@coinbase/cds-web 8.52.0 → 8.52.2
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/CHANGELOG.md +12 -0
- package/dts/controls/Checkbox.d.ts +5 -3
- package/dts/controls/Checkbox.d.ts.map +1 -1
- package/dts/controls/Radio.d.ts +9 -2
- package/dts/controls/Radio.d.ts.map +1 -1
- package/dts/overlays/FocusTrap.d.ts +10 -4
- package/dts/overlays/FocusTrap.d.ts.map +1 -1
- package/dts/overlays/modal/Modal.d.ts +6 -13
- package/dts/overlays/modal/Modal.d.ts.map +1 -1
- package/dts/overlays/tray/Tray.d.ts +12 -22
- package/dts/overlays/tray/Tray.d.ts.map +1 -1
- package/esm/controls/Checkbox.js +0 -1
- package/esm/controls/Radio.css +1 -1
- package/esm/controls/Radio.js +3 -1
- package/esm/overlays/FocusTrap.js +4 -5
- package/esm/overlays/modal/Modal.js +3 -1
- package/esm/overlays/tray/Tray.js +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.52.2 (3/11/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Configure control borderWidth and controlColor. [[#457](https://github.com/coinbase/cds/pull/457)]
|
|
16
|
+
|
|
17
|
+
## 8.52.1 (3/11/2026 PST)
|
|
18
|
+
|
|
19
|
+
#### 🐞 Fixes
|
|
20
|
+
|
|
21
|
+
- Add keyboard scroll support to FocusTrap, Tray, and Modal. [[#481](https://github.com/coinbase/cds/pull/481)]
|
|
22
|
+
|
|
11
23
|
## 8.52.0 (3/10/2026 PST)
|
|
12
24
|
|
|
13
25
|
#### 🚀 Updates
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
3
3
|
import { type ControlBaseProps } from './Control';
|
|
4
|
-
export type
|
|
5
|
-
/**
|
|
4
|
+
export type CheckboxBaseProps<CheckboxValue extends string> = ControlBaseProps<CheckboxValue> & {
|
|
5
|
+
/**
|
|
6
|
+
* Sets the checked/active color of the checkbox.
|
|
6
7
|
* @default fgInverse
|
|
7
8
|
*/
|
|
8
9
|
controlColor?: ThemeVars.Color;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Sets the border width of the checkbox.
|
|
11
12
|
* @default 100
|
|
12
13
|
*/
|
|
13
14
|
borderWidth?: ThemeVars.BorderWidth;
|
|
14
15
|
};
|
|
16
|
+
export type CheckboxProps<CheckboxValue extends string> = CheckboxBaseProps<CheckboxValue>;
|
|
15
17
|
declare const CheckboxWithRef: <CheckboxValue extends string>(
|
|
16
18
|
props: CheckboxProps<CheckboxValue> & {
|
|
17
19
|
ref?: React.Ref<HTMLInputElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/controls/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAejE,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAyB3D,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/controls/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAejE,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAyB3D,MAAM,MAAM,iBAAiB,CAAC,aAAa,SAAS,MAAM,IAAI,gBAAgB,CAAC,aAAa,CAAC,GAAG;IAC9F;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,aAAa,SAAS,MAAM,IAAI,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAE3F,QAAA,MAAM,eAAe,EA4Ef,CAAC,aAAa,SAAS,MAAM,EACjC,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAE,KACxE,KAAK,CAAC,YAAY,CAAC;AAExB,eAAO,MAAM,QAAQ,EAA4B,OAAO,eAAe,GACrE,KAAK,CAAC,mBAAmB,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/dts/controls/Radio.d.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
3
3
|
import { type ControlBaseProps } from './Control';
|
|
4
|
-
export type
|
|
5
|
-
/**
|
|
4
|
+
export type RadioBaseProps<RadioValue extends string> = ControlBaseProps<RadioValue> & {
|
|
5
|
+
/**
|
|
6
|
+
* Sets the checked/active color of the radio.
|
|
6
7
|
* @default bgPrimary
|
|
7
8
|
*/
|
|
8
9
|
controlColor?: ThemeVars.Color;
|
|
10
|
+
/**
|
|
11
|
+
* Sets the border width of the radio.
|
|
12
|
+
* @default 100
|
|
13
|
+
*/
|
|
14
|
+
borderWidth?: ThemeVars.BorderWidth;
|
|
9
15
|
};
|
|
16
|
+
export type RadioProps<RadioValue extends string> = RadioBaseProps<RadioValue>;
|
|
10
17
|
declare const RadioWithRef: <RadioValue extends string>(
|
|
11
18
|
props: RadioProps<RadioValue> & {
|
|
12
19
|
ref?: React.Ref<HTMLInputElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../src/controls/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAcjE,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../src/controls/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAcjE,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAsC3D,MAAM,MAAM,cAAc,CAAC,UAAU,SAAS,MAAM,IAAI,gBAAgB,CAAC,UAAU,CAAC,GAAG;IACrF;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,UAAU,SAAS,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC;AAE/E,QAAA,MAAM,YAAY,EAqDZ,CAAC,UAAU,SAAS,MAAM,EAC9B,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAE,KAClE,KAAK,CAAC,YAAY,CAAC;AAExB,eAAO,MAAM,KAAK,EAAyB,OAAO,YAAY,GAC5D,KAAK,CAAC,mBAAmB,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -13,21 +13,27 @@ export type FocusTrapProps = {
|
|
|
13
13
|
* Disables the focus trap to allow normal keyboard navigation.
|
|
14
14
|
*/
|
|
15
15
|
disableFocusTrap?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* If `true`, the focus trap will include the trigger in the focus trap.
|
|
18
|
-
*/
|
|
19
|
-
includeTriggerInFocusTrap?: boolean;
|
|
20
16
|
/**
|
|
21
17
|
* If `true`, the focus trap will not automatically shift focus to itself when it opens, and
|
|
22
18
|
* replace it to the last focused element when it closes.
|
|
23
19
|
* @default false
|
|
24
20
|
*/
|
|
25
21
|
disableAutoFocus?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* If `true`, the focus trap will not allow arrow key navigation.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disableArrowKeyNavigation?: boolean;
|
|
26
27
|
/**
|
|
27
28
|
* If `true`, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
28
29
|
* @default false
|
|
29
30
|
*/
|
|
30
31
|
restoreFocusOnUnmount?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* If `true`, the focus trap will include the trigger in the focus trap.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
includeTriggerInFocusTrap?: boolean;
|
|
31
37
|
/**
|
|
32
38
|
* If `true`, the focus trap will respect negative `tabIndex` values, removing them from the list of focusable elements.
|
|
33
39
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusTrap.d.ts","sourceRoot":"","sources":["../../src/overlays/FocusTrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAOrD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,YAAY,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC;IAC1D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B
|
|
1
|
+
{"version":3,"file":"FocusTrap.d.ts","sourceRoot":"","sources":["../../src/overlays/FocusTrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAOrD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,YAAY,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC;IAC1D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAGF,eAAO,MAAM,eAAe,UAAiD,CAAC;AA+B9E,eAAO,MAAM,SAAS,4CA8SpB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { type ModalContextValue } from '@coinbase/cds-common/overlays/ModalContext';
|
|
3
3
|
import type { PositionStyles, SharedProps } from '@coinbase/cds-common/types';
|
|
4
4
|
import type { Position } from '@coinbase/cds-common/types/Position';
|
|
5
|
+
import { type FocusTrapProps } from '../FocusTrap';
|
|
5
6
|
import type { ModalWrapperProps } from './ModalWrapper';
|
|
6
7
|
type ModalChildrenRenderProps = {
|
|
7
8
|
closeModal: () => void;
|
|
@@ -9,7 +10,11 @@ type ModalChildrenRenderProps = {
|
|
|
9
10
|
export type ModalBaseProps = SharedProps &
|
|
10
11
|
ModalContextValue &
|
|
11
12
|
Pick<PositionStyles, 'zIndex'> &
|
|
12
|
-
Omit<ModalWrapperProps, 'onOverlayPress'> &
|
|
13
|
+
Omit<ModalWrapperProps, 'onOverlayPress'> &
|
|
14
|
+
Pick<
|
|
15
|
+
FocusTrapProps,
|
|
16
|
+
'disableFocusTrap' | 'focusTabIndexElements' | 'disableArrowKeyNavigation'
|
|
17
|
+
> & {
|
|
13
18
|
/** Component to render as the Modal content */
|
|
14
19
|
children?: React.ReactNode | React.FC<ModalChildrenRenderProps>;
|
|
15
20
|
/**
|
|
@@ -26,18 +31,6 @@ export type ModalBaseProps = SharedProps &
|
|
|
26
31
|
* @danger This is a migration escape hatch. It is not intended to be used normally.
|
|
27
32
|
*/
|
|
28
33
|
dangerouslySetPosition?: Position;
|
|
29
|
-
/**
|
|
30
|
-
* Set disableFocusTrap to disable keyboard listeners responsible for focus trap behavior
|
|
31
|
-
* This can be useful for scenarios like Yubikey 2fa
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
disableFocusTrap?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Allow any element with `tabIndex` attribute to be focusable in FocusTrap, rather than only focusing specific interactive element types like button.
|
|
37
|
-
* This can be useful when having long content in a Modal.
|
|
38
|
-
* @default false
|
|
39
|
-
*/
|
|
40
|
-
focusTabIndexElements?: boolean;
|
|
41
34
|
/**
|
|
42
35
|
* If `true`, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
43
36
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/overlays/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAO3F,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAMlG,OAAO,KAAK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AAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAEvE,eAAO,MAAM,KAAK,kIAmHjB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PinningDirection, SharedAccessibilityProps } from '@coinbase/cds-common';
|
|
3
3
|
import type { StylesAndClassNames } from '../../types';
|
|
4
|
+
import { type FocusTrapProps } from '../FocusTrap';
|
|
4
5
|
/**
|
|
5
6
|
* Static class names for Tray component parts.
|
|
6
7
|
* Use these selectors to target specific elements with CSS.
|
|
@@ -28,7 +29,10 @@ export declare const trayClassNames: {
|
|
|
28
29
|
export type TrayRenderChildren = React.FC<{
|
|
29
30
|
handleClose: () => void;
|
|
30
31
|
}>;
|
|
31
|
-
export type TrayBaseProps =
|
|
32
|
+
export type TrayBaseProps = Pick<
|
|
33
|
+
FocusTrapProps,
|
|
34
|
+
'focusTabIndexElements' | 'disableArrowKeyNavigation'
|
|
35
|
+
> & {
|
|
32
36
|
children?: React.ReactNode | TrayRenderChildren;
|
|
33
37
|
/** ReactNode to render as the Drawer header. Can be a ReactNode or a function that receives { handleClose }. */
|
|
34
38
|
header?: React.ReactNode | TrayRenderChildren;
|
|
@@ -80,22 +84,15 @@ export type TrayBaseProps = {
|
|
|
80
84
|
/** z-index for the tray overlay */
|
|
81
85
|
zIndex?: number;
|
|
82
86
|
/**
|
|
83
|
-
*
|
|
84
|
-
* This
|
|
87
|
+
* When true, the tray will use opacity animation instead of transform animation.
|
|
88
|
+
* This is useful for supporting reduced motion for accessibility.
|
|
85
89
|
*/
|
|
86
|
-
|
|
90
|
+
reduceMotion?: boolean;
|
|
87
91
|
/**
|
|
88
92
|
* If `true`, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
89
|
-
*
|
|
90
|
-
* WARNING: If you disable this, you need to ensure that focus is restored properly so it doesn't end up on the body
|
|
91
93
|
* @default true
|
|
92
94
|
*/
|
|
93
95
|
restoreFocusOnUnmount?: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* When true, the tray will use opacity animation instead of transform animation.
|
|
96
|
-
* This is useful for supporting reduced motion for accessibility.
|
|
97
|
-
*/
|
|
98
|
-
reduceMotion?: boolean;
|
|
99
96
|
/**
|
|
100
97
|
* Sets an accessible label for the close button.
|
|
101
98
|
* On web, maps to `aria-label` and defines a string value that labels an interactive element.
|
|
@@ -130,7 +127,7 @@ export type TrayRefProps = {
|
|
|
130
127
|
};
|
|
131
128
|
export declare const Tray: React.MemoExoticComponent<
|
|
132
129
|
React.ForwardRefExoticComponent<
|
|
133
|
-
{
|
|
130
|
+
Pick<FocusTrapProps, 'disableArrowKeyNavigation' | 'focusTabIndexElements'> & {
|
|
134
131
|
children?: React.ReactNode | TrayRenderChildren;
|
|
135
132
|
/** ReactNode to render as the Drawer header. Can be a ReactNode or a function that receives { handleClose }. */
|
|
136
133
|
header?: React.ReactNode | TrayRenderChildren;
|
|
@@ -182,22 +179,15 @@ export declare const Tray: React.MemoExoticComponent<
|
|
|
182
179
|
/** z-index for the tray overlay */
|
|
183
180
|
zIndex?: number;
|
|
184
181
|
/**
|
|
185
|
-
*
|
|
186
|
-
* This
|
|
182
|
+
* When true, the tray will use opacity animation instead of transform animation.
|
|
183
|
+
* This is useful for supporting reduced motion for accessibility.
|
|
187
184
|
*/
|
|
188
|
-
|
|
185
|
+
reduceMotion?: boolean;
|
|
189
186
|
/**
|
|
190
187
|
* If `true`, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
191
|
-
*
|
|
192
|
-
* WARNING: If you disable this, you need to ensure that focus is restored properly so it doesn't end up on the body
|
|
193
188
|
* @default true
|
|
194
189
|
*/
|
|
195
190
|
restoreFocusOnUnmount?: boolean;
|
|
196
|
-
/**
|
|
197
|
-
* When true, the tray will use opacity animation instead of transform animation.
|
|
198
|
-
* This is useful for supporting reduced motion for accessibility.
|
|
199
|
-
*/
|
|
200
|
-
reduceMotion?: boolean;
|
|
201
191
|
/**
|
|
202
192
|
* Sets an accessible label for the close button.
|
|
203
193
|
* On web, maps to `aria-label` and defines a string value that labels an interactive element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tray.d.ts","sourceRoot":"","sources":["../../../src/overlays/tray/Tray.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAa,MAAM,sBAAsB,CAAC;AA2BlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Tray.d.ts","sourceRoot":"","sources":["../../../src/overlays/tray/Tray.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAa,MAAM,sBAAsB,CAAC;AA2BlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAkE9D;;;GAGG;AACH,eAAO,MAAM,cAAc;IACzB,6BAA6B;;IAE7B,+BAA+B;;IAE/B,yCAAyC;;IAEzC,6BAA6B;;IAE7B,yBAAyB;;IAEzB,2BAA2B;;IAE3B,iGAAiG;;IAEjG,iGAAiG;;IAEjG,2BAA2B;;CAEnB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,WAAW,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,cAAc,EACd,uBAAuB,GAAG,2BAA2B,CACtD,GAAG;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,kBAAkB,CAAC;IAChD,gHAAgH;IAChH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,kBAAkB,CAAC;IAC9C,gHAAgH;IAChH,MAAM,CAAC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|
52
52
|
"aria-label": props.accessibilityLabel,
|
|
53
53
|
borderRadius: borderRadius,
|
|
54
|
-
borderWidth: borderWidth,
|
|
55
54
|
checked: checked,
|
|
56
55
|
elevation: elevation,
|
|
57
56
|
label: children,
|
package/esm/controls/Radio.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cds{.baseCss-b1rohblb{position:relative;-webkit-appearance:radio;-moz-appearance:radio;appearance:radio;width:var(--controlSize-radioSize);height:var(--controlSize-radioSize);border-style:solid;border-
|
|
1
|
+
@layer cds{.baseCss-b1rohblb{position:relative;-webkit-appearance:radio;-moz-appearance:radio;appearance:radio;width:var(--controlSize-radioSize);height:var(--controlSize-radioSize);border-style:solid;border-radius:var(--borderRadius-1000);-webkit-transition:border-color 0.2s linear;transition:border-color 0.2s linear;}.baseCss-b1rohblb:focus{outline:none;}.baseCss-b1rohblb:focus-visible{outline-style:solid;outline-width:2px;outline-color:var(--color-bgPrimary);outline-offset:2px;}}
|
package/esm/controls/Radio.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["children", "controlColor", "checked", "background", "borderColor", "elevation"];
|
|
1
|
+
const _excluded = ["children", "controlColor", "checked", "background", "borderColor", "borderWidth", "elevation"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -40,6 +40,7 @@ const RadioWithRef = /*#__PURE__*/forwardRef(function RadioWithRef(_ref2, ref) {
|
|
|
40
40
|
checked = false,
|
|
41
41
|
background = 'bg',
|
|
42
42
|
borderColor = checked ? controlColor : 'bgLineHeavy',
|
|
43
|
+
borderWidth = 100,
|
|
43
44
|
elevation
|
|
44
45
|
} = _ref2,
|
|
45
46
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
@@ -61,6 +62,7 @@ const RadioWithRef = /*#__PURE__*/forwardRef(function RadioWithRef(_ref2, ref) {
|
|
|
61
62
|
alignItems: "center",
|
|
62
63
|
background: background,
|
|
63
64
|
borderColor: borderColor,
|
|
65
|
+
borderWidth: borderWidth,
|
|
64
66
|
className: baseCss,
|
|
65
67
|
"data-filled": checked,
|
|
66
68
|
flexShrink: 0,
|
|
@@ -15,8 +15,9 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
15
15
|
onEscPress,
|
|
16
16
|
disableTypeFocus,
|
|
17
17
|
disableFocusTrap,
|
|
18
|
-
includeTriggerInFocusTrap,
|
|
19
18
|
disableAutoFocus,
|
|
19
|
+
disableArrowKeyNavigation,
|
|
20
|
+
includeTriggerInFocusTrap,
|
|
20
21
|
respectNegativeTabIndex,
|
|
21
22
|
focusTabIndexElements,
|
|
22
23
|
autoFocusDelay,
|
|
@@ -57,9 +58,7 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
57
58
|
const document = (_getBrowserGlobals2 = getBrowserGlobals()) === null || _getBrowserGlobals2 === void 0 ? void 0 : _getBrowserGlobals2.document;
|
|
58
59
|
const activeElement = document === null || document === void 0 ? void 0 : document.activeElement;
|
|
59
60
|
if (!element || !document) return;
|
|
60
|
-
|
|
61
|
-
const activeElementIsTextArea = activeElement && Array.from(textAreas).includes(activeElement);
|
|
62
|
-
if (activeElementIsTextArea && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
61
|
+
if (disableArrowKeyNavigation && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
63
62
|
return;
|
|
64
63
|
}
|
|
65
64
|
let focusableElements = Array.from(element.querySelectorAll(focusTabIndexElements ? FOCUSABLE_ELEMENTS_INCLUDING_TABINDEX : FOCUSABLE_ELEMENTS));
|
|
@@ -163,7 +162,7 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
163
162
|
if ((event.key === 'ArrowUp' && activeElementIsMenuItemOrOption || event.key === 'Tab' && event.shiftKey) && activeElementIndex) {
|
|
164
163
|
focusPrevElement();
|
|
165
164
|
}
|
|
166
|
-
}, [focusTabIndexElements, disableTypeFocus, respectNegativeTabIndex, includeTriggerInFocusTrap]);
|
|
165
|
+
}, [focusTabIndexElements, disableTypeFocus, disableArrowKeyNavigation, respectNegativeTabIndex, includeTriggerInFocusTrap]);
|
|
167
166
|
const handleKeyDown = useCallback(event => {
|
|
168
167
|
// Update the keystroke history
|
|
169
168
|
updateKeystrokeHistory(event.key);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["children", "visible", "onRequestClose", "disableOverlayPress", "disablePortal", "disableFocusTrap", "accessibilityLabelledBy", "accessibilityLabel", "focusTabIndexElements", "restoreFocusOnUnmount", "width", "dangerouslyDisableResponsiveness", "dangerouslySetPosition", "shouldCloseOnEscPress", "hideCloseButton", "hideDividers", "maxWidth"];
|
|
1
|
+
const _excluded = ["children", "visible", "onRequestClose", "disableOverlayPress", "disablePortal", "disableFocusTrap", "accessibilityLabelledBy", "accessibilityLabel", "focusTabIndexElements", "restoreFocusOnUnmount", "disableArrowKeyNavigation", "width", "dangerouslyDisableResponsiveness", "dangerouslySetPosition", "shouldCloseOnEscPress", "hideCloseButton", "hideDividers", "maxWidth"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -48,6 +48,7 @@ export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
48
48
|
accessibilityLabel,
|
|
49
49
|
focusTabIndexElements = false,
|
|
50
50
|
restoreFocusOnUnmount = true,
|
|
51
|
+
disableArrowKeyNavigation,
|
|
51
52
|
width,
|
|
52
53
|
dangerouslyDisableResponsiveness = false,
|
|
53
54
|
dangerouslySetPosition,
|
|
@@ -111,6 +112,7 @@ export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
111
112
|
testID: "modal-dialog-motion",
|
|
112
113
|
width: width !== null && width !== void 0 ? width : defaultWidth,
|
|
113
114
|
children: /*#__PURE__*/_jsx(FocusTrap, {
|
|
115
|
+
disableArrowKeyNavigation: disableArrowKeyNavigation,
|
|
114
116
|
disableFocusTrap: disableFocusTrap,
|
|
115
117
|
focusTabIndexElements: focusTabIndexElements,
|
|
116
118
|
onEscPress: shouldCloseOnEscPress ? handleClose : undefined,
|
|
@@ -108,6 +108,7 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
|
|
|
108
108
|
accessibilityLabelledBy,
|
|
109
109
|
focusTabIndexElements,
|
|
110
110
|
restoreFocusOnUnmount = true,
|
|
111
|
+
disableArrowKeyNavigation,
|
|
111
112
|
reduceMotion,
|
|
112
113
|
closeAccessibilityLabel = 'Close',
|
|
113
114
|
closeAccessibilityHint,
|
|
@@ -291,6 +292,7 @@ export const Tray = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tray(_ref
|
|
|
291
292
|
children: /*#__PURE__*/_jsx(DragMotionProvider, {
|
|
292
293
|
enabled: !preventDismiss,
|
|
293
294
|
children: /*#__PURE__*/_jsx(FocusTrap, {
|
|
295
|
+
disableArrowKeyNavigation: disableArrowKeyNavigation,
|
|
294
296
|
focusTabIndexElements: focusTabIndexElements,
|
|
295
297
|
onEscPress: preventDismiss ? undefined : handleClose,
|
|
296
298
|
restoreFocusOnUnmount: restoreFocusOnUnmount,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-web",
|
|
3
|
-
"version": "8.52.
|
|
3
|
+
"version": "8.52.2",
|
|
4
4
|
"description": "Coinbase Design System - Web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
"react-dom": "^18.3.1"
|
|
208
208
|
},
|
|
209
209
|
"dependencies": {
|
|
210
|
-
"@coinbase/cds-common": "^8.52.
|
|
210
|
+
"@coinbase/cds-common": "^8.52.2",
|
|
211
211
|
"@coinbase/cds-icons": "^5.12.0",
|
|
212
212
|
"@coinbase/cds-illustrations": "^4.32.0",
|
|
213
213
|
"@coinbase/cds-lottie-files": "^3.3.4",
|