Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Defaults DropDown options display value to flex #951

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/short-islands-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@autoguru/overdrive': patch
---

DropDown options get default display flex
3 changes: 2 additions & 1 deletion packages/overdrive/lib/components/DropDown/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ import { EPositionerAlignment } from '../Positioner';

import { DropDownOptionsList } from './DropDownOptionsList';

type ButtonProps = Omit<ComponentProps<typeof Button>, 'is' | 'children'>;
type ButtonProps = Omit<ComponentProps<typeof Button>, 'is' | 'children' | 'onClick'>;
type FlyoutProps = Pick<ComponentProps<typeof Flyout>, 'alignment'>;

export interface Props extends ButtonProps, FlyoutProps {
children: ReactNode;
label: string;
icon?: IconType;
onClick?: ComponentProps<typeof Button>['onClick'];
}

export const DropDown = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ export const DropDownOption: FunctionComponent<Props> = ({
label,
icon,
className,
display='flex',
iconColour = 'dark',
is='button',
...boxProps
}) => {
const colourStyles = useTextStyles({ colour: iconColour });
return (
<Box
className={[styles.root, className]}
{...boxProps}
display={display}
paddingX="3"
paddingY="2"
is={is}
>
<Inline
noWrap
Expand Down