feat(item-option): add default styles (#29635)

This commit is contained in:
Maria Hutt
2024-06-20 11:03:10 -07:00
committed by GitHub
parent 3c7a00e57d
commit 5055bdcc96
96 changed files with 114 additions and 22 deletions

View File

@ -0,0 +1,47 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
@import "./item-option";
// Ionic Item Option
// --------------------------------------------------
:host {
@include globals.padding(0);
min-width: globals.$ionic-scale-1600;
height: globals.$ionic-scale-1600;
font-size: globals.$ionic-font-size-350;
font-weight: globals.$ionic-font-weight-medium;
line-height: globals.$ionic-line-height-500;
}
.button-native {
@include globals.padding(globals.$ionic-space-200);
}
::slotted([slot="top"]) {
@include globals.margin(0, 0, globals.$ionic-space-100, 0);
}
::slotted([slot="bottom"]) {
@include globals.margin(globals.$ionic-space-100, 0, 0, 0);
}
::slotted([slot="start"]) {
@include margin(0, globals.$ionic-space-100, 0, 0);
}
::slotted([slot="end"]) {
@include margin(0, 0, 0, globals.$ionic-space-100);
}
::slotted(ion-icon),
::slotted([slot="icon-only"]) {
@include globals.margin(0);
width: globals.$ionic-scale-500;
min-width: initial;
height: globals.$ionic-scale-500;
}

View File

@ -24,7 +24,7 @@ import type { Color } from '../../interface';
styleUrls: { styleUrls: {
ios: 'item-option.ios.scss', ios: 'item-option.ios.scss',
md: 'item-option.md.scss', md: 'item-option.md.scss',
ionic: 'item-option.md.scss', ionic: 'item-option.ionic.scss',
}, },
shadow: true, shadow: true,
}) })

View File

@ -0,0 +1,37 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
@import "./item-options";
// Ionic Item Options
// --------------------------------------------------
.item-options-ionic {
align-items: center;
gap: globals.$ionic-space-100;
}
/* stylelint-disable property-disallowed-list */
[dir="ltr"] .item-options-start ion-item-option:last-child,
[dir="rtl"] .item-options-start ion-item-option:first-child {
margin-right: globals.$ionic-space-200;
}
[dir="ltr"] .item-options-start ion-item-option:first-child,
[dir="rtl"] .item-options-start ion-item-option:last-child {
margin-left: calc(globals.$ionic-space-200 + var(--ion-safe-area-left, 0));
padding-left: initial;
}
[dir="ltr"] .item-options-end ion-item-option:first-child,
[dir="rtl"] .item-options-end ion-item-option:last-child {
margin-left: globals.$ionic-space-200;
}
[dir="ltr"] .item-options-end ion-item-option:last-child,
[dir="rtl"] .item-options-end ion-item-option:first-child {
margin-right: calc(globals.$ionic-space-200 + var(--ion-safe-area-right, 0));
padding-right: initial;
}
/* stylelint-enable property-disallowed-list */

View File

@ -14,7 +14,7 @@ import type { Side } from '../menu/menu-interface';
styleUrls: { styleUrls: {
ios: 'item-options.ios.scss', ios: 'item-options.ios.scss',
md: 'item-options.md.scss', md: 'item-options.md.scss',
ionic: 'item-options.md.scss', ionic: 'item-options.ionic.scss',
}, },
}) })
export class ItemOptions implements ComponentInterface { export class ItemOptions implements ComponentInterface {

View File

@ -33,7 +33,7 @@
<ion-icon slot="icon-only" name="trash"></ion-icon> <ion-icon slot="icon-only" name="trash"></ion-icon>
</ion-item-option> </ion-item-option>
<ion-item-option> <ion-item-option>
<ion-icon slot="icon-only" name="star"></ion-icon> <ion-icon slot="icon-only" name="bookmark"></ion-icon>
</ion-item-option> </ion-item-option>
</ion-item-options> </ion-item-options>
</ion-item-sliding> </ion-item-sliding>
@ -43,14 +43,14 @@
<ion-label>Icons in Start Slot</ion-label> <ion-label>Icons in Start Slot</ion-label>
</ion-item> </ion-item>
<ion-item-options> <ion-item-options>
<ion-item-option color="primary"> <ion-item-option color="light">
<ion-icon slot="start" ios="ellipsis-horizontal" md="ellipsis-vertical"></ion-icon>
More
</ion-item-option>
<ion-item-option color="secondary">
<ion-icon slot="start" name="archive"></ion-icon> <ion-icon slot="start" name="archive"></ion-icon>
Archive Archive
</ion-item-option> </ion-item-option>
<ion-item-option color="secondary">
<ion-icon slot="start" name="bookmark"></ion-icon>
Save
</ion-item-option>
</ion-item-options> </ion-item-options>
</ion-item-sliding> </ion-item-sliding>
@ -59,14 +59,14 @@
<ion-label>Icons in End Slot</ion-label> <ion-label>Icons in End Slot</ion-label>
</ion-item> </ion-item>
<ion-item-options> <ion-item-options>
<ion-item-option color="primary"> <ion-item-option color="light">
<ion-icon slot="end" ios="ellipsis-horizontal" md="ellipsis-vertical"></ion-icon>
More
</ion-item-option>
<ion-item-option color="secondary">
<ion-icon slot="end" name="archive"></ion-icon> <ion-icon slot="end" name="archive"></ion-icon>
Archive Archive
</ion-item-option> </ion-item-option>
<ion-item-option color="secondary">
<ion-icon slot="end" name="bookmark"></ion-icon>
Save
</ion-item-option>
</ion-item-options> </ion-item-options>
</ion-item-sliding> </ion-item-sliding>
@ -75,14 +75,18 @@
<ion-label>Icons in Top Slot</ion-label> <ion-label>Icons in Top Slot</ion-label>
</ion-item> </ion-item>
<ion-item-options> <ion-item-options>
<ion-item-option color="primary"> <ion-item-option color="danger">
<ion-icon slot="top" ios="ellipsis-horizontal" md="ellipsis-vertical"></ion-icon> <ion-icon slot="top" name="trash"></ion-icon>
More Delete
</ion-item-option> </ion-item-option>
<ion-item-option color="secondary"> <ion-item-option color="light">
<ion-icon slot="top" name="archive"></ion-icon> <ion-icon slot="top" name="archive"></ion-icon>
Archive Archive
</ion-item-option> </ion-item-option>
<ion-item-option color="secondary">
<ion-icon slot="top" name="bookmark"></ion-icon>
Save
</ion-item-option>
</ion-item-options> </ion-item-options>
</ion-item-sliding> </ion-item-sliding>
@ -91,14 +95,18 @@
<ion-label>Icons in Bottom Slot</ion-label> <ion-label>Icons in Bottom Slot</ion-label>
</ion-item> </ion-item>
<ion-item-options> <ion-item-options>
<ion-item-option color="primary"> <ion-item-option color="danger">
<ion-icon slot="bottom" ios="ellipsis-horizontal" md="ellipsis-vertical"></ion-icon> <ion-icon slot="bottom" name="trash"></ion-icon>
More Delete
</ion-item-option> </ion-item-option>
<ion-item-option color="secondary"> <ion-item-option color="light">
<ion-icon slot="bottom" name="archive"></ion-icon> <ion-icon slot="bottom" name="archive"></ion-icon>
Archive Archive
</ion-item-option> </ion-item-option>
<ion-item-option color="secondary">
<ion-icon slot="bottom" name="bookmark"></ion-icon>
Save
</ion-item-option>
</ion-item-options> </ion-item-options>
</ion-item-sliding> </ion-item-sliding>
</ion-list> </ion-list>

View File

@ -8,7 +8,7 @@ import { configs, test, dragElementBy } from '@utils/test/playwright';
* It is important to test all modes to ensure that the * It is important to test all modes to ensure that the
* child components are being rendered correctly. * child components are being rendered correctly.
*/ */
configs().forEach(({ title, screenshot, config }) => { configs({ modes: ['ionic-md', 'ios', 'md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('item-sliding: icons'), () => { test.describe(title('item-sliding: icons'), () => {
test('should not have visual regressions', async ({ page }) => { test('should not have visual regressions', async ({ page }) => {
await page.goto(`/src/components/item-sliding/test/icons`, config); await page.goto(`/src/components/item-sliding/test/icons`, config);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB