Skip to content

Commit 6fc6ed8

Browse files
authored
[CL-944] update layout components to support constrained height contexts (#17670)
1 parent 834caa0 commit 6fc6ed8

File tree

8 files changed

+13
-9
lines changed

8 files changed

+13
-9
lines changed

libs/components/src/dialog/dialog/dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class="tw-flex tw-w-full tw-flex-col tw-self-center tw-overflow-hidden tw-border tw-border-solid tw-border-secondary-100 tw-bg-background tw-text-main"
44
[ngClass]="[
55
width,
6-
isDrawer ? 'tw-h-screen tw-border-t-0' : 'tw-rounded-t-xl md:tw-rounded-xl tw-shadow-lg',
6+
isDrawer ? 'tw-h-full tw-border-t-0' : 'tw-rounded-t-xl md:tw-rounded-xl tw-shadow-lg',
77
]"
88
cdkTrapFocus
99
cdkTrapFocusAutoCapture

libs/components/src/dialog/dialog/dialog.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class DialogComponent {
104104
// `tw-max-h-[90vh]` is needed to prevent dialogs from overlapping the desktop header
105105
const baseClasses = ["tw-flex", "tw-flex-col", "tw-w-screen"];
106106
const sizeClasses = this.dialogRef?.isDrawer
107-
? ["tw-min-h-screen", "md:tw-w-[23rem]"]
107+
? ["tw-h-full", "md:tw-w-[23rem]"]
108108
: ["md:tw-p-4", "tw-w-screen", "tw-max-h-[90vh]"];
109109

110110
const animationClasses =

libs/components/src/drawer/drawer-body.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { hasScrolledFrom } from "../utils/has-scrolled-from";
1212
imports: [],
1313
host: {
1414
class:
15-
"tw-p-4 tw-pt-0 tw-block tw-overflow-auto tw-border-solid tw-border tw-border-transparent tw-transition-colors tw-duration-200",
15+
"tw-p-4 tw-pt-0 tw-flex-1 tw-overflow-auto tw-border-solid tw-border tw-border-transparent tw-transition-colors tw-duration-200",
1616
"[class.tw-border-t-secondary-300]": "this.hasScrolledFrom().top",
1717
},
1818
hostDirectives: [

libs/components/src/drawer/drawer.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ng-container *cdkPortal>
22
<section
33
[attr.role]="role()"
4-
class="tw-w-[23rem] tw-sticky tw-top-0 tw-h-screen tw-flex tw-flex-col tw-overflow-auto tw-border-0 tw-border-l tw-border-solid tw-border-secondary-300 tw-bg-background"
4+
class="tw-w-[23rem] tw-sticky tw-top-0 tw-h-full tw-flex tw-flex-col tw-overflow-auto tw-border-0 tw-border-l tw-border-solid tw-border-secondary-300 tw-bg-background"
55
>
66
<ng-content></ng-content>
77
</section>

libs/components/src/layout/layout.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@let mainContentId = "main-content";
2-
<div class="tw-flex tw-w-full">
3-
<div class="tw-flex tw-w-full" cdkTrapFocus>
2+
<div class="tw-flex tw-size-full">
3+
<div class="tw-flex tw-size-full" cdkTrapFocus>
44
<div
55
class="tw-fixed tw-z-50 tw-w-full tw-flex tw-justify-center tw-opacity-0 focus-within:tw-opacity-100 tw-pointer-events-none focus-within:tw-pointer-events-auto"
66
>
@@ -23,7 +23,7 @@
2323
[id]="mainContentId"
2424
tabindex="-1"
2525
bitScrollLayoutHost
26-
class="tw-overflow-auto tw-max-h-screen tw-min-w-0 tw-flex-1 tw-bg-background tw-p-8 tw-pt-6 tw-@container"
26+
class="tw-overflow-auto tw-max-h-full tw-min-w-0 tw-flex-1 tw-bg-background tw-p-8 tw-pt-6 tw-@container"
2727
>
2828
<!-- ^ If updating this padding, also update the padding correction in bit-banner! ^ -->
2929
<ng-content></ng-content>
@@ -45,7 +45,7 @@
4545
</div>
4646
}
4747
</div>
48-
<div class="tw-absolute tw-z-50 tw-left-0 md:tw-sticky tw-top-0 tw-h-screen md:tw-w-auto">
48+
<div class="tw-absolute tw-z-50 tw-left-0 md:tw-sticky tw-top-0 tw-h-full md:tw-w-auto">
4949
<ng-template [cdkPortalOutlet]="drawerPortal()"></ng-template>
5050
</div>
5151
</div>

libs/components/src/layout/layout.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { ScrollLayoutHostDirective } from "./scroll-layout.directive";
2929
],
3030
host: {
3131
"(document:keydown.tab)": "handleKeydown($event)",
32+
class: "tw-block tw-h-screen",
3233
},
3334
hostDirectives: [DrawerHostDirective],
3435
})

libs/components/src/navigation/side-nav.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
) {
88
<nav
99
id="bit-side-nav"
10-
class="tw-sticky tw-inset-y-0 tw-left-0 tw-z-30 tw-flex tw-h-screen tw-flex-col tw-overscroll-none tw-overflow-auto tw-bg-background-alt3 tw-outline-none"
10+
class="tw-sticky tw-inset-y-0 tw-left-0 tw-z-30 tw-flex tw-h-full tw-flex-col tw-overscroll-none tw-overflow-auto tw-bg-background-alt3 tw-outline-none"
1111
[ngClass]="{ 'tw-w-60': data.open }"
1212
[ngStyle]="
1313
variant() === 'secondary' && {

libs/components/src/navigation/side-nav.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export type SideNavVariant = "primary" | "secondary";
1717
selector: "bit-side-nav",
1818
templateUrl: "side-nav.component.html",
1919
imports: [CommonModule, CdkTrapFocus, NavDividerComponent, BitIconButtonComponent, I18nPipe],
20+
host: {
21+
class: "tw-block tw-h-full",
22+
},
2023
})
2124
export class SideNavComponent {
2225
readonly variant = input<SideNavVariant>("primary");

0 commit comments

Comments
 (0)