UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

442 lines (387 loc) • 12.7 kB
/* mixins & extensions */ @keyframes in { 0% { opacity: 0; } 100% { opacity: 1; } } @keyframes in-down { 0% { opacity: 0; transform: translate3D(0, -5px, 0); } 100% { opacity: 1; transform: translate3D(0, 0, 0); } } @keyframes in-up { 0% { opacity: 0; transform: translate3D(0, 5px, 0); } 100% { opacity: 1; transform: translate3D(0, 0, 0); } } @keyframes in-right { 0% { opacity: 0; transform: translate3D(-5px, 0, 0); } 100% { opacity: 1; transform: translate3D(0, 0, 0); } } @keyframes in-left { 0% { opacity: 0; transform: translate3D(5px, 0, 0); } 100% { opacity: 1; transform: translate3D(0, 0, 0); } } @keyframes in-scale { 0% { opacity: 0; transform: scale3D(0.95, 0.95, 1); } 100% { opacity: 1; transform: scale3D(1, 1, 1); } } :root { --calcite-animation-timing: calc(150ms * var(--calcite-internal-duration-factor)); --calcite-internal-duration-factor: var(--calcite-duration-factor, 1); --calcite-internal-animation-timing-fast: calc(100ms * var(--calcite-internal-duration-factor)); --calcite-internal-animation-timing-medium: calc(200ms * var(--calcite-internal-duration-factor)); --calcite-internal-animation-timing-slow: calc(300ms * var(--calcite-internal-duration-factor)); } .calcite-animate { opacity: 0; animation-fill-mode: both; animation-duration: var(--calcite-animation-timing); } .calcite-animate__in { animation-name: in; } .calcite-animate__in-down { animation-name: in-down; } .calcite-animate__in-up { animation-name: in-up; } .calcite-animate__in-right { animation-name: in-right; } .calcite-animate__in-left { animation-name: in-left; } .calcite-animate__in-scale { animation-name: in-scale; } @media (prefers-reduced-motion: reduce) { :root { --calcite-internal-duration-factor: 0.01; } } /* helper to properly scale internal durations */ /** * Currently only used in Checkbox. */ :root { --calcite-floating-ui-transition: var(--calcite-animation-timing); --calcite-floating-ui-z-index: var(--calcite-app-z-index-dropdown); } :host([hidden]) { display: none; } /** * CSS Custom Properties * * These properties can be overridden using the component's tag as selector. * * @prop --calcite-shell-panel-width: Specifies the width of the component. * @prop --calcite-shell-panel-max-width: Specifies the maximum width of the component. * @prop --calcite-shell-panel-min-width: Specifies the minimum width of the component. * @prop --calcite-shell-panel-height: When `layout` is `horizontal`, or `layout` is `vertical` and `displayMode` is `float`, specifies the height of the component. * @prop --calcite-shell-panel-max-height: When `layout` is `horizontal`, or `layout` is `vertical` and `displayMode` is `float`, specifies the maximum height of the component. * @prop --calcite-shell-panel-min-height: When `layout` is `horizontal`, or `layout` is `vertical` and `displayMode` is `float`, specifies the minimum height of the component. * @prop --calcite-shell-panel-detached-max-height: [Deprecated] Use the `heightScale` property instead. 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. * */ :host { pointer-events: none; position: relative; display: flex; flex: 0 1 auto; align-items: stretch; z-index: var(--calcite-shell-panel-z-index, var(--calcite-app-z-index)); --calcite-shell-panel-detached-max-height: unset; --calcite-shell-panel-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]) { z-index: var(--calcite-shell-panel-z-index, calc(var(--calcite-app-z-index) + 1)); } :host([layout=vertical][display-mode=overlay]) { z-index: var(--calcite-shell-panel-z-index, calc(var(--calcite-app-z-index-header) + 1)); } :host([layout=vertical][width-scale=s]) .content { --calcite-shell-panel-width-internal: var(--calcite-shell-panel-width, 12vw); --calcite-shell-panel-max-width-internal: var(--calcite-shell-panel-max-width, 300px); --calcite-shell-panel-min-width-internal: var(--calcite-shell-panel-min-width, 150px); } :host([layout=vertical][width-scale=m]) .content { --calcite-shell-panel-width-internal: var(--calcite-shell-panel-width, 20vw); --calcite-shell-panel-max-width-internal: var(--calcite-shell-panel-max-width, 420px); --calcite-shell-panel-min-width-internal: var(--calcite-shell-panel-min-width, 240px); } :host([layout=vertical][width-scale=l]) .content { --calcite-shell-panel-width-internal: var(--calcite-shell-panel-width, 45vw); --calcite-shell-panel-max-width-internal: var(--calcite-shell-panel-max-width, 680px); --calcite-shell-panel-min-width-internal: var(--calcite-shell-panel-min-width, 340px); } :host([layout=horizontal][height-scale=s]) .content { --calcite-shell-panel-max-height-internal: var( --calcite-shell-panel-max-height, var(--calcite-shell-panel-detached-max-height, 20vh) ); } :host([layout=horizontal]) .content { --calcite-shell-panel-min-height-internal: var(--calcite-shell-panel-min-height, 5vh); --calcite-shell-panel-max-height-internal: var( --calcite-shell-panel-max-height, var(--calcite-shell-panel-detached-max-height, 30vh) ); } :host([layout=horizontal][height-scale=l]) .content { --calcite-shell-panel-max-height-internal: var( --calcite-shell-panel-max-height, var(--calcite-shell-panel-detached-max-height, 40vh) ); } .container { pointer-events: none; box-sizing: border-box; display: flex; flex: 1 1 auto; align-items: stretch; background-color: transparent; font-size: var(--calcite-font-size--1); color: var(--calcite-ui-text-2); } .container * { box-sizing: border-box; } :host([layout=horizontal]) .container { flex-direction: column; } :host(:hover) .separator:not(:hover):not(:focus), :host(:focus-within) .separator:not(:hover):not(:focus) { opacity: 1; background-color: var(--calcite-ui-border-3); } .separator { pointer-events: auto; position: absolute; display: flex; background-color: transparent; opacity: 0; transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s; cursor: col-resize; outline: none; } .separator:hover { opacity: 1; background-color: var(--calcite-ui-border-2); } .separator:focus { background-color: var(--calcite-ui-brand); opacity: 1; } :host([layout=vertical]) .separator { inset-block: 0px; block-size: 100%; inline-size: 0.125rem; cursor: col-resize; } :host([layout=horizontal][position=start]) .separator { inset-block-end: 0px; } :host([layout=horizontal][position=end]) .separator { inset-block-start: 0px; } :host([layout=horizontal]) .separator { inset-inline-end: 0px; block-size: 0.125rem; inline-size: 100%; cursor: row-resize; } :host([layout=vertical][position=start]) .separator { inset-inline-end: -2px; } :host([layout=horizontal][position=start]) .separator { inset-block-end: -2px; } :host([layout=vertical][position=end]) .separator { inset-inline-start: -2px; } :host([layout=horizontal][position=end]) .separator { inset-block-start: -2px; } ::slotted(calcite-panel), ::slotted(calcite-flow) { block-size: 100%; inline-size: 100%; flex: 1 1 auto; max-block-size: unset; max-inline-size: unset; } ::slotted(.calcite-match-height) { display: flex; flex: 1 1 auto; overflow: hidden; } .content { pointer-events: auto; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; align-self: stretch; background-color: var(--calcite-ui-background); padding: 0px; transition: max-block-size var(--calcite-animation-timing), max-inline-size var(--calcite-animation-timing); } :host([layout=vertical]) .content { inline-size: var(--calcite-shell-panel-width-internal); max-inline-size: var(--calcite-shell-panel-max-width-internal); min-inline-size: var(--calcite-shell-panel-min-width-internal); } :host([layout=horizontal]) .content { block-size: var(--calcite-shell-panel-height-internal); max-block-size: var(--calcite-shell-panel-max-height-internal); min-block-size: var(--calcite-shell-panel-min-height-internal); } .content__header { display: flex; flex: 0 1 auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; } .content__body { display: flex; flex: 1 1 auto; flex-direction: column; overflow: hidden; } .content--overlay { position: absolute; --tw-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04); --tw-shadow-colored: 0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } :host([layout=vertical]) .content--overlay { inset-block-start: 0px; block-size: 100%; } :host([layout=horizontal]) .content--overlay { inset-inline-start: 0px; inline-size: 100%; } :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 { margin-inline: 0.5rem; margin-block: 0.5rem auto; block-size: auto; overflow: hidden; border-radius: 0.25rem; --tw-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04); --tw-shadow-colored: 0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); max-block-size: var(--calcite-shell-panel-max-height-internal, calc(100% - 1rem)); } .content--float ::slotted(calcite-panel), .content--float ::slotted(calcite-flow) { max-block-size: unset; } :host([layout=horizontal]) .content--float { margin-block: 0.5rem; } :host([position=start]) .content--float ::slotted(calcite-panel), :host([position=start]) .content--float ::slotted(calcite-flow), :host([position=end]) .content--float ::slotted(calcite-panel), :host([position=end]) .content--float ::slotted(calcite-flow) { border-style: none; } .content[hidden] { display: none; } slot[name=action-bar]::slotted(calcite-action-bar), .content ::slotted(calcite-flow), .content ::slotted(calcite-panel:not([closed])) { border-width: 1px; border-style: solid; border-color: var(--calcite-ui-border-3); } :host([position=start]) slot[name=action-bar]::slotted(calcite-action-bar), :host([position=start]) .content ::slotted(calcite-flow), :host([position=start]) .content ::slotted(calcite-panel) { border-inline-start: none; } :host([position=end]) slot[name=action-bar]::slotted(calcite-action-bar), :host([position=end]) .content ::slotted(calcite-flow), :host([position=end]) .content ::slotted(calcite-panel) { border-inline-end: none; } :host([layout=horizontal]) slot[name=action-bar]::slotted(calcite-action-bar) { border-inline: 0; } :host([layout=horizontal][position=start]) .content ::slotted(calcite-flow), :host([layout=horizontal][position=start]) .content ::slotted(calcite-panel) { border-inline: 0; border-block-start: 0; } :host([layout=horizontal][position=end]) .content ::slotted(calcite-flow), :host([layout=horizontal][position=end]) .content ::slotted(calcite-panel) { border-inline: 0; border-block-end: 0; }