@transferwise/components 0.0.0-experimental-ef158b4 → 0.0.0-experimental-4f82861

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/main.css CHANGED
@@ -3198,7 +3198,8 @@ a {
3198
3198
  padding-bottom: 4px !important;
3199
3199
  }
3200
3200
  .tw-modal table,
3201
- .tw-modal .table {
3201
+ .tw-modal .table,
3202
+ .tw-modal .np-theme-personal {
3202
3203
  background-color: transparent;
3203
3204
  }
3204
3205
  @media (min-width: 576px) {
@@ -3198,7 +3198,8 @@ a {
3198
3198
  padding-bottom: 4px !important;
3199
3199
  }
3200
3200
  .tw-modal table,
3201
- .tw-modal .table {
3201
+ .tw-modal .table,
3202
+ .tw-modal .np-theme-personal {
3202
3203
  background-color: transparent;
3203
3204
  }
3204
3205
  @media (min-width: 576px) {
@@ -83,7 +83,8 @@
83
83
  padding-bottom: 4px !important;
84
84
  }
85
85
  .tw-modal table,
86
- .tw-modal .table {
86
+ .tw-modal .table,
87
+ .tw-modal .np-theme-personal {
87
88
  background-color: transparent;
88
89
  }
89
90
  @media (min-width: 576px) {
@@ -1,98 +1,57 @@
1
- import { DebouncedFunc } from 'lodash';
2
- import { Component, ReactNode } from 'react';
3
- import { Size, SizeMedium, SizeLarge } from '../common';
4
- import { InlineAlertProps } from '../inlineAlert/InlineAlert';
5
- import TypeaheadOption from './typeaheadOption/TypeaheadOption';
6
- export type TypeaheadOption<T = string> = {
7
- label: string;
8
- note?: string;
9
- secondary?: string;
10
- value?: T;
11
- };
12
- export interface TypeaheadProps<T> {
13
- id: string;
14
- name: string;
15
- addon: ReactNode;
16
- alert?: {
17
- message: InlineAlertProps['children'];
18
- type: InlineAlertProps['type'];
19
- };
20
- allowNew: boolean;
21
- autoFillOnBlur?: boolean;
22
- autoFocus: boolean;
23
- chipSeparators?: string[];
24
- clearable: boolean;
25
- footer: ReactNode;
26
- initialValue: TypeaheadOption<T>[];
27
- inputAutoComplete?: string;
28
- maxHeight: number;
29
- minQueryLength: number;
30
- placeholder?: string;
31
- multiple: boolean;
32
- options: TypeaheadOption<T>[];
33
- searchDelay: number;
34
- showSuggestions: boolean;
35
- showNewEntry: boolean;
36
- size?: SizeMedium | SizeLarge;
37
- onBlur?: () => void;
38
- onChange: (options: TypeaheadOption<T>[]) => void;
39
- onFocus?: () => void;
40
- onInputChange?: (query: string) => void;
41
- onSearch?: (query: string) => void;
42
- validateChip?: (chip: TypeaheadOption<T>) => boolean;
43
- }
44
- type TypeaheadState<T> = {
45
- selected: TypeaheadOption<T>[];
46
- keyboardFocusedOptionIndex: number | null;
47
- errorState: boolean;
48
- query: string;
49
- optionsShown?: boolean;
50
- isFocused?: boolean;
51
- };
52
- export default class Typeahead<T> extends Component<TypeaheadProps<T>, TypeaheadState<T>> {
53
- props: TypeaheadProps<T> & Required<Pick<TypeaheadProps<T>, keyof typeof Typeahead.defaultProps>>;
54
- static defaultProps: {
55
- addon: null;
56
- allowNew: boolean;
57
- autoFillOnBlur: boolean;
58
- autoFocus: boolean;
59
- chipSeparators: never[];
60
- clearable: boolean;
61
- footer: null;
62
- initialValue: never[];
63
- inputAutoComplete: string;
64
- maxHeight: null;
65
- minQueryLength: number;
66
- multiple: boolean;
67
- searchDelay: number;
68
- showSuggestions: boolean;
69
- showNewEntry: boolean;
70
- size: Size;
71
- validateChip: () => boolean;
72
- };
73
- constructor(props: TypeaheadProps<T>);
74
- handleSearchDebounced: DebouncedFunc<(query: string) => void>;
75
- UNSAFE_componentWillReceiveProps(nextProps: TypeaheadProps<T>): void;
76
- componentWillUnmount(): void;
77
- handleOnFocus: () => void;
78
- onOptionSelected: (event: React.MouseEvent, item: TypeaheadOption<T>) => void;
79
- handleOnChange: React.ChangeEventHandler<HTMLInputElement>;
80
- handleOnPaste: React.ClipboardEventHandler<HTMLInputElement>;
81
- handleOnKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
82
- moveFocusedOption(offset: number): void;
83
- selectItem: (item: TypeaheadOption<T>) => void;
84
- handleSearch: (query: string) => void;
85
- handleDocumentClick: () => void;
86
- showMenu: () => void;
87
- hideMenu: () => void;
88
- updateSelectedValue: (selected: TypeaheadOption<T>[]) => void;
89
- clear: (event: React.MouseEvent<HTMLButtonElement>) => void;
90
- removeChip: (option: TypeaheadOption<T>) => void;
91
- renderChip: (option: TypeaheadOption<T>, idx: number) => ReactNode;
92
- renderMenu: ({ footer, options, id, keyboardFocusedOptionIndex, query, allowNew, showNewEntry, dropdownOpen, }: Pick<TypeaheadProps<T>, "id" | "footer" | "options" | "allowNew" | "showNewEntry"> & Pick<TypeaheadState<T>, "keyboardFocusedOptionIndex" | "query"> & {
93
- dropdownOpen?: boolean | undefined;
94
- }) => import("react").JSX.Element;
95
- render(): import("react").JSX.Element;
96
- }
97
- export {};
98
- //# sourceMappingURL=Typeahead.d.ts.map
1
+ import * as React from 'react';
2
+
3
+ export interface TypeaheadOptions {
4
+ label: string;
5
+ note?: string;
6
+ secondary?: string;
7
+ value?: Object;
8
+ }
9
+
10
+ export interface TypeaheadInitialValue {
11
+ label: string;
12
+ note?: string;
13
+ secondary?: string;
14
+ }
15
+
16
+ export interface TypeaheadAlert {
17
+ message: string;
18
+ type: "error" | "warning" | "neutral";
19
+ }
20
+
21
+ export type TypeaheadSize = "md" | "lg";
22
+
23
+ export interface TypeaheadProps {
24
+ id: string;
25
+ name: string;
26
+ options: TypeaheadOptions[];
27
+ initialValue?: TypeaheadInitialValue[];
28
+ onChange: (...args: any[])=>any;
29
+ allowNew?: boolean;
30
+ autoFocus?: boolean;
31
+ clearable?: boolean;
32
+ multiple?: boolean;
33
+ showSuggestions?: boolean;
34
+ showNewEntry?: boolean;
35
+ searchDelay?: number;
36
+ maxHeight?: number;
37
+ minQueryLength?: number;
38
+ addon?: React.ReactNode;
39
+ placeholder?: string;
40
+ alert?: TypeaheadAlert;
41
+ footer?: React.ReactNode;
42
+ validateChip?: (...args: any[])=>any;
43
+ onSearch?: (...args: any[])=>any;
44
+ onBlur?: (...args: any[])=>any;
45
+ onInputChange?: (...args: any[])=>any;
46
+ onFocus?: (...args: any[])=>any;
47
+ chipSeparators?: string[];
48
+ size?: TypeaheadSize;
49
+ inputAutoComplete?: string;
50
+ autoFillOnBlur?: boolean;
51
+ }
52
+
53
+ export default class Typeahead extends React.Component<TypeaheadProps, any> {
54
+ render(): JSX.Element;
55
+
56
+ }
57
+
@@ -1 +1 @@
1
- {"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../../src/typeahead/Typeahead.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGvC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAE,IAAI,EAAa,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAOnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAKhE,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,MAAM,IAAI;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;KAChC,CAAC;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,E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Typeahead.js"],"names":[],"mappings":"AAyBA;IACE,wBAWC;IARC,2BAAqE;IAErE;;;;;MAKC;IAGH,uDAeC;IAED,6BAEC;IAED,0BAOE;IAEF,kDAGE;IAEF,qCAoBE;IAEF,oCAiBE;IAEF,sCAmCE;IAEF,qCAYC;IAED,gCAiBE;IAEF,sCAME;IAEF,mCASE;IAEF,gCAgBE;IAEF,qBAWE;IAEF,qBAWE;IAEF,6CAOE;IAEF,4BASE;IAEF,kCAME;IAEF,mEAcE;IAEF;;;;;;;;;sCA0CE;IAEF,sCAmGC;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqEe,0CAAU;;;;;;;;;;AAle1B,gCAAyB;AADzB,0CAAmC"}
@@ -1,29 +1,47 @@
1
- import { Component, ReactNode } from 'react';
2
- import { TypeaheadOption, TypeaheadProps } from '../Typeahead';
3
- export type TypeaheadInputProps<T> = {
4
- typeaheadId: string;
5
- value: string;
6
- selected: TypeaheadOption<T>[];
7
- optionsShown?: boolean;
8
- autoComplete: string;
9
- onChange: React.ChangeEventHandler<HTMLInputElement>;
10
- onKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
11
- onFocus: () => void;
12
- onPaste: React.ClipboardEventHandler<HTMLInputElement>;
13
- renderChip: (chip: TypeaheadOption<T>, index: number) => ReactNode;
14
- } & Pick<TypeaheadProps<T>, 'id' | 'name' | 'autoFocus' | 'multiple' | 'placeholder' | 'maxHeight' | 'onFocus'>;
15
- type TypeaheadInputState = {
16
- inputWidth: number;
17
- };
18
- export default class TypeaheadInput<T> extends Component<TypeaheadInputProps<T>, TypeaheadInputState> {
19
- inputRef: HTMLInputElement | null;
20
- sizerRef: HTMLDivElement | null;
21
- constructor(props: TypeaheadInputProps<T>);
1
+ declare class TypeaheadInput extends Component<any, any, any> {
2
+ constructor();
3
+ state: {
4
+ inputWidth: number;
5
+ };
22
6
  componentDidMount(): void;
23
- componentDidUpdate(previousProps: TypeaheadInputProps<T>): void;
7
+ componentDidUpdate(previousProps: any): void;
24
8
  recalculateWidth: () => void;
25
9
  renderInput: () => import("react").JSX.Element;
10
+ inputRef: HTMLInputElement | null | undefined;
26
11
  render(): import("react").JSX.Element;
12
+ sizerRef: HTMLDivElement | null | undefined;
27
13
  }
28
- export {};
14
+ declare namespace TypeaheadInput {
15
+ namespace propTypes {
16
+ const typeaheadId: any;
17
+ const name: any;
18
+ const autoFocus: any;
19
+ const multiple: any;
20
+ const value: any;
21
+ const selected: any;
22
+ const placeholder: any;
23
+ const optionsShown: any;
24
+ const maxHeight: any;
25
+ const autoComplete: any;
26
+ const onChange: any;
27
+ const renderChip: any;
28
+ const onKeyDown: any;
29
+ const onFocus: any;
30
+ const onPaste: any;
31
+ }
32
+ namespace defaultProps {
33
+ const autoFocus_1: boolean;
34
+ export { autoFocus_1 as autoFocus };
35
+ const maxHeight_1: null;
36
+ export { maxHeight_1 as maxHeight };
37
+ const placeholder_1: string;
38
+ export { placeholder_1 as placeholder };
39
+ const optionsShown_1: boolean;
40
+ export { optionsShown_1 as optionsShown };
41
+ const selected_1: never[];
42
+ export { selected_1 as selected };
43
+ }
44
+ }
45
+ export default TypeaheadInput;
46
+ import { Component } from "react";
29
47
  //# sourceMappingURL=TypeaheadInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypeaheadInput.d.ts","sourceRoot":"","sources":["../../../../src/typeahead/typeaheadInput/TypeaheadInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI/D,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,YAAY,CAAC,EAA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11 +1,19 @@
1
- /// <reference types="react" />
2
- import { TypeaheadOption } from '../Typeahead';
3
- export type TypeaheadOptionProps<T> = {
4
- option: TypeaheadOption<T>;
5
- selected?: boolean;
6
- onClick?: React.MouseEventHandler;
7
- query?: string;
8
- };
9
- declare const Option: <T>(props: TypeaheadOptionProps<T>) => import("react").JSX.Element;
10
1
  export default Option;
2
+ declare function Option(props: any): import("react").JSX.Element;
3
+ declare namespace Option {
4
+ namespace propTypes {
5
+ const option: any;
6
+ const query: any;
7
+ const selected: any;
8
+ const onClick: any;
9
+ }
10
+ namespace defaultProps {
11
+ const selected_1: boolean;
12
+ export { selected_1 as selected };
13
+ const query_1: string;
14
+ export { query_1 as query };
15
+ export function onClick_1(): void;
16
+ export { onClick_1 as onClick };
17
+ }
18
+ }
11
19
  //# sourceMappingURL=TypeaheadOption.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypeaheadOption.d.ts","sourceRoot":"","sources":["../../../../src/typeahead/typeaheadOption/TypeaheadOption.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,MAAM,oEAqBX,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"TypeaheadOption.d.ts","sourceRoot":"","sources":["../../../../src/typeahead/typeaheadOption/TypeaheadOption.js"],"names":[],"mappings":";AAMA,iEAqBC;;;;;;;;;;;;;QAgBU,kCAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-ef158b4",
3
+ "version": "0.0.0-experimental-4f82861",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -97,9 +97,6 @@
97
97
  "@react-spring/web": "~9.6.1",
98
98
  "@transferwise/formatting": "^2.1.0",
99
99
  "@transferwise/neptune-validation": "^3.1.0",
100
- "@types/lodash": "4.14.202",
101
- "@types/lodash.clamp": "^4.0.9",
102
- "@types/lodash.debounce": "^4.0.9",
103
100
  "@types/lodash.throttle": "^4.1.7",
104
101
  "classnames": "^2.2.6",
105
102
  "commonmark": "0.29.1",
package/src/main.css CHANGED
@@ -3198,7 +3198,8 @@ a {
3198
3198
  padding-bottom: 4px !important;
3199
3199
  }
3200
3200
  .tw-modal table,
3201
- .tw-modal .table {
3201
+ .tw-modal .table,
3202
+ .tw-modal .np-theme-personal {
3202
3203
  background-color: transparent;
3203
3204
  }
3204
3205
  @media (min-width: 576px) {
@@ -83,7 +83,8 @@
83
83
  padding-bottom: 4px !important;
84
84
  }
85
85
  .tw-modal table,
86
- .tw-modal .table {
86
+ .tw-modal .table,
87
+ .tw-modal .np-theme-personal {
87
88
  background-color: transparent;
88
89
  }
89
90
  @media (min-width: 576px) {
@@ -97,7 +97,7 @@
97
97
  }
98
98
  }
99
99
 
100
- table, .table {
100
+ table, .table, .np-theme-personal {
101
101
  background-color: transparent;
102
102
  }
103
103
  }
@@ -1,10 +1,11 @@
1
1
  import { action } from '@storybook/addon-actions';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
+ import { ScreenMode, ThemeProvider } from '@wise/components-theming';
3
4
  import { useState } from 'react';
4
5
 
5
- import { Button, Modal } from '..';
6
- import { Scroll } from '../common';
7
- import { lorem10, lorem1000, storyConfig } from '../test-utils';
6
+ import { Button, Modal, ModalProps } from '..';
7
+ import { CommonProps, Scroll } from '../common';
8
+ import { lorem10, lorem100, lorem1000, storyConfig } from '../test-utils';
8
9
 
9
10
  export default {
10
11
  component: Modal,
@@ -23,6 +24,39 @@ export default {
23
24
 
24
25
  type Story = StoryObj<typeof Modal>;
25
26
 
27
+ export interface StoryContentProps {
28
+ args: CommonProps & ModalProps;
29
+ screenMode?: ScreenMode;
30
+ }
31
+
32
+ const StoryContent = ({ args, screenMode }: StoryContentProps) => {
33
+ // eslint-disable-next-line react-hooks/rules-of-hooks
34
+ const [open, setOpen] = useState(args.open);
35
+ return (
36
+ <>
37
+ <Button onClick={() => setOpen(true)}>Open Modal</Button>
38
+ <Modal
39
+ {...args}
40
+ body={
41
+ !screenMode ? (
42
+ args.body
43
+ ) : (
44
+ <ThemeProvider theme="personal" screenMode={screenMode}>
45
+ {lorem100}
46
+ </ThemeProvider>
47
+ )
48
+ }
49
+ open={open}
50
+ disableDimmerClickToClose={args.disableDimmerClickToClose}
51
+ onClose={() => {
52
+ setOpen(false);
53
+ action('Modal closed')();
54
+ }}
55
+ />
56
+ </>
57
+ );
58
+ };
59
+
26
60
  export const Basic: Story = {
27
61
  args: {
28
62
  title: 'Title',
@@ -30,24 +64,7 @@ export const Basic: Story = {
30
64
  scroll: Scroll.VIEWPORT,
31
65
  footer: <Button block>Action</Button>,
32
66
  },
33
- render: (args) => {
34
- // eslint-disable-next-line react-hooks/rules-of-hooks
35
- const [open, setOpen] = useState(args.open);
36
- return (
37
- <>
38
- <Button onClick={() => setOpen(true)}>Open Modal</Button>
39
- <Modal
40
- {...args}
41
- open={open}
42
- disableDimmerClickToClose={args.disableDimmerClickToClose}
43
- onClose={() => {
44
- setOpen(false);
45
- action('Modal closed')();
46
- }}
47
- />
48
- </>
49
- );
50
- },
67
+ render: (args) => <StoryContent args={args} />,
51
68
  };
52
69
 
53
70
  export const BasicMobile: Story = storyConfig(Basic, { variants: ['mobile'] });
@@ -80,3 +97,18 @@ export const WithoutTitle: Story = {
80
97
  };
81
98
 
82
99
  export const WithoutTitleMobile: Story = storyConfig(WithoutTitle, { variants: ['mobile'] });
100
+
101
+ export const WithThemeProviderInContentProps: Story = {
102
+ args: {
103
+ title: lorem10,
104
+ body: lorem100,
105
+ scroll: Scroll.VIEWPORT,
106
+ footer: <Button block>Action</Button>,
107
+ },
108
+ render: (args, { globals: { screenMode } }) => (
109
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
110
+ <StoryContent args={args} screenMode={screenMode} />
111
+ ),
112
+ };
113
+
114
+ export const WithThemeProviderInContent: Story = storyConfig(WithThemeProviderInContentProps, {});