feat(divider): add new ion-divider component (#30270)

Issue number: internal
---------

## What is the new behavior?
- Introduces a new component, `ion-divider` which has two props,
`spacing` and `inset`.
- Adds e2e tests to both `spacing` and `inset` props

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

## Other information
- As discussed with the PO, using this new component inside an
`ion-item` is out of scope , for now.

---------

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Gonçalo M. <goncalo.martins@outsystems.com>
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
This commit is contained in:
Marta Carlos
2025-03-25 09:04:19 +00:00
committed by GitHub
parent 02c9d64ca5
commit c37eaabae9
77 changed files with 483 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import { defineCustomElement as defineIonChip } from '@ionic/core/components/ion
import { defineCustomElement as defineIonCol } from '@ionic/core/components/ion-col.js';
import { defineCustomElement as defineIonContent } from '@ionic/core/components/ion-content.js';
import { defineCustomElement as defineIonDatetimeButton } from '@ionic/core/components/ion-datetime-button.js';
import { defineCustomElement as defineIonDivider } from '@ionic/core/components/ion-divider.js';
import { defineCustomElement as defineIonFab } from '@ionic/core/components/ion-fab.js';
import { defineCustomElement as defineIonFabButton } from '@ionic/core/components/ion-fab-button.js';
import { defineCustomElement as defineIonFabList } from '@ionic/core/components/ion-fab-list.js';
@ -732,6 +733,30 @@ export class IonDatetimeButton {
export declare interface IonDatetimeButton extends Components.IonDatetimeButton {}
@ProxyCmp({
defineCustomElementFn: defineIonDivider,
inputs: ['inset', 'spacing']
})
@Component({
selector: 'ion-divider',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['inset', 'spacing'],
standalone: true
})
export class IonDivider {
protected el: HTMLIonDividerElement;
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
}
}
export declare interface IonDivider extends Components.IonDivider {}
@ProxyCmp({
defineCustomElementFn: defineIonFab,
inputs: ['activated', 'edge', 'horizontal', 'mode', 'theme', 'vertical'],