@transferwise/components 0.0.0-experimental-adcaf57 → 0.0.0-experimental-2118ad7

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 (49) hide show
  1. package/build/index.esm.js +142 -68
  2. package/build/index.esm.js.map +1 -1
  3. package/build/index.js +143 -69
  4. package/build/index.js.map +1 -1
  5. package/build/types/common/textFormat/formatWithPattern/formatWithPattern.d.ts +1 -1
  6. package/build/types/common/textFormat/formatWithPattern/formatWithPattern.d.ts.map +1 -1
  7. package/build/types/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.d.ts +1 -2
  8. package/build/types/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.d.ts.map +1 -1
  9. package/build/types/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.d.ts +1 -5
  10. package/build/types/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.d.ts.map +1 -1
  11. package/build/types/common/textFormat/unformatWithPattern/unformatWithPattern.d.ts +1 -1
  12. package/build/types/common/textFormat/unformatWithPattern/unformatWithPattern.d.ts.map +1 -1
  13. package/build/types/index.d.ts +0 -2
  14. package/build/types/index.d.ts.map +1 -1
  15. package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts +11 -5
  16. package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts.map +1 -1
  17. package/build/types/inputWithDisplayFormat/index.d.ts +1 -2
  18. package/build/types/inputWithDisplayFormat/index.d.ts.map +1 -1
  19. package/build/types/inputs/Input.d.ts +6 -8
  20. package/build/types/inputs/Input.d.ts.map +1 -1
  21. package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts +11 -5
  22. package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts.map +1 -1
  23. package/build/types/textareaWithDisplayFormat/index.d.ts +1 -2
  24. package/build/types/textareaWithDisplayFormat/index.d.ts.map +1 -1
  25. package/build/types/withDisplayFormat/WithDisplayFormat.d.ts +82 -55
  26. package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
  27. package/build/types/withDisplayFormat/index.d.ts +1 -2
  28. package/build/types/withDisplayFormat/index.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/common/textFormat/formatWithPattern/{formatWithPattern.ts → formatWithPattern.js} +4 -8
  31. package/src/common/textFormat/getCursorPositionAfterKeystroke/{getCursorPositionAfterKeystroke.ts → getCursorPositionAfterKeystroke.js} +6 -7
  32. package/src/common/textFormat/getSymbolsInPatternWithPosition/{getSymbolsInPatternWithPosition.ts → getSymbolsInPatternWithPosition.js} +2 -7
  33. package/src/common/textFormat/unformatWithPattern/{unformatWithPattern.ts → unformatWithPattern.js} +2 -3
  34. package/src/index.ts +0 -2
  35. package/src/inputWithDisplayFormat/InputWithDisplayFormat.js +14 -0
  36. package/src/inputWithDisplayFormat/index.js +1 -0
  37. package/src/inputs/Input.tsx +11 -6
  38. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +14 -0
  39. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.spec.js +1 -3
  40. package/src/textareaWithDisplayFormat/index.js +1 -0
  41. package/src/withDisplayFormat/WithDisplayFormat.js +312 -0
  42. package/src/withDisplayFormat/index.js +1 -0
  43. package/src/inputWithDisplayFormat/InputWithDisplayFormat.tsx +0 -11
  44. package/src/inputWithDisplayFormat/index.ts +0 -2
  45. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +0 -30
  46. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.tsx +0 -11
  47. package/src/textareaWithDisplayFormat/index.ts +0 -2
  48. package/src/withDisplayFormat/WithDisplayFormat.tsx +0 -303
  49. package/src/withDisplayFormat/index.ts +0 -2
@@ -1,3 +1,3 @@
1
- declare const formatWithPattern: (value: string, pattern: string) => string;
2
1
  export default formatWithPattern;
2
+ declare function formatWithPattern(value: any, pattern: any): any;
3
3
  //# sourceMappingURL=formatWithPattern.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatWithPattern.d.ts","sourceRoot":"","sources":["../../../../../src/common/textFormat/formatWithPattern/formatWithPattern.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,iBAAiB,UAAW,MAAM,WAAW,MAAM,KAAG,MAuB3D,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"formatWithPattern.d.ts","sourceRoot":"","sources":["../../../../../src/common/textFormat/formatWithPattern/formatWithPattern.js"],"names":[],"mappings":";AAEA,kEAoBC"}
@@ -1,4 +1,3 @@
1
- import type { EventType } from '../../../withDisplayFormat/WithDisplayFormat';
2
- declare const getCursorPositionAfteractionstroke: (action: EventType, selectionStart: number, selectionEnd: number, pattern: string, pastedLength: number) => number;
3
1
  export default getCursorPositionAfteractionstroke;
2
+ declare function getCursorPositionAfteractionstroke(action: any, selectionStart: any, selectionEnd: any, pattern: any, pastedLength: any): any;
4
3
  //# sourceMappingURL=getCursorPositionAfterKeystroke.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCursorPositionAfterKeystroke.d.ts","sourceRoot":"","sources":["../../../../../src/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAI9E,QAAA,MAAM,kCAAkC,WAC9B,SAAS,kBACD,MAAM,gBACR,MAAM,WACX,MAAM,gBACD,MAAM,KACnB,MA6BF,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
1
+ {"version":3,"file":"getCursorPositionAfterKeystroke.d.ts","sourceRoot":"","sources":["../../../../../src/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js"],"names":[],"mappings":";AAGA,+IAmCC"}
@@ -1,7 +1,3 @@
1
- export type SymbolWithPosition = {
2
- index: number;
3
- symbol: string;
4
- };
5
- declare const getSymbolsInPatternWithPosition: (pattern: string) => SymbolWithPosition[];
6
1
  export default getSymbolsInPatternWithPosition;
2
+ declare function getSymbolsInPatternWithPosition(pattern: any): any[];
7
3
  //# sourceMappingURL=getSymbolsInPatternWithPosition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSymbolsInPatternWithPosition.d.ts","sourceRoot":"","sources":["../../../../../src/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,+BAA+B,YAAa,MAAM,KAAG,kBAAkB,EAU5E,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"getSymbolsInPatternWithPosition.d.ts","sourceRoot":"","sources":["../../../../../src/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js"],"names":[],"mappings":";AAAA,sEAUC"}
@@ -1,3 +1,3 @@
1
- declare const unformatWithPattern: (value: string, pattern: string) => string;
2
1
  export default unformatWithPattern;
2
+ declare function unformatWithPattern(value: any, pattern: any): string;
3
3
  //# sourceMappingURL=unformatWithPattern.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unformatWithPattern.d.ts","sourceRoot":"","sources":["../../../../../src/common/textFormat/unformatWithPattern/unformatWithPattern.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,mBAAmB,UAAW,MAAM,WAAW,MAAM,KAAG,MAQ7D,CAAC;AAKF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"unformatWithPattern.d.ts","sourceRoot":"","sources":["../../../../../src/common/textFormat/unformatWithPattern/unformatWithPattern.js"],"names":[],"mappings":";AAAA,uEAQC"}
@@ -2,12 +2,10 @@
2
2
  * Types
3
3
  */
4
4
  export type { InputProps } from './inputs/Input';
5
- export type { InputWithDisplayFormatProps } from './inputWithDisplayFormat';
6
5
  export type { InputGroupProps } from './inputs/InputGroup';
7
6
  export type { SearchInputProps } from './inputs/SearchInput';
8
7
  export type { SelectInputGroupItem, SelectInputItem, SelectInputOptionContentProps, SelectInputOptionItem, SelectInputProps, SelectInputSeparatorItem, SelectInputTriggerButtonProps, } from './inputs/SelectInput';
9
8
  export type { TextAreaProps } from './inputs/TextArea';
10
- export type { TextareaWithDisplayFormatProps } from './textareaWithDisplayFormat';
11
9
  export type { UploadedFile, UploadError, UploadResponse } from './uploadInput/types';
12
10
  export type { ModalProps } from './modal';
13
11
  export type { CurrencyHeaderItem, CurrencyItem, CurrencyOptionItem, MoneyInputProps, } from './moneyInput';
@@ -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,EAC7B,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrF,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,eAAe,EACf,eAAe,EACf,UAAU,EACV,SAAS,EACT,SAAS,EACT,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;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D;;GAEG;AACH,OAAO,EACL,SAAS,EACT,IAAI,EACJ,KAAK,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,OAAO,GACR,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC;;GAEG;AACH,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC"}
@@ -1,5 +1,11 @@
1
- /// <reference types="react" />
2
- import { type TextInputProps } from '../withDisplayFormat';
3
- declare const InputWithDisplayFormat: (props: TextInputProps) => import("react").JSX.Element;
4
- export default InputWithDisplayFormat;
5
- //# sourceMappingURL=InputWithDisplayFormat.d.ts.map
1
+ import * as React from 'react';
2
+
3
+ export interface InputWithDisplayFormatProps {
4
+ displayPattern: string;
5
+ onChange: (...args: any[])=>any;
6
+ }
7
+
8
+ declare const InputWithDisplayFormat: React.FC<InputWithDisplayFormatProps>;
9
+
10
+ export default InputWithDisplayFormat;
11
+
@@ -1 +1 @@
1
- {"version":3,"file":"InputWithDisplayFormat.d.ts","sourceRoot":"","sources":["../../../src/inputWithDisplayFormat/InputWithDisplayFormat.tsx"],"names":[],"mappings":";AACA,OAA0B,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE9E,QAAA,MAAM,sBAAsB,UAAW,cAAc,gCAKpD,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"InputWithDisplayFormat.d.ts","sourceRoot":"","sources":["../../../src/inputWithDisplayFormat/InputWithDisplayFormat.js"],"names":[],"mappings":";AAIA,iFAEC"}
@@ -1,3 +1,2 @@
1
- export { default } from './InputWithDisplayFormat';
2
- export type { TextInputProps as InputWithDisplayFormatProps } from '../withDisplayFormat';
1
+ export { default } from "./InputWithDisplayFormat";
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inputWithDisplayFormat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,YAAY,EAAE,cAAc,IAAI,2BAA2B,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inputWithDisplayFormat/index.js"],"names":[],"mappings":""}
@@ -1,13 +1,11 @@
1
- import { InputHTMLAttributes } from 'react';
1
+ /// <reference types="react" />
2
2
  import { SizeLarge, SizeMedium, SizeSmall } from '../common';
3
- export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {
3
+ import { Merge } from '../utils';
4
+ export interface InputProps extends Merge<React.ComponentPropsWithRef<'input'>, {
4
5
  size?: 'auto' | SizeSmall | SizeMedium | SizeLarge;
5
6
  shape?: 'rectangle' | 'pill';
6
7
  'aria-invalid'?: boolean;
7
- };
8
- export declare const Input: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
9
- size?: "auto" | "sm" | "md" | "lg" | undefined;
10
- shape?: "rectangle" | "pill" | undefined;
11
- 'aria-invalid'?: boolean | undefined;
12
- } & import("react").RefAttributes<HTMLInputElement>>;
8
+ }> {
9
+ }
10
+ export declare const Input: import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
13
11
  //# sourceMappingURL=Input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/inputs/Input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAc,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAK7D,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,GAAG;IAC7E,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IACnD,KAAK,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,KAAK;;;;oDAkBhB,CAAC"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/inputs/Input.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,MAAM,WAAW,UACf,SAAQ,KAAK,CACX,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACpC;IACE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IACnD,KAAK,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CACF;CAAG;AAEN,eAAO,MAAM,KAAK,sHAkBhB,CAAC"}
@@ -1,5 +1,11 @@
1
- /// <reference types="react" />
2
- import { type TextInputProps } from '../withDisplayFormat';
3
- declare const TextareaWithDisplayFormat: (props: TextInputProps) => import("react").JSX.Element;
4
- export default TextareaWithDisplayFormat;
5
- //# sourceMappingURL=TextareaWithDisplayFormat.d.ts.map
1
+ import * as React from 'react';
2
+
3
+ export interface TextareaWithDisplayFormatProps {
4
+ displayPattern: string;
5
+ onChange: (...args: any[])=>any;
6
+ }
7
+
8
+ declare const TextareaWithDisplayFormat: React.FC<TextareaWithDisplayFormatProps>;
9
+
10
+ export default TextareaWithDisplayFormat;
11
+
@@ -1 +1 @@
1
- {"version":3,"file":"TextareaWithDisplayFormat.d.ts","sourceRoot":"","sources":["../../../src/textareaWithDisplayFormat/TextareaWithDisplayFormat.tsx"],"names":[],"mappings":";AACA,OAA0B,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE9E,QAAA,MAAM,yBAAyB,UAAW,cAAc,gCAKvD,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"TextareaWithDisplayFormat.d.ts","sourceRoot":"","sources":["../../../src/textareaWithDisplayFormat/TextareaWithDisplayFormat.js"],"names":[],"mappings":";AAIA,oFAEC"}
@@ -1,3 +1,2 @@
1
- export { default } from './TextareaWithDisplayFormat';
2
- export type { TextInputProps as TextareaWithDisplayFormatProps } from '../withDisplayFormat';
1
+ export { default } from "./TextareaWithDisplayFormat";
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/textareaWithDisplayFormat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,YAAY,EAAE,cAAc,IAAI,8BAA8B,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/textareaWithDisplayFormat/index.js"],"names":[],"mappings":""}
@@ -1,63 +1,90 @@
1
- import { Component, KeyboardEvent, ClipboardEvent, ChangeEvent, FocusEvent } from 'react';
2
- import { HistoryNavigator } from '../common';
3
- import { InputProps } from '../inputs/Input';
4
- import { TextAreaProps } from '../inputs/TextArea';
5
- import { Merge } from '../utils';
6
- export type TextInputProps = Merge<InputProps, {
7
- value?: string;
8
- displayPattern: string;
9
- /**
10
- * autocomplete hides our form help so we need to disable it when help text
11
- * is present. Chrome ignores autocomplete=off, the only way to disable it is
12
- * to provide an 'invalid' value, for which 'disabled' serves.
13
- */
14
- autoComplete?: InputProps['autoComplete'] | 'disabled';
15
- onChange?: (value: string) => void;
16
- onBlur?: (value: string) => void;
17
- onFocus?: (value: string) => void;
18
- }>;
19
- export type Props = typeof WithDisplayFormat.defaultProps & {
20
- render: (renderProps: InputProps | TextAreaProps) => JSX.Element;
21
- } & TextInputProps;
22
- export type EventType = 'KeyDown' | 'Paste' | 'Cut' | 'Undo' | 'Redo' | 'Backspace' | 'Delete' | null;
23
- type State = {
24
- value: string;
25
- historyNavigator: HistoryNavigator;
26
- prevDisplayPattern?: string;
27
- triggerType?: EventType;
28
- triggerEvent?: KeyboardEvent<HTMLInputElement> | null;
29
- pastedLength?: number;
30
- selectionStart?: HTMLInputElement['selectionStart'];
31
- selectionEnd?: HTMLInputElement['selectionEnd'];
32
- };
33
- declare class WithDisplayFormat extends Component<Props, State> {
34
- static defaultProps: {
35
- autoComplete: string;
36
- displayPattern: string;
37
- type: string;
38
- value: string;
39
- };
40
- constructor(props: Props);
41
- static getDerivedStateFromProps({ displayPattern }: Props, { prevDisplayPattern, value, historyNavigator }: State): {
42
- prevDisplayPattern: string;
43
- value: string;
1
+ export default WithDisplayFormat;
2
+ declare class WithDisplayFormat extends Component<any, any, any> {
3
+ static getDerivedStateFromProps(nextProps: any, previousState: any): {
4
+ prevDisplayPattern: any;
5
+ value: any;
44
6
  triggerType: null;
45
7
  triggerEvent: null;
46
8
  pastedLength: number;
47
9
  } | null;
48
- getUserAction: (unformattedValue: string) => EventType;
10
+ constructor(props: any);
11
+ state: {
12
+ value: any;
13
+ historyNavigator: HistoryNavigator;
14
+ prevDisplayPattern: any;
15
+ triggerType: null;
16
+ triggerEvent: null;
17
+ };
18
+ getUserAction: (unformattedValue: any) => any;
49
19
  resetEvent: () => void;
50
- detectUndoRedo: (event: KeyboardEvent<HTMLInputElement>) => "Undo" | "Redo" | null;
51
- handleOnKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
52
- handleOnPaste: (event: ClipboardEvent<HTMLInputElement>) => void;
20
+ detectUndoRedo: (event: any) => "Redo" | "Undo" | null;
21
+ handleOnKeyDown: (event: any) => void;
22
+ handleOnPaste: (event: any) => void;
53
23
  handleOnCut: () => void;
54
- isKeyAllowed: (action: EventType) => boolean;
55
- handleOnChange: (event: ChangeEvent<HTMLInputElement>) => void;
56
- handleOnBlur: (event: FocusEvent<HTMLInputElement>) => void;
57
- handleOnFocus: (event: FocusEvent<HTMLInputElement>) => void;
58
- handleDelete: (unformattedValue: string, action: EventType) => string;
59
- handleCursorPositioning: (action: EventType) => void;
60
- render(): JSX.Element;
24
+ isKeyAllowed: (action: any) => boolean;
25
+ handleOnChange: (event: any) => void;
26
+ handleOnBlur: (event: any) => void;
27
+ handleOnFocus: (event: any) => void;
28
+ handleDelete: (unformattedValue: any, action: any) => string;
29
+ handleCursorPositioning: (action: any) => void;
30
+ render(): any;
61
31
  }
62
- export default WithDisplayFormat;
32
+ declare namespace WithDisplayFormat {
33
+ namespace propTypes {
34
+ const autoComplete: any;
35
+ const className: any;
36
+ const disabled: any;
37
+ const id: any;
38
+ const maxLength: any;
39
+ const minLength: any;
40
+ const name: any;
41
+ const onFocus: any;
42
+ const onBlur: any;
43
+ const onChange: any;
44
+ const placeholder: any;
45
+ const readOnly: any;
46
+ const render: any;
47
+ const required: any;
48
+ const displayPattern: any;
49
+ const type: any;
50
+ const inputMode: any;
51
+ const value: any;
52
+ }
53
+ namespace defaultProps {
54
+ const autoComplete_1: string;
55
+ export { autoComplete_1 as autoComplete };
56
+ const className_1: null;
57
+ export { className_1 as className };
58
+ const disabled_1: boolean;
59
+ export { disabled_1 as disabled };
60
+ const id_1: null;
61
+ export { id_1 as id };
62
+ const maxLength_1: null;
63
+ export { maxLength_1 as maxLength };
64
+ const minLength_1: null;
65
+ export { minLength_1 as minLength };
66
+ const name_1: null;
67
+ export { name_1 as name };
68
+ const placeholder_1: null;
69
+ export { placeholder_1 as placeholder };
70
+ const readOnly_1: boolean;
71
+ export { readOnly_1 as readOnly };
72
+ const required_1: boolean;
73
+ export { required_1 as required };
74
+ const displayPattern_1: string;
75
+ export { displayPattern_1 as displayPattern };
76
+ const type_1: string;
77
+ export { type_1 as type };
78
+ const inputMode_1: null;
79
+ export { inputMode_1 as inputMode };
80
+ const value_1: string;
81
+ export { value_1 as value };
82
+ const onFocus_1: null;
83
+ export { onFocus_1 as onFocus };
84
+ const onBlur_1: null;
85
+ export { onBlur_1 as onBlur };
86
+ }
87
+ }
88
+ import { Component } from "react";
89
+ import { HistoryNavigator } from "../common";
63
90
  //# sourceMappingURL=WithDisplayFormat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WithDisplayFormat.d.ts","sourceRoot":"","sources":["../../../src/withDisplayFormat/WithDisplayFormat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAS7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7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AC,KAAK,EAAE,KAAK,CAAC;IACrD,MAAM,CAAC,YAAY;;;;;MAKjB;gBAEU,KAAK,EAAE,KAAK;IAYxB,MAAM,CAAC,wBAAwB,CAC7B,EAAE,cAAc,EAAE,EAAE,KAAK,EACzB,EAAE,kBAAmC,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,KAAK;;;;;;;IAiBzE,aAAa,qBAAsB,MAAM,KAAG,SAAS,CA+BnD;IAEF,UAAU,aAMR;IAEF,cAAc,UAAW,cAAc,gBAAgB,CAAC,4BAMtD;IAEF,eAAe,UAAW,cAAc,gBAAgB,CAAC,UAuBvD;IAEF,aAAa,UAAW,eAAe,gBAAgB,CAAC,UAQtD;IAEF,WAAW,aAET;IAEF,YAAY,WAAY,SAAS,aAK/B;IAEF,cAAc,UAAW,YAAY,gBAAgB,CAAC,UA0BpD;IAEF,YAAY,UAAW,WAAW,gBAAgB,CAAC,UAEjD;IAEF,aAAa,UAAW,WAAW,gBAAgB,CAAC,UAMlD;IAEF,YAAY,qBAAsB,MAAM,UAAU,SAAS,YAwBzD;IAEF,uBAAuB,WAAY,SAAS,UAkB1C;IAEF,MAAM;CAuBP;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"WithDisplayFormat.d.ts","sourceRoot":"","sources":["../../../src/withDisplayFormat/WithDisplayFormat.js"],"names":[],"mappings":";AAaA;IAcE;;;;;;aAkBC;IA/BD,wBAWC;IAPC;;;;;;MAMC;IAuBH,8CA0BE;IAEF,uBAME;IAEF,uDAME;IAEF,sCAuBE;IAEF,oCAQE;IAEF,wBAEE;IAEF,uCAKE;IAEF,qCA0BE;IAEF,mCAKE;IAEF,oCAME;IAEF,6DAuBE;IAEF,+CAkBE;IAEF,cAsCC;CACF"}
@@ -1,3 +1,2 @@
1
- export { default } from './WithDisplayFormat';
2
- export type { Props as WithDisplayFormatProps, TextInputProps } from './WithDisplayFormat';
1
+ export { default } from "./WithDisplayFormat";
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/withDisplayFormat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,YAAY,EAAE,KAAK,IAAI,sBAAsB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/withDisplayFormat/index.js"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-adcaf57",
3
+ "version": "0.0.0-experimental-2118ad7",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,7 +1,6 @@
1
1
  import getSymbolsInPatternWithPosition from '../getSymbolsInPatternWithPosition';
2
- import type { SymbolWithPosition } from '../getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition';
3
2
 
4
- const formatWithPattern = (value: string, pattern: string): string => {
3
+ const formatWithPattern = (value, pattern) => {
5
4
  if (!value || value === '') {
6
5
  return '';
7
6
  }
@@ -10,16 +9,13 @@ const formatWithPattern = (value: string, pattern: string): string => {
10
9
 
11
10
  const patternWithSymbolsPosition = getSymbolsInPatternWithPosition(pattern);
12
11
 
13
- let patternSymbol: SymbolWithPosition[] = [];
12
+ let patternSymbol = [];
14
13
  // valueArray.length increments during the cycle cause we are adding new elements.
15
14
  for (let index = 0; index < valueArray.length; index += 1) {
16
- patternSymbol = patternWithSymbolsPosition.filter((pattern) => pattern.index === index);
15
+ patternSymbol = patternWithSymbolsPosition.filter((symbol) => symbol.index === index);
17
16
  // Add pattern's symbol at n position
18
17
  if (patternSymbol.length === 1) {
19
- const last = patternSymbol.pop();
20
- if (last) {
21
- valueArray.splice(index, 0, last.symbol);
22
- }
18
+ valueArray.splice(index, 0, patternSymbol.pop().symbol);
23
19
  }
24
20
  }
25
21
 
@@ -1,14 +1,13 @@
1
- import type { EventType } from '../../../withDisplayFormat/WithDisplayFormat';
2
1
  import getCountOfSymbolsInSelection from '../getCountOfSymbolsInSelection';
3
2
  import { getDistanceToNextSymbol, getDistanceToPreviousSymbol } from '../getDistanceToSymbol';
4
3
 
5
4
  const getCursorPositionAfteractionstroke = (
6
- action: EventType,
7
- selectionStart: number,
8
- selectionEnd: number,
9
- pattern: string,
10
- pastedLength: number,
11
- ): number => {
5
+ action,
6
+ selectionStart,
7
+ selectionEnd,
8
+ pattern,
9
+ pastedLength,
10
+ ) => {
12
11
  let cursorPosition = selectionStart;
13
12
 
14
13
  switch (action) {
@@ -1,10 +1,5 @@
1
- export type SymbolWithPosition = {
2
- index: number;
3
- symbol: string;
4
- };
5
-
6
- const getSymbolsInPatternWithPosition = (pattern: string): SymbolWithPosition[] => {
7
- const patternWithSymbolsPosition: SymbolWithPosition[] = [];
1
+ const getSymbolsInPatternWithPosition = (pattern) => {
2
+ const patternWithSymbolsPosition = [];
8
3
  const patternArray = pattern.split('');
9
4
  patternArray.forEach((symbol, index) => {
10
5
  if (symbol !== '*') {
@@ -1,4 +1,4 @@
1
- const unformatWithPattern = (value: string, pattern: string): string => {
1
+ const unformatWithPattern = (value, pattern) => {
2
2
  let valueArray = [''];
3
3
  if (value && value.length > 0) {
4
4
  valueArray = value.toString().split('');
@@ -8,7 +8,6 @@ const unformatWithPattern = (value: string, pattern: string): string => {
8
8
  return valueArray.join('');
9
9
  };
10
10
 
11
- const getSymbolsInPattern = (pattern: string): string[] =>
12
- pattern.split('').filter((symbol) => symbol !== '*');
11
+ const getSymbolsInPattern = (pattern) => pattern.split('').filter((symbol) => symbol !== '*');
13
12
 
14
13
  export default unformatWithPattern;
package/src/index.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  * Types
3
3
  */
4
4
  export type { InputProps } from './inputs/Input';
5
- export type { InputWithDisplayFormatProps } from './inputWithDisplayFormat';
6
5
  export type { InputGroupProps } from './inputs/InputGroup';
7
6
  export type { SearchInputProps } from './inputs/SearchInput';
8
7
  export type {
@@ -15,7 +14,6 @@ export type {
15
14
  SelectInputTriggerButtonProps,
16
15
  } from './inputs/SelectInput';
17
16
  export type { TextAreaProps } from './inputs/TextArea';
18
- export type { TextareaWithDisplayFormatProps } from './textareaWithDisplayFormat';
19
17
  export type { UploadedFile, UploadError, UploadResponse } from './uploadInput/types';
20
18
  export type { ModalProps } from './modal';
21
19
  export type {
@@ -0,0 +1,14 @@
1
+ import PropTypes from 'prop-types';
2
+
3
+ import WithDisplayFormat from '../withDisplayFormat';
4
+
5
+ const InputWithDisplayFormat = (props) => (
6
+ <WithDisplayFormat {...props} render={(renderProps) => <input {...renderProps} />} />
7
+ );
8
+
9
+ InputWithDisplayFormat.propTypes = {
10
+ displayPattern: PropTypes.string.isRequired,
11
+ onChange: PropTypes.func.isRequired,
12
+ };
13
+
14
+ export default InputWithDisplayFormat;
@@ -0,0 +1 @@
1
+ export { default } from './InputWithDisplayFormat';
@@ -1,16 +1,21 @@
1
1
  import classNames from 'classnames';
2
- import { InputHTMLAttributes, forwardRef } from 'react';
2
+ import { forwardRef } from 'react';
3
3
 
4
4
  import { SizeLarge, SizeMedium, SizeSmall } from '../common';
5
+ import { Merge } from '../utils';
5
6
 
6
7
  import { useInputPaddings } from './InputGroup';
7
8
  import { formControlClassNameBase } from './_common';
8
9
 
9
- export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {
10
- size?: 'auto' | SizeSmall | SizeMedium | SizeLarge;
11
- shape?: 'rectangle' | 'pill';
12
- 'aria-invalid'?: boolean;
13
- };
10
+ export interface InputProps
11
+ extends Merge<
12
+ React.ComponentPropsWithRef<'input'>,
13
+ {
14
+ size?: 'auto' | SizeSmall | SizeMedium | SizeLarge;
15
+ shape?: 'rectangle' | 'pill';
16
+ 'aria-invalid'?: boolean;
17
+ }
18
+ > {}
14
19
 
15
20
  export const Input = forwardRef(function Input(
16
21
  { size = 'auto', shape = 'rectangle', className, ...restProps }: InputProps,
@@ -0,0 +1,14 @@
1
+ import PropTypes from 'prop-types';
2
+
3
+ import WithDisplayFormat from '../withDisplayFormat';
4
+
5
+ const TextareaWithDisplayFormat = (props) => (
6
+ <WithDisplayFormat {...props} render={(renderProps) => <textarea {...renderProps} />} />
7
+ );
8
+
9
+ TextareaWithDisplayFormat.propTypes = {
10
+ displayPattern: PropTypes.string.isRequired,
11
+ onChange: PropTypes.func.isRequired,
12
+ };
13
+
14
+ export default TextareaWithDisplayFormat;
@@ -1,7 +1,5 @@
1
1
  import { shallow } from 'enzyme';
2
2
 
3
- import { TextArea } from '../inputs/TextArea';
4
-
5
3
  import TextareaWithDisplayFormat from '.';
6
4
 
7
5
  describe('TextareaWithDisplayFormat', () => {
@@ -12,6 +10,6 @@ describe('TextareaWithDisplayFormat', () => {
12
10
  .find('WithDisplayFormat')
13
11
  .renderProp('render')({ value: 'test' });
14
12
 
15
- expect(view.find(TextArea).props('value')).toStrictEqual({ value: 'test' });
13
+ expect(view.find('textarea').props('value')).toStrictEqual({ value: 'test' });
16
14
  });
17
15
  });
@@ -0,0 +1 @@
1
+ export { default } from './TextareaWithDisplayFormat';