refactor(chip): update styles, remove chip-icon and chip-button (#16264)

This reimplements chip, removing the extraneous chip-button and chip-icon components and updating the design to match the updated Material Design spec.
This commit is contained in:
Cam Wiegert
2018-11-08 14:58:29 -06:00
committed by GitHub
parent 6794447e10
commit 91f07bc097
28 changed files with 304 additions and 1177 deletions

View File

@ -20,7 +20,6 @@ A list of the breaking changes introduced to each component in Ionic Angular v4.
- [Alert](#alert)
- [Back Button](#back-button)
- [Button](#button)
- [Chip](#chip)
- [Colors](#colors)
- [Content](#content)
- [Datetime](#datetime)
@ -250,34 +249,6 @@ The `small` and `large` attributes are now combined under the `size` attribute.
</ion-button>
```
## Chip
### Markup Changed
Buttons inside of an `<ion-chip>` container should now be written as an `<ion-chip-button>` element. Ionic will determine when to render an anchor tag based on the presence of an `href` attribute.
**Old Usage Example:**
```html
<ion-chip>
<ion-label>Default</ion-label>
<ion-button clear color="light">
<ion-icon name="close-circle"></ion-icon>
</ion-button>
</ion-chip>
```
**New Usage Example:**
```html
<ion-chip>
<ion-label>Default</ion-label>
<ion-chip-button fill="clear" color="light">
<ion-icon name="close-circle"></ion-icon>
</ion-chip-button>
</ion-chip>
```
## Colors

View File

@ -16,8 +16,6 @@ export const DIRECTIVES = [
d.CardTitle,
d.Checkbox,
d.Chip,
d.ChipButton,
d.ChipIcon,
d.Col,
d.Content,
d.Datetime,

View File

@ -168,35 +168,13 @@ export class Checkbox {
}
export declare interface Chip extends StencilComponents<'IonChip'> {}
@Component({ selector: 'ion-chip', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['color', 'mode'] })
@Component({ selector: 'ion-chip', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['color', 'mode', 'outline'] })
export class Chip {
constructor(c: ChangeDetectorRef, r: ElementRef) {
c.detach();
const el = r.nativeElement;
proxyInputs(this, el, ['color', 'mode']);
}
}
export declare interface ChipButton extends StencilComponents<'IonChipButton'> {}
@Component({ selector: 'ion-chip-button', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['color', 'mode', 'disabled', 'fill', 'href'] })
export class ChipButton {
constructor(c: ChangeDetectorRef, r: ElementRef) {
c.detach();
const el = r.nativeElement;
proxyInputs(this, el, ['color', 'mode', 'disabled', 'fill', 'href']);
}
}
export declare interface ChipIcon extends StencilComponents<'IonChipIcon'> {}
@Component({ selector: 'ion-chip-icon', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['color', 'mode', 'fill', 'name', 'src'] })
export class ChipIcon {
constructor(c: ChangeDetectorRef, r: ElementRef) {
c.detach();
const el = r.nativeElement;
proxyInputs(this, el, ['color', 'mode', 'fill', 'name', 'src']);
proxyInputs(this, el, ['color', 'mode', 'outline']);
}
}