Skip to content
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

feat: button group #2473

Merged
merged 62 commits into from
Dec 16, 2020
Merged

feat: button group #2473

merged 62 commits into from
Dec 16, 2020

Conversation

maksim-karatkevich
Copy link
Contributor

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

@codecov
Copy link

codecov bot commented Aug 5, 2020

Codecov Report

Merging #2473 (738e86d) into master (b7a2c6e) will decrease coverage by 0.34%.
The diff coverage is 62.41%.

@@            Coverage Diff             @@
##           master    #2473      +/-   ##
==========================================
- Coverage   78.93%   78.59%   -0.35%     
==========================================
  Files         253      258       +5     
  Lines        7815     7908      +93     
  Branches      857      875      +18     
==========================================
+ Hits         6169     6215      +46     
- Misses       1382     1427      +45     
- Partials      264      266       +2     
Impacted Files Coverage Δ
...omponents/button-toggle/button-toggle.directive.ts 40.00% <40.00%> (ø)
.../components/button-group/button-group.component.ts 53.33% <53.33%> (ø)
...k/theme/components/button/base-button.directive.ts 74.62% <74.62%> (ø)
...eme/components/button-group/button-group.module.ts 100.00% <100.00%> (ø)
...e/components/button-toggle/button-toggle.module.ts 100.00% <100.00%> (ø)
...mework/theme/components/button/button.component.ts 81.39% <100.00%> (-2.88%) ⬇️
... and 1 more

@yggg yggg changed the title Feat/button group feat: button group Sep 1, 2020
@ghost
Copy link

ghost commented Sep 10, 2020

DeepCode's analysis on #0d88ee found:

  • ℹ️ 4 minor issues. 👇
  • ✔️ 1 issue was fixed.

Top issues

Description Example fixes
Array type using 'T[]' is forbidden for non-simple types. Use 'Array' instead. Occurrences: 🔧 Example fixes
asterisks in jsdoc must be aligned Occurrences: 🔧 Example fixes
Type boolean trivially inferred from a boolean literal, remove type annotation Occurrences: 🔧 Example fixes

👉 View analysis in DeepCode’s Dashboard | Configure the bot

docs/structure.ts Outdated Show resolved Hide resolved
src/playground/with-layout/button/button.module.ts Outdated Show resolved Hide resolved
docs/assets/images/components/button-group.svg Outdated Show resolved Hide resolved
docs/app/@theme/styles/styles.scss Outdated Show resolved Hide resolved
src/framework/theme/styles/themes/_mapping.scss Outdated Show resolved Hide resolved
src/framework/theme/styles/themes/_mapping.scss Outdated Show resolved Hide resolved
src/framework/theme/styles/themes/_mapping.scss Outdated Show resolved Hide resolved
src/framework/theme/styles/themes/_mapping.scss Outdated Show resolved Hide resolved
src/framework/theme/styles/themes/_mapping.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@yggg yggg left a comment

Choose a reason for hiding this comment

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

A few more comments:

  • Use default sized button in examples (except for size example). Currently most example has giant buttons for some reason.
  • button-group-multiple.component example. Icon only buttons should be square shaped (see example here). Make sure button toggle also has same styles as button here.
  • Ensure button and button toggle has the same dimensions. You can add button toggles to the button interactive examples and compare it there. https://akveo.github.io/nebular/example/button/button-interactive.component. And also check button dimensions didn't changed in this PR (compare with online docs examples).

docs/app/@theme/styles/styles.scss Outdated Show resolved Hide resolved
Comment on lines 11 to 14
div {
display: flex;
align-items: center;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no div in the nb-button-group template.


[nbButtonToggle], [nbButton] {
&:focus {
//Needs to make shadow visible
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's clarify with something like:

Sibling buttons are covering outline shadow. position: relative; declaration makes shadow appear on top of sibling buttons.

Comment on lines 25 to 34
border-radius, 0 nb-theme(button-#{$shape}-border-radius) nb-theme(button-#{$shape}-border-radius) 0);
@include nb-rtl(
border-radius, nb-theme(button-#{$shape}-border-radius) 0 0 nb-theme(button-#{$shape}-border-radius));
}

&:first-child.shape-#{$shape} {
@include nb-ltr(
border-radius, nb-theme(button-#{$shape}-border-radius) 0 0 nb-theme(button-#{$shape}-border-radius));
@include nb-rtl(
border-radius, 0 nb-theme(button-#{$shape}-border-radius) nb-theme(button-#{$shape}-border-radius) 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Assign nb-theme(button-#{$shape}-border-radius) to a variable and use it to reduce lines length.

Comment on lines 45 to 62
@include nb-ltr(border-right,
nb-theme(button-toggle-border-width)
nb-theme(button-toggle-border-style)
nb-theme(button-toggle-border-color));
@include nb-rtl(border-left,
nb-theme(button-toggle-border-width)
nb-theme(button-toggle-border-style)
nb-theme(button-toggle-border-color));

&:hover {
@include nb-ltr(border-right,
nb-theme(button-toggle-border-width)
nb-theme(button-toggle-border-style)
nb-theme(button-toggle-border-color));
@include nb-rtl(border-left,
nb-theme(button-toggle-border-width)
nb-theme(button-toggle-border-style)
nb-theme(button-toggle-border-color));
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's introduce a variable and set it to border values so we don't need to repeat tree nb-theme calls four times. Something like:

$border: nb-theme(button-toggle-border-width) nb-theme(button-toggle-border-style) nb-theme(button-toggle-border-color);
// ...
@include nb-ltr(border-right, $border);

yggg and others added 24 commits October 15, 2020 18:44
Instead of setting border-radius, reset it only on unnecessary
element sides. Correct border-radius already set in button and
button toggle styles. We only need to reset it to 0 on the sides
where the element has siblings.
Don't remove border as height of buttons inside the group would be smaller
than buttons outside the group. Also, make divider on the start side as per
design.
@yggg yggg merged commit 72bb1b3 into master Dec 16, 2020
@yggg yggg deleted the feat/button-group branch December 16, 2020 15:04
@yggg yggg restored the feat/button-group branch December 16, 2020 15:04
yggg pushed a commit that referenced this pull request Dec 24, 2020
(cherry picked from commit 72bb1b3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants