Skip to content

Commit

Permalink
feat: extend action sheet styles to allow for custom content
Browse files Browse the repository at this point in the history
  • Loading branch information
joneff authored and Juveniel committed Oct 14, 2022
1 parent 5d837ea commit 073230b
Show file tree
Hide file tree
Showing 15 changed files with 561 additions and 113 deletions.
43 changes: 31 additions & 12 deletions packages/bootstrap/scss/action-sheet/_variables.scss
Expand Up @@ -3,7 +3,8 @@ $actionsheet-padding-x: null !default;
$actionsheet-padding-y: null !default;
$actionsheet-width: 360px !default;
$actionsheet-max-width: 100% !default;
$actionsheet-max-height: 50vh !default;
$actionsheet-height: 60vh !default;
$actionsheet-max-height: 60vh !default;

$actionsheet-border-width: 0px !default;
$actionsheet-border-radius: 0px !default;
Expand All @@ -19,18 +20,23 @@ $actionsheet-shadow: 0 8px 10px -5px rgba( black, .2 ), 0 16px 24px 2px rgba( bl


// Actionsheet header
$actionsheet-header-padding-x: k-map-get( $spacing, 4 ) !default;
$actionsheet-header-padding-y: k-map-get( $spacing, 2 ) !default;
$actionsheet-header-border-width: null !default;
$actionsheet-header-font-size: null !default;
$actionsheet-header-font-family: null !default;
$actionsheet-header-line-height: null !default;
$actionsheet-titlebar-padding-x: k-map-get( $spacing, 4 ) !default;
$actionsheet-titlebar-padding-y: k-map-get( $spacing, 2 ) !default;
$actionsheet-titlebar-border-width: null !default;
$actionsheet-titlebar-font-size: null !default;
$actionsheet-titlebar-font-family: null !default;
$actionsheet-titlebar-line-height: null !default;
$actionsheet-titlebar-gap: k-map-get( $spacing, 4 ) !default;

$actionsheet-header-bg: null !default;
$actionsheet-header-text: null !default;
$actionsheet-header-border: null !default;
$actionsheet-header-gradient: null !default;
$actionsheet-header-shadow: null !default;
$actionsheet-titlebar-bg: null !default;
$actionsheet-titlebar-text: null !default;
$actionsheet-titlebar-border: null !default;
$actionsheet-titlebar-gradient: null !default;
$actionsheet-titlebar-shadow: null !default;

$actionsheet-subtitle-font-size: $font-size-sm !default;
$actionsheet-subtitle-line-height: $line-height-sm !default;
$actionsheet-subtitle-text: $subtle-text !default;


// Actionsheet item
Expand Down Expand Up @@ -65,3 +71,16 @@ $actionsheet-item-disabled-text: null !default;
$actionsheet-item-disabled-border: null !default;
$actionsheet-item-disabled-gradient: null !default;
$actionsheet-item-disabled-shadow: null !default;


// Adaptive Actionsheet
$adaptive-actionsheet-titlebar-border-width: 1px !default;
$adaptive-actionsheet-titlebar-padding-y: k-map-get( $spacing, 4 ) !default;
$adaptive-actionsheet-titlebar-padding-x: $adaptive-actionsheet-titlebar-padding-y !default;
$adaptive-actionsheet-titlebar-border: $component-border !default;

$adaptive-actionsheet-content-padding-y: k-map-get( $spacing, 2 ) !default;
$adaptive-actionsheet-content-padding-x: k-map-get( $spacing, 4 ) !default;

$adaptive-actionsheet-footer-padding-y: k-map-get( $spacing, 2 ) !default;
$adaptive-actionsheet-footer-padding-x: k-map-get( $spacing, 4 ) !default;
43 changes: 31 additions & 12 deletions packages/classic/scss/action-sheet/_variables.scss
Expand Up @@ -3,7 +3,8 @@ $actionsheet-padding-x: null !default;
$actionsheet-padding-y: null !default;
$actionsheet-width: 360px !default;
$actionsheet-max-width: 100% !default;
$actionsheet-max-height: 50vh !default;
$actionsheet-height: 60vh !default;
$actionsheet-max-height: 60vh !default;

$actionsheet-border-width: 0px !default;
$actionsheet-border-radius: 0px !default;
Expand All @@ -19,18 +20,23 @@ $actionsheet-shadow: 0 8px 10px -5px rgba( black, .2 ), 0 16px 24px 2px rgba( bl


// Actionsheet header
$actionsheet-header-padding-x: k-map-get( $spacing, 4 ) !default;
$actionsheet-header-padding-y: k-map-get( $spacing, 2 ) !default;
$actionsheet-header-border-width: null !default;
$actionsheet-header-font-size: null !default;
$actionsheet-header-font-family: null !default;
$actionsheet-header-line-height: null !default;
$actionsheet-titlebar-padding-x: k-map-get( $spacing, 4 ) !default;
$actionsheet-titlebar-padding-y: k-map-get( $spacing, 2 ) !default;
$actionsheet-titlebar-border-width: null !default;
$actionsheet-titlebar-font-size: null !default;
$actionsheet-titlebar-font-family: null !default;
$actionsheet-titlebar-line-height: null !default;
$actionsheet-titlebar-gap: k-map-get( $spacing, 4 ) !default;

$actionsheet-header-bg: null !default;
$actionsheet-header-text: null !default;
$actionsheet-header-border: null !default;
$actionsheet-header-gradient: null !default;
$actionsheet-header-shadow: null !default;
$actionsheet-titlebar-bg: null !default;
$actionsheet-titlebar-text: null !default;
$actionsheet-titlebar-border: null !default;
$actionsheet-titlebar-gradient: null !default;
$actionsheet-titlebar-shadow: null !default;

$actionsheet-subtitle-font-size: $font-size-sm !default;
$actionsheet-subtitle-line-height: $line-height-sm !default;
$actionsheet-subtitle-text: $subtle-text !default;


// Actionsheet item
Expand Down Expand Up @@ -65,3 +71,16 @@ $actionsheet-item-disabled-text: null !default;
$actionsheet-item-disabled-border: null !default;
$actionsheet-item-disabled-gradient: null !default;
$actionsheet-item-disabled-shadow: null !default;


// Adaptive Actionsheet
$adaptive-actionsheet-titlebar-border-width: 1px !default;
$adaptive-actionsheet-titlebar-padding-y: k-map-get( $spacing, 4 ) !default;
$adaptive-actionsheet-titlebar-padding-x: $adaptive-actionsheet-titlebar-padding-y !default;
$adaptive-actionsheet-titlebar-border: $component-border !default;

$adaptive-actionsheet-content-padding-y: k-map-get( $spacing, 2 ) !default;
$adaptive-actionsheet-content-padding-x: k-map-get( $spacing, 4 ) !default;

$adaptive-actionsheet-footer-padding-y: k-map-get( $spacing, 2 ) !default;
$adaptive-actionsheet-footer-padding-x: k-map-get( $spacing, 4 ) !default;
183 changes: 155 additions & 28 deletions packages/default/scss/action-sheet/_layout.scss
@@ -1,70 +1,114 @@
@include exports("action-sheet/layout") {

// Action sheet container
.k-actionsheet-container {
width: 100vw;
height: 100vh;
width: 100%;
height: 100%;
max-width: unquote("max(100%, 100vw)");
max-height: unquote("max(100%, 100vh)");
position: fixed;
top: 0;
left: 0;
z-index: 9999;
overflow: hidden;
transform: translateZ(0);
}


// Animation container
.k-actionsheet-container {

// Overlay
> .k-overlay {
position: absolute;
z-index: 1;
}

// Nested animation container
> .k-animation-container {
width: 100%;
height: 100%;
border-radius: 0;
overflow: hidden;
position: absolute;
z-index: 2;
top: 0;
left: 0;
pointer-events: none;

> .k-child-animation-container {
position: absolute;
}
}

// No animation container
> .k-actionsheet {
position: absolute;
z-index: 2;
}

// Enable mouse events for action sheet
.k-actionsheet {
pointer-events: all;
}
}


// Actionsheet
.k-actionsheet {
padding: $actionsheet-padding-y $actionsheet-padding-y;
width: $actionsheet-width;
max-width: $actionsheet-max-width;
max-height: $actionsheet-max-height;
padding-block: $actionsheet-padding-y;
padding-inline: $actionsheet-padding-y;
width: var( --kendo-actionsheet-width, #{$actionsheet-width} );
height: var( --kendo-actionsheet-height, #{$actionsheet-height} );
max-width: var( --kendo-actionsheet-max-width, #{$actionsheet-max-width} );
max-height: var( --kendo-actionsheet-max-height, #{$actionsheet-max-height} );
border-width: 0;
border-style: solid;
border-color: transparent;
box-sizing: border-box;
font-size: $actionsheet-font-size;
font-family: $actionsheet-font-family;
line-height: $actionsheet-line-height;
overflow-x: hidden;
overflow-y: auto;
position: fixed;
z-index: 10002;
overflow: hidden;
position: relative;

*,
*::before,
*::after {
box-sizing: border-box;
}
}
.k-actionsheet-fullscreen {
max-height: 100%;
height: 100%;
}


// Actionsheet header
.k-actionsheet-header {
padding: $actionsheet-header-padding-y $actionsheet-header-padding-x;
// Actionsheet titlebar
.k-actionsheet-titlebar {
padding: $actionsheet-titlebar-padding-y $actionsheet-titlebar-padding-x;
border-width: 0;
border-bottom-width: if( $actionsheet-header-border-width, $actionsheet-header-border-width, null );
border-bottom-width: if( $actionsheet-titlebar-border-width, $actionsheet-titlebar-border-width, null );
border-style: solid;
border-color: transparent;
box-sizing: border-box;
font-size: $actionsheet-header-font-size;
font-family: $actionsheet-header-font-family;
line-height: $actionsheet-header-line-height;
font-size: $actionsheet-titlebar-font-size;
font-family: $actionsheet-titlebar-font-family;
line-height: $actionsheet-titlebar-line-height;
flex: none;
display: flex;
flex-flow: column nowrap;
align-items: center;
gap: $actionsheet-titlebar-gap;
}


// Actionsheet titlebar
.k-actionsheet-titlebar {
@extend .k-actionsheet-header !optional;
.k-actionsheet-titlebar-group {
display: flex;
flex-flow: row nowrap;
align-items: center;
width: 100%;
}
.k-actionsheet-title {
flex: 1;
}
.k-actionsheet-subtitle {
font-size: $actionsheet-subtitle-font-size;
line-height: $actionsheet-subtitle-line-height;
}
.k-actionsheet-actions {
flex: none;
}
Expand All @@ -74,6 +118,7 @@
.k-actionsheet-content {
flex: 1;
overflow: auto;
position: relative;
}


Expand All @@ -88,6 +133,7 @@
margin: 0;
padding: 0;
list-style: none;
flex: none;
}


Expand All @@ -106,7 +152,7 @@
outline: 0;
display: flex;
flex-flow: row nowrap;
align-items: center;
align-items: flex-start;
gap: $actionsheet-item-spacing;
}
.k-actionsheet-item-icon {
Expand All @@ -129,6 +175,7 @@
.k-actionsheet > .k-hr {
margin: 0;
border-color: inherit;
flex: none;
}


Expand Down Expand Up @@ -165,6 +212,12 @@
top: 50%;
transform: translateY( -50% );
}
.k-actionsheet-fullscreen {
width: 100%;
max-width: 100%;
max-height: 100%;
height: 100%;
}


// Action sheet in popup
Expand All @@ -186,6 +239,28 @@
display: flex;
flex-flow: column nowrap;

.k-actionsheet-titlebar {
padding: $adaptive-actionsheet-titlebar-padding-y $adaptive-actionsheet-titlebar-padding-x;
border-bottom-width: $adaptive-actionsheet-titlebar-border-width;
}

.k-actionsheet-content {
padding: $adaptive-actionsheet-content-padding-y $adaptive-actionsheet-content-padding-x;
}

.k-actionsheet-footer {
padding: $adaptive-actionsheet-footer-padding-y $adaptive-actionsheet-footer-padding-x;
}

.k-list-container,
.k-treeview {
height: 100%;
}
.k-list-filter {
width: 100%;
padding-inline: 0;
}

.k-calendar {
margin-inline: auto;
border-width: 0;
Expand All @@ -205,6 +280,58 @@
height: 100%;
}
}

.k-datetime-wrap {
width: 100%;
height: 100%;
display: flex;
flex-flow: column nowrap;
}
.k-datetime-selector {
flex: 1 1 auto;
}

.k-datetime-calendar-wrap {
width: 100%;
position: absolute;
top: 0;
left: 0;
bottom: 0;
flex: 0 0 100%;
}

.k-datetime-time-wrap {
width: 100%;
position: absolute;
top: 0;
left: 100%;
bottom: 0;
flex: 0 0 100%;
}

.k-scrollable-wrap {
height: 100%;
overflow-y: auto;
}
}

}

@include exports("action-sheet/layout/legacy") {

.k-actionsheet-jq {
&.k-actionsheet {
height: auto;
}

.k-actionsheet-header {
@extend .k-actionsheet-titlebar !optional;
align-items: flex-start;
}

.k-actionsheet-action {
align-items: center;
}
}

}

0 comments on commit 073230b

Please sign in to comment.