123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508 |
- /* 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-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-scale {
- animation-name: in-scale;
- }
- @media (prefers-reduced-motion: reduce) {
- :root {
- --calcite-internal-duration-factor: 0.01;
- }
- }
- /**
- * Currently only used in Checkbox.
- */
- :root {
- --calcite-floating-ui-transition: var(--calcite-animation-timing);
- }
- :host([hidden]) {
- display: none;
- }
- /**
- * CSS Custom Properties
- *
- * These properties can be overridden using the component's tag as selector.
- *
- * @prop --calcite-modal-content-text: [Deprecated] The component content's font size.
- * @prop --calcite-modal-padding: [Deprecated] The padding around content area slot.
- * @prop --calcite-modal-padding-large: [Deprecated] The left/right padding around items within the component.
- * @prop --calcite-modal-title-text: [Deprecated] The component title's font size.
- * @prop --calcite-scrim-background: [Deprecated] The component's semi-transparent background color.
- */
- :host {
- position: fixed;
- inset: 0px;
- z-index: 700;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow-y: hidden;
- color: var(--calcite-ui-text-2);
- opacity: 0;
- visibility: hidden !important;
- transition: visibility 0ms linear var(--calcite-internal-animation-timing-slow), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88);
- }
- :host([scale=s]) {
- --calcite-modal-padding: 0.75rem;
- --calcite-modal-padding-large: 1rem;
- --calcite-modal-title-text: var(--calcite-font-size-1);
- --calcite-modal-content-text: var(--calcite-font-size--1);
- --calcite-modal-padding-internal: 0.75rem;
- --calcite-modal-padding-large-internal: 1rem;
- --calcite-modal-title-text-internal: var(--calcite-font-size-1);
- --calcite-modal-content-text-internal: var(--calcite-font-size--1);
- }
- :host([scale=m]) {
- --calcite-modal-padding: 1rem;
- --calcite-modal-padding-large: 1.25rem;
- --calcite-modal-title-text: var(--calcite-font-size-2);
- --calcite-modal-content-text: var(--calcite-font-size-0);
- --calcite-modal-padding-internal: 1rem;
- --calcite-modal-padding-large-internal: 1.25rem;
- --calcite-modal-title-text-internal: var(--calcite-font-size-2);
- --calcite-modal-content-text-internal: var(--calcite-font-size-0);
- }
- :host([scale=l]) {
- --calcite-modal-padding: 1.25rem;
- --calcite-modal-padding-large: 1.5rem;
- --calcite-modal-title-text: var(--calcite-font-size-3);
- --calcite-modal-content-text: var(--calcite-font-size-1);
- --calcite-modal-padding-internal: 1.25rem;
- --calcite-modal-padding-large-internal: 1.5rem;
- --calcite-modal-title-text-internal: var(--calcite-font-size-3);
- --calcite-modal-content-text-internal: var(--calcite-font-size-1);
- }
- .scrim {
- --calcite-scrim-background: rgba(0, 0, 0, 0.75);
- position: fixed;
- inset: 0px;
- display: flex;
- overflow-y: hidden;
- }
- .modal {
- pointer-events: none;
- z-index: 800;
- float: none;
- margin: 1.5rem;
- box-sizing: border-box;
- display: flex;
- inline-size: 100%;
- flex-direction: column;
- overflow: hidden;
- border-radius: 0.25rem;
- background-color: var(--calcite-ui-foreground-1);
- opacity: 0;
- --tw-shadow: 0 2px 12px -4px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.16);
- --tw-shadow-colored: 0 2px 12px -4px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
- -webkit-overflow-scrolling: touch;
- visibility: hidden;
- transition: transform var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), visibility 0ms linear var(--calcite-internal-animation-timing-slow), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88);
- --calcite-modal-hidden-position: translate3d(0, 20px, 0);
- --calcite-modal-shown-position: translate3d(0, 0, 0);
- }
- .modal--opening-idle {
- transform: var(--calcite-modal-hidden-position);
- }
- .modal--opening-active {
- transform: var(--calcite-modal-shown-position);
- }
- .modal--closing-idle {
- transform: var(--calcite-modal-shown-position);
- }
- .modal--closing-active {
- transform: var(--calcite-modal-hidden-position);
- }
- :host([open]) {
- opacity: 1;
- visibility: visible !important;
- transition-delay: 0ms;
- }
- :host([open]) .modal--open {
- pointer-events: auto;
- visibility: visible;
- opacity: 1;
- transition: transform var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), visibility 0ms linear, opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), max-inline-size var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), max-block-size var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88);
- transition-delay: 0ms;
- }
- /**
- * Header
- */
- .header {
- z-index: 400;
- display: flex;
- min-inline-size: 0px;
- max-inline-size: 100%;
- border-start-start-radius: 0.25rem;
- border-start-end-radius: 0.25rem;
- border-width: 0px;
- border-block-end-width: 1px;
- border-style: solid;
- border-color: var(--calcite-ui-border-3);
- background-color: var(--calcite-ui-foreground-1);
- flex: 0 0 auto;
- }
- .close {
- order: 2;
- margin: 0px;
- cursor: pointer;
- -webkit-appearance: none;
- appearance: none;
- border-style: none;
- background-color: transparent;
- color: var(--calcite-ui-text-3);
- outline-color: transparent;
- transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;
- border-start-end-radius: 0.25rem;
- padding-block: var(--calcite-modal-padding, var(--calcite-modal-padding-internal));
- padding-inline: var(--calcite-modal-padding, var(--calcite-modal-padding-internal));
- flex: 0 0 auto;
- }
- .close calcite-icon {
- pointer-events: none;
- vertical-align: -2px;
- }
- .close:focus {
- outline: 2px solid var(--calcite-ui-brand);
- outline-offset: -2px;
- }
- .close:hover, .close:focus, .close:active {
- background-color: var(--calcite-ui-foreground-2);
- color: var(--calcite-ui-text-1);
- }
- .title {
- order: 1;
- display: flex;
- min-inline-size: 0px;
- align-items: center;
- flex: 1 1 auto;
- padding-block: var(--calcite-modal-padding, var(--calcite-model-padding-internal));
- padding-inline: var(--calcite-modal-padding-large, var(--calcite-modal-padding-large-internal));
- }
- slot[name=header]::slotted(*),
- *::slotted([slot=header]) {
- margin: 0px;
- font-weight: var(--calcite-font-weight-normal);
- color: var(--calcite-ui-text-1);
- font-size: var(--calcite-modal-title-text, var(--calcite-modal-title-text-internal));
- }
- /**
- * Content area
- */
- .content {
- position: relative;
- box-sizing: border-box;
- display: block;
- block-size: 100%;
- overflow: auto;
- background-color: var(--calcite-ui-foreground-1);
- padding: 0px;
- max-block-size: calc(100vh - 12rem);
- }
- .content--spaced {
- padding: var(--calcite-modal-padding);
- }
- .content--no-footer {
- border-end-end-radius: 0.25rem;
- border-end-start-radius: 0.25rem;
- }
- slot[name=content]::slotted(*),
- *::slotted([slot=content]) {
- font-size: var(--calcite-modal-content-text, var(--calcite-modal-context-text-internal));
- }
- :host([background-color=grey]) .content {
- background-color: var(--calcite-ui-background);
- }
- /**
- * Footer
- */
- .footer {
- z-index: 400;
- margin-block-start: auto;
- box-sizing: border-box;
- display: flex;
- inline-size: 100%;
- justify-content: space-between;
- border-end-end-radius: 0.25rem;
- border-end-start-radius: 0.25rem;
- border-width: 0px;
- border-block-start-width: 1px;
- border-style: solid;
- border-color: var(--calcite-ui-border-3);
- background-color: var(--calcite-ui-foreground-1);
- flex: 0 0 auto;
- padding-block: var(--calcite-modal-padding, var(--calcite-modal-padding-internal));
- padding-inline: var(--calcite-modal-padding-large, var(--calcite-modal-padding-large-internal));
- }
- .footer--hide-back .back,
- .footer--hide-secondary .secondary {
- display: none;
- }
- .back {
- display: block;
- margin-inline-end: auto;
- }
- .secondary {
- margin-inline: 0.25rem;
- display: block;
- }
- slot[name=primary] {
- display: block;
- }
- /**
- * Sizes
- */
- :host([width=small]) .modal {
- inline-size: auto;
- }
- :host([width=s]) .modal {
- max-inline-size: 32rem;
- }
- @media screen and (max-width: 35rem) {
- :host([width=s]) .modal {
- margin: 0px;
- block-size: 100%;
- max-block-size: 100%;
- inline-size: 100%;
- max-inline-size: 100%;
- border-radius: 0px;
- }
- :host([width=s]) .content {
- flex: 1 1 auto;
- max-block-size: unset;
- }
- :host([width=s][docked]) {
- align-items: flex-end;
- }
- }
- :host([width=m]) .modal {
- max-inline-size: 48rem;
- }
- @media screen and (max-width: 51rem) {
- :host([width=m]) .modal {
- margin: 0px;
- block-size: 100%;
- max-block-size: 100%;
- inline-size: 100%;
- max-inline-size: 100%;
- border-radius: 0px;
- }
- :host([width=m]) .content {
- flex: 1 1 auto;
- max-block-size: unset;
- }
- :host([width=m][docked]) {
- align-items: flex-end;
- }
- }
- :host([width=l]) .modal {
- max-inline-size: 94rem;
- }
- @media screen and (max-width: 97rem) {
- :host([width=l]) .modal {
- margin: 0px;
- block-size: 100%;
- max-block-size: 100%;
- inline-size: 100%;
- max-inline-size: 100%;
- border-radius: 0px;
- }
- :host([width=l]) .content {
- flex: 1 1 auto;
- max-block-size: unset;
- }
- :host([width=l][docked]) {
- align-items: flex-end;
- }
- }
- /**
- * Fullscreen
- */
- :host([fullscreen]) {
- background-color: transparent;
- }
- :host([fullscreen]) .modal {
- margin: 0px;
- block-size: 100%;
- max-block-size: 100%;
- inline-size: 100%;
- max-inline-size: 100%;
- --calcite-modal-hidden-position: translate3D(0, 20px, 0) scale(0.95);
- --calcite-modal-shown-position: translate3D(0, 0, 0) scale(1);
- }
- :host([fullscreen]) .content {
- max-block-size: 100%;
- flex: 1 1 auto;
- }
- :host([open][fullscreen]) .header {
- border-radius: 0;
- }
- :host([open][fullscreen]) .footer {
- border-radius: 0;
- }
- /**
- * Docked
- */
- :host([docked]) .modal {
- block-size: auto;
- }
- :host([docked]) .content {
- block-size: auto;
- flex: 1 1 auto;
- }
- @media screen and (max-width: 860px) {
- :host([docked]) .modal {
- border-radius: var(--calcite-border-radius) var(--calcite-border-radius) 0 0;
- }
- :host([docked]) .close {
- border-start-end-radius: var(--calcite-border-radius);
- }
- }
- /**
- * Colors
- */
- :host([color=red]) .modal {
- border-color: var(--calcite-ui-danger);
- }
- :host([color=blue]) .modal {
- border-color: var(--calcite-ui-info);
- }
- :host([color=red]) .modal,
- :host([color=blue]) .modal {
- border-width: 0px;
- border-block-start-width: 4px;
- border-style: solid;
- }
- :host([color=red]) .header,
- :host([color=blue]) .header {
- border-radius: 0.25rem;
- border-end-end-radius: 0px;
- border-end-start-radius: 0px;
- }
- /**
- * Tablet
- */
- @media screen and (max-width: 860px) {
- slot[name=header]::slotted(*),
- *::slotted([slot=header]) {
- font-size: var(--calcite-font-size-1);
- }
- .footer {
- position: sticky;
- inset-block-end: 0px;
- }
- }
- /**
- * Mobile
- */
- @media screen and (max-width: 480px) {
- .footer {
- flex-direction: column;
- }
- .back,
- .secondary {
- margin: 0px;
- margin-block-end: 0.25rem;
- }
- }
|