@aurodesignsystem/auro-dialog 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,278 @@
1
+ // Copyright (c) 2024 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2
+ // See LICENSE in the project root for license information.
3
+
4
+ // ---------------------------------------------------------------------
5
+
6
+ /* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, lit-a11y/click-events-have-key-events, jsdoc/require-description-complete-sentence */
7
+
8
+ import { LitElement, html } from "lit";
9
+ import { classMap } from 'lit/directives/class-map.js';
10
+
11
+ import styleCss from "./style-css.js";
12
+ import styleCssFixed from './style-fixed-css.js';
13
+ import styleUnformattedCss from './style-unformatted-css.js';
14
+ import styleUnformattedCssFixed from './style-unformatted-fixed-css.js';
15
+ import closeIcon from '@alaskaairux/icons/dist/icons/interface/x-lg_es6.js';
16
+
17
+ /* eslint-disable one-var, prefer-destructuring */
18
+
19
+ const ESCAPE_KEYCODE = 27,
20
+ FOCUS_TIMEOUT = 50;
21
+
22
+ // See https://git.io/JJ6SJ for "How to document your components using JSDoc"
23
+ /**
24
+ * auro-dialog appear above the page and require the user's attention.
25
+ *
26
+ * @attr {Boolean} modal - Modal dialog restricts the user to take an action (no default close actions)
27
+ * @attr {Boolean} fixed - Uses fixed pixel values for element shape
28
+ * @attr {Boolean} unformatted - Unformatted dialog window, edge-to-edge fill for content
29
+ * @attr {Boolean} sm - Sets dialog box to small style. Adding both sm and lg will set the dialog to sm for desktop and lg for mobile.
30
+ * @attr {Boolean} md - Sets dialog box to medium style. Adding both md and lg will set the dialog to md for desktop and lg for mobile.
31
+ * @attr {Boolean} onDark - Sets close icon to white for dark backgrounds
32
+ * @attr {Boolean} open - Sets state of dialog to open
33
+ * @prop {HTMLElement} triggerElement - The element to focus when the dialog is closed. If not set, defaults to the value of document.activeElement when the dialog is opened.
34
+ * @slot header - Text to display as the header of the modal
35
+ * @slot content - Injects content into the body of the modal
36
+ * @slot footer - Used for action options, e.g. buttons
37
+ * @function toggleViewable - toggles the 'open' property on the element
38
+ * @event toggle - Event fires when the element is closed
39
+ * @csspart close-button - adjust position of the close X icon in the dialog window
40
+ * @csspart dialog-overlay - apply CSS on the overlay of the dialog
41
+ * @csspart dialog - apply CSS to the entire dialog
42
+ * @csspart dialog-header - apply CSS to the header of the dialog
43
+ * @csspart dialog-content - apply CSS to the content of the dialog
44
+ * @csspart dialog-footer - apply CSS to the footer of the dialog
45
+ */
46
+
47
+ export default class ComponentBase extends LitElement {
48
+ constructor() {
49
+ super();
50
+
51
+ /**
52
+ * @private
53
+ */
54
+ this.dom = new DOMParser().parseFromString(closeIcon.svg, 'text/html');
55
+
56
+ /**
57
+ * @private
58
+ */
59
+ this.svg = this.dom.body.firstChild;
60
+
61
+ this.modal = false;
62
+ this.unformatted = false;
63
+ }
64
+
65
+ static get properties() {
66
+ return {
67
+ modal: { type: Boolean },
68
+ unformatted: {
69
+ type: Boolean,
70
+ reflect: true
71
+ },
72
+ open: {
73
+ type: Boolean,
74
+ reflect: true
75
+ },
76
+ triggerElement: {
77
+ attribute: false
78
+ }
79
+ };
80
+ }
81
+
82
+ firstUpdated() {
83
+ const slot = this.shadowRoot.querySelector("#footer"),
84
+ slotWrapper = this.shadowRoot.querySelector("#footerWrapper");
85
+
86
+ this.dialog = this.shadowRoot.getElementById('dialog');
87
+
88
+ if (!this.unformatted && slot.assignedNodes().length === 0) {
89
+ slotWrapper.classList.remove("dialog-footer");
90
+ }
91
+ }
92
+
93
+ /**
94
+ * LitElement lifecycle method. Called after the DOM has been updated.
95
+ * @param {Map<string, any>} changedProperties - Keys are the names of changed properties, values are the corresponding previous values.
96
+ * @returns {void}
97
+ */
98
+ updated(changedProperties) {
99
+ if (changedProperties.has('open')) {
100
+ if (this.open) {
101
+ this.openDialog();
102
+ } else {
103
+ this.closeDialog();
104
+ }
105
+ }
106
+ }
107
+
108
+ connectedCallback() {
109
+ super.connectedCallback();
110
+ this.keydownEventHandler = this.handleKeydown.bind(this);
111
+ window.addEventListener('keydown', this.keydownEventHandler);
112
+ }
113
+
114
+ disconnectedCallback() {
115
+ super.disconnectedCallback();
116
+ window.removeEventListener('keydown', this.keydownEventHandler);
117
+ }
118
+
119
+ /**
120
+ * @private
121
+ * @returns {void}
122
+ */
123
+ openDialog() {
124
+ this.defaultTrigger = document.activeElement;
125
+
126
+ setTimeout(() => {
127
+ this.focus();
128
+
129
+ this.handleFocusLoss();
130
+ }, FOCUS_TIMEOUT);
131
+ }
132
+
133
+ /**
134
+ * @private
135
+ * @returns {void}
136
+ */
137
+ closeDialog() {
138
+ this.dispatchToggleEvent();
139
+ }
140
+
141
+ /**
142
+ * @private
143
+ * @returns {void}
144
+ */
145
+ dispatchToggleEvent() {
146
+ // replace with Event constructor once IE support dropped
147
+ const toggleEvent = document.createEvent("HTMLEvents");
148
+
149
+ toggleEvent.initEvent("toggle", true, false);
150
+ this.dispatchEvent(toggleEvent);
151
+ }
152
+
153
+ /**
154
+ * @private
155
+ * @returns {void} Determines if dropdown bib should be closed on focus change.
156
+ */
157
+ handleFocusLoss() {
158
+ const focusable = [...this.querySelectorAll('button, auro-button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')];
159
+
160
+ const firstFocusableElement = focusable[0];
161
+ const lastFocusableElement = focusable[focusable.length - 1];
162
+
163
+ const closeButton = this.shadowRoot.getElementById('dialog-close');
164
+
165
+ lastFocusableElement.addEventListener('focusout', () => {
166
+ if (closeButton !== null) { // eslint-disable-line no-negated-condition
167
+ closeButton.focus();
168
+ } else {
169
+ firstFocusableElement.focus();
170
+ }
171
+ });
172
+ }
173
+
174
+ /**
175
+ * @private
176
+ * @returns {void}
177
+ */
178
+ handleOverlayClick() {
179
+ if (this.open && !this.modal) {
180
+ this.handleCloseButtonClick();
181
+ }
182
+ }
183
+
184
+ /**
185
+ * @private
186
+ * @returns {void}
187
+ */
188
+ handleCloseButtonClick() {
189
+ this.open = false;
190
+ }
191
+
192
+ /**
193
+ * @private
194
+ * @param {KeyboardEvent} event - The keyboard event containing the key and keyCode.
195
+ * @returns {void}
196
+ */
197
+ handleKeydown({ key, keyCode }) {
198
+ if (this.open && !this.modal && (key === 'Escape' || keyCode === ESCAPE_KEYCODE)) {
199
+ this.open = false;
200
+ }
201
+ }
202
+
203
+ /**
204
+ * Focus the dialog.
205
+ * @private
206
+ * @returns {void}
207
+ */
208
+ focus() {
209
+ if (this.open) {
210
+ this.dialog.focus();
211
+ }
212
+ }
213
+
214
+ static get styles() {
215
+ return [
216
+ styleCss,
217
+ styleCssFixed,
218
+ styleUnformattedCss,
219
+ styleUnformattedCssFixed
220
+ ];
221
+ }
222
+
223
+ /**
224
+ * @private
225
+ * @returns {TemplateResult} - The close button template.
226
+ */
227
+ getCloseButton() {
228
+ return this.modal
229
+ ? html``
230
+ : html`
231
+ <button class="dialog-header--action" id="dialog-close" @click="${this.handleCloseButtonClick}" part="close-button">
232
+ <span>${this.svg}</span>
233
+ <span class="util_displayHiddenVisually">Close</span>
234
+ </button>
235
+ `;
236
+ }
237
+
238
+ render() {
239
+ const classes = {
240
+ 'dialogOverlay': true,
241
+ 'dialogOverlay--modal': this.modal && this.open,
242
+ 'dialogOverlay--open': this.open,
243
+ 'util_displayHidden': !this.open
244
+ },
245
+
246
+ contentClasses = {
247
+ 'dialog': true,
248
+ 'dialog--open': this.open
249
+ };
250
+
251
+ return html`
252
+ <div class="${classMap(classes)}" id="dialog-overlay" part="dialog-overlay" @click=${this.handleOverlayClick}></div>
253
+
254
+ <div role="dialog" id="dialog" class="${classMap(contentClasses)}" part="dialog" aria-labelledby="dialog-header" tabindex="-1">
255
+ ${this.unformatted
256
+ ? html`
257
+ <slot name="content"></slot>
258
+ ${this.getCloseButton()}
259
+ `
260
+ : html`
261
+ <div class="dialog-header" part="dialog-header">
262
+ <h1 class="heading heading--700 util_stackMarginNone--top" id="dialog-header">
263
+ <slot name="header">Default header ...</slot>
264
+ </h1>
265
+ ${this.getCloseButton()}
266
+ </div>
267
+ <div class="dialog-content" part="dialog-content">
268
+ <slot name="content"></slot>
269
+ </div>
270
+ <div class="dialog-footer" id="footerWrapper" part="dialog-footer">
271
+ <slot name="footer" id="footer"></slot>
272
+ </div>
273
+ `
274
+ }
275
+ </div>
276
+ `;
277
+ }
278
+ }
@@ -0,0 +1,2 @@
1
+ import {css} from 'lit-element';
2
+ export default css`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}.heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}.heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}.heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}.heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}.heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.util_inlinePaddingNone--left{padding-left:0}.util_inlinePaddingNone--right{padding-right:0}.util_inlineMarginNone--left{margin-left:0}.util_inlineMarginNone--right{margin-right:0}.util_inlinePadding25--left{padding-left:.125rem}.util_inlinePadding25--right{padding-right:.125rem}.util_inlineMargin25--left{margin-left:.125rem}.util_inlineMargin25--right{margin-right:.125rem}.util_inlinePadding50--left{padding-left:.25rem}.util_inlinePadding50--right{padding-right:.25rem}.util_inlineMargin50--left{margin-left:.25rem}.util_inlineMargin50--right{margin-right:.25rem}.util_inlinePadding100--left{padding-left:.5rem}.util_inlinePadding100--right{padding-right:.5rem}.util_inlineMargin100--left{margin-left:.5rem}.util_inlineMargin100--right{margin-right:.5rem}.util_inlinePadding200--left{padding-left:1rem}.util_inlinePadding200--right{padding-right:1rem}.util_inlineMargin200--left{margin-left:1rem}.util_inlineMargin200--right{margin-right:1rem}.util_inlinePadding300--left{padding-left:1.5rem}.util_inlinePadding300--right{padding-right:1.5rem}.util_inlineMargin300--left{margin-left:1.5rem}.util_inlineMargin300--right{margin-right:1.5rem}.util_inlinePadding400--left{padding-left:2rem}.util_inlinePadding400--right{padding-right:2rem}.util_inlineMargin400--left{margin-left:2rem}.util_inlineMargin400--right{margin-right:2rem}.util_inlinePadding500--left{padding-left:2.5rem}.util_inlinePadding500--right{padding-right:2.5rem}.util_inlineMargin500--left{margin-left:2.5rem}.util_inlineMargin500--right{margin-right:2.5rem}.util_inlinePadding600--left{padding-left:3rem}.util_inlinePadding600--right{padding-right:3rem}.util_inlineMargin600--left{margin-left:3rem}.util_inlineMargin600--right{margin-right:3rem}.util_inlinePadding700--left{padding-left:3.5rem}.util_inlinePadding700--right{padding-right:3.5rem}.util_inlineMargin700--left{margin-left:3.5rem}.util_inlineMargin700--right{margin-right:3.5rem}.util_inlinePadding800--left{padding-left:4rem}.util_inlinePadding800--right{padding-right:4rem}.util_inlineMargin800--left{margin-left:4rem}.util_inlineMargin800--right{margin-right:4rem}.util_inlinePadding900--left{padding-left:4.5rem}.util_inlinePadding900--right{padding-right:4.5rem}.util_inlineMargin900--left{margin-left:4.5rem}.util_inlineMargin900--right{margin-right:4.5rem}.util_inlinePadding1000--left{padding-left:5rem}.util_inlinePadding1000--right{padding-right:5rem}.util_inlineMargin1000--left{margin-left:5rem}.util_inlineMargin1000--right{margin-right:5rem}.util_stackPaddingNone--top{padding-top:0}.util_stackPaddingNone--bottom{padding-bottom:0}.util_stackMarginNone--top{margin-top:0}.util_stackMarginNone--bottom{margin-bottom:0}.util_stackPadding25--top{padding-top:.125rem}.util_stackPadding25--bottom{padding-bottom:.125rem}.util_stackMargin25--top{margin-top:.125rem}.util_stackMargin25--bottom{margin-bottom:.125rem}.util_stackPadding50--top{padding-top:.25rem}.util_stackPadding50--bottom{padding-bottom:.25rem}.util_stackMargin50--top{margin-top:.25rem}.util_stackMargin50--bottom{margin-bottom:.25rem}.util_stackPadding100--top{padding-top:.5rem}.util_stackPadding100--bottom{padding-bottom:.5rem}.util_stackMargin100--top{margin-top:.5rem}.util_stackMargin100--bottom{margin-bottom:.5rem}.util_stackPadding200--top{padding-top:1rem}.util_stackPadding200--bottom{padding-bottom:1rem}.util_stackMargin200--top{margin-top:1rem}.util_stackMargin200--bottom{margin-bottom:1rem}.util_stackPadding300--top{padding-top:1.5rem}.util_stackPadding300--bottom{padding-bottom:1.5rem}.util_stackMargin300--top{margin-top:1.5rem}.util_stackMargin300--bottom{margin-bottom:1.5rem}.util_stackPadding400--top{padding-top:2rem}.util_stackPadding400--bottom{padding-bottom:2rem}.util_stackMargin400--top{margin-top:2rem}.util_stackMargin400--bottom{margin-bottom:2rem}.util_stackPadding500--top{padding-top:2.5rem}.util_stackPadding500--bottom{padding-bottom:2.5rem}.util_stackMargin500--top{margin-top:2.5rem}.util_stackMargin500--bottom{margin-bottom:2.5rem}.util_stackPadding600--top{padding-top:3rem}.util_stackPadding600--bottom{padding-bottom:3rem}.util_stackMargin600--top{margin-top:3rem}.util_stackMargin600--bottom{margin-bottom:3rem}.util_stackPadding700--top{padding-top:3.5rem}.util_stackPadding700--bottom{padding-bottom:3.5rem}.util_stackMargin700--top{margin-top:3.5rem}.util_stackMargin700--bottom{margin-bottom:3.5rem}.util_stackPadding800--top{padding-top:4rem}.util_stackPadding800--bottom{padding-bottom:4rem}.util_stackMargin800--top{margin-top:4rem}.util_stackMargin800--bottom{margin-bottom:4rem}.util_stackPadding900--top{padding-top:4.5rem}.util_stackPadding900--bottom{padding-bottom:4.5rem}.util_stackMargin900--top{margin-top:4.5rem}.util_stackMargin900--bottom{margin-bottom:4.5rem}.util_stackPadding1000--top{padding-top:5rem}.util_stackPadding1000--bottom{padding-bottom:5rem}.util_stackMargin1000--top{margin-top:5rem}.util_stackMargin1000--bottom{margin-bottom:5rem}:host{--insetPaddingXl:0 var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400);--insetPaddingXxl:0 var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600);--insetPaddingXxxl:0 var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800)}.dialogOverlay{position:fixed;z-index:-1;bottom:0;left:0;width:100%;height:100%}.dialogOverlay--open{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.2, 0);background:rgba(0, 0, 0, 0.2)}.dialogOverlay--modal{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.5, 0);background:rgba(0, 0, 0, 0.5)}.dialog{position:fixed;z-index:-1;right:0;bottom:0;left:0;display:block;visibility:hidden;overflow:visible;width:100%;max-height:90%;padding:var(--insetPaddingXl);transform:translateY(100%);opacity:0;border:0;background:var(--ds-color-background-lightest, #ffffff);color:var(--ds-color-text-primary-default, #222222);transition:all .3s ease-in-out}@media screen and (min-width: 768px){.dialog{top:10%;bottom:unset;max-width:80%;max-height:80%;margin:auto;padding:var(--insetPaddingXxxl);transform:scale(0);box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.12),0 1px 10px 0 rgba(0, 0, 0, 0.1)}.dialog--open{transform:scale(1)}}@media screen and (min-width: 1024px){.dialog{max-width:986px}}.dialog--open{z-index:var(--ds-depth-modal, 400);visibility:visible;transform:translateY(0%);opacity:1}.dialog-footer{padding-top:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){.dialog-footer ::slotted(*){display:flex;justify-content:flex-end}}.dialog-header{display:flex;align-items:flex-start;justify-content:space-between;padding-top:var(--ds-size-800, 4rem)}.dialog-header svg{fill:var(--ds-color-text-secondary-default, #626b79)}.dialog-header--action{margin:0;padding:0;border:none;border:2px solid transparent;border-radius:var(--ds-border-radius, 0.375rem);background-color:transparent}.dialog-header--action:hover{cursor:pointer}::slotted([slot=content]){position:relative}:host([unformatted]) .dialog-header--action{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([unformatted]) .dialog-header--action{top:var(--ds-size-800, 4rem);right:var(--ds-size-800, 4rem)}}:host([unformatted][onDark]) .dialog-header--action{color:var(--ds-color-base-white, #ffffff)}:host([sm]) .dialog{max-height:30%}@media screen and (min-width: 768px){:host([sm]) .dialog{top:10%;max-width:40%;max-height:80%;padding:var(--insetPaddingXxl)}}@media screen and (min-width: 1024px){:host([sm]) .dialog{max-width:740px}}:host([md]) .dialog{max-height:50%}@media screen and (min-width: 768px){:host([md]) .dialog{top:10%;max-width:70%;max-height:80%}}@media screen and (min-width: 1024px){:host([md]) .dialog{top:10%;max-width:986px}}@media screen and (min-width: 768px){:host([sm][lg]) .dialog,:host([md][lg]) .dialog{max-height:80%}}:host([sm][lg]) .dialog,:host([md][lg]) .dialog{max-height:90%}:host([unformatted]) .dialog{padding:0}`;
@@ -0,0 +1,2 @@
1
+ import {css} from 'lit-element';
2
+ export default css`:host([fixed]) *,:host([fixed]) *:before,:host([fixed]) *:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){:host([fixed]) *,:host([fixed]) *:before,:host([fixed]) *:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}:host([fixed]) *:focus-visible{outline:0}:host([fixed]) *:focus-visible{outline:0}:host([fixed]) :focus:not(:focus-visible){outline:3px solid transparent}:host([fixed]) .heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}:host([fixed]) .heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}:host([fixed]) .heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}:host([fixed]) .heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}:host([fixed]) .heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}:host([fixed]) .heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){:host([fixed]) .heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){:host([fixed]) .heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}:host([fixed]) .heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}:host([fixed]) .heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}:host([fixed]) .util_displayInline{display:inline}:host([fixed]) .util_displayInlineBlock{display:inline-block}:host([fixed]) .util_displayBlock{display:block}:host([fixed]) .util_displayFlex{display:flex}:host([fixed]) .util_displayHidden{display:none}:host([fixed]) .util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host([fixed]) .util_inlinePaddingNone--left{padding-left:0}:host([fixed]) .util_inlinePaddingNone--right{padding-right:0}:host([fixed]) .util_inlineMarginNone--left{margin-left:0}:host([fixed]) .util_inlineMarginNone--right{margin-right:0}:host([fixed]) .util_inlinePadding25--left{padding-left:.125rem}:host([fixed]) .util_inlinePadding25--right{padding-right:.125rem}:host([fixed]) .util_inlineMargin25--left{margin-left:.125rem}:host([fixed]) .util_inlineMargin25--right{margin-right:.125rem}:host([fixed]) .util_inlinePadding50--left{padding-left:.25rem}:host([fixed]) .util_inlinePadding50--right{padding-right:.25rem}:host([fixed]) .util_inlineMargin50--left{margin-left:.25rem}:host([fixed]) .util_inlineMargin50--right{margin-right:.25rem}:host([fixed]) .util_inlinePadding100--left{padding-left:.5rem}:host([fixed]) .util_inlinePadding100--right{padding-right:.5rem}:host([fixed]) .util_inlineMargin100--left{margin-left:.5rem}:host([fixed]) .util_inlineMargin100--right{margin-right:.5rem}:host([fixed]) .util_inlinePadding200--left{padding-left:1rem}:host([fixed]) .util_inlinePadding200--right{padding-right:1rem}:host([fixed]) .util_inlineMargin200--left{margin-left:1rem}:host([fixed]) .util_inlineMargin200--right{margin-right:1rem}:host([fixed]) .util_inlinePadding300--left{padding-left:1.5rem}:host([fixed]) .util_inlinePadding300--right{padding-right:1.5rem}:host([fixed]) .util_inlineMargin300--left{margin-left:1.5rem}:host([fixed]) .util_inlineMargin300--right{margin-right:1.5rem}:host([fixed]) .util_inlinePadding400--left{padding-left:2rem}:host([fixed]) .util_inlinePadding400--right{padding-right:2rem}:host([fixed]) .util_inlineMargin400--left{margin-left:2rem}:host([fixed]) .util_inlineMargin400--right{margin-right:2rem}:host([fixed]) .util_inlinePadding500--left{padding-left:2.5rem}:host([fixed]) .util_inlinePadding500--right{padding-right:2.5rem}:host([fixed]) .util_inlineMargin500--left{margin-left:2.5rem}:host([fixed]) .util_inlineMargin500--right{margin-right:2.5rem}:host([fixed]) .util_inlinePadding600--left{padding-left:3rem}:host([fixed]) .util_inlinePadding600--right{padding-right:3rem}:host([fixed]) .util_inlineMargin600--left{margin-left:3rem}:host([fixed]) .util_inlineMargin600--right{margin-right:3rem}:host([fixed]) .util_inlinePadding700--left{padding-left:3.5rem}:host([fixed]) .util_inlinePadding700--right{padding-right:3.5rem}:host([fixed]) .util_inlineMargin700--left{margin-left:3.5rem}:host([fixed]) .util_inlineMargin700--right{margin-right:3.5rem}:host([fixed]) .util_inlinePadding800--left{padding-left:4rem}:host([fixed]) .util_inlinePadding800--right{padding-right:4rem}:host([fixed]) .util_inlineMargin800--left{margin-left:4rem}:host([fixed]) .util_inlineMargin800--right{margin-right:4rem}:host([fixed]) .util_inlinePadding900--left{padding-left:4.5rem}:host([fixed]) .util_inlinePadding900--right{padding-right:4.5rem}:host([fixed]) .util_inlineMargin900--left{margin-left:4.5rem}:host([fixed]) .util_inlineMargin900--right{margin-right:4.5rem}:host([fixed]) .util_inlinePadding1000--left{padding-left:5rem}:host([fixed]) .util_inlinePadding1000--right{padding-right:5rem}:host([fixed]) .util_inlineMargin1000--left{margin-left:5rem}:host([fixed]) .util_inlineMargin1000--right{margin-right:5rem}:host([fixed]) .util_stackPaddingNone--top{padding-top:0}:host([fixed]) .util_stackPaddingNone--bottom{padding-bottom:0}:host([fixed]) .util_stackMarginNone--top{margin-top:0}:host([fixed]) .util_stackMarginNone--bottom{margin-bottom:0}:host([fixed]) .util_stackPadding25--top{padding-top:.125rem}:host([fixed]) .util_stackPadding25--bottom{padding-bottom:.125rem}:host([fixed]) .util_stackMargin25--top{margin-top:.125rem}:host([fixed]) .util_stackMargin25--bottom{margin-bottom:.125rem}:host([fixed]) .util_stackPadding50--top{padding-top:.25rem}:host([fixed]) .util_stackPadding50--bottom{padding-bottom:.25rem}:host([fixed]) .util_stackMargin50--top{margin-top:.25rem}:host([fixed]) .util_stackMargin50--bottom{margin-bottom:.25rem}:host([fixed]) .util_stackPadding100--top{padding-top:.5rem}:host([fixed]) .util_stackPadding100--bottom{padding-bottom:.5rem}:host([fixed]) .util_stackMargin100--top{margin-top:.5rem}:host([fixed]) .util_stackMargin100--bottom{margin-bottom:.5rem}:host([fixed]) .util_stackPadding200--top{padding-top:1rem}:host([fixed]) .util_stackPadding200--bottom{padding-bottom:1rem}:host([fixed]) .util_stackMargin200--top{margin-top:1rem}:host([fixed]) .util_stackMargin200--bottom{margin-bottom:1rem}:host([fixed]) .util_stackPadding300--top{padding-top:1.5rem}:host([fixed]) .util_stackPadding300--bottom{padding-bottom:1.5rem}:host([fixed]) .util_stackMargin300--top{margin-top:1.5rem}:host([fixed]) .util_stackMargin300--bottom{margin-bottom:1.5rem}:host([fixed]) .util_stackPadding400--top{padding-top:2rem}:host([fixed]) .util_stackPadding400--bottom{padding-bottom:2rem}:host([fixed]) .util_stackMargin400--top{margin-top:2rem}:host([fixed]) .util_stackMargin400--bottom{margin-bottom:2rem}:host([fixed]) .util_stackPadding500--top{padding-top:2.5rem}:host([fixed]) .util_stackPadding500--bottom{padding-bottom:2.5rem}:host([fixed]) .util_stackMargin500--top{margin-top:2.5rem}:host([fixed]) .util_stackMargin500--bottom{margin-bottom:2.5rem}:host([fixed]) .util_stackPadding600--top{padding-top:3rem}:host([fixed]) .util_stackPadding600--bottom{padding-bottom:3rem}:host([fixed]) .util_stackMargin600--top{margin-top:3rem}:host([fixed]) .util_stackMargin600--bottom{margin-bottom:3rem}:host([fixed]) .util_stackPadding700--top{padding-top:3.5rem}:host([fixed]) .util_stackPadding700--bottom{padding-bottom:3.5rem}:host([fixed]) .util_stackMargin700--top{margin-top:3.5rem}:host([fixed]) .util_stackMargin700--bottom{margin-bottom:3.5rem}:host([fixed]) .util_stackPadding800--top{padding-top:4rem}:host([fixed]) .util_stackPadding800--bottom{padding-bottom:4rem}:host([fixed]) .util_stackMargin800--top{margin-top:4rem}:host([fixed]) .util_stackMargin800--bottom{margin-bottom:4rem}:host([fixed]) .util_stackPadding900--top{padding-top:4.5rem}:host([fixed]) .util_stackPadding900--bottom{padding-bottom:4.5rem}:host([fixed]) .util_stackMargin900--top{margin-top:4.5rem}:host([fixed]) .util_stackMargin900--bottom{margin-bottom:4.5rem}:host([fixed]) .util_stackPadding1000--top{padding-top:5rem}:host([fixed]) .util_stackPadding1000--bottom{padding-bottom:5rem}:host([fixed]) .util_stackMargin1000--top{margin-top:5rem}:host([fixed]) .util_stackMargin1000--bottom{margin-bottom:5rem}:host([fixed]) :host{--insetPaddingXl:0 var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400);--insetPaddingXxl:0 var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600);--insetPaddingXxxl:0 var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800)}:host([fixed]) .dialogOverlay{position:fixed;z-index:-1;bottom:0;left:0;width:100%;height:100%}:host([fixed]) .dialogOverlay--open{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.2, 0);background:rgba(0, 0, 0, 0.2)}:host([fixed]) .dialogOverlay--modal{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.5, 0);background:rgba(0, 0, 0, 0.5)}:host([fixed]) .dialog{position:fixed;z-index:-1;right:0;bottom:0;left:0;display:block;visibility:hidden;overflow:visible;width:100%;max-height:90%;padding:var(--insetPaddingXl);transform:translateY(100%);opacity:0;border:0;background:var(--ds-color-background-lightest, #ffffff);color:var(--ds-color-text-primary-default, #222222);transition:all .3s ease-in-out}@media screen and (min-width: 768px){:host([fixed]) .dialog{top:10%;bottom:unset;max-width:80%;max-height:80%;margin:auto;padding:var(--insetPaddingXxxl);transform:scale(0);box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.12),0 1px 10px 0 rgba(0, 0, 0, 0.1)}:host([fixed]) .dialog--open{transform:scale(1)}}@media screen and (min-width: 1024px){:host([fixed]) .dialog{max-width:986px}}:host([fixed]) .dialog--open{z-index:var(--ds-depth-modal, 400);visibility:visible;transform:translateY(0%);opacity:1}:host([fixed]) .dialog-footer{padding-top:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([fixed]) .dialog-footer ::slotted(*){display:flex;justify-content:flex-end}}:host([fixed]) .dialog-header{display:flex;align-items:flex-start;justify-content:space-between;padding-top:var(--ds-size-800, 4rem)}:host([fixed]) .dialog-header svg{fill:var(--ds-color-text-secondary-default, #626b79)}:host([fixed]) .dialog-header--action{margin:0;padding:0;border:none;border:2px solid transparent;border-radius:var(--ds-border-radius, 0.375rem);background-color:transparent}:host([fixed]) .dialog-header--action:hover{cursor:pointer}:host([fixed]) ::slotted([slot=content]){position:relative}:host([fixed]) :host([unformatted]) .dialog-header--action{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([fixed]) :host([unformatted]) .dialog-header--action{top:var(--ds-size-800, 4rem);right:var(--ds-size-800, 4rem)}}:host([fixed]) :host([unformatted][onDark]) .dialog-header--action{color:var(--ds-color-base-white, #ffffff)}:host([fixed]) :host([sm]) .dialog{max-height:30%}@media screen and (min-width: 768px){:host([fixed]) :host([sm]) .dialog{top:10%;max-width:40%;max-height:80%;padding:var(--insetPaddingXxl)}}@media screen and (min-width: 1024px){:host([fixed]) :host([sm]) .dialog{max-width:740px}}:host([fixed]) :host([md]) .dialog{max-height:50%}@media screen and (min-width: 768px){:host([fixed]) :host([md]) .dialog{top:10%;max-width:70%;max-height:80%}}@media screen and (min-width: 1024px){:host([fixed]) :host([md]) .dialog{top:10%;max-width:986px}}@media screen and (min-width: 768px){:host([fixed]) :host([sm][lg]) .dialog,:host([fixed]) :host([md][lg]) .dialog{max-height:80%}}:host([fixed]) :host([sm][lg]) .dialog,:host([fixed]) :host([md][lg]) .dialog{max-height:90%}:host([fixed]) :host([unformatted]) .dialog{padding:0}`;
@@ -0,0 +1,2 @@
1
+ import {css} from 'lit-element';
2
+ export default css`[unformatted] .unformattedWrapper{padding:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){[unformatted] .unformattedWrapper{padding:var(--ds-size-800, 4rem);padding-top:var(--ds-size-400, 2rem)}}`;
@@ -0,0 +1,2 @@
1
+ import {css} from 'lit-element';
2
+ export default css`:host([fixed]) [unformatted] .unformattedWrapper{padding:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([fixed]) [unformatted] .unformattedWrapper{padding:var(--ds-size-800, 4rem);padding-top:var(--ds-size-400, 2rem)}}`;