@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
package/dist/tt-page.js
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
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
|
+
let TTPage = class TTPage extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
// Named `heading` rather than `title` so it cannot collide with the
|
|
13
|
+
// global HTML title attribute (which renders a native tooltip).
|
|
14
|
+
this.heading = "";
|
|
15
|
+
this.description = "";
|
|
16
|
+
// How wide the content column may grow. Documentation wants a narrow,
|
|
17
|
+
// readable measure; an app dashboard usually wants the full width.
|
|
18
|
+
// Reflected so the :host([width=...]) rules below can match.
|
|
19
|
+
this.width = "default";
|
|
20
|
+
}
|
|
21
|
+
static { this.styles = css `
|
|
22
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
23
|
+
hidden element would still show. Important, so it always wins. */
|
|
24
|
+
:host([hidden]) {
|
|
25
|
+
display: none !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host {
|
|
29
|
+
display: block;
|
|
30
|
+
|
|
31
|
+
/* One variable drives the column; each width overrides just this. */
|
|
32
|
+
--_max: 1000px;
|
|
33
|
+
|
|
34
|
+
font-family: var(--tt-font-sans);
|
|
35
|
+
|
|
36
|
+
-webkit-font-smoothing: antialiased;
|
|
37
|
+
text-rendering: optimizeLegibility;
|
|
38
|
+
|
|
39
|
+
color: var(--tt-foreground);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Reading measure, for prose and documentation. */
|
|
43
|
+
:host([width="narrow"]) {
|
|
44
|
+
--_max: 720px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([width="wide"]) {
|
|
48
|
+
--_max: 1400px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Edge to edge: dashboards, tables, anything data-dense. */
|
|
52
|
+
:host([width="full"]) {
|
|
53
|
+
--_max: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.page {
|
|
57
|
+
max-width: var(--_max);
|
|
58
|
+
margin: 0 auto;
|
|
59
|
+
padding: var(--tt-space-12) var(--tt-space-8);
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
h1 {
|
|
64
|
+
margin: 0;
|
|
65
|
+
|
|
66
|
+
font-family: var(--tt-font-display);
|
|
67
|
+
font-size: var(--tt-text-3xl);
|
|
68
|
+
font-weight: var(--tt-weight-bold);
|
|
69
|
+
line-height: var(--tt-leading-tight);
|
|
70
|
+
letter-spacing: -0.02em;
|
|
71
|
+
|
|
72
|
+
color: var(--tt-foreground);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
p {
|
|
76
|
+
margin: var(--tt-space-2) 0 0;
|
|
77
|
+
max-width: 62ch;
|
|
78
|
+
|
|
79
|
+
color: var(--tt-muted-foreground);
|
|
80
|
+
|
|
81
|
+
font-size: var(--tt-text-md);
|
|
82
|
+
line-height: var(--tt-leading-relaxed);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
The page owns the spacing between its children. Children never set
|
|
87
|
+
their own outer margins, so any mix of sections, grids and tables
|
|
88
|
+
spaces evenly without knowing about each other.
|
|
89
|
+
*/
|
|
90
|
+
.content {
|
|
91
|
+
margin-top: var(--tt-space-10);
|
|
92
|
+
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
gap: var(--tt-space-10);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (max-width: 768px) {
|
|
99
|
+
.page {
|
|
100
|
+
padding: var(--tt-space-8) var(--tt-space-5);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
h1 {
|
|
104
|
+
font-size: var(--tt-text-2xl);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.content {
|
|
108
|
+
margin-top: var(--tt-space-8);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@media (max-width: 480px) {
|
|
113
|
+
.page {
|
|
114
|
+
/*
|
|
115
|
+
space-3 horizontally, matching --tt-bento-gap.
|
|
116
|
+
|
|
117
|
+
The inset around a grid should equal the gutter inside it, or the
|
|
118
|
+
first tile reads as further from the screen edge than it is from
|
|
119
|
+
its neighbour and the whole block looks off-centre. On a phone
|
|
120
|
+
this is the difference between a mosaic and a list of boxes with
|
|
121
|
+
a margin.
|
|
122
|
+
|
|
123
|
+
It is also simply more screen: 12px a side on a 390px phone is
|
|
124
|
+
worth about 10% of the width back.
|
|
125
|
+
*/
|
|
126
|
+
padding: var(--tt-space-6) var(--tt-space-3);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
h1 {
|
|
130
|
+
font-size: var(--tt-text-xl);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`; }
|
|
134
|
+
render() {
|
|
135
|
+
return html `
|
|
136
|
+
<div class="page" part="page">
|
|
137
|
+
<h1 part="heading">${this.heading}</h1>
|
|
138
|
+
|
|
139
|
+
${this.description
|
|
140
|
+
? html `<p part="description">${this.description}</p>`
|
|
141
|
+
: ""}
|
|
142
|
+
|
|
143
|
+
<div class="content" part="content">
|
|
144
|
+
<slot></slot>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
`;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
__decorate([
|
|
151
|
+
property({ type: String })
|
|
152
|
+
], TTPage.prototype, "heading", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
property({ type: String })
|
|
155
|
+
], TTPage.prototype, "description", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
property({ type: String, reflect: true })
|
|
158
|
+
], TTPage.prototype, "width", void 0);
|
|
159
|
+
TTPage = __decorate([
|
|
160
|
+
customElement("tt-page")
|
|
161
|
+
], TTPage);
|
|
162
|
+
export { TTPage };
|
|
163
|
+
//# sourceMappingURL=tt-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-page.js","sourceRoot":"","sources":["../src/tt-page.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;AAGrD,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QACL,oEAAoE;QACpE,gEAAgE;QAEhE,YAAO,GAAG,EAAE,CAAC;QAGb,gBAAW,GAAG,EAAE,CAAC;QAEjB,sEAAsE;QACtE,mEAAmE;QACnE,6DAA6D;QAE7D,UAAK,GAA2C,SAAS,CAAC;IAmI5D,CAAC;aAjIQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHlB,AAhHY,CAgHX;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA;;6BAEc,IAAI,CAAC,OAAO;;UAE/B,IAAI,CAAC,WAAW;YAChB,CAAC,CAAC,IAAI,CAAA,yBAAyB,IAAI,CAAC,WAAW,MAAM;YACrD,CAAC,CAAC,EAAE;;;;;;KAMT,CAAC;IACJ,CAAC;;AA3ID;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACV;AAMjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCACgB;AAb/C,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAgJlB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./tt-button.js";
|
|
3
|
+
import "./tt-icon.js";
|
|
4
|
+
/**
|
|
5
|
+
* Page navigation. Owns nothing: the current page comes in, and a click
|
|
6
|
+
* emits the page you asked for. The parent decides what that means and
|
|
7
|
+
* passes the new page back down.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TTPagination extends LitElement {
|
|
10
|
+
page: number;
|
|
11
|
+
total: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
siblings: number;
|
|
14
|
+
private get pageCount();
|
|
15
|
+
private get current();
|
|
16
|
+
private get pages();
|
|
17
|
+
private go;
|
|
18
|
+
private get range();
|
|
19
|
+
static styles: import("lit").CSSResult;
|
|
20
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
"tt-pagination": TTPagination;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=tt-pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-pagination.d.ts","sourceRoot":"","sources":["../src/tt-pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AAEtB;;;;GAIG;AACH,qBACa,YAAa,SAAQ,UAAU;IACd,IAAI,SAAK;IAET,KAAK,SAAK;IAEc,QAAQ,SAAM;IAItC,QAAQ,SAAK;IAIzC,OAAO,KAAK,SAAS,GAEpB;IAED,OAAO,KAAK,OAAO,GAIlB;IAQD,OAAO,KAAK,KAAK,GAwBhB;IAED,OAAO,CAAC,EAAE;IAYV,OAAO,KAAK,KAAK,GAIhB;IAED,MAAM,CAAC,MAAM,0BAkDX;IAEF,MAAM;CAqDP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -0,0 +1,194 @@
|
|
|
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
|
+
import "./tt-button.js";
|
|
10
|
+
import "./tt-icon.js";
|
|
11
|
+
/**
|
|
12
|
+
* Page navigation. Owns nothing: the current page comes in, and a click
|
|
13
|
+
* emits the page you asked for. The parent decides what that means and
|
|
14
|
+
* passes the new page back down.
|
|
15
|
+
*/
|
|
16
|
+
let TTPagination = class TTPagination extends LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.page = 1;
|
|
20
|
+
this.total = 0;
|
|
21
|
+
this.pageSize = 10;
|
|
22
|
+
// How many numbered buttons to show around the current page before
|
|
23
|
+
// collapsing the rest into an ellipsis.
|
|
24
|
+
this.siblings = 1;
|
|
25
|
+
}
|
|
26
|
+
// Derived, never stored: total pages is a function of two properties
|
|
27
|
+
// that already exist, so it cannot go stale.
|
|
28
|
+
get pageCount() {
|
|
29
|
+
return Math.max(1, Math.ceil(this.total / this.pageSize));
|
|
30
|
+
}
|
|
31
|
+
get current() {
|
|
32
|
+
// Clamp, so a page number left over from a longer list cannot point
|
|
33
|
+
// past the end after the results shrink.
|
|
34
|
+
return Math.min(Math.max(1, this.page), this.pageCount);
|
|
35
|
+
}
|
|
36
|
+
/*
|
|
37
|
+
Which numbers to show. Always the first and last page, plus a window
|
|
38
|
+
around the current one, with -1 standing in for an ellipsis.
|
|
39
|
+
|
|
40
|
+
1 ... 4 [5] 6 ... 20
|
|
41
|
+
*/
|
|
42
|
+
get pages() {
|
|
43
|
+
const count = this.pageCount;
|
|
44
|
+
const current = this.current;
|
|
45
|
+
const span = this.siblings;
|
|
46
|
+
// Few enough to show them all.
|
|
47
|
+
if (count <= span * 2 + 5) {
|
|
48
|
+
return Array.from({ length: count }, (_, i) => i + 1);
|
|
49
|
+
}
|
|
50
|
+
const result = [1];
|
|
51
|
+
const start = Math.max(2, current - span);
|
|
52
|
+
const end = Math.min(count - 1, current + span);
|
|
53
|
+
if (start > 2)
|
|
54
|
+
result.push(-1);
|
|
55
|
+
for (let i = start; i <= end; i++)
|
|
56
|
+
result.push(i);
|
|
57
|
+
if (end < count - 1)
|
|
58
|
+
result.push(-1);
|
|
59
|
+
result.push(count);
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
go(page) {
|
|
63
|
+
if (page === this.current || page < 1 || page > this.pageCount)
|
|
64
|
+
return;
|
|
65
|
+
this.dispatchEvent(new CustomEvent("tt-page-change", {
|
|
66
|
+
detail: { page },
|
|
67
|
+
bubbles: true,
|
|
68
|
+
composed: true,
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
get range() {
|
|
72
|
+
const from = (this.current - 1) * this.pageSize + 1;
|
|
73
|
+
const to = Math.min(this.current * this.pageSize, this.total);
|
|
74
|
+
return { from, to };
|
|
75
|
+
}
|
|
76
|
+
static { this.styles = css `
|
|
77
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
78
|
+
hidden element would still show. Important, so it always wins. */
|
|
79
|
+
:host([hidden]) {
|
|
80
|
+
display: none !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host {
|
|
84
|
+
display: block;
|
|
85
|
+
font-family: var(--tt-font-sans);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.bar {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: space-between;
|
|
92
|
+
flex-wrap: wrap;
|
|
93
|
+
gap: var(--tt-space-3);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.summary {
|
|
97
|
+
font-size: var(--tt-text-sm);
|
|
98
|
+
color: var(--tt-muted-foreground);
|
|
99
|
+
font-variant-numeric: tabular-nums;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
Wraps, so the row fits any container. A middle page draws the most
|
|
104
|
+
buttons (previous, 1, ..., 9, 10, 11, ..., 20, next), and at touch
|
|
105
|
+
size that row is wider than a phone. Without wrap its min-content
|
|
106
|
+
width was the whole row, so it could only stick out.
|
|
107
|
+
*/
|
|
108
|
+
.pages {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-wrap: wrap;
|
|
111
|
+
align-items: center;
|
|
112
|
+
gap: var(--tt-space-1);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ellipsis {
|
|
116
|
+
padding: 0 var(--tt-space-1);
|
|
117
|
+
color: var(--tt-muted-foreground);
|
|
118
|
+
user-select: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Square at minimum, from the same token as the button's height, so
|
|
122
|
+
the number buttons grow with the touch and density modes too. */
|
|
123
|
+
tt-button {
|
|
124
|
+
min-width: var(--tt-control-sm);
|
|
125
|
+
}
|
|
126
|
+
`; }
|
|
127
|
+
render() {
|
|
128
|
+
// One page of results needs no controls at all.
|
|
129
|
+
if (this.pageCount <= 1)
|
|
130
|
+
return html ``;
|
|
131
|
+
const current = this.current;
|
|
132
|
+
const { from, to } = this.range;
|
|
133
|
+
return html `
|
|
134
|
+
<nav class="bar" part="bar" aria-label="Pagination">
|
|
135
|
+
<span class="summary">
|
|
136
|
+
${from}-${to} of ${this.total}
|
|
137
|
+
</span>
|
|
138
|
+
|
|
139
|
+
<div class="pages">
|
|
140
|
+
<tt-button
|
|
141
|
+
variant="secondary"
|
|
142
|
+
size="small"
|
|
143
|
+
?disabled=${current === 1}
|
|
144
|
+
label="Previous page"
|
|
145
|
+
@tt-button-click=${() => this.go(current - 1)}
|
|
146
|
+
>
|
|
147
|
+
<tt-icon name="chevron-left" size="16px"></tt-icon>
|
|
148
|
+
</tt-button>
|
|
149
|
+
|
|
150
|
+
${this.pages.map((page) => page === -1
|
|
151
|
+
? html `<span class="ellipsis" aria-hidden="true">…</span>`
|
|
152
|
+
: html `
|
|
153
|
+
<tt-button
|
|
154
|
+
variant=${page === current ? "primary" : "secondary"}
|
|
155
|
+
size="small"
|
|
156
|
+
label=${`Page ${page}`}
|
|
157
|
+
current=${page === current ? "page" : ""}
|
|
158
|
+
@tt-button-click=${() => this.go(page)}
|
|
159
|
+
>
|
|
160
|
+
${page}
|
|
161
|
+
</tt-button>
|
|
162
|
+
`)}
|
|
163
|
+
|
|
164
|
+
<tt-button
|
|
165
|
+
variant="secondary"
|
|
166
|
+
size="small"
|
|
167
|
+
?disabled=${current === this.pageCount}
|
|
168
|
+
label="Next page"
|
|
169
|
+
@tt-button-click=${() => this.go(current + 1)}
|
|
170
|
+
>
|
|
171
|
+
<tt-icon name="chevron-right" size="16px"></tt-icon>
|
|
172
|
+
</tt-button>
|
|
173
|
+
</div>
|
|
174
|
+
</nav>
|
|
175
|
+
`;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
__decorate([
|
|
179
|
+
property({ type: Number })
|
|
180
|
+
], TTPagination.prototype, "page", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
property({ type: Number })
|
|
183
|
+
], TTPagination.prototype, "total", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
property({ type: Number, attribute: "page-size" })
|
|
186
|
+
], TTPagination.prototype, "pageSize", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
property({ type: Number })
|
|
189
|
+
], TTPagination.prototype, "siblings", void 0);
|
|
190
|
+
TTPagination = __decorate([
|
|
191
|
+
customElement("tt-pagination")
|
|
192
|
+
], TTPagination);
|
|
193
|
+
export { TTPagination };
|
|
194
|
+
//# sourceMappingURL=tt-pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-pagination.js","sourceRoot":"","sources":["../src/tt-pagination.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class TTPreview extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"tt-preview": TTPreview;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=tt-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-preview.d.ts","sourceRoot":"","sources":["../src/tt-preview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,qBACa,SAAU,SAAQ,UAAU;IACvC,MAAM,CAAC,MAAM,0BA6CX;IAEF,MAAM;CAOP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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 } from "lit/decorators.js";
|
|
9
|
+
let TTPreview = class TTPreview extends LitElement {
|
|
10
|
+
static { this.styles = css `
|
|
11
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
12
|
+
hidden element would still show. Important, so it always wins. */
|
|
13
|
+
:host([hidden]) {
|
|
14
|
+
display: none !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host {
|
|
18
|
+
display: block;
|
|
19
|
+
|
|
20
|
+
/* Private alias - derived from the theme so the dot grid follows
|
|
21
|
+
light/dark automatically. */
|
|
22
|
+
--_dot: color-mix(in srgb, var(--tt-foreground) 8%, transparent);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.preview {
|
|
26
|
+
min-height: 140px;
|
|
27
|
+
max-height: 500px;
|
|
28
|
+
overflow: auto;
|
|
29
|
+
|
|
30
|
+
width: 100%;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
|
|
33
|
+
border: 1px solid var(--tt-border);
|
|
34
|
+
border-radius: var(--tt-radius-lg);
|
|
35
|
+
|
|
36
|
+
background-color: var(--tt-card);
|
|
37
|
+
background-image: radial-gradient(var(--_dot) 1px, transparent 1px);
|
|
38
|
+
background-size: 16px 16px;
|
|
39
|
+
background-position: -8px -8px;
|
|
40
|
+
|
|
41
|
+
padding: var(--tt-space-8);
|
|
42
|
+
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
gap: var(--tt-space-3);
|
|
47
|
+
flex-wrap: wrap;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (max-width: 480px) {
|
|
51
|
+
.preview {
|
|
52
|
+
padding: var(--tt-space-5);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`; }
|
|
56
|
+
render() {
|
|
57
|
+
return html `
|
|
58
|
+
<div class="preview" part="preview">
|
|
59
|
+
<slot></slot>
|
|
60
|
+
</div>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
TTPreview = __decorate([
|
|
65
|
+
customElement("tt-preview")
|
|
66
|
+
], TTPreview);
|
|
67
|
+
export { TTPreview };
|
|
68
|
+
//# sourceMappingURL=tt-preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-preview.js","sourceRoot":"","sources":["../src/tt-preview.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG3C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;aAChC,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6ClB,AA7CY,CA6CX;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA;;;;KAIV,CAAC;IACJ,CAAC;;AAtDU,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAuDrB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./tt-card.js";
|
|
3
|
+
import "./tt-image.js";
|
|
4
|
+
import "./tt-button.js";
|
|
5
|
+
import "./tt-icon.js";
|
|
6
|
+
export type ProductOrientation = "vertical" | "horizontal";
|
|
7
|
+
export type ProductVariant = "default" | "minimal" | "elevated" | "featured";
|
|
8
|
+
export type ProductLayout = "standard" | "overlay" | "compact";
|
|
9
|
+
export declare class TTProduct extends LitElement {
|
|
10
|
+
src: string;
|
|
11
|
+
ratio: string;
|
|
12
|
+
orientation: ProductOrientation;
|
|
13
|
+
variant: ProductVariant;
|
|
14
|
+
layout: ProductLayout;
|
|
15
|
+
heading: string;
|
|
16
|
+
description: string;
|
|
17
|
+
descriptionLines: number;
|
|
18
|
+
price: string;
|
|
19
|
+
wasPrice: string;
|
|
20
|
+
rating: string;
|
|
21
|
+
value: string;
|
|
22
|
+
buttonLink: string;
|
|
23
|
+
buttonLabel: string;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
private handleClick;
|
|
26
|
+
static styles: import("lit").CSSResult[];
|
|
27
|
+
private renderMedia;
|
|
28
|
+
private renderRating;
|
|
29
|
+
private renderBody;
|
|
30
|
+
private get actionName();
|
|
31
|
+
private renderQuickAdd;
|
|
32
|
+
private renderButton;
|
|
33
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
"tt-product": TTProduct;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=tt-product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-product.d.ts","sourceRoot":"","sources":["../src/tt-product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAQrD,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,YAAY,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAC7E,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/D,qBACa,SAAU,SAAQ,UAAU;IACX,GAAG,SAAM;IACT,KAAK,SAAO;IAGxC,WAAW,EAAE,kBAAkB,CAAc;IAG7C,OAAO,EAAE,cAAc,CAAa;IAGpC,MAAM,EAAE,aAAa,CAAc;IAEP,OAAO,SAAM;IACb,WAAW,SAAM;IACe,gBAAgB,SAAK;IAErD,KAAK,SAAM;IACa,QAAQ,SAAM;IACtC,MAAM,SAAM;IAEZ,KAAK,SAAM;IACe,UAAU,SAAM;IACf,WAAW,SAAmB;IAEzC,QAAQ,UAAS;IAE7D,OAAO,CAAC,WAAW;IAcnB,MAAM,CAAC,MAAM,4BA4WV;IAEH,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,UAAU;IA8ClB,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,YAAY;IAcpB,MAAM;CAyBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|