Skip to content

Commit

Permalink
[File Upload Component] Use forms.maxWidth styling from euiTheme (#20…
Browse files Browse the repository at this point in the history
…5947)

## Summary

Follows elastic/eui#8221
  • Loading branch information
tsullivan authored Jan 8, 2025
1 parent d6e28f7 commit 63c0d18
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
EuiText,
useEuiTheme,
useGeneratedHtmlId,
mathWithUnits,
} from '@elastic/eui';
import type {
EuiFilePickerClass,
Expand Down Expand Up @@ -80,15 +79,12 @@ export const FileUpload = React.forwardRef<EuiFilePickerClass, Props>(
const id = useGeneratedHtmlId({ prefix: 'filesFileUpload' });
const errorId = `${id}_error`;

// FIXME: add a token for this on euiTheme.components. https://github.com/elastic/eui/issues/8217
const formMaxWidth = mathWithUnits(euiTheme.size.base, (x) => x * 25);

return (
<div
data-test-subj="filesFileUpload"
css={[
css`
max-width: ${fullWidth ? '100%' : formMaxWidth};
max-width: ${fullWidth ? '100%' : euiTheme.components.forms.maxWidth};
`,
fullWidth ? styles.fullWidth : undefined,
compressed ? styles.horizontalContainer : undefined,
Expand Down

0 comments on commit 63c0d18

Please sign in to comment.