UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

276 lines (244 loc) • 5.58 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-popover-z-index: Sets the z-index value for the component. */ :host { --calcite-floating-ui-z-index: var(--calcite-popover-z-index, var(--calcite-app-z-index-popup)); display: block; position: absolute; z-index: var(--calcite-floating-ui-z-index); } .calcite-floating-ui-anim { position: relative; transition: var(--calcite-floating-ui-transition); transition-property: transform, visibility, opacity; opacity: 0; box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.16); z-index: var(--calcite-app-z-index); border-radius: 0.25rem; } :host([data-placement^=bottom]) .calcite-floating-ui-anim { transform: translateY(-5px); } :host([data-placement^=top]) .calcite-floating-ui-anim { transform: translateY(5px); } :host([data-placement^=left]) .calcite-floating-ui-anim { transform: translateX(5px); } :host([data-placement^=right]) .calcite-floating-ui-anim { transform: translateX(-5px); } :host([data-placement]) .calcite-floating-ui-anim--active { opacity: 1; transform: translate(0); } :host([calcite-hydrated-hidden]) { visibility: hidden !important; pointer-events: none; } .calcite-floating-ui-arrow { pointer-events: none; position: absolute; z-index: calc(var(--calcite-app-z-index) * -1); fill: var(--calcite-ui-foreground-1); } .calcite-floating-ui-arrow__stroke { stroke: var(--calcite-ui-border-3); } :host([scale=s]) .heading { padding-inline: 0.75rem; padding-block: 0.5rem; font-size: var(--calcite-font-size--1); line-height: 1.375; } :host([scale=m]) .heading { padding-inline: 1rem; padding-block: 0.75rem; font-size: var(--calcite-font-size-0); line-height: 1.375; } :host([scale=l]) .heading { padding-inline: 1.25rem; padding-block: 1rem; font-size: var(--calcite-font-size-1); line-height: 1.375; } :host { pointer-events: none; } :host([open]) { pointer-events: initial; } .calcite-floating-ui-anim { border-radius: 0.25rem; border-width: 1px; border-style: solid; border-color: var(--calcite-ui-border-3); background-color: var(--calcite-ui-foreground-1); } .arrow::before { outline: 1px solid var(--calcite-ui-border-3); } .header { display: flex; flex: 1 1 auto; align-items: stretch; justify-content: flex-start; border-width: 0px; border-block-end-width: 1px; border-style: solid; border-block-end-color: var(--calcite-ui-border-3); } .heading { margin: 0px; display: block; flex: 1 1 auto; align-self: center; white-space: normal; font-weight: var(--calcite-font-weight-medium); color: var(--calcite-ui-text-1); word-wrap: break-word; word-break: break-word; } .container { position: relative; display: flex; block-size: 100%; flex-direction: row; flex-wrap: nowrap; border-radius: 0.25rem; color: var(--calcite-ui-text-1); } .container.has-header { flex-direction: column; } .content { display: flex; block-size: 100%; inline-size: 100%; flex-direction: column; flex-wrap: nowrap; align-self: center; word-wrap: break-word; word-break: break-word; } .close-button-container { display: flex; overflow: hidden; flex: 0 0 auto; border-start-end-radius: 0.25rem; border-end-end-radius: 0.25rem; } ::slotted(calcite-panel), ::slotted(calcite-flow) { block-size: 100%; }