Skip to content
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
62 changes: 62 additions & 0 deletions src/list/__tests__/list-item-artwork-min-width.scenario.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
Copyright (c) Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';

import Search from '../../icon/search';
import { ListItem, ListItemLabel, ARTWORK_SIZES } from '..';

export function Scenario() {
return (
<div style={{ width: '100px', padding: '24px', backgroundColor: 'lightgreen' }}>
<ListItem>
<ListItemLabel>No Artwork</ListItemLabel>
</ListItem>

<ListItem artwork={Search} artworkSize={ARTWORK_SIZES.SMALL}>
<ListItemLabel>Small Artwork</ListItemLabel>
</ListItem>

<ListItem artwork={Search} artworkSize={ARTWORK_SIZES.MEDIUM}>
<ListItemLabel>Medium Artwork</ListItemLabel>
</ListItem>

<ListItem artwork={Search} artworkSize={ARTWORK_SIZES.LARGE}>
<ListItemLabel>Large Artwork</ListItemLabel>
</ListItem>

<ListItem
artwork={() => (
<div
style={{
backgroundColor: 'lightskyblue',
width: '64px',
height: '24px',
}}
/>
)}
artworkSize={64}
>
<ListItemLabel>64px Artwork</ListItemLabel>
</ListItem>

<ListItem
artwork={() => (
<div
style={{
backgroundColor: 'lightskyblue',
width: '96px',
height: '24px',
}}
/>
)}
artworkSize={96}
>
<ListItemLabel>96px Artwork</ListItemLabel>
</ListItem>
</div>
);
}
2 changes: 2 additions & 0 deletions src/list/__tests__/list.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import { Scenario as ListItemArtworkMinWidth } from './list-item-artwork-min-width.scenario';
import { Scenario as ListItemArtworkSizes } from './list-item-artwork-sizes.scenario';
import { Scenario as ListItemMenuAdapter } from './list-item-menu-adapter.scenario';
import { Scenario as ListItemOverrides } from './list-item-overrides.scenario';
import { Scenario as ListItemRtl } from './list-item-rtl.scenario';
import { Scenario as ListItem } from './list-item.scenario';
import { Scenario as ListHeading } from './list-heading.scenario';

export const ItemArtworkMinWidth = () => <ListItemArtworkMinWidth />;
export const ItemArtworkSizes = () => <ListItemArtworkSizes />;
export const ItemMenuAdapter = () => <ListItemMenuAdapter />;
export const ItemOverrides = () => <ListItemOverrides />;
Expand Down
2 changes: 2 additions & 0 deletions src/list/styled-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const StyledArtworkContainer = styled<'div', StyledArtworkContainerProps>
return {
alignItems: 'center',
display: 'flex',
flexShrink: 0,
paddingLeft: $theme.sizing.scale600,
paddingRight: $theme.sizing.scale600,
};
Expand All @@ -87,6 +88,7 @@ export const StyledArtworkContainer = styled<'div', StyledArtworkContainerProps>
return {
alignItems: 'center',
display: 'flex',
flexShrink: 0,
justifyContent: 'center',
width: $theme.sizing.scale1600,
};
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.