Skip to content

Commit b0885ef

Browse files
committed
chore: move props to internal
1 parent 3f22180 commit b0885ef

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

src/dropdown/interfaces.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,14 @@ export interface DropdownProps extends ExpandToViewport {
9191
onOutsideClick?: NonCancelableEventHandler<null>;
9292

9393
/**
94-
* Minimum width constraint for the dropdown.
95-
* - Number: minimum width in pixels
96-
* - 'trigger': dropdown will be at least as wide as the trigger
97-
* - undefined: no minimum constraint (fits content)
94+
* Minimum width constraint for the dropdown in pixels.
9895
*/
99-
minWidth?: DropdownWidthConstraint;
96+
minWidth?: number;
10097

10198
/**
102-
* Maximum width constraint for the dropdown.
103-
* - Number: maximum width in pixels
104-
* - 'trigger': dropdown cannot exceed the trigger width
105-
* - undefined: fit to content width (no max constraint)
99+
* Maximum width constraint for the dropdown in pixels.
106100
*/
107-
maxWidth?: DropdownWidthConstraint;
108-
109-
/**
110-
* Preferred alignment of the dropdown relative to its trigger.
111-
* The dropdown will attempt this alignment first, but will automatically
112-
* adjust if there's insufficient space on the preferred side.
113-
*/
114-
preferredAlignment?: DropdownAlignment;
101+
maxWidth?: number;
115102

116103
/**
117104
* Hides the block (top/bottom) borders of the dropdown content wrapper.

src/dropdown/internal.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ import {
2727
InteriorDropdownPosition,
2828
} from './dropdown-fit-handler';
2929
import { applyDropdownPositionRelativeToViewport, LogicalDOMRect } from './dropdown-position';
30-
import { DropdownProps } from './interfaces';
30+
import { DropdownAlignment, DropdownProps, DropdownWidthConstraint } from './interfaces';
3131

32-
interface InternalDropdownProps extends DropdownProps, InternalBaseComponentProps {
32+
interface InternalDropdownProps
33+
extends Omit<DropdownProps, 'minWidth' | 'maxWidth' | 'preferredAlignment'>,
34+
InternalBaseComponentProps {
3335
onMouseDown?: React.MouseEventHandler;
3436
contentKey?: string;
3537
dropdownId?: string;
@@ -39,6 +41,9 @@ interface InternalDropdownProps extends DropdownProps, InternalBaseComponentProp
3941
interior?: boolean;
4042
scrollable?: boolean;
4143
loopFocus?: boolean;
44+
minWidth?: DropdownWidthConstraint;
45+
maxWidth?: DropdownWidthConstraint;
46+
preferredAlignment?: DropdownAlignment;
4247
}
4348

4449
import styles from './styles.css.js';

0 commit comments

Comments
 (0)