@tartaguti/ui-components 0.0.0-stage → 0.2.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.
- package/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +192 -2
- package/THIRD-PARTY-NOTICES.md +29 -0
- package/custom-elements.json +16899 -0
- package/dist/accordion/tt-accordion-item.d.ts +32 -0
- package/dist/accordion/tt-accordion-item.d.ts.map +1 -0
- package/dist/accordion/tt-accordion-item.js +247 -0
- package/dist/accordion/tt-accordion-item.js.map +1 -0
- package/dist/accordion/tt-accordion.d.ts +28 -0
- package/dist/accordion/tt-accordion.d.ts.map +1 -0
- package/dist/accordion/tt-accordion.js +148 -0
- package/dist/accordion/tt-accordion.js.map +1 -0
- package/dist/bento/tt-bento-item.d.ts +35 -0
- package/dist/bento/tt-bento-item.d.ts.map +1 -0
- package/dist/bento/tt-bento-item.js +201 -0
- package/dist/bento/tt-bento-item.js.map +1 -0
- package/dist/bento/tt-bento.d.ts +25 -0
- package/dist/bento/tt-bento.d.ts.map +1 -0
- package/dist/bento/tt-bento.js +314 -0
- package/dist/bento/tt-bento.js.map +1 -0
- package/dist/floating.d.ts +61 -0
- package/dist/floating.d.ts.map +1 -0
- package/dist/floating.js +120 -0
- package/dist/floating.js.map +1 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/tt-draggable.d.ts +29 -0
- package/dist/interaction/tt-draggable.d.ts.map +1 -0
- package/dist/interaction/tt-draggable.js +66 -0
- package/dist/interaction/tt-draggable.js.map +1 -0
- package/dist/interaction/tt-droppable.d.ts +37 -0
- package/dist/interaction/tt-droppable.d.ts.map +1 -0
- package/dist/interaction/tt-droppable.js +108 -0
- package/dist/interaction/tt-droppable.js.map +1 -0
- package/dist/interaction/tt-resizable.d.ts +45 -0
- package/dist/interaction/tt-resizable.d.ts.map +1 -0
- package/dist/interaction/tt-resizable.js +210 -0
- package/dist/interaction/tt-resizable.js.map +1 -0
- package/dist/interaction/tt-reveal.d.ts +54 -0
- package/dist/interaction/tt-reveal.d.ts.map +1 -0
- package/dist/interaction/tt-reveal.js +302 -0
- package/dist/interaction/tt-reveal.js.map +1 -0
- package/dist/motion.d.ts +8 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +49 -0
- package/dist/motion.js.map +1 -0
- package/dist/overlay.d.ts +7 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +121 -0
- package/dist/overlay.js.map +1 -0
- package/dist/safe-url.d.ts +14 -0
- package/dist/safe-url.d.ts.map +1 -0
- package/dist/safe-url.js +46 -0
- package/dist/safe-url.js.map +1 -0
- package/dist/scroll-lock.d.ts +22 -0
- package/dist/scroll-lock.d.ts.map +1 -0
- package/dist/scroll-lock.js +56 -0
- package/dist/scroll-lock.js.map +1 -0
- package/dist/sidebar/tt-menu-group.d.ts +69 -0
- package/dist/sidebar/tt-menu-group.d.ts.map +1 -0
- package/dist/sidebar/tt-menu-group.js +358 -0
- package/dist/sidebar/tt-menu-group.js.map +1 -0
- package/dist/sidebar/tt-menu-item.d.ts +70 -0
- package/dist/sidebar/tt-menu-item.d.ts.map +1 -0
- package/dist/sidebar/tt-menu-item.js +502 -0
- package/dist/sidebar/tt-menu-item.js.map +1 -0
- package/dist/sidebar/tt-sidebar-footer.d.ts +39 -0
- package/dist/sidebar/tt-sidebar-footer.d.ts.map +1 -0
- package/dist/sidebar/tt-sidebar-footer.js +205 -0
- package/dist/sidebar/tt-sidebar-footer.js.map +1 -0
- package/dist/sidebar/tt-sidebar-header.d.ts +31 -0
- package/dist/sidebar/tt-sidebar-header.d.ts.map +1 -0
- package/dist/sidebar/tt-sidebar-header.js +150 -0
- package/dist/sidebar/tt-sidebar-header.js.map +1 -0
- package/dist/sidebar/tt-sidebar.d.ts +72 -0
- package/dist/sidebar/tt-sidebar.d.ts.map +1 -0
- package/dist/sidebar/tt-sidebar.js +539 -0
- package/dist/sidebar/tt-sidebar.js.map +1 -0
- package/dist/sr-only.d.ts +15 -0
- package/dist/sr-only.d.ts.map +1 -0
- package/dist/sr-only.js +27 -0
- package/dist/sr-only.js.map +1 -0
- package/dist/tokens.css +1124 -0
- package/dist/tt-alert.d.ts +26 -0
- package/dist/tt-alert.d.ts.map +1 -0
- package/dist/tt-alert.js +165 -0
- package/dist/tt-alert.js.map +1 -0
- package/dist/tt-aspect-ratio.d.ts +40 -0
- package/dist/tt-aspect-ratio.d.ts.map +1 -0
- package/dist/tt-aspect-ratio.js +98 -0
- package/dist/tt-aspect-ratio.js.map +1 -0
- package/dist/tt-auth.d.ts +75 -0
- package/dist/tt-auth.d.ts.map +1 -0
- package/dist/tt-auth.js +520 -0
- package/dist/tt-auth.js.map +1 -0
- package/dist/tt-avatar.d.ts +26 -0
- package/dist/tt-avatar.d.ts.map +1 -0
- package/dist/tt-avatar.js +169 -0
- package/dist/tt-avatar.js.map +1 -0
- package/dist/tt-badge.d.ts +36 -0
- package/dist/tt-badge.d.ts.map +1 -0
- package/dist/tt-badge.js +135 -0
- package/dist/tt-badge.js.map +1 -0
- package/dist/tt-breadcrumbs.d.ts +22 -0
- package/dist/tt-breadcrumbs.d.ts.map +1 -0
- package/dist/tt-breadcrumbs.js +144 -0
- package/dist/tt-breadcrumbs.js.map +1 -0
- package/dist/tt-button-group.d.ts +32 -0
- package/dist/tt-button-group.d.ts.map +1 -0
- package/dist/tt-button-group.js +132 -0
- package/dist/tt-button-group.js.map +1 -0
- package/dist/tt-button.d.ts +31 -0
- package/dist/tt-button.d.ts.map +1 -0
- package/dist/tt-button.js +483 -0
- package/dist/tt-button.js.map +1 -0
- package/dist/tt-card.d.ts +26 -0
- package/dist/tt-card.d.ts.map +1 -0
- package/dist/tt-card.js +429 -0
- package/dist/tt-card.js.map +1 -0
- package/dist/tt-chart.d.ts +36 -0
- package/dist/tt-chart.d.ts.map +1 -0
- package/dist/tt-chart.js +332 -0
- package/dist/tt-chart.js.map +1 -0
- package/dist/tt-checkbox-group.d.ts +38 -0
- package/dist/tt-checkbox-group.d.ts.map +1 -0
- package/dist/tt-checkbox-group.js +243 -0
- package/dist/tt-checkbox-group.js.map +1 -0
- package/dist/tt-checkbox.d.ts +35 -0
- package/dist/tt-checkbox.d.ts.map +1 -0
- package/dist/tt-checkbox.js +354 -0
- package/dist/tt-checkbox.js.map +1 -0
- package/dist/tt-code-block.d.ts +37 -0
- package/dist/tt-code-block.d.ts.map +1 -0
- package/dist/tt-code-block.js +409 -0
- package/dist/tt-code-block.js.map +1 -0
- package/dist/tt-collapsible.d.ts +71 -0
- package/dist/tt-collapsible.d.ts.map +1 -0
- package/dist/tt-collapsible.js +206 -0
- package/dist/tt-collapsible.js.map +1 -0
- package/dist/tt-combobox.d.ts +107 -0
- package/dist/tt-combobox.d.ts.map +1 -0
- package/dist/tt-combobox.js +816 -0
- package/dist/tt-combobox.js.map +1 -0
- package/dist/tt-company-card.d.ts +30 -0
- package/dist/tt-company-card.d.ts.map +1 -0
- package/dist/tt-company-card.js +382 -0
- package/dist/tt-company-card.js.map +1 -0
- package/dist/tt-comparison-table.d.ts +59 -0
- package/dist/tt-comparison-table.d.ts.map +1 -0
- package/dist/tt-comparison-table.js +441 -0
- package/dist/tt-comparison-table.js.map +1 -0
- package/dist/tt-component-doc.d.ts +63 -0
- package/dist/tt-component-doc.d.ts.map +1 -0
- package/dist/tt-component-doc.js +585 -0
- package/dist/tt-component-doc.js.map +1 -0
- package/dist/tt-confirm.d.ts +45 -0
- package/dist/tt-confirm.d.ts.map +1 -0
- package/dist/tt-confirm.js +151 -0
- package/dist/tt-confirm.js.map +1 -0
- package/dist/tt-contact-list.d.ts +18 -0
- package/dist/tt-contact-list.d.ts.map +1 -0
- package/dist/tt-contact-list.js +101 -0
- package/dist/tt-contact-list.js.map +1 -0
- package/dist/tt-copy-button.d.ts +25 -0
- package/dist/tt-copy-button.d.ts.map +1 -0
- package/dist/tt-copy-button.js +194 -0
- package/dist/tt-copy-button.js.map +1 -0
- package/dist/tt-data-table.d.ts +96 -0
- package/dist/tt-data-table.d.ts.map +1 -0
- package/dist/tt-data-table.js +812 -0
- package/dist/tt-data-table.js.map +1 -0
- package/dist/tt-divider.d.ts +19 -0
- package/dist/tt-divider.d.ts.map +1 -0
- package/dist/tt-divider.js +104 -0
- package/dist/tt-divider.js.map +1 -0
- package/dist/tt-drawer.d.ts +38 -0
- package/dist/tt-drawer.d.ts.map +1 -0
- package/dist/tt-drawer.js +433 -0
- package/dist/tt-drawer.js.map +1 -0
- package/dist/tt-dropdown-menu.d.ts +57 -0
- package/dist/tt-dropdown-menu.d.ts.map +1 -0
- package/dist/tt-dropdown-menu.js +631 -0
- package/dist/tt-dropdown-menu.js.map +1 -0
- package/dist/tt-empty-state.d.ts +13 -0
- package/dist/tt-empty-state.d.ts.map +1 -0
- package/dist/tt-empty-state.js +94 -0
- package/dist/tt-empty-state.js.map +1 -0
- package/dist/tt-example.d.ts +33 -0
- package/dist/tt-example.d.ts.map +1 -0
- package/dist/tt-example.js +250 -0
- package/dist/tt-example.js.map +1 -0
- package/dist/tt-file-upload.d.ts +85 -0
- package/dist/tt-file-upload.d.ts.map +1 -0
- package/dist/tt-file-upload.js +662 -0
- package/dist/tt-file-upload.js.map +1 -0
- package/dist/tt-filter.d.ts +62 -0
- package/dist/tt-filter.d.ts.map +1 -0
- package/dist/tt-filter.js +393 -0
- package/dist/tt-filter.js.map +1 -0
- package/dist/tt-form.d.ts +33 -0
- package/dist/tt-form.d.ts.map +1 -0
- package/dist/tt-form.js +202 -0
- package/dist/tt-form.js.map +1 -0
- package/dist/tt-grid.d.ts +22 -0
- package/dist/tt-grid.d.ts.map +1 -0
- package/dist/tt-grid.js +106 -0
- package/dist/tt-grid.js.map +1 -0
- package/dist/tt-icon.d.ts +20 -0
- package/dist/tt-icon.d.ts.map +1 -0
- package/dist/tt-icon.js +510 -0
- package/dist/tt-icon.js.map +1 -0
- package/dist/tt-image.d.ts +59 -0
- package/dist/tt-image.d.ts.map +1 -0
- package/dist/tt-image.js +314 -0
- package/dist/tt-image.js.map +1 -0
- package/dist/tt-inbox.d.ts +45 -0
- package/dist/tt-inbox.d.ts.map +1 -0
- package/dist/tt-inbox.js +275 -0
- package/dist/tt-inbox.js.map +1 -0
- package/dist/tt-input.d.ts +43 -0
- package/dist/tt-input.d.ts.map +1 -0
- package/dist/tt-input.js +476 -0
- package/dist/tt-input.js.map +1 -0
- package/dist/tt-kbd.d.ts +39 -0
- package/dist/tt-kbd.d.ts.map +1 -0
- package/dist/tt-kbd.js +145 -0
- package/dist/tt-kbd.js.map +1 -0
- package/dist/tt-key-values.d.ts +17 -0
- package/dist/tt-key-values.d.ts.map +1 -0
- package/dist/tt-key-values.js +126 -0
- package/dist/tt-key-values.js.map +1 -0
- package/dist/tt-knowledge-doc.d.ts +24 -0
- package/dist/tt-knowledge-doc.d.ts.map +1 -0
- package/dist/tt-knowledge-doc.js +120 -0
- package/dist/tt-knowledge-doc.js.map +1 -0
- package/dist/tt-layout.d.ts +36 -0
- package/dist/tt-layout.d.ts.map +1 -0
- package/dist/tt-layout.js +318 -0
- package/dist/tt-layout.js.map +1 -0
- package/dist/tt-modal.d.ts +32 -0
- package/dist/tt-modal.d.ts.map +1 -0
- package/dist/tt-modal.js +553 -0
- package/dist/tt-modal.js.map +1 -0
- package/dist/tt-navbar.d.ts +33 -0
- package/dist/tt-navbar.d.ts.map +1 -0
- package/dist/tt-navbar.js +390 -0
- package/dist/tt-navbar.js.map +1 -0
- package/dist/tt-page-header.d.ts +28 -0
- package/dist/tt-page-header.d.ts.map +1 -0
- package/dist/tt-page-header.js +166 -0
- package/dist/tt-page-header.js.map +1 -0
- package/dist/tt-page.d.ts +14 -0
- package/dist/tt-page.d.ts.map +1 -0
- package/dist/tt-page.js +163 -0
- package/dist/tt-page.js.map +1 -0
- package/dist/tt-pagination.d.ts +27 -0
- package/dist/tt-pagination.d.ts.map +1 -0
- package/dist/tt-pagination.js +194 -0
- package/dist/tt-pagination.js.map +1 -0
- package/dist/tt-preview.d.ts +11 -0
- package/dist/tt-preview.d.ts.map +1 -0
- package/dist/tt-preview.js +68 -0
- package/dist/tt-preview.js.map +1 -0
- package/dist/tt-product.d.ts +40 -0
- package/dist/tt-product.d.ts.map +1 -0
- package/dist/tt-product.js +590 -0
- package/dist/tt-product.js.map +1 -0
- package/dist/tt-profile-card.d.ts +23 -0
- package/dist/tt-profile-card.d.ts.map +1 -0
- package/dist/tt-profile-card.js +199 -0
- package/dist/tt-profile-card.js.map +1 -0
- package/dist/tt-progress.d.ts +26 -0
- package/dist/tt-progress.d.ts.map +1 -0
- package/dist/tt-progress.js +156 -0
- package/dist/tt-progress.js.map +1 -0
- package/dist/tt-quantity.d.ts +36 -0
- package/dist/tt-quantity.d.ts.map +1 -0
- package/dist/tt-quantity.js +396 -0
- package/dist/tt-quantity.js.map +1 -0
- package/dist/tt-radio-group.d.ts +50 -0
- package/dist/tt-radio-group.d.ts.map +1 -0
- package/dist/tt-radio-group.js +372 -0
- package/dist/tt-radio-group.js.map +1 -0
- package/dist/tt-rating.d.ts +54 -0
- package/dist/tt-rating.d.ts.map +1 -0
- package/dist/tt-rating.js +312 -0
- package/dist/tt-rating.js.map +1 -0
- package/dist/tt-search.d.ts +47 -0
- package/dist/tt-search.d.ts.map +1 -0
- package/dist/tt-search.js +360 -0
- package/dist/tt-search.js.map +1 -0
- package/dist/tt-section.d.ts +13 -0
- package/dist/tt-section.d.ts.map +1 -0
- package/dist/tt-section.js +98 -0
- package/dist/tt-section.js.map +1 -0
- package/dist/tt-select.d.ts +62 -0
- package/dist/tt-select.d.ts.map +1 -0
- package/dist/tt-select.js +662 -0
- package/dist/tt-select.js.map +1 -0
- package/dist/tt-skeleton.d.ts +20 -0
- package/dist/tt-skeleton.d.ts.map +1 -0
- package/dist/tt-skeleton.js +143 -0
- package/dist/tt-skeleton.js.map +1 -0
- package/dist/tt-slider.d.ts +74 -0
- package/dist/tt-slider.d.ts.map +1 -0
- package/dist/tt-slider.js +426 -0
- package/dist/tt-slider.js.map +1 -0
- package/dist/tt-social-links.d.ts +34 -0
- package/dist/tt-social-links.d.ts.map +1 -0
- package/dist/tt-social-links.js +242 -0
- package/dist/tt-social-links.js.map +1 -0
- package/dist/tt-sparkline.d.ts +19 -0
- package/dist/tt-sparkline.d.ts.map +1 -0
- package/dist/tt-sparkline.js +191 -0
- package/dist/tt-sparkline.js.map +1 -0
- package/dist/tt-spinner.d.ts +19 -0
- package/dist/tt-spinner.d.ts.map +1 -0
- package/dist/tt-spinner.js +93 -0
- package/dist/tt-spinner.js.map +1 -0
- package/dist/tt-stack.d.ts +42 -0
- package/dist/tt-stack.d.ts.map +1 -0
- package/dist/tt-stack.js +158 -0
- package/dist/tt-stack.js.map +1 -0
- package/dist/tt-stat.d.ts +17 -0
- package/dist/tt-stat.d.ts.map +1 -0
- package/dist/tt-stat.js +134 -0
- package/dist/tt-stat.js.map +1 -0
- package/dist/tt-switch.d.ts +39 -0
- package/dist/tt-switch.d.ts.map +1 -0
- package/dist/tt-switch.js +254 -0
- package/dist/tt-switch.js.map +1 -0
- package/dist/tt-switcher.d.ts +23 -0
- package/dist/tt-switcher.d.ts.map +1 -0
- package/dist/tt-switcher.js +203 -0
- package/dist/tt-switcher.js.map +1 -0
- package/dist/tt-table-cell.d.ts +26 -0
- package/dist/tt-table-cell.d.ts.map +1 -0
- package/dist/tt-table-cell.js +121 -0
- package/dist/tt-table-cell.js.map +1 -0
- package/dist/tt-table-row.d.ts +31 -0
- package/dist/tt-table-row.d.ts.map +1 -0
- package/dist/tt-table-row.js +72 -0
- package/dist/tt-table-row.js.map +1 -0
- package/dist/tt-table.d.ts +44 -0
- package/dist/tt-table.d.ts.map +1 -0
- package/dist/tt-table.js +270 -0
- package/dist/tt-table.js.map +1 -0
- package/dist/tt-tabs.d.ts +31 -0
- package/dist/tt-tabs.d.ts.map +1 -0
- package/dist/tt-tabs.js +223 -0
- package/dist/tt-tabs.js.map +1 -0
- package/dist/tt-tag-list.d.ts +19 -0
- package/dist/tt-tag-list.d.ts.map +1 -0
- package/dist/tt-tag-list.js +136 -0
- package/dist/tt-tag-list.js.map +1 -0
- package/dist/tt-text.d.ts +52 -0
- package/dist/tt-text.d.ts.map +1 -0
- package/dist/tt-text.js +337 -0
- package/dist/tt-text.js.map +1 -0
- package/dist/tt-textarea.d.ts +43 -0
- package/dist/tt-textarea.d.ts.map +1 -0
- package/dist/tt-textarea.js +356 -0
- package/dist/tt-textarea.js.map +1 -0
- package/dist/tt-thread.d.ts +62 -0
- package/dist/tt-thread.d.ts.map +1 -0
- package/dist/tt-thread.js +374 -0
- package/dist/tt-thread.js.map +1 -0
- package/dist/tt-toast.d.ts +49 -0
- package/dist/tt-toast.d.ts.map +1 -0
- package/dist/tt-toast.js +440 -0
- package/dist/tt-toast.js.map +1 -0
- package/dist/tt-toggle-group.d.ts +73 -0
- package/dist/tt-toggle-group.d.ts.map +1 -0
- package/dist/tt-toggle-group.js +273 -0
- package/dist/tt-toggle-group.js.map +1 -0
- package/dist/tt-toggle.d.ts +54 -0
- package/dist/tt-toggle.d.ts.map +1 -0
- package/dist/tt-toggle.js +232 -0
- package/dist/tt-toggle.js.map +1 -0
- package/dist/tt-toolbar.d.ts +26 -0
- package/dist/tt-toolbar.d.ts.map +1 -0
- package/dist/tt-toolbar.js +164 -0
- package/dist/tt-toolbar.js.map +1 -0
- package/dist/tt-tooltip.d.ts +42 -0
- package/dist/tt-tooltip.d.ts.map +1 -0
- package/dist/tt-tooltip.js +299 -0
- package/dist/tt-tooltip.js.map +1 -0
- package/package.json +84 -4
- package/vscode.html-custom-data.json +2911 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import type { PropertyValues } from "lit";
|
|
3
|
+
import "./tt-icon.js";
|
|
4
|
+
export type ModalSize = "small" | "medium" | "large";
|
|
5
|
+
export declare class TTModal extends LitElement {
|
|
6
|
+
open: boolean;
|
|
7
|
+
heading: string;
|
|
8
|
+
size: ModalSize;
|
|
9
|
+
persistent: boolean;
|
|
10
|
+
preview: boolean;
|
|
11
|
+
private lastFocused;
|
|
12
|
+
private closing;
|
|
13
|
+
private cancelExit?;
|
|
14
|
+
private closeModal;
|
|
15
|
+
private handleBackdropClick;
|
|
16
|
+
private handleButtonClick;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
private locked;
|
|
19
|
+
private setLock;
|
|
20
|
+
disconnectedCallback(): void;
|
|
21
|
+
willUpdate(changed: PropertyValues): void;
|
|
22
|
+
updated(changed: PropertyValues): void;
|
|
23
|
+
private handleKeyDown;
|
|
24
|
+
static styles: import("lit").CSSResult;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
"tt-modal": TTModal;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=tt-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-modal.d.ts","sourceRoot":"","sources":["../src/tt-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAO1C,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD,qBACa,OAAQ,SAAQ,UAAU;IAIrC,IAAI,UAAS;IAKb,OAAO,SAAM;IAGb,IAAI,EAAE,SAAS,CAAY;IAS3B,UAAU,UAAS;IAInB,OAAO,UAAS;IAEhB,OAAO,CAAC,WAAW,CAA4B;IAQtC,OAAO,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,iBAAiB;IAQzB,iBAAiB;IAWjB,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO,CAAC,OAAO;IASf,oBAAoB;IAapB,UAAU,CAAC,OAAO,EAAE,cAAc;IAYlC,OAAO,CAAC,OAAO,EAAE,cAAc;IA2D/B,OAAO,CAAC,aAAa,CA4BnB;IAEF,MAAM,CAAC,MAAM,0BAwSX;IAEF,MAAM;CAmDP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
|
package/dist/tt-modal.js
ADDED
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from "lit";
|
|
8
|
+
import { property, customElement, state } from "lit/decorators.js";
|
|
9
|
+
import { lockScroll, unlockScroll } from "./scroll-lock.js";
|
|
10
|
+
import { deepActiveElement, pushOverlay, removeOverlay, isTopOverlay, trapTab } from "./overlay.js";
|
|
11
|
+
import { afterTransitions } from "./motion.js";
|
|
12
|
+
import "./tt-icon.js";
|
|
13
|
+
let TTModal = class TTModal extends LitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
// Reflected, like open on tt-drawer and every other disclosure, so
|
|
17
|
+
// tt-modal[open] works as a selector.
|
|
18
|
+
this.open = false;
|
|
19
|
+
// Named `heading` rather than `title` so it cannot collide with the
|
|
20
|
+
// global HTML title attribute (which renders a native tooltip).
|
|
21
|
+
this.heading = "";
|
|
22
|
+
this.size = "medium";
|
|
23
|
+
/*
|
|
24
|
+
Cannot be dismissed: no close button, and Escape and the backdrop do
|
|
25
|
+
nothing. For a choice the user has to make. Named for the ON state
|
|
26
|
+
because a boolean attribute can only switch something on; the old
|
|
27
|
+
closable defaulted to true and could never be turned off from HTML.
|
|
28
|
+
*/
|
|
29
|
+
this.persistent = false;
|
|
30
|
+
// Renders inline instead of as a fixed overlay, for documentation previews.
|
|
31
|
+
this.preview = false;
|
|
32
|
+
this.lastFocused = null;
|
|
33
|
+
/*
|
|
34
|
+
True for the length of the exit transition after `open` goes false.
|
|
35
|
+
The dialog stays drawn so it has something to fade, but inert and
|
|
36
|
+
click-through: the scroll lock, the overlay stack and focus going back
|
|
37
|
+
all happen at once in updated(), and only the picture lingers.
|
|
38
|
+
*/
|
|
39
|
+
this.closing = false;
|
|
40
|
+
// Whether this element currently holds a scroll lock. The lock is
|
|
41
|
+
// reference counted, so it has to release exactly what it took.
|
|
42
|
+
this.locked = false;
|
|
43
|
+
this.handleKeyDown = (event) => {
|
|
44
|
+
if (!this.open || this.preview)
|
|
45
|
+
return;
|
|
46
|
+
// Only the overlay on top reacts. A confirm opened from inside this
|
|
47
|
+
// modal must take the Escape, not share it.
|
|
48
|
+
if (!isTopOverlay(this))
|
|
49
|
+
return;
|
|
50
|
+
if (event.key === "Escape") {
|
|
51
|
+
// A control inside the dialog already used this Escape, for
|
|
52
|
+
// example to close its own listbox. Closing the dialog as well
|
|
53
|
+
// would undo two things with one key.
|
|
54
|
+
if (event.defaultPrevented)
|
|
55
|
+
return;
|
|
56
|
+
this.closeModal();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
/*
|
|
60
|
+
Keep Tab inside the dialog.
|
|
61
|
+
|
|
62
|
+
Without this, tabbing past the last control walks focus into the page
|
|
63
|
+
behind the overlay. It is invisible to a sighted mouse user and
|
|
64
|
+
completely breaks the dialog for anyone using a keyboard or a screen
|
|
65
|
+
reader, who ends up reading content they cannot see.
|
|
66
|
+
*/
|
|
67
|
+
if (event.key === "Tab") {
|
|
68
|
+
const dialog = this.renderRoot?.querySelector(".modal");
|
|
69
|
+
if (dialog)
|
|
70
|
+
trapTab(event, dialog);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
closeModal() {
|
|
75
|
+
if (this.persistent) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.open = false;
|
|
79
|
+
this.dispatchEvent(new CustomEvent("tt-close", {
|
|
80
|
+
bubbles: true,
|
|
81
|
+
composed: true,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
handleBackdropClick(event) {
|
|
85
|
+
if (event.target === event.currentTarget) {
|
|
86
|
+
this.closeModal();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
handleButtonClick(event) {
|
|
90
|
+
const target = event.target;
|
|
91
|
+
if (target.hasAttribute("data-close")) {
|
|
92
|
+
this.closeModal();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
connectedCallback() {
|
|
96
|
+
super.connectedCallback();
|
|
97
|
+
window.addEventListener("keydown", this.handleKeyDown);
|
|
98
|
+
// Moved in the page while open: back on the stack it left.
|
|
99
|
+
if (this.open && !this.preview && this.hasUpdated)
|
|
100
|
+
pushOverlay(this);
|
|
101
|
+
}
|
|
102
|
+
setLock(want) {
|
|
103
|
+
if (want === this.locked)
|
|
104
|
+
return;
|
|
105
|
+
this.locked = want;
|
|
106
|
+
if (want)
|
|
107
|
+
lockScroll();
|
|
108
|
+
else
|
|
109
|
+
unlockScroll();
|
|
110
|
+
}
|
|
111
|
+
disconnectedCallback() {
|
|
112
|
+
window.removeEventListener("keydown", this.handleKeyDown);
|
|
113
|
+
this.setLock(false);
|
|
114
|
+
removeOverlay(this);
|
|
115
|
+
// Removed mid-exit (a router swapping the page): nothing to finish.
|
|
116
|
+
this.cancelExit?.();
|
|
117
|
+
this.closing = false;
|
|
118
|
+
super.disconnectedCallback();
|
|
119
|
+
}
|
|
120
|
+
willUpdate(changed) {
|
|
121
|
+
if (!changed.has("open") || this.preview)
|
|
122
|
+
return;
|
|
123
|
+
if (this.open) {
|
|
124
|
+
// Reopened mid-exit: the same dialog turns round from where it got to.
|
|
125
|
+
this.cancelExit?.();
|
|
126
|
+
this.closing = false;
|
|
127
|
+
}
|
|
128
|
+
else if (changed.get("open") === true) {
|
|
129
|
+
this.closing = true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
updated(changed) {
|
|
133
|
+
// After the render that applied the closing styles, so afterTransitions
|
|
134
|
+
// reads the exit durations rather than the entrance ones.
|
|
135
|
+
if (changed.has("closing") && this.closing) {
|
|
136
|
+
const root = this.renderRoot;
|
|
137
|
+
this.cancelExit = afterTransitions([root.querySelector(".backdrop"), root.querySelector(".modal")], () => {
|
|
138
|
+
this.cancelExit = undefined;
|
|
139
|
+
this.closing = false;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
if (changed.has("open") && !this.preview) {
|
|
143
|
+
this.setLock(this.open);
|
|
144
|
+
if (this.open) {
|
|
145
|
+
pushOverlay(this);
|
|
146
|
+
// Deep, as on tt-drawer: the outermost shadow host is not where
|
|
147
|
+
// the person was.
|
|
148
|
+
this.lastFocused = deepActiveElement();
|
|
149
|
+
/*
|
|
150
|
+
Directly, not in requestAnimationFrame. updated() already runs
|
|
151
|
+
after the dialog is rendered, so a frame bought nothing, and a
|
|
152
|
+
browser does not deliver frames to a background tab: a dialog
|
|
153
|
+
opened by a timer while the user was elsewhere never took focus
|
|
154
|
+
at all, and the keyboard stayed behind it.
|
|
155
|
+
*/
|
|
156
|
+
this.renderRoot?.querySelector(".modal")?.focus();
|
|
157
|
+
/*
|
|
158
|
+
A slotted element marked autofocus then takes focus from the
|
|
159
|
+
dialog: the same attribute a native <dialog> honours. tt-confirm
|
|
160
|
+
uses it to land on Cancel, so a stray Enter on "Delete?" cancels
|
|
161
|
+
rather than deletes, which its docs had promised while focus sat
|
|
162
|
+
on the dialog box.
|
|
163
|
+
|
|
164
|
+
After ITS first render, not now: a tt-button created in the same
|
|
165
|
+
template as this modal has not drawn its inner <button> yet when
|
|
166
|
+
this runs, so focusing it immediately focused nothing.
|
|
167
|
+
*/
|
|
168
|
+
const preferred = this.querySelector("[autofocus]");
|
|
169
|
+
if (preferred) {
|
|
170
|
+
Promise.resolve(preferred.updateComplete).then(() => {
|
|
171
|
+
if (this.open)
|
|
172
|
+
preferred.focus();
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
removeOverlay(this);
|
|
178
|
+
this.lastFocused?.focus?.();
|
|
179
|
+
this.lastFocused = null;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
static { this.styles = css `
|
|
184
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
185
|
+
hidden element would still show. Important, so it always wins. */
|
|
186
|
+
:host([hidden]) {
|
|
187
|
+
display: none !important;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:host {
|
|
191
|
+
/* Private aliases - underscore-prefixed so they never shadow a
|
|
192
|
+
global --tt-* token a consumer may have set. */
|
|
193
|
+
/* Rung 3 of the elevation ladder in tokens.css: the popover
|
|
194
|
+
surface, the same one tt-drawer uses. It said --tt-card, which
|
|
195
|
+
happens to hold the same colour today and is the wrong rung. */
|
|
196
|
+
--_surface: var(--tt-popover);
|
|
197
|
+
--_foreground: var(--tt-popover-foreground);
|
|
198
|
+
--_body: var(--tt-muted-foreground);
|
|
199
|
+
--_radius: var(--tt-radius-lg);
|
|
200
|
+
|
|
201
|
+
font-family: var(--tt-font-sans);
|
|
202
|
+
-webkit-font-smoothing: antialiased;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.backdrop {
|
|
206
|
+
position: fixed;
|
|
207
|
+
inset: 0;
|
|
208
|
+
|
|
209
|
+
background: var(--tt-overlay);
|
|
210
|
+
|
|
211
|
+
-webkit-backdrop-filter: blur(3px);
|
|
212
|
+
backdrop-filter: blur(3px);
|
|
213
|
+
|
|
214
|
+
display: flex;
|
|
215
|
+
justify-content: center;
|
|
216
|
+
align-items: center;
|
|
217
|
+
|
|
218
|
+
padding: var(--tt-space-5);
|
|
219
|
+
|
|
220
|
+
z-index: var(--tt-z-modal);
|
|
221
|
+
|
|
222
|
+
transition: opacity var(--tt-duration-slow) var(--tt-ease-out);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.preview {
|
|
226
|
+
position: relative;
|
|
227
|
+
inset: auto;
|
|
228
|
+
|
|
229
|
+
padding: 0;
|
|
230
|
+
|
|
231
|
+
background: transparent;
|
|
232
|
+
|
|
233
|
+
-webkit-backdrop-filter: none;
|
|
234
|
+
backdrop-filter: none;
|
|
235
|
+
|
|
236
|
+
z-index: auto;
|
|
237
|
+
|
|
238
|
+
transition: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.modal {
|
|
242
|
+
box-sizing: border-box;
|
|
243
|
+
|
|
244
|
+
width: 100%;
|
|
245
|
+
|
|
246
|
+
max-height: calc(100dvh - 40px);
|
|
247
|
+
|
|
248
|
+
/*
|
|
249
|
+
The MODAL does not scroll. Its body does.
|
|
250
|
+
|
|
251
|
+
This used to be overflow: auto on the whole dialog, which sounds
|
|
252
|
+
equivalent and is not. The children are flex items with the
|
|
253
|
+
default flex-shrink: 1, so a tall body was SQUEEZED to fit the
|
|
254
|
+
max-height rather than the dialog scrolling, and because section
|
|
255
|
+
was overflow: visible its content then painted straight through
|
|
256
|
+
the footer. A shop quick view showed "reviews" and a stock badge
|
|
257
|
+
below the Close button.
|
|
258
|
+
|
|
259
|
+
Measured before the fix: section box 430px, its content 559px.
|
|
260
|
+
The missing 129px were being drawn over the buttons.
|
|
261
|
+
*/
|
|
262
|
+
overflow: hidden;
|
|
263
|
+
|
|
264
|
+
display: flex;
|
|
265
|
+
flex-direction: column;
|
|
266
|
+
|
|
267
|
+
gap: var(--tt-space-4);
|
|
268
|
+
|
|
269
|
+
padding: var(--tt-space-6);
|
|
270
|
+
|
|
271
|
+
background: var(--_surface);
|
|
272
|
+
color: var(--_foreground);
|
|
273
|
+
|
|
274
|
+
border: 1px solid var(--tt-border);
|
|
275
|
+
border-radius: var(--_radius);
|
|
276
|
+
|
|
277
|
+
/*
|
|
278
|
+
Concentric corners for anything slotted in that FILLS this box: a
|
|
279
|
+
full-width image, a table, a nested panel. Same contract tt-card
|
|
280
|
+
publishes, so a child written for a card is already correct here
|
|
281
|
+
and needs no second rule.
|
|
282
|
+
|
|
283
|
+
This floors at sm, because the padding is wider than the radius.
|
|
284
|
+
That is the right answer rather than a missed opportunity: once
|
|
285
|
+
the inset exceeds the curve there is no visual relationship left
|
|
286
|
+
to preserve.
|
|
287
|
+
*/
|
|
288
|
+
--tt-radius-nested: max(
|
|
289
|
+
var(--tt-radius-sm),
|
|
290
|
+
calc(var(--_radius) - var(--tt-space-6))
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
box-shadow: var(--tt-elevation-3);
|
|
294
|
+
|
|
295
|
+
transition:
|
|
296
|
+
opacity var(--tt-duration-slow) var(--tt-ease-out),
|
|
297
|
+
transform var(--tt-duration-slow) var(--tt-ease-out);
|
|
298
|
+
|
|
299
|
+
outline: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.preview .modal {
|
|
303
|
+
box-shadow: none;
|
|
304
|
+
transition: none;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/*
|
|
308
|
+
Entrance. @starting-style is what a NEWLY DRAWN element transitions
|
|
309
|
+
from, so the dialog rises and fades in as it first renders. A
|
|
310
|
+
transition rather than a keyframe animation, so a dialog closed
|
|
311
|
+
halfway in turns round from where it got to instead of jumping.
|
|
312
|
+
Reduced motion needs nothing here: tokens.css makes every duration
|
|
313
|
+
1ms, which leaves no movement to see.
|
|
314
|
+
*/
|
|
315
|
+
@starting-style {
|
|
316
|
+
.backdrop {
|
|
317
|
+
opacity: 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.modal {
|
|
321
|
+
opacity: 0;
|
|
322
|
+
transform: translateY(8px) scale(0.98);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/*
|
|
327
|
+
Exit. Quicker than the entrance and accelerating away, because
|
|
328
|
+
nobody watches where a closed thing goes. pointer-events: none, so a
|
|
329
|
+
click during the fade reaches the page underneath.
|
|
330
|
+
*/
|
|
331
|
+
.backdrop.closing {
|
|
332
|
+
opacity: 0;
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
|
|
335
|
+
transition-duration: var(--tt-duration-normal);
|
|
336
|
+
transition-timing-function: var(--tt-ease-in);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.closing .modal {
|
|
340
|
+
opacity: 0;
|
|
341
|
+
transform: translateY(4px) scale(0.98);
|
|
342
|
+
|
|
343
|
+
transition-duration: var(--tt-duration-normal);
|
|
344
|
+
transition-timing-function: var(--tt-ease-in);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.small {
|
|
348
|
+
max-width: 340px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.medium {
|
|
352
|
+
max-width: 460px;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.large {
|
|
356
|
+
max-width: 640px;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
header {
|
|
360
|
+
display: flex;
|
|
361
|
+
justify-content: space-between;
|
|
362
|
+
align-items: center;
|
|
363
|
+
|
|
364
|
+
gap: var(--tt-space-3);
|
|
365
|
+
|
|
366
|
+
color: var(--_foreground);
|
|
367
|
+
|
|
368
|
+
font-size: var(--tt-text-lg);
|
|
369
|
+
font-weight: var(--tt-weight-semibold);
|
|
370
|
+
|
|
371
|
+
letter-spacing: -0.015em;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.close {
|
|
375
|
+
display: inline-flex;
|
|
376
|
+
align-items: center;
|
|
377
|
+
justify-content: center;
|
|
378
|
+
|
|
379
|
+
/* The control token, not a fixed 30px: the same close button in
|
|
380
|
+
tt-modal and tt-drawer, and it grows to a full touch target
|
|
381
|
+
under pointer: coarse like every other control. */
|
|
382
|
+
width: var(--tt-control-sm);
|
|
383
|
+
height: var(--tt-control-sm);
|
|
384
|
+
|
|
385
|
+
margin: -6px -6px -6px 0;
|
|
386
|
+
|
|
387
|
+
border: none;
|
|
388
|
+
border-radius: var(--tt-radius);
|
|
389
|
+
|
|
390
|
+
background: transparent;
|
|
391
|
+
color: var(--_body);
|
|
392
|
+
|
|
393
|
+
cursor: pointer;
|
|
394
|
+
|
|
395
|
+
font-size: var(--tt-text-lg);
|
|
396
|
+
line-height: 1;
|
|
397
|
+
|
|
398
|
+
transition:
|
|
399
|
+
background var(--tt-duration-normal) var(--tt-ease),
|
|
400
|
+
color var(--tt-duration-normal) var(--tt-ease);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.close:hover {
|
|
404
|
+
background: var(--tt-accent);
|
|
405
|
+
color: var(--_foreground);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.close:focus-visible {
|
|
409
|
+
outline: var(--tt-ring-width) solid var(--tt-ring);
|
|
410
|
+
outline-offset: var(--tt-ring-offset);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/*
|
|
414
|
+
The scroller. Three declarations, all load-bearing.
|
|
415
|
+
|
|
416
|
+
flex: 1 lets it take the space header and footer do not.
|
|
417
|
+
|
|
418
|
+
min-height: 0 is the one people miss. A flex item defaults to
|
|
419
|
+
min-height: auto, which refuses to shrink below its content, so
|
|
420
|
+
overflow never engages and the item pushes the footer out of the
|
|
421
|
+
dialog instead.
|
|
422
|
+
|
|
423
|
+
overflow: auto then scrolls what is left over, rather than letting
|
|
424
|
+
it paint outside the box.
|
|
425
|
+
*/
|
|
426
|
+
section {
|
|
427
|
+
flex: 1 1 auto;
|
|
428
|
+
min-height: 0;
|
|
429
|
+
overflow: auto;
|
|
430
|
+
|
|
431
|
+
color: var(--_body);
|
|
432
|
+
|
|
433
|
+
font-size: var(--tt-text-sm);
|
|
434
|
+
line-height: var(--tt-leading-relaxed);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* Pinned. Neither may shrink, or a long body reclaims the space the
|
|
438
|
+
heading and the buttons need. */
|
|
439
|
+
header,
|
|
440
|
+
footer {
|
|
441
|
+
flex: 0 0 auto;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
footer {
|
|
445
|
+
display: flex;
|
|
446
|
+
justify-content: flex-end;
|
|
447
|
+
|
|
448
|
+
gap: var(--tt-space-2);
|
|
449
|
+
|
|
450
|
+
flex-wrap: wrap;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* Sheet-style on small screens */
|
|
454
|
+
@media (max-width: 520px) {
|
|
455
|
+
.backdrop:not(.preview) {
|
|
456
|
+
align-items: flex-end;
|
|
457
|
+
padding: 0;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.backdrop:not(.preview) .modal {
|
|
461
|
+
max-width: 100%;
|
|
462
|
+
|
|
463
|
+
border-radius: var(--_radius) var(--_radius) 0 0;
|
|
464
|
+
|
|
465
|
+
max-height: 88dvh;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/* A sheet comes up from the bottom edge and goes back down to it. */
|
|
469
|
+
@starting-style {
|
|
470
|
+
.backdrop:not(.preview) .modal {
|
|
471
|
+
transform: translateY(100%);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.backdrop.closing:not(.preview) .modal {
|
|
476
|
+
transform: translateY(100%);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
`; }
|
|
480
|
+
render() {
|
|
481
|
+
if (!this.open && !this.closing && !this.preview) {
|
|
482
|
+
return html ``;
|
|
483
|
+
}
|
|
484
|
+
return html `
|
|
485
|
+
<div
|
|
486
|
+
class="backdrop ${this.preview ? "preview" : ""} ${this.closing
|
|
487
|
+
? "closing"
|
|
488
|
+
: ""}"
|
|
489
|
+
?inert=${this.closing}
|
|
490
|
+
@click=${this.handleBackdropClick}
|
|
491
|
+
>
|
|
492
|
+
<div
|
|
493
|
+
part="modal"
|
|
494
|
+
class="modal ${this.size}"
|
|
495
|
+
role="dialog"
|
|
496
|
+
aria-modal=${this.preview ? "false" : "true"}
|
|
497
|
+
aria-labelledby=${this.heading ? "tt-modal-title" : ""}
|
|
498
|
+
tabindex="-1"
|
|
499
|
+
>
|
|
500
|
+
<header part="header">
|
|
501
|
+
<span id="tt-modal-title">${this.heading}</span>
|
|
502
|
+
|
|
503
|
+
<slot name="header"></slot>
|
|
504
|
+
|
|
505
|
+
${!this.persistent
|
|
506
|
+
? html `
|
|
507
|
+
<button
|
|
508
|
+
part="close"
|
|
509
|
+
class="close"
|
|
510
|
+
aria-label="Close"
|
|
511
|
+
@click=${this.closeModal}
|
|
512
|
+
>
|
|
513
|
+
<tt-icon name="x" size="16px"></tt-icon>
|
|
514
|
+
</button>
|
|
515
|
+
`
|
|
516
|
+
: null}
|
|
517
|
+
</header>
|
|
518
|
+
|
|
519
|
+
<section part="body">
|
|
520
|
+
<slot></slot>
|
|
521
|
+
</section>
|
|
522
|
+
|
|
523
|
+
<footer part="footer" @tt-button-click=${this.handleButtonClick}>
|
|
524
|
+
<slot name="footer"></slot>
|
|
525
|
+
</footer>
|
|
526
|
+
</div>
|
|
527
|
+
</div>
|
|
528
|
+
`;
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
__decorate([
|
|
532
|
+
property({ type: Boolean, reflect: true })
|
|
533
|
+
], TTModal.prototype, "open", void 0);
|
|
534
|
+
__decorate([
|
|
535
|
+
property({ type: String })
|
|
536
|
+
], TTModal.prototype, "heading", void 0);
|
|
537
|
+
__decorate([
|
|
538
|
+
property({ type: String })
|
|
539
|
+
], TTModal.prototype, "size", void 0);
|
|
540
|
+
__decorate([
|
|
541
|
+
property({ type: Boolean })
|
|
542
|
+
], TTModal.prototype, "persistent", void 0);
|
|
543
|
+
__decorate([
|
|
544
|
+
property({ type: Boolean })
|
|
545
|
+
], TTModal.prototype, "preview", void 0);
|
|
546
|
+
__decorate([
|
|
547
|
+
state()
|
|
548
|
+
], TTModal.prototype, "closing", void 0);
|
|
549
|
+
TTModal = __decorate([
|
|
550
|
+
customElement("tt-modal")
|
|
551
|
+
], TTModal);
|
|
552
|
+
export { TTModal };
|
|
553
|
+
//# sourceMappingURL=tt-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-modal.js","sourceRoot":"","sources":["../src/tt-modal.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,cAAc,CAAC;AAKf,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAAhC;;QACL,mEAAmE;QACnE,sCAAsC;QAEtC,SAAI,GAAG,KAAK,CAAC;QAEb,oEAAoE;QACpE,gEAAgE;QAEhE,YAAO,GAAG,EAAE,CAAC;QAGb,SAAI,GAAc,QAAQ,CAAC;QAE3B;;;;;UAKE;QAEF,eAAU,GAAG,KAAK,CAAC;QAEnB,4EAA4E;QAE5E,YAAO,GAAG,KAAK,CAAC;QAER,gBAAW,GAAuB,IAAI,CAAC;QAE/C;;;;;UAKE;QACe,YAAO,GAAG,KAAK,CAAC;QAyCjC,kEAAkE;QAClE,gEAAgE;QACxD,WAAM,GAAG,KA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AC,IAAI,CAAC,UAAU;YAChB,CAAC,CAAC,IAAI,CAAA;;;;;6BAKS,IAAI,CAAC,UAAU;;;;iBAI3B;YACH,CAAC,CAAC,IAAI;;;;;;;mDAO+B,IAAI,CAAC,iBAAiB;;;;;KAKpE,CAAC;IACJ,CAAC;;AAniBD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAC9B;AAKb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACA;AAS3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACT;AAInB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACZ;AAUC;IAAhB,KAAK,EAAE;wCAAyB;AAnCtB,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAwiBnB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./tt-button.js";
|
|
3
|
+
import "./tt-icon.js";
|
|
4
|
+
export type NavbarSize = "small" | "medium" | "large";
|
|
5
|
+
export declare class TTNavbar extends LitElement {
|
|
6
|
+
sticky: boolean;
|
|
7
|
+
bordered: boolean;
|
|
8
|
+
size: NavbarSize;
|
|
9
|
+
mobileMenuOpen: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* A soft blurred boundary below the bar instead of a hard rule, for
|
|
12
|
+
* where content actually scrolls UNDERNEATH it: a landing page, or any
|
|
13
|
+
* layout where the bar floats over the scroller rather than sitting in
|
|
14
|
+
* a column above it.
|
|
15
|
+
*
|
|
16
|
+
* Not decoration, and not a nicer border. It marks where UI meets
|
|
17
|
+
* content, so it is wrong on a bar with nothing passing under it, and
|
|
18
|
+
* it does nothing unless `sticky` is set. Use one per scrolling view.
|
|
19
|
+
*
|
|
20
|
+
* Attribute is `scroll-edge`, kebab-case like every multi-word
|
|
21
|
+
* attribute in the library.
|
|
22
|
+
*/
|
|
23
|
+
scrollEdge: boolean;
|
|
24
|
+
private handleMenuToggle;
|
|
25
|
+
static styles: import("lit").CSSResult;
|
|
26
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
"tt-navbar": TTNavbar;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=tt-navbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-navbar.d.ts","sourceRoot":"","sources":["../src/tt-navbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAGrD,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,qBACa,QAAS,SAAQ,UAAU;IAUtC,MAAM,UAAS;IAKf,QAAQ,UAAS;IAKjB,IAAI,EAAE,UAAU,CAAY;IAG5B,cAAc,UAAS;IAEvB;;;;;;;;;;;;OAYG;IAEH,UAAU,UAAS;IAEnB,OAAO,CAAC,gBAAgB;IAcxB,MAAM,CAAC,MAAM,0BAuQX;IAEF,MAAM;CAmDP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|