Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Radio and checkbox icon buttons #1892

Merged
merged 45 commits into from
Aug 29, 2018

Conversation

blackbaud-conorwright
Copy link
Contributor

@blackbaud-conorwright blackbaud-conorwright commented Aug 10, 2018

Created new radio and checkbox icon button components.

The tag names are up for debate, I'm still not sure if sky-checkbox-icon and sky-radio-icon are clear enough. They seem like they could be confused with an icon component that can be placed inside of these elements.

Resolves: #970

Original contribution: #1644

@codecov-io
Copy link

codecov-io commented Aug 10, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@dfbf923). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #1892   +/-   ##
========================================
  Coverage          ?    100%           
========================================
  Files             ?     424           
  Lines             ?    8968           
  Branches          ?    1326           
========================================
  Hits              ?    8968           
  Misses            ?       0           
  Partials          ?       0
Impacted Files Coverage Δ
src/modules/checkbox/checkbox.component.ts 100% <100%> (ø)
src/modules/radio/radio.component.ts 100% <100%> (ø)
src/modules/radio/radio.module.ts 100% <100%> (ø)
src/modules/checkbox/checkbox.module.ts 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfbf923...1d3f2f4. Read the comment docs.

@blackbaud-johnly
Copy link
Contributor

Created #1907 to document new components.

Copy link
Contributor

@Blackbaud-AlexKingman Blackbaud-AlexKingman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work here. Just a few questions/comments. Also, I don't necessarily have a problem with the component names. I couldn't really think of an alternative that was better, so I think I'm happy with what you've got here. Great job.

@@ -25,4 +25,34 @@ export class SkyCheckboxDemoComponent {
disabled: true
}
];
public iconCheckboxItems = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed none of these are disabled. Should we show at least one disabled value to show consumers how to do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a good plan. I'm going to add strikethrough to the group example.

@@ -118,3 +153,23 @@ fieldset {
flex: 1 1 auto;
width: 100%;
}

.sky-switch-icon-group{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is sky-switch-icon-group being used? I can't find it anywhere in our codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have messaged you. Todd just added this as a class that people can put on the container of their icon buttons (radio or checkbox) to have them appear as an inline group. I'm adding an example to each demo now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool! That will be helpful. I noticed there's some style inconsistencies with this block of CSS - space before the bracket and some tabs needed. Other than that, I'm good with this 👍

'sky-switch-control-danger': checkboxType === 'danger'
}">
<sky-icon
aria-hidden="true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need aria-hidden anymore with the new icon component, do you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true. I do not need this anymore 👍
Removing.

return this._checkboxType || 'info';
}
public set checkboxType(value: string) {
this._checkboxType = value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to also do a if(value) check and a .toLowerCase() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I do want that. Added

useExisting: forwardRef(() => SkyCheckboxIconComponent),
multi: true
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a // tslint:enable here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah, nice catch

<span
class="sky-switch-control sky-rounded-corners">
<sky-icon
*ngIf="checked"
aria-hidden="true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before - can you get rid of aria-hidden now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

public radioType: string;
}

describe('Icon radio component', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say Radio icon component ? I only ask because if we're quickly scanning the list of tests, you might have trouble finding it since its not consistent with the component name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. I'll switch them around

public checkboxType: string;
}

describe('Icon checkbox component', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before - Checkbox icon component.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched

@blackbaud-conorwright
Copy link
Contributor Author

updated @Blackbaud-AlexKingman 👍

@Blackbaud-AlexKingman
Copy link
Contributor

Talked offline about not using rounded corners in the groups. Once thats done, I'm good to go with this!

@blackbaud-conorwright
Copy link
Contributor Author

@Blackbaud-AlexKingman I've updated the demos to use the groupings properly. They were already set, the icon components have to be direct children of the switch-group element.

@Blackbaud-AlexKingman
Copy link
Contributor

Smooth. I like it 🚢 🇮🇹 !

@blackbaud-conorwright
Copy link
Contributor Author

On hold for: blackbaud/skyux-theme#23

@blackbaud-conorwright blackbaud-conorwright merged commit e02f5b4 into master Aug 29, 2018
@blackbaud-conorwright blackbaud-conorwright deleted the radio-checkbox-icon-buttons branch August 29, 2018 19:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants