@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,585 @@
|
|
|
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 } from "lit/decorators.js";
|
|
9
|
+
import "./tt-page.js";
|
|
10
|
+
import "./tt-section.js";
|
|
11
|
+
import "./tt-preview.js";
|
|
12
|
+
import "./tt-example.js";
|
|
13
|
+
import "./tt-code-block.js";
|
|
14
|
+
import "./tt-table.js";
|
|
15
|
+
import "./tt-icon.js";
|
|
16
|
+
// "attribute" is optional on a row and renders as a dash when absent:
|
|
17
|
+
// arrays and objects have no attribute, only a property.
|
|
18
|
+
const PROP_COLUMNS = [
|
|
19
|
+
{ key: "name", label: "Property" },
|
|
20
|
+
{ key: "attribute", label: "Attribute", code: true },
|
|
21
|
+
{ key: "type", label: "Type", code: true },
|
|
22
|
+
{ key: "default", label: "Default", code: true },
|
|
23
|
+
];
|
|
24
|
+
const EVENT_COLUMNS = [
|
|
25
|
+
{ key: "name", label: "Event", code: true },
|
|
26
|
+
{ key: "description", label: "Description" },
|
|
27
|
+
];
|
|
28
|
+
const METHOD_COLUMNS = [
|
|
29
|
+
{ key: "name", label: "Method", code: true },
|
|
30
|
+
{ key: "description", label: "Description" },
|
|
31
|
+
];
|
|
32
|
+
const SLOT_COLUMNS = [
|
|
33
|
+
{ key: "name", label: "Slot", code: true },
|
|
34
|
+
{ key: "description", label: "Description" },
|
|
35
|
+
];
|
|
36
|
+
const PART_COLUMNS = [
|
|
37
|
+
{ key: "name", label: "Part", code: true },
|
|
38
|
+
{ key: "description", label: "Description" },
|
|
39
|
+
];
|
|
40
|
+
const CSS_PROPERTY_COLUMNS = [
|
|
41
|
+
{ key: "name", label: "Custom property", code: true },
|
|
42
|
+
{ key: "default", label: "Default", code: true },
|
|
43
|
+
{ key: "description", label: "Description" },
|
|
44
|
+
];
|
|
45
|
+
const KEY_COLUMNS = [
|
|
46
|
+
{ key: "keys", label: "Key", code: true },
|
|
47
|
+
{ key: "action", label: "Action" },
|
|
48
|
+
];
|
|
49
|
+
let TTComponentDoc = class TTComponentDoc extends LitElement {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
|
+
// Named `heading` rather than `title` so it cannot collide with the
|
|
53
|
+
// global HTML title attribute (which renders a native tooltip).
|
|
54
|
+
this.heading = "";
|
|
55
|
+
this.description = "";
|
|
56
|
+
this.code = "";
|
|
57
|
+
this.props = [];
|
|
58
|
+
this.events = [];
|
|
59
|
+
/*
|
|
60
|
+
Public methods. There was nowhere to put them, so focus(),
|
|
61
|
+
checkValidity(), tt-form's submit() and the rest existed only in the
|
|
62
|
+
source: public API a reader of these pages could not discover.
|
|
63
|
+
*/
|
|
64
|
+
this.methods = [];
|
|
65
|
+
this.slots = [];
|
|
66
|
+
this.parts = [];
|
|
67
|
+
// Custom properties a consumer may set on the element to restyle it,
|
|
68
|
+
// the token-level counterpart of parts.
|
|
69
|
+
this.cssProperties = [];
|
|
70
|
+
// The import line for this component.
|
|
71
|
+
this.importPath = "";
|
|
72
|
+
/*
|
|
73
|
+
Everything below is optional. A section appears only once it has
|
|
74
|
+
something to put in it, so the sixty-odd docs that predate these fields
|
|
75
|
+
render exactly as they did before.
|
|
76
|
+
*/
|
|
77
|
+
// Composition skeleton for a multi-element component, as markup.
|
|
78
|
+
this.anatomy = "";
|
|
79
|
+
this.examples = [];
|
|
80
|
+
this.guidelines = null;
|
|
81
|
+
this.accessibility = null;
|
|
82
|
+
this.related = [];
|
|
83
|
+
}
|
|
84
|
+
/*
|
|
85
|
+
The page does not know how the app routes, so it announces the doc that
|
|
86
|
+
was asked for and lets whoever owns navigation act on it. Same rule as
|
|
87
|
+
every other component here: report the intent, do not assume the effect.
|
|
88
|
+
*/
|
|
89
|
+
openDoc(doc) {
|
|
90
|
+
this.dispatchEvent(new CustomEvent("tt-doc-link", {
|
|
91
|
+
detail: { doc },
|
|
92
|
+
bubbles: true,
|
|
93
|
+
composed: true,
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
static { this.styles = css `
|
|
97
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
98
|
+
hidden element would still show. Important, so it always wins. */
|
|
99
|
+
:host([hidden]) {
|
|
100
|
+
display: none !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host {
|
|
104
|
+
display: block;
|
|
105
|
+
|
|
106
|
+
--_max: 880px;
|
|
107
|
+
|
|
108
|
+
color: var(--tt-foreground);
|
|
109
|
+
font-family: var(--tt-font-sans);
|
|
110
|
+
|
|
111
|
+
-webkit-font-smoothing: antialiased;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.wrap {
|
|
115
|
+
max-width: var(--_max);
|
|
116
|
+
margin: 0 auto;
|
|
117
|
+
|
|
118
|
+
padding: var(--tt-space-12) var(--tt-space-6);
|
|
119
|
+
|
|
120
|
+
box-sizing: border-box;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
tt-section {
|
|
124
|
+
display: block;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
tt-preview {
|
|
128
|
+
display: block;
|
|
129
|
+
overflow-x: auto;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
Examples are the long tail of the page, so they get more air between
|
|
134
|
+
them than the sections above. Anything tighter and two adjacent
|
|
135
|
+
examples read as one.
|
|
136
|
+
*/
|
|
137
|
+
.examples {
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
gap: var(--tt-space-10);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.guidelines {
|
|
144
|
+
display: grid;
|
|
145
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
146
|
+
gap: var(--tt-space-5);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.guide {
|
|
150
|
+
border: 1px solid var(--tt-border);
|
|
151
|
+
border-radius: var(--tt-radius-lg);
|
|
152
|
+
|
|
153
|
+
background: var(--tt-card);
|
|
154
|
+
|
|
155
|
+
padding: var(--tt-space-5);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/*
|
|
159
|
+
A hairline of colour on the leading edge, not a tinted card. Full
|
|
160
|
+
colour fills would fight the previews for attention, and this page is
|
|
161
|
+
read top to bottom in one pass.
|
|
162
|
+
*/
|
|
163
|
+
.guide.use {
|
|
164
|
+
border-left: 3px solid var(--tt-success);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.guide.avoid {
|
|
168
|
+
border-left: 3px solid var(--tt-destructive);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.guide h3 {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
gap: var(--tt-space-2);
|
|
175
|
+
|
|
176
|
+
margin: 0 0 var(--tt-space-4);
|
|
177
|
+
|
|
178
|
+
font-size: var(--tt-text-xs);
|
|
179
|
+
font-weight: var(--tt-weight-semibold);
|
|
180
|
+
|
|
181
|
+
text-transform: uppercase;
|
|
182
|
+
letter-spacing: 0.06em;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.guide.use h3 {
|
|
186
|
+
color: var(--tt-success);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.guide.avoid h3 {
|
|
190
|
+
color: var(--tt-destructive);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.guide ul {
|
|
194
|
+
margin: 0;
|
|
195
|
+
padding: 0;
|
|
196
|
+
list-style: none;
|
|
197
|
+
|
|
198
|
+
display: flex;
|
|
199
|
+
flex-direction: column;
|
|
200
|
+
gap: var(--tt-space-3);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.guide li {
|
|
204
|
+
display: flex;
|
|
205
|
+
align-items: flex-start;
|
|
206
|
+
gap: var(--tt-space-2);
|
|
207
|
+
|
|
208
|
+
font-size: var(--tt-text-sm);
|
|
209
|
+
line-height: var(--tt-leading-relaxed);
|
|
210
|
+
|
|
211
|
+
color: var(--tt-muted-foreground);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.guide li tt-icon {
|
|
215
|
+
flex: none;
|
|
216
|
+
|
|
217
|
+
/* Optically centres the tick on the first line of text. */
|
|
218
|
+
margin-top: 3px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.guide.use li tt-icon {
|
|
222
|
+
color: var(--tt-success);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.guide.avoid li tt-icon {
|
|
226
|
+
color: var(--tt-destructive);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.notes {
|
|
230
|
+
margin: var(--tt-space-5) 0 0;
|
|
231
|
+
padding-left: var(--tt-space-5);
|
|
232
|
+
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
gap: var(--tt-space-2);
|
|
236
|
+
|
|
237
|
+
font-size: var(--tt-text-sm);
|
|
238
|
+
line-height: var(--tt-leading-relaxed);
|
|
239
|
+
|
|
240
|
+
color: var(--tt-muted-foreground);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Related: chips that route inside the app, so no href to hand out. */
|
|
244
|
+
.related {
|
|
245
|
+
display: flex;
|
|
246
|
+
flex-wrap: wrap;
|
|
247
|
+
gap: var(--tt-space-2);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.related button {
|
|
251
|
+
display: inline-flex;
|
|
252
|
+
align-items: baseline;
|
|
253
|
+
gap: var(--tt-space-2);
|
|
254
|
+
|
|
255
|
+
border: 1px solid var(--tt-border);
|
|
256
|
+
border-radius: var(--tt-radius-full);
|
|
257
|
+
|
|
258
|
+
padding: var(--tt-space-2) var(--tt-space-4);
|
|
259
|
+
|
|
260
|
+
background: var(--tt-card);
|
|
261
|
+
|
|
262
|
+
font: inherit;
|
|
263
|
+
font-size: var(--tt-text-sm);
|
|
264
|
+
font-weight: var(--tt-weight-medium);
|
|
265
|
+
|
|
266
|
+
color: var(--tt-foreground);
|
|
267
|
+
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
|
|
270
|
+
transition:
|
|
271
|
+
background var(--tt-duration-fast) var(--tt-ease),
|
|
272
|
+
border-color var(--tt-duration-fast) var(--tt-ease);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.related button:hover {
|
|
276
|
+
background: var(--tt-muted);
|
|
277
|
+
border-color: var(--tt-muted-foreground);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.related button:focus-visible {
|
|
281
|
+
outline: var(--tt-ring-width) solid var(--tt-ring);
|
|
282
|
+
outline-offset: var(--tt-ring-offset);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.related .reason {
|
|
286
|
+
font-weight: var(--tt-weight-regular);
|
|
287
|
+
color: var(--tt-muted-foreground);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@media (max-width: 768px) {
|
|
291
|
+
.wrap {
|
|
292
|
+
padding: var(--tt-space-8) var(--tt-space-5);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.guidelines {
|
|
296
|
+
grid-template-columns: minmax(0, 1fr);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.examples {
|
|
300
|
+
gap: var(--tt-space-8);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@media (max-width: 480px) {
|
|
305
|
+
.wrap {
|
|
306
|
+
padding: var(--tt-space-6) var(--tt-space-4);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
`; }
|
|
311
|
+
renderGuidelines() {
|
|
312
|
+
const use = this.guidelines?.use ?? [];
|
|
313
|
+
const avoid = this.guidelines?.avoid ?? [];
|
|
314
|
+
if (!use.length && !avoid.length)
|
|
315
|
+
return "";
|
|
316
|
+
return html `
|
|
317
|
+
<tt-section heading="When to use it">
|
|
318
|
+
<div class="guidelines">
|
|
319
|
+
${use.length
|
|
320
|
+
? html `
|
|
321
|
+
<div class="guide use">
|
|
322
|
+
<h3>
|
|
323
|
+
<tt-icon name="check-circle" size="14px"></tt-icon>
|
|
324
|
+
Reach for it
|
|
325
|
+
</h3>
|
|
326
|
+
|
|
327
|
+
<ul>
|
|
328
|
+
${use.map((line) => html `
|
|
329
|
+
<li>
|
|
330
|
+
<tt-icon name="check" size="14px"></tt-icon>
|
|
331
|
+
<span>${line}</span>
|
|
332
|
+
</li>
|
|
333
|
+
`)}
|
|
334
|
+
</ul>
|
|
335
|
+
</div>
|
|
336
|
+
`
|
|
337
|
+
: ""}
|
|
338
|
+
${avoid.length
|
|
339
|
+
? html `
|
|
340
|
+
<div class="guide avoid">
|
|
341
|
+
<h3>
|
|
342
|
+
<tt-icon name="x-circle" size="14px"></tt-icon>
|
|
343
|
+
Use something else
|
|
344
|
+
</h3>
|
|
345
|
+
|
|
346
|
+
<ul>
|
|
347
|
+
${avoid.map((line) => html `
|
|
348
|
+
<li>
|
|
349
|
+
<tt-icon name="x" size="14px"></tt-icon>
|
|
350
|
+
<span>${line}</span>
|
|
351
|
+
</li>
|
|
352
|
+
`)}
|
|
353
|
+
</ul>
|
|
354
|
+
</div>
|
|
355
|
+
`
|
|
356
|
+
: ""}
|
|
357
|
+
</div>
|
|
358
|
+
</tt-section>
|
|
359
|
+
`;
|
|
360
|
+
}
|
|
361
|
+
renderAccessibility() {
|
|
362
|
+
const keys = this.accessibility?.keys ?? [];
|
|
363
|
+
const notes = this.accessibility?.notes ?? [];
|
|
364
|
+
if (!keys.length && !notes.length)
|
|
365
|
+
return "";
|
|
366
|
+
return html `
|
|
367
|
+
<tt-section
|
|
368
|
+
heading="Accessibility"
|
|
369
|
+
description="What the component already handles, so you do not rebuild it."
|
|
370
|
+
>
|
|
371
|
+
${keys.length
|
|
372
|
+
? html `
|
|
373
|
+
<tt-table
|
|
374
|
+
.columns=${KEY_COLUMNS}
|
|
375
|
+
.rows=${keys.map(({ keys, action }) => ({ keys, action }))}
|
|
376
|
+
></tt-table>
|
|
377
|
+
`
|
|
378
|
+
: ""}
|
|
379
|
+
${notes.length
|
|
380
|
+
? html `
|
|
381
|
+
<ul class="notes">
|
|
382
|
+
${notes.map((note) => html `<li>${note}</li>`)}
|
|
383
|
+
</ul>
|
|
384
|
+
`
|
|
385
|
+
: ""}
|
|
386
|
+
</tt-section>
|
|
387
|
+
`;
|
|
388
|
+
}
|
|
389
|
+
render() {
|
|
390
|
+
return html `
|
|
391
|
+
<div class="wrap">
|
|
392
|
+
<tt-page heading=${this.heading} description=${this.description}>
|
|
393
|
+
<tt-section heading="Preview">
|
|
394
|
+
<tt-preview>
|
|
395
|
+
<slot name="preview"></slot>
|
|
396
|
+
</tt-preview>
|
|
397
|
+
</tt-section>
|
|
398
|
+
|
|
399
|
+
${this.importPath
|
|
400
|
+
? html `
|
|
401
|
+
<tt-section heading="Import">
|
|
402
|
+
<tt-code-block show-line-numbers
|
|
403
|
+
.code=${this.importPath}
|
|
404
|
+
language="javascript"
|
|
405
|
+
></tt-code-block>
|
|
406
|
+
</tt-section>
|
|
407
|
+
`
|
|
408
|
+
: ""}
|
|
409
|
+
|
|
410
|
+
<tt-section heading="Usage">
|
|
411
|
+
<tt-code-block show-line-numbers .code=${this.code} language="html"></tt-code-block>
|
|
412
|
+
</tt-section>
|
|
413
|
+
|
|
414
|
+
${this.renderGuidelines()}
|
|
415
|
+
${this.anatomy
|
|
416
|
+
? html `
|
|
417
|
+
<tt-section
|
|
418
|
+
heading="Anatomy"
|
|
419
|
+
description="The pieces and how they nest."
|
|
420
|
+
>
|
|
421
|
+
<tt-code-block show-line-numbers
|
|
422
|
+
.code=${this.anatomy}
|
|
423
|
+
language="html"
|
|
424
|
+
></tt-code-block>
|
|
425
|
+
</tt-section>
|
|
426
|
+
`
|
|
427
|
+
: ""}
|
|
428
|
+
${this.examples.length
|
|
429
|
+
? html `
|
|
430
|
+
<tt-section
|
|
431
|
+
heading="Examples"
|
|
432
|
+
description="Every one is live. Switch to Code for the markup behind it."
|
|
433
|
+
>
|
|
434
|
+
<div class="examples">
|
|
435
|
+
${this.examples.map((example) => html `
|
|
436
|
+
<tt-example
|
|
437
|
+
heading=${example.title}
|
|
438
|
+
description=${example.description ?? ""}
|
|
439
|
+
.code=${example.code}
|
|
440
|
+
language=${example.language ?? "html"}
|
|
441
|
+
align=${example.align ?? "center"}
|
|
442
|
+
>
|
|
443
|
+
${example.preview}
|
|
444
|
+
</tt-example>
|
|
445
|
+
`)}
|
|
446
|
+
</div>
|
|
447
|
+
</tt-section>
|
|
448
|
+
`
|
|
449
|
+
: ""}
|
|
450
|
+
|
|
451
|
+
<tt-section heading="Properties">
|
|
452
|
+
<tt-table .columns=${PROP_COLUMNS} .rows=${this.props}></tt-table>
|
|
453
|
+
</tt-section>
|
|
454
|
+
|
|
455
|
+
${this.events.length
|
|
456
|
+
? html `
|
|
457
|
+
<tt-section heading="Events">
|
|
458
|
+
<tt-table
|
|
459
|
+
.columns=${EVENT_COLUMNS}
|
|
460
|
+
.rows=${this.events}
|
|
461
|
+
></tt-table>
|
|
462
|
+
</tt-section>
|
|
463
|
+
`
|
|
464
|
+
: ""}
|
|
465
|
+
${this.methods.length
|
|
466
|
+
? html `
|
|
467
|
+
<tt-section heading="Methods">
|
|
468
|
+
<tt-table
|
|
469
|
+
.columns=${METHOD_COLUMNS}
|
|
470
|
+
.rows=${this.methods}
|
|
471
|
+
></tt-table>
|
|
472
|
+
</tt-section>
|
|
473
|
+
`
|
|
474
|
+
: ""}
|
|
475
|
+
${this.slots.length
|
|
476
|
+
? html `
|
|
477
|
+
<tt-section heading="Slots">
|
|
478
|
+
<tt-table
|
|
479
|
+
.columns=${SLOT_COLUMNS}
|
|
480
|
+
.rows=${this.slots}
|
|
481
|
+
></tt-table>
|
|
482
|
+
</tt-section>
|
|
483
|
+
`
|
|
484
|
+
: ""}
|
|
485
|
+
${this.parts.length
|
|
486
|
+
? html `
|
|
487
|
+
<tt-section
|
|
488
|
+
heading="CSS Parts"
|
|
489
|
+
description="Style these from outside with ::part(name)."
|
|
490
|
+
>
|
|
491
|
+
<tt-table
|
|
492
|
+
.columns=${PART_COLUMNS}
|
|
493
|
+
.rows=${this.parts}
|
|
494
|
+
></tt-table>
|
|
495
|
+
</tt-section>
|
|
496
|
+
`
|
|
497
|
+
: ""}
|
|
498
|
+
${this.cssProperties.length
|
|
499
|
+
? html `
|
|
500
|
+
<tt-section
|
|
501
|
+
heading="CSS Custom Properties"
|
|
502
|
+
description="Set these on the element, or on any ancestor: custom properties inherit through the shadow boundary."
|
|
503
|
+
>
|
|
504
|
+
<tt-table
|
|
505
|
+
.columns=${CSS_PROPERTY_COLUMNS}
|
|
506
|
+
.rows=${this.cssProperties}
|
|
507
|
+
></tt-table>
|
|
508
|
+
</tt-section>
|
|
509
|
+
`
|
|
510
|
+
: ""}
|
|
511
|
+
${this.renderAccessibility()}
|
|
512
|
+
${this.related.length
|
|
513
|
+
? html `
|
|
514
|
+
<tt-section
|
|
515
|
+
heading="Related"
|
|
516
|
+
description="What usually shows up alongside this one."
|
|
517
|
+
>
|
|
518
|
+
<div class="related">
|
|
519
|
+
${this.related.map((link) => html `
|
|
520
|
+
<button @click=${() => this.openDoc(link.doc)}>
|
|
521
|
+
${link.label}
|
|
522
|
+
${link.reason
|
|
523
|
+
? html `<span class="reason">${link.reason}</span>`
|
|
524
|
+
: ""}
|
|
525
|
+
</button>
|
|
526
|
+
`)}
|
|
527
|
+
</div>
|
|
528
|
+
</tt-section>
|
|
529
|
+
`
|
|
530
|
+
: ""}
|
|
531
|
+
</tt-page>
|
|
532
|
+
</div>
|
|
533
|
+
`;
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
__decorate([
|
|
537
|
+
property({ type: String })
|
|
538
|
+
], TTComponentDoc.prototype, "heading", void 0);
|
|
539
|
+
__decorate([
|
|
540
|
+
property({ type: String })
|
|
541
|
+
], TTComponentDoc.prototype, "description", void 0);
|
|
542
|
+
__decorate([
|
|
543
|
+
property({ type: String })
|
|
544
|
+
], TTComponentDoc.prototype, "code", void 0);
|
|
545
|
+
__decorate([
|
|
546
|
+
property({ type: Array })
|
|
547
|
+
], TTComponentDoc.prototype, "props", void 0);
|
|
548
|
+
__decorate([
|
|
549
|
+
property({ type: Array })
|
|
550
|
+
], TTComponentDoc.prototype, "events", void 0);
|
|
551
|
+
__decorate([
|
|
552
|
+
property({ type: Array })
|
|
553
|
+
], TTComponentDoc.prototype, "methods", void 0);
|
|
554
|
+
__decorate([
|
|
555
|
+
property({ type: Array })
|
|
556
|
+
], TTComponentDoc.prototype, "slots", void 0);
|
|
557
|
+
__decorate([
|
|
558
|
+
property({ type: Array })
|
|
559
|
+
], TTComponentDoc.prototype, "parts", void 0);
|
|
560
|
+
__decorate([
|
|
561
|
+
property({ type: Array, attribute: "css-properties" })
|
|
562
|
+
], TTComponentDoc.prototype, "cssProperties", void 0);
|
|
563
|
+
__decorate([
|
|
564
|
+
property({ type: String, attribute: "import-path" })
|
|
565
|
+
], TTComponentDoc.prototype, "importPath", void 0);
|
|
566
|
+
__decorate([
|
|
567
|
+
property({ type: String })
|
|
568
|
+
], TTComponentDoc.prototype, "anatomy", void 0);
|
|
569
|
+
__decorate([
|
|
570
|
+
property({ type: Array })
|
|
571
|
+
], TTComponentDoc.prototype, "examples", void 0);
|
|
572
|
+
__decorate([
|
|
573
|
+
property({ type: Object })
|
|
574
|
+
], TTComponentDoc.prototype, "guidelines", void 0);
|
|
575
|
+
__decorate([
|
|
576
|
+
property({ type: Object })
|
|
577
|
+
], TTComponentDoc.prototype, "accessibility", void 0);
|
|
578
|
+
__decorate([
|
|
579
|
+
property({ type: Array })
|
|
580
|
+
], TTComponentDoc.prototype, "related", void 0);
|
|
581
|
+
TTComponentDoc = __decorate([
|
|
582
|
+
customElement("tt-component-doc")
|
|
583
|
+
], TTComponentDoc);
|
|
584
|
+
export { TTComponentDoc };
|
|
585
|
+
//# sourceMappingURL=tt-component-doc.js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,EAAE,MAAM,EAAE,CAAC;+CACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDACE;AAG5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACa;AAGxC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACmB;AAG9C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CACC;AA7DhB,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAohB1B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./tt-modal.js";
|
|
3
|
+
import "./tt-button.js";
|
|
4
|
+
export interface ConfirmOptions {
|
|
5
|
+
heading: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
danger?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Confirmation dialog with a promise-based API. Mount one near the app
|
|
13
|
+
* root, then anywhere else:
|
|
14
|
+
*
|
|
15
|
+
* if (await confirm({ heading: "Delete request?", danger: true })) {
|
|
16
|
+
* ...
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* The promise is the point. The alternative is a dialog component plus
|
|
20
|
+
* open state plus two event handlers plus a variable remembering what you
|
|
21
|
+
* were about to do, spread across every caller. Here the decision reads
|
|
22
|
+
* as one line, in the order it happens.
|
|
23
|
+
*/
|
|
24
|
+
export declare class TTConfirm extends LitElement {
|
|
25
|
+
private pending?;
|
|
26
|
+
connectedCallback(): void;
|
|
27
|
+
disconnectedCallback(): void;
|
|
28
|
+
private returnFocus;
|
|
29
|
+
ask(options: ConfirmOptions): Promise<boolean>;
|
|
30
|
+
private settle;
|
|
31
|
+
static styles: import("lit").CSSResult;
|
|
32
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Ask for confirmation from anywhere. Requires a <tt-confirm> mounted in
|
|
36
|
+
* the page. Resolves false if none is mounted, so a missing dialog can
|
|
37
|
+
* never silently confirm a destructive action.
|
|
38
|
+
*/
|
|
39
|
+
export declare function confirm(options: ConfirmOptions): Promise<boolean>;
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLElementTagNameMap {
|
|
42
|
+
"tt-confirm": TTConfirm;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=tt-confirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-confirm.d.ts","sourceRoot":"","sources":["../src/tt-confirm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAExB,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAMD;;;;;;;;;;;;GAYG;AACH,qBACa,SAAU,SAAQ,UAAU;IAC9B,OAAO,CAAC,OAAO,CAAC,CAAiB;IAE1C,iBAAiB;IAKjB,oBAAoB;IAmBpB,OAAO,CAAC,WAAW,CAA4B;IAE/C,GAAG,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAuB9C,OAAO,CAAC,MAAM;IAWd,MAAM,CAAC,MAAM,0BAcX;IAEF,MAAM;CAmCP;AAID;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CASjE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|