@tartaguti/ui-components 0.0.0-stage → 0.1.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 +7 -0
- package/LICENSE +21 -0
- package/README.md +192 -2
- package/THIRD-PARTY-NOTICES.md +29 -0
- package/custom-elements.json +16731 -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 +69 -0
- package/dist/tt-data-table.d.ts.map +1 -0
- package/dist/tt-data-table.js +542 -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 +2907 -0
|
@@ -0,0 +1,164 @@
|
|
|
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 { customElement, property } from "lit/decorators.js";
|
|
9
|
+
/**
|
|
10
|
+
* The row above a list: something to filter with on the left, actions on
|
|
11
|
+
* the right, and a gap between them that collapses when the row wraps.
|
|
12
|
+
*
|
|
13
|
+
* This is the third copy of the same flex row in this repo, which is the
|
|
14
|
+
* point at which a pattern earns a component. Directory, Members and Shop
|
|
15
|
+
* each had their own, and each had drifted: different gaps, different
|
|
16
|
+
* wrap behaviour, and a hand-rolled spacer div in two of them.
|
|
17
|
+
*
|
|
18
|
+
* Pure layout. It has no idea what is in it, so a search box, a segmented
|
|
19
|
+
* control or a count all work without it knowing.
|
|
20
|
+
*/
|
|
21
|
+
let TTToolbar = class TTToolbar extends LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
// A rule underneath, when the toolbar sits directly on top of content
|
|
25
|
+
// rather than above a card that already has its own edge.
|
|
26
|
+
this.bordered = false;
|
|
27
|
+
// Stacks into two full-width rows instead of wrapping inline. Use when
|
|
28
|
+
// the start side is a search field that should stay full width on a
|
|
29
|
+
// phone rather than shrinking to a stub.
|
|
30
|
+
this.stack = false;
|
|
31
|
+
// Vertical alignment of the two sides. "center" is right for controls;
|
|
32
|
+
// "start" is right when one side is a block of filters that is much
|
|
33
|
+
// taller than the other.
|
|
34
|
+
this.align = "center";
|
|
35
|
+
}
|
|
36
|
+
static { this.styles = css `
|
|
37
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
38
|
+
hidden element would still show. Important, so it always wins. */
|
|
39
|
+
:host([hidden]) {
|
|
40
|
+
display: none !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host {
|
|
44
|
+
display: block;
|
|
45
|
+
font-family: var(--tt-font-sans);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host([bordered]) .bar {
|
|
49
|
+
padding-bottom: var(--tt-space-4);
|
|
50
|
+
border-bottom: 1px solid var(--tt-border);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.bar {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-wrap: wrap;
|
|
56
|
+
align-items: center;
|
|
57
|
+
|
|
58
|
+
/* Two values: a small gap between rows once it wraps, a larger one
|
|
59
|
+
between the two sides while it has not. */
|
|
60
|
+
gap: var(--tt-space-3) var(--tt-space-4);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([align="start"]) .bar {
|
|
64
|
+
align-items: flex-start;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
Each side is its own flex row so callers can drop several controls
|
|
69
|
+
into a slot without wrapping them in a div first.
|
|
70
|
+
|
|
71
|
+
min-width: 0 on both. Flex items refuse to shrink below their
|
|
72
|
+
content by default, so a long search field or a wide button group
|
|
73
|
+
would push the row wider than the page instead of wrapping.
|
|
74
|
+
*/
|
|
75
|
+
.side {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: var(--tt-space-3);
|
|
80
|
+
|
|
81
|
+
min-width: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
The start side takes the leftover space, which is what pushes the
|
|
86
|
+
end side to the right edge. No spacer element needed: a spacer div
|
|
87
|
+
is the thing three pages were each reinventing.
|
|
88
|
+
*/
|
|
89
|
+
.start {
|
|
90
|
+
flex: 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.end {
|
|
94
|
+
flex: 0 0 auto;
|
|
95
|
+
justify-content: flex-end;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Hidden when nothing is slotted, so an empty side draws no gap. */
|
|
99
|
+
.side:not(:has(*)) {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([stack]) .bar {
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
align-items: stretch;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([stack]) .end {
|
|
109
|
+
justify-content: flex-start;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@media (max-width: 640px) {
|
|
113
|
+
.bar {
|
|
114
|
+
gap: var(--tt-space-2) var(--tt-space-3);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Below this width there is no room for two sides side by side, so
|
|
118
|
+
the end row moves under the start row rather than squeezing it. */
|
|
119
|
+
.start {
|
|
120
|
+
flex: 1 1 100%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.end {
|
|
124
|
+
flex: 1 1 100%;
|
|
125
|
+
justify-content: flex-start;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`; }
|
|
129
|
+
render() {
|
|
130
|
+
return html `
|
|
131
|
+
<!--
|
|
132
|
+
No role="toolbar". That role is a promise: ONE Tab stop, arrow
|
|
133
|
+
keys between the controls inside. This is pure layout around a
|
|
134
|
+
search field and some buttons, which Tab through normally and
|
|
135
|
+
must, since arrows inside a text field move the caret. A screen
|
|
136
|
+
reader announced "toolbar" and its users pressed arrows for
|
|
137
|
+
nothing.
|
|
138
|
+
-->
|
|
139
|
+
<div class="bar" part="bar">
|
|
140
|
+
<div class="side start" part="start">
|
|
141
|
+
<slot></slot>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div class="side end" part="end">
|
|
145
|
+
<slot name="end"></slot>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
`;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
__decorate([
|
|
152
|
+
property({ type: Boolean, reflect: true })
|
|
153
|
+
], TTToolbar.prototype, "bordered", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
property({ type: Boolean, reflect: true })
|
|
156
|
+
], TTToolbar.prototype, "stack", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
property({ type: String, reflect: true })
|
|
159
|
+
], TTToolbar.prototype, "align", void 0);
|
|
160
|
+
TTToolbar = __decorate([
|
|
161
|
+
customElement("tt-toolbar")
|
|
162
|
+
], TTToolbar);
|
|
163
|
+
export { TTToolbar };
|
|
164
|
+
//# sourceMappingURL=tt-toolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-toolbar.js","sourceRoot":"","sources":["../src/tt-toolbar.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;;;;;;GAWG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QACL,sEAAsE;QACtE,0DAA0D;QACd,aAAQ,GAAG,KAAK,CAAC;QAE7D,uEAAuE;QACvE,oEAAoE;QACpE,yCAAyC;QACG,UAAK,GAAG,KAAK,CAAC;QAE1D,uEAAuE;QACvE,oEAAoE;QACpE,yBAAyB;QACkB,UAAK,GAC9C,QAAQ,CAAC;IAqHb,CAAC;aAnHQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FlB,AA5FY,CA4FX;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;KAkBV,CAAC;IACJ,CAAC;;AA/H2C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAkB;AAKjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAAe;AAKf;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAC/B;AAdA,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAmIrB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import type { PropertyValues } from "lit";
|
|
3
|
+
export type TooltipPlacement = "top" | "bottom" | "left" | "right";
|
|
4
|
+
/**
|
|
5
|
+
* A short hint attached to whatever you slot into it.
|
|
6
|
+
*
|
|
7
|
+
* Only ever supplementary. A tooltip is invisible on touch devices and to
|
|
8
|
+
* anyone who does not hover, so never put information here that a user
|
|
9
|
+
* needs in order to complete a task.
|
|
10
|
+
*/
|
|
11
|
+
export declare class TTTooltip extends LitElement {
|
|
12
|
+
content: string;
|
|
13
|
+
placement: TooltipPlacement;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
delay: number;
|
|
16
|
+
private open;
|
|
17
|
+
private tip;
|
|
18
|
+
private anchor;
|
|
19
|
+
private timer?;
|
|
20
|
+
private described?;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
private handleFocusin;
|
|
24
|
+
private handleFocusout;
|
|
25
|
+
private describe;
|
|
26
|
+
private undescribe;
|
|
27
|
+
private show;
|
|
28
|
+
private hide;
|
|
29
|
+
private scheduleHide;
|
|
30
|
+
private keepOpen;
|
|
31
|
+
private handleKeydown;
|
|
32
|
+
private position;
|
|
33
|
+
updated(changed: PropertyValues<this>): void;
|
|
34
|
+
static styles: import("lit").CSSResult;
|
|
35
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
36
|
+
}
|
|
37
|
+
declare global {
|
|
38
|
+
interface HTMLElementTagNameMap {
|
|
39
|
+
"tt-tooltip": TTTooltip;
|
|
40
|
+
}
|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(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 { customElement, property, query, state } from "lit/decorators.js";
|
|
9
|
+
/**
|
|
10
|
+
* A short hint attached to whatever you slot into it.
|
|
11
|
+
*
|
|
12
|
+
* Only ever supplementary. A tooltip is invisible on touch devices and to
|
|
13
|
+
* anyone who does not hover, so never put information here that a user
|
|
14
|
+
* needs in order to complete a task.
|
|
15
|
+
*/
|
|
16
|
+
let TTTooltip = class TTTooltip extends LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.content = "";
|
|
20
|
+
this.placement = "top";
|
|
21
|
+
this.disabled = false;
|
|
22
|
+
// Stops a tooltip flashing up as the pointer crosses on its way
|
|
23
|
+
// somewhere else.
|
|
24
|
+
this.delay = 150;
|
|
25
|
+
this.open = false;
|
|
26
|
+
/*
|
|
27
|
+
HOW THE TEXT REACHES A SCREEN READER.
|
|
28
|
+
|
|
29
|
+
The tip lives in this shadow root and the trigger does not, so
|
|
30
|
+
neither reference works: an aria-describedby id never crosses a shadow
|
|
31
|
+
boundary, and ariaDescribedByElements may point OUT of a shadow root
|
|
32
|
+
but never INTO one. So the text itself goes onto the focused element
|
|
33
|
+
as aria-description, which takes a string and needs no reference.
|
|
34
|
+
|
|
35
|
+
The focused element, not the slotted one: composedPath()[0] is what
|
|
36
|
+
really holds focus, even inside a slotted component's own shadow root
|
|
37
|
+
(tt-button's inner <button>). An aria attribute on a tt-button host
|
|
38
|
+
reaches nothing. Set on focus, removed on blur, so the page's own
|
|
39
|
+
markup is only touched while it is focused, and an aria-description
|
|
40
|
+
the page wrote itself is left alone.
|
|
41
|
+
*/
|
|
42
|
+
this.handleFocusin = (event) => {
|
|
43
|
+
const target = event.composedPath()[0];
|
|
44
|
+
if (target instanceof Element)
|
|
45
|
+
this.describe(target);
|
|
46
|
+
this.show();
|
|
47
|
+
};
|
|
48
|
+
this.handleFocusout = () => {
|
|
49
|
+
this.undescribe();
|
|
50
|
+
this.hide();
|
|
51
|
+
};
|
|
52
|
+
this.show = () => {
|
|
53
|
+
if (this.disabled || !this.content)
|
|
54
|
+
return;
|
|
55
|
+
clearTimeout(this.timer);
|
|
56
|
+
this.timer = setTimeout(() => {
|
|
57
|
+
this.open = true;
|
|
58
|
+
this.updateComplete.then(() => this.position());
|
|
59
|
+
}, this.delay);
|
|
60
|
+
};
|
|
61
|
+
this.hide = () => {
|
|
62
|
+
clearTimeout(this.timer);
|
|
63
|
+
this.open = false;
|
|
64
|
+
};
|
|
65
|
+
// Escape closes it, which matters because a tooltip triggered by
|
|
66
|
+
// keyboard focus otherwise has no way to be dismissed.
|
|
67
|
+
/*
|
|
68
|
+
Leaving the trigger hides AFTER a short grace period, so the pointer
|
|
69
|
+
can cross the gap onto the tooltip itself and stay there (WCAG 1.4.13,
|
|
70
|
+
"hoverable"). Someone zoomed in, or reading slowly, has to be able to
|
|
71
|
+
keep a tooltip up long enough to read it.
|
|
72
|
+
*/
|
|
73
|
+
this.scheduleHide = () => {
|
|
74
|
+
clearTimeout(this.timer);
|
|
75
|
+
this.timer = setTimeout(() => (this.open = false), 120);
|
|
76
|
+
};
|
|
77
|
+
this.keepOpen = () => {
|
|
78
|
+
clearTimeout(this.timer);
|
|
79
|
+
};
|
|
80
|
+
/*
|
|
81
|
+
Escape from ANYWHERE while it is showing (WCAG 1.4.13, "dismissable").
|
|
82
|
+
The listener used to sit on the trigger, so it only heard Escape while
|
|
83
|
+
the trigger had focus; a tooltip shown by hovering could not be
|
|
84
|
+
dismissed from the keyboard at all.
|
|
85
|
+
*/
|
|
86
|
+
this.handleKeydown = (event) => {
|
|
87
|
+
if (event.key !== "Escape" || !this.open)
|
|
88
|
+
return;
|
|
89
|
+
// Consumed, so a dialog around the trigger does not ALSO close: the
|
|
90
|
+
// first Escape dismisses the smallest thing. tt-modal skips an Escape
|
|
91
|
+
// that is already defaultPrevented.
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
this.hide();
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
connectedCallback() {
|
|
97
|
+
super.connectedCallback();
|
|
98
|
+
// Escape while showing; see handleKeydown.
|
|
99
|
+
document.addEventListener("keydown", this.handleKeydown);
|
|
100
|
+
}
|
|
101
|
+
disconnectedCallback() {
|
|
102
|
+
clearTimeout(this.timer);
|
|
103
|
+
document.removeEventListener("keydown", this.handleKeydown);
|
|
104
|
+
this.undescribe();
|
|
105
|
+
super.disconnectedCallback();
|
|
106
|
+
}
|
|
107
|
+
describe(target) {
|
|
108
|
+
this.undescribe();
|
|
109
|
+
if (this.disabled || !this.content)
|
|
110
|
+
return;
|
|
111
|
+
if (target.hasAttribute("aria-description"))
|
|
112
|
+
return;
|
|
113
|
+
target.setAttribute("aria-description", this.content);
|
|
114
|
+
this.described = target;
|
|
115
|
+
}
|
|
116
|
+
undescribe() {
|
|
117
|
+
this.described?.removeAttribute("aria-description");
|
|
118
|
+
this.described = undefined;
|
|
119
|
+
}
|
|
120
|
+
/*
|
|
121
|
+
Rendered in the top layer via popover, so no ancestor's overflow can
|
|
122
|
+
clip it. The top layer sits outside normal flow, so the position has
|
|
123
|
+
to be set from script using the trigger's viewport rectangle.
|
|
124
|
+
*/
|
|
125
|
+
position() {
|
|
126
|
+
const tip = this.tip;
|
|
127
|
+
const anchor = this.anchor;
|
|
128
|
+
if (!tip || !anchor)
|
|
129
|
+
return;
|
|
130
|
+
if (!tip.matches(":popover-open"))
|
|
131
|
+
tip.showPopover();
|
|
132
|
+
const a = anchor.getBoundingClientRect();
|
|
133
|
+
const t = tip.getBoundingClientRect();
|
|
134
|
+
const gap = 8;
|
|
135
|
+
let top = 0;
|
|
136
|
+
let left = 0;
|
|
137
|
+
switch (this.placement) {
|
|
138
|
+
case "bottom":
|
|
139
|
+
top = a.bottom + gap;
|
|
140
|
+
left = a.left + a.width / 2 - t.width / 2;
|
|
141
|
+
break;
|
|
142
|
+
case "left":
|
|
143
|
+
top = a.top + a.height / 2 - t.height / 2;
|
|
144
|
+
left = a.left - t.width - gap;
|
|
145
|
+
break;
|
|
146
|
+
case "right":
|
|
147
|
+
top = a.top + a.height / 2 - t.height / 2;
|
|
148
|
+
left = a.right + gap;
|
|
149
|
+
break;
|
|
150
|
+
default:
|
|
151
|
+
top = a.top - t.height - gap;
|
|
152
|
+
left = a.left + a.width / 2 - t.width / 2;
|
|
153
|
+
}
|
|
154
|
+
// Keep it on screen. A tooltip half off the viewport is worse than
|
|
155
|
+
// one on the wrong side.
|
|
156
|
+
const margin = 8;
|
|
157
|
+
left = Math.max(margin, Math.min(left, window.innerWidth - t.width - margin));
|
|
158
|
+
top = Math.max(margin, Math.min(top, window.innerHeight - t.height - margin));
|
|
159
|
+
tip.style.left = `${left}px`;
|
|
160
|
+
tip.style.top = `${top}px`;
|
|
161
|
+
}
|
|
162
|
+
updated(changed) {
|
|
163
|
+
if (!this.open && this.tip?.matches(":popover-open")) {
|
|
164
|
+
this.tip.hidePopover();
|
|
165
|
+
}
|
|
166
|
+
// New text, or disabled, while focused: keep the description in step.
|
|
167
|
+
if (this.described && (changed.has("content") || changed.has("disabled"))) {
|
|
168
|
+
if (this.disabled || !this.content)
|
|
169
|
+
this.undescribe();
|
|
170
|
+
else
|
|
171
|
+
this.described.setAttribute("aria-description", this.content);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
static { this.styles = css `
|
|
175
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
176
|
+
hidden element would still show. Important, so it always wins. */
|
|
177
|
+
:host([hidden]) {
|
|
178
|
+
display: none !important;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:host {
|
|
182
|
+
display: inline-block;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.anchor {
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.tip {
|
|
190
|
+
position: fixed;
|
|
191
|
+
margin: 0;
|
|
192
|
+
padding: 6px 10px;
|
|
193
|
+
|
|
194
|
+
max-width: 260px;
|
|
195
|
+
|
|
196
|
+
border: none;
|
|
197
|
+
border-radius: var(--tt-radius);
|
|
198
|
+
|
|
199
|
+
background: var(--tt-foreground);
|
|
200
|
+
color: var(--tt-background);
|
|
201
|
+
|
|
202
|
+
font-family: var(--tt-font-sans);
|
|
203
|
+
font-size: var(--tt-text-xs);
|
|
204
|
+
line-height: var(--tt-leading-snug);
|
|
205
|
+
|
|
206
|
+
box-shadow: var(--tt-elevation-2);
|
|
207
|
+
|
|
208
|
+
/* The pointer may rest on it (see scheduleHide). It only exists
|
|
209
|
+
while hovered or focused, so it never sits over a click target
|
|
210
|
+
the user has not already moved away from. */
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* In and out of the top layer, as on tt-dropdown-menu: see the note
|
|
214
|
+
there for why display and overlay ride along. A fade only: it can
|
|
215
|
+
sit on any of four sides, so there is no one direction to come from,
|
|
216
|
+
and a tooltip that slides draws more attention than its text. */
|
|
217
|
+
.tip {
|
|
218
|
+
transition:
|
|
219
|
+
opacity var(--tt-duration-fast) var(--tt-ease-in),
|
|
220
|
+
overlay var(--tt-duration-fast) allow-discrete,
|
|
221
|
+
display var(--tt-duration-fast) allow-discrete;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.tip:popover-open {
|
|
225
|
+
transition-duration: var(--tt-duration-normal);
|
|
226
|
+
transition-timing-function: var(--tt-ease-out);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@starting-style {
|
|
230
|
+
.tip:popover-open {
|
|
231
|
+
opacity: 0;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* Closing: the pointer passes through, so it cannot land on the
|
|
236
|
+
fading tip and hold it open again. */
|
|
237
|
+
.tip:not(:popover-open) {
|
|
238
|
+
display: none;
|
|
239
|
+
opacity: 0;
|
|
240
|
+
pointer-events: none;
|
|
241
|
+
}
|
|
242
|
+
`; }
|
|
243
|
+
render() {
|
|
244
|
+
return html `
|
|
245
|
+
<!--
|
|
246
|
+
Focus and blur as well as pointer events, so a keyboard user gets
|
|
247
|
+
the tooltip too. The focus handlers also hand the text to a screen
|
|
248
|
+
reader; see handleFocusin.
|
|
249
|
+
-->
|
|
250
|
+
<span
|
|
251
|
+
class="anchor"
|
|
252
|
+
part="anchor"
|
|
253
|
+
@mouseenter=${this.show}
|
|
254
|
+
@mouseleave=${this.scheduleHide}
|
|
255
|
+
@focusin=${this.handleFocusin}
|
|
256
|
+
@focusout=${this.handleFocusout}
|
|
257
|
+
>
|
|
258
|
+
<slot></slot>
|
|
259
|
+
</span>
|
|
260
|
+
|
|
261
|
+
<div
|
|
262
|
+
class="tip"
|
|
263
|
+
part="tip"
|
|
264
|
+
role="tooltip"
|
|
265
|
+
popover="manual"
|
|
266
|
+
@mouseenter=${this.keepOpen}
|
|
267
|
+
@mouseleave=${this.scheduleHide}
|
|
268
|
+
>
|
|
269
|
+
${this.content}
|
|
270
|
+
</div>
|
|
271
|
+
`;
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
__decorate([
|
|
275
|
+
property({ type: String })
|
|
276
|
+
], TTTooltip.prototype, "content", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
property({ type: String, reflect: true })
|
|
279
|
+
], TTTooltip.prototype, "placement", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
property({ type: Boolean, reflect: true })
|
|
282
|
+
], TTTooltip.prototype, "disabled", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
property({ type: Number })
|
|
285
|
+
], TTTooltip.prototype, "delay", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
state()
|
|
288
|
+
], TTTooltip.prototype, "open", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
query(".tip")
|
|
291
|
+
], TTTooltip.prototype, "tip", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
query(".anchor")
|
|
294
|
+
], TTTooltip.prototype, "anchor", void 0);
|
|
295
|
+
TTTooltip = __decorate([
|
|
296
|
+
customElement("tt-tooltip")
|
|
297
|
+
], TTTooltip);
|
|
298
|
+
export { TTTooltip };
|
|
299
|
+
//# sourceMappingURL=tt-tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-tooltip.js","sourceRoot":"","sources":["../src/tt-tooltip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI1E;;;;;;GAMG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QACuB,YAAO,GAAG,EAAE,CAAC;QAEE,cAAS,GAAqB,KAAK,CAAC;QAEnC,aAAQ,GAAG,KAAK,CAAC;QAE7D,gEAAgE;QAChE,kBAAkB;QACU,UAAK,GAAG,GAAG,CAAC;QAEvB,SAAI,GAAG,KAAK,CAAC;QAwB9B;;;;;;;;;;;;;;;UAeE;QACM,kBAAa,GAAG,CAAC,KAAiB,EAAE,EAAE;YAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,MAAM,YAAY,OAAO;gBAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACrD,IAAI,CAAC,IAAI,EAAE,CAAC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I,CAAC,cAAc;;;;;;;;;;sBAUjB,IAAI,CAAC,QAAQ;sBACb,IAAI,CAAC,YAAY;;UAE7B,IAAI,CAAC,OAAO;;KAEjB,CAAC;IACJ,CAAC;;AA/R2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAc;AAEE;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAqC;AAEnC;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAkB;AAIjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAa;AAEvB;IAAhB,KAAK,EAAE;uCAAsB;AAEP;IAAtB,KAAK,CAAC,MAAM,CAAC;sCAA2B;AACf;IAAzB,KAAK,CAAC,SAAS,CAAC;yCAA8B;AAdpC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAiSrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,86 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tartaguti/ui-components",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Reusable Lit web components for Tartaguti projects",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lit",
|
|
7
|
+
"web-components",
|
|
8
|
+
"design-system"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": "negilatifi",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/negilatifi/tartaguti-base.git",
|
|
15
|
+
"directory": "packages/ui-components"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"sideEffects": true,
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./tokens.css": "./dist/tokens.css",
|
|
28
|
+
"./sidebar/*": {
|
|
29
|
+
"types": "./dist/sidebar/*.d.ts",
|
|
30
|
+
"default": "./dist/sidebar/*.js"
|
|
31
|
+
},
|
|
32
|
+
"./accordion/*": {
|
|
33
|
+
"types": "./dist/accordion/*.d.ts",
|
|
34
|
+
"default": "./dist/accordion/*.js"
|
|
35
|
+
},
|
|
36
|
+
"./bento/*": {
|
|
37
|
+
"types": "./dist/bento/*.d.ts",
|
|
38
|
+
"default": "./dist/bento/*.js"
|
|
39
|
+
},
|
|
40
|
+
"./*": {
|
|
41
|
+
"types": "./dist/*.d.ts",
|
|
42
|
+
"default": "./dist/*.js"
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"dist",
|
|
51
|
+
"README.md",
|
|
52
|
+
"THIRD-PARTY-NOTICES.md",
|
|
53
|
+
"CHANGELOG.md",
|
|
54
|
+
"custom-elements.json",
|
|
55
|
+
"vscode.html-custom-data.json"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc -p tsconfig.build.json && node scripts/copy-assets.mjs && npm run analyze",
|
|
59
|
+
"prepublishOnly": "npm run build && npm run verify",
|
|
60
|
+
"test": "web-test-runner --config web-test-runner.config.mjs",
|
|
61
|
+
"test:watch": "web-test-runner --config web-test-runner.config.mjs --watch",
|
|
62
|
+
"verify": "node scripts/verify-package.mjs",
|
|
63
|
+
"analyze": "cem analyze --litelement --globs \"src/**/*.ts\" --outdir . && npm run custom-data",
|
|
64
|
+
"custom-data": "node scripts/html-custom-data.mjs",
|
|
65
|
+
"lint:lit": "lit-analyzer \"src/**/*.ts\" --rules.no-invalid-css off"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"lit": "^3.0.0"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"chart.js": "^4.5.1",
|
|
72
|
+
"prismjs": "^1.30.0"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@open-wc/testing": "^5.0.0",
|
|
76
|
+
"@types/mocha": "^10.0.10",
|
|
77
|
+
"@types/prismjs": "^1.26.6",
|
|
78
|
+
"@web/dev-server-esbuild": "^2.0.0",
|
|
79
|
+
"@web/test-runner": "^1.0.0",
|
|
80
|
+
"@web/test-runner-playwright": "^1.0.0",
|
|
81
|
+
"lit": "^3.3.3",
|
|
82
|
+
"typescript": "~6.0.2"
|
|
83
|
+
},
|
|
84
|
+
"//sideEffects": "Never set this to false. Importing a component module is what registers its custom element; tree-shaking would silently remove every component.",
|
|
85
|
+
"customElements": "custom-elements.json"
|
|
86
|
+
}
|