Skip to content

Commit

Permalink
Merge branch 'next' into ROU-10735
Browse files Browse the repository at this point in the history
  • Loading branch information
brandyscarney committed May 22, 2024
2 parents 18e24f2 + 1c035af commit 29ba323
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ ion-backdrop,event,ionBackdropTap,void,true
ion-badge,shadow
ion-badge,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
ion-badge,prop,mode,"ios" | "md",undefined,false,false
ion-badge,prop,size,"large" | "medium" | "small" | undefined,undefined,false,false
ion-badge,prop,size,"large" | "medium" | "small" | "xlarge" | undefined,undefined,false,false
ion-badge,prop,theme,"ios" | "md" | "ionic",undefined,false,false
ion-badge,css-prop,--background,ionic
ion-badge,css-prop,--background,ios
Expand Down
8 changes: 4 additions & 4 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ export namespace Components {
*/
"mode"?: "ios" | "md";
/**
* Set to `"small"` for less height and width. Set to "medium" for slightly larger dimensions. Set to "large" for even greater height and width. Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
* Set to `"small"` for less height and width. Set to "medium" for slightly larger dimensions. Set to "large" for even greater height and width. Set to `"xlarge"` for the largest badge. Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
*/
"size"?: 'small' | 'medium' | 'large';
"size"?: 'small' | 'medium' | 'large' | 'xlarge';
/**
* The theme determines the visual appearance of the component.
*/
Expand Down Expand Up @@ -5650,9 +5650,9 @@ declare namespace LocalJSX {
*/
"mode"?: "ios" | "md";
/**
* Set to `"small"` for less height and width. Set to "medium" for slightly larger dimensions. Set to "large" for even greater height and width. Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
* Set to `"small"` for less height and width. Set to "medium" for slightly larger dimensions. Set to "large" for even greater height and width. Set to `"xlarge"` for the largest badge. Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
*/
"size"?: 'small' | 'medium' | 'large';
"size"?: 'small' | 'medium' | 'large' | 'xlarge';
/**
* The theme determines the visual appearance of the component.
*/
Expand Down
13 changes: 13 additions & 0 deletions core/src/components/badge/badge.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,16 @@

line-height: globals.$ionic-line-height-700;
}

/* Extra Large Badge */
:host(.badge-xlarge) {
--padding-start: #{globals.$ionic-space-200};
--padding-end: #{globals.$ionic-space-200};

min-width: globals.$ionic-scale-1400;
height: globals.$ionic-scale-1400;

font-size: globals.$ionic-font-size-550;

line-height: globals.$ionic-line-height-700;
}
4 changes: 2 additions & 2 deletions core/src/components/badge/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export class Badge implements ComponentInterface {
@Prop({ reflect: true }) color?: Color;

/**
* Set to `"small"` for less height and width. Set to "medium" for slightly larger dimensions. Set to "large" for even greater height and width.
* Set to `"small"` for less height and width. Set to "medium" for slightly larger dimensions. Set to "large" for even greater height and width. Set to `"xlarge"` for the largest badge.
* Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
*/
@Prop() size?: 'small' | 'medium' | 'large';
@Prop() size?: 'small' | 'medium' | 'large' | 'xlarge';

private getSize(): string | undefined {
const theme = getIonTheme(this);
Expand Down
13 changes: 13 additions & 0 deletions core/src/components/badge/test/size/badge.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,18 @@ configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screens

await expect(badge).toHaveScreenshot(screenshot(`badge-size-large`));
});

test('should render xlarge badges', async ({ page }) => {
await page.setContent(
`
<ion-badge size="xlarge">00</ion-badge>
`,
config
);

const badge = page.locator('ion-badge');

await expect(badge).toHaveScreenshot(screenshot(`badge-size-xlarge`));
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions core/src/components/badge/test/size/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,25 @@
<ion-content class="ion-padding" id="content" no-bounce>
<ion-list>
<ion-item>
<ion-label>Default Badge</ion-label>
<ion-label>Default</ion-label>
<ion-badge slot="end">00</ion-badge>
</ion-item>
<ion-item>
<ion-label>Small Badge</ion-label>
<ion-label>Small</ion-label>
<ion-badge slot="end" size="small">00</ion-badge>
</ion-item>
<ion-item>
<ion-label>Medium Badge</ion-label>
<ion-label>Medium</ion-label>
<ion-badge slot="end" size="medium">00</ion-badge>
</ion-item>
<ion-item>
<ion-label>Large Badge</ion-label>
<ion-label>Large</ion-label>
<ion-badge slot="end" size="large">00</ion-badge>
</ion-item>
<ion-item>
<ion-label>XLarge</ion-label>
<ion-badge slot="end" size="xlarge">00</ion-badge>
</ion-item>
</ion-list>
</ion-content>
</ion-app>
Expand Down

0 comments on commit 29ba323

Please sign in to comment.