@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,539 @@
|
|
|
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, nothing } from "lit";
|
|
8
|
+
import { property, state, customElement } from "lit/decorators.js";
|
|
9
|
+
import "../tt-icon.js";
|
|
10
|
+
/**
|
|
11
|
+
* The navigation column of an app shell.
|
|
12
|
+
*
|
|
13
|
+
* ---------------------------------------------------------------------
|
|
14
|
+
* HOW COLLAPSING WORKS, AND WHY IT NEEDS NO PROPS.
|
|
15
|
+
*
|
|
16
|
+
* With `collapsible`, the sidebar can shrink to an icon rail. Everything
|
|
17
|
+
* inside it has to change at once: labels disappear, rows centre, group
|
|
18
|
+
* headings go, badges go, the indent goes. Passing that down would mean a
|
|
19
|
+
* `collapsed` prop on every child, kept in sync by hand, at every depth.
|
|
20
|
+
*
|
|
21
|
+
* Instead the collapsed state is published as ordinary CSS custom
|
|
22
|
+
* properties on the host, and each child reads the ones it cares about
|
|
23
|
+
* through var() with the expanded value as the fallback:
|
|
24
|
+
*
|
|
25
|
+
* --tt-menu-label-cols 1fr -> 0fr label track collapses
|
|
26
|
+
* --tt-menu-gap sp-2 -> 0px no gap beside nothing
|
|
27
|
+
* --tt-menu-justify start-> center icons centre in the rail
|
|
28
|
+
* --tt-menu-trail-display flex -> none badges and dots go
|
|
29
|
+
* --tt-menu-heading-display flex -> none group headings go
|
|
30
|
+
* --tt-menu-rail-rows unset-> 1fr every group forced open
|
|
31
|
+
* --tt-menu-rail-visibility unset-> visible ...and its items reachable
|
|
32
|
+
* --tt-menu-indent sp-2 -> 0px no nesting indent
|
|
33
|
+
*
|
|
34
|
+
* Custom properties inherit and they cross shadow boundaries, so this
|
|
35
|
+
* reaches a menu item nested three groups deep with no wiring, and a menu
|
|
36
|
+
* item used outside a sidebar simply gets the fallbacks. Same mechanism
|
|
37
|
+
* as --tt-radius-nested in tokens.css.
|
|
38
|
+
*
|
|
39
|
+
* They are declared in the stylesheet under :host([collapsed]) rather
|
|
40
|
+
* than written from JavaScript, and that matters: a media query can
|
|
41
|
+
* override a stylesheet rule, and cannot override an inline style. It is
|
|
42
|
+
* what lets the block at the bottom of this file switch the whole rail
|
|
43
|
+
* off on a phone, where the sidebar is a drawer and a rail would be an
|
|
44
|
+
* unusable 64px strip sliding over the page.
|
|
45
|
+
*
|
|
46
|
+
* ---------------------------------------------------------------------
|
|
47
|
+
* WHO OWNS `collapsed`.
|
|
48
|
+
*
|
|
49
|
+
* The component toggles itself and announces it with tt-sidebar-toggle,
|
|
50
|
+
* the same shape tt-menu-group uses for open/close. An app that wants to
|
|
51
|
+
* remember the choice listens for the event and writes the property back;
|
|
52
|
+
* one that does not gets working behaviour for free.
|
|
53
|
+
*/
|
|
54
|
+
let TTSidebar = class TTSidebar extends LitElement {
|
|
55
|
+
constructor() {
|
|
56
|
+
super(...arguments);
|
|
57
|
+
this.variant = "default";
|
|
58
|
+
this.width = 240;
|
|
59
|
+
// The width of the icon rail when collapsed.
|
|
60
|
+
this.railWidth = 64;
|
|
61
|
+
// Shows the collapse control. Without it the sidebar cannot be shrunk.
|
|
62
|
+
this.collapsible = false;
|
|
63
|
+
this.collapsed = false;
|
|
64
|
+
/*
|
|
65
|
+
The name of the navigation landmark. A screen reader lists landmarks,
|
|
66
|
+
and "navigation" repeated twice on a page with a navbar tells the
|
|
67
|
+
listener nothing about which is which.
|
|
68
|
+
*/
|
|
69
|
+
this.label = "Main";
|
|
70
|
+
this.collapseLabel = "Collapse sidebar";
|
|
71
|
+
this.expandLabel = "Expand sidebar";
|
|
72
|
+
this.hasHeader = false;
|
|
73
|
+
this.hasFooter = false;
|
|
74
|
+
}
|
|
75
|
+
/** Flips the rail open or shut, and announces it. */
|
|
76
|
+
toggle() {
|
|
77
|
+
this.collapsed = !this.collapsed;
|
|
78
|
+
this.dispatchEvent(new CustomEvent("tt-sidebar-toggle", {
|
|
79
|
+
detail: { collapsed: this.collapsed },
|
|
80
|
+
bubbles: true,
|
|
81
|
+
composed: true,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
willUpdate(changed) {
|
|
85
|
+
if (changed.has("width")) {
|
|
86
|
+
this.style.setProperty("--tt-sidebar-width", `${this.width}px`);
|
|
87
|
+
}
|
|
88
|
+
if (changed.has("railWidth")) {
|
|
89
|
+
this.style.setProperty("--tt-sidebar-rail-width", `${this.railWidth}px`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
updateSlot(prop, event) {
|
|
93
|
+
const slot = event.target;
|
|
94
|
+
this[prop] = slot
|
|
95
|
+
.assignedNodes({ flatten: true })
|
|
96
|
+
.some((node) => node.nodeType === Node.ELEMENT_NODE ||
|
|
97
|
+
(node.textContent ?? "").trim() !== "");
|
|
98
|
+
}
|
|
99
|
+
static { this.styles = css `
|
|
100
|
+
/* The browser's own [hidden] rule loses to any :host display, so a
|
|
101
|
+
hidden element would still show. Important, so it always wins. */
|
|
102
|
+
:host([hidden]) {
|
|
103
|
+
display: none !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host {
|
|
107
|
+
display: block;
|
|
108
|
+
|
|
109
|
+
width: var(--tt-sidebar-width, 240px);
|
|
110
|
+
max-width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
|
|
115
|
+
font-family: var(--tt-font-sans);
|
|
116
|
+
-webkit-font-smoothing: antialiased;
|
|
117
|
+
|
|
118
|
+
color: var(--tt-sidebar-foreground);
|
|
119
|
+
|
|
120
|
+
/* The one animation the shell itself performs. Everything inside
|
|
121
|
+
reacts to the width rather than being animated separately, which
|
|
122
|
+
is why they all land together. */
|
|
123
|
+
transition: width var(--tt-duration-normal) var(--tt-ease-out);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ---- the collapsed channel ----
|
|
127
|
+
|
|
128
|
+
See the note at the top of this file. Values here, fallbacks in the
|
|
129
|
+
children, so nothing has to be told anything. */
|
|
130
|
+
|
|
131
|
+
:host([collapsed]) {
|
|
132
|
+
width: var(--tt-sidebar-rail-width, 64px);
|
|
133
|
+
|
|
134
|
+
--tt-menu-label-cols: 0fr;
|
|
135
|
+
--tt-menu-gap: 0px;
|
|
136
|
+
--tt-menu-justify: center;
|
|
137
|
+
--tt-menu-trail-display: none;
|
|
138
|
+
--tt-menu-heading-display: none;
|
|
139
|
+
--tt-menu-rail-rows: 1fr;
|
|
140
|
+
--tt-menu-rail-visibility: visible;
|
|
141
|
+
--tt-menu-indent: 0px;
|
|
142
|
+
|
|
143
|
+
/* The arrow has nothing to sit beside any more. */
|
|
144
|
+
--tt-rail-justify: center;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
nav {
|
|
148
|
+
width: 100%;
|
|
149
|
+
max-width: 100%;
|
|
150
|
+
height: 100%;
|
|
151
|
+
box-sizing: border-box;
|
|
152
|
+
|
|
153
|
+
background: var(--tt-sidebar);
|
|
154
|
+
color: var(--tt-sidebar-foreground);
|
|
155
|
+
|
|
156
|
+
border: 1px solid var(--tt-sidebar-border);
|
|
157
|
+
border-radius: var(--tt-radius);
|
|
158
|
+
|
|
159
|
+
padding: var(--tt-space-4);
|
|
160
|
+
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
gap: var(--tt-space-4);
|
|
164
|
+
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
|
|
167
|
+
transition:
|
|
168
|
+
padding var(--tt-duration-normal) var(--tt-ease-out),
|
|
169
|
+
box-shadow var(--tt-duration-normal) var(--tt-ease-out);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/*
|
|
173
|
+
THE PANEL ANIMATES. THE TEXT DOES NOT.
|
|
174
|
+
|
|
175
|
+
Nothing inside a menu item transitions its label any more, so a word
|
|
176
|
+
is either there or it is not. That is the whole behaviour, and this
|
|
177
|
+
one rule is what makes it look right.
|
|
178
|
+
|
|
179
|
+
Without it, opening would re-lay-out every row at every width
|
|
180
|
+
between 64px and 240px, and a label that is present the whole time
|
|
181
|
+
has to ellipsis its way in: D..., Dash..., Dashboa..., Dashboard.
|
|
182
|
+
Same chewing as before, just at full opacity.
|
|
183
|
+
|
|
184
|
+
So while a collapsible sidebar is open, the content is pinned to the
|
|
185
|
+
width it will end at, and the host's overflow:hidden clips it. The
|
|
186
|
+
text is laid out ONCE, at its real size, and the panel slides off it
|
|
187
|
+
rather than squeezing it.
|
|
188
|
+
|
|
189
|
+
Only on a collapsible sidebar, and only while it is open, so a
|
|
190
|
+
sidebar in a container narrower than its own width is unaffected.
|
|
191
|
+
*/
|
|
192
|
+
:host([collapsible]:not([collapsed])) nav {
|
|
193
|
+
min-width: var(--tt-sidebar-width, 240px);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* A rail is mostly padding if it keeps the full gutter, and the icons
|
|
197
|
+
stop looking centred. */
|
|
198
|
+
:host([collapsed]) nav {
|
|
199
|
+
padding: var(--tt-space-4) var(--tt-space-2);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.borderless {
|
|
203
|
+
border: none;
|
|
204
|
+
border-radius: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/*
|
|
208
|
+
Floating: the column reads as a card sitting ON the page rather than
|
|
209
|
+
as a wall beside it. Useful when the shell has a coloured background
|
|
210
|
+
worth seeing around the navigation.
|
|
211
|
+
*/
|
|
212
|
+
.floating {
|
|
213
|
+
/* The inset is what makes it float. Without a gap on all four
|
|
214
|
+
sides it is still a wall, just a rounded one. The height and
|
|
215
|
+
width are reduced by the same amount so the margin does not
|
|
216
|
+
push the column past the shell. */
|
|
217
|
+
margin: var(--tt-space-2);
|
|
218
|
+
width: calc(100% - var(--tt-space-4));
|
|
219
|
+
height: calc(100% - var(--tt-space-4));
|
|
220
|
+
|
|
221
|
+
border-radius: var(--tt-radius-xl);
|
|
222
|
+
|
|
223
|
+
/* Level 1: a sidebar sits on the page, it does not hover over it
|
|
224
|
+
the way a modal does. See the elevation table in tokens.css. */
|
|
225
|
+
box-shadow: var(--tt-elevation-1);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.header {
|
|
229
|
+
padding-bottom: var(--tt-space-3);
|
|
230
|
+
border-bottom: 1px solid var(--tt-sidebar-border);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.content {
|
|
234
|
+
flex: 1;
|
|
235
|
+
min-height: 0;
|
|
236
|
+
|
|
237
|
+
display: flex;
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
gap: var(--tt-space-1);
|
|
240
|
+
|
|
241
|
+
overflow-y: auto;
|
|
242
|
+
|
|
243
|
+
/* A rail is narrower than a scrollbar is wide in some browsers, and
|
|
244
|
+
a horizontal bar appearing under a column of icons looks broken. */
|
|
245
|
+
overflow-x: hidden;
|
|
246
|
+
|
|
247
|
+
/* Invisible at rest, there when you reach for it.
|
|
248
|
+
|
|
249
|
+
A navigation list is read, not scrubbed, so a permanent grey bar
|
|
250
|
+
down the side is decoration that competes with the items. But
|
|
251
|
+
the list CAN overflow, so the scroller has to stay real: this
|
|
252
|
+
hides the thumb rather than removing the scrollbar.
|
|
253
|
+
|
|
254
|
+
The track keeps its width in both states. Toggling
|
|
255
|
+
scrollbar-width instead would reflow every row by 6px the moment
|
|
256
|
+
the pointer entered the column, which is a worse problem than
|
|
257
|
+
the one being solved. */
|
|
258
|
+
scrollbar-width: thin;
|
|
259
|
+
scrollbar-color: transparent transparent;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:host(:hover) .content,
|
|
263
|
+
.content:focus-within {
|
|
264
|
+
scrollbar-color: color-mix(
|
|
265
|
+
in oklab,
|
|
266
|
+
var(--tt-sidebar-foreground) 25%,
|
|
267
|
+
transparent
|
|
268
|
+
)
|
|
269
|
+
transparent;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.content::-webkit-scrollbar {
|
|
273
|
+
width: 6px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.content::-webkit-scrollbar-thumb {
|
|
277
|
+
background: transparent;
|
|
278
|
+
border-radius: var(--tt-radius-full);
|
|
279
|
+
|
|
280
|
+
transition: background var(--tt-duration-fast) var(--tt-ease-out);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
:host(:hover) .content::-webkit-scrollbar-thumb,
|
|
284
|
+
.content:focus-within::-webkit-scrollbar-thumb {
|
|
285
|
+
background: color-mix(
|
|
286
|
+
in oklab,
|
|
287
|
+
var(--tt-sidebar-foreground) 22%,
|
|
288
|
+
transparent
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.content::-webkit-scrollbar-track {
|
|
293
|
+
background: transparent;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.footer {
|
|
297
|
+
padding-top: var(--tt-space-3);
|
|
298
|
+
border-top: 1px solid var(--tt-sidebar-border);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* ---- the collapse control ----
|
|
302
|
+
|
|
303
|
+
An arrow, not a labelled row. A full-width "Collapse sidebar"
|
|
304
|
+
button read as a navigation destination, which is exactly what it
|
|
305
|
+
is not: it changes how the sidebar is drawn, it does not take you
|
|
306
|
+
anywhere. Something that small and that permanent should be a
|
|
307
|
+
handle, and a handle carries its meaning in its shape.
|
|
308
|
+
|
|
309
|
+
It sits in FLOW at the bottom rather than floating on the trailing
|
|
310
|
+
edge. An absolutely positioned handle looks better right up until
|
|
311
|
+
the rail, where 26px of button lands on top of a 64px column of
|
|
312
|
+
icons. In flow it can never overlap anything at either width. */
|
|
313
|
+
|
|
314
|
+
.rail-row {
|
|
315
|
+
display: flex;
|
|
316
|
+
justify-content: var(--tt-rail-justify, flex-end);
|
|
317
|
+
|
|
318
|
+
flex-shrink: 0;
|
|
319
|
+
padding: 0 var(--tt-space-1);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.rail {
|
|
323
|
+
display: flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
justify-content: center;
|
|
326
|
+
|
|
327
|
+
width: 26px;
|
|
328
|
+
height: 26px;
|
|
329
|
+
padding: 0;
|
|
330
|
+
|
|
331
|
+
border: 1px solid transparent;
|
|
332
|
+
border-radius: var(--tt-radius-full);
|
|
333
|
+
background: transparent;
|
|
334
|
+
|
|
335
|
+
color: var(--tt-muted-foreground);
|
|
336
|
+
cursor: pointer;
|
|
337
|
+
|
|
338
|
+
/* Out of the way until wanted. The sidebar is read far more often
|
|
339
|
+
than it is resized. */
|
|
340
|
+
opacity: 0;
|
|
341
|
+
|
|
342
|
+
transition:
|
|
343
|
+
opacity var(--tt-duration-fast) var(--tt-ease-out),
|
|
344
|
+
background var(--tt-duration-fast) var(--tt-ease-out),
|
|
345
|
+
border-color var(--tt-duration-fast) var(--tt-ease-out),
|
|
346
|
+
color var(--tt-duration-fast) var(--tt-ease-out);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/*
|
|
350
|
+
Three ways in, because hover alone is not a way in for everyone.
|
|
351
|
+
Collapsed is unconditional: once the labels are gone this button is
|
|
352
|
+
the only route back, so hiding it would be a trap.
|
|
353
|
+
*/
|
|
354
|
+
:host(:hover) .rail,
|
|
355
|
+
:host(:focus-within) .rail,
|
|
356
|
+
:host([collapsed]) .rail {
|
|
357
|
+
opacity: 1;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@media (hover: none) {
|
|
361
|
+
.rail {
|
|
362
|
+
opacity: 1;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.rail:hover {
|
|
367
|
+
border-color: var(--tt-sidebar-border);
|
|
368
|
+
background: var(--tt-sidebar-accent);
|
|
369
|
+
color: var(--tt-sidebar-accent-foreground);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.rail:focus-visible {
|
|
373
|
+
opacity: 1;
|
|
374
|
+
|
|
375
|
+
outline: var(--tt-ring-width) solid var(--tt-ring);
|
|
376
|
+
outline-offset: var(--tt-ring-offset);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.rail tt-icon {
|
|
380
|
+
flex-shrink: 0;
|
|
381
|
+
|
|
382
|
+
/* One icon, turned over, rather than two icons swapped. Swapping
|
|
383
|
+
the name would replace the node and there would be nothing to
|
|
384
|
+
animate between. */
|
|
385
|
+
transition: transform var(--tt-duration-normal) var(--tt-ease-spring);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
:host([collapsed]) .rail tt-icon {
|
|
389
|
+
transform: rotate(180deg);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
[hidden] {
|
|
393
|
+
display: none;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* ---- mobile ----
|
|
397
|
+
|
|
398
|
+
On a phone this element is not a column beside the page, it is a
|
|
399
|
+
drawer sliding over it (see tt-layout). A rail there would be a
|
|
400
|
+
64px strip covering the screen with no labels, so the whole
|
|
401
|
+
collapsed state is switched off and the drawer is always full
|
|
402
|
+
width. This works only because the channel above is declared in a
|
|
403
|
+
stylesheet: an inline style written from JavaScript could not be
|
|
404
|
+
overridden here. */
|
|
405
|
+
|
|
406
|
+
@media (max-width: 768px) {
|
|
407
|
+
:host([collapsed]) {
|
|
408
|
+
width: var(--tt-sidebar-width, 240px);
|
|
409
|
+
|
|
410
|
+
--tt-menu-label-cols: 1fr;
|
|
411
|
+
--tt-menu-gap: var(--tt-space-2);
|
|
412
|
+
--tt-menu-justify: flex-start;
|
|
413
|
+
--tt-menu-trail-display: flex;
|
|
414
|
+
--tt-menu-heading-display: flex;
|
|
415
|
+
--tt-menu-indent: var(--tt-space-2);
|
|
416
|
+
|
|
417
|
+
/* initial is the guaranteed-invalid value for a custom property,
|
|
418
|
+
so every var(--tt-menu-rail-rows, X) below falls back to X and
|
|
419
|
+
groups go back to obeying their own open state. Same for the
|
|
420
|
+
arrow's alignment. */
|
|
421
|
+
--tt-menu-rail-rows: initial;
|
|
422
|
+
--tt-menu-rail-visibility: initial;
|
|
423
|
+
--tt-rail-justify: initial;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/*
|
|
427
|
+
The pin above exists to stop the content reflowing DURING a width
|
|
428
|
+
animation, and on a phone there is no width animation: the drawer
|
|
429
|
+
is always full width. Left in, it would push the content past a
|
|
430
|
+
drawer narrower than 240px and clip the right-hand side of every
|
|
431
|
+
row.
|
|
432
|
+
*/
|
|
433
|
+
:host([collapsible]:not([collapsed])) nav {
|
|
434
|
+
min-width: 0;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
:host([collapsed]) nav {
|
|
438
|
+
padding: var(--tt-space-4);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
:host([collapsed]) .rail tt-icon {
|
|
442
|
+
transform: none;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/* The drawer is already the full width it can be, so there is
|
|
446
|
+
nothing for this button to do. */
|
|
447
|
+
.rail {
|
|
448
|
+
display: none;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
`; }
|
|
452
|
+
render() {
|
|
453
|
+
const variant = this.variant === "borderless"
|
|
454
|
+
? "borderless"
|
|
455
|
+
: this.variant === "floating"
|
|
456
|
+
? "floating"
|
|
457
|
+
: "";
|
|
458
|
+
/*
|
|
459
|
+
The name is the whole control now that the text is gone, so it does
|
|
460
|
+
double duty: the accessible name AND the tooltip. An arrow with no
|
|
461
|
+
name is a mystery button.
|
|
462
|
+
*/
|
|
463
|
+
const railName = this.collapsed ? this.expandLabel : this.collapseLabel;
|
|
464
|
+
return html `
|
|
465
|
+
<nav class=${variant} aria-label=${this.label}>
|
|
466
|
+
<div class="header" ?hidden=${!this.hasHeader}>
|
|
467
|
+
<slot
|
|
468
|
+
name="header"
|
|
469
|
+
@slotchange=${(e) => this.updateSlot("hasHeader", e)}
|
|
470
|
+
></slot>
|
|
471
|
+
</div>
|
|
472
|
+
|
|
473
|
+
<div class="content">
|
|
474
|
+
<slot></slot>
|
|
475
|
+
</div>
|
|
476
|
+
|
|
477
|
+
${this.collapsible
|
|
478
|
+
? html `
|
|
479
|
+
<div class="rail-row">
|
|
480
|
+
<button
|
|
481
|
+
class="rail"
|
|
482
|
+
part="rail"
|
|
483
|
+
type="button"
|
|
484
|
+
aria-expanded=${!this.collapsed}
|
|
485
|
+
aria-label=${railName}
|
|
486
|
+
title=${railName}
|
|
487
|
+
@click=${this.toggle}
|
|
488
|
+
>
|
|
489
|
+
<tt-icon name="chevron-left" size="16px"></tt-icon>
|
|
490
|
+
</button>
|
|
491
|
+
</div>
|
|
492
|
+
`
|
|
493
|
+
: nothing}
|
|
494
|
+
|
|
495
|
+
<div class="footer" ?hidden=${!this.hasFooter}>
|
|
496
|
+
<slot
|
|
497
|
+
name="footer"
|
|
498
|
+
@slotchange=${(e) => this.updateSlot("hasFooter", e)}
|
|
499
|
+
></slot>
|
|
500
|
+
</div>
|
|
501
|
+
</nav>
|
|
502
|
+
`;
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
__decorate([
|
|
506
|
+
property({ type: String })
|
|
507
|
+
], TTSidebar.prototype, "variant", void 0);
|
|
508
|
+
__decorate([
|
|
509
|
+
property({ type: Number })
|
|
510
|
+
], TTSidebar.prototype, "width", void 0);
|
|
511
|
+
__decorate([
|
|
512
|
+
property({ type: Number, attribute: "rail-width" })
|
|
513
|
+
], TTSidebar.prototype, "railWidth", void 0);
|
|
514
|
+
__decorate([
|
|
515
|
+
property({ type: Boolean, reflect: true })
|
|
516
|
+
], TTSidebar.prototype, "collapsible", void 0);
|
|
517
|
+
__decorate([
|
|
518
|
+
property({ type: Boolean, reflect: true })
|
|
519
|
+
], TTSidebar.prototype, "collapsed", void 0);
|
|
520
|
+
__decorate([
|
|
521
|
+
property({ type: String })
|
|
522
|
+
], TTSidebar.prototype, "label", void 0);
|
|
523
|
+
__decorate([
|
|
524
|
+
property({ type: String, attribute: "collapse-label" })
|
|
525
|
+
], TTSidebar.prototype, "collapseLabel", void 0);
|
|
526
|
+
__decorate([
|
|
527
|
+
property({ type: String, attribute: "expand-label" })
|
|
528
|
+
], TTSidebar.prototype, "expandLabel", void 0);
|
|
529
|
+
__decorate([
|
|
530
|
+
state()
|
|
531
|
+
], TTSidebar.prototype, "hasHeader", void 0);
|
|
532
|
+
__decorate([
|
|
533
|
+
state()
|
|
534
|
+
], TTSidebar.prototype, "hasFooter", void 0);
|
|
535
|
+
TTSidebar = __decorate([
|
|
536
|
+
customElement("tt-sidebar")
|
|
537
|
+
], TTSidebar);
|
|
538
|
+
export { TTSidebar };
|
|
539
|
+
//# sourceMappingURL=tt-sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-sidebar.js","sourceRoot":"","sources":["../../src/sidebar/tt-sidebar.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.sr-only`: present for screen readers, invisible on screen.
|
|
3
|
+
*
|
|
4
|
+
* Shared rather than copied, because a shadow root inherits no page
|
|
5
|
+
* styles, so every component that needs the class has to carry it, and
|
|
6
|
+
* hand-copied versions drift. Use it as the first entry of a styles array:
|
|
7
|
+
*
|
|
8
|
+
* static styles = [srOnly, css`...`];
|
|
9
|
+
*
|
|
10
|
+
* clip-path rather than the older clip, which is deprecated. Not
|
|
11
|
+
* display:none or visibility:hidden: both remove the text from the
|
|
12
|
+
* accessibility tree too, which defeats the point.
|
|
13
|
+
*/
|
|
14
|
+
export declare const srOnly: import("lit").CSSResult;
|
|
15
|
+
//# sourceMappingURL=sr-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sr-only.d.ts","sourceRoot":"","sources":["../src/sr-only.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,yBAWlB,CAAC"}
|
package/dist/sr-only.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `.sr-only`: present for screen readers, invisible on screen.
|
|
4
|
+
*
|
|
5
|
+
* Shared rather than copied, because a shadow root inherits no page
|
|
6
|
+
* styles, so every component that needs the class has to carry it, and
|
|
7
|
+
* hand-copied versions drift. Use it as the first entry of a styles array:
|
|
8
|
+
*
|
|
9
|
+
* static styles = [srOnly, css`...`];
|
|
10
|
+
*
|
|
11
|
+
* clip-path rather than the older clip, which is deprecated. Not
|
|
12
|
+
* display:none or visibility:hidden: both remove the text from the
|
|
13
|
+
* accessibility tree too, which defeats the point.
|
|
14
|
+
*/
|
|
15
|
+
export const srOnly = css `
|
|
16
|
+
.sr-only {
|
|
17
|
+
position: absolute;
|
|
18
|
+
width: 1px;
|
|
19
|
+
height: 1px;
|
|
20
|
+
padding: 0;
|
|
21
|
+
margin: -1px;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
clip-path: inset(50%);
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
//# sourceMappingURL=sr-only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sr-only.js","sourceRoot":"","sources":["../src/sr-only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;CAWxB,CAAC"}
|