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(input): Eva style #1343

Merged
merged 66 commits into from
Apr 4, 2019
Merged

feat(input): Eva style #1343

merged 66 commits into from
Apr 4, 2019

Conversation

yggg
Copy link
Contributor

@yggg yggg commented Apr 2, 2019

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

Short description of what this resolves:

Restyle input in Eva styles.

BREAKING CHANGES:

Following theme properties were renamed:
form-control-border-width -> input-border-width
form-control-border-radius -> input-rectangle-border-radius
form-control-semi-round-border-radius -> input-semi-round-border-radius
form-control-round-border-radius -> input-round-border-radius
form-control-text-primary-color -> input-text-color
form-control-border-color -> input-border-color
form-control-selected-border-color -> input-focus-border-color, input-[status]-focus-color
form-control-bg -> input-background-color
form-control-focus-bg -> input-focus-border-color
form-control-placeholder-color -> input-placeholder-text-color
form-control-placeholder-font-size -> input-placeholder-font-size
form-control-font-size -> input-medium-text-font-size
form-control-font-size-sm -> input-small-text-font-size
form-control-font-size-lg -> input-large-text-font-size
form-control-padding -> input-medium-padding
form-control-padding-sm -> input-small-padding
form-control-padding-lg -> input-large-padding
form-control-info-border-color -> input-info-border-color
form-control-success-border-color -> input-success-border-color
form-control-danger-border-color -> input-danger-border-color
form-control-warning-border-color -> input-warning-border-color
form-control-border-type -> input-border-style

Removed:
form-control-label-font-weight
form-control-feedback-font-size
form-control-feedback-font-weight

Input status classes were renamed from input-[status-name] to status-[status-name].
Input size classes were renamed from input-[size-name] to size-[size-name].
Input shape classes were renamed from input-[shape-name] to shape-[shape-name].

All NbInputDirective static fields removed. Removed fields:
SIZE_SMALL, SIZE_MEDIUM, SIZE_LARGE, STATUS_PRIMARY, STATUS_INFO, STATUS_SUCCESS,
STATUS_WARNING, STATUS_DANGER, SHAPE_SEMI_ROUND, SHAPE_RECTANGLE, SHAPE_ROUND.
Use NbComponentStatus, NbComponentShape, NbComponentSize instead.

NbInputDirective 'size' property and 'setSize' getter removed.
Use unified 'fieldSize' property instead.

NbInputDirective 'setFullWidth' replaced with read/write 'fullWidth' property.

Remove bootstrap theme support until it's refactored to use updated
theme properties

nnixaa and others added 30 commits March 28, 2019 17:26
BREAKING CHANGES:
- calendar - use primary button in cosmic theme
- checkbox - `opacity` instead of `lightning`
- context-menu, popover, datepicker - `calc` instead of `round` and scss calculations
- input - `opacity` for placeholder instead of `lightning`
- tabs - remove gradient for tab bottom separator in cosmic theme
- toastr - use `background-color` instead of the gradient in cosmic theme
- text colors are now used from success/primary/warning/etc colors
- add color palette instead of generating colors using scss-functions, an example for `primary`
`color-primary-200`
`color-primary-300`
`color-primary-400`
`color-primary-600`
`color-primary-700`

`create-colors-palette()` scss function that can be used during the theme installation process to generate palette automatically

Closes #1228
Disable e2e on next branch. Will be enabled after updating tests to new colors, etc.
…-icons package (#1319)

BREAKING CHANGE:

Starting from version 4.0, Nebular introduces new `nb-icon` component and `NbIconLibraries` service to host SVG and Font icon packs. As a breaking change, Nebular moves from `nebular-icons` package to much more popular [Eva Icons pack](https://akveo.github.io/eva-icons/) consisting of 480+ beautiful SVG icons. We believe this will bring more quality and variety to interfaces based on Nebular.

Now all Nebular components internally use `<nb-icon></nb-icon>` component utilizing Eva Icons SVG icons. More details on [nb-icon](https://akveo.github.io/nebular/docs/components/icon) component.

There are two ways to upgrade:
**Migrate to Eva Icons** (recommended):
1) install Eva Icons Nebular package `npm i @nebular/eva-icons`
2) register `NbEvaIconsModule` in the `app.module.ts`
```
import { NbEvaIconsModule } form '@nebular/eva-icons';

@NgModule({
  imports: [
  	// ...
    NbEvaIconsModule,
  ],
})
```
3) Search for all usages of `<span icon="nb-*"` or ``<i icon="nb-*"``and replace with `<nb-icon icon="icon-name"></nb-icon>`. Full icons list https://akveo.github.io/eva-icons/.

4) Search for `icon: 'nb-*'` references in properties for such components as Menu, Actions, Tabs, etc. Replace those with `icon: 'icon-name'`. Please note, there is no need to specify any icon prefix (such as `eva-` or `nb-`) since prefix is specified when the icon package is registered in Nebular. 

4) Update styles if necessary.

5) if you have `nebular-icons` installed, remove the package and all references.

**Continue using nebular-icons**
This option is also possible, but please note, Nebular Component will still use Eva Icons pack for internal component icons, such as `close`, `arrow-down`, `arrow-up`, etc.

1) Register nebular-icons as a pack for Nebular in your `app.component.ts`
```
  import { NbIconLibraries } from '@nebular/theme';

  constructor(private iconLibraries: NbIconLibraries) {
    this.iconLibraries.registerFontPack('nebular', { iconClassPrefix: 'nb' });
    this.iconLibraries.setDefaultPack('nebular');
  }
```

3) Search for all usages of `<span icon="nb-*"` or ``<i icon="nb-*"`` and replace with `<nb-icon icon="icon-name"></nb-icon>` without the `nb-` prefix  since prefix is specified when the icon package is registered in Nebular. 

4) Search for `icon: 'nb-*'` references in properties for such components as Menu, Actions, Tabs, etc. Replace those with `icon: 'icon-name'` without `nb-` prefix since it is unnecessary and covered under the hood.

Please open an issue if you have any questions or having difficulties to migrate.
BREAKING CHANGE:
Following map keys were removed:
  - border-color
  - color-gray
  - color-neutral
  - color-disabled
Mapping for borders, disabled and similar styles would controlled
by design system and configured for each component individually.
BREAKING CHANGE:
Properties 'checkbox-bg', 'checkbox-checked-bg' and 'checkbox-disabled-bg'
replaced with:
  - checkbox-disabled-background-color
  - checkbox-[status]-background-color
  - checkbox-[status]-checked-background-color
  - checkbox-[status]-indeterminate-background-color
  - checkbox-[status]-focus-background-color
  - checkbox-[status]-hover-background-color
  - checkbox-[status]-active-background-color

Property 'checkbox-size' splited into 'checkbox-height', 'checkbox-width'.

Following properties were removed (along with ability to change appearance of checkbox
based on checked or disabled state):
  - checkbox-checked-size
  - checkbox-checked-border-size
  - checkbox-disabled-size removed
  - checkbox-disabled-border-size

Property 'checkbox-border-size' replaced with 'checkbox-border-width'.

Properties 'checkbox-border-color', 'checkbox-checked-border-color', 'checkbox-disabled-border-color'
replaced with:
  - checkbox-disabled-border-color
  - checkbox-[status]-border-color
  - checkbox-[status]-checked-border-color
  - checkbox-[status]-indeterminate-border-color
  - checkbox-[status]-hover-border-color
  - checkbox-[status]-active-border-color

Properties 'checkbox-checkmark', 'checkbox-checked-checkmark', 'checkbox-disabled-checkmark'
replaced with:
  - checkbox-disabled-checkmark-color
  - checkbox-[status]-checked-checkmark-color
  - checkbox-[status]-indeterminate-checkmark-color
BREAKING CHANGE:
Description for change made in 37a490b.

Check mark pseudo element replaced with svg.

Checkbox classes were changed.
Class 'customised-control' replaced with 'label'.
Class 'customised-control-input' replaced with 'native-input'.
Class 'customised-control-indicator' replaced with 'custom-checkbox'.
Class 'customised-control-description' replaced with 'text'.
BREAKING CHANGES:

NbCheckboxComponent's '_value' property now private. Use 'value' instead.
yggg added 12 commits March 31, 2019 10:18
BREAKING CHANGE:
Following NbInputDirective static fields removed:
SIZE_SMALL, SIZE_LARGE, STATUS_PRIMARY, STATUS_INFO, STATUS_SUCCESS,
STATUS_WARNING, STATUS_DANGER, SHAPE_SEMI_ROUND, SHAPE_ROUND.
BREAKING CHANGE:
NbInputDirective 'size' property and 'setSize' getter removed.
Use unified 'fieldSize' property instead.
NbInputDirective 'setFullWidth' replaced with read/write 'fullWidth'
property.
@yggg yggg requested a review from nnixaa April 2, 2019 18:47
@yggg yggg changed the base branch from master to next April 2, 2019 18:47
@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #1343 into next will decrease coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##             next    #1343      +/-   ##
==========================================
- Coverage   81.47%   81.44%   -0.03%     
==========================================
  Files         237      237              
  Lines        7233     7222      -11     
  Branches      618      617       -1     
==========================================
- Hits         5893     5882      -11     
  Misses       1154     1154              
  Partials      186      186
Impacted Files Coverage Δ
...ramework/theme/components/input/input.directive.ts 100% <100%> (ø) ⬆️
...rk/theme/components/checkbox/checkbox.component.ts 100% <100%> (ø) ⬆️

@@ -1 +1 @@
export type NbComponentSize = '' | 'tiny' | 'small' | 'medium' | 'large' | 'giant';
export type NbComponentSize = 'tiny' | 'small' | 'medium' | 'large' | 'giant';
Copy link
Collaborator

Choose a reason for hiding this comment

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

so, no empty status after all?

Copy link
Contributor Author

@yggg yggg Apr 3, 2019

Choose a reason for hiding this comment

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

Yep. No more empty values for size, status or shape. Component which could has unset value, should add '' as possible value. Like this:
status: '' | NbComponentStatus;

@yggg yggg requested a review from nnixaa April 3, 2019 13:08
@yggg yggg merged commit 6419ea4 into akveo:next Apr 4, 2019
brannon-darby pushed a commit to brannon-darby/nebular that referenced this pull request Apr 5, 2019
brannon-darby pushed a commit to brannon-darby/nebular that referenced this pull request Apr 5, 2019
yggg added a commit that referenced this pull request Apr 17, 2019
yggg added a commit that referenced this pull request May 27, 2019
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.

None yet

2 participants