-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Added new component six-breadcrumbs #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
9ad047e
feat: Added new component six-breadcrumbs
fortesp a5be53b
fix: renamed to six-breadcrumbs-item
fortesp 7dbfe4b
chore: prettier formatting
fortesp 0a04346
chore: more prettier formatting
fortesp 8db2b47
docs: update
fortesp 6e4c508
docs: readme.md update on multiple components
fortesp faa2825
chore: improved disabled comment
fortesp 37b29f6
chore: kebab case and comment
fortesp 4fe11f2
fix: six-button.scss import not correct
fortesp 7045c15
fix: changed entire way how its handled inspired by shoelace
fortesp 2ddf322
chore: fixed event comment
fortesp df47c16
chore: fixed event comment components.d.ts
fortesp b683d54
docs: readme.md
fortesp 00be4db
docs: readme.md
fortesp 2051153
fix: six-breadcrumbs-item.scss
fortesp eb33b08
fix: removed console.log
fortesp 6dc9e6f
fix: components.ts
fortesp ee6a6e4
fix: components.ts
fortesp ba00750
fix: components.ts
fortesp e93cc11
fix: components.ts
fortesp dbaf931
fix: components.ts
fortesp e8156fd
refactor: several other changes per comments
fortesp e32862f
fix: gap between icon and the button label
fortesp a64b436
style: added index.html paragraph
fortesp 44dac2d
fix: unit tests
fortesp 00060e0
chore: improve breadcrumbs component
dac7104
fix: Changes as per pennal comments
fortesp 3af9745
test: Changes as per pennal comments
fortesp 814b77b
fix: lint & prettier
fortesp 3e26723
chore: docs
fortesp 51df83b
chore: added examples to vue and react
fortesp db9f7f9
chore: prettier
fortesp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| export const components = ["six-alert","six-avatar","six-badge","six-button","six-card","six-checkbox","six-date","six-datepicker","six-details","six-dialog","six-drawer","six-dropdown","six-error","six-error-page","six-file-list","six-file-list-item","six-file-upload","six-footer","six-group-label","six-header","six-header-dropdown-item","six-header-item","six-header-menu-button","six-icon","six-icon-button","six-input","six-item-picker","six-language-switcher","six-layout-grid","six-logo","six-main-container","six-menu","six-menu-divider","six-menu-item","six-menu-label","six-picto","six-progress-bar","six-progress-ring","six-radio","six-range","six-rating","six-root","six-search-field","six-select","six-sidebar","six-sidebar-item","six-sidebar-item-group","six-spinner","six-stage-indicator","six-switch","six-tab","six-tab-group","six-tab-panel","six-tag","six-textarea","six-tile","six-timepicker","six-tooltip"]; | ||
| export const components = ["six-alert","six-avatar","six-badge","six-breadcrumbs","six-breadcrumbs-item","six-button","six-card","six-checkbox","six-date","six-datepicker","six-details","six-dialog","six-drawer","six-dropdown","six-error","six-error-page","six-file-list","six-file-list-item","six-file-upload","six-footer","six-group-label","six-header","six-header-dropdown-item","six-header-item","six-header-menu-button","six-icon","six-icon-button","six-input","six-item-picker","six-language-switcher","six-layout-grid","six-logo","six-main-container","six-menu","six-menu-divider","six-menu-item","six-menu-label","six-picto","six-progress-bar","six-progress-ring","six-radio","six-range","six-rating","six-root","six-search-field","six-select","six-sidebar","six-sidebar-item","six-sidebar-item-group","six-spinner","six-stage-indicator","six-switch","six-tab","six-tab-group","six-tab-panel","six-tag","six-textarea","six-tile","six-timepicker","six-tooltip"]; |
This file contains hidden or 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,78 @@ | ||
| # Breadcrumbs Item | ||
|
|
||
|
|
||
| Breadcrumb items are intended for use with the six-breadcrumbs component. For usage details, see the [six-breadcrumbs documentation](six-breadcrumbs.html). | ||
|
|
||
| <docs-demo-six-breadcrumbs-item-0></docs-demo-six-breadcrumbs-item-0> | ||
|
|
||
| ```html | ||
| <six-breadcrumbs> | ||
| <six-breadcrumbs-item>A</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>B</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>C</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| <!-- Auto Generated Below --> | ||
|
|
||
|
|
||
| ## Overview | ||
|
|
||
| Breadcrumb items are used inside breadcrumbs to represent different links. | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Attribute | Description | Type | Default | | ||
| | ---------- | ----------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- | ----------- | | ||
| | `href` | `href` | When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. | `string \| undefined` | `undefined` | | ||
| | `readonly` | `read-only` | Set to true to readonly the breadcrumb item. | `boolean` | `false` | | ||
| | `size` | `size` | The breadcrumbs item size. | `"large" \| "medium" \| "small"` | `'medium'` | | ||
| | `target` | `target` | Tells the browser where to open the link. Only used when `href` is set. | `"_blank" \| "_parent" \| "_self" \| "_top" \| undefined` | `undefined` | | ||
|
|
||
|
|
||
| ## Slots | ||
|
|
||
| | Slot | Description | | ||
| | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | | The breadcrumb itemβs label. | | ||
| | `"prefix"` | An optional prefix, usually an icon or icon button. | | ||
| | `"separator"` | The separator to use for the breadcrumb item. This will only change the separator for this item. If you want to change it for all items in the group, set the separator on six-breadcrumbs instead. | | ||
| | `"suffix"` | An optional suffix, usually an icon or icon button. | | ||
|
|
||
|
|
||
| ## Shadow Parts | ||
|
|
||
| | Part | Description | | ||
| | ------------- | -------------------------------- | | ||
| | `"base"` | The component's base wrapper. | | ||
| | `"button"` | The button that renders the item | | ||
| | `"separator"` | The separator | | ||
|
|
||
|
|
||
| ## CSS Custom Properties | ||
|
|
||
| | Name | Description | | ||
| | ------------------- | -------------------------------------- | | ||
| | `--last-item-color` | The color of the last breadcrumbs item | | ||
| | `--separator-color` | The color of the separator | | ||
|
|
||
|
|
||
| ## Dependencies | ||
|
|
||
| ### Depends on | ||
|
|
||
| - [six-button](six-button.html) | ||
|
|
||
| ### Graph | ||
| ```mermaid | ||
| graph TD; | ||
| six-breadcrumbs-item --> six-button | ||
| six-button --> six-spinner | ||
| style six-breadcrumbs-item fill:#f9f,stroke:#333,stroke-width:4px | ||
| ``` | ||
|
|
||
| ---------------------------------------------- | ||
|
|
||
| Copyright Β© 2021-present SIX-Group | ||
This file contains hidden or 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,179 @@ | ||
| # Breadcrumbs | ||
|
|
||
|
|
||
| Breadcrumbs provide a group of links so users can easily navigate a websiteβs hierarchy. Breadcrumbs are usually placed before a pageβs main content with the current page shown last to indicate the userβs position in the navigation. | ||
|
|
||
| <docs-demo-six-breadcrumbs-0></docs-demo-six-breadcrumbs-0> | ||
|
|
||
| ```html | ||
| <six-breadcrumbs> | ||
| <six-breadcrumbs-item>A</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>B</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>C</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
| ``` | ||
|
|
||
|
|
||
| ## Custom Separators | ||
|
|
||
| Use the separator slot to change the separator that goes between breadcrumb items. Icons work well, but you can also use text or an image. | ||
|
|
||
| <docs-demo-six-breadcrumbs-1></docs-demo-six-breadcrumbs-1> | ||
|
|
||
| ```html | ||
| <six-breadcrumbs> | ||
| <six-icon slot="separator" size="small">arrow_forward</six-icon> | ||
| <six-breadcrumbs-item>A</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>B</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Current</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
| ``` | ||
|
|
||
|
|
||
| Using `separator-icon` attribute | ||
|
|
||
| <docs-demo-six-breadcrumbs-2></docs-demo-six-breadcrumbs-2> | ||
|
|
||
| ```html | ||
| <six-breadcrumbs separator-icon="arrow_forward"> | ||
| <six-breadcrumbs-item>A</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>B</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Current</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
| ``` | ||
|
|
||
|
|
||
| ## Prefixes | ||
|
|
||
| Use the prefix slot to add content before any breadcrumb item. | ||
|
|
||
| <docs-demo-six-breadcrumbs-3></docs-demo-six-breadcrumbs-3> | ||
|
|
||
| ```html | ||
| <six-breadcrumbs> | ||
| <six-icon slot="separator" size="small">arrow_forward</six-icon> | ||
| <six-breadcrumbs-item> | ||
| <six-icon slot="prefix" size="small">house</six-icon> | ||
| Home | ||
| </six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Page</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Current</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
| ``` | ||
|
|
||
|
|
||
| ## Suffixes | ||
|
|
||
| Use the suffix slot to add content after any breadcrumb item. | ||
|
|
||
| <docs-demo-six-breadcrumbs-4></docs-demo-six-breadcrumbs-4> | ||
|
|
||
| ```html | ||
| <six-breadcrumbs> | ||
| <six-icon slot="separator" size="small">arrow_forward</six-icon> | ||
| <six-breadcrumbs-item>Home</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Page</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item> | ||
| <six-icon slot="suffix" size="small">lock</six-icon> | ||
| Current | ||
| </six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
| ``` | ||
|
|
||
|
|
||
| ## Styling | ||
|
|
||
| Use CSS custom properties to customize the appearance of breadcrumb items. | ||
|
|
||
| <docs-demo-six-breadcrumbs-5></docs-demo-six-breadcrumbs-5> | ||
|
|
||
| ```html | ||
| <div class="parent"> | ||
| <six-breadcrumbs> | ||
| <six-icon slot="separator" size="small">arrow_forward</six-icon> | ||
| <six-breadcrumbs-item>Home</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Page</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Current</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
| </div> | ||
| ``` | ||
|
|
||
|
|
||
| ## Dynamically Add/Remove Items | ||
|
|
||
| Items can be dynamically added and removed. | ||
|
|
||
| <docs-demo-six-breadcrumbs-6></docs-demo-six-breadcrumbs-6> | ||
|
|
||
| ```html | ||
| <six-button type="secondary" id="remove-button">Remove</six-button> | ||
| <six-button type="secondary" id="add-button">Add</six-button> | ||
|
|
||
| <six-breadcrumbs id="dynamic-breadcrumbs"> | ||
| <six-breadcrumbs-item>Item 0</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Item 1</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
|
|
||
| <script type="module"> | ||
| let counter = 2; | ||
| const breadcrumbs = document.getElementById('dynamic-breadcrumbs'); | ||
|
|
||
| document.getElementById('remove-button').addEventListener('click', () => { | ||
| breadcrumbs.lastElementChild?.remove(); | ||
| }); | ||
|
|
||
| document.getElementById('add-button').addEventListener('click', () => { | ||
| const item = document.createElement('six-breadcrumbs-item'); | ||
| item.textContent = `Item ${counter++}`; | ||
| breadcrumbs.append(item); | ||
| }); | ||
| </script> | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| <!-- Auto Generated Below --> | ||
|
|
||
|
|
||
| ## Overview | ||
|
|
||
| Breadcrumbs provide a group of links so users can easily navigate a website's hierarchy. | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Attribute | Description | Type | Default | | ||
| | --------------- | ---------------- | --------------------------------------------------------------- | -------- | ------- | | ||
| | `separatorIcon` | `separator-icon` | Defines an icon as a separator without having to place a slot * | `string` | `''` | | ||
|
|
||
|
|
||
| ## Slots | ||
|
|
||
| | Slot | Description | | ||
| | ------------- | ------------------------------------------------------------------------ | | ||
| | | One or more breadcrumb items to display. | | ||
| | `"separator"` | The separator to use between breadcrumb items. Works best with six-icon. | | ||
|
|
||
|
|
||
| ## Shadow Parts | ||
|
|
||
| | Part | Description | | ||
| | -------- | ----------------------------- | | ||
| | `"base"` | The component's base wrapper. | | ||
|
|
||
|
|
||
| ## Dependencies | ||
|
|
||
| ### Depends on | ||
|
|
||
| - [six-icon](six-icon.html) | ||
|
|
||
| ### Graph | ||
| ```mermaid | ||
| graph TD; | ||
| six-breadcrumbs --> six-icon | ||
| style six-breadcrumbs fill:#f9f,stroke:#333,stroke-width:4px | ||
| ``` | ||
|
|
||
| ---------------------------------------------- | ||
|
|
||
| Copyright Β© 2021-present SIX-Group |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,20 @@ | ||
| <template> | ||
| <div> | ||
|
|
||
| <six-breadcrumbs> | ||
| <six-breadcrumbs-item>A</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>B</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>C</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
|
|
||
| </div> | ||
| </template> | ||
| <style> | ||
|
|
||
| </style> | ||
| <script> | ||
| export default { | ||
| name: 'docs-demo-six-breadcrumbs-0', | ||
| mounted() { } | ||
| } | ||
| </script> |
This file contains hidden or 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,21 @@ | ||
| <template> | ||
| <div> | ||
|
|
||
| <six-breadcrumbs> | ||
| <six-icon slot="separator" size="small">arrow_forward</six-icon> | ||
| <six-breadcrumbs-item>A</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>B</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Current</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
|
|
||
| </div> | ||
| </template> | ||
| <style> | ||
|
|
||
| </style> | ||
| <script> | ||
| export default { | ||
| name: 'docs-demo-six-breadcrumbs-1', | ||
| mounted() { } | ||
| } | ||
| </script> |
This file contains hidden or 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,20 @@ | ||
| <template> | ||
| <div> | ||
|
|
||
| <six-breadcrumbs separator-icon="arrow_forward"> | ||
| <six-breadcrumbs-item>A</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>B</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Current</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
|
|
||
| </div> | ||
| </template> | ||
| <style> | ||
|
|
||
| </style> | ||
| <script> | ||
| export default { | ||
| name: 'docs-demo-six-breadcrumbs-2', | ||
| mounted() { } | ||
| } | ||
| </script> |
This file contains hidden or 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,24 @@ | ||
| <template> | ||
| <div> | ||
|
|
||
| <six-breadcrumbs> | ||
| <six-icon slot="separator" size="small">arrow_forward</six-icon> | ||
| <six-breadcrumbs-item> | ||
| <six-icon slot="prefix" size="small">house</six-icon> | ||
| Home | ||
| </six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Page</six-breadcrumbs-item> | ||
| <six-breadcrumbs-item>Current</six-breadcrumbs-item> | ||
| </six-breadcrumbs> | ||
|
|
||
| </div> | ||
| </template> | ||
| <style> | ||
|
|
||
| </style> | ||
| <script> | ||
| export default { | ||
| name: 'docs-demo-six-breadcrumbs-3', | ||
| mounted() { } | ||
| } | ||
| </script> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.