Skip to content

Commit 943d022

Browse files
vladimir-kubaVladimir Kubantsev
andauthored
fix(Item): fixed item min width to 0 [#343] (#344)
Co-authored-by: Vladimir Kubantsev <[email protected]>
1 parent be53fc5 commit 943d022

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

src/components/AsideHeader/__stories__/AsideHeader.stories.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {PageLayout} from '../components/PageLayout/PageLayout';
99
import {PageLayoutAside} from '../components/PageLayout/PageLayoutAside';
1010

1111
import {AsideHeaderShowcase} from './AsideHeaderShowcase';
12-
import {menuItemsShowcase} from './moc';
12+
import {menuItemsClamped, menuItemsShowcase} from './moc';
1313

1414
import logoIcon from '../../../../.storybook/assets/logo.svg';
1515

@@ -181,3 +181,18 @@ const FallbackTemplate: StoryFn<typeof fallbackArgs> = ({
181181

182182
export const Fallback = FallbackTemplate.bind({});
183183
Fallback.args = fallbackArgs;
184+
185+
/** @type {StoryFn} */
186+
export function LineClamp() {
187+
const [compact, setCompact] = React.useState(false);
188+
return (
189+
<PageLayout compact={compact}>
190+
<PageLayoutAside
191+
logo={{icon: logoIcon, text: 'Line clamp', 'aria-label': 'Line clamp'}}
192+
menuItems={menuItemsClamped}
193+
onChangeCompact={setCompact}
194+
headerDecoration
195+
/>
196+
</PageLayout>
197+
);
198+
}

src/components/AsideHeader/__stories__/moc.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,44 @@ When in the woods you saw the young man, sole,
112112
And met the look of his extinguished eyes,
113113
Then did you sigh?
114114
`;
115+
116+
const MENU_ITEMS_CLAMPED_TITLE = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
117+
118+
const MENU_ITEMS_CLAMPED: MenuItem[] = [
119+
{
120+
id: 'text',
121+
title: MENU_ITEMS_CLAMPED_TITLE,
122+
icon: Gear,
123+
},
124+
{
125+
id: 'text-action',
126+
title: MENU_ITEMS_CLAMPED_TITLE,
127+
icon: Gear,
128+
type: 'action',
129+
},
130+
{
131+
id: 'text-link',
132+
title: MENU_ITEMS_CLAMPED_TITLE,
133+
icon: Gear,
134+
link: 'about:blank',
135+
},
136+
{
137+
id: 'text-link-action',
138+
title: MENU_ITEMS_CLAMPED_TITLE,
139+
icon: Gear,
140+
link: 'about:blank',
141+
type: 'action',
142+
},
143+
];
144+
145+
export const menuItemsClamped = MENU_ITEMS_CLAMPED.concat({
146+
id: 'divider',
147+
title: undefined,
148+
type: 'divider',
149+
}).concat(
150+
MENU_ITEMS_CLAMPED.map((item) => ({
151+
...item,
152+
id: item.id.concat('-new'),
153+
rightAdornment: renderTag('new'),
154+
})),
155+
);

src/components/CompositeBar/Item/Item.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ $block: '.#{variables.$ns}composite-bar-item';
2020
--_--item-selected-background-color-active: var(--g-color-base-selection);
2121

2222
display: flex;
23+
min-width: 0;
2324
width: 100%;
2425
height: 100%;
2526
align-items: center;

0 commit comments

Comments
 (0)