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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
c6def0c
feat(button-group): add button-group.component
Aug 3, 2020
f11382c
feat(button-group): fix issues, add docs
Aug 5, 2020
10aedab
fix(tabIndex): fix linter
Aug 5, 2020
afe383f
feat(button-group): update docs
Aug 6, 2020
2a4bda1
feat(button-group): fix styles
Aug 6, 2020
bb29543
feat(button-group): fix lint
Aug 6, 2020
abd9aaa
feat(button-group): fix lint
Aug 6, 2020
95ea86e
feat(button-group): fix comments
Aug 11, 2020
5329d11
feat(button-group): add base button component
Aug 18, 2020
df92134
fix(tabIndex): fix lint
Aug 18, 2020
52752aa
fix(tabIndex): fix errors
Aug 19, 2020
91c7a00
Merge branch 'master' into feat/button-group
maksim-karatkevich Sep 3, 2020
7e58c7e
Merge branch 'master' into feat/button-group
yggg Sep 10, 2020
5e64b9f
feat(button-group): fix comments
Sep 11, 2020
af713a0
Merge remote-tracking branch 'origin/feat/button-group' into feat/but…
Sep 11, 2020
d894742
refactor: reorganized buttons structure
Sep 29, 2020
8f67ad4
fix: fixed linter issues
Sep 29, 2020
b403d65
Merge branch 'master' into feat/button-group
yggg Oct 2, 2020
0532558
fix: fixed pull request comments
Oct 6, 2020
f86a215
fix: fixed linter issues
Oct 6, 2020
1749ae9
fix: fixed button sizes
Oct 8, 2020
1804a34
fix: improved button group styles
Oct 8, 2020
b50573b
Merge branch 'master' into feat/button-group
yggg Oct 13, 2020
c26c9c1
fix: added items to public_api.ts
Oct 13, 2020
432408c
fix: changed button-group border styles
Oct 13, 2020
e7af301
Merge branch 'feat/button-group' of https://github.com/akveo/nebular …
Oct 13, 2020
341f2b4
docs(button group): simplify examples
yggg Oct 13, 2020
e4b6d34
docs(button): remove button group example
yggg Oct 13, 2020
c509900
refactor(playground): update button examples list
yggg Oct 13, 2020
546899a
refactor(docs): remove button toggle theme
yggg Oct 13, 2020
07060b0
feat: added tests for dynamic button
Oct 13, 2020
1ec6ff2
Merge branch 'feat/button-group' of https://github.com/akveo/nebular …
Oct 13, 2020
1be79db
fix(button toggle): add css transitions
yggg Oct 13, 2020
1e97514
Merge branch 'master' into feat/button-group
yggg Oct 15, 2020
3b95110
refactor(button): remove nb-button-theme mixin
yggg Oct 15, 2020
e645911
refactor(button): move focus ring overlap fix into button styles
yggg Oct 15, 2020
d39eae0
refactor(button): remove redundant button appearance mixins
yggg Oct 15, 2020
f3dd5b2
refactor(button): move animation rule to the core mixin
yggg Oct 15, 2020
34879d9
refactor(button group): make inline flex
yggg Oct 15, 2020
cac7647
style(button group): change formatting
yggg Oct 15, 2020
8e8638f
refactor(button group): don't set border radius
yggg Oct 16, 2020
d6840dc
refactor(button group): make appearance an input
yggg Nov 5, 2020
69b1f3d
style(button group): update formatting and members order
yggg Nov 6, 2020
fa401e0
docs(button group): remove unrelated theme properties
yggg Nov 6, 2020
1cf4aa2
fix(button group): correct border radius for single group member
yggg Nov 6, 2020
b364d3e
refactor(button toggle): simplify status class bindings
yggg Nov 11, 2020
a4481ab
fix(button group): button text same color as toggle color
yggg Nov 11, 2020
e13be5a
Merge branch 'master' into feat/button-group
yggg Dec 12, 2020
738e86d
Merge branch 'feat/button-group' of github.com:akveo/nebular into fea…
yggg Dec 12, 2020
abbb0d2
Merge branch 'feat/button-group-beta' into feat/button-group
yggg Dec 15, 2020
e5acf49
refactor(group): remove unnecessary import
yggg Dec 15, 2020
839e845
refactor(group): enable OnPush cd strategy
yggg Dec 15, 2020
013d070
fix(toggle): mark for check when changing pressed state from group
yggg Dec 15, 2020
e9e72c5
refactor(group): determine button type via instaceof
yggg Dec 15, 2020
5ece357
refactor(group): rename method to clarify what it does
yggg Dec 15, 2020
4b47978
refactor(button): move tabindex related properties to the base class
yggg Dec 15, 2020
d24d8aa
refactor(button): remove duplicate properties defined in a base class
yggg Dec 15, 2020
6da91f6
style: revert accidental changes
yggg Dec 15, 2020
34c6f75
refactor: remove comment
yggg Dec 15, 2020
c5b5662
test(group): refactor and add tests for a newly added group
yggg Dec 15, 2020
de460d5
fix(group): defer update changed projected content
yggg Dec 16, 2020
0d88ee5
fix(group): correct buttons height
yggg Dec 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/assets/images/components/button-group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,15 @@ export const structure = [
'NbButtonComponent',
],
},
{
type: 'tabs',
name: 'Button Group',
icon: 'button-group.svg',
source: [
'NbButtonGroupComponent',
'NbButtonToggleDirective',
],
},
{
type: 'tabs',
name: 'Checkbox',
Expand Down
59 changes: 59 additions & 0 deletions src/app/playground-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,65 @@ export const PLAYGROUND_COMPONENTS: ComponentLink[] = [
},
],
},
{
path: 'button-group',
children: [
{
path: 'button-group-showcase.component',
link: '/button-group/button-group-showcase.component',
component: 'ButtonGroupShowcaseComponent',
name: 'Button Group Showcase',
},
{
path: 'button-group-multiple.component',
link: '/button-group/button-group-multiple.component',
component: 'ButtonGroupMultipleComponent',
name: 'Button Group Multiple',
},
{
path: 'button-group-sizes.component',
link: '/button-group/button-group-sizes.component',
component: 'ButtonGroupSizesComponent',
name: 'Button Group Sizes',
},
{
path: 'button-group-appearances.component',
link: '/button-group/button-group-appearances.component',
component: 'ButtonGroupAppearancesComponent',
name: 'Button Group Appearances',
},
{
path: 'button-group-shapes.component',
link: '/button-group/button-group-shapes.component',
component: 'ButtonGroupShapesComponent',
name: 'Button Group Shapes',
},
{
path: 'button-and-button-toggle-groups.component',
link: '/button-group/button-and-button-toggle-groups.component',
component: 'ButtonAndButtonToggleGroupsComponent',
name: 'Button And Button Toggle Groups',
},
{
path: 'button-group-interactive.component',
link: '/button-group/button-group-interactive.component',
component: 'ButtonGroupInteractiveComponent',
name: 'Button Group Interactive',
},
{
path: 'button-group-disabled.component',
link: '/button-group/button-group-disabled.component',
component: 'ButtonGroupDisabledComponent',
name: 'Button Group Disabled',
},
{
path: 'button-group-statuses.component',
link: '/button-group/button-group-statuses.component',
component: 'ButtonGroupStatusesComponent',
name: 'Button Group Statuses',
},
],
},
{
path: 'calendar',
children: [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@mixin nb-buttons-group-theme() {
nb-button-group {
display: inline-flex;

[nbButton],
[nbButtonToggle] {
@include nb-ltr() {
&:first-child:not(:last-child) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
&:last-child:not(:first-child) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
@include nb-rtl() {
&:first-child:not(:last-child) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
&:last-child:not(:first-child) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}

&:not(:first-child):not(:last-child) {
border-radius: 0;
}

&.appearance-filled,
&.appearance-ghost {
// Makes border same color as background. We need to keep the border so that buttons inside and outside
// the group have the same height.
border-color: transparent;
}

&.appearance-filled {
.status-basic {
color: nb-theme(button-group-filled-button-basic-text-color);
}

@each $status in nb-get-statuses() {
// I can't figure out any sane selector to turn the start border into a divider for buttons
// in the default state only (not hovered, focused, etc.). So I went with this horrible thing.
// Another way was to copy button styles here, but then we need to keep track of button styles
// all the time. Also, it would increase the number of duplicate button styles.
&.status-#{$status}:not(:first-child):not(:hover):not(:focus):not(:active):not([disabled]) {
@include nb-ltr(border-left-color, nb-theme(button-group-filled-#{$status}-divider-color));
@include nb-rtl(border-right-color, nb-theme(button-group-filled-#{$status}-divider-color));
}
}
}

// See the comment on the selector above
&.appearance-ghost:not(:first-child):not(:hover):not(:focus):not(:active):not([disabled]) {
@include nb-ltr(border-left-color, nb-theme(button-group-ghost-divider-color));
@include nb-rtl(border-right-color, nb-theme(button-group-ghost-divider-color));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@mixin nb-buttons-toggle-theme() {
[nbButtonToggle] {
@extend [nbButton];
}
}

Loading