@transferwise/components 0.0.0-experimental-7709e0e → 0.0.0-experimental-94569f6

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
@@ -2400,66 +2400,36 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2400
2400
  position: relative;
2401
2401
  z-index: 1060;
2402
2402
  }
2403
- .np-bottom-sheet-v2-backdrop-container--enter,
2404
- .np-bottom-sheet-v2-backdrop-container--leave {
2405
- transition-property: opacity;
2406
- transition-timing-function: ease-out;
2407
- transition-duration: 300ms;
2408
- }
2409
- .np-bottom-sheet-v2-backdrop-container--enter-from,
2410
- .np-bottom-sheet-v2-backdrop-container--leave-to {
2411
- opacity: 0;
2412
- }
2413
2403
  .np-bottom-sheet-v2-backdrop {
2414
2404
  position: fixed;
2415
2405
  inset: 0px;
2416
2406
  background-color: #37517e;
2417
2407
  background-color: var(--color-content-primary);
2418
2408
  opacity: 0.4;
2409
+ transition-property: opacity;
2410
+ transition-timing-function: ease-out;
2411
+ transition-duration: 300ms;
2412
+ }
2413
+ .np-bottom-sheet-v2-backdrop--closed {
2414
+ opacity: 0;
2419
2415
  }
2420
2416
  .np-bottom-sheet-v2 {
2421
2417
  position: fixed;
2422
2418
  inset: 0px;
2419
+ bottom: env(keyboard-inset-height, 0px);
2420
+ margin-left: 8px;
2421
+ margin-left: var(--size-8);
2422
+ margin-right: 8px;
2423
+ margin-right: var(--size-8);
2424
+ margin-top: 64px;
2425
+ margin-top: var(--size-64);
2423
2426
  display: flex;
2424
2427
  flex-direction: column;
2425
2428
  justify-content: flex-end;
2426
- padding-left: 8px;
2427
- padding-left: var(--size-8);
2428
- padding-right: 8px;
2429
- padding-right: var(--size-8);
2430
- padding-top: 64px;
2431
- padding-top: var(--size-64);
2432
2429
  }
2433
2430
  .np-bottom-sheet-v2-content {
2434
- max-height: 100%;
2435
- }
2436
- .np-bottom-sheet-v2-content--enter,
2437
- .np-bottom-sheet-v2-content--leave {
2438
- transition-property: transform;
2439
- transition-timing-function: ease-out;
2440
- transition-duration: 300ms;
2441
- }
2442
- @media (prefers-reduced-motion: reduce) {
2443
- .np-bottom-sheet-v2-content--enter,
2444
- .np-bottom-sheet-v2-content--leave {
2445
- transition-property: opacity;
2446
- }
2447
- }
2448
- @media (prefers-reduced-motion: no-preference) {
2449
- .np-bottom-sheet-v2-content--enter-from,
2450
- .np-bottom-sheet-v2-content--leave-to {
2451
- transform: translateY(100%);
2452
- }
2453
- }
2454
- @media (prefers-reduced-motion: reduce) {
2455
- .np-bottom-sheet-v2-content--enter-from,
2456
- .np-bottom-sheet-v2-content--leave-to {
2457
- opacity: 0;
2458
- }
2459
- }
2460
- .np-bottom-sheet-v2-content-inner-container {
2461
2431
  display: flex;
2462
- height: 100%;
2432
+ max-height: 100%;
2463
2433
  flex-direction: column;
2464
2434
  border-top-left-radius: 32px;
2465
2435
  /* TODO: Tokenize */
@@ -2469,30 +2439,45 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2469
2439
  background-color: var(--color-background-elevated);
2470
2440
  box-shadow: 0 0 40px rgba(69, 71, 69, 0.2);
2471
2441
  }
2472
- .np-bottom-sheet-v2-content-inner-container:focus {
2442
+ .np-bottom-sheet-v2-content:focus {
2473
2443
  outline: none;
2474
2444
  }
2445
+ @media (prefers-reduced-motion: no-preference) {
2446
+ .np-bottom-sheet-v2-content {
2447
+ transition-property: transform;
2448
+ transition-timing-function: ease-out;
2449
+ transition-duration: 300ms;
2450
+ }
2451
+ .np-bottom-sheet-v2-content--closed {
2452
+ transform: translateY(100%);
2453
+ }
2454
+ }
2455
+ @media (prefers-reduced-motion: reduce) {
2456
+ .np-bottom-sheet-v2-content {
2457
+ transition-property: opacity;
2458
+ transition-timing-function: ease-out;
2459
+ transition-duration: 300ms;
2460
+ }
2461
+ .np-bottom-sheet-v2-content--closed {
2462
+ opacity: 0;
2463
+ }
2464
+ }
2475
2465
  .np-bottom-sheet-v2-header {
2476
2466
  align-self: flex-end;
2477
2467
  padding: 16px;
2478
2468
  padding: var(--size-16);
2479
2469
  }
2480
2470
  .np-bottom-sheet-v2-content-inner {
2481
- padding-top: 0px;
2482
- display: grid;
2483
- grid-row-gap: 8px;
2484
- grid-row-gap: var(--size-8);
2471
+ display: flex;
2472
+ flex-direction: column;
2485
2473
  row-gap: 8px;
2486
2474
  row-gap: var(--size-8);
2487
- overflow-y: auto;
2488
- grid-template-rows: repeat(1, minmax(0, 1fr));
2489
- }
2490
- .np-bottom-sheet-v2-content-inner--has-title {
2491
- grid-template-rows: auto 1fr;
2475
+ overflow: auto;
2492
2476
  }
2493
2477
  .np-bottom-sheet-v2-content-inner--padding-md {
2494
2478
  padding: 16px;
2495
2479
  padding: var(--size-16);
2480
+ padding-top: 0px;
2496
2481
  }
2497
2482
  .np-bottom-sheet-v2-title {
2498
2483
  color: #37517e;
@@ -4208,16 +4193,14 @@ html:not([dir="rtl"]) .np-navigation-option {
4208
4193
  height: var(--size-32);
4209
4194
  }
4210
4195
  }
4211
- .status-circle.negative,
4212
- .status-circle.error {
4196
+ .status-circle.negative {
4213
4197
  background-color: var(--color-sentiment-negative);
4214
4198
  }
4215
4199
  .status-circle.neutral {
4216
4200
  background-color: #5d7079;
4217
4201
  background-color: var(--color-content-secondary);
4218
4202
  }
4219
- .status-circle.positive,
4220
- .status-circle.success {
4203
+ .status-circle.positive {
4221
4204
  background-color: var(--color-sentiment-positive);
4222
4205
  }
4223
4206
  .tw-stepper {
@@ -2,66 +2,36 @@
2
2
  position: relative;
3
3
  z-index: 1060;
4
4
  }
5
- .np-bottom-sheet-v2-backdrop-container--enter,
6
- .np-bottom-sheet-v2-backdrop-container--leave {
7
- transition-property: opacity;
8
- transition-timing-function: ease-out;
9
- transition-duration: 300ms;
10
- }
11
- .np-bottom-sheet-v2-backdrop-container--enter-from,
12
- .np-bottom-sheet-v2-backdrop-container--leave-to {
13
- opacity: 0;
14
- }
15
5
  .np-bottom-sheet-v2-backdrop {
16
6
  position: fixed;
17
7
  inset: 0px;
18
8
  background-color: #37517e;
19
9
  background-color: var(--color-content-primary);
20
10
  opacity: 0.4;
11
+ transition-property: opacity;
12
+ transition-timing-function: ease-out;
13
+ transition-duration: 300ms;
14
+ }
15
+ .np-bottom-sheet-v2-backdrop--closed {
16
+ opacity: 0;
21
17
  }
22
18
  .np-bottom-sheet-v2 {
23
19
  position: fixed;
24
20
  inset: 0px;
21
+ bottom: env(keyboard-inset-height, 0px);
22
+ margin-left: 8px;
23
+ margin-left: var(--size-8);
24
+ margin-right: 8px;
25
+ margin-right: var(--size-8);
26
+ margin-top: 64px;
27
+ margin-top: var(--size-64);
25
28
  display: flex;
26
29
  flex-direction: column;
27
30
  justify-content: flex-end;
28
- padding-left: 8px;
29
- padding-left: var(--size-8);
30
- padding-right: 8px;
31
- padding-right: var(--size-8);
32
- padding-top: 64px;
33
- padding-top: var(--size-64);
34
31
  }
35
32
  .np-bottom-sheet-v2-content {
36
- max-height: 100%;
37
- }
38
- .np-bottom-sheet-v2-content--enter,
39
- .np-bottom-sheet-v2-content--leave {
40
- transition-property: transform;
41
- transition-timing-function: ease-out;
42
- transition-duration: 300ms;
43
- }
44
- @media (prefers-reduced-motion: reduce) {
45
- .np-bottom-sheet-v2-content--enter,
46
- .np-bottom-sheet-v2-content--leave {
47
- transition-property: opacity;
48
- }
49
- }
50
- @media (prefers-reduced-motion: no-preference) {
51
- .np-bottom-sheet-v2-content--enter-from,
52
- .np-bottom-sheet-v2-content--leave-to {
53
- transform: translateY(100%);
54
- }
55
- }
56
- @media (prefers-reduced-motion: reduce) {
57
- .np-bottom-sheet-v2-content--enter-from,
58
- .np-bottom-sheet-v2-content--leave-to {
59
- opacity: 0;
60
- }
61
- }
62
- .np-bottom-sheet-v2-content-inner-container {
63
33
  display: flex;
64
- height: 100%;
34
+ max-height: 100%;
65
35
  flex-direction: column;
66
36
  border-top-left-radius: 32px;
67
37
  /* TODO: Tokenize */
@@ -71,30 +41,45 @@
71
41
  background-color: var(--color-background-elevated);
72
42
  box-shadow: 0 0 40px rgba(69, 71, 69, 0.2);
73
43
  }
74
- .np-bottom-sheet-v2-content-inner-container:focus {
44
+ .np-bottom-sheet-v2-content:focus {
75
45
  outline: none;
76
46
  }
47
+ @media (prefers-reduced-motion: no-preference) {
48
+ .np-bottom-sheet-v2-content {
49
+ transition-property: transform;
50
+ transition-timing-function: ease-out;
51
+ transition-duration: 300ms;
52
+ }
53
+ .np-bottom-sheet-v2-content--closed {
54
+ transform: translateY(100%);
55
+ }
56
+ }
57
+ @media (prefers-reduced-motion: reduce) {
58
+ .np-bottom-sheet-v2-content {
59
+ transition-property: opacity;
60
+ transition-timing-function: ease-out;
61
+ transition-duration: 300ms;
62
+ }
63
+ .np-bottom-sheet-v2-content--closed {
64
+ opacity: 0;
65
+ }
66
+ }
77
67
  .np-bottom-sheet-v2-header {
78
68
  align-self: flex-end;
79
69
  padding: 16px;
80
70
  padding: var(--size-16);
81
71
  }
82
72
  .np-bottom-sheet-v2-content-inner {
83
- padding-top: 0px;
84
- display: grid;
85
- grid-row-gap: 8px;
86
- grid-row-gap: var(--size-8);
73
+ display: flex;
74
+ flex-direction: column;
87
75
  row-gap: 8px;
88
76
  row-gap: var(--size-8);
89
- overflow-y: auto;
90
- grid-template-rows: repeat(1, minmax(0, 1fr));
91
- }
92
- .np-bottom-sheet-v2-content-inner--has-title {
93
- grid-template-rows: auto 1fr;
77
+ overflow: auto;
94
78
  }
95
79
  .np-bottom-sheet-v2-content-inner--padding-md {
96
80
  padding: 16px;
97
81
  padding: var(--size-16);
82
+ padding-top: 0px;
98
83
  }
99
84
  .np-bottom-sheet-v2-title {
100
85
  color: #37517e;
@@ -2400,66 +2400,36 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2400
2400
  position: relative;
2401
2401
  z-index: 1060;
2402
2402
  }
2403
- .np-bottom-sheet-v2-backdrop-container--enter,
2404
- .np-bottom-sheet-v2-backdrop-container--leave {
2405
- transition-property: opacity;
2406
- transition-timing-function: ease-out;
2407
- transition-duration: 300ms;
2408
- }
2409
- .np-bottom-sheet-v2-backdrop-container--enter-from,
2410
- .np-bottom-sheet-v2-backdrop-container--leave-to {
2411
- opacity: 0;
2412
- }
2413
2403
  .np-bottom-sheet-v2-backdrop {
2414
2404
  position: fixed;
2415
2405
  inset: 0px;
2416
2406
  background-color: #37517e;
2417
2407
  background-color: var(--color-content-primary);
2418
2408
  opacity: 0.4;
2409
+ transition-property: opacity;
2410
+ transition-timing-function: ease-out;
2411
+ transition-duration: 300ms;
2412
+ }
2413
+ .np-bottom-sheet-v2-backdrop--closed {
2414
+ opacity: 0;
2419
2415
  }
2420
2416
  .np-bottom-sheet-v2 {
2421
2417
  position: fixed;
2422
2418
  inset: 0px;
2419
+ bottom: env(keyboard-inset-height, 0px);
2420
+ margin-left: 8px;
2421
+ margin-left: var(--size-8);
2422
+ margin-right: 8px;
2423
+ margin-right: var(--size-8);
2424
+ margin-top: 64px;
2425
+ margin-top: var(--size-64);
2423
2426
  display: flex;
2424
2427
  flex-direction: column;
2425
2428
  justify-content: flex-end;
2426
- padding-left: 8px;
2427
- padding-left: var(--size-8);
2428
- padding-right: 8px;
2429
- padding-right: var(--size-8);
2430
- padding-top: 64px;
2431
- padding-top: var(--size-64);
2432
2429
  }
2433
2430
  .np-bottom-sheet-v2-content {
2434
- max-height: 100%;
2435
- }
2436
- .np-bottom-sheet-v2-content--enter,
2437
- .np-bottom-sheet-v2-content--leave {
2438
- transition-property: transform;
2439
- transition-timing-function: ease-out;
2440
- transition-duration: 300ms;
2441
- }
2442
- @media (prefers-reduced-motion: reduce) {
2443
- .np-bottom-sheet-v2-content--enter,
2444
- .np-bottom-sheet-v2-content--leave {
2445
- transition-property: opacity;
2446
- }
2447
- }
2448
- @media (prefers-reduced-motion: no-preference) {
2449
- .np-bottom-sheet-v2-content--enter-from,
2450
- .np-bottom-sheet-v2-content--leave-to {
2451
- transform: translateY(100%);
2452
- }
2453
- }
2454
- @media (prefers-reduced-motion: reduce) {
2455
- .np-bottom-sheet-v2-content--enter-from,
2456
- .np-bottom-sheet-v2-content--leave-to {
2457
- opacity: 0;
2458
- }
2459
- }
2460
- .np-bottom-sheet-v2-content-inner-container {
2461
2431
  display: flex;
2462
- height: 100%;
2432
+ max-height: 100%;
2463
2433
  flex-direction: column;
2464
2434
  border-top-left-radius: 32px;
2465
2435
  /* TODO: Tokenize */
@@ -2469,30 +2439,45 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2469
2439
  background-color: var(--color-background-elevated);
2470
2440
  box-shadow: 0 0 40px rgba(69, 71, 69, 0.2);
2471
2441
  }
2472
- .np-bottom-sheet-v2-content-inner-container:focus {
2442
+ .np-bottom-sheet-v2-content:focus {
2473
2443
  outline: none;
2474
2444
  }
2445
+ @media (prefers-reduced-motion: no-preference) {
2446
+ .np-bottom-sheet-v2-content {
2447
+ transition-property: transform;
2448
+ transition-timing-function: ease-out;
2449
+ transition-duration: 300ms;
2450
+ }
2451
+ .np-bottom-sheet-v2-content--closed {
2452
+ transform: translateY(100%);
2453
+ }
2454
+ }
2455
+ @media (prefers-reduced-motion: reduce) {
2456
+ .np-bottom-sheet-v2-content {
2457
+ transition-property: opacity;
2458
+ transition-timing-function: ease-out;
2459
+ transition-duration: 300ms;
2460
+ }
2461
+ .np-bottom-sheet-v2-content--closed {
2462
+ opacity: 0;
2463
+ }
2464
+ }
2475
2465
  .np-bottom-sheet-v2-header {
2476
2466
  align-self: flex-end;
2477
2467
  padding: 16px;
2478
2468
  padding: var(--size-16);
2479
2469
  }
2480
2470
  .np-bottom-sheet-v2-content-inner {
2481
- padding-top: 0px;
2482
- display: grid;
2483
- grid-row-gap: 8px;
2484
- grid-row-gap: var(--size-8);
2471
+ display: flex;
2472
+ flex-direction: column;
2485
2473
  row-gap: 8px;
2486
2474
  row-gap: var(--size-8);
2487
- overflow-y: auto;
2488
- grid-template-rows: repeat(1, minmax(0, 1fr));
2489
- }
2490
- .np-bottom-sheet-v2-content-inner--has-title {
2491
- grid-template-rows: auto 1fr;
2475
+ overflow: auto;
2492
2476
  }
2493
2477
  .np-bottom-sheet-v2-content-inner--padding-md {
2494
2478
  padding: 16px;
2495
2479
  padding: var(--size-16);
2480
+ padding-top: 0px;
2496
2481
  }
2497
2482
  .np-bottom-sheet-v2-title {
2498
2483
  color: #37517e;
@@ -4208,16 +4193,14 @@ html:not([dir="rtl"]) .np-navigation-option {
4208
4193
  height: var(--size-32);
4209
4194
  }
4210
4195
  }
4211
- .status-circle.negative,
4212
- .status-circle.error {
4196
+ .status-circle.negative {
4213
4197
  background-color: var(--color-sentiment-negative);
4214
4198
  }
4215
4199
  .status-circle.neutral {
4216
4200
  background-color: #5d7079;
4217
4201
  background-color: var(--color-content-secondary);
4218
4202
  }
4219
- .status-circle.positive,
4220
- .status-circle.success {
4203
+ .status-circle.positive {
4221
4204
  background-color: var(--color-sentiment-positive);
4222
4205
  }
4223
4206
  .tw-stepper {
@@ -66,15 +66,13 @@
66
66
  height: var(--size-32);
67
67
  }
68
68
  }
69
- .status-circle.negative,
70
- .status-circle.error {
69
+ .status-circle.negative {
71
70
  background-color: var(--color-sentiment-negative);
72
71
  }
73
72
  .status-circle.neutral {
74
73
  background-color: #5d7079;
75
74
  background-color: var(--color-content-secondary);
76
75
  }
77
- .status-circle.positive,
78
- .status-circle.success {
76
+ .status-circle.positive {
79
77
  background-color: var(--color-sentiment-positive);
80
78
  }
@@ -0,0 +1,2 @@
1
+ export declare function useVirtualKeyboard(): void;
2
+ //# sourceMappingURL=useVirtualKeyboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVirtualKeyboard.d.ts","sourceRoot":"","sources":["../../../../src/common/hooks/useVirtualKeyboard.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,SAajC"}
@@ -1,16 +1,11 @@
1
- import { Sentiment } from '../common';
2
1
  export type FieldProps = {
3
2
  /** `null` disables auto-generating the `id` attribute, falling back to nesting-based label association over setting `htmlFor` explicitly. */
4
3
  id?: string | null;
5
4
  label: React.ReactNode;
6
- /** @deprecated use `message` and `type={Sentiment.NEUTRAL}` prop instead */
7
5
  hint?: React.ReactNode;
8
- message?: React.ReactNode;
9
- /** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */
10
6
  error?: React.ReactNode;
11
- sentiment?: `${Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.POSITIVE | Sentiment.WARNING}`;
12
7
  className?: string;
13
8
  children?: React.ReactNode;
14
9
  };
15
- export declare const Field: ({ id, label, message: propMessage, sentiment: propType, className, children, ...props }: FieldProps) => import("react").JSX.Element;
10
+ export declare const Field: ({ id, label, hint, error, className, children }: FieldProps) => import("react").JSX.Element;
16
11
  //# sourceMappingURL=Field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/field/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAUtC,MAAM,MAAM,UAAU,GAAG;IACvB,6IAA6I;IAC7I,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,6EAA6E;IAC7E,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IACjG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,KAAK,4FAQf,UAAU,gCA4CZ,CAAC"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/field/Field.tsx"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAAG;IACvB,6IAA6I;IAC7I,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,KAAK,oDAAqD,UAAU,gCA8ChF,CAAC"}
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { Sentiment } from '../common';
3
3
  export interface InlineAlertProps {
4
4
  id?: string;
@@ -6,5 +6,5 @@ export interface InlineAlertProps {
6
6
  className?: string;
7
7
  children: ReactNode;
8
8
  }
9
- export default function InlineAlert({ id, type, className, children, }: InlineAlertProps): React.JSX.Element;
9
+ export default function InlineAlert({ id, type, className, children, }: InlineAlertProps): import("react").JSX.Element;
10
10
  //# sourceMappingURL=InlineAlert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineAlert.d.ts","sourceRoot":"","sources":["../../../src/inlineAlert/InlineAlert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAQ,MAAM,WAAW,CAAC;AAG5C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,EAAE,EACF,IAAgB,EAChB,SAAS,EACT,QAAQ,GACT,EAAE,gBAAgB,qBAmBlB"}
1
+ {"version":3,"file":"InlineAlert.d.ts","sourceRoot":"","sources":["../../../src/inlineAlert/InlineAlert.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,EAAE,EACF,IAAgB,EAChB,SAAS,EACT,QAAQ,GACT,EAAE,gBAAgB,+BAYlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"_BottomSheet.d.ts","sourceRoot":"","sources":["../../../src/inputs/_BottomSheet.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QACrB,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAChC,mBAAmB,EAAE,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK;YACvE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,aAAa,EACb,KAAK,EACL,eAAe,EACf,OAAc,EACd,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,gBAAgB,+BAmGlB"}
1
+ {"version":3,"file":"_BottomSheet.d.ts","sourceRoot":"","sources":["../../../src/inputs/_BottomSheet.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QACrB,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAChC,mBAAmB,EAAE,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK;YACvE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,aAAa,EACb,KAAK,EACL,eAAe,EACf,OAAc,EACd,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,gBAAgB,+BA4FlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-7709e0e",
3
+ "version": "0.0.0-experimental-94569f6",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -93,12 +93,12 @@
93
93
  "rollup": "^4.17.2",
94
94
  "storybook": "^8.1.10",
95
95
  "@transferwise/less-config": "3.1.0",
96
- "@transferwise/neptune-css": "0.0.0-experimental-7709e0e",
97
- "@wise/components-theming": "1.3.0"
96
+ "@wise/components-theming": "1.3.0",
97
+ "@transferwise/neptune-css": "14.10.0"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "@transferwise/icons": "^3.7.0",
101
- "@transferwise/neptune-css": "0.0.0-experimental-7709e0e",
101
+ "@transferwise/neptune-css": "^14.9.6",
102
102
  "@wise/art": "^2.7.0",
103
103
  "@wise/components-theming": "^1.0.0",
104
104
  "react": ">=18",
@@ -0,0 +1,16 @@
1
+ import { useEffect } from 'react';
2
+
3
+ export function useVirtualKeyboard() {
4
+ useEffect(() => {
5
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access, functional/immutable-data */
6
+ if ('virtualKeyboard' in navigator) {
7
+ (navigator.virtualKeyboard as any).overlaysContent = true;
8
+ }
9
+ return () => {
10
+ if ('virtualKeyboard' in navigator) {
11
+ (navigator.virtualKeyboard as any).overlaysContent = false;
12
+ }
13
+ };
14
+ /* eslint-enable @typescript-eslint/no-unsafe-member-access, functional/immutable-data */
15
+ }, []);
16
+ }
@@ -2,12 +2,10 @@ import { useState } from 'react';
2
2
 
3
3
  import { Input } from '../inputs/Input';
4
4
  import { Field } from './Field';
5
- import { Sentiment } from '../common';
6
5
 
7
6
  export default {
8
7
  component: Field,
9
8
  title: 'Field',
10
- tags: ['autodocs'],
11
9
  };
12
10
 
13
11
  export const Basic = () => {
@@ -19,22 +17,43 @@ export const Basic = () => {
19
17
  );
20
18
  };
21
19
 
22
- export const WithStatusMessages = () => {
20
+ export const WithErrorMessage = () => {
23
21
  const [value, setValue] = useState<string | undefined>('This is some text');
24
22
  return (
25
- <div>
26
- <Field label="Phone number" sentiment={Sentiment.POSITIVE} message="Positive message">
27
- <Input value={value} onChange={({ target }) => setValue(target.value)} />
28
- </Field>
29
- <Field label="Phone number" sentiment={Sentiment.WARNING} message="Warning message">
30
- <Input value={value} onChange={({ target }) => setValue(target.value)} />
31
- </Field>
32
- <Field label="Phone number" sentiment={Sentiment.NEGATIVE} message="This is a required field">
33
- <Input value={value} onChange={({ target }) => setValue(target.value)} />
34
- </Field>
35
- <Field label="Phone number" message="This is a helpful message">
36
- <Input value={value} onChange={({ target }) => setValue(target.value)} />
37
- </Field>
38
- </div>
23
+ <Field label="Phone number" error="This is a required field">
24
+ <Input value={value} onChange={({ target }) => setValue(target.value)} />
25
+ </Field>
26
+ );
27
+ };
28
+
29
+ export const WithHelp = () => {
30
+ const [value, setValue] = useState<string | undefined>('This is some text');
31
+ return (
32
+ <Field label="Phone number" hint="This is a helpful message">
33
+ <Input value={value} onChange={({ target }) => setValue(target.value)} />
34
+ </Field>
35
+ );
36
+ };
37
+
38
+ export const WithHelpAndErrorOnBlur = () => {
39
+ const [value, setValue] = useState<string | undefined>('This is some text');
40
+ const [error, setError] = useState<string | undefined>(undefined);
41
+ return (
42
+ <Field label="Phone number" hint="Please include country code" error={error}>
43
+ <Input
44
+ value={value}
45
+ onChange={({ target }) => {
46
+ setValue(target.value);
47
+ setError(undefined);
48
+ }}
49
+ onBlur={() => {
50
+ if (!value) {
51
+ setError('This is a required field');
52
+ } else {
53
+ setError(undefined);
54
+ }
55
+ }}
56
+ />
57
+ </Field>
39
58
  );
40
59
  };