Skip to content

Commit faa5c25

Browse files
committed
feat: Button - add support for fullWidth prop, Select Picker - option w-100 style
1 parent 554d915 commit faa5c25

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/Shared/Components/Button/Button.component.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ const Button = ({
137137
icon = null,
138138
ariaLabel = null,
139139
showAriaLabelInTippy = true,
140+
fullWidth = false,
140141
...props
141142
}: ButtonProps) => {
142143
const isDisabled = disabled || isLoading
@@ -171,7 +172,7 @@ const Button = ({
171172
<ButtonElement
172173
{...props}
173174
disabled={isDisabled}
174-
className={`br-4 flex cursor dc__tab-focus dc__position-rel dc__capitalize ${getButtonDerivedClass({ size, variant, style, isLoading, icon })} ${isDisabled ? 'dc__disabled' : ''}`}
175+
className={`br-4 flex cursor dc__tab-focus dc__position-rel dc__capitalize ${getButtonDerivedClass({ size, variant, style, isLoading, icon })} ${isDisabled ? 'dc__disabled' : ''} ${fullWidth ? 'w-100' : ''}`}
175176
data-testid={dataTestId}
176177
aria-label={ariaLabel}
177178
>

src/Shared/Components/Button/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ export type ButtonProps = (
8585
* @default false
8686
*/
8787
disabled?: boolean
88+
/**
89+
* Determines if the button should expand to fill the full width of its container.
90+
*
91+
* @default false
92+
*/
93+
fullWidth?: boolean
8894
} & (
8995
| {
9096
/**

src/Shared/Components/SelectPicker/common.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const SelectPickerOption = <OptionValue, IsMulti extends boolean>({
149149
disabled={isDisabled}
150150
/>
151151
)}
152-
<div className={`flex left ${showDescription ? 'top' : ''} dc__gap-8`}>
152+
<div className={`flex left w-100 ${showDescription ? 'top' : ''} dc__gap-8`}>
153153
{startIcon && (
154154
<div className="dc__no-shrink icon-dim-20 flex dc__fill-available-space">{startIcon}</div>
155155
)}

0 commit comments

Comments
 (0)