Skip to content

Commit ca7a9d9

Browse files
chore: deprecate Dropdown
1 parent 89c5bcb commit ca7a9d9

5 files changed

Lines changed: 28 additions & 0 deletions

File tree

apps/docs/docs/components/layout/Dropdown/webMetadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"storybook": "https://cds-storybook.coinbase.com/?path=/story/components-dropdown-dropdown--default",
55
"figma": "https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/%E2%9C%A8-CDS-Components?m=auto&node-id=465-13742&t=8hgl6nX25pIzCo0y-1",
66
"description": "An overlay that opens and closes.",
7+
"warning": "This component is deprecated. Please use Popover instead.",
78
"relatedComponents": [
89
{
910
"label": "Select",

packages/web/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@
148148
"types": "./dts/pagination/index.d.ts",
149149
"default": "./esm/pagination/index.js"
150150
},
151+
"./popover": {
152+
"types": "./dts/popover/index.d.ts",
153+
"default": "./esm/popover/index.js"
154+
},
151155
"./section-header": {
152156
"types": "./dts/section-header/index.d.ts",
153157
"default": "./esm/section-header/index.js"

packages/web/src/dropdown/Dropdown.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ const PopoverDropdown = memo(
215215
),
216216
);
217217

218+
/**
219+
* @deprecated Use Popover instead. This will be removed in a future major release.
220+
* @deprecationExpectedRemoval v10
221+
*/
218222
export const Dropdown = memo(
219223
forwardRef<DropdownRef, DropdownProps>(
220224
(

packages/web/src/dropdown/DropdownProps.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@ import type { SharedAccessibilityProps, SharedProps } from '@coinbase/cds-common
22

33
import { type PopoverProps } from '../overlays/popover/PopoverProps';
44

5+
/**
6+
* @deprecated Use Popover instead. This will be removed in a future major release.
7+
* @deprecationExpectedRemoval v10
8+
*/
59
export type DropdownRef = {
610
openMenu: () => void;
711
closeMenu: () => void;
812
};
913

14+
/**
15+
* @deprecated Use Popover instead. This will be removed in a future major release.
16+
* @deprecationExpectedRemoval v10
17+
*/
1018
export type DropdownInternalProps = DropdownProps & {
1119
visible: boolean;
1220
};
1321

22+
/**
23+
* @deprecated Use Popover instead. This will be removed in a future major release.
24+
* @deprecationExpectedRemoval v10
25+
*/
1426
export type DropdownProps = {
1527
/**
1628
* Enable to have Dropdown render its content inside a Modal as opposed to a relatively positioned Popover
@@ -77,6 +89,10 @@ export type DropdownProps = {
7789
'accessibilityLabel' | 'accessibilityLabelledBy' | 'accessibilityHint'
7890
>;
7991

92+
/**
93+
* @deprecated Use Popover instead. This will be removed in a future major release.
94+
* @deprecationExpectedRemoval v10
95+
*/
8096
export type DropdownRefProps = {
8197
openMenu: () => void;
8298
closeMenu: () => void;

packages/web/src/popover/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from '../overlays/popover/Popover';
2+
export * from '../overlays/popover/PopoverProps';
3+
export * from '../overlays/popover/usePopper';

0 commit comments

Comments
 (0)