Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions core/src/components/action-sheet/action-sheet.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,18 @@
align-items: center;
}

.action-sheet-button-label-has-rich-content,
.select-option-content {
flex: 1;
}

.select-option-start,
.select-option-end {
display: flex;

align-items: center;
}

.select-option-description {
display: block;
}
95 changes: 92 additions & 3 deletions core/src/components/action-sheet/action-sheet.ionic.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,111 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
@use "../../themes/mixins" as mixins;
@use "../../themes/functions.font" as fontMixins;
@use "./action-sheet.common";
@use "./action-sheet.md" as action-sheet-md;

// Ionic Action Sheet
// --------------------------------------------------

:host {
--background: #{globals.$ion-bg-surface-default};
--backdrop-opacity: 0.7;
--button-background: transparent;
--button-background-selected: currentColor;
--button-background-selected-opacity: 0;
--button-background-activated: transparent;
--button-background-activated-opacity: 0;
--button-background-hover: currentColor;
--button-background-hover-opacity: 0.04;
--button-background-focused: currentColor;
--button-background-focused-opacity: 0.12;
--button-color: #{globals.$ion-text-default};
--button-color-disabled: var(--button-color);
--color: #{globals.$ion-text-default};
}

// Action Sheet Wrapper
// -----------------------------------------

.action-sheet-wrapper {
@include mixins.margin(var(--ion-safe-area-top, 0), auto, 0, auto);
}

.action-sheet-title {
@include mixins.padding(globals.$ion-scale-400);
@include globals.typography(globals.$ion-heading-h6-medium);

color: var(--color);

text-align: start;
}

.action-sheet-sub-title {
@include globals.typography(globals.$ion-body-lg-regular);
}

// Action Sheet Group
// -----------------------------------------

.action-sheet-group:first-child {
@include mixins.padding(globals.$ion-scale-400, null, null, null);
}

.action-sheet-group:last-child {
@include mixins.padding(null, null, globals.$ion-scale-400, null);
}

// Action Sheet Buttons
// -----------------------------------------

.action-sheet-button {
@include mixins.padding(
globals.$ion-scale-300,
globals.$ion-scale-400,
globals.$ion-scale-300,
globals.$ion-scale-400
);
@include globals.typography(globals.$ion-body-md-regular);

position: relative;

min-height: 52px;

text-align: start;

contain: content;
overflow: hidden;
}

.action-sheet-icon {
@include mixins.margin(globals.$ion-scale-0, globals.$ion-scale-600, globals.$ion-scale-0, globals.$ion-scale-0);
@include globals.typography(globals.$ion-body-md-regular);

color: var(--color, globals.$ion-text-default);
}

.action-sheet-button-inner {
justify-content: flex-start;
}

.action-sheet-selected {
font-weight: bold;
}

// Action Sheet: Select Option
// --------------------------------------------------

.action-sheet-button-label {
gap: globals.$ion-space-300;
}

.select-option-start,
.select-option-end {
gap: globals.$ion-space-200;
}

.select-option-description {
@include globals.typography(globals.$ion-body-md-regular);
@include globals.padding(0);

color: globals.$ion-text-subtle;

font-size: globals.$ion-font-size-350;
}
2 changes: 1 addition & 1 deletion core/src/components/action-sheet/action-sheet.md.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "./action-sheet.native";
@import "./action-sheet.md.vars";

// Material Design Action Sheet Title
// Material Design Action Sheet
// -----------------------------------------

:host {
Expand Down
5 changes: 5 additions & 0 deletions core/src/components/action-sheet/action-sheet.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
gap: 12px;
}

.select-option-start,
.select-option-end {
gap: 8px;
}

.select-option-description {
@include mixins.padding(5px, 0, 0, 0);

Expand Down
7 changes: 7 additions & 0 deletions core/src/components/alert/alert.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ textarea.alert-input {
flex: 1;
}

.select-option-start,
.select-option-end {
display: flex;

align-items: center;
}

.select-option-description {
display: block;
}
5 changes: 5 additions & 0 deletions core/src/components/alert/alert.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
gap: globals.$ion-space-300;
}

.select-option-start,
.select-option-end {
gap: globals.$ion-space-200;
}

.select-option-description {
@include globals.typography(globals.$ion-body-md-regular);
@include globals.padding(0);
Expand Down
5 changes: 5 additions & 0 deletions core/src/components/alert/alert.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
gap: 12px;
}

.select-option-start,
.select-option-end {
gap: 8px;
}

.select-option-description {
@include mixins.padding(5px, 0, 0, 0);

Expand Down
20 changes: 20 additions & 0 deletions core/src/components/select-modal/select-modal.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@
align-items: center;
}

ion-radio.select-option-has-rich-content::part(label),
ion-checkbox.select-option-has-rich-content::part(label),
.select-option-content {
flex: 1;

/**
* Let rich content wrap instead of inheriting the label part's
* single-line truncation, so arbitrary slotted elements render
* without clipping.
*/
white-space: normal;
}

.select-option-start,
.select-option-end {
display: flex;

align-items: center;
}

.select-option-description {
display: block;
}
5 changes: 5 additions & 0 deletions core/src/components/select-modal/select-modal.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ ion-content {
gap: globals.$ion-space-300;
}

.select-option-start,
.select-option-end {
gap: globals.$ion-space-200;
}

.select-option-description {
@include globals.typography(globals.$ion-body-md-regular);

Expand Down
5 changes: 5 additions & 0 deletions core/src/components/select-modal/select-modal.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
gap: 12px;
}

.select-option-start,
.select-option-end {
gap: 8px;
}

.select-option-description {
@include mixins.padding(5px, 0, 0, 0);

Expand Down
8 changes: 8 additions & 0 deletions core/src/components/select-modal/select-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class SelectModal implements ComponentInterface {
* part of the public `SelectModalOption` interface.
*/
const richOption = option as SelectOverlayOption;
const hasRichContent = !!richOption.startContent || !!richOption.endContent || !!richOption.description;
const optionLabelOptions = {
id: `modal-option-${index}`,
label: richOption.text,
Expand All @@ -145,6 +146,9 @@ export class SelectModal implements ComponentInterface {
}}
>
<ion-radio
class={{
'select-option-has-rich-content': hasRichContent,
}}
value={option.value}
disabled={option.disabled}
justify="start"
Expand Down Expand Up @@ -186,6 +190,7 @@ export class SelectModal implements ComponentInterface {
* part of the public `SelectModalOption` interface.
*/
const richOption = option as SelectOverlayOption;
const hasRichContent = !!richOption.startContent || !!richOption.endContent || !!richOption.description;
const optionLabelOptions = {
id: `modal-option-${index}`,
label: richOption.text,
Expand All @@ -203,6 +208,9 @@ export class SelectModal implements ComponentInterface {
}}
>
<ion-checkbox
class={{
'select-option-has-rich-content': hasRichContent,
}}
value={option.value}
disabled={option.disabled}
checked={option.checked}
Expand Down
20 changes: 20 additions & 0 deletions core/src/components/select-popover/select-popover.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ ion-label {
flex-wrap: wrap;
}

ion-radio.select-option-has-rich-content::part(label),
ion-checkbox.select-option-has-rich-content::part(label),
.select-option-content {
flex: 1;

/**
* Let rich content wrap instead of inheriting the label part's
* single-line truncation, so arbitrary slotted elements render
* without clipping.
*/
white-space: normal;
}

.select-option-start,
.select-option-end {
display: flex;

align-items: center;
}

.select-option-description {
display: block;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
gap: globals.$ion-space-300;
}

.select-option-start,
.select-option-end {
gap: globals.$ion-space-200;
}

.select-option-description {
@include globals.typography(globals.$ion-body-md-regular);
@include globals.padding(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
gap: 12px;
}

.select-option-start,
.select-option-end {
gap: 8px;
}

.select-option-description {
@include mixins.padding(5px, 0, 0, 0);

Expand Down
8 changes: 8 additions & 0 deletions core/src/components/select-popover/select-popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export class SelectPopover implements ComponentInterface {
* part of the public `SelectPopoverOption` interface.
*/
const richOption = option as SelectOverlayOption;
const hasRichContent = !!richOption.startContent || !!richOption.endContent || !!richOption.description;
const optionLabelOptions = {
id: `popover-option-${index}`,
label: richOption.text,
Expand All @@ -152,6 +153,9 @@ export class SelectPopover implements ComponentInterface {
}}
>
<ion-checkbox
class={{
'select-option-has-rich-content': hasRichContent,
}}
value={option.value}
disabled={option.disabled}
checked={option.checked}
Expand Down Expand Up @@ -184,6 +188,7 @@ export class SelectPopover implements ComponentInterface {
* part of the public `SelectPopoverOption` interface.
*/
const richOption = option as SelectOverlayOption;
const hasRichContent = !!richOption.startContent || !!richOption.endContent || !!richOption.description;
const optionLabelOptions = {
id: `popover-option-${index}`,
label: richOption.text,
Expand All @@ -201,6 +206,9 @@ export class SelectPopover implements ComponentInterface {
}}
>
<ion-radio
class={{
'select-option-has-rich-content': hasRichContent,
}}
value={option.value}
disabled={option.disabled}
onClick={() => this.dismissParentPopover()}
Expand Down
Loading
Loading