-
Notifications
You must be signed in to change notification settings - Fork 79
feat(shell-panel): Add displayMode
and heightScale
properties and deprecate detached
and detachedHeightScale
#6919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 23 commits
1759395
8f7ef0e
5bd9e2a
d75eba6
9a89722
d679581
64727da
9b83adf
12c4a6e
9d29c8b
7512799
84173eb
1c73948
bf34c6f
d0d4d33
37b7d67
4d4aa3c
cc4d704
f5587fb
4b786cc
84919cb
bf127b7
3fab75e
d31f5e4
9c5e0ea
fba2a7a
5bc9b90
4385b6f
a117a06
c3506db
f226499
da167e2
410ac2c
e388238
4d8b78a
3a6499a
317bb1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type DisplayMode = "dock" | "float" | "overlay"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @prop --calcite-shell-panel-height: When `layout` is `"horizontal"`, specifies the height of the component. | ||
* @prop --calcite-shell-panel-max-height: When `layout` is `"horizontal"`, specifies the maximum height of the component. | ||
* @prop --calcite-shell-panel-min-height: When `layout` is `"horizontal"`, specifies the minimum height of the component. | ||
* @prop --calcite-shell-panel-detached-max-height: When `detached` is `true`, specifies the maximum height of the component. | ||
* @prop --calcite-shell-panel-detached-max-height: When `displayMode` is `float`, specifies the maximum height of the component. | ||
* @prop --calcite-shell-panel-z-index: Specifies the z-index value for the component. | ||
* | ||
*/ | ||
|
@@ -20,8 +20,23 @@ | |
flex | ||
flex-initial | ||
items-stretch; | ||
--calcite-shell-panel-detached-max-height: unset; | ||
z-index: var(--calcite-shell-panel-z-index, theme("zIndex.default")); | ||
--calcite-shell-panel-detached-max-height: unset; | ||
--calcite-shell-panel-shadow-block-start-internal: 0 4px 8px -1px rgba(0, 0, 0, 0.08), | ||
0 2px 4px -1px rgba(0, 0, 0, 0.04); | ||
--calcite-shell-panel-shadow-block-end-internal: 0 -4px 8px -1px rgba(0, 0, 0, 0.08), | ||
0 -2px 4px -1px rgba(0, 0, 0, 0.04); | ||
--calcite-shell-panel-shadow-inline-start-internal: 4px 0 8px -1px rgba(0, 0, 0, 0.08), | ||
2px 0 4px -1px rgba(0, 0, 0, 0.04); | ||
--calcite-shell-panel-shadow-inline-end-internal: -4px 0 8px -1px rgba(0, 0, 0, 0.08), | ||
-2px 0 4px -1px rgba(0, 0, 0, 0.04); | ||
} | ||
|
||
.calcite--rtl.content--overlay { | ||
--calcite-shell-panel-shadow-inline-start-internal: -4px 0 8px -1px rgba(0, 0, 0, 0.08), | ||
-2px 0 4px -1px rgba(0, 0, 0, 0.04); | ||
--calcite-shell-panel-shadow-inline-end-internal: 4px 0 8px -1px rgba(0, 0, 0, 0.08), | ||
2px 0 4px -1px rgba(0, 0, 0, 0.04); | ||
} | ||
|
||
:host([layout="vertical"]) { | ||
|
@@ -52,15 +67,15 @@ | |
--calcite-shell-panel-min-width-internal: var(--calcite-shell-panel-min-width, 340px); | ||
} | ||
|
||
:host([detached-height-scale="s"]) .content--detached { | ||
:host([detached-height-scale="s"]) .content--float { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we update this detached prop to say float as well? deprecate and add new? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or could we just deprecate this prop and use a CSS var instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could look at changing how this behaves in the future, there’s a need for a “full” and “auto” height. “Float” sounds a bit weird in this context but if that’s the value name we should update to match. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jcfranco should we deprecate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. I believe we should once we have the new prop in place. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we need this at all with the available css variables to constrain and set height, especially if it only affects the one mode. Detached shell panel in vertical layout could be height: auto to fit content, and could set a max height of 100% (minus margin). Not sure how common having a defined height that is less than 100% but more than the height of the content is. cc @asangma for general Shell FYI / use cases There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added it but if we want to remove we can. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @macandcheese do you want me to remove the |
||
--calcite-shell-panel-detached-max-height-internal: var(--calcite-shell-panel-detached-max-height, 40vh); | ||
} | ||
|
||
:host([detached-height-scale="m"]) .content--detached { | ||
:host([detached-height-scale="m"]) .content--float { | ||
--calcite-shell-panel-detached-max-height-internal: var(--calcite-shell-panel-detached-max-height, 60vh); | ||
} | ||
|
||
:host([detached-height-scale="l"]) .content--detached { | ||
:host([detached-height-scale="l"]) .content--float { | ||
--calcite-shell-panel-detached-max-height-internal: var(--calcite-shell-panel-detached-max-height, 80vh); | ||
} | ||
|
||
|
@@ -194,26 +209,60 @@ | |
overflow-hidden; | ||
} | ||
|
||
.content--detached { | ||
.content--overlay { | ||
@apply absolute | ||
shadow-0; | ||
} | ||
|
||
:host([layout="vertical"]) .content--overlay { | ||
@apply top-0 h-full; | ||
} | ||
|
||
:host([layout="horizontal"]) .content--overlay { | ||
@apply left-0 w-full; | ||
} | ||
|
||
:host([layout="vertical"][position="start"]) .content--overlay { | ||
inset-inline-start: 100%; | ||
box-shadow: var(--calcite-shell-panel-shadow-inline-start-internal); | ||
} | ||
|
||
:host([layout="vertical"][position="end"]) .content--overlay { | ||
inset-inline-end: 100%; | ||
box-shadow: var(--calcite-shell-panel-shadow-inline-end-internal); | ||
} | ||
|
||
:host([layout="horizontal"][position="start"]) .content--overlay { | ||
inset-block-start: 100%; | ||
box-shadow: var(--calcite-shell-panel-shadow-block-start-internal); | ||
} | ||
|
||
:host([layout="horizontal"][position="end"]) .content--overlay { | ||
inset-block-end: 100%; | ||
box-shadow: var(--calcite-shell-panel-shadow-block-end-internal); | ||
} | ||
|
||
.content--float { | ||
@apply shadow-0 | ||
mx-2 | ||
mt-2 | ||
mb-auto | ||
h-auto | ||
overflow-hidden | ||
rounded; | ||
} | ||
|
||
.content--detached { | ||
max-block-size: var(--calcite-shell-panel-detached-max-height-internal); | ||
::slotted(calcite-panel), | ||
::slotted(calcite-flow) { | ||
max-block-size: unset; | ||
} | ||
} | ||
|
||
:host([position="start"]) .content--detached, | ||
:host([position="end"]) .content--detached { | ||
:host([layout="horizontal"]) .content--float { | ||
@apply my-2; | ||
} | ||
|
||
:host([position="start"]) .content--float, | ||
:host([position="end"]) .content--float { | ||
::slotted(calcite-panel), | ||
::slotted(calcite-flow) { | ||
@apply border-none; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@macandcheese should we rename these CSS props to not use detached and float instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we should update to the final value name. At some point we can probably look to combine this with the other css vars, maybe when we look at the content-behind / Shell cases.