Skip to content

Commit

Permalink
fix(visual-picker): add focus styling (#3093)
Browse files Browse the repository at this point in the history
  • Loading branch information
engai authored Feb 22, 2018
1 parent 42cb1d0 commit cbd07e9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
4 changes: 4 additions & 0 deletions ui/components/visual-picker/coverable-content/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
box-shadow: $elevation-shadow-4;
}

&:focus ~ label .slds-visual-picker__body > *:first-child {
text-decoration: underline;
}

/**
* @summary Non-selected state
* @selector .slds-is-not-selected
Expand Down
20 changes: 13 additions & 7 deletions ui/components/visual-picker/coverable-content/example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ import { UtilityIcon } from '../../icons/base/example';
// Partial(s)
/// ////////////////////////////////////////

export const Option = props => (
<span className="slds-text-title" key={_.uniqueId()}>
{props.label}
</span>
);

export let VisualPicker = props => {
const uniqueId = _.uniqueId('visual-picker-');

Expand Down Expand Up @@ -139,15 +145,15 @@ export default (
icon
sprite="utility"
symbol="connected_apps"
label="Connected App"
label={<Option label="Connected App" />}
size="medium"
/>
<VisualPicker
type="radio"
icon
sprite="utility"
symbol="custom_apps"
label="Custom App"
label={<Option label="Custom App" />}
size="medium"
/>
</FormElementControl>
Expand All @@ -167,7 +173,7 @@ export let states = [
icon
sprite="utility"
symbol="connected_apps"
label="Connected App"
label={<Option label="Connected App" />}
size="medium"
/>
<VisualPicker
Expand All @@ -176,7 +182,7 @@ export let states = [
icon
sprite="utility"
symbol="custom_apps"
label="Custom App"
label={<Option label="Custom App" />}
size="medium"
/>
</FormElementControl>
Expand All @@ -198,23 +204,23 @@ export let examples = [
icon
sprite="standard"
symbol="account"
label="Account"
label={<Option label="Account" />}
size="medium"
/>
<VisualPicker
type="checkbox"
icon
sprite="standard"
symbol="lead"
label="Lead"
label={<Option label="Lead" />}
size="medium"
/>
<VisualPicker
type="checkbox"
icon
sprite="standard"
symbol="orders"
label="Orders"
label={<Option label="Orders" />}
size="medium"
/>
</FormElementControl>
Expand Down
6 changes: 5 additions & 1 deletion ui/components/visual-picker/vertical/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@

+ .slds-visual-picker_vertical {
margin-left: 0;
margin-top: $spacing-large;
margin-top: $spacing-medium;
}

.slds-visual-picker__figure,
.slds-visual-picker__body {
width: $size-large;
}

input:focus ~ label .slds-visual-picker__text .slds-text-heading_medium {
text-decoration: underline;
}
}

0 comments on commit cbd07e9

Please sign in to comment.