@transferwise/components 46.3.0 → 46.4.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsivePanel.d.ts","sourceRoot":"","sources":["../../../../src/common/responsivePanel/ResponsivePanel.tsx"],"names":[],"mappings":";AAUA,QAAA,MAAM,eAAe;;;;;;;;;;;mGAuCpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ResponsivePanel.d.ts","sourceRoot":"","sources":["../../../../src/common/responsivePanel/ResponsivePanel.tsx"],"names":[],"mappings":";AAUA,QAAA,MAAM,eAAe;;;;;;;;;;;mGAsCpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dimmer.d.ts","sourceRoot":"","sources":["../../../src/dimmer/Dimmer.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,WAAW,EACX,cAAc,EACd,cAAc,EACd,WAAW,EAEZ,MAAM,WAAW,CAAC;AAOnB,eAAO,MAAM,cAAc,MAAM,CAAC;AAIlC,KAAK,WAAW,GAAG,WAAW,GAAG;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,eAAe,CAAC,EAAE,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;IAChE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,e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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,SAAS,CAAC,WAAW,CAAC,CAAC;IAC/C,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,+BAoGlB"}
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,KA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AE,MAAM,IAAI,CAAC;CACzB;AAID,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,IAAI,EACJ,aAAa,EACb,KAAK,EACL,IAAW,EACX,OAAc,EACd,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,YAAY,+BAkFd"}
1
+ {"version":3,"file":"_Popover.d.ts","sourceRoot":"","sources":["../../../src/inputs/_Popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAML,KAAK,SAAS,EAOf,MAAM,oBAAoB,CAAC;AAS5B,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,CAAC,IAAI,EAAE;QACpB,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,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,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;AAID,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,IAAI,EACJ,aAAa,EACb,KAAK,EACL,IAAW,EACX,OAAc,EACd,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,YAAY,+BAsFd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.3.0",
3
+ "version": "46.4.0",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -4,7 +4,7 @@ exports[`BottomSheet renders content when open 1`] = `
4
4
  <body>
5
5
  <div />
6
6
  <div
7
- class="np-theme-light"
7
+ class="np-theme-personal"
8
8
  >
9
9
  <span
10
10
  data-focus-scope-start="true"
@@ -22,7 +22,6 @@ const ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(
22
22
  }: PanelProps,
23
23
  reference,
24
24
  ) => {
25
- const { className: themeClassname } = useTheme();
26
25
  const { isMobile } = useLayout();
27
26
  if (isMobile) {
28
27
  return (
@@ -40,7 +39,7 @@ const ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(
40
39
  open={open}
41
40
  position={position}
42
41
  anchorRef={anchorRef}
43
- className={classNames(themeClassname, className)}
42
+ className={className}
44
43
  onClose={onClose}
45
44
  >
46
45
  {children}
@@ -183,7 +183,11 @@ const DimmerWrapper: React.ComponentType<{
183
183
  const { screenMode, theme } = useTheme();
184
184
 
185
185
  return open || hasNotExited ? (
186
- <ThemeProvider theme={theme} screenMode={screenMode} isNotRootProvider>
186
+ <ThemeProvider
187
+ theme="personal"
188
+ screenMode={theme === 'personal' ? screenMode : 'light'}
189
+ isNotRootProvider
190
+ >
187
191
  {children}
188
192
  </ThemeProvider>
189
193
  ) : (
@@ -68,7 +68,11 @@ export function BottomSheet({
68
68
  })}
69
69
 
70
70
  <FloatingPortal>
71
- <ThemeProvider theme={theme} screenMode={screenMode} isNotRootProvider>
71
+ <ThemeProvider
72
+ theme="personal"
73
+ screenMode={theme === 'personal' ? screenMode : 'light'}
74
+ isNotRootProvider
75
+ >
72
76
  <Transition
73
77
  show={open}
74
78
  className="np-bottom-sheet-v2-container"
@@ -90,7 +90,11 @@ export function Popover({
90
90
  })}
91
91
 
92
92
  <FloatingPortal>
93
- <ThemeProvider theme={theme} screenMode={screenMode} isNotRootProvider>
93
+ <ThemeProvider
94
+ theme="personal"
95
+ screenMode={theme === 'personal' ? screenMode : 'light'}
96
+ isNotRootProvider
97
+ >
94
98
  <Transition
95
99
  show={open}
96
100
  leave="transition-opacity"
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`Popover on desktop renders when is open 1`] = `
4
4
  <div
5
- class="np-panel np-panel--open np-theme-light np-popover__container"
5
+ class="np-panel np-panel--open np-popover__container"
6
6
  data-popper-escaped="true"
7
7
  data-popper-placement="right"
8
8
  data-popper-reference-hidden="true"
@@ -20,7 +20,7 @@ class RadioGroup extends Component {
20
20
  const { radios, name } = this.props;
21
21
  const { selectedValue } = this.state;
22
22
  return radios && radios.length > 0 ? (
23
- <>
23
+ <div role="radiogroup">
24
24
  {radios.map(({ id, avatar, value, label, disabled, secondary, readOnly }, index) => (
25
25
  <Radio
26
26
  // eslint-disable-next-line react/no-array-index-key
@@ -37,7 +37,7 @@ class RadioGroup extends Component {
37
37
  onChange={(value_) => this.handleOnChange(value_)}
38
38
  />
39
39
  ))}
40
- </>
40
+ </div>
41
41
  ) : null;
42
42
  }
43
43
  }
@@ -0,0 +1,16 @@
1
+ import { render, screen } from '@testing-library/react';
2
+
3
+ import RadioGroup from '.';
4
+
5
+ describe('RadioGroup', () => {
6
+ it('has accessible role', () => {
7
+ render(
8
+ <RadioGroup
9
+ name="currency"
10
+ radios={[{ label: 'USD' }, { label: 'EUR' }]}
11
+ onChange={() => {}}
12
+ />,
13
+ );
14
+ expect(screen.getByRole('radiogroup')).toBeInTheDocument();
15
+ });
16
+ });