Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const sections = [
<tr>
<td>size</td>
<td>
<TableCode>'small' | 'medium' | 'large' | 'fillParent'</TableCode>
<TableCode>'small' | 'medium' | 'large' | 'fillParent' | 'fitContent'</TableCode>
</td>
<td>Size of the component.</td>
<td>
Expand Down
4 changes: 4 additions & 0 deletions packages/lib/src/select/Select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ const Select = () => (
<Title title="Fillparent size" theme="light" level={4} />
<DxcSelect label="Fillparent" options={singleOptions} size="fillParent" />
</ExampleContainer>
<ExampleContainer>
<Title title="FitContent size" theme="light" level={4} />
<DxcSelect label="FitContent" options={singleOptions} defaultValue="1" size="fitContent" />
</ExampleContainer>
<ExampleContainer>
<Title title="Different sizes inside a flex" theme="light" level={4} />
<DxcFlex justifyContent="space-between" gap="var(--spacing-gap-ml)">
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/select/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type CommonProps = {
/**
* Size of the component.
*/
size?: "small" | "medium" | "large" | "fillParent";
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
/**
* Value of the tabindex attribute.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/lib/src/select/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const sizes = {
medium: "360px",
large: "480px",
fillParent: "100%",
fitContent: "fit-content",
};

export const calculateWidth = (margin: SelectPropsType["margin"], size: SelectPropsType["size"]) =>
Expand Down
Loading