diff --git a/src/design-system/select/select-root.component.tsx b/src/design-system/select/select-root.component.tsx index 35374a8..11e08d8 100644 --- a/src/design-system/select/select-root.component.tsx +++ b/src/design-system/select/select-root.component.tsx @@ -3,6 +3,7 @@ import React from 'react'; import ChevronDownIcon from '@icons/ChevronDownComponent'; import * as Select from '@radix-ui/react-select'; +import cn from 'classnames'; import { Item, ItemRoot } from './select-item'; import * as cx from './select-root.component.css'; @@ -26,6 +27,8 @@ export type SelectRootProps = Pick< portalContainer?: HTMLElement; triggerTestId?: string; zIndex?: number; + fullWidth?: boolean; + className?: string; }; const isValidSelectRootChild = ( @@ -56,6 +59,8 @@ const isValidSelectRootChild = ( * @param variant The style variant. * @param triggerTestId The `data-testid` attribute, passed to the input trigger / root element. * @param zIndex The `z-index` applied to the ``. + * @param fullWidth If `true`, the select trigger and content will take the full width of the parent container. + * @param className The CSS class name applied to the root element. */ export const Root = ({ align = 'selected', @@ -73,6 +78,8 @@ export const Root = ({ variant = 'plain', triggerTestId, zIndex, + fullWidth = false, + className, }: Readonly): JSX.Element => { const [isOpen, setIsOpen] = React.useState(defaultOpen); @@ -87,9 +94,10 @@ export const Root = ({ onValueChange={onChange} > {showArrow && ( @@ -100,7 +108,12 @@ export const Root = ({ diff --git a/src/design-system/select/select.stories.tsx b/src/design-system/select/select.stories.tsx index 23294d8..2683ec2 100644 --- a/src/design-system/select/select.stories.tsx +++ b/src/design-system/select/select.stories.tsx @@ -275,6 +275,34 @@ const SelectRootVariants = (): JSX.Element => { ); }; +const FullWidth = (): JSX.Element => ( + + + void 0} + placeholder={placeholder} + showArrow + fullWidth + > + {options.map(option => ( + + ))} + + + +); + export const Overview = (): JSX.Element => ( @@ -283,6 +311,8 @@ export const Overview = (): JSX.Element => ( + + );