Skip to content

Commit 1849ef6

Browse files
committed
More breadcrumbs stories
1 parent ec7841e commit 1849ef6

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

lib/src/breadcrumbs/Breadcrumbs.stories.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ const items = [
4848

4949
const Breadcrumbs = () => (
5050
<>
51-
<Title title="Breadcrumbs" theme="light" level={2} />
51+
<Title title="Default" theme="light" level={3} />
5252
<ExampleContainer>
53-
<Title title="Default" theme="light" level={3} />
5453
<DxcBreadcrumbs
5554
items={[
5655
{
@@ -72,28 +71,34 @@ const Breadcrumbs = () => (
7271
]}
7372
/>
7473
</ExampleContainer>
74+
<Title title="Collapsed variant" theme="light" level={3} />
7575
<ExampleContainer>
76-
<Title title="Collapsed variant" theme="light" level={3} />
7776
<DxcBreadcrumbs items={items} />
7877
</ExampleContainer>
78+
<Title title="Collapsed variant without root" theme="light" level={3} />
7979
<ExampleContainer>
80-
<Title title="Collapsed variant without root" theme="light" level={3} />
8180
<DxcBreadcrumbs items={items} showRoot={false} />
8281
</ExampleContainer>
82+
<Title title="Collapsed variant with dropdown menu opened" theme="light" level={3} />
83+
<ExampleContainer>
84+
<DxcContainer height="150px">
85+
<DxcBreadcrumbs items={items} />
86+
</DxcContainer>
87+
</ExampleContainer>
88+
<Title title="Focus state" theme="light" level={3} />
8389
<ExampleContainer pseudoState="pseudo-focus">
84-
<Title title="Focus state" theme="light" level={3} />
8590
<DxcBreadcrumbs items={items} />
8691
</ExampleContainer>
92+
<Title title="Hover state" theme="light" level={3} />
8793
<ExampleContainer pseudoState="pseudo-hover">
88-
<Title title="Hover state" theme="light" level={3} />
8994
<DxcBreadcrumbs items={items} />
9095
</ExampleContainer>
96+
<Title title="Active state" theme="light" level={3} />
9197
<ExampleContainer pseudoState="pseudo-active">
92-
<Title title="Active state" theme="light" level={3} />
9398
<DxcBreadcrumbs items={items} />
9499
</ExampleContainer>
100+
<Title title="Truncation and text ellipsis with tooltip (only when collapsed)" theme="light" level={3} />
95101
<ExampleContainer>
96-
<Title title="Truncation and text ellipsis with tooltip (only when collapsed)" theme="light" level={3} />
97102
<DxcContainer width="200px">
98103
<DxcBreadcrumbs
99104
items={[
@@ -118,8 +123,8 @@ const Breadcrumbs = () => (
118123
/>
119124
</DxcContainer>
120125
</ExampleContainer>
126+
<Title title="Truncation, text ellipsis with tooltip and without root" theme="light" level={3} />
121127
<ExampleContainer>
122-
<Title title="Truncation, text ellipsis with tooltip and without root" theme="light" level={3} />
123128
<DxcContainer width="200px">
124129
<DxcBreadcrumbs
125130
items={[
@@ -145,10 +150,10 @@ const Breadcrumbs = () => (
145150
/>
146151
</DxcContainer>
147152
</ExampleContainer>
153+
<Title title="Dropdown theming doesn't affect the collapsed trigger" theme="light" level={3} />
148154
<ExampleContainer>
149-
<Title title="Dropdown theming doesn't affect the collapsed trigger" theme="light" level={3} />
155+
<Title title="Opinionated theming" theme="light" level={4} />
150156
<ExampleContainer>
151-
<Title title="Opinionated theming" theme="light" level={4} />
152157
<HalstackProvider
153158
theme={{
154159
dropdown: {
@@ -161,8 +166,8 @@ const Breadcrumbs = () => (
161166
<DxcBreadcrumbs items={items} itemsBeforeCollapse={3} />
162167
</HalstackProvider>
163168
</ExampleContainer>
169+
<Title title="Advanced theming" theme="light" level={4} />
164170
<ExampleContainer>
165-
<Title title="Advanced theming" theme="light" level={4} />
166171
<HalstackProvider
167172
advancedTheme={{
168173
dropdown: {
@@ -178,16 +183,12 @@ const Breadcrumbs = () => (
178183
</HalstackProvider>
179184
</ExampleContainer>
180185
</ExampleContainer>
181-
<ExampleContainer expanded>
182-
<Title title="Collapsed variant with dropdown menu opened" theme="light" level={3} />
183-
<DxcBreadcrumbs items={items} />
184-
</ExampleContainer>
185186
</>
186187
);
187188

188189
export const Chromatic = Breadcrumbs.bind({});
189190
Chromatic.play = async ({ canvasElement }) => {
190191
const canvas = within(canvasElement);
191192
const dropdowns = canvas.getAllByRole("button");
192-
await userEvent.click(dropdowns[dropdowns.length - 1]);
193+
await userEvent.click(dropdowns[2]);
193194
};

0 commit comments

Comments
 (0)