@transferwise/components 0.0.0-experimental-94569f6 → 0.0.0-experimental-5769182

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,36 +2400,66 @@ 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
+ }
2403
2413
  .np-bottom-sheet-v2-backdrop {
2404
2414
  position: fixed;
2405
2415
  inset: 0px;
2406
2416
  background-color: #37517e;
2407
2417
  background-color: var(--color-content-primary);
2408
2418
  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;
2415
2419
  }
2416
2420
  .np-bottom-sheet-v2 {
2417
2421
  position: fixed;
2418
2422
  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);
2426
2423
  display: flex;
2427
2424
  flex-direction: column;
2428
2425
  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);
2429
2432
  }
2430
2433
  .np-bottom-sheet-v2-content {
2431
- display: flex;
2432
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
+ display: flex;
2462
+ height: 100%;
2433
2463
  flex-direction: column;
2434
2464
  border-top-left-radius: 32px;
2435
2465
  /* TODO: Tokenize */
@@ -2439,45 +2469,30 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2439
2469
  background-color: var(--color-background-elevated);
2440
2470
  box-shadow: 0 0 40px rgba(69, 71, 69, 0.2);
2441
2471
  }
2442
- .np-bottom-sheet-v2-content:focus {
2472
+ .np-bottom-sheet-v2-content-inner-container:focus {
2443
2473
  outline: none;
2444
2474
  }
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
- }
2465
2475
  .np-bottom-sheet-v2-header {
2466
2476
  align-self: flex-end;
2467
2477
  padding: 16px;
2468
2478
  padding: var(--size-16);
2469
2479
  }
2470
2480
  .np-bottom-sheet-v2-content-inner {
2471
- display: flex;
2472
- flex-direction: column;
2481
+ padding-top: 0px;
2482
+ display: grid;
2483
+ grid-row-gap: 8px;
2484
+ grid-row-gap: var(--size-8);
2473
2485
  row-gap: 8px;
2474
2486
  row-gap: var(--size-8);
2475
- overflow: auto;
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;
2476
2492
  }
2477
2493
  .np-bottom-sheet-v2-content-inner--padding-md {
2478
2494
  padding: 16px;
2479
2495
  padding: var(--size-16);
2480
- padding-top: 0px;
2481
2496
  }
2482
2497
  .np-bottom-sheet-v2-title {
2483
2498
  color: #37517e;
@@ -4193,14 +4208,16 @@ html:not([dir="rtl"]) .np-navigation-option {
4193
4208
  height: var(--size-32);
4194
4209
  }
4195
4210
  }
4196
- .status-circle.negative {
4211
+ .status-circle.negative,
4212
+ .status-circle.error {
4197
4213
  background-color: var(--color-sentiment-negative);
4198
4214
  }
4199
4215
  .status-circle.neutral {
4200
4216
  background-color: #5d7079;
4201
4217
  background-color: var(--color-content-secondary);
4202
4218
  }
4203
- .status-circle.positive {
4219
+ .status-circle.positive,
4220
+ .status-circle.success {
4204
4221
  background-color: var(--color-sentiment-positive);
4205
4222
  }
4206
4223
  .tw-stepper {
@@ -2,36 +2,66 @@
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
+ }
5
15
  .np-bottom-sheet-v2-backdrop {
6
16
  position: fixed;
7
17
  inset: 0px;
8
18
  background-color: #37517e;
9
19
  background-color: var(--color-content-primary);
10
20
  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;
17
21
  }
18
22
  .np-bottom-sheet-v2 {
19
23
  position: fixed;
20
24
  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);
28
25
  display: flex;
29
26
  flex-direction: column;
30
27
  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);
31
34
  }
32
35
  .np-bottom-sheet-v2-content {
33
- display: flex;
34
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
+ display: flex;
64
+ height: 100%;
35
65
  flex-direction: column;
36
66
  border-top-left-radius: 32px;
37
67
  /* TODO: Tokenize */
@@ -41,45 +71,30 @@
41
71
  background-color: var(--color-background-elevated);
42
72
  box-shadow: 0 0 40px rgba(69, 71, 69, 0.2);
43
73
  }
44
- .np-bottom-sheet-v2-content:focus {
74
+ .np-bottom-sheet-v2-content-inner-container:focus {
45
75
  outline: none;
46
76
  }
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
- }
67
77
  .np-bottom-sheet-v2-header {
68
78
  align-self: flex-end;
69
79
  padding: 16px;
70
80
  padding: var(--size-16);
71
81
  }
72
82
  .np-bottom-sheet-v2-content-inner {
73
- display: flex;
74
- flex-direction: column;
83
+ padding-top: 0px;
84
+ display: grid;
85
+ grid-row-gap: 8px;
86
+ grid-row-gap: var(--size-8);
75
87
  row-gap: 8px;
76
88
  row-gap: var(--size-8);
77
- overflow: auto;
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;
78
94
  }
79
95
  .np-bottom-sheet-v2-content-inner--padding-md {
80
96
  padding: 16px;
81
97
  padding: var(--size-16);
82
- padding-top: 0px;
83
98
  }
84
99
  .np-bottom-sheet-v2-title {
85
100
  color: #37517e;
@@ -2400,36 +2400,66 @@ 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
+ }
2403
2413
  .np-bottom-sheet-v2-backdrop {
2404
2414
  position: fixed;
2405
2415
  inset: 0px;
2406
2416
  background-color: #37517e;
2407
2417
  background-color: var(--color-content-primary);
2408
2418
  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;
2415
2419
  }
2416
2420
  .np-bottom-sheet-v2 {
2417
2421
  position: fixed;
2418
2422
  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);
2426
2423
  display: flex;
2427
2424
  flex-direction: column;
2428
2425
  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);
2429
2432
  }
2430
2433
  .np-bottom-sheet-v2-content {
2431
- display: flex;
2432
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
+ display: flex;
2462
+ height: 100%;
2433
2463
  flex-direction: column;
2434
2464
  border-top-left-radius: 32px;
2435
2465
  /* TODO: Tokenize */
@@ -2439,45 +2469,30 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2439
2469
  background-color: var(--color-background-elevated);
2440
2470
  box-shadow: 0 0 40px rgba(69, 71, 69, 0.2);
2441
2471
  }
2442
- .np-bottom-sheet-v2-content:focus {
2472
+ .np-bottom-sheet-v2-content-inner-container:focus {
2443
2473
  outline: none;
2444
2474
  }
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
- }
2465
2475
  .np-bottom-sheet-v2-header {
2466
2476
  align-self: flex-end;
2467
2477
  padding: 16px;
2468
2478
  padding: var(--size-16);
2469
2479
  }
2470
2480
  .np-bottom-sheet-v2-content-inner {
2471
- display: flex;
2472
- flex-direction: column;
2481
+ padding-top: 0px;
2482
+ display: grid;
2483
+ grid-row-gap: 8px;
2484
+ grid-row-gap: var(--size-8);
2473
2485
  row-gap: 8px;
2474
2486
  row-gap: var(--size-8);
2475
- overflow: auto;
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;
2476
2492
  }
2477
2493
  .np-bottom-sheet-v2-content-inner--padding-md {
2478
2494
  padding: 16px;
2479
2495
  padding: var(--size-16);
2480
- padding-top: 0px;
2481
2496
  }
2482
2497
  .np-bottom-sheet-v2-title {
2483
2498
  color: #37517e;
@@ -4193,14 +4208,16 @@ html:not([dir="rtl"]) .np-navigation-option {
4193
4208
  height: var(--size-32);
4194
4209
  }
4195
4210
  }
4196
- .status-circle.negative {
4211
+ .status-circle.negative,
4212
+ .status-circle.error {
4197
4213
  background-color: var(--color-sentiment-negative);
4198
4214
  }
4199
4215
  .status-circle.neutral {
4200
4216
  background-color: #5d7079;
4201
4217
  background-color: var(--color-content-secondary);
4202
4218
  }
4203
- .status-circle.positive {
4219
+ .status-circle.positive,
4220
+ .status-circle.success {
4204
4221
  background-color: var(--color-sentiment-positive);
4205
4222
  }
4206
4223
  .tw-stepper {
@@ -66,13 +66,15 @@
66
66
  height: var(--size-32);
67
67
  }
68
68
  }
69
- .status-circle.negative {
69
+ .status-circle.negative,
70
+ .status-circle.error {
70
71
  background-color: var(--color-sentiment-negative);
71
72
  }
72
73
  .status-circle.neutral {
73
74
  background-color: #5d7079;
74
75
  background-color: var(--color-content-secondary);
75
76
  }
76
- .status-circle.positive {
77
+ .status-circle.positive,
78
+ .status-circle.success {
77
79
  background-color: var(--color-sentiment-positive);
78
80
  }
@@ -1,11 +1,16 @@
1
+ import { Sentiment } from '../common';
1
2
  export type FieldProps = {
2
3
  /** `null` disables auto-generating the `id` attribute, falling back to nesting-based label association over setting `htmlFor` explicitly. */
3
4
  id?: string | null;
4
5
  label: React.ReactNode;
6
+ /** @deprecated use `message` and `type={Sentiment.NEUTRAL}` prop instead */
5
7
  hint?: React.ReactNode;
8
+ message?: React.ReactNode;
9
+ /** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */
6
10
  error?: React.ReactNode;
11
+ sentiment?: `${Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.POSITIVE | Sentiment.WARNING}`;
7
12
  className?: string;
8
13
  children?: React.ReactNode;
9
14
  };
10
- export declare const Field: ({ id, label, hint, error, className, children }: FieldProps) => import("react").JSX.Element;
15
+ export declare const Field: ({ id, label, message: propMessage, sentiment: propType, className, children, ...props }: FieldProps) => import("react").JSX.Element;
11
16
  //# sourceMappingURL=Field.d.ts.map
@@ -1 +1 @@
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
+ {"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,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { 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): import("react").JSX.Element;
9
+ export default function InlineAlert({ id, type, className, children, }: InlineAlertProps): 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":"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
+ {"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 +1 @@
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"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-94569f6",
3
+ "version": "0.0.0-experimental-5769182",
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
- "@wise/components-theming": "1.3.0",
97
- "@transferwise/neptune-css": "14.10.0"
96
+ "@transferwise/neptune-css": "0.0.0-experimental-5769182",
97
+ "@wise/components-theming": "1.3.0"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "@transferwise/icons": "^3.7.0",
101
- "@transferwise/neptune-css": "^14.9.6",
101
+ "@transferwise/neptune-css": "0.0.0-experimental-5769182",
102
102
  "@wise/art": "^2.7.0",
103
103
  "@wise/components-theming": "^1.0.0",
104
104
  "react": ">=18",
@@ -2,10 +2,12 @@ import { useState } from 'react';
2
2
 
3
3
  import { Input } from '../inputs/Input';
4
4
  import { Field } from './Field';
5
+ import { Sentiment } from '../common';
5
6
 
6
7
  export default {
7
8
  component: Field,
8
9
  title: 'Field',
10
+ tags: ['autodocs'],
9
11
  };
10
12
 
11
13
  export const Basic = () => {
@@ -17,43 +19,22 @@ export const Basic = () => {
17
19
  );
18
20
  };
19
21
 
20
- export const WithErrorMessage = () => {
22
+ export const WithStatusMessages = () => {
21
23
  const [value, setValue] = useState<string | undefined>('This is some text');
22
24
  return (
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>
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>
58
39
  );
59
40
  };
@@ -0,0 +1,33 @@
1
+ import { useState } from 'react';
2
+
3
+ import { Input } from '../inputs/Input';
4
+ import { Field } from './Field';
5
+ import { Sentiment } from '../common';
6
+
7
+ export default {
8
+ component: Field,
9
+ title: 'Field/Tests',
10
+ };
11
+
12
+ export const WithHelpAndErrorOnBlur = () => {
13
+ const [value, setValue] = useState('This is some text');
14
+ const [error, setError] = useState<string | undefined>(undefined);
15
+ return (
16
+ <Field
17
+ label="Phone number"
18
+ sentiment={error ? Sentiment.NEGATIVE : Sentiment.NEUTRAL}
19
+ message={error || 'Please include country code'}
20
+ >
21
+ <Input
22
+ value={value}
23
+ onChange={({ target }) => {
24
+ setValue(target.value);
25
+ setError(undefined);
26
+ }}
27
+ onBlur={() => {
28
+ setError('Something went wrong');
29
+ }}
30
+ />
31
+ </Field>
32
+ );
33
+ };