Skip to content

Commit

Permalink
fix(breadcrumb): focus outline only on keyboard focus
Browse files Browse the repository at this point in the history
  • Loading branch information
mdt2 authored and pfulton committed Dec 1, 2023
1 parent ec96da6 commit 1f72c3e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
16 changes: 8 additions & 8 deletions components/breadcrumb/metadata/breadcrumb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ examples:
</li>
</ul>
</nav>
- id: breadcrumb
- id: breadcrumb-dragged
name: Dragged
status: Verified
markup: |
Expand All @@ -58,7 +58,7 @@ examples:
</li>
</ul>
</nav>
- id: breadcrumb
- id: breadcrumb-nested
name: Nested
status: Verified
markup: |
Expand Down Expand Up @@ -91,7 +91,7 @@ examples:
</li>
</ul>
</nav>
- id: breadcrumb
- id: breadcrumb-nested-root
name: Nested (root visible)
status: Verified
markup: |
Expand Down Expand Up @@ -147,7 +147,7 @@ examples:
</li>
</ul>
</nav>
- id: breadcrumb-multiline
- id: breadcrumb-multiline-dragged
name: Multiline (dragged)
status: Verified
markup: |
Expand All @@ -170,7 +170,7 @@ examples:
</li>
</ul>
</nav>
- id: breadcrumb-multiline
- id: breadcrumb-multiline-nested
name: Multiline Nested
status: Verified
markup: |
Expand Down Expand Up @@ -203,7 +203,7 @@ examples:
</li>
</ul>
</nav>
- id: breadcrumb-multiline
- id: breadcrumb-multiline-nested-root
name: Multiline Nested (root visible)
status: Verified
markup: |
Expand Down Expand Up @@ -259,7 +259,7 @@ examples:
</li>
</ul>
</nav>
- id: breadcrumb-compact
- id: breadcrumb-compact-nested
name: Compact Nested
status: Verified
markup: |
Expand Down Expand Up @@ -292,7 +292,7 @@ examples:
</li>
</ul>
</nav>
- id: breadcrumb-compact
- id: breadcrumb-compact-nested-root
name: Compact Nested (root visible)
status: Verified
markup: |
Expand Down
11 changes: 11 additions & 0 deletions components/breadcrumb/stories/breadcrumb.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@ export default {
options: ["compact", "multiline"],
control: "inline-radio",
},
isDragged: {
name: "Dragged",
type: { name: "boolean" },
table: {
type: { summary: "boolean" },
category: "State",
},
control: "boolean"
},
},
args: {
rootClass: "spectrum-Breadcrumbs",
isDragged: false,
},
parameters: {
actions: {
Expand Down Expand Up @@ -63,6 +73,7 @@ NestedMultiline.args = {
},
{
label: "Trend",
isDragged: true,
},
{
label: "January 2019 Assets",
Expand Down
7 changes: 4 additions & 3 deletions components/breadcrumb/stories/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { html } from "lit";
import { classMap } from "lit/directives/class-map.js";
import { when } from "lit/directives/when.js";

import { Template as Icon } from "@spectrum-css/icon/stories/template.js";
import { Template as ActionButton } from "@spectrum-css/actionbutton/stories/template.js";
import { Template as Icon } from "@spectrum-css/icon/stories/template.js";

import "../index.css";

Expand All @@ -12,6 +12,7 @@ export const Template = ({
customClasses = [],
items = [],
variant,
isDragged = false,
...globals
}) => {
const { express } = globals;
Expand All @@ -33,12 +34,12 @@ export const Template = ({
})}
>
${items.map((item, idx, arr) => {
const { label, isDisabled, isDragged, iconName } = item;
const { label, isDisabled, iconName } = item;
return html` <li
class=${classMap({
[`${rootClass}-item`]: true,
"is-disabled": isDisabled,
"is-dragged": isDragged,
"is-dragged": isDragged && item.isDragged,
})}
>
${when(
Expand Down

0 comments on commit 1f72c3e

Please sign in to comment.