@tanrei/web 0.0.0-stage → 0.1.0-next.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/LICENSE +202 -0
- package/NOTICE +58 -0
- package/README.md +9743 -2
- package/custom-elements.json +86072 -0
- package/dist/THIRD_PARTY_LICENSES.md +136 -0
- package/dist/accordion.css +812 -0
- package/dist/app-shell.css +493 -0
- package/dist/avatar.css +80 -0
- package/dist/breadcrumbs.css +511 -0
- package/dist/callout.css +65 -0
- package/dist/code.css +595 -0
- package/dist/components/accordion/accordion.d.ts +197 -0
- package/dist/components/accordion/accordion.js +763 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/app-bar/app-bar.d.ts +107 -0
- package/dist/components/app-bar/app-bar.js +295 -0
- package/dist/components/app-bar/app-bar.js.map +1 -0
- package/dist/components/app-bar/app-bar.styles.d.ts +12 -0
- package/dist/components/app-bar/app-bar.styles.js +223 -0
- package/dist/components/app-bar/app-bar.styles.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +220 -0
- package/dist/components/app-shell/app-shell.js +677 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/avatar/avatar.d.ts +162 -0
- package/dist/components/avatar/avatar.js +390 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/avatar.styles.d.ts +9 -0
- package/dist/components/avatar/avatar.styles.js +258 -0
- package/dist/components/avatar/avatar.styles.js.map +1 -0
- package/dist/components/badge/badge.d.ts +59 -0
- package/dist/components/badge/badge.js +176 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/badge.styles.d.ts +1 -0
- package/dist/components/badge/badge.styles.js +106 -0
- package/dist/components/badge/badge.styles.js.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +207 -0
- package/dist/components/bottom-sheet/bottom-sheet.js +724 -0
- package/dist/components/bottom-sheet/bottom-sheet.js.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.d.ts +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.js +393 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +176 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +638 -0
- package/dist/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.d.ts +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +225 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.js.map +1 -0
- package/dist/components/button/button.d.ts +280 -0
- package/dist/components/button/button.js +530 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/button.styles.d.ts +20 -0
- package/dist/components/button/button.styles.js +328 -0
- package/dist/components/button/button.styles.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +124 -0
- package/dist/components/button-group/button-group.js +287 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/button-group/button-group.styles.d.ts +1 -0
- package/dist/components/button-group/button-group.styles.js +220 -0
- package/dist/components/button-group/button-group.styles.js.map +1 -0
- package/dist/components/button-with-menu/button-with-menu.d.ts +224 -0
- package/dist/components/button-with-menu/button-with-menu.js +635 -0
- package/dist/components/button-with-menu/button-with-menu.js.map +1 -0
- package/dist/components/button-with-menu/button-with-menu.styles.d.ts +15 -0
- package/dist/components/button-with-menu/button-with-menu.styles.js +418 -0
- package/dist/components/button-with-menu/button-with-menu.styles.js.map +1 -0
- package/dist/components/calendar/calendar.d.ts +380 -0
- package/dist/components/calendar/calendar.js +1619 -0
- package/dist/components/calendar/calendar.js.map +1 -0
- package/dist/components/calendar/calendar.styles.d.ts +11 -0
- package/dist/components/calendar/calendar.styles.js +412 -0
- package/dist/components/calendar/calendar.styles.js.map +1 -0
- package/dist/components/callout/callout.d.ts +157 -0
- package/dist/components/callout/callout.js +436 -0
- package/dist/components/callout/callout.js.map +1 -0
- package/dist/components/callout/callout.styles.d.ts +13 -0
- package/dist/components/callout/callout.styles.js +383 -0
- package/dist/components/callout/callout.styles.js.map +1 -0
- package/dist/components/card/card.d.ts +108 -0
- package/dist/components/card/card.js +235 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/card.styles.d.ts +9 -0
- package/dist/components/card/card.styles.js +170 -0
- package/dist/components/card/card.styles.js.map +1 -0
- package/dist/components/carousel/carousel-geometry.d.ts +178 -0
- package/dist/components/carousel/carousel-geometry.js +356 -0
- package/dist/components/carousel/carousel-geometry.js.map +1 -0
- package/dist/components/carousel/carousel.d.ts +401 -0
- package/dist/components/carousel/carousel.js +1352 -0
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/carousel/carousel.styles.d.ts +4 -0
- package/dist/components/carousel/carousel.styles.js +475 -0
- package/dist/components/carousel/carousel.styles.js.map +1 -0
- package/dist/components/chat-composer/chat-composer.d.ts +482 -0
- package/dist/components/chat-composer/chat-composer.js +1374 -0
- package/dist/components/chat-composer/chat-composer.js.map +1 -0
- package/dist/components/chat-composer/chat-composer.styles.d.ts +9 -0
- package/dist/components/chat-composer/chat-composer.styles.js +308 -0
- package/dist/components/chat-composer/chat-composer.styles.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +135 -0
- package/dist/components/checkbox/checkbox.js +296 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +13 -0
- package/dist/components/checkbox/checkbox.styles.js +226 -0
- package/dist/components/checkbox/checkbox.styles.js.map +1 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +199 -0
- package/dist/components/checkbox-group/checkbox-group.js +500 -0
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -0
- package/dist/components/chip/chip.d.ts +176 -0
- package/dist/components/chip/chip.js +376 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/chip/chip.styles.d.ts +10 -0
- package/dist/components/chip/chip.styles.js +465 -0
- package/dist/components/chip/chip.styles.js.map +1 -0
- package/dist/components/chip-field/chip-field.d.ts +315 -0
- package/dist/components/chip-field/chip-field.js +887 -0
- package/dist/components/chip-field/chip-field.js.map +1 -0
- package/dist/components/code-block/code-block.before.d.ts +2 -0
- package/dist/components/code-block/code-block.before.js +193 -0
- package/dist/components/code-block/code-block.before.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +268 -0
- package/dist/components/code-block/code-block.js +1009 -0
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/code-block/code-block.light.d.ts +50 -0
- package/dist/components/code-block/code-block.light.js +287 -0
- package/dist/components/code-block/code-block.light.js.map +1 -0
- package/dist/components/code-block/code-block.lines.d.ts +49 -0
- package/dist/components/code-block/code-block.lines.js +75 -0
- package/dist/components/code-block/code-block.lines.js.map +1 -0
- package/dist/components/code-block/code-block.styles.d.ts +8 -0
- package/dist/components/code-block/code-block.styles.js +212 -0
- package/dist/components/code-block/code-block.styles.js.map +1 -0
- package/dist/components/color-field/color-field.d.ts +120 -0
- package/dist/components/color-field/color-field.js +182 -0
- package/dist/components/color-field/color-field.js.map +1 -0
- package/dist/components/color-input/color-input.d.ts +302 -0
- package/dist/components/color-input/color-input.js +748 -0
- package/dist/components/color-input/color-input.js.map +1 -0
- package/dist/components/color-input/color-input.styles.d.ts +22 -0
- package/dist/components/color-input/color-input.styles.js +373 -0
- package/dist/components/color-input/color-input.styles.js.map +1 -0
- package/dist/components/color-input/color-text.d.ts +48 -0
- package/dist/components/color-input/color-text.js +77 -0
- package/dist/components/color-input/color-text.js.map +1 -0
- package/dist/components/combobox/combobox.d.ts +387 -0
- package/dist/components/combobox/combobox.js +1108 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/combobox/combobox.styles.d.ts +26 -0
- package/dist/components/combobox/combobox.styles.js +497 -0
- package/dist/components/combobox/combobox.styles.js.map +1 -0
- package/dist/components/combobox-field/combobox-field.d.ts +159 -0
- package/dist/components/combobox-field/combobox-field.js +280 -0
- package/dist/components/combobox-field/combobox-field.js.map +1 -0
- package/dist/components/copy-button/copy-button.d.ts +112 -0
- package/dist/components/copy-button/copy-button.js +237 -0
- package/dist/components/copy-button/copy-button.js.map +1 -0
- package/dist/components/copy-button/copy-button.styles.d.ts +1 -0
- package/dist/components/copy-button/copy-button.styles.js +62 -0
- package/dist/components/copy-button/copy-button.styles.js.map +1 -0
- package/dist/components/date-time-picker/date-time-picker.d.ts +603 -0
- package/dist/components/date-time-picker/date-time-picker.js +2537 -0
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -0
- package/dist/components/date-time-picker/date-time-picker.styles.d.ts +1 -0
- package/dist/components/date-time-picker/date-time-picker.styles.js +842 -0
- package/dist/components/date-time-picker/date-time-picker.styles.js.map +1 -0
- package/dist/components/description-list/description-list.d.ts +133 -0
- package/dist/components/description-list/description-list.js +395 -0
- package/dist/components/description-list/description-list.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +140 -0
- package/dist/components/dialog/dialog.js +440 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.styles.js +306 -0
- package/dist/components/dialog/dialog.styles.js.map +1 -0
- package/dist/components/divider/divider.d.ts +112 -0
- package/dist/components/divider/divider.js +331 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/divider/divider.styles.d.ts +6 -0
- package/dist/components/divider/divider.styles.js +183 -0
- package/dist/components/divider/divider.styles.js.map +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.d.ts +246 -0
- package/dist/components/embedded-text-input/embedded-text-input.js +673 -0
- package/dist/components/embedded-text-input/embedded-text-input.js.map +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.d.ts +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.js +204 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.js.map +1 -0
- package/dist/components/empty-state/empty-state.d.ts +132 -0
- package/dist/components/empty-state/empty-state.js +333 -0
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/empty-state/empty-state.styles.d.ts +11 -0
- package/dist/components/empty-state/empty-state.styles.js +218 -0
- package/dist/components/empty-state/empty-state.styles.js.map +1 -0
- package/dist/components/fab-menu/fab-menu.d.ts +240 -0
- package/dist/components/fab-menu/fab-menu.js +605 -0
- package/dist/components/fab-menu/fab-menu.js.map +1 -0
- package/dist/components/fab-menu/fab-menu.styles.d.ts +21 -0
- package/dist/components/fab-menu/fab-menu.styles.js +427 -0
- package/dist/components/fab-menu/fab-menu.styles.js.map +1 -0
- package/dist/components/field/field.d.ts +165 -0
- package/dist/components/field/field.js +399 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/field/field.styles.d.ts +2 -0
- package/dist/components/field/field.styles.js +177 -0
- package/dist/components/field/field.styles.js.map +1 -0
- package/dist/components/field-group/field-group.d.ts +122 -0
- package/dist/components/field-group/field-group.js +246 -0
- package/dist/components/field-group/field-group.js.map +1 -0
- package/dist/components/field-group/field-group.styles.d.ts +7 -0
- package/dist/components/field-group/field-group.styles.js +28 -0
- package/dist/components/field-group/field-group.styles.js.map +1 -0
- package/dist/components/figure/figure.d.ts +152 -0
- package/dist/components/figure/figure.js +435 -0
- package/dist/components/figure/figure.js.map +1 -0
- package/dist/components/file-item/file-item.d.ts +232 -0
- package/dist/components/file-item/file-item.js +665 -0
- package/dist/components/file-item/file-item.js.map +1 -0
- package/dist/components/file-item/file-item.styles.d.ts +2 -0
- package/dist/components/file-item/file-item.styles.js +582 -0
- package/dist/components/file-item/file-item.styles.js.map +1 -0
- package/dist/components/file-picker/file-picker.d.ts +221 -0
- package/dist/components/file-picker/file-picker.js +588 -0
- package/dist/components/file-picker/file-picker.js.map +1 -0
- package/dist/components/file-picker/file-picker.styles.d.ts +2 -0
- package/dist/components/file-picker/file-picker.styles.js +303 -0
- package/dist/components/file-picker/file-picker.styles.js.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +353 -0
- package/dist/components/file-upload/file-upload.js +939 -0
- package/dist/components/file-upload/file-upload.js.map +1 -0
- package/dist/components/file-upload/file-upload.styles.d.ts +1 -0
- package/dist/components/file-upload/file-upload.styles.js +91 -0
- package/dist/components/file-upload/file-upload.styles.js.map +1 -0
- package/dist/components/image-preview/image-preview.d.ts +336 -0
- package/dist/components/image-preview/image-preview.js +1510 -0
- package/dist/components/image-preview/image-preview.js.map +1 -0
- package/dist/components/image-preview/image-preview.styles.d.ts +1 -0
- package/dist/components/image-preview/image-preview.styles.js +418 -0
- package/dist/components/image-preview/image-preview.styles.js.map +1 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.d.ts +94 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.js +285 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.d.ts +11 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.js +155 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.js.map +1 -0
- package/dist/components/link-card/link-card.d.ts +156 -0
- package/dist/components/link-card/link-card.js +713 -0
- package/dist/components/link-card/link-card.js.map +1 -0
- package/dist/components/list/list.d.ts +430 -0
- package/dist/components/list/list.js +1230 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/list/list.styles.d.ts +3 -0
- package/dist/components/list/list.styles.js +334 -0
- package/dist/components/list/list.styles.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator.d.ts +83 -0
- package/dist/components/loading-indicator/loading-indicator.js +195 -0
- package/dist/components/loading-indicator/loading-indicator.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator.styles.d.ts +6 -0
- package/dist/components/loading-indicator/loading-indicator.styles.js +124 -0
- package/dist/components/loading-indicator/loading-indicator.styles.js.map +1 -0
- package/dist/components/main-action-button/main-action-button.d.ts +95 -0
- package/dist/components/main-action-button/main-action-button.js +202 -0
- package/dist/components/main-action-button/main-action-button.js.map +1 -0
- package/dist/components/main-action-button/main-action-button.styles.d.ts +10 -0
- package/dist/components/main-action-button/main-action-button.styles.js +285 -0
- package/dist/components/main-action-button/main-action-button.styles.js.map +1 -0
- package/dist/components/menu/menu.d.ts +813 -0
- package/dist/components/menu/menu.js +2061 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menu/menu.styles.d.ts +18 -0
- package/dist/components/menu/menu.styles.js +587 -0
- package/dist/components/menu/menu.styles.js.map +1 -0
- package/dist/components/menubar/menubar.d.ts +477 -0
- package/dist/components/menubar/menubar.js +1677 -0
- package/dist/components/menubar/menubar.js.map +1 -0
- package/dist/components/menubar/menubar.styles.d.ts +43 -0
- package/dist/components/menubar/menubar.styles.js +379 -0
- package/dist/components/menubar/menubar.styles.js.map +1 -0
- package/dist/components/navigation-bar/navigation-bar.d.ts +239 -0
- package/dist/components/navigation-bar/navigation-bar.js +544 -0
- package/dist/components/navigation-bar/navigation-bar.js.map +1 -0
- package/dist/components/navigation-bar/navigation-bar.styles.d.ts +21 -0
- package/dist/components/navigation-bar/navigation-bar.styles.js +320 -0
- package/dist/components/navigation-bar/navigation-bar.styles.js.map +1 -0
- package/dist/components/navigation-drawer/navigation-drawer.d.ts +627 -0
- package/dist/components/navigation-drawer/navigation-drawer.js +1917 -0
- package/dist/components/navigation-drawer/navigation-drawer.js.map +1 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.d.ts +40 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.js +934 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.js.map +1 -0
- package/dist/components/number-field/number-field.d.ts +147 -0
- package/dist/components/number-field/number-field.js +252 -0
- package/dist/components/number-field/number-field.js.map +1 -0
- package/dist/components/number-input/number-input.d.ts +347 -0
- package/dist/components/number-input/number-input.js +929 -0
- package/dist/components/number-input/number-input.js.map +1 -0
- package/dist/components/number-input/number-input.styles.d.ts +22 -0
- package/dist/components/number-input/number-input.styles.js +395 -0
- package/dist/components/number-input/number-input.styles.js.map +1 -0
- package/dist/components/number-input/number-text.d.ts +74 -0
- package/dist/components/number-input/number-text.js +230 -0
- package/dist/components/number-input/number-text.js.map +1 -0
- package/dist/components/one-time-code-field/one-time-code-field.d.ts +94 -0
- package/dist/components/one-time-code-field/one-time-code-field.js +135 -0
- package/dist/components/one-time-code-field/one-time-code-field.js.map +1 -0
- package/dist/components/one-time-code-input/code-text.d.ts +51 -0
- package/dist/components/one-time-code-input/code-text.js +145 -0
- package/dist/components/one-time-code-input/code-text.js.map +1 -0
- package/dist/components/one-time-code-input/one-time-code-input.d.ts +219 -0
- package/dist/components/one-time-code-input/one-time-code-input.js +710 -0
- package/dist/components/one-time-code-input/one-time-code-input.js.map +1 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.d.ts +8 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.js +323 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.js.map +1 -0
- package/dist/components/option/option.d.ts +51 -0
- package/dist/components/option/option.js +75 -0
- package/dist/components/option/option.js.map +1 -0
- package/dist/components/page-header/page-header.d.ts +97 -0
- package/dist/components/page-header/page-header.js +258 -0
- package/dist/components/page-header/page-header.js.map +1 -0
- package/dist/components/popover/popover.d.ts +217 -0
- package/dist/components/popover/popover.js +616 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/popover/popover.styles.d.ts +8 -0
- package/dist/components/popover/popover.styles.js +299 -0
- package/dist/components/popover/popover.styles.js.map +1 -0
- package/dist/components/progress-indicator/progress-indicator.d.ts +76 -0
- package/dist/components/progress-indicator/progress-indicator.js +165 -0
- package/dist/components/progress-indicator/progress-indicator.js.map +1 -0
- package/dist/components/progress-indicator/progress-indicator.styles.d.ts +7 -0
- package/dist/components/progress-indicator/progress-indicator.styles.js +271 -0
- package/dist/components/progress-indicator/progress-indicator.styles.js.map +1 -0
- package/dist/components/radio-button/radio-button.d.ts +149 -0
- package/dist/components/radio-button/radio-button.js +370 -0
- package/dist/components/radio-button/radio-button.js.map +1 -0
- package/dist/components/radio-button/radio-button.styles.d.ts +8 -0
- package/dist/components/radio-button/radio-button.styles.js +190 -0
- package/dist/components/radio-button/radio-button.styles.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +188 -0
- package/dist/components/radio-group/radio-group.js +380 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/search/search.d.ts +569 -0
- package/dist/components/search/search.js +1801 -0
- package/dist/components/search/search.js.map +1 -0
- package/dist/components/search/search.styles.d.ts +15 -0
- package/dist/components/search/search.styles.js +967 -0
- package/dist/components/search/search.styles.js.map +1 -0
- package/dist/components/segmented-button/segmented-button.d.ts +183 -0
- package/dist/components/segmented-button/segmented-button.js +483 -0
- package/dist/components/segmented-button/segmented-button.js.map +1 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +19 -0
- package/dist/components/segmented-button/segmented-button.styles.js +400 -0
- package/dist/components/segmented-button/segmented-button.styles.js.map +1 -0
- package/dist/components/select/select.d.ts +259 -0
- package/dist/components/select/select.js +702 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select/select.styles.d.ts +27 -0
- package/dist/components/select/select.styles.js +359 -0
- package/dist/components/select/select.styles.js.map +1 -0
- package/dist/components/select-field/select-field.d.ts +141 -0
- package/dist/components/select-field/select-field.js +234 -0
- package/dist/components/select-field/select-field.js.map +1 -0
- package/dist/components/side-sheet/side-sheet.d.ts +190 -0
- package/dist/components/side-sheet/side-sheet.js +592 -0
- package/dist/components/side-sheet/side-sheet.js.map +1 -0
- package/dist/components/side-sheet/side-sheet.styles.d.ts +9 -0
- package/dist/components/side-sheet/side-sheet.styles.js +352 -0
- package/dist/components/side-sheet/side-sheet.styles.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +157 -0
- package/dist/components/skeleton/skeleton.js +550 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/slider.d.ts +235 -0
- package/dist/components/slider/slider.js +792 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/slider/slider.styles.d.ts +6 -0
- package/dist/components/slider/slider.styles.js +492 -0
- package/dist/components/slider/slider.styles.js.map +1 -0
- package/dist/components/slider-field/slider-field.d.ts +150 -0
- package/dist/components/slider-field/slider-field.js +269 -0
- package/dist/components/slider-field/slider-field.js.map +1 -0
- package/dist/components/snackbar/snackbar.d.ts +237 -0
- package/dist/components/snackbar/snackbar.js +607 -0
- package/dist/components/snackbar/snackbar.js.map +1 -0
- package/dist/components/snackbar/snackbar.styles.d.ts +10 -0
- package/dist/components/snackbar/snackbar.styles.js +510 -0
- package/dist/components/snackbar/snackbar.styles.js.map +1 -0
- package/dist/components/switch/switch.d.ts +161 -0
- package/dist/components/switch/switch.js +470 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/switch/switch.styles.d.ts +3 -0
- package/dist/components/switch/switch.styles.js +440 -0
- package/dist/components/switch/switch.styles.js.map +1 -0
- package/dist/components/tab-view/tab-view.d.ts +303 -0
- package/dist/components/tab-view/tab-view.js +917 -0
- package/dist/components/tab-view/tab-view.js.map +1 -0
- package/dist/components/tab-view/tab-view.styles.d.ts +19 -0
- package/dist/components/tab-view/tab-view.styles.js +85 -0
- package/dist/components/tab-view/tab-view.styles.js.map +1 -0
- package/dist/components/table/table.d.ts +386 -0
- package/dist/components/table/table.js +1320 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +227 -0
- package/dist/components/table-of-contents/table-of-contents.js +963 -0
- package/dist/components/table-of-contents/table-of-contents.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.styles.d.ts +1 -0
- package/dist/components/table-of-contents/table-of-contents.styles.js +243 -0
- package/dist/components/table-of-contents/table-of-contents.styles.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +800 -0
- package/dist/components/tabs/tabs.js +2183 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tabs/tabs.styles.d.ts +47 -0
- package/dist/components/tabs/tabs.styles.js +595 -0
- package/dist/components/tabs/tabs.styles.js.map +1 -0
- package/dist/components/tag/tag.d.ts +77 -0
- package/dist/components/tag/tag.js +143 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/tag/tag.styles.d.ts +13 -0
- package/dist/components/tag/tag.styles.js +215 -0
- package/dist/components/tag/tag.styles.js.map +1 -0
- package/dist/components/tag-group/tag-group.d.ts +110 -0
- package/dist/components/tag-group/tag-group.js +298 -0
- package/dist/components/tag-group/tag-group.js.map +1 -0
- package/dist/components/tag-group/tag-group.styles.d.ts +8 -0
- package/dist/components/tag-group/tag-group.styles.js +66 -0
- package/dist/components/tag-group/tag-group.styles.js.map +1 -0
- package/dist/components/text-field/text-field.d.ts +159 -0
- package/dist/components/text-field/text-field.js +272 -0
- package/dist/components/text-field/text-field.js.map +1 -0
- package/dist/components/text-input/text-input-segments.d.ts +93 -0
- package/dist/components/text-input/text-input-segments.js +233 -0
- package/dist/components/text-input/text-input-segments.js.map +1 -0
- package/dist/components/text-input/text-input.d.ts +683 -0
- package/dist/components/text-input/text-input.js +2120 -0
- package/dist/components/text-input/text-input.js.map +1 -0
- package/dist/components/text-input/text-input.styles.d.ts +27 -0
- package/dist/components/text-input/text-input.styles.js +1071 -0
- package/dist/components/text-input/text-input.styles.js.map +1 -0
- package/dist/components/toolbar/toolbar.d.ts +123 -0
- package/dist/components/toolbar/toolbar.js +336 -0
- package/dist/components/toolbar/toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar.styles.d.ts +10 -0
- package/dist/components/toolbar/toolbar.styles.js +156 -0
- package/dist/components/toolbar/toolbar.styles.js.map +1 -0
- package/dist/components/tooltip/tooltip-placement.d.ts +22 -0
- package/dist/components/tooltip/tooltip-placement.js +15 -0
- package/dist/components/tooltip/tooltip-placement.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +267 -0
- package/dist/components/tooltip/tooltip.js +902 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +7 -0
- package/dist/components/tooltip/tooltip.styles.js +240 -0
- package/dist/components/tooltip/tooltip.styles.js.map +1 -0
- package/dist/components/tree-view/tree-view.d.ts +264 -0
- package/dist/components/tree-view/tree-view.js +1228 -0
- package/dist/components/tree-view/tree-view.js.map +1 -0
- package/dist/description-list.css +337 -0
- package/dist/empty-state.css +70 -0
- package/dist/figure.css +381 -0
- package/dist/generated/icon-sets.d.ts +9 -0
- package/dist/generated/icon-sets.js +18 -0
- package/dist/generated/icon-sets.js.map +1 -0
- package/dist/generated/words.d.ts +161 -0
- package/dist/generated/words.js +91 -0
- package/dist/generated/words.js.map +1 -0
- package/dist/highlight/grammars/css.d.ts +3 -0
- package/dist/highlight/grammars/css.js +56 -0
- package/dist/highlight/grammars/css.js.map +1 -0
- package/dist/highlight/grammars/dart.d.ts +3 -0
- package/dist/highlight/grammars/dart.js +53 -0
- package/dist/highlight/grammars/dart.js.map +1 -0
- package/dist/highlight/grammars/javascript.d.ts +4 -0
- package/dist/highlight/grammars/javascript.js +119 -0
- package/dist/highlight/grammars/javascript.js.map +1 -0
- package/dist/highlight/grammars/json.d.ts +3 -0
- package/dist/highlight/grammars/json.js +19 -0
- package/dist/highlight/grammars/json.js.map +1 -0
- package/dist/highlight/grammars/kotlin.d.ts +3 -0
- package/dist/highlight/grammars/kotlin.js +46 -0
- package/dist/highlight/grammars/kotlin.js.map +1 -0
- package/dist/highlight/grammars/markup.d.ts +3 -0
- package/dist/highlight/grammars/markup.js +45 -0
- package/dist/highlight/grammars/markup.js.map +1 -0
- package/dist/highlight/grammars/shared.d.ts +25 -0
- package/dist/highlight/grammars/shared.js +37 -0
- package/dist/highlight/grammars/shared.js.map +1 -0
- package/dist/highlight/grammars/shell.d.ts +3 -0
- package/dist/highlight/grammars/shell.js +48 -0
- package/dist/highlight/grammars/shell.js.map +1 -0
- package/dist/highlight/grammars/swift.d.ts +3 -0
- package/dist/highlight/grammars/swift.js +46 -0
- package/dist/highlight/grammars/swift.js.map +1 -0
- package/dist/highlight/grammars/typescript.d.ts +2 -0
- package/dist/highlight/grammars/typescript.js +5 -0
- package/dist/highlight/grammars/typescript.js.map +1 -0
- package/dist/highlight/index.d.ts +104 -0
- package/dist/highlight/index.js +331 -0
- package/dist/highlight/index.js.map +1 -0
- package/dist/icons.css +107 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +10 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +100 -0
- package/dist/index.js.map +1 -0
- package/dist/link-card.css +678 -0
- package/dist/link.css +728 -0
- package/dist/link.d.ts +21 -0
- package/dist/link.js +594 -0
- package/dist/link.js.map +1 -0
- package/dist/links/index.d.ts +136 -0
- package/dist/links/index.js +404 -0
- package/dist/links/index.js.map +1 -0
- package/dist/links/node/address.js +154 -0
- package/dist/links/node/cli.js +102 -0
- package/dist/links/node/fetcher.js +267 -0
- package/dist/links/node/head.js +278 -0
- package/dist/links/node/index.d.ts +164 -0
- package/dist/links/node/index.js +26 -0
- package/dist/links/node/links.js +275 -0
- package/dist/links/node/lock.js +86 -0
- package/dist/links/node/mark.js +71 -0
- package/dist/links/node/options.js +120 -0
- package/dist/links/node/pictures.js +265 -0
- package/dist/links/node/refresh.js +28 -0
- package/dist/menu.css +97 -0
- package/dist/menubar.css +69 -0
- package/dist/page-header.css +324 -0
- package/dist/pagination.css +410 -0
- package/dist/pagination.d.ts +6 -0
- package/dist/pagination.js +256 -0
- package/dist/pagination.js.map +1 -0
- package/dist/primitives/actions.d.ts +75 -0
- package/dist/primitives/actions.js +142 -0
- package/dist/primitives/actions.js.map +1 -0
- package/dist/primitives/after-click.d.ts +8 -0
- package/dist/primitives/after-click.js +21 -0
- package/dist/primitives/after-click.js.map +1 -0
- package/dist/primitives/anchored.d.ts +134 -0
- package/dist/primitives/anchored.js +425 -0
- package/dist/primitives/anchored.js.map +1 -0
- package/dist/primitives/arc.d.ts +13 -0
- package/dist/primitives/arc.js +49 -0
- package/dist/primitives/arc.js.map +1 -0
- package/dist/primitives/arrow.d.ts +47 -0
- package/dist/primitives/arrow.js +159 -0
- package/dist/primitives/arrow.js.map +1 -0
- package/dist/primitives/auto-height.d.ts +56 -0
- package/dist/primitives/auto-height.js +150 -0
- package/dist/primitives/auto-height.js.map +1 -0
- package/dist/primitives/autofocus.d.ts +11 -0
- package/dist/primitives/autofocus.js +26 -0
- package/dist/primitives/autofocus.js.map +1 -0
- package/dist/primitives/availability.d.ts +32 -0
- package/dist/primitives/availability.js +122 -0
- package/dist/primitives/availability.js.map +1 -0
- package/dist/primitives/axes.d.ts +45 -0
- package/dist/primitives/axes.js +72 -0
- package/dist/primitives/axes.js.map +1 -0
- package/dist/primitives/behavior.d.ts +14 -0
- package/dist/primitives/behavior.js +19 -0
- package/dist/primitives/behavior.js.map +1 -0
- package/dist/primitives/calendar-date.d.ts +79 -0
- package/dist/primitives/calendar-date.js +135 -0
- package/dist/primitives/calendar-date.js.map +1 -0
- package/dist/primitives/composed.d.ts +144 -0
- package/dist/primitives/composed.js +303 -0
- package/dist/primitives/composed.js.map +1 -0
- package/dist/primitives/default-button.d.ts +49 -0
- package/dist/primitives/default-button.js +270 -0
- package/dist/primitives/default-button.js.map +1 -0
- package/dist/primitives/description.d.ts +18 -0
- package/dist/primitives/description.js +18 -0
- package/dist/primitives/description.js.map +1 -0
- package/dist/primitives/destination.d.ts +259 -0
- package/dist/primitives/destination.js +651 -0
- package/dist/primitives/destination.js.map +1 -0
- package/dist/primitives/direction.d.ts +23 -0
- package/dist/primitives/direction.js +90 -0
- package/dist/primitives/direction.js.map +1 -0
- package/dist/primitives/disabled-while-focused.d.ts +46 -0
- package/dist/primitives/disabled-while-focused.js +126 -0
- package/dist/primitives/disabled-while-focused.js.map +1 -0
- package/dist/primitives/disclosure.d.ts +9 -0
- package/dist/primitives/disclosure.js +15 -0
- package/dist/primitives/disclosure.js.map +1 -0
- package/dist/primitives/dismiss.d.ts +88 -0
- package/dist/primitives/dismiss.js +232 -0
- package/dist/primitives/dismiss.js.map +1 -0
- package/dist/primitives/field-frame.d.ts +166 -0
- package/dist/primitives/field-frame.js +358 -0
- package/dist/primitives/field-frame.js.map +1 -0
- package/dist/primitives/field-group-frame.d.ts +59 -0
- package/dist/primitives/field-group-frame.js +174 -0
- package/dist/primitives/field-group-frame.js.map +1 -0
- package/dist/primitives/field-trigger.d.ts +117 -0
- package/dist/primitives/field-trigger.js +387 -0
- package/dist/primitives/field-trigger.js.map +1 -0
- package/dist/primitives/field.d.ts +186 -0
- package/dist/primitives/field.js +349 -0
- package/dist/primitives/field.js.map +1 -0
- package/dist/primitives/file-format.d.ts +23 -0
- package/dist/primitives/file-format.js +185 -0
- package/dist/primitives/file-format.js.map +1 -0
- package/dist/primitives/file-item-holder.d.ts +45 -0
- package/dist/primitives/file-item-holder.js +39 -0
- package/dist/primitives/file-item-holder.js.map +1 -0
- package/dist/primitives/focus-order.d.ts +11 -0
- package/dist/primitives/focus-order.js +11 -0
- package/dist/primitives/focus-order.js.map +1 -0
- package/dist/primitives/focus-ring.d.ts +76 -0
- package/dist/primitives/focus-ring.js +230 -0
- package/dist/primitives/focus-ring.js.map +1 -0
- package/dist/primitives/follow.d.ts +65 -0
- package/dist/primitives/follow.js +283 -0
- package/dist/primitives/follow.js.map +1 -0
- package/dist/primitives/form-disabled.d.ts +20 -0
- package/dist/primitives/form-disabled.js +46 -0
- package/dist/primitives/form-disabled.js.map +1 -0
- package/dist/primitives/form-says.d.ts +33 -0
- package/dist/primitives/form-says.js +45 -0
- package/dist/primitives/form-says.js.map +1 -0
- package/dist/primitives/forward.d.ts +13 -0
- package/dist/primitives/forward.js +28 -0
- package/dist/primitives/forward.js.map +1 -0
- package/dist/primitives/glyph-mirror.d.ts +77 -0
- package/dist/primitives/glyph-mirror.js +211 -0
- package/dist/primitives/glyph-mirror.js.map +1 -0
- package/dist/primitives/glyph-pending.d.ts +17 -0
- package/dist/primitives/glyph-pending.js +91 -0
- package/dist/primitives/glyph-pending.js.map +1 -0
- package/dist/primitives/glyph.d.ts +53 -0
- package/dist/primitives/glyph.js +161 -0
- package/dist/primitives/glyph.js.map +1 -0
- package/dist/primitives/group-item.d.ts +128 -0
- package/dist/primitives/group-item.js +334 -0
- package/dist/primitives/group-item.js.map +1 -0
- package/dist/primitives/hidden.d.ts +2 -0
- package/dist/primitives/hidden.js +23 -0
- package/dist/primitives/hidden.js.map +1 -0
- package/dist/primitives/host-aria.d.ts +8 -0
- package/dist/primitives/host-aria.js +18 -0
- package/dist/primitives/host-aria.js.map +1 -0
- package/dist/primitives/index.d.ts +59 -0
- package/dist/primitives/index.js +189 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/indicator-drag.d.ts +90 -0
- package/dist/primitives/indicator-drag.js +207 -0
- package/dist/primitives/indicator-drag.js.map +1 -0
- package/dist/primitives/interactive.d.ts +13 -0
- package/dist/primitives/interactive.js +67 -0
- package/dist/primitives/interactive.js.map +1 -0
- package/dist/primitives/item-row.d.ts +34 -0
- package/dist/primitives/item-row.js +76 -0
- package/dist/primitives/item-row.js.map +1 -0
- package/dist/primitives/item-update.d.ts +2 -0
- package/dist/primitives/item-update.js +12 -0
- package/dist/primitives/item-update.js.map +1 -0
- package/dist/primitives/kept-length.d.ts +34 -0
- package/dist/primitives/kept-length.js +154 -0
- package/dist/primitives/kept-length.js.map +1 -0
- package/dist/primitives/keyboard-convention.d.ts +30 -0
- package/dist/primitives/keyboard-convention.js +88 -0
- package/dist/primitives/keyboard-convention.js.map +1 -0
- package/dist/primitives/label-lines.d.ts +12 -0
- package/dist/primitives/label-lines.js +34 -0
- package/dist/primitives/label-lines.js.map +1 -0
- package/dist/primitives/layout-scale.d.ts +18 -0
- package/dist/primitives/layout-scale.js +35 -0
- package/dist/primitives/layout-scale.js.map +1 -0
- package/dist/primitives/link.d.ts +147 -0
- package/dist/primitives/link.js +204 -0
- package/dist/primitives/link.js.map +1 -0
- package/dist/primitives/locale-date.d.ts +132 -0
- package/dist/primitives/locale-date.js +508 -0
- package/dist/primitives/locale-date.js.map +1 -0
- package/dist/primitives/missing-value.d.ts +16 -0
- package/dist/primitives/missing-value.js +31 -0
- package/dist/primitives/missing-value.js.map +1 -0
- package/dist/primitives/modal.d.ts +38 -0
- package/dist/primitives/modal.js +175 -0
- package/dist/primitives/modal.js.map +1 -0
- package/dist/primitives/native-text.d.ts +51 -0
- package/dist/primitives/native-text.js +77 -0
- package/dist/primitives/native-text.js.map +1 -0
- package/dist/primitives/natural-height.d.ts +21 -0
- package/dist/primitives/natural-height.js +36 -0
- package/dist/primitives/natural-height.js.map +1 -0
- package/dist/primitives/option-list.d.ts +314 -0
- package/dist/primitives/option-list.js +1098 -0
- package/dist/primitives/option-list.js.map +1 -0
- package/dist/primitives/overlay-focus.d.ts +48 -0
- package/dist/primitives/overlay-focus.js +152 -0
- package/dist/primitives/overlay-focus.js.map +1 -0
- package/dist/primitives/placement.d.ts +131 -0
- package/dist/primitives/placement.js +144 -0
- package/dist/primitives/placement.js.map +1 -0
- package/dist/primitives/places.d.ts +44 -0
- package/dist/primitives/places.js +98 -0
- package/dist/primitives/places.js.map +1 -0
- package/dist/primitives/press.d.ts +90 -0
- package/dist/primitives/press.js +153 -0
- package/dist/primitives/press.js.map +1 -0
- package/dist/primitives/report.d.ts +17 -0
- package/dist/primitives/report.js +34 -0
- package/dist/primitives/report.js.map +1 -0
- package/dist/primitives/ripple.d.ts +40 -0
- package/dist/primitives/ripple.js +70 -0
- package/dist/primitives/ripple.js.map +1 -0
- package/dist/primitives/roving.d.ts +41 -0
- package/dist/primitives/roving.js +71 -0
- package/dist/primitives/roving.js.map +1 -0
- package/dist/primitives/selection.d.ts +134 -0
- package/dist/primitives/selection.js +287 -0
- package/dist/primitives/selection.js.map +1 -0
- package/dist/primitives/separation.d.ts +28 -0
- package/dist/primitives/separation.js +96 -0
- package/dist/primitives/separation.js.map +1 -0
- package/dist/primitives/shared-choice.d.ts +33 -0
- package/dist/primitives/shared-choice.js +110 -0
- package/dist/primitives/shared-choice.js.map +1 -0
- package/dist/primitives/sheet.d.ts +63 -0
- package/dist/primitives/sheet.js +139 -0
- package/dist/primitives/sheet.js.map +1 -0
- package/dist/primitives/sheets.d.ts +8 -0
- package/dist/primitives/sheets.js +96 -0
- package/dist/primitives/sheets.js.map +1 -0
- package/dist/primitives/states.d.ts +33 -0
- package/dist/primitives/states.js +30 -0
- package/dist/primitives/states.js.map +1 -0
- package/dist/primitives/system-watch.d.ts +9 -0
- package/dist/primitives/system-watch.js +29 -0
- package/dist/primitives/system-watch.js.map +1 -0
- package/dist/primitives/target.d.ts +21 -0
- package/dist/primitives/target.js +79 -0
- package/dist/primitives/target.js.map +1 -0
- package/dist/primitives/values.d.ts +6 -0
- package/dist/primitives/values.js +22 -0
- package/dist/primitives/values.js.map +1 -0
- package/dist/primitives/visibility.d.ts +12 -0
- package/dist/primitives/visibility.js +50 -0
- package/dist/primitives/visibility.js.map +1 -0
- package/dist/primitives/words.d.ts +81 -0
- package/dist/primitives/words.js +236 -0
- package/dist/primitives/words.js.map +1 -0
- package/dist/prose.css +1917 -0
- package/dist/registry.d.ts +182 -0
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -0
- package/dist/shape.css +21 -0
- package/dist/skeleton.css +428 -0
- package/dist/steps.css +231 -0
- package/dist/steps.d.ts +6 -0
- package/dist/steps.js +156 -0
- package/dist/steps.js.map +1 -0
- package/dist/styles/icons.d.ts +62 -0
- package/dist/styles/icons.js +237 -0
- package/dist/styles/icons.js.map +1 -0
- package/dist/styles/product-text.d.ts +66 -0
- package/dist/styles/product-text.js +114 -0
- package/dist/styles/product-text.js.map +1 -0
- package/dist/styles/registered-properties.d.ts +6 -0
- package/dist/styles/registered-properties.js +68 -0
- package/dist/styles/registered-properties.js.map +1 -0
- package/dist/styles/shape.d.ts +59 -0
- package/dist/styles/shape.js +95 -0
- package/dist/styles/shape.js.map +1 -0
- package/dist/systems/cupertino.css +8793 -0
- package/dist/systems/m3-expressive-like.css +8786 -0
- package/dist/systems/m3-like.css +8748 -0
- package/dist/table-of-contents.css +482 -0
- package/dist/table.css +902 -0
- package/dist/tanrei.bundle.js +26644 -0
- package/dist/tanrei.bundle.js.map +7 -0
- package/dist/text.css +104 -0
- package/dist/timeline.css +410 -0
- package/dist/timeline.d.ts +6 -0
- package/dist/timeline.js +176 -0
- package/dist/timeline.js.map +1 -0
- package/dist/tokens.css +8801 -0
- package/dist/tree-view.css +797 -0
- package/dist/words.d.ts +2 -0
- package/dist/words.js +6 -0
- package/dist/words.js.map +1 -0
- package/package.json +132 -3
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
import { ReactiveElement } from 'lit';
|
|
2
|
+
import { AvailabilityController, SEPARATIONS, SEPARATION_VALUES, compChoice, deepActive, report, styleQueries } from '../../primitives/index.js';
|
|
3
|
+
import { debugBuild } from '../../primitives/report.js';
|
|
4
|
+
import { adoptUnlessDrawn } from '../../primitives/sheets.js';
|
|
5
|
+
const SHELL_CSS = (() => {
|
|
6
|
+
try {
|
|
7
|
+
return "@layer tanrei.components {\n:where(tanrei-app-shell) {\n--_aps-breakpoint-medium: 37.5rem;\n--_aps-breakpoint-expanded: 64rem;\n--tanrei-app-shell-window-class: compact;\n--_aps-gutter: var(--tanrei-comp-app-shell-gutter-compact);\n--_aps-centring: calc((100% - var(--tanrei-comp-app-shell-main-max-width)) / 2);\n--_aps-inset-start: env(safe-area-inset-left, 0px);\n--_aps-inset-end: env(safe-area-inset-right, 0px);\n--_aps-inset-bottom: env(safe-area-inset-bottom, 0px);\n--_aps-inline-start: max(var(--_aps-gutter), var(--_aps-inset-start));\n--_aps-inline-end: max(var(--_aps-gutter), var(--_aps-inset-end));\n--_aps-separation: var(--tanrei-comp-app-shell-separation);\n--_aps-line: var(--tanrei-comp-app-shell-outline-width);\n--_aps-line-color: var(--tanrei-comp-app-shell-outline-color);\n--_aps-menu: hidden;\n--_aps-top: var(--tanrei-app-shell-scroll-offset, 0px);\n--_aps-view: calc(100vh - var(--_aps-top));\n--_aps-view: calc(100dvh - var(--_aps-top));\ndisplay: grid;\ngrid-template-columns: [frame-start] auto [main-start] minmax(0, 1fr) [aside-start] auto [frame-end];\ngrid-template-rows: [announcement] auto [header] auto [before] auto [main] minmax(0, 1fr) [after] auto [footer] auto [bar] auto [frame-end];\nbox-sizing: border-box;\nposition: relative;\nmin-inline-size: 0;\nmin-block-size: 100vh;\nmin-block-size: 100dvh;\npadding-block-end: var(--_aps-inset-bottom);\nbackground-color: var(--tanrei-comp-app-shell-container-color);\ncolor: var(--tanrei-comp-app-shell-content-color);\n}\n:where(tanrei-app-shell[hidden]) {\ndisplay: none;\n}\n:where(tanrei-app-shell):dir(rtl) {\n--_aps-inset-start: env(safe-area-inset-right, 0px);\n--_aps-inset-end: env(safe-area-inset-left, 0px);\n}\n:where(tanrei-app-shell[main-width='full']) {\n--_aps-centring: 0px;\n}\n:where(tanrei-app-shell[separation='divider']) {\n--_aps-separation: divider;\n}\n:where(tanrei-app-shell[separation='gap']) {\n--_aps-separation: gap;\n}\n:where(tanrei-app-shell):where(:has(> [slot='navigation'])) {\n--_aps-menu: shown;\n}\n:where(tanrei-app-shell):where(:has(> [slot='navigation-bar'])) {\n--_aps-inset-bottom: 0px;\n}\n:where(tanrei-app-shell) > :where([slot='announcement']) {\ngrid-area: announcement / frame-start / auto / frame-end;\nmin-inline-size: 0;\n}\n:where(tanrei-app-shell) > :where([slot='header']) {\ngrid-area: header / frame-start / auto / frame-end;\nmin-inline-size: 0;\nposition: sticky;\ninset-block-start: 0;\nz-index: 1;\n}\n:where(tanrei-app-shell[header-position='static'], tanrei-app-shell[scroll='main']) > :where([slot='header']) {\nposition: static;\n}\n:where(tanrei-app-shell) > :where([slot='navigation']) {\ngrid-area: before / frame-start / footer / main-start;\nmax-inline-size: calc(100vw - var(--tanrei-sys-target-touch));\nposition: sticky;\ninset-block-start: var(--_aps-top);\nalign-self: start;\nblock-size: 0;\nmin-block-size: min(100%, var(--_aps-view));\nmargin-block-end: var(--_aps-footer, 0px);\n}\n:where(tanrei-app-shell) > :where([slot='navigation']:not(tanrei-navigation-drawer)) {\noverflow: auto;\noverscroll-behavior: contain;\n}\n@media (width < 64rem) {\n:where(tanrei-app-shell) > :where([slot='navigation']:not(tanrei-navigation-drawer)),\n:where(tanrei-app-shell) > :where(tanrei-navigation-drawer[slot='navigation']:not(:defined, [collapsible])) {\ndisplay: none;\n}\n}\n@media (width < 37.5rem) {\n:where(tanrei-app-shell) > :where(tanrei-navigation-drawer[slot='navigation']:not(:defined)) {\ndisplay: none;\n}\n}\n:where(tanrei-app-shell) > :where(main, [role='main']) {\ngrid-area: main / main-start / auto / frame-end;\nbox-sizing: border-box;\nmin-inline-size: 0;\npadding-block: var(--tanrei-comp-app-shell-main-padding-block);\npadding-inline: max(var(--_aps-inline-start), var(--_aps-centring)) max(var(--_aps-inline-end), var(--_aps-centring));\n}\n:where(tanrei-app-shell) > :where(main:focus, [role='main']:focus) {\noutline: none;\n}\n:where(tanrei-app-shell) > :where([slot='aside']) {\ngrid-area: after / main-start / auto / frame-end;\nbox-sizing: border-box;\nmin-inline-size: 0;\nmargin-inline: max(var(--_aps-inline-start), var(--_aps-centring)) max(var(--_aps-inline-end), var(--_aps-centring));\nmargin-block-start: calc((var(--tanrei-comp-app-shell-aside-gap) - var(--_aps-line)) / 2 - var(--tanrei-comp-app-shell-main-padding-block));\nborder-block-start: var(--_aps-line) solid var(--_aps-line-color);\npadding-block: calc((var(--tanrei-comp-app-shell-aside-gap) - var(--_aps-line)) / 2) var(--tanrei-comp-app-shell-main-padding-block);\n}\n:where(tanrei-app-shell[aside-order='before']) > :where([slot='aside']) {\ngrid-row: before;\nmargin-block: 0 calc((var(--tanrei-comp-app-shell-aside-gap) - var(--_aps-line)) / 2 - var(--tanrei-comp-app-shell-main-padding-block));\nborder-block-start: 0;\nborder-block-end: var(--_aps-line) solid var(--_aps-line-color);\npadding-block: var(--tanrei-comp-app-shell-main-padding-block) calc((var(--tanrei-comp-app-shell-aside-gap) - var(--_aps-line)) / 2);\n}\n:where(tanrei-app-shell) > :where([slot='footer']) {\ngrid-area: footer / frame-start / auto / frame-end;\nbox-sizing: border-box;\nmin-inline-size: 0;\nborder-block-start: var(--_aps-line) solid var(--_aps-line-color);\npadding-block: calc(var(--tanrei-comp-app-shell-footer-padding-block) - var(--_aps-line)) var(--tanrei-comp-app-shell-footer-padding-block);\npadding-inline: var(--_aps-inline-start) var(--_aps-inline-end);\nposition: relative;\nz-index: 1;\nbackground-color: var(--tanrei-comp-app-shell-container-color);\n}\n:where(tanrei-app-shell) > :where([slot='navigation-bar']) {\ngrid-area: bar / frame-start / auto / frame-end;\nmin-inline-size: 0;\nposition: sticky;\ninset-block-end: 0;\nz-index: 1;\n}\n@container style(--_aps-menu: hidden) {\n:where(tanrei-app-shell) :where([data-app-shell-menu]) {\ndisplay: none;\n}\n}\n:where(tanrei-app-shell[data-menu='hidden']) :where([data-app-shell-menu]) {\ndisplay: none;\n}\n:where(tanrei-app-shell) > [slot='skip-link'] {\nposition: absolute;\noverflow: hidden;\ninline-size: var(--tanrei-sys-border-hairline);\nblock-size: var(--tanrei-sys-border-hairline);\nclip-path: inset(50%);\nwhite-space: nowrap;\n}\n:where(tanrei-app-shell) > [slot='skip-link']:focus-visible {\nposition: fixed;\nz-index: 2;\noverflow: visible;\ninset-block-start: calc(env(safe-area-inset-top, 0px) + var(--tanrei-comp-app-shell-skip-link-offset) + var(--tanrei-comp-app-shell-skip-link-container-padding-block));\ninset-inline-start: calc(var(--_aps-inset-start) + var(--tanrei-comp-app-shell-skip-link-offset) + var(--tanrei-comp-app-shell-skip-link-container-padding-inline));\ninline-size: auto;\nblock-size: auto;\nmax-inline-size: calc(100vw - 2 * (var(--tanrei-comp-app-shell-skip-link-offset) + var(--tanrei-comp-app-shell-skip-link-container-padding-inline)) - var(--_aps-inset-start) - var(--_aps-inset-end));\nclip-path: none;\nwhite-space: normal;\nfont: var(--tanrei-comp-app-shell-skip-link-label-typescale-font);\nletter-spacing: var(--tanrei-comp-app-shell-skip-link-label-typescale-letter-spacing);\n}\n:where(tanrei-app-shell) > [slot='skip-link']:focus-visible::after {\n--tanrei-corner-pill: 0;\n}\n:where(tanrei-app-shell) > [slot='skip-link']:focus-visible::after {\n--_corner-scale: 1;\nborder-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale));\n}\n@supports (corner-shape: superellipse(log(2, 2))) {\n:where(tanrei-app-shell) > [slot='skip-link']:focus-visible::after {\n--_corner-smoothing: calc(var(--tanrei-sys-shape-corner-smoothing, 0) * (1 - var(--tanrei-corner-pill, 0)));\n--_corner-scale: calc(1 + 0.4 * var(--_corner-smoothing));\ncorner-shape: superellipse(log(calc(2 + var(--_corner-smoothing)), 2));\n}\n}\n:where(tanrei-app-shell) > [slot='skip-link']:focus-visible::after {\ncontent: '';\nposition: absolute;\nz-index: -1;\ninset-block: calc(-1 * var(--tanrei-comp-app-shell-skip-link-container-padding-block));\ninset-inline: calc(-1 * var(--tanrei-comp-app-shell-skip-link-container-padding-inline));\nbox-sizing: border-box;\nbackground-color: var(--tanrei-comp-app-shell-skip-link-container-color);\nbox-shadow: var(--tanrei-comp-app-shell-skip-link-container-elevation);\n--tanrei-corner-radius: var(--tanrei-comp-app-shell-skip-link-container-shape);\n--tanrei-corner-pill: var(--tanrei-comp-app-shell-skip-link-container-shape-pill, 0);\n}\n@media (width >= 37.5rem) {\n:where(tanrei-app-shell) {\n--tanrei-app-shell-window-class: medium;\n--_aps-gutter: var(--tanrei-comp-app-shell-gutter-medium);\n--_aps-inset-bottom: env(safe-area-inset-bottom, 0px);\n}\n:where(tanrei-app-shell):where(:has(> [slot='navigation'][collapsible])) {\n--_aps-menu: hidden;\n}\n:where(tanrei-app-shell) > :where(tanrei-navigation-drawer[slot='navigation'][collapsible]:not(:defined)) {\ninline-size: var(--tanrei-comp-navigation-drawer-collapsed-container-width);\n}\n:where(tanrei-app-shell) > :where([slot='navigation-bar']) {\ndisplay: none;\n}\n}\n@media (width >= 64rem) {\n:where(tanrei-app-shell) {\n--tanrei-app-shell-window-class: expanded;\n--_aps-gutter: var(--tanrei-comp-app-shell-gutter-expanded);\n}\n:where(tanrei-app-shell):where(:has(> [slot='navigation'])) {\n--_aps-menu: hidden;\n}\n:where(tanrei-app-shell) > :where(tanrei-navigation-drawer[slot='navigation']:not(:defined)) {\ninline-size: var(--tanrei-comp-navigation-drawer-container-width);\n}\n:where(tanrei-app-shell) > :where([slot='aside']:not(tanrei-side-sheet)) {\ninline-size: var(--tanrei-comp-app-shell-aside-width);\n}\n:where(tanrei-app-shell) > :where(main, [role='main']) {\ngrid-column: main-start / aside-start;\n}\n:where(tanrei-app-shell) > :where([slot='aside']) {\ngrid-area: before / aside-start / footer / frame-end;\nmargin: 0;\nborder-block: 0;\nborder-inline-start: var(--_aps-line) solid var(--_aps-line-color);\npadding-block: var(--tanrei-comp-app-shell-main-padding-block);\npadding-inline: calc(var(--tanrei-comp-app-shell-aside-padding-inline) - var(--_aps-line)) max(var(--tanrei-comp-app-shell-aside-padding-inline), var(--_aps-inset-end));\nposition: sticky;\ninset-block-start: var(--_aps-top);\nalign-self: start;\nblock-size: 0;\nmin-block-size: min(100%, var(--_aps-view));\nmargin-block-end: var(--_aps-footer, 0px);\noverflow: auto;\noverscroll-behavior: contain;\n}\n}\n:where(tanrei-app-shell[scroll='main']) {\n--_aps-top: 0px;\nblock-size: calc(100vh - env(keyboard-inset-height, 0px));\nblock-size: calc(100dvh - env(keyboard-inset-height, 0px));\nmin-block-size: 0;\noverflow: clip;\n}\n:where(tanrei-app-shell[scroll='main']) > :where(main, [role='main']) {\nmin-block-size: 0;\noverflow: auto;\noverscroll-behavior: contain;\n}\n:where(tanrei-app-shell[scroll='main']) > :where([slot='navigation']) {\nposition: static;\nmin-block-size: 100%;\nmargin-block-end: 0;\n}\n:where(tanrei-app-shell[scroll='main']) > :where([slot='navigation-bar']) {\nposition: static;\n}\n:where(tanrei-app-shell[scroll='main']) > :where([slot='aside']) {\nmargin-block: 0;\npadding-block: calc((var(--tanrei-comp-app-shell-aside-gap) - var(--_aps-line)) / 2);\n}\n@media (width >= 64rem) {\n:where(tanrei-app-shell[scroll='main']) > :where([slot='aside']) {\nposition: static;\nmin-block-size: 100%;\nmargin-block-end: 0;\npadding-block: var(--tanrei-comp-app-shell-main-padding-block);\n}\n}\n@container style(--_aps-separation: gap) {\n:where(tanrei-app-shell) > :where([slot='aside'], [slot='footer']) {\n--_aps-line: 0px;\n}\n}\n:where(tanrei-app-shell[data-separation='gap']) > :where([slot='aside'], [slot='footer']) {\n--_aps-line: 0px;\n}\n:where(tanrei-app-shell) > :where(tanrei-side-sheet[slot='aside']) {\nmargin: 0;\nborder: 0;\npadding: 0;\noverflow: visible;\n}\n:where(:root):where(:has(tanrei-app-shell:not([scroll='main'], [header-position='static']) > [slot='header'])) {\n--tanrei-app-shell-scroll-offset: var(--tanrei-comp-app-bar-container-height-small);\nscroll-padding-block-start: var(--tanrei-app-shell-scroll-offset);\n}\n@media (width < 37.5rem) {\n:where(:root):where(:has(tanrei-app-shell:not([scroll='main']) > [slot='navigation-bar'])) {\n--tanrei-app-shell-scroll-offset-end: var(--tanrei-comp-navigation-bar-container-height);\nscroll-padding-block-end: var(--tanrei-app-shell-scroll-offset-end);\n}\n}\n@media (forced-colors: active) {\n:where(tanrei-app-shell) {\n--_aps-line-color: CanvasText;\nbackground-color: Canvas;\ncolor: CanvasText;\n}\n:where(tanrei-app-shell) > :where([slot='footer']) {\nbackground-color: Canvas;\n}\n:where(tanrei-app-shell) > [slot='skip-link']:focus-visible::after {\nborder: var(--tanrei-comp-app-shell-outline-width) solid CanvasText;\nbackground-color: Canvas;\n}\n}\n@media print {\n:where(tanrei-app-shell) > :where([slot='header'], [slot='navigation'], [slot='aside'], [slot='navigation-bar']) {\nposition: static;\n}\n:where(tanrei-app-shell) > [slot='skip-link'],\n:where(tanrei-app-shell) > :where([slot='navigation'], [slot='navigation-bar']) {\ndisplay: none;\n}\n}\n}";
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
13
|
+
const SCROLLS = ['page', 'main'];
|
|
14
|
+
const HEADER_POSITIONS = ['sticky', 'static'];
|
|
15
|
+
const MAIN_WIDTHS = ['contained', 'full'];
|
|
16
|
+
const ASIDE_ORDERS = ['after', 'before'];
|
|
17
|
+
/** The mark of the header's one button that opens the navigation (APS-6). */
|
|
18
|
+
const MENU = '[data-app-shell-menu]';
|
|
19
|
+
/** What the frame gives the page: the height it keeps over the top of the scrolling view, and over its bottom (APS-17). */
|
|
20
|
+
const OFFSET = '--tanrei-app-shell-scroll-offset';
|
|
21
|
+
const OFFSET_END = '--tanrei-app-shell-scroll-offset-end';
|
|
22
|
+
/** The footer's measured height, for the stylesheet (APS-11). */
|
|
23
|
+
const FOOTER = '--_aps-footer';
|
|
24
|
+
let made;
|
|
25
|
+
/** The frame's stylesheet, made once and shared by every root that needs it. */
|
|
26
|
+
function sheet() {
|
|
27
|
+
if (made !== undefined)
|
|
28
|
+
return made;
|
|
29
|
+
if (typeof CSSStyleSheet === 'undefined' || !SHELL_CSS)
|
|
30
|
+
return (made = null);
|
|
31
|
+
made = new CSSStyleSheet();
|
|
32
|
+
try {
|
|
33
|
+
made.replaceSync(SHELL_CSS);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// A browser that cannot construct it: the page's own copy of app-shell.css lays the frame out.
|
|
37
|
+
}
|
|
38
|
+
return made;
|
|
39
|
+
}
|
|
40
|
+
/** Writes an attribute only when it differs. */
|
|
41
|
+
function mark(element, name, value) {
|
|
42
|
+
if (value === null) {
|
|
43
|
+
if (element.hasAttribute(name))
|
|
44
|
+
element.removeAttribute(name);
|
|
45
|
+
}
|
|
46
|
+
else if (element.getAttribute(name) !== value)
|
|
47
|
+
element.setAttribute(name, value);
|
|
48
|
+
}
|
|
49
|
+
/** Whether `element` is drawn: it, and everything it stands in, has a box. */
|
|
50
|
+
const drawn = (element) => element.getClientRects().length > 0;
|
|
51
|
+
/** The frames that have measured something over the top or the bottom of the page: the last one to measure wins, and the last to leave takes the value back. */
|
|
52
|
+
const measured = new Map();
|
|
53
|
+
function publish(owner, name, size) {
|
|
54
|
+
const owners = measured.get(name) ?? new Set();
|
|
55
|
+
measured.set(name, owners);
|
|
56
|
+
const root = document.documentElement;
|
|
57
|
+
if (size === null) {
|
|
58
|
+
if (!owners.delete(owner))
|
|
59
|
+
return;
|
|
60
|
+
if (!owners.size)
|
|
61
|
+
root.style.removeProperty(name);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
owners.add(owner);
|
|
65
|
+
const value = `${Math.round(size * 100) / 100}px`;
|
|
66
|
+
if (root.style.getPropertyValue(name) !== value)
|
|
67
|
+
root.style.setProperty(name, value);
|
|
68
|
+
}
|
|
69
|
+
let ids = 0;
|
|
70
|
+
/**
|
|
71
|
+
* Frames a page or an app: places a header, the navigation, the main content, an aside and a footer, decides from the
|
|
72
|
+
* window's width how each of them is shown, and lets a keyboard reach the content in one step. It draws the frame and
|
|
73
|
+
* none of what stands in it.
|
|
74
|
+
*
|
|
75
|
+
* Contract: specs/app-shell.spec.json. The element has **no shadow root**: it is the frame around the product's own
|
|
76
|
+
* regions, which stay in the document and keep their semantics — a `<header>` is the page's banner and the one
|
|
77
|
+
* `<main>` its main landmark for a screen reader, a crawler and a page without script alike.
|
|
78
|
+
*
|
|
79
|
+
* ```html
|
|
80
|
+
* <tanrei-app-shell aside-order="before" aside-label="On this page">
|
|
81
|
+
* <a class="tanrei-link" data-standalone slot="skip-link" href="#main">Skip to content</a>
|
|
82
|
+
* <div slot="announcement">…a callout…</div>
|
|
83
|
+
* <header slot="header">
|
|
84
|
+
* <tanrei-app-bar headline="Tanrei">
|
|
85
|
+
* <tanrei-button slot="navigation" data-app-shell-menu variant="text" label="Menu"><span slot="icon">menu</span></tanrei-button>
|
|
86
|
+
* </tanrei-app-bar>
|
|
87
|
+
* </header>
|
|
88
|
+
* <tanrei-navigation-drawer slot="navigation" responsive collapsible label="Documentation">…</tanrei-navigation-drawer>
|
|
89
|
+
* <aside slot="aside">…</aside>
|
|
90
|
+
* <main id="main" tabindex="-1">…</main>
|
|
91
|
+
* <footer slot="footer">…</footer>
|
|
92
|
+
* <tanrei-navigation-bar slot="navigation-bar" label="Sections">…</tanrei-navigation-bar>
|
|
93
|
+
* </tanrei-app-shell>
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* A region is a child with a `slot` attribute — the region's name; no shadow root reads it — and the main region is
|
|
97
|
+
* the one `<main>` without one. They are written in the order a keyboard walks them (APS-22): the skip link, the
|
|
98
|
+
* announcement, the header, the navigation, the aside while `aside-order` is `before`, the main region, the aside
|
|
99
|
+
* while it is `after`, the footer, the navigation bar. The stylesheet places them by name and never reorders focus.
|
|
100
|
+
*
|
|
101
|
+
* Everything laid out is `@tanrei/web/app-shell.css`, before and without this script (APS-24): the window's class is
|
|
102
|
+
* a media condition, a region the class does not show has no box, and the skip link is an anchor to the main region's
|
|
103
|
+
* id. The element adds the same sheet to the root it is connected to, and what a stylesheet cannot say:
|
|
104
|
+
*
|
|
105
|
+
* - **the class**, as the read-only `windowClass`, the `data-window-class` attribute and `windowclasschange` — from
|
|
106
|
+
* two `matchMedia` listeners of the widths the stylesheet was written with; no resize listener and no frame loop.
|
|
107
|
+
* What the frame holds also inherits it as `--tanrei-app-shell-window-class`, from the stylesheet alone;
|
|
108
|
+
* - **the menu button** — the one icon-only `<tanrei-button data-app-shell-menu>` in the header — which it answers
|
|
109
|
+
* while the navigation has no place in the layout: `navigationOpen` and the `open` of a
|
|
110
|
+
* `<tanrei-navigation-drawer>` in the navigation region become true, the drawer's `close` makes them false again,
|
|
111
|
+
* and the button says `aria-expanded` and what it controls;
|
|
112
|
+
* - **the scroll offset**: the header's measured height as `--tanrei-app-shell-scroll-offset` on the document's root
|
|
113
|
+
* (the stylesheet sets the root's scroll padding from it), and the navigation bar's as
|
|
114
|
+
* `--tanrei-app-shell-scroll-offset-end`, so a link's target and a focused element rest clear of both. The product's
|
|
115
|
+
* own sticky parts read the same properties;
|
|
116
|
+
* - **a landmark** for a region whose element does not give one (`role="banner"` on a header that is not a
|
|
117
|
+
* `<header>`, `aria-label` from `aside-label` on an aside without a name), and `tabindex="-1"` on a `<main>` that
|
|
118
|
+
* lacks it;
|
|
119
|
+
* - the debug reports of APS-4, APS-21 and APS-29.
|
|
120
|
+
*
|
|
121
|
+
* With `scroll="main"` the main region is the scrolling view: name its id in the app bar's `scroll-target`.
|
|
122
|
+
*
|
|
123
|
+
* @tag tanrei-app-shell
|
|
124
|
+
* @slot - The main region: the one `<main>` child without a `slot` attribute. Its `id` is the skip link's destination.
|
|
125
|
+
* @slot skip-link - The skip link: a standalone Link (`class="tanrei-link" data-standalone`) whose `href` is the main region's id, with the product's words. Shown only while it has keyboard focus.
|
|
126
|
+
* @slot announcement - The notice above the header: an element around a callout, across the frame's width.
|
|
127
|
+
* @slot header - The header: a `<header>` around the product's app bar, with the menu button in the bar's navigation slot.
|
|
128
|
+
* @slot navigation - The navigation: a `<tanrei-navigation-drawer responsive>`. Anything else is placed beside the content in an expanded window and is not shown in a narrower one.
|
|
129
|
+
* @slot aside - The aside: an `<aside>` with the product's supporting content, or a side sheet.
|
|
130
|
+
* @slot footer - The footer: a `<footer>` with the product's own layout.
|
|
131
|
+
* @slot navigation-bar - A navigation bar for the bottom edge of a compact window.
|
|
132
|
+
* @fires {CustomEvent<TanreiAppShellWindowClassChangeDetail>} windowclasschange - The frame decided the window's class for the first time, or the window's width changed it: `detail.windowClass` (and `windowClass`) is `compact`, `medium` or `expanded`.
|
|
133
|
+
* @fires {CustomEvent<TanreiAppShellNavigationOpenChangeDetail>} navigationopenchange - The navigation asks to be presented over the content, or to be put away: the menu button was activated (`detail.navigationOpen` true), or the open navigation closed or the window's class changed (false). `navigationOpen` already holds it.
|
|
134
|
+
* @cssprop --tanrei-app-shell-scroll-offset - On the document's root: the height the frame keeps over the top of the page (a sticky header's), for the product's own sticky parts.
|
|
135
|
+
* @cssprop --tanrei-app-shell-scroll-offset-end - On the document's root: the height the frame keeps over the bottom of the page (the navigation bar's).
|
|
136
|
+
* @cssprop --tanrei-app-shell-window-class - Inherited by everything the frame holds: `compact`, `medium` or `expanded`, for a style container query.
|
|
137
|
+
*/
|
|
138
|
+
export class TanreiAppShell extends ReactiveElement {
|
|
139
|
+
constructor() {
|
|
140
|
+
super(...arguments);
|
|
141
|
+
this.availability = new AvailabilityController(this, 'app-shell');
|
|
142
|
+
/**
|
|
143
|
+
* What scrolls: the `scroll` attribute. `page`: the whole page scrolls in the window, the header stays at the top and the navigation and the aside stay in view beside the content. `main`: the frame is exactly as tall as the window and only the main region scrolls inside it.
|
|
144
|
+
* @attr scroll
|
|
145
|
+
*/
|
|
146
|
+
this.scrolls = 'page';
|
|
147
|
+
/** Whether the header stays at the top of the window while the page scrolls (`sticky`) or scrolls away with it (`static`). Ignored while `scroll` is `main`, where the header never moves. */
|
|
148
|
+
this.headerPosition = 'sticky';
|
|
149
|
+
/** `contained`: the main region's content is no wider than the frame's readable width and is centred in its room. `full`: it takes all the room inside the gutters. */
|
|
150
|
+
this.mainWidth = 'contained';
|
|
151
|
+
/** Where the aside stands in reading and focus order, and so where it is drawn when it is not beside the main content: `after` it (below) or `before` it (above). Write the aside on that side of the `<main>` in the markup. */
|
|
152
|
+
this.asideOrder = 'after';
|
|
153
|
+
/** How regions that touch are told apart: `divider` draws the one hairline, `gap` draws nothing; `auto` takes `comp.app-shell.separation`, the design system's answer. */
|
|
154
|
+
this.separation = 'auto';
|
|
155
|
+
/** Whether the navigation is presented over the content, while it has no place of its own in the layout (or only its column). The menu button makes it true; closing the navigation, and any change of the window's class, makes it false. */
|
|
156
|
+
this.navigationOpen = false;
|
|
157
|
+
/** Names the aside for assistive technology where its element has no name of its own. */
|
|
158
|
+
this.asideLabel = '';
|
|
159
|
+
/** APS-2: the two widths the stylesheet was written with, as media queries, and what stops listening. */
|
|
160
|
+
this.widths = null;
|
|
161
|
+
this.decided = null;
|
|
162
|
+
/** APS-3: a `windowclasschange` owed once the class it names is drawn. */
|
|
163
|
+
this.announce = false;
|
|
164
|
+
this.mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(() => this.read());
|
|
165
|
+
/** The navigation's `collapsible` decides its presentation in a medium window (APS-4). */
|
|
166
|
+
this.navigationMutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(() => this.read());
|
|
167
|
+
this.sizes = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver((entries) => this.resized(entries));
|
|
168
|
+
/** The regions read last. */
|
|
169
|
+
this.header = null;
|
|
170
|
+
this.bar = null;
|
|
171
|
+
this.footer = null;
|
|
172
|
+
/** APS-23: what last took focus in the frame, until focus goes elsewhere by a person's doing. */
|
|
173
|
+
this.focused = null;
|
|
174
|
+
this.drawer = null;
|
|
175
|
+
this.navigation = null;
|
|
176
|
+
/** The elements the frame gave a role, a name or a tab index, and what it gave: taken back when they leave it. */
|
|
177
|
+
this.given = new Map();
|
|
178
|
+
this.menuStated = null;
|
|
179
|
+
this.menuAwaited = null;
|
|
180
|
+
this.awaitingParse = false;
|
|
181
|
+
this.onWidth = () => this.decide();
|
|
182
|
+
this.onFocusIn = (event) => {
|
|
183
|
+
const [target] = event.composedPath();
|
|
184
|
+
this.focused = target instanceof Element ? target : null;
|
|
185
|
+
};
|
|
186
|
+
/** Focus that leaves an element which is still drawn was moved by a person; one that is no longer drawn lost it to the layout. */
|
|
187
|
+
this.onFocusOut = (event) => {
|
|
188
|
+
const [target] = event.composedPath();
|
|
189
|
+
if (target instanceof Element && target === this.focused && drawn(target) && !(event.relatedTarget instanceof Element && this.holds(event.relatedTarget)))
|
|
190
|
+
this.focused = null;
|
|
191
|
+
};
|
|
192
|
+
/** APS-7: the menu button opens the navigation over the content. */
|
|
193
|
+
this.onClick = (event) => {
|
|
194
|
+
const path = event.composedPath();
|
|
195
|
+
// APS-20: the skip link moves focus to the main region itself.
|
|
196
|
+
const skip = path.find((node) => node instanceof Element && node.parentNode === this && node.getAttribute('slot') === 'skip-link');
|
|
197
|
+
if (skip) {
|
|
198
|
+
// A plain activation only: a press that opens the link elsewhere is the browser's.
|
|
199
|
+
if (!event.defaultPrevented && event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey && this.skip(skip))
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const menu = this.menu;
|
|
204
|
+
if (!menu || !path.includes(menu) || !this.menuShown)
|
|
205
|
+
return;
|
|
206
|
+
this.setOpen(true, true);
|
|
207
|
+
this.syncNavigation();
|
|
208
|
+
};
|
|
209
|
+
/** APS-7: the open navigation closed — by its scrim, Escape, a destination, a drag or the platform's back (NVD-20, NVD-21). */
|
|
210
|
+
this.onDrawerClose = () => {
|
|
211
|
+
const menu = this.menu;
|
|
212
|
+
const told = this.setOpen(false, true);
|
|
213
|
+
if (!told || !menu)
|
|
214
|
+
return;
|
|
215
|
+
// The drawer gives focus back to where it was (NVD-22); a press that gave the button no focus (Safari does not
|
|
216
|
+
// focus a button that is clicked) left it nowhere, and the menu button is where it belongs.
|
|
217
|
+
void (this.drawer?.updateComplete ?? Promise.resolve()).then(() => {
|
|
218
|
+
const active = document.activeElement;
|
|
219
|
+
if (this.menuShown && (!active || active === document.body || active === this.drawer))
|
|
220
|
+
menu.focus();
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
/** APS-4: the column's own menu button widened it over the content, or narrowed it again (NVD-37). */
|
|
224
|
+
this.onDrawerForm = () => {
|
|
225
|
+
const drawer = this.drawer;
|
|
226
|
+
if (!drawer || this.presentation !== 'column')
|
|
227
|
+
return;
|
|
228
|
+
this.setOpen(!!drawer.open, true);
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
static { this.properties = {
|
|
232
|
+
// The defaults are not reflected: a frame that is defined is the frame that was written.
|
|
233
|
+
// `scroll` is the attribute; the property cannot have that name, which is every element's `scroll()` method.
|
|
234
|
+
scrolls: { type: String, attribute: 'scroll', reflect: true, useDefault: true },
|
|
235
|
+
headerPosition: { type: String, attribute: 'header-position', reflect: true, useDefault: true },
|
|
236
|
+
mainWidth: { type: String, attribute: 'main-width', reflect: true, useDefault: true },
|
|
237
|
+
asideOrder: { type: String, attribute: 'aside-order', reflect: true, useDefault: true },
|
|
238
|
+
separation: { type: String, reflect: true, useDefault: true },
|
|
239
|
+
navigationOpen: { type: Boolean, attribute: 'navigation-open', reflect: true },
|
|
240
|
+
asideLabel: { type: String, attribute: 'aside-label' },
|
|
241
|
+
}; }
|
|
242
|
+
/** No shadow root: the regions are the document's. */
|
|
243
|
+
createRenderRoot() {
|
|
244
|
+
return this;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* APS-2, APS-3: the class of the window's current width — `compact`, `medium` or `expanded` — or null until it is
|
|
248
|
+
* decided. Read-only, derived from the width alone and never stored in a prop; reflected as the `data-window-class`
|
|
249
|
+
* attribute.
|
|
250
|
+
*/
|
|
251
|
+
get windowClass() {
|
|
252
|
+
return this.decided;
|
|
253
|
+
}
|
|
254
|
+
connectedCallback() {
|
|
255
|
+
// Asked for before the element's own first update is (which `super` asks for): the frames connected in one turn
|
|
256
|
+
// are all read before any of them is drawn.
|
|
257
|
+
this.watchTogether();
|
|
258
|
+
super.connectedCallback();
|
|
259
|
+
adoptUnlessDrawn(this, sheet(), '--_aps-breakpoint-medium');
|
|
260
|
+
this.mutations?.observe(this, { childList: true });
|
|
261
|
+
this.addEventListener('click', this.onClick);
|
|
262
|
+
this.addEventListener('focusin', this.onFocusIn);
|
|
263
|
+
this.addEventListener('focusout', this.onFocusOut);
|
|
264
|
+
if (this.hasUpdated)
|
|
265
|
+
this.read();
|
|
266
|
+
}
|
|
267
|
+
disconnectedCallback() {
|
|
268
|
+
super.disconnectedCallback();
|
|
269
|
+
this.mutations?.disconnect();
|
|
270
|
+
this.navigationMutations?.disconnect();
|
|
271
|
+
this.sizes?.disconnect();
|
|
272
|
+
this.removeEventListener('click', this.onClick);
|
|
273
|
+
this.removeEventListener('focusin', this.onFocusIn);
|
|
274
|
+
this.removeEventListener('focusout', this.onFocusOut);
|
|
275
|
+
this.focused = null;
|
|
276
|
+
this.style.removeProperty(FOOTER);
|
|
277
|
+
this.unwatch();
|
|
278
|
+
this.listen(null);
|
|
279
|
+
this.header = this.bar = this.footer = this.navigation = null;
|
|
280
|
+
publish(this, OFFSET, null);
|
|
281
|
+
publish(this, OFFSET_END, null);
|
|
282
|
+
for (const [element, names] of this.given)
|
|
283
|
+
for (const name of names)
|
|
284
|
+
element.removeAttribute(name);
|
|
285
|
+
this.given.clear();
|
|
286
|
+
}
|
|
287
|
+
// ---- APS-2, APS-3: the window's class ----
|
|
288
|
+
/** The two widths are read back from the stylesheet that lays the frame out, so the two can never disagree. */
|
|
289
|
+
watch() {
|
|
290
|
+
this.takeWidths(this.readWidths());
|
|
291
|
+
}
|
|
292
|
+
/** The frames connected in this turn, whose widths are read together (`watchTogether`). */
|
|
293
|
+
static { this.connecting = new Set(); }
|
|
294
|
+
/**
|
|
295
|
+
* `watch()` for a frame that was just connected: in ONE microtask after the script that connected it, for every
|
|
296
|
+
* frame of that turn — all read, then all told their class — and before any of them is drawn or a frame painted.
|
|
297
|
+
* Read in its own connection, each frame had the page styled for itself, after the class the one before it had just
|
|
298
|
+
* written (fifty at once: fifty style passes). A page has one frame; a gallery of them has many.
|
|
299
|
+
*/
|
|
300
|
+
watchTogether() {
|
|
301
|
+
const due = TanreiAppShell.connecting;
|
|
302
|
+
if (!due.size) {
|
|
303
|
+
queueMicrotask(() => {
|
|
304
|
+
const all = [...due];
|
|
305
|
+
due.clear();
|
|
306
|
+
const read = all.map((each) => each.readWidths());
|
|
307
|
+
all.forEach((each, index) => each.takeWidths(read[index]));
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
due.add(this);
|
|
311
|
+
}
|
|
312
|
+
/** The reading half of `watch()`: the widths the frame's stylesheet was written for, and the tokens' here. */
|
|
313
|
+
readWidths() {
|
|
314
|
+
if (!this.isConnected || typeof matchMedia !== 'function')
|
|
315
|
+
return null;
|
|
316
|
+
const style = getComputedStyle(this);
|
|
317
|
+
const [medium, expanded] = ['medium', 'expanded'].map((name) => style.getPropertyValue(`--_aps-breakpoint-${name}`).trim());
|
|
318
|
+
// Before its stylesheet has arrived nothing names the widths: nothing is decided on a guess (APS-24).
|
|
319
|
+
if (!medium || !expanded)
|
|
320
|
+
return null;
|
|
321
|
+
const tokens = debugBuild() ? ['medium', 'expanded'].map((name) => style.getPropertyValue(`--tanrei-comp-app-shell-breakpoint-${name}`).trim()).join(' ') : '';
|
|
322
|
+
return { medium, expanded, tokens };
|
|
323
|
+
}
|
|
324
|
+
/** The writing half of `watch()`: the widths are listened to, and the window's class decided. */
|
|
325
|
+
takeWidths(read) {
|
|
326
|
+
if (!read || !this.isConnected)
|
|
327
|
+
return;
|
|
328
|
+
const { medium, expanded, tokens } = read;
|
|
329
|
+
const text = `${medium} ${expanded}`;
|
|
330
|
+
if (this.widths?.text !== text) {
|
|
331
|
+
this.unwatch();
|
|
332
|
+
this.widths = { medium: matchMedia(`(min-width: ${medium})`), expanded: matchMedia(`(min-width: ${expanded})`), text };
|
|
333
|
+
this.widths.medium.addEventListener('change', this.onWidth);
|
|
334
|
+
this.widths.expanded.addEventListener('change', this.onWidth);
|
|
335
|
+
// The stylesheet's conditions are written by the build from the tokens of one system: a system or a layer that
|
|
336
|
+
// moves the widths needs the stylesheet written for it, or the frame and a navigation drawer in it part.
|
|
337
|
+
if (debugBuild() && tokens.trim() && tokens !== text) {
|
|
338
|
+
report(this, 'APS-2', `the stylesheet was written for the window widths ${text}, and comp.app-shell.breakpoint is ${tokens} here: load the app-shell stylesheet built for this design system`);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
this.decide();
|
|
342
|
+
}
|
|
343
|
+
unwatch() {
|
|
344
|
+
this.widths?.medium.removeEventListener('change', this.onWidth);
|
|
345
|
+
this.widths?.expanded.removeEventListener('change', this.onWidth);
|
|
346
|
+
this.widths = null;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* APS-3, APS-7, APS-23: the class of the window's current width. The first decision is only told. A change closes
|
|
350
|
+
* an open navigation at once and takes focus off what the new arrangement does not show.
|
|
351
|
+
*/
|
|
352
|
+
decide() {
|
|
353
|
+
const widths = this.widths;
|
|
354
|
+
if (!widths)
|
|
355
|
+
return;
|
|
356
|
+
const next = widths.expanded.matches ? 'expanded' : widths.medium.matches ? 'medium' : 'compact';
|
|
357
|
+
const before = this.decided;
|
|
358
|
+
if (next === before)
|
|
359
|
+
return;
|
|
360
|
+
this.decided = next;
|
|
361
|
+
mark(this, 'data-window-class', next);
|
|
362
|
+
this.announce = true;
|
|
363
|
+
if (before !== null) {
|
|
364
|
+
// APS-7: a responsive drawer takes its own overlay down at the same width (NVD-54); the frame's side is told once.
|
|
365
|
+
this.setOpen(false, true);
|
|
366
|
+
// APS-23: focus on something the new arrangement does not show — the menu button, a destination of the
|
|
367
|
+
// navigation bar — goes to the main region. (Where focus was in the navigation, the drawer has kept it: NVD-54.)
|
|
368
|
+
// A browser takes focus from an element as soon as it is no longer drawn, before or after it tells of the new
|
|
369
|
+
// width: what had focus is what the frame last saw take it, unless a person has moved it since.
|
|
370
|
+
const active = deepActive();
|
|
371
|
+
const lost = !active || active === document.body || active === document.documentElement;
|
|
372
|
+
const had = lost ? this.focused : active;
|
|
373
|
+
if (had && this.holds(had) && !drawn(had))
|
|
374
|
+
this.main()?.focus({ preventScroll: true });
|
|
375
|
+
}
|
|
376
|
+
if (this.hasUpdated) {
|
|
377
|
+
this.read();
|
|
378
|
+
this.tell();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/** Whether `element` is in the frame: in its regions, or in a shadow root of something in them. */
|
|
382
|
+
holds(element) {
|
|
383
|
+
for (let at = element; at; at = at.parentNode ?? at.host ?? null)
|
|
384
|
+
if (at === this)
|
|
385
|
+
return true;
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
/** APS-3: `windowclasschange`, once for each class decided. */
|
|
389
|
+
tell() {
|
|
390
|
+
if (!this.announce || !this.decided)
|
|
391
|
+
return;
|
|
392
|
+
this.announce = false;
|
|
393
|
+
this.dispatchEvent(new CustomEvent('windowclasschange', { bubbles: true, detail: { windowClass: this.decided } }));
|
|
394
|
+
}
|
|
395
|
+
// ---- the regions ----
|
|
396
|
+
region(name) {
|
|
397
|
+
return this.querySelector(`:scope > [slot="${name}"]`);
|
|
398
|
+
}
|
|
399
|
+
main() {
|
|
400
|
+
return this.querySelector(':scope > main, :scope > [role="main"]');
|
|
401
|
+
}
|
|
402
|
+
/** APS-4: how the navigation is presented now: beside the content, as its column, or over the content when opened. */
|
|
403
|
+
get presentation() {
|
|
404
|
+
if (!this.navigation || !this.decided)
|
|
405
|
+
return null;
|
|
406
|
+
if (this.decided === 'expanded')
|
|
407
|
+
return 'standard';
|
|
408
|
+
return this.decided === 'medium' && this.navigation.hasAttribute('collapsible') ? 'column' : 'modal';
|
|
409
|
+
}
|
|
410
|
+
/** Gives `element` an attribute it lacks, and remembers that the frame did. */
|
|
411
|
+
give(element, name, value) {
|
|
412
|
+
const names = this.given.get(element) ?? [];
|
|
413
|
+
if (!names.includes(name)) {
|
|
414
|
+
if (element.hasAttribute(name))
|
|
415
|
+
return;
|
|
416
|
+
this.given.set(element, [...names, name]);
|
|
417
|
+
}
|
|
418
|
+
mark(element, name, value);
|
|
419
|
+
}
|
|
420
|
+
takeBack(element, name) {
|
|
421
|
+
const names = this.given.get(element);
|
|
422
|
+
if (!names?.includes(name))
|
|
423
|
+
return;
|
|
424
|
+
element.removeAttribute(name);
|
|
425
|
+
this.given.set(element, names.filter((given) => given !== name));
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Reads the regions the frame holds and writes what follows from them: the landmarks and names their elements lack
|
|
429
|
+
* (APS-21), the main region's tab index (APS-20), what is measured (APS-17), the navigation that is followed
|
|
430
|
+
* (APS-7), and the two choices where the browser cannot query them (APS-6, APS-18). Called when a property, a child
|
|
431
|
+
* or the class changes; it writes only what differs, so it settles.
|
|
432
|
+
*/
|
|
433
|
+
read() {
|
|
434
|
+
if (!this.isConnected)
|
|
435
|
+
return;
|
|
436
|
+
for (const element of [...this.given.keys()]) {
|
|
437
|
+
if (element.parentNode === this)
|
|
438
|
+
continue;
|
|
439
|
+
for (const name of this.given.get(element))
|
|
440
|
+
element.removeAttribute(name);
|
|
441
|
+
this.given.delete(element);
|
|
442
|
+
}
|
|
443
|
+
const header = this.region('header');
|
|
444
|
+
const footer = this.region('footer');
|
|
445
|
+
const aside = this.region('aside');
|
|
446
|
+
const navigation = this.region('navigation');
|
|
447
|
+
const bar = this.region('navigation-bar');
|
|
448
|
+
const mains = this.querySelectorAll(':scope > main, :scope > [role="main"]');
|
|
449
|
+
// APS-21: the landmark of a region whose element does not give it.
|
|
450
|
+
if (header && header.localName !== 'header')
|
|
451
|
+
this.give(header, 'role', 'banner');
|
|
452
|
+
if (footer && footer.localName !== 'footer')
|
|
453
|
+
this.give(footer, 'role', 'contentinfo');
|
|
454
|
+
if (aside) {
|
|
455
|
+
// A side sheet is named by its own headline, and is the landmark itself (SSH-22).
|
|
456
|
+
const names = aside.localName === 'tanrei-side-sheet';
|
|
457
|
+
if (!names && aside.localName !== 'aside')
|
|
458
|
+
this.give(aside, 'role', 'complementary');
|
|
459
|
+
const label = String(this.asideLabel ?? '').trim();
|
|
460
|
+
if (!names && label)
|
|
461
|
+
this.give(aside, 'aria-label', label);
|
|
462
|
+
else
|
|
463
|
+
this.takeBack(aside, 'aria-label');
|
|
464
|
+
if (!names && !aside.hasAttribute('aria-label') && !aside.hasAttribute('aria-labelledby')) {
|
|
465
|
+
report(this, 'APS-21', 'the aside has no name: set aside-label, or aria-label on the aside itself');
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
// APS-20: the main region takes focus when the skip link is followed, and is no stop of the Tab order.
|
|
469
|
+
for (const main of mains)
|
|
470
|
+
this.give(main, 'tabindex', '-1');
|
|
471
|
+
if (debugBuild()) {
|
|
472
|
+
// A frame that is still being parsed is read again when it is whole.
|
|
473
|
+
if (document.readyState === 'loading') {
|
|
474
|
+
if (!this.awaitingParse)
|
|
475
|
+
document.addEventListener('DOMContentLoaded', () => ((this.awaitingParse = false), this.read()), { once: true });
|
|
476
|
+
this.awaitingParse = true;
|
|
477
|
+
}
|
|
478
|
+
else if (mains.length !== 1)
|
|
479
|
+
report(this, 'APS-21', mains.length ? `the frame holds ${mains.length} main regions; a page has one` : 'the frame holds no main region: give it one <main> child without a slot attribute');
|
|
480
|
+
}
|
|
481
|
+
// APS-17: what the frame keeps over the top and the bottom of the page is measured.
|
|
482
|
+
if (header !== this.header || bar !== this.bar || footer !== this.footer) {
|
|
483
|
+
this.sizes?.disconnect();
|
|
484
|
+
this.header = header;
|
|
485
|
+
this.bar = bar;
|
|
486
|
+
this.footer = footer;
|
|
487
|
+
for (const observed of [header, bar, footer])
|
|
488
|
+
if (observed)
|
|
489
|
+
this.sizes?.observe(observed);
|
|
490
|
+
if (!header)
|
|
491
|
+
publish(this, OFFSET, null);
|
|
492
|
+
if (!bar)
|
|
493
|
+
publish(this, OFFSET_END, null);
|
|
494
|
+
if (!footer)
|
|
495
|
+
this.style.removeProperty(FOOTER);
|
|
496
|
+
}
|
|
497
|
+
// APS-4, APS-7: the navigation, and the drawer whose opening and closing the frame follows.
|
|
498
|
+
if (navigation !== this.navigation) {
|
|
499
|
+
this.navigationMutations?.disconnect();
|
|
500
|
+
this.navigation = navigation;
|
|
501
|
+
if (navigation)
|
|
502
|
+
this.navigationMutations?.observe(navigation, { attributes: true, attributeFilter: ['collapsible'] });
|
|
503
|
+
this.listen(navigation?.localName === 'tanrei-navigation-drawer' ? navigation : null);
|
|
504
|
+
}
|
|
505
|
+
const presentation = this.presentation;
|
|
506
|
+
if (navigation && !this.drawer && presentation && presentation !== 'standard') {
|
|
507
|
+
report(this, 'APS-4', 'the navigation of a narrow window needs a navigation drawer: what the navigation region holds cannot present itself over the content, and is not shown');
|
|
508
|
+
}
|
|
509
|
+
if (this.drawer && this.drawer.responsive === false && this.decided) {
|
|
510
|
+
report(this, 'APS-4', 'the navigation drawer in the navigation region is not responsive: set its responsive attribute, so that the window’s class chooses its presentation as it chooses the frame’s');
|
|
511
|
+
}
|
|
512
|
+
this.syncNavigation();
|
|
513
|
+
// APS-6, APS-18: where the browser answers style queries the stylesheet reads both itself, and nothing is written.
|
|
514
|
+
const queries = styleQueries();
|
|
515
|
+
mark(this, 'data-separation', queries ? null : compChoice(this, '--_aps-separation', SEPARATIONS));
|
|
516
|
+
mark(this, 'data-menu', queries ? null : this.menuShown ? 'shown' : 'hidden');
|
|
517
|
+
this.stateMenu();
|
|
518
|
+
}
|
|
519
|
+
// ---- APS-17: the scroll offset ----
|
|
520
|
+
resized(entries) {
|
|
521
|
+
for (const entry of entries) {
|
|
522
|
+
const size = entry.borderBoxSize?.[0]?.blockSize ?? entry.contentRect.height;
|
|
523
|
+
if (entry.target === this.header)
|
|
524
|
+
this.measure(size);
|
|
525
|
+
else if (entry.target === this.bar)
|
|
526
|
+
publish(this, OFFSET_END, this.scrolls !== 'main' && size > 0 ? size : null);
|
|
527
|
+
else if (entry.target === this.footer) {
|
|
528
|
+
// APS-11: where the navigation and the aside stop staying in view (a browser keeps a sticky part inside the
|
|
529
|
+
// frame, not inside its row: the stylesheet takes this much off the end of what it may reach).
|
|
530
|
+
const value = `${Math.round(size * 100) / 100}px`;
|
|
531
|
+
if (this.style.getPropertyValue(FOOTER) !== value)
|
|
532
|
+
this.style.setProperty(FOOTER, value);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
/** The header's height, while the header is kept over the top of the page; nothing otherwise (APS-17). */
|
|
537
|
+
measure(size = this.header?.getBoundingClientRect().height) {
|
|
538
|
+
const kept = this.scrolls !== 'main' && this.headerPosition !== 'static';
|
|
539
|
+
publish(this, OFFSET, kept && size !== undefined && size > 0 ? size : null);
|
|
540
|
+
}
|
|
541
|
+
// ---- APS-6, APS-7: the menu button and the navigation ----
|
|
542
|
+
/** APS-6: whether the menu button is shown: only while the navigation has no place in the layout. */
|
|
543
|
+
get menuShown() {
|
|
544
|
+
return this.presentation === 'modal';
|
|
545
|
+
}
|
|
546
|
+
get menu() {
|
|
547
|
+
return this.header?.querySelector(MENU) ?? null;
|
|
548
|
+
}
|
|
549
|
+
/** The drawer whose `close` and `expandedchange` the frame follows: one at a time. */
|
|
550
|
+
listen(drawer) {
|
|
551
|
+
if (drawer === this.drawer)
|
|
552
|
+
return;
|
|
553
|
+
this.drawer?.removeEventListener('close', this.onDrawerClose);
|
|
554
|
+
this.drawer?.removeEventListener('expandedchange', this.onDrawerForm);
|
|
555
|
+
this.drawer = drawer;
|
|
556
|
+
drawer?.addEventListener('close', this.onDrawerClose);
|
|
557
|
+
drawer?.addEventListener('expandedchange', this.onDrawerForm);
|
|
558
|
+
}
|
|
559
|
+
/** Makes `navigationOpen` `open`, and tells it once where the value changed. */
|
|
560
|
+
setOpen(open, tell) {
|
|
561
|
+
if (this.navigationOpen === open)
|
|
562
|
+
return false;
|
|
563
|
+
this.navigationOpen = open;
|
|
564
|
+
if (tell)
|
|
565
|
+
this.dispatchEvent(new CustomEvent('navigationopenchange', { bubbles: true, detail: { navigationOpen: open } }));
|
|
566
|
+
return true;
|
|
567
|
+
}
|
|
568
|
+
/** APS-7: the drawer is open while `navigationOpen` is, where it is presented over the content; a drawer beside it is left alone. */
|
|
569
|
+
syncNavigation() {
|
|
570
|
+
const drawer = this.drawer;
|
|
571
|
+
const presentation = this.presentation;
|
|
572
|
+
if (!drawer || !presentation || presentation === 'standard')
|
|
573
|
+
return;
|
|
574
|
+
if (drawer.open !== this.navigationOpen)
|
|
575
|
+
drawer.open = this.navigationOpen;
|
|
576
|
+
}
|
|
577
|
+
/** APS-7: the menu button says whether the navigation it controls is open, on the button it draws. */
|
|
578
|
+
stateMenu() {
|
|
579
|
+
const menu = this.menuShown ? this.menu : null;
|
|
580
|
+
// A Tanrei Button draws its button in its shadow root, which is what is focused and read; a native one is itself.
|
|
581
|
+
const custom = !!menu && menu.localName.includes('-');
|
|
582
|
+
const target = menu ? (custom ? (menu.shadowRoot?.querySelector('button, [role="button"]') ?? null) : menu) : null;
|
|
583
|
+
const was = this.menuStated;
|
|
584
|
+
if (was && was !== target) {
|
|
585
|
+
was.removeAttribute('aria-expanded');
|
|
586
|
+
was.removeAttribute('aria-controls');
|
|
587
|
+
if ('ariaControlsElements' in was)
|
|
588
|
+
was.ariaControlsElements = null;
|
|
589
|
+
}
|
|
590
|
+
this.menuStated = target;
|
|
591
|
+
if (menu && !target && this.menuAwaited !== menu) {
|
|
592
|
+
// A button that has not drawn itself yet is stated when it has.
|
|
593
|
+
this.menuAwaited = menu;
|
|
594
|
+
void customElements
|
|
595
|
+
.whenDefined(menu.localName)
|
|
596
|
+
.then(() => menu.updateComplete)
|
|
597
|
+
.then(() => this.isConnected && this.read());
|
|
598
|
+
}
|
|
599
|
+
if (!target)
|
|
600
|
+
return;
|
|
601
|
+
mark(target, 'aria-expanded', String(this.navigationOpen));
|
|
602
|
+
const controlled = this.navigation;
|
|
603
|
+
if (!controlled)
|
|
604
|
+
return;
|
|
605
|
+
if (target.getRootNode() === controlled.getRootNode()) {
|
|
606
|
+
if (!controlled.id)
|
|
607
|
+
controlled.id = `tanrei-app-shell-navigation-${++ids}`;
|
|
608
|
+
mark(target, 'aria-controls', controlled.id);
|
|
609
|
+
}
|
|
610
|
+
else if ('ariaControlsElements' in target) {
|
|
611
|
+
// An id of the page cannot be named from inside the button's shadow root; the element itself can.
|
|
612
|
+
target.ariaControlsElements = [controlled];
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
// ---- APS-20: the skip link ----
|
|
616
|
+
/**
|
|
617
|
+
* APS-20: focus goes to the region the link names — the main region — and its top comes into view below the header,
|
|
618
|
+
* at once, whatever the page says of how it scrolls. The link's own navigation is then not needed, and is not left to
|
|
619
|
+
* follow: a browser that is given the focus here and then follows the fragment starts its next Tab after the first
|
|
620
|
+
* link of the region (Firefox). Without this script the anchor does the same by itself. Returns whether it did.
|
|
621
|
+
*/
|
|
622
|
+
skip(link) {
|
|
623
|
+
const href = link.getAttribute('href') ?? '';
|
|
624
|
+
let target = null;
|
|
625
|
+
if (href.startsWith('#') && href.length > 1) {
|
|
626
|
+
try {
|
|
627
|
+
target = this.getRootNode().getElementById(decodeURIComponent(href.slice(1)));
|
|
628
|
+
}
|
|
629
|
+
catch {
|
|
630
|
+
target = null;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
target ??= this.main();
|
|
634
|
+
if (!target)
|
|
635
|
+
return false;
|
|
636
|
+
if (!target.hasAttribute('tabindex') && target.tabIndex < 0)
|
|
637
|
+
target.setAttribute('tabindex', '-1');
|
|
638
|
+
target.focus({ preventScroll: true });
|
|
639
|
+
// While the main region is the scrolling view (APS-15) its top is its own scroll position.
|
|
640
|
+
if (this.scrolls === 'main' && target.parentNode === this)
|
|
641
|
+
target.scrollTo({ top: 0, behavior: 'instant' });
|
|
642
|
+
else
|
|
643
|
+
target.scrollIntoView({ block: 'start', inline: 'nearest', behavior: 'instant' });
|
|
644
|
+
return document.activeElement === target || target.contains(document.activeElement);
|
|
645
|
+
}
|
|
646
|
+
// ---- changes ----
|
|
647
|
+
willUpdate() {
|
|
648
|
+
// The stylesheet may have arrived since the element was connected (a page that loads it late).
|
|
649
|
+
if (!this.widths)
|
|
650
|
+
this.watch();
|
|
651
|
+
}
|
|
652
|
+
updated(changed) {
|
|
653
|
+
// APS-29: a value the frame does not define renders with the default (no rule matches it); a debug build says so.
|
|
654
|
+
const known = [
|
|
655
|
+
['scrolls', SCROLLS, 'page'],
|
|
656
|
+
['headerPosition', HEADER_POSITIONS, 'sticky'],
|
|
657
|
+
['mainWidth', MAIN_WIDTHS, 'contained'],
|
|
658
|
+
['asideOrder', ASIDE_ORDERS, 'after'],
|
|
659
|
+
];
|
|
660
|
+
for (const [name, values, fallback] of known) {
|
|
661
|
+
const value = String(this[name]);
|
|
662
|
+
if (changed.has(name) && !values.includes(value))
|
|
663
|
+
report(this, 'APS-29', `${name === 'scrolls' ? 'scroll' : name} "${value}" is not a value the app shell defines; it is rendered as "${fallback}"`);
|
|
664
|
+
}
|
|
665
|
+
// APS-18: a separation the frame does not define is auto.
|
|
666
|
+
if (changed.has('separation') && !SEPARATION_VALUES.includes(this.separation)) {
|
|
667
|
+
report(this, 'APS-18', `separation "${this.separation}" is not a value the app shell defines; it is drawn as "auto"`);
|
|
668
|
+
}
|
|
669
|
+
this.read();
|
|
670
|
+
if (changed.has('scrolls') || changed.has('headerPosition'))
|
|
671
|
+
this.measure();
|
|
672
|
+
this.tell();
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
if (!customElements.get('tanrei-app-shell'))
|
|
676
|
+
customElements.define('tanrei-app-shell', TanreiAppShell);
|
|
677
|
+
//# sourceMappingURL=app-shell.js.map
|