@transferwise/components 0.0.0-experimental-dc27817 → 0.0.0-experimental-d675045

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
@@ -4637,15 +4637,15 @@ html:not([dir="rtl"]) .np-navigation-option {
4637
4637
  .segmented-control__segments {
4638
4638
  display: inline-flex;
4639
4639
  position: relative;
4640
+ padding: 4px;
4641
+ padding: var(--size-4);
4642
+ width: 100%;
4640
4643
  justify-content: center;
4641
4644
  align-items: center;
4642
4645
  background: rgba(134,167,189,0.10196);
4643
4646
  background: var(--color-background-neutral);
4644
- padding: 4px;
4645
- padding: var(--size-4);
4646
4647
  border-radius: 24px;
4647
4648
  border-radius: var(--size-24);
4648
- width: 100%;
4649
4649
  transition: outline 300ms;
4650
4650
  outline: 2px solid transparent;
4651
4651
  }
@@ -4654,16 +4654,16 @@ html:not([dir="rtl"]) .np-navigation-option {
4654
4654
  }
4655
4655
  .segmented-control__segments::after {
4656
4656
  content: "";
4657
- background: #ffffff;
4658
- background: var(--color-background-screen);
4659
- width: var(--segment-highlight-width);
4660
4657
  position: absolute;
4658
+ width: var(--segment-highlight-width);
4661
4659
  top: 4px;
4662
4660
  top: var(--size-4);
4663
4661
  bottom: 4px;
4664
4662
  bottom: var(--size-4);
4665
4663
  left: var(--segment-highlight-x);
4666
4664
  z-index: 0;
4665
+ background: #ffffff;
4666
+ background: var(--color-background-screen);
4667
4667
  border-radius: 24px;
4668
4668
  border-radius: var(--size-24);
4669
4669
  transition: left 300ms;
@@ -4675,19 +4675,21 @@ html:not([dir="rtl"]) .np-navigation-option {
4675
4675
  position: relative;
4676
4676
  flex: 1 1 100%;
4677
4677
  flex-flow: column;
4678
- min-width: 0;
4679
- align-items: center;
4680
- text-align: center;
4681
- vertical-align: middle;
4682
4678
  padding: 8px 16px;
4683
4679
  padding: var(--size-8) var(--size-16);
4684
4680
  margin: 0 0 0 4px;
4685
4681
  margin: 0 0 0 var(--size-4);
4682
+ min-width: 0;
4683
+ line-height: inherit;
4684
+ align-items: center;
4685
+ text-align: center;
4686
+ vertical-align: middle;
4686
4687
  border-radius: 24px;
4687
4688
  border-radius: var(--size-24);
4688
4689
  z-index: 1;
4689
4690
  cursor: pointer;
4690
4691
  transition: font-weight 300ms, background 300ms;
4692
+ color: var(--color-interactive-primary);
4691
4693
  }
4692
4694
  .segmented-control__segment:first-child {
4693
4695
  margin-left: 0;
@@ -4702,16 +4704,15 @@ html:not([dir="rtl"]) .np-navigation-option {
4702
4704
  pointer-events: none;
4703
4705
  }
4704
4706
  .segmented-control__button {
4707
+ width: 100%;
4708
+ height: 100%;
4705
4709
  background: none;
4706
4710
  -webkit-appearance: none;
4707
4711
  -moz-appearance: none;
4708
4712
  appearance: none;
4709
4713
  border: none;
4710
4714
  outline: none;
4711
- width: 100%;
4712
- height: 100%;
4713
4715
  font: inherit;
4714
- padding: none;
4715
4716
  outline: 2px solid transparent;
4716
4717
  }
4717
4718
  .segmented-control__button:focus {
@@ -4637,15 +4637,15 @@ html:not([dir="rtl"]) .np-navigation-option {
4637
4637
  .segmented-control__segments {
4638
4638
  display: inline-flex;
4639
4639
  position: relative;
4640
+ padding: 4px;
4641
+ padding: var(--size-4);
4642
+ width: 100%;
4640
4643
  justify-content: center;
4641
4644
  align-items: center;
4642
4645
  background: rgba(134,167,189,0.10196);
4643
4646
  background: var(--color-background-neutral);
4644
- padding: 4px;
4645
- padding: var(--size-4);
4646
4647
  border-radius: 24px;
4647
4648
  border-radius: var(--size-24);
4648
- width: 100%;
4649
4649
  transition: outline 300ms;
4650
4650
  outline: 2px solid transparent;
4651
4651
  }
@@ -4654,16 +4654,16 @@ html:not([dir="rtl"]) .np-navigation-option {
4654
4654
  }
4655
4655
  .segmented-control__segments::after {
4656
4656
  content: "";
4657
- background: #ffffff;
4658
- background: var(--color-background-screen);
4659
- width: var(--segment-highlight-width);
4660
4657
  position: absolute;
4658
+ width: var(--segment-highlight-width);
4661
4659
  top: 4px;
4662
4660
  top: var(--size-4);
4663
4661
  bottom: 4px;
4664
4662
  bottom: var(--size-4);
4665
4663
  left: var(--segment-highlight-x);
4666
4664
  z-index: 0;
4665
+ background: #ffffff;
4666
+ background: var(--color-background-screen);
4667
4667
  border-radius: 24px;
4668
4668
  border-radius: var(--size-24);
4669
4669
  transition: left 300ms;
@@ -4675,19 +4675,21 @@ html:not([dir="rtl"]) .np-navigation-option {
4675
4675
  position: relative;
4676
4676
  flex: 1 1 100%;
4677
4677
  flex-flow: column;
4678
- min-width: 0;
4679
- align-items: center;
4680
- text-align: center;
4681
- vertical-align: middle;
4682
4678
  padding: 8px 16px;
4683
4679
  padding: var(--size-8) var(--size-16);
4684
4680
  margin: 0 0 0 4px;
4685
4681
  margin: 0 0 0 var(--size-4);
4682
+ min-width: 0;
4683
+ line-height: inherit;
4684
+ align-items: center;
4685
+ text-align: center;
4686
+ vertical-align: middle;
4686
4687
  border-radius: 24px;
4687
4688
  border-radius: var(--size-24);
4688
4689
  z-index: 1;
4689
4690
  cursor: pointer;
4690
4691
  transition: font-weight 300ms, background 300ms;
4692
+ color: var(--color-interactive-primary);
4691
4693
  }
4692
4694
  .segmented-control__segment:first-child {
4693
4695
  margin-left: 0;
@@ -4702,16 +4704,15 @@ html:not([dir="rtl"]) .np-navigation-option {
4702
4704
  pointer-events: none;
4703
4705
  }
4704
4706
  .segmented-control__button {
4707
+ width: 100%;
4708
+ height: 100%;
4705
4709
  background: none;
4706
4710
  -webkit-appearance: none;
4707
4711
  -moz-appearance: none;
4708
4712
  appearance: none;
4709
4713
  border: none;
4710
4714
  outline: none;
4711
- width: 100%;
4712
- height: 100%;
4713
4715
  font: inherit;
4714
- padding: none;
4715
4716
  outline: 2px solid transparent;
4716
4717
  }
4717
4718
  .segmented-control__button:focus {
@@ -6,15 +6,15 @@
6
6
  .segmented-control__segments {
7
7
  display: inline-flex;
8
8
  position: relative;
9
+ padding: 4px;
10
+ padding: var(--size-4);
11
+ width: 100%;
9
12
  justify-content: center;
10
13
  align-items: center;
11
14
  background: rgba(134,167,189,0.10196);
12
15
  background: var(--color-background-neutral);
13
- padding: 4px;
14
- padding: var(--size-4);
15
16
  border-radius: 24px;
16
17
  border-radius: var(--size-24);
17
- width: 100%;
18
18
  transition: outline 300ms;
19
19
  outline: 2px solid transparent;
20
20
  }
@@ -23,16 +23,16 @@
23
23
  }
24
24
  .segmented-control__segments::after {
25
25
  content: "";
26
- background: #ffffff;
27
- background: var(--color-background-screen);
28
- width: var(--segment-highlight-width);
29
26
  position: absolute;
27
+ width: var(--segment-highlight-width);
30
28
  top: 4px;
31
29
  top: var(--size-4);
32
30
  bottom: 4px;
33
31
  bottom: var(--size-4);
34
32
  left: var(--segment-highlight-x);
35
33
  z-index: 0;
34
+ background: #ffffff;
35
+ background: var(--color-background-screen);
36
36
  border-radius: 24px;
37
37
  border-radius: var(--size-24);
38
38
  transition: left 300ms;
@@ -44,19 +44,21 @@
44
44
  position: relative;
45
45
  flex: 1 1 100%;
46
46
  flex-flow: column;
47
- min-width: 0;
48
- align-items: center;
49
- text-align: center;
50
- vertical-align: middle;
51
47
  padding: 8px 16px;
52
48
  padding: var(--size-8) var(--size-16);
53
49
  margin: 0 0 0 4px;
54
50
  margin: 0 0 0 var(--size-4);
51
+ min-width: 0;
52
+ line-height: inherit;
53
+ align-items: center;
54
+ text-align: center;
55
+ vertical-align: middle;
55
56
  border-radius: 24px;
56
57
  border-radius: var(--size-24);
57
58
  z-index: 1;
58
59
  cursor: pointer;
59
60
  transition: font-weight 300ms, background 300ms;
61
+ color: var(--color-interactive-primary);
60
62
  }
61
63
  .segmented-control__segment:first-child {
62
64
  margin-left: 0;
@@ -71,16 +73,15 @@
71
73
  pointer-events: none;
72
74
  }
73
75
  .segmented-control__button {
76
+ width: 100%;
77
+ height: 100%;
74
78
  background: none;
75
79
  -webkit-appearance: none;
76
80
  -moz-appearance: none;
77
81
  appearance: none;
78
82
  border: none;
79
83
  outline: none;
80
- width: 100%;
81
- height: 100%;
82
84
  font: inherit;
83
- padding: none;
84
85
  outline: 2px solid transparent;
85
86
  }
86
87
  .segmented-control__button:focus {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-dc27817",
3
+ "version": "0.0.0-experimental-d675045",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/main.css CHANGED
@@ -4637,15 +4637,15 @@ html:not([dir="rtl"]) .np-navigation-option {
4637
4637
  .segmented-control__segments {
4638
4638
  display: inline-flex;
4639
4639
  position: relative;
4640
+ padding: 4px;
4641
+ padding: var(--size-4);
4642
+ width: 100%;
4640
4643
  justify-content: center;
4641
4644
  align-items: center;
4642
4645
  background: rgba(134,167,189,0.10196);
4643
4646
  background: var(--color-background-neutral);
4644
- padding: 4px;
4645
- padding: var(--size-4);
4646
4647
  border-radius: 24px;
4647
4648
  border-radius: var(--size-24);
4648
- width: 100%;
4649
4649
  transition: outline 300ms;
4650
4650
  outline: 2px solid transparent;
4651
4651
  }
@@ -4654,16 +4654,16 @@ html:not([dir="rtl"]) .np-navigation-option {
4654
4654
  }
4655
4655
  .segmented-control__segments::after {
4656
4656
  content: "";
4657
- background: #ffffff;
4658
- background: var(--color-background-screen);
4659
- width: var(--segment-highlight-width);
4660
4657
  position: absolute;
4658
+ width: var(--segment-highlight-width);
4661
4659
  top: 4px;
4662
4660
  top: var(--size-4);
4663
4661
  bottom: 4px;
4664
4662
  bottom: var(--size-4);
4665
4663
  left: var(--segment-highlight-x);
4666
4664
  z-index: 0;
4665
+ background: #ffffff;
4666
+ background: var(--color-background-screen);
4667
4667
  border-radius: 24px;
4668
4668
  border-radius: var(--size-24);
4669
4669
  transition: left 300ms;
@@ -4675,19 +4675,21 @@ html:not([dir="rtl"]) .np-navigation-option {
4675
4675
  position: relative;
4676
4676
  flex: 1 1 100%;
4677
4677
  flex-flow: column;
4678
- min-width: 0;
4679
- align-items: center;
4680
- text-align: center;
4681
- vertical-align: middle;
4682
4678
  padding: 8px 16px;
4683
4679
  padding: var(--size-8) var(--size-16);
4684
4680
  margin: 0 0 0 4px;
4685
4681
  margin: 0 0 0 var(--size-4);
4682
+ min-width: 0;
4683
+ line-height: inherit;
4684
+ align-items: center;
4685
+ text-align: center;
4686
+ vertical-align: middle;
4686
4687
  border-radius: 24px;
4687
4688
  border-radius: var(--size-24);
4688
4689
  z-index: 1;
4689
4690
  cursor: pointer;
4690
4691
  transition: font-weight 300ms, background 300ms;
4692
+ color: var(--color-interactive-primary);
4691
4693
  }
4692
4694
  .segmented-control__segment:first-child {
4693
4695
  margin-left: 0;
@@ -4702,16 +4704,15 @@ html:not([dir="rtl"]) .np-navigation-option {
4702
4704
  pointer-events: none;
4703
4705
  }
4704
4706
  .segmented-control__button {
4707
+ width: 100%;
4708
+ height: 100%;
4705
4709
  background: none;
4706
4710
  -webkit-appearance: none;
4707
4711
  -moz-appearance: none;
4708
4712
  appearance: none;
4709
4713
  border: none;
4710
4714
  outline: none;
4711
- width: 100%;
4712
- height: 100%;
4713
4715
  font: inherit;
4714
- padding: none;
4715
4716
  outline: 2px solid transparent;
4716
4717
  }
4717
4718
  .segmented-control__button:focus {
@@ -6,15 +6,15 @@
6
6
  .segmented-control__segments {
7
7
  display: inline-flex;
8
8
  position: relative;
9
+ padding: 4px;
10
+ padding: var(--size-4);
11
+ width: 100%;
9
12
  justify-content: center;
10
13
  align-items: center;
11
14
  background: rgba(134,167,189,0.10196);
12
15
  background: var(--color-background-neutral);
13
- padding: 4px;
14
- padding: var(--size-4);
15
16
  border-radius: 24px;
16
17
  border-radius: var(--size-24);
17
- width: 100%;
18
18
  transition: outline 300ms;
19
19
  outline: 2px solid transparent;
20
20
  }
@@ -23,16 +23,16 @@
23
23
  }
24
24
  .segmented-control__segments::after {
25
25
  content: "";
26
- background: #ffffff;
27
- background: var(--color-background-screen);
28
- width: var(--segment-highlight-width);
29
26
  position: absolute;
27
+ width: var(--segment-highlight-width);
30
28
  top: 4px;
31
29
  top: var(--size-4);
32
30
  bottom: 4px;
33
31
  bottom: var(--size-4);
34
32
  left: var(--segment-highlight-x);
35
33
  z-index: 0;
34
+ background: #ffffff;
35
+ background: var(--color-background-screen);
36
36
  border-radius: 24px;
37
37
  border-radius: var(--size-24);
38
38
  transition: left 300ms;
@@ -44,19 +44,21 @@
44
44
  position: relative;
45
45
  flex: 1 1 100%;
46
46
  flex-flow: column;
47
- min-width: 0;
48
- align-items: center;
49
- text-align: center;
50
- vertical-align: middle;
51
47
  padding: 8px 16px;
52
48
  padding: var(--size-8) var(--size-16);
53
49
  margin: 0 0 0 4px;
54
50
  margin: 0 0 0 var(--size-4);
51
+ min-width: 0;
52
+ line-height: inherit;
53
+ align-items: center;
54
+ text-align: center;
55
+ vertical-align: middle;
55
56
  border-radius: 24px;
56
57
  border-radius: var(--size-24);
57
58
  z-index: 1;
58
59
  cursor: pointer;
59
60
  transition: font-weight 300ms, background 300ms;
61
+ color: var(--color-interactive-primary);
60
62
  }
61
63
  .segmented-control__segment:first-child {
62
64
  margin-left: 0;
@@ -71,16 +73,15 @@
71
73
  pointer-events: none;
72
74
  }
73
75
  .segmented-control__button {
76
+ width: 100%;
77
+ height: 100%;
74
78
  background: none;
75
79
  -webkit-appearance: none;
76
80
  -moz-appearance: none;
77
81
  appearance: none;
78
82
  border: none;
79
83
  outline: none;
80
- width: 100%;
81
- height: 100%;
82
84
  font: inherit;
83
- padding: none;
84
85
  outline: 2px solid transparent;
85
86
  }
86
87
  .segmented-control__button:focus {
@@ -7,12 +7,12 @@
7
7
  .segmented-control__segments {
8
8
  display: inline-flex;
9
9
  position: relative;
10
+ padding: var(--size-4);
11
+ width: 100%;
10
12
  justify-content: center;
11
13
  align-items: center;
12
14
  background: var(--color-background-neutral);
13
- padding: var(--size-4);
14
- border-radius: var(--size-24);
15
- width: 100%;
15
+ border-radius: var(--size-24);
16
16
  transition: outline 300ms;
17
17
  outline: 2px solid transparent;
18
18
  }
@@ -23,13 +23,13 @@
23
23
 
24
24
  .segmented-control__segments::after {
25
25
  content: "";
26
- background: var(--color-background-screen);
27
- width: var(--segment-highlight-width);
28
26
  position: absolute;
27
+ width: var(--segment-highlight-width);
29
28
  top: var(--size-4);
30
29
  bottom: var(--size-4);
31
30
  left: var(--segment-highlight-x);
32
31
  z-index: 0;
32
+ background: var(--color-background-screen);
33
33
  border-radius: var(--size-24);
34
34
  transition: left 300ms;
35
35
  }
@@ -42,16 +42,18 @@
42
42
  position: relative;
43
43
  flex: 1 1 100%;
44
44
  flex-flow: column;
45
+ padding: var(--size-8) var(--size-16);
46
+ margin: 0 0 0 var(--size-4);
45
47
  min-width: 0;
48
+ line-height: inherit;
46
49
  align-items: center;
47
50
  text-align: center;
48
51
  vertical-align: middle;
49
- padding: var(--size-8) var(--size-16);
50
- margin: 0 0 0 var(--size-4);
51
52
  border-radius: var(--size-24);
52
53
  z-index: 1;
53
54
  cursor: pointer;
54
55
  transition: font-weight 300ms, background 300ms;
56
+ color: var(--color-interactive-primary);
55
57
  }
56
58
 
57
59
  .segmented-control__segment:first-child {
@@ -69,14 +71,13 @@
69
71
  }
70
72
 
71
73
  .segmented-control__button {
74
+ width: 100%;
75
+ height: 100%;
72
76
  background: none;
73
77
  appearance: none;
74
78
  border: none;
75
79
  outline: none;
76
- width: 100%;
77
- height: 100%;
78
80
  font: inherit;
79
- padding: none;
80
81
  outline: 2px solid transparent;
81
82
  }
82
83
 
@@ -61,6 +61,13 @@ describe('SegmentedControl', () => {
61
61
  );
62
62
  });
63
63
 
64
+ it('default value is selected', () => {
65
+ renderSegmentedControl({ mode: 'view', segments: defaultSegmentsWithControls });
66
+
67
+ const accountingTab = screen.getByRole('tab', { name: 'Accounting' });
68
+ expect(accountingTab).toHaveAttribute('aria-selected', 'true');
69
+ });
70
+
64
71
  it('lets the user pick through the segments when it is set to input', () => {
65
72
  renderSegmentedControl();
66
73