Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
185e8ec
feat(accordion): initial files for ionic theme
brandyscarney Oct 10, 2024
e0027b0
feat(accordion): add ionic theme default styles
brandyscarney Oct 11, 2024
f0d310d
fix(accordion): import missing common file
brandyscarney Oct 11, 2024
a72a66b
fix(accordion): improve border positioning for correct height
brandyscarney Oct 11, 2024
738733f
fix(accordion): only add padding to the inset accordion group
brandyscarney Oct 11, 2024
2630fa9
feat(accordion): add disabled state and test
brandyscarney Oct 14, 2024
62231be
fix(accordion-group): update accordion group shape
brandyscarney Oct 14, 2024
aade9df
test(accordion-group): add expand and states tests
brandyscarney Oct 14, 2024
c6be0b5
fix(item): add back min-height initial and inherit line-height
brandyscarney Oct 14, 2024
b6f9417
fix(accordion-group): add missing import
brandyscarney Oct 14, 2024
a707db1
chore(): add updated snapshots
brandyscarney Oct 14, 2024
ddcaf67
test(accordion): add ionic theme to basic test
brandyscarney Oct 14, 2024
84942b9
test(accordion): add ionic theme to multiple test
brandyscarney Oct 14, 2024
03729e6
test(accordion): add basic test for ionic theme with content only
brandyscarney Oct 14, 2024
4557c51
feat(accordion-group): add accordion group styles
brandyscarney Oct 14, 2024
8f4b179
fix(accordion-group): remove global styles
brandyscarney Oct 14, 2024
1c90386
test(accordion-group): add test for disabled state
brandyscarney Oct 14, 2024
3bb7380
test(accordion-group): add test for expand property
brandyscarney Oct 14, 2024
0180f4d
Merge branch 'ROU-11258' into ROU-11257
brandyscarney Oct 14, 2024
7a39589
chore(): add updated snapshots
brandyscarney Oct 14, 2024
667b817
chore: remove unused file
brandyscarney Oct 14, 2024
ab17b0a
Merge branch 'ROU-11258' into ROU-11257
brandyscarney Oct 14, 2024
eff9c5a
chore(): add updated snapshots
brandyscarney Oct 15, 2024
a9cf63f
Merge branch 'ROU-11258' into ROU-11257
brandyscarney Oct 15, 2024
8a497c4
fix(accordion): update styles based on feedback from design
brandyscarney Oct 15, 2024
521be54
test(accordion): update states test to show inset vs compact
brandyscarney Oct 15, 2024
7265b59
chore(): add updated snapshots
brandyscarney Oct 15, 2024
3000d9e
style: lint
brandyscarney Oct 15, 2024
a267975
Merge branch 'next' into ROU-11258
brandyscarney Oct 16, 2024
b8d6e89
fix(accordion-group): add min-width
brandyscarney Oct 16, 2024
4a1e928
Merge branch 'ROU-11258' into ROU-11257
brandyscarney Oct 16, 2024
d09d81e
fix(accordion): remove min width from accordion
brandyscarney Oct 16, 2024
75cad7d
Merge branch 'next' into ROU-11257
brandyscarney Oct 16, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Accordion Group: Common
// --------------------------------------------------

:host {
display: block;
}
20 changes: 20 additions & 0 deletions core/src/components/accordion-group/accordion-group.ionic.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
@use "./accordion-group.common";

// Ionic Accordion Group
// --------------------------------------------------

:host {
min-width: 272px;

background-color: globals.$ionic-color-base-white;
}

// Inset Accordion Group
// --------------------------------------------------

// Shape and padding only apply if the group is inset
:host(.accordion-group-expand-inset) {
@include globals.border-radius(globals.$ionic-border-radius-400);
@include globals.padding(globals.$ionic-space-100);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./accordion-group";
@import "./accordion-group.native";

// iOS Accordion Group
// --------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./accordion-group";
@import "./accordion-group.native";
@import "../accordion/accordion.md.vars";

// Material Design Accordion Group
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
@import "./accordion-group.common";
@import "../../themes/native/native.globals";
@import "../accordion/accordion.vars";

// Accordion Group
// Accordion Group: Native
// --------------------------------------------------

:host {
display: block;
}

:host(.accordion-group-expand-inset) {
@include margin($accordion-inset-margin, $accordion-inset-margin, $accordion-inset-margin, $accordion-inset-margin);
}
2 changes: 1 addition & 1 deletion core/src/components/accordion-group/accordion-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { AccordionGroupChangeEventDetail } from './accordion-group-interfac
styleUrls: {
ios: 'accordion-group.ios.scss',
md: 'accordion-group.md.scss',
ionic: 'accordion-group.md.scss',
ionic: 'accordion-group.ionic.scss',
},
shadow: true,
})
Expand Down
162 changes: 162 additions & 0 deletions core/src/components/accordion-group/test/expand/accordion.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screenshot, title }) => {
test.describe(title('accordion-group: expand'), () => {
test.describe(title('compact'), () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<style>
/* Background styles to show the border radius */
:root {
background: #ccc7c7;
}
</style>
<ion-accordion-group>
<ion-accordion value="first">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="second">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="third">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
</ion-accordion-group>
`,
config
);

const accordionGroup = page.locator('ion-accordion-group');

await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-expand-compact'));
});

test('should not have visual regressions when expanded', async ({ page }) => {
await page.setContent(
`
<style>
/* Background styles to show the border radius */
:root {
background: #ccc7c7;
}
</style>
<ion-accordion-group value="first">
<ion-accordion value="first">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="second">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="third">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
</ion-accordion-group>
`,
config
);

const accordionGroup = page.locator('ion-accordion-group');

await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-expand-compact-expanded'));
});
});

test.describe(title('inset'), () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<style>
/* Background styles to show the border radius */
:root {
background: #ccc7c7;
}
</style>
<ion-accordion-group expand="inset">
<ion-accordion value="first">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="second">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="third">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
</ion-accordion-group>
`,
config
);

const accordionGroup = page.locator('ion-accordion-group');

await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-expand-inset'));
});

test('should not have visual regressions when expanded', async ({ page }) => {
await page.setContent(
`
<style>
/* Background styles to show the border radius */
:root {
background: #ccc7c7;
}
</style>
<ion-accordion-group value="first" expand="inset">
<ion-accordion value="first">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="second">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="third">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
</ion-accordion-group>
`,
config
);

const accordionGroup = page.locator('ion-accordion-group');

await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-expand-inset-expanded'));
});
});
});
});
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.
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.
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.
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.
135 changes: 135 additions & 0 deletions core/src/components/accordion-group/test/expand/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Accordion Group - Expand</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
<script src="../../../../../scripts/testing/scripts.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
<style>
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-row-gap: 20px;
grid-column-gap: 20px;
}
h2 {
font-size: 12px;
font-weight: normal;

color: #6f7378;

margin-top: 10px;
margin-left: 5px;
}
</style>
</head>

<body>
<ion-app>
<ion-header translucent="true">
<ion-toolbar>
<ion-title>Accordion Group - Expand</ion-title>
</ion-toolbar>
</ion-header>
<ion-content fullscreen="true" color="light">
<div class="grid ion-padding">
<div class="grid-item">
<h2>Default</h2>
<ion-accordion-group>
<ion-accordion value="first">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="second">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="third">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
</ion-accordion-group>
</div>
<div class="grid-item">
<h2>Default: Expanded</h2>
<ion-accordion-group value="first">
<ion-accordion value="first">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="second">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="third">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
</ion-accordion-group>
</div>
<div class="grid-item">
<h2>Inset</h2>
<ion-accordion-group expand="inset">
<ion-accordion value="first">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="second">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="third">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
</ion-accordion-group>
</div>
<div class="grid-item">
<h2>Inset: Expanded</h2>
<ion-accordion-group value="first" expand="inset">
<ion-accordion value="first">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="second">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
<ion-accordion value="third">
<ion-item slot="header">
<ion-label>Accordion title</ion-label>
</ion-item>
<div slot="content">This is the body of the accordion.</div>
</ion-accordion>
</ion-accordion-group>
</div>
</div>
</ion-content>
</ion-app>
</body>
</html>
Loading
Loading