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(radio): Eva style #1344

Merged
merged 31 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
544237a
feat(radio): eva styles
yggg Apr 2, 2019
267670b
refactor(radio): align class names with checkbox
yggg Mar 24, 2019
b07dbe9
fix(radio): update and resubscribe to option after they change
yggg Mar 24, 2019
3138b24
fix(radio): update and resubscribe to option after they change
yggg Mar 24, 2019
3dd3cd7
feat(radio): add statuses to radio button
yggg Mar 24, 2019
00a4ce2
refactor(radio): style using updated component properties
yggg Mar 24, 2019
409b149
fix(radio): prevent inner circle distortion
yggg Mar 24, 2019
37a550a
docs(radio): add statuses and disabled group examples
yggg Mar 24, 2019
79931f2
docs(radio): update theme properties list
yggg Mar 24, 2019
fc04ebf
fix(radio): proper typography settings
yggg Mar 31, 2019
0eb812f
refactor(radio): remove white status
yggg Mar 31, 2019
89df6bd
feat(radio): add background color
yggg Mar 31, 2019
5476810
refactor(radio): remove named inputs
yggg Mar 31, 2019
7496c65
refactor(radio): remove own status enum and use shared
yggg Mar 31, 2019
f725667
fix(radio): typo
yggg Mar 31, 2019
1458ec0
docs(radio): fix examples
yggg Mar 31, 2019
94d2f2b
feat(radio): add border style theme property
yggg Apr 2, 2019
218f14e
refactor(radio): use named state colors
yggg Apr 2, 2019
60e60c6
feat(radio): prevent setting empty status
yggg Apr 2, 2019
c0abb37
docs(radio): update theme properties list
yggg Apr 3, 2019
d09570e
refactor(radio): move status class to the host
yggg Apr 3, 2019
42baf59
feat(radio): set default status if value not passed
yggg Apr 3, 2019
09b5f3a
fix(radio): update radio status and trigger change detection
yggg Apr 3, 2019
19e5fe7
refactor(radio): set provided status if it differ from current
yggg Apr 3, 2019
b43cc88
refactor(radio): call change detector methods from radio component
yggg Apr 3, 2019
32003be
fix(radio): set radio name right away
yggg Apr 3, 2019
54852e9
Merge branch 'next' into feat/eva-radio
yggg Apr 4, 2019
3275354
fix(radio): prevent subscription creating if no options
yggg Apr 4, 2019
5c2b1d7
feat(radio): initialize radio properties
yggg Apr 4, 2019
bae04b9
fix(radio): wait change detection to finish before updating options
yggg Apr 4, 2019
8533560
docs(radio): remove unnecessary interface
yggg Apr 4, 2019
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
12 changes: 12 additions & 0 deletions src/app/playground-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,18 @@ export const PLAYGROUND_COMPONENTS: ComponentLink[] = [
component: 'RadioShowcaseComponent',
name: 'Radio Showcase',
},
{
path: 'radio-statuses.component',
link: '/radio/radio-statuses.component',
component: 'RadioStatusesComponent',
name: 'Radio Statuses',
},
{
path: 'radio-disabled-group.component',
link: '/radio/radio-disabled-group.component',
component: 'RadioDisabledGroupComponent',
name: 'Radio Disabled Group',
},
],
},
{
Expand Down
116 changes: 51 additions & 65 deletions src/framework/theme/components/radio/_radio.component.theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,66 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@mixin input-border-color($color) {
input:checked + .radio-indicator,
input:hover:not(:disabled) + .radio-indicator {
border-color: $color;
}
}

@mixin nb-input-status-color($origin-border-color) {
@include input-border-color($origin-border-color);
&.success {
@include input-border-color(nb-theme(color-success));
}
&.warning {
@include input-border-color(nb-theme(color-warning));
}
&.danger {
@include input-border-color(nb-theme(color-danger));
}
}

@mixin nb-radio-check-mark($size, $color) {
&::before {
background-color: $color;
height: calc(#{$size} * 0.6);
width: calc(#{$size} * 0.6);
border: solid $color;
}
}

@mixin set-box-style($bg, $size, $border-size, $border-color) {
background-color: $bg;
width: $size;
height: $size;
border: $border-size solid $border-color;
}

@mixin nb-radio-theme() {
nb-radio {
.radio-indicator {
@include set-box-style(
nb-theme(radio-bg),
nb-theme(radio-size),
nb-theme(radio-border-size),
nb-theme(radio-border-color)
);

@include nb-radio-check-mark(nb-theme(radio-size), nb-theme(radio-checkmark));
.radio-circle {
height: nb-theme(radio-height);
width: nb-theme(radio-width);
background-color: nb-theme(radio-background-color);
border-style: nb-theme(radio-border-style);
border-width: nb-theme(radio-border-width);
}

input:checked + .radio-indicator,
input:disabled:checked + .radio-indicator {
@include set-box-style(
nb-theme(radio-checked-bg),
nb-theme(radio-checked-size),
nb-theme(radio-checked-border-size),
nb-theme(radio-checked-border-color)
);
@include nb-radio-check-mark(nb-theme(radio-checked-size), nb-theme(radio-checked-checkmark));
.native-input:focus + .radio-circle {
box-shadow: 0 0 0 nb-theme(radio-outline-width) nb-theme(radio-outline-color);
}

input:disabled + .radio-indicator {
@include set-box-style(
nb-theme(radio-disabled-bg),
nb-theme(radio-disabled-size),
nb-theme(radio-disabled-border-size),
nb-theme(radio-disabled-border-color)
);
@include nb-radio-check-mark(nb-theme(radio-disabled-size), nb-theme(radio-disabled-checkmark));
.native-input:disabled + .radio-circle {
border-color: nb-theme(radio-disabled-border-color);
}
.native-input:disabled:checked + .radio-circle::before {
background-color: nb-theme(radio-disabled-inner-circle-color);
}
.native-input:disabled ~ .text {
color: nb-theme(radio-disabled-text-color);
}

@each $status in nb-get-statuses() {
&.status-#{$status} .native-input:enabled + .radio-circle {
border-color: nb-theme(radio-#{$status}-border-color);
}
&.status-#{$status} .native-input:enabled:checked + .radio-circle::before {
background-color: nb-theme(radio-#{$status}-inner-circle-color);;
}

&.status-#{$status} .native-input:enabled:focus + .radio-circle {
border-color: nb-theme(radio-#{$status}-focus-border-color);
}
&.status-#{$status} .native-input:enabled:checked:focus + .radio-circle::before {
background-color: nb-theme(radio-#{$status}-focus-inner-circle-color);
}

@include nb-input-status-color(nb-theme(radio-checked-border-color));
&.status-#{$status} label:hover .native-input:enabled + .radio-circle {
border-color: nb-theme(radio-#{$status}-hover-border-color);
}
&.status-#{$status} label:hover .native-input:checked:enabled + .radio-circle::before {
background-color: nb-theme(radio-#{$status}-hover-inner-circle-color);
}

&.status-#{$status} .native-input:enabled:active + .radio-circle {
border-color: nb-theme(radio-#{$status}-active-border-color);
}
&.status-#{$status} .native-input:enabled:checked:active + .radio-circle::before {
background-color: nb-theme(radio-#{$status}-active-inner-circle-color);
}
}

.radio-description {
color: nb-theme(radio-fg);
.text {
color: nb-theme(radio-text-color);
font-family: nb-theme(radio-text-font-family);
font-size: nb-theme(radio-text-font-size);
font-weight: nb-theme(radio-text-font-weight);
line-height: nb-theme(radio-text-line-height);
}
}
}
Loading