@transferwise/components 46.13.0 → 46.14.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.
Files changed (126) hide show
  1. package/build/index.esm.js +175 -346
  2. package/build/index.esm.js.map +1 -1
  3. package/build/index.js +148 -319
  4. package/build/index.js.map +1 -1
  5. package/build/main.css +6 -82
  6. package/build/styles/decision/Decision.css +6 -82
  7. package/build/styles/main.css +6 -82
  8. package/build/types/body/Body.d.ts +1 -1
  9. package/build/types/common/commonProps.d.ts +1 -1
  10. package/build/types/common/commonProps.d.ts.map +1 -1
  11. package/build/types/common/dateUtils/getDayNames/getDayNames.d.ts +1 -1
  12. package/build/types/common/dateUtils/getDayNames/getDayNames.d.ts.map +1 -1
  13. package/build/types/common/dateUtils/getDayNames/index.d.ts +1 -1
  14. package/build/types/common/dateUtils/getDayNames/index.d.ts.map +1 -1
  15. package/build/types/common/dateUtils/getMonthNames/getMonthNames.d.ts +1 -1
  16. package/build/types/common/dateUtils/getMonthNames/getMonthNames.d.ts.map +1 -1
  17. package/build/types/common/dateUtils/getMonthNames/index.d.ts +1 -1
  18. package/build/types/common/dateUtils/getMonthNames/index.d.ts.map +1 -1
  19. package/build/types/common/dateUtils/index.d.ts +6 -6
  20. package/build/types/common/dateUtils/index.d.ts.map +1 -1
  21. package/build/types/common/dateUtils/isDateValid/index.d.ts +1 -1
  22. package/build/types/common/dateUtils/isDateValid/index.d.ts.map +1 -1
  23. package/build/types/common/dateUtils/isDateValid/isDateValid.d.ts +2 -2
  24. package/build/types/common/dateUtils/isDateValid/isDateValid.d.ts.map +1 -1
  25. package/build/types/common/dateUtils/isMonthAndYearFormat/index.d.ts +1 -1
  26. package/build/types/common/dateUtils/isMonthAndYearFormat/index.d.ts.map +1 -1
  27. package/build/types/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.d.ts +1 -1
  28. package/build/types/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.d.ts.map +1 -1
  29. package/build/types/common/dateUtils/isWithinRange/index.d.ts +1 -1
  30. package/build/types/common/dateUtils/isWithinRange/index.d.ts.map +1 -1
  31. package/build/types/common/dateUtils/isWithinRange/isWithinRange.d.ts +1 -1
  32. package/build/types/common/dateUtils/isWithinRange/isWithinRange.d.ts.map +1 -1
  33. package/build/types/common/dateUtils/moveToWithinRange/index.d.ts +1 -1
  34. package/build/types/common/dateUtils/moveToWithinRange/index.d.ts.map +1 -1
  35. package/build/types/common/dateUtils/moveToWithinRange/moveToWithinRange.d.ts +1 -1
  36. package/build/types/common/dateUtils/moveToWithinRange/moveToWithinRange.d.ts.map +1 -1
  37. package/build/types/common/panel/Panel.d.ts +1 -1
  38. package/build/types/common/responsivePanel/ResponsivePanel.d.ts +1 -1
  39. package/build/types/dateInput/DateInput.d.ts +30 -41
  40. package/build/types/dateInput/DateInput.d.ts.map +1 -1
  41. package/build/types/dateInput/DateInput.messages.d.ts +24 -33
  42. package/build/types/dateInput/DateInput.messages.d.ts.map +1 -1
  43. package/build/types/dateInput/index.d.ts +2 -2
  44. package/build/types/dateInput/index.d.ts.map +1 -1
  45. package/build/types/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.d.ts +1 -1
  46. package/build/types/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.d.ts.map +1 -1
  47. package/build/types/dateInput/utils/convertToLocalMidnight/index.d.ts +1 -1
  48. package/build/types/dateInput/utils/convertToLocalMidnight/index.d.ts.map +1 -1
  49. package/build/types/dateInput/utils/index.d.ts +1 -2
  50. package/build/types/dateInput/utils/index.d.ts.map +1 -1
  51. package/build/types/dateLookup/DateLookup.d.ts +1 -0
  52. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  53. package/build/types/decision/Decision.d.ts +39 -52
  54. package/build/types/decision/Decision.d.ts.map +1 -1
  55. package/build/types/decision/index.d.ts +1 -2
  56. package/build/types/decision/index.d.ts.map +1 -1
  57. package/build/types/dimmer/Dimmer.d.ts +1 -1
  58. package/build/types/index.d.ts +2 -0
  59. package/build/types/index.d.ts.map +1 -1
  60. package/build/types/promoCard/PromoCard.d.ts +1 -2
  61. package/build/types/promoCard/PromoCard.d.ts.map +1 -1
  62. package/build/types/select/searchBox/SearchBox.d.ts +1 -1
  63. package/package.json +1 -1
  64. package/src/common/commonProps.ts +1 -1
  65. package/src/common/dateUtils/getDayNames/getDayNames.spec.js +2 -2
  66. package/src/common/dateUtils/getDayNames/{getDayNames.js → getDayNames.ts} +5 -2
  67. package/src/common/dateUtils/getMonthNames/getMonthNames.spec.js +9 -8
  68. package/src/common/dateUtils/getMonthNames/{getMonthNames.js → getMonthNames.ts} +5 -3
  69. package/src/common/dateUtils/isDateValid/{isDateValid.spec.js → isDateValid.spec.ts} +1 -1
  70. package/src/common/dateUtils/isDateValid/isDateValid.ts +13 -0
  71. package/src/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.spec.js +3 -7
  72. package/src/common/dateUtils/isMonthAndYearFormat/{isMonthAndYearFormat.js → isMonthAndYearFormat.ts} +1 -1
  73. package/src/common/dateUtils/isWithinRange/{isWithinRange.spec.js → isWithinRange.spec.ts} +0 -10
  74. package/src/common/dateUtils/isWithinRange/{isWithinRange.js → isWithinRange.ts} +1 -1
  75. package/src/common/dateUtils/moveToWithinRange/{moveToWithinRange.js → moveToWithinRange.ts} +2 -2
  76. package/src/dateInput/DateInput.spec.js +7 -56
  77. package/src/dateInput/DateInput.story.tsx +11 -8
  78. package/src/dateInput/{DateInput.js → DateInput.tsx} +116 -123
  79. package/src/dateInput/index.ts +2 -0
  80. package/src/dateInput/utils/convertToLocalMidnight/{convertToLocalMidnight.js → convertToLocalMidnight.ts} +1 -1
  81. package/src/dateInput/utils/{index.js → index.ts} +0 -1
  82. package/src/dateLookup/DateLookup.js +12 -1
  83. package/src/dateLookup/DateLookup.testingLibrary.spec.js +12 -1
  84. package/src/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -0
  85. package/src/decision/Decision.css +6 -82
  86. package/src/decision/Decision.less +3 -41
  87. package/src/decision/Decision.spec.js +56 -61
  88. package/src/decision/{Decision.story.js → Decision.story.tsx} +5 -5
  89. package/src/decision/Decision.tsx +133 -0
  90. package/src/decision/index.ts +1 -0
  91. package/src/index.ts +2 -0
  92. package/src/main.css +6 -82
  93. package/src/promoCard/PromoCard.tsx +1 -2
  94. package/src/tile/Tile.js +1 -1
  95. package/build/types/dateInput/utils/explodeDate/explodeDate.d.ts +0 -6
  96. package/build/types/dateInput/utils/explodeDate/explodeDate.d.ts.map +0 -1
  97. package/build/types/dateInput/utils/explodeDate/index.d.ts +0 -2
  98. package/build/types/dateInput/utils/explodeDate/index.d.ts.map +0 -1
  99. package/build/types/decision/decisionEnums.d.ts +0 -9
  100. package/build/types/decision/decisionEnums.d.ts.map +0 -1
  101. package/build/types/sizeSwapper/SizeSwapper.d.ts +0 -3
  102. package/build/types/sizeSwapper/SizeSwapper.d.ts.map +0 -1
  103. package/build/types/sizeSwapper/index.d.ts +0 -2
  104. package/build/types/sizeSwapper/index.d.ts.map +0 -1
  105. package/src/common/dateUtils/isDateValid/isDateValid.js +0 -6
  106. package/src/dateInput/index.js +0 -3
  107. package/src/dateInput/utils/explodeDate/explodeDate.js +0 -7
  108. package/src/dateInput/utils/explodeDate/explodeDate.spec.js +0 -11
  109. package/src/dateInput/utils/explodeDate/index.js +0 -1
  110. package/src/decision/Decision.js +0 -148
  111. package/src/decision/decisionEnums.ts +0 -11
  112. package/src/decision/index.js +0 -2
  113. package/src/sizeSwapper/SizeSwapper.js +0 -69
  114. package/src/sizeSwapper/SizeSwapper.spec.js +0 -100
  115. package/src/sizeSwapper/SizeSwapper.story.js +0 -34
  116. package/src/sizeSwapper/index.js +0 -1
  117. /package/src/common/dateUtils/getDayNames/{index.js → index.ts} +0 -0
  118. /package/src/common/dateUtils/getMonthNames/{index.js → index.ts} +0 -0
  119. /package/src/common/dateUtils/{index.js → index.ts} +0 -0
  120. /package/src/common/dateUtils/isDateValid/{index.js → index.ts} +0 -0
  121. /package/src/common/dateUtils/isMonthAndYearFormat/{index.js → index.ts} +0 -0
  122. /package/src/common/dateUtils/isWithinRange/{index.js → index.ts} +0 -0
  123. /package/src/common/dateUtils/moveToWithinRange/{index.js → index.ts} +0 -0
  124. /package/src/dateInput/{DateInput.messages.js → DateInput.messages.ts} +0 -0
  125. /package/src/dateInput/utils/convertToLocalMidnight/{convertToLocalMidnight.spec.js → convertToLocalMidnight.spec.ts} +0 -0
  126. /package/src/dateInput/utils/convertToLocalMidnight/{index.js → index.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.messages.d.ts","sourceRoot":"","sources":["../../../src/dateInput/DateInput.messages.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"DateInput.messages.d.ts","sourceRoot":"","sources":["../../../src/dateInput/DateInput.messages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAuBG"}
@@ -1,3 +1,3 @@
1
- export default DateInput;
2
- import DateInput from "./DateInput";
1
+ export { default } from './DateInput';
2
+ export type { DateInputProps } from './DateInput';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dateInput/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dateInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -1,2 +1,2 @@
1
- export function convertToLocalMidnight(date: any): Date;
1
+ export declare const convertToLocalMidnight: (date: string) => Date;
2
2
  //# sourceMappingURL=convertToLocalMidnight.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"convertToLocalMidnight.d.ts","sourceRoot":"","sources":["../../../../../src/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js"],"names":[],"mappings":"AAAO,wDAIN"}
1
+ {"version":3,"file":"convertToLocalMidnight.d.ts","sourceRoot":"","sources":["../../../../../src/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,SAAU,MAAM,SAIlD,CAAC"}
@@ -1,2 +1,2 @@
1
- export { convertToLocalMidnight } from "./convertToLocalMidnight";
1
+ export { convertToLocalMidnight } from './convertToLocalMidnight';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dateInput/utils/convertToLocalMidnight/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dateInput/utils/convertToLocalMidnight/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,3 +1,2 @@
1
- export { explodeDate } from "./explodeDate";
2
- export { convertToLocalMidnight } from "./convertToLocalMidnight";
1
+ export { convertToLocalMidnight } from './convertToLocalMidnight';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dateInput/utils/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dateInput/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -11,6 +11,7 @@ export interface DateLookupProps {
11
11
  size?: DateLookupSize;
12
12
  placeholder?: string;
13
13
  label?: string;
14
+ "aria-labelledby"?: string;
14
15
  monthFormat?: DateLookupMonthFormat;
15
16
  disabled?: boolean;
16
17
  onChange: (...args: any[])=>any;
@@ -1 +1 @@
1
- {"version":3,"file":"DateLookup.d.ts","sourceRoot":"","sources":["../../../src/dateLookup/DateLookup.js"],"names":[],"mappings":";AAoBA;IAoBE;;;;;;aAqBC;IApCD,wBAaC;IAjBD,wCAAsB;IAEtB,yCAAuB;IAIrB;;;;;;;;;;MAUC;IA0BH,6CAMC;IAFC,uCAAyE;IAI3E,6BAGC;IAED,iBAOE;IAEF,oBAME;IAEF,kBAME;IAEF,oCA6CE;IAEF,wEAmBE;IAEF,+DAOE;IAEF,gCAIE;IAEF,yBAA+C;IAE/C,2BAAmD;IAEnD,0BAAiD;IAEjD,sDAME;IAEF;;;eAEE;IAEF,+CA8BE;IAEF,wBAGE;IAEF,sCA0BC;CACF"}
1
+ {"version":3,"file":"DateLookup.d.ts","sourceRoot":"","sources":["../../../src/dateLookup/DateLookup.js"],"names":[],"mappings":";AAoBA;IAoBE;;;;;;aAqBC;IApCD,wBAaC;IAjBD,wCAAsB;IAEtB,yCAAuB;IAIrB;;;;;;;;;;MAUC;IA0BH,6CAMC;IAFC,uCAAyE;IAI3E,6BAGC;IAED,iBAOE;IAEF,oBAME;IAEF,kBAME;IAEF,oCA6CE;IAEF,wEAmBE;IAEF,+DAOE;IAEF,gCAIE;IAEF,yBAA+C;IAE/C,2BAAmD;IAEnD,0BAAiD;IAEjD,sDAME;IAEF;;;eAEE;IAEF,+CA8BE;IAEF,wBAGE;IAEF,sCAoCC;CACF"}
@@ -1,52 +1,39 @@
1
- import * as React from 'react';
2
-
3
- export interface DecisionOptions {
4
- description?: React.ReactNode;
5
- disabled?: boolean;
6
- href?: string;
7
- target?: "_self" | "_blank" | "_parent" | "_top";
8
- media?: {
9
- block: React.ReactNode;
10
- list: React.ReactNode;
11
- };
12
- onClick?: (...args: any[])=>any;
13
- title: React.ReactNode;
14
- }
15
-
16
- export type DecisionPresentation = "LIST" | "LIST_BLOCK" | "LIST_BLOCK_GRID";
17
-
18
- export type DecisionSize = "sm" | "md";
19
-
20
- export type DecisionType = "NAVIGATION";
21
-
22
- export interface DecisionProps {
23
- /**
24
- * A list of elements to be rendered
25
- */
26
- options: DecisionOptions[];
27
- /**
28
- * Handles the display mode of the component
29
- */
30
- presentation?: DecisionPresentation;
31
- /**
32
- * Size currently affects only Tile dimension
33
- */
34
- size?: DecisionSize;
35
- /**
36
- * Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options
37
- */
38
- type?: DecisionType;
39
- /**
40
- * Display media in a circle in list presentation
41
- */
42
- showMediaCircleInList?: boolean;
43
- /**
44
- * Sets navigation options to be aligned with the parent container
45
- */
46
- isContainerAligned?: boolean;
47
- }
48
-
49
- declare const Decision: React.FC<DecisionProps>;
50
-
51
- export default Decision;
52
-
1
+ /// <reference types="react" />
2
+ import { SizeSmall, SizeMedium } from '../common';
3
+ interface DecisionOption {
4
+ description?: React.ReactNode;
5
+ disabled?: boolean;
6
+ href?: string;
7
+ target?: React.HTMLAttributeAnchorTarget;
8
+ media: {
9
+ block: React.ReactNode;
10
+ list: React.ReactNode;
11
+ };
12
+ onClick?: React.MouseEventHandler<HTMLElement>;
13
+ title: React.ReactNode;
14
+ }
15
+ export declare enum DecisionPresentation {
16
+ LIST = "LIST",
17
+ LIST_BLOCK = "LIST_BLOCK",
18
+ LIST_BLOCK_GRID = "LIST_BLOCK_GRID"
19
+ }
20
+ export declare enum DecisionType {
21
+ NAVIGATION = "NAVIGATION"
22
+ }
23
+ export interface DecisionProps {
24
+ /** A list of elements to be rendered */
25
+ options: DecisionOption[];
26
+ /** Handles the display mode of the component */
27
+ presentation?: `${DecisionPresentation}`;
28
+ /** Size currently affects only Tile dimension */
29
+ size?: SizeSmall | SizeMedium;
30
+ /** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */
31
+ type?: `${DecisionType}`;
32
+ /** Display media in a circle in list presentation */
33
+ showMediaCircleInList?: boolean;
34
+ /** Sets navigation options to be aligned with the parent container */
35
+ isContainerAligned?: boolean;
36
+ }
37
+ declare const Decision: ({ options, presentation, size, type, showMediaCircleInList, isContainerAligned, }: DecisionProps) => import("react").JSX.Element | null;
38
+ export default Decision;
39
+ //# sourceMappingURL=Decision.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Decision.d.ts","sourceRoot":"","sources":["../../../src/decision/Decision.js"],"names":[],"mappings":";AAUA;;;;;;;QAiGC"}
1
+ {"version":3,"file":"Decision.d.ts","sourceRoot":"","sources":["../../../src/decision/Decision.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAoB,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKpE,UAAU,cAAc;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC;IACzC,KAAK,EAAE;QACL,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;KACvB,CAAC;IACF,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC/C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,eAAe,oBAAoB;CACpC;AAED,oBAAY,YAAY;IACtB,UAAU,eAAe;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,iDAAiD;IACjD,YAAY,CAAC,EAAE,GAAG,oBAAoB,EAAE,CAAC;IACzC,iDAAiD;IACjD,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9B,+HAA+H;IAC/H,IAAI,CAAC,EAAE,GAAG,YAAY,EAAE,CAAC;IAEzB,qDAAqD;IACrD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,QAAA,MAAM,QAAQ,sFAOX,aAAa,uCA4Ef,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,3 +1,2 @@
1
- export { default } from "./Decision";
2
- export { Presentation as DecisionPresentation, Type as DecisionType } from "./decisionEnums";
1
+ export { default, DecisionPresentation, DecisionType } from './Decision';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decision/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decision/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
@@ -22,7 +22,7 @@ export { Dimmer };
22
22
  declare const _default: (props: CommonProps & {
23
23
  children?: ReactNode;
24
24
  disableClickToClose?: boolean | undefined;
25
- contentPosition?: "center" | "bottom" | "top" | undefined;
25
+ contentPosition?: "top" | "bottom" | "center" | undefined;
26
26
  fadeContentOnEnter?: boolean | undefined;
27
27
  fadeContentOnExit?: boolean | undefined;
28
28
  open?: boolean | undefined;
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * Types
3
3
  */
4
+ export type { DecisionProps } from './decision/Decision';
4
5
  export type { InputProps } from './inputs/Input';
6
+ export type { DateInputProps } from './dateInput';
5
7
  export type { InputWithDisplayFormatProps } from './inputWithDisplayFormat';
6
8
  export type { InputGroupProps } from './inputs/InputGroup';
7
9
  export type { SearchInputProps } from './inputs/SearchInput';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,6BAA6B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
3
3
  import { PromoCardIndicatorProps } from './PromoCardIndicator';
4
4
  export type ReferenceType = React.Ref<HTMLInputElement>;
5
- export type LinkTarget = '_blank' | '_parent' | '_self' | '_top';
6
5
  export type RelatedTypes = '' | 'alternate' | 'author' | 'bookmark' | 'external' | 'help' | 'license' | 'next' | 'nofollow' | 'noreferrer' | 'noopener' | 'prev' | 'search' | 'tag';
7
6
  export interface PromoCardCommonProps {
8
7
  /** Optional prop to specify classNames onto the PromoCard */
@@ -54,7 +53,7 @@ export interface PromoCardLinkProps extends PromoCardCommonProps, Omit<CardProps
54
53
  */
55
54
  rel?: RelatedTypes;
56
55
  /** Optional prop to to display where the linked URL will show */
57
- target?: LinkTarget;
56
+ target?: React.HTMLAttributeAnchorTarget;
58
57
  /** Only applies to role="radio" or "checkbox" */
59
58
  defaultChecked?: never;
60
59
  isChecked?: never;
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCard.d.ts","sourceRoot":"","sources":["../../../src/promoCard/PromoCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAIhG,OAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAA2B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AACjE,MAAM,MAAM,YAAY,GACpB,EAAE,GACF,WAAW,GACX,QAAQ,GACR,UAAU,GACV,UAAU,GACV,MAAM,GACN,SAAS,GACT,MAAM,GACN,UAAU,GACV,YAAY,GACZ,UAAU,GACV,MAAM,GACN,QAAQ,GACR,KAAK,CAAC;AAEV,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uDAAuD;IACvD,EAAE,CAAC,EAA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,yBAAyB,CAAC;IAEzC,iDAAiD;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC9F,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,iDAAiD;IACjD,SAAS,CAAC,EAAE,aAAa,CAAC;IAE1B,gEAAgE;IAChE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAE5B,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAExE,MAAM,MAAM,oBAAoB,GAAG,CACjC,KAAK,EAAE,kBAAkB,GAAG,qBAAqB,KAC9C,GAAG,CAAC,OAAO,CAAC;;AAmOjB,wBAAqC"}
@@ -3,6 +3,6 @@ declare const SearchBox: import("react").ForwardRefExoticComponent<{
3
3
  id?: string | undefined;
4
4
  classNames?: Record<string, string> | undefined;
5
5
  focusedOptionId?: string | undefined;
6
- } & Pick<InputHTMLAttributes<HTMLInputElement>, "value" | "placeholder" | "onChange" | "onClick"> & import("react").RefAttributes<HTMLInputElement>>;
6
+ } & Pick<InputHTMLAttributes<HTMLInputElement>, "placeholder" | "onChange" | "onClick" | "value"> & import("react").RefAttributes<HTMLInputElement>>;
7
7
  export default SearchBox;
8
8
  //# sourceMappingURL=SearchBox.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.13.0",
3
+ "version": "46.14.0",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,7 +14,7 @@ export type AriaLabelProperty = {
14
14
 
15
15
  export type LinkProps = {
16
16
  href: string;
17
- target?: '_blank' | '_self' | '_parent' | '_top';
17
+ target?: React.HTMLAttributeAnchorTarget;
18
18
  onClick?: React.MouseEventHandler<HTMLElement>;
19
19
  };
20
20
 
@@ -6,11 +6,11 @@ jest.mock('@transferwise/formatting', () => ({
6
6
 
7
7
  describe('getDayNames', () => {
8
8
  it('returns all weekdays', () => {
9
- expect(getDayNames()).toHaveLength(7);
9
+ expect(getDayNames('en')).toHaveLength(7);
10
10
  });
11
11
 
12
12
  it('starts with Monday and ends with Sunday', () => {
13
- const days = getDayNames();
13
+ const days = getDayNames('en');
14
14
  expect(days[0]).toBe(1);
15
15
  expect(days[days.length - 1]).toBe(0);
16
16
  });
@@ -1,7 +1,10 @@
1
1
  import { formatDate } from '@transferwise/formatting';
2
2
 
3
- export function getDayNames(locale, format = 'short') {
4
- const days = [];
3
+ export function getDayNames(
4
+ locale: string,
5
+ format: Intl.DateTimeFormatOptions['weekday'] = 'short',
6
+ ) {
7
+ const days: string[] = [];
5
8
  const date = new Date(2018, 0, 1); // 2018 started with Monday
6
9
  while (days.length < 7) {
7
10
  days.push(formatDate(date, locale, { weekday: format }));
@@ -1,8 +1,4 @@
1
- import { getMonthNames } from '..';
2
-
3
- jest.mock('@transferwise/formatting', () => ({
4
- formatDate: (month) => month.getMonth(),
5
- }));
1
+ import { getMonthNames } from './getMonthNames';
6
2
 
7
3
  describe('getMonthNames', () => {
8
4
  it('returns all months', () => {
@@ -10,8 +6,13 @@ describe('getMonthNames', () => {
10
6
  });
11
7
 
12
8
  it('starts with January and ends with December', () => {
13
- const months = getMonthNames();
14
- expect(months[0]).toBe(0);
15
- expect(months[months.length - 1]).toBe(11);
9
+ const months = getMonthNames('en', 'long');
10
+ expect(months[0]).toBe('January');
11
+ expect(months.at(-1)).toBe('December');
12
+ });
13
+
14
+ it('gets localized month names', () => {
15
+ const months = getMonthNames('fr', 'long');
16
+ expect(months[0]).toBe('janvier');
16
17
  });
17
18
  });
@@ -1,13 +1,15 @@
1
1
  import { formatDate } from '@transferwise/formatting';
2
2
 
3
- export const getMonthNames = (locale, format = 'long') => {
4
- const months = [];
3
+ export const getMonthNames = (
4
+ locale: string,
5
+ format: Intl.DateTimeFormatOptions['month'] = 'long',
6
+ ): string[] => {
7
+ const months: string[] = [];
5
8
  const date = new Date(2018, 0, 1);
6
9
  const monthFormat = { month: format };
7
10
  while (months.length < 12) {
8
11
  months.push(formatDate(date, locale, monthFormat));
9
12
  date.setMonth(date.getMonth() + 1);
10
13
  }
11
-
12
14
  return months;
13
15
  };
@@ -1,4 +1,4 @@
1
- import { isDateValid } from '.';
1
+ import { isDateValid } from '..';
2
2
 
3
3
  describe('isDateValid', () => {
4
4
  it('should return false for invalid format', () => {
@@ -0,0 +1,13 @@
1
+ export const isDateValid = (date: Date | string | null) => {
2
+ if (date === null) {
3
+ return false;
4
+ } else if (date instanceof Date) {
5
+ return validDateObject(date);
6
+ } else {
7
+ return validDateString(date);
8
+ }
9
+ };
10
+
11
+ export const validDateString = (dateString: string) => validDateObject(new Date(dateString));
12
+
13
+ const validDateObject = (dateObject: Date) => !isNaN(dateObject.getTime());
@@ -1,15 +1,11 @@
1
- import { isMonthAndYearFormat } from '.';
1
+ import { isMonthAndYearFormat } from '..';
2
2
 
3
3
  describe('isDateValid', () => {
4
- it('should return false if day is provided', () => {
4
+ it('should return false if day is provided as string', () => {
5
5
  expect(isMonthAndYearFormat('1998-02-04')).toBe(false);
6
6
  });
7
7
 
8
- it('should return true if day is not provided', () => {
8
+ it('should return true if day is not provided as string', () => {
9
9
  expect(isMonthAndYearFormat('1998-02')).toBe(true);
10
10
  });
11
-
12
- it('should return false if argument provided is not a string', () => {
13
- expect(isMonthAndYearFormat([])).toBe(false);
14
- });
15
11
  });
@@ -1,4 +1,4 @@
1
1
  import { validDateString } from '../isDateValid';
2
2
 
3
- export const isMonthAndYearFormat = (dateString) =>
3
+ export const isMonthAndYearFormat = (dateString: string) =>
4
4
  validDateString(dateString) && dateString.split('-').length < 3;
@@ -1,14 +1,6 @@
1
1
  import { isWithinRange } from '..';
2
2
 
3
3
  describe('isWithinRange', () => {
4
- it('returns true when no dates are provided', () => {
5
- expect(isWithinRange()).toBe(true);
6
- });
7
-
8
- it('returns true when no min and max', () => {
9
- expect(isWithinRange(new Date())).toBe(true);
10
- });
11
-
12
4
  it('returns true when date is between min and max', () => {
13
5
  const date = new Date('1995-12-20');
14
6
  const min = new Date('1995-12-19');
@@ -27,7 +19,6 @@ describe('isWithinRange', () => {
27
19
  const date = new Date('1995-12-20');
28
20
  const min = new Date('1995-12-21');
29
21
  const max = new Date('1995-12-22');
30
- expect(isWithinRange(date, min)).toBe(false);
31
22
  expect(isWithinRange(date, min, max)).toBe(false);
32
23
  });
33
24
 
@@ -35,7 +26,6 @@ describe('isWithinRange', () => {
35
26
  const date = new Date('1995-12-23');
36
27
  const min = new Date('1995-12-20');
37
28
  const max = new Date('1995-12-22');
38
- expect(isWithinRange(date, null, max)).toBe(false);
39
29
  expect(isWithinRange(date, min, max)).toBe(false);
40
30
  });
41
31
  });
@@ -1,3 +1,3 @@
1
- export function isWithinRange(date, min, max) {
1
+ export function isWithinRange(date: Date, min: Date, max: Date) {
2
2
  return !date || ((!min || date >= min) && (!max || date <= max));
3
3
  }
@@ -1,6 +1,6 @@
1
- import { isWithinRange } from '../isWithinRange';
1
+ import { isWithinRange } from '..';
2
2
 
3
3
  // Makes sure that date is between min and max dates, returns a cloned min or max
4
- export function moveToWithinRange(date, min, max) {
4
+ export function moveToWithinRange(date: Date, min: Date, max: Date) {
5
5
  return isWithinRange(date, min, max) ? date : new Date(min && date < min ? +min : +max);
6
6
  }
@@ -4,44 +4,12 @@ import { useIntl } from 'react-intl';
4
4
  import { DateInput, Input } from '..';
5
5
  import { mockMatchMedia, mockResizeObserver } from '../test-utils';
6
6
 
7
- const MONTHS_FR = [
8
- 'janvier',
9
- 'février',
10
- 'mars',
11
- 'avril',
12
- 'mai',
13
- 'juin',
14
- 'juillet',
15
- 'août',
16
- 'septembre',
17
- 'octobre',
18
- 'novembre',
19
- 'décembre',
20
- ];
21
-
22
- const MONTHS_EN = [
23
- 'January',
24
- 'February',
25
- 'March',
26
- 'April',
27
- 'May',
28
- 'June',
29
- 'July',
30
- 'August',
31
- 'September',
32
- 'October',
33
- 'November',
34
- 'December',
35
- ];
36
-
37
7
  const LOCALES = {
38
- fr: 'fr-FR',
39
8
  jp: 'ja-JP',
40
9
  };
41
-
42
10
  const DEFAULT_LOCALE = 'en-GB';
43
-
44
- const FEBRUARY_OPTION = { value: MONTHS_EN[1] };
11
+ const FEBRUARY_INDEX = 1;
12
+ const AUGUST_INDEX = 7;
45
13
 
46
14
  const DAY_SELECTOR = 'ForwardRef(Input)[name="day"]';
47
15
  const MONTH_SELECTOR = 'SelectInput';
@@ -73,12 +41,6 @@ jest.mock('./DateInput.messages', () => ({
73
41
  }));
74
42
 
75
43
  jest.mock('react-intl');
76
- jest.mock('@transferwise/formatting', () => {
77
- return {
78
- formatDate: (month, locale) =>
79
- locale === LOCALES.fr ? MONTHS_FR[month.getMonth()] : MONTHS_EN[month.getMonth()],
80
- };
81
- });
82
44
 
83
45
  describe('Date Input Component', () => {
84
46
  let selectMonth;
@@ -111,7 +73,7 @@ describe('Date Input Component', () => {
111
73
  });
112
74
 
113
75
  it('sets month field to 0', () => {
114
- expect(selectMonth.props().value).toBeUndefined();
76
+ expect(selectMonth.props().value).toBeNull();
115
77
  });
116
78
 
117
79
  it('sets year field to empty', () => {
@@ -143,7 +105,7 @@ describe('Date Input Component', () => {
143
105
  inputYear = component.find(YEAR_SELECTOR);
144
106
 
145
107
  expect(inputDay.prop('value')).toBe(1);
146
- expect(selectMonth.prop('value').label).toBe(FEBRUARY_OPTION.value);
108
+ expect(selectMonth.prop('value')).toBe(FEBRUARY_INDEX);
147
109
  expect(inputYear.prop('value')).toBe(1971);
148
110
  });
149
111
  });
@@ -157,7 +119,7 @@ describe('Date Input Component', () => {
157
119
  inputYear = component.find(YEAR_SELECTOR);
158
120
 
159
121
  expect(inputDay.prop('value')).toBe(22);
160
- expect(selectMonth.prop('value').label).toBe(MONTHS_EN[7]);
122
+ expect(selectMonth.prop('value')).toBe(AUGUST_INDEX);
161
123
  expect(inputYear.prop('value')).toBe(1990);
162
124
  });
163
125
  });
@@ -171,7 +133,7 @@ describe('Date Input Component', () => {
171
133
  inputYear = component.find(YEAR_SELECTOR);
172
134
 
173
135
  expect(inputDay.prop('value')).toBe('');
174
- expect(selectMonth.prop('value').label).toBe(MONTHS_EN[7]);
136
+ expect(selectMonth.prop('value')).toBe(AUGUST_INDEX);
175
137
  expect(inputYear.prop('value')).toBe(1990);
176
138
  });
177
139
  });
@@ -185,7 +147,7 @@ describe('Date Input Component', () => {
185
147
  inputYear = component.find(YEAR_SELECTOR);
186
148
 
187
149
  expect(inputDay.prop('value')).toBe(28);
188
- expect(selectMonth.prop('value').label).toBe(FEBRUARY_OPTION.value);
150
+ expect(selectMonth.prop('value')).toBe(FEBRUARY_INDEX);
189
151
  expect(inputYear.prop('value')).toBe(1990);
190
152
  });
191
153
  });
@@ -220,17 +182,6 @@ describe('Date Input Component', () => {
220
182
  });
221
183
 
222
184
  describe('when locale is provided', () => {
223
- it('updates selectMonth based on locale', () => {
224
- useIntl.mockReturnValue({
225
- locale: LOCALES.fr,
226
- formatMessage: (message) => message.defaultMessage,
227
- });
228
- component = shallow(<DateInput {...props} />);
229
- selectMonth = component.find(MONTH_SELECTOR);
230
-
231
- expect(selectMonth.props().items[0].value.label).toStrictEqual(MONTHS_FR[0]);
232
- });
233
-
234
185
  it('shows day before month if locale not US', () => {
235
186
  component = shallow(<DateInput {...props} />);
236
187
 
@@ -1,9 +1,12 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
  import { userEvent, within } from '@storybook/test';
3
+ import * as React from 'react';
3
4
 
4
- import { DateInput, Info, InlineAlert, Title, Typography } from '..';
5
+ import { DateInput, DateMode, Info, InlineAlert, Title, Typography } from '..';
5
6
  import { lorem10, storyConfig } from '../test-utils';
6
7
 
8
+ import { DateInputProps } from './DateInput';
9
+
7
10
  export default {
8
11
  component: DateInput,
9
12
  title: 'Forms/DateInput',
@@ -14,17 +17,15 @@ export default {
14
17
  yearLabel: 'Year input',
15
18
  yearAutoComplete: 'bday-year',
16
19
  selectProps: {
17
- buttonProps: {
18
- 'aria-label': 'Select month',
19
- },
20
+ placeholder: 'Month',
20
21
  },
21
22
  },
22
23
  tags: ['autodocs'],
23
24
  } satisfies Meta<typeof DateInput>;
24
25
 
25
- type Story = StoryObj<typeof DateInput>;
26
+ type Story = StoryObj<DateInputProps>;
26
27
 
27
- export const Basic: Story = {};
28
+ export const Basic: StoryObj = {};
28
29
 
29
30
  Basic.play = async ({ canvasElement }) => {
30
31
  const canvas = within(canvasElement);
@@ -65,8 +66,10 @@ export const WithLabel: Story = {
65
66
  label (rare use case)
66
67
  </Title>
67
68
  <fieldset>
68
- <legend className="control-label">Expiry Date</legend>
69
- <DateInput {...args} />
69
+ <legend className="control-label">
70
+ Expiry Date for Credit Card (example of MONTH_YEAR mode)
71
+ </legend>
72
+ <DateInput {...args} mode={DateMode.MONTH_YEAR} />
70
73
  </fieldset>
71
74
  </>
72
75
  );