forked from carbon-design-system/carbon-for-ibm-dotcom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(breadcrumb): finish updating breadcrumb to sb v7 (carbon-design…
…-system#11310) Co-authored-by: kennylam <[email protected]>
- Loading branch information
Showing
4 changed files
with
141 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 0 additions & 116 deletions
116
packages/carbon-web-components/src/components/breadcrumb/breadcrumb-story.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
packages/carbon-web-components/src/components/breadcrumb/breadcrumb.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/** | ||
* @license | ||
* | ||
* Copyright IBM Corp. 2019, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { html } from 'lit'; | ||
import './breadcrumb'; | ||
import './breadcrumb-item'; | ||
import './breadcrumb-link'; | ||
import './breadcrumb-overflow-menu'; | ||
import '../overflow-menu/overflow-menu-body'; | ||
import './breadcrumb-skeleton'; | ||
import storyDocs from './breadcrumb.mdx'; | ||
|
||
const args = { | ||
ariaLabel: '', | ||
classes: '', | ||
noTrailingSlash: false, | ||
}; | ||
|
||
const argTypes = { | ||
ariaLabel: { | ||
control: 'text', | ||
description: 'Specify the label for the breadcrumb container.', | ||
name: 'aria-label', | ||
}, | ||
classes: { | ||
control: 'text', | ||
description: | ||
'Specify an optional className to be applied to the container node.', | ||
}, | ||
noTrailingSlash: { | ||
control: 'boolean', | ||
description: | ||
'Optional prop to omit the trailing slash for the breadcrumbs.', | ||
}, | ||
}; | ||
|
||
export const Default = { | ||
render: () => { | ||
return html` | ||
<cds-breadcrumb> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="/#">Breadcrumb 1</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="#">Breadcrumb 2</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="#">Breadcrumb 3</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link>Breadcrumb 4</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
</cds-breadcrumb> | ||
`; | ||
}, | ||
}; | ||
|
||
export const BreadcrumbWithOverflowMenu = { | ||
render: () => html` | ||
<cds-breadcrumb> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="/#">Breadcrumb 1</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="/#">Breadcrumb 2</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-overflow-menu> | ||
<cds-overflow-menu-body> | ||
<cds-overflow-menu-item>Breadcrumb 3</cds-overflow-menu-item> | ||
<cds-overflow-menu-item>Breadcrumb 4</cds-overflow-menu-item> | ||
</cds-overflow-menu-body> | ||
</cds-breadcrumb-overflow-menu> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="/#">Breadcrumb 5</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link>Breadcrumb 6</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
</cds-breadcrumb> | ||
`, | ||
}; | ||
|
||
export const Skeleton = { | ||
render: () => { | ||
return html` <cds-breadcrumb-skeleton> </cds-breadcrumb-skeleton> `; | ||
}, | ||
}; | ||
|
||
export const Playground = { | ||
args, | ||
argTypes, | ||
render: (args) => { | ||
const { ariaLabel, classes, noTrailingSlash } = args ?? {}; | ||
return html` | ||
<cds-breadcrumb | ||
?no-trailing-slash="${noTrailingSlash}" | ||
class="${classes}" | ||
aria-label="${ariaLabel}"> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="/#">Breadcrumb 1</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="#">Breadcrumb 2</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link href="#">Breadcrumb 3</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
<cds-breadcrumb-item> | ||
<cds-breadcrumb-link>Breadcrumb 4</cds-breadcrumb-link> | ||
</cds-breadcrumb-item> | ||
</cds-breadcrumb> | ||
`; | ||
}, | ||
}; | ||
|
||
const meta = { | ||
title: 'Components/Breadcrumb', | ||
parameters: { | ||
docs: { | ||
page: storyDocs, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; |