@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,638 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
+
import { AvailabilityController, DIRECTION_PROBE, DirectionController, GlyphDrawnController, GlyphMirrorController, PressController, SystemWatchController, glyphMirrors, report, styleQueries, syncFocusStyle, } from '../../primitives/index.js';
|
|
4
|
+
import { LINK_KEYS, readDestination } from '../../primitives/link.js';
|
|
5
|
+
import { debugBuild } from '../../primitives/report.js';
|
|
6
|
+
import { WordsController } from '../../primitives/words.js';
|
|
7
|
+
import { MIRRORED } from '../../styles/icons.js';
|
|
8
|
+
// BRC-11: the levels taken out of the trail are listed in a menu, which the breadcrumbs define wherever they are imported.
|
|
9
|
+
import '../menu/menu.js';
|
|
10
|
+
import { styles } from './breadcrumbs.styles.js';
|
|
11
|
+
import { adoptUnlessDrawn } from '../../primitives/sheets.js';
|
|
12
|
+
const LEVELS_CSS = (() => {
|
|
13
|
+
try {
|
|
14
|
+
return "@layer tanrei.components {\n:where(tanrei-breadcrumbs) > :where(a) {\n--tanrei-corner-pill: 0;\n}\n:where(tanrei-breadcrumbs) > :where(a) {\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-breadcrumbs) > :where(a) {\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-breadcrumbs) {\n--_brc-start: left;\n}\n:where(tanrei-breadcrumbs:dir(rtl)) {\n--_brc-start: right;\n}\n:where(tanrei-breadcrumbs:not(:defined)) {\ndisplay: flex;\nflex-wrap: wrap;\nalign-items: flex-start;\nrow-gap: var(--tanrei-comp-breadcrumbs-row-gap);\nbox-sizing: border-box;\nmin-inline-size: 0;\nmax-inline-size: 100%;\n}\n:where(tanrei-breadcrumbs) > :where(a, span) {\n--_brc-line: calc(var(--tanrei-comp-breadcrumbs-label-typescale-font-size) * var(--tanrei-comp-breadcrumbs-label-typescale-line-height));\nposition: relative;\nisolation: isolate;\ndisplay: block;\nflex: 0 1 auto;\nbox-sizing: border-box;\nmin-inline-size: 0;\nmargin: 0;\npadding: 0;\nfont: var(--tanrei-comp-breadcrumbs-label-typescale-font);\nletter-spacing: var(--tanrei-comp-breadcrumbs-label-typescale-letter-spacing);\ncolor: var(--tanrei-comp-breadcrumbs-label-color);\ntext-decoration-line: none;\noverflow-wrap: anywhere;\ntext-align: var(--_brc-start);\nunicode-bidi: plaintext;\n-webkit-tap-highlight-color: transparent;\n&:where([aria-current]:not([aria-current='false'])):where(:last-child) {\ncolor: var(--tanrei-comp-breadcrumbs-current-content-color);\nfont-weight: var(--tanrei-comp-breadcrumbs-label-typescale-font-weight-emphasized);\n}\n&:where(:any-link:not([href=''], [href^='javascript:' i])) {\n--_brc-container: var(--tanrei-comp-breadcrumbs-item-container-color);\n--_brc-content: var(--tanrei-comp-breadcrumbs-item-content-color);\n--_brc-hovered-container: var(--tanrei-comp-breadcrumbs-item-hovered-container-color);\n--_brc-hovered-content: var(--tanrei-comp-breadcrumbs-item-hovered-content-color);\n--_brc-focused-container: var(--tanrei-comp-breadcrumbs-item-focused-container-color);\n--_brc-focused-content: var(--tanrei-comp-breadcrumbs-item-focused-content-color);\n--_brc-pressed-container: var(--tanrei-comp-breadcrumbs-item-pressed-container-color);\n--_brc-pressed-content: var(--tanrei-comp-breadcrumbs-item-pressed-content-color);\n--_brc-now-container: var(--_brc-container);\n--_brc-now-content: var(--_brc-content);\n--_brc-target: var(--tanrei-sys-target-pointer);\n--tanrei-corner-radius: var(--tanrei-comp-breadcrumbs-container-shape);\n--tanrei-corner-pill: var(--tanrei-comp-breadcrumbs-container-shape-pill, 0);\ncolor: var(--_brc-now-content);\nbackground-color: var(--_brc-now-container);\nbackground-image: var(--_brc-held-image);\nbackground-clip: var(--_brc-held-clip);\n--_brc-line-rest: underline;\n--_brc-line-state: underline;\ntext-decoration-line: var(--_brc-line-rest);\ntext-decoration-thickness: var(--tanrei-comp-breadcrumbs-underline-width);\ntext-underline-offset: var(--tanrei-comp-breadcrumbs-underline-offset);\ncursor: pointer;\n--_brc-held-image: none;\n--_brc-held-clip: border-box;\ntransition:\n--_brc-held-image 0s linear var(--tanrei-sys-motion-duration-press-hold),\n--_brc-held-clip 0s linear var(--tanrei-sys-motion-duration-press-hold),\nbackground-color var(--tanrei-comp-breadcrumbs-motion-state-duration) var(--tanrei-comp-breadcrumbs-motion-state-easing),\ncolor var(--tanrei-comp-breadcrumbs-motion-state-duration) var(--tanrei-comp-breadcrumbs-motion-state-easing),\nopacity var(--tanrei-comp-breadcrumbs-motion-state-duration) var(--tanrei-comp-breadcrumbs-motion-state-easing);\ntransition-behavior: allow-discrete;\n@media (pointer: coarse) {\n--_brc-target: var(--tanrei-sys-target-touch);\n}\n}\n@container style(--tanrei-comp-breadcrumbs-underline-visibility: hover) {\n& {\n--_brc-line-rest: none;\n}\n}\n@container style(--tanrei-comp-breadcrumbs-underline-visibility: never) {\n& {\n--_brc-line-rest: none;\n--_brc-line-state: none;\n}\n}\n:where(tanrei-breadcrumbs[data-tanrei-underline='hover']) > & {\n--_brc-line-rest: none;\n}\n:where(tanrei-breadcrumbs[data-tanrei-underline='never']) > & {\n--_brc-line-rest: none;\n--_brc-line-state: none;\n}\n:where(tanrei-breadcrumbs[underline='always']) > & {\n--_brc-line-rest: underline;\n--_brc-line-state: underline;\n}\n:where(tanrei-breadcrumbs[underline='hover']) > & {\n--_brc-line-rest: none;\n--_brc-line-state: underline;\n}\n:where(tanrei-breadcrumbs[underline='never']) > & {\n--_brc-line-rest: none;\n--_brc-line-state: none;\n}\n&:where(:any-link:not([href=''], [href^='javascript:' i])):where([aria-current]:not([aria-current='false'])):where(:last-child) {\n--_brc-container: var(--tanrei-comp-breadcrumbs-current-container-color);\n--_brc-content: var(--tanrei-comp-breadcrumbs-current-content-color);\n--_brc-hovered-container: var(--tanrei-comp-breadcrumbs-current-hovered-container-color);\n--_brc-hovered-content: var(--tanrei-comp-breadcrumbs-current-hovered-content-color);\n--_brc-focused-container: var(--tanrei-comp-breadcrumbs-current-focused-container-color);\n--_brc-focused-content: var(--tanrei-comp-breadcrumbs-current-focused-content-color);\n--_brc-pressed-container: var(--tanrei-comp-breadcrumbs-current-pressed-container-color);\n--_brc-pressed-content: var(--tanrei-comp-breadcrumbs-current-pressed-content-color);\n--_brc-line-rest: none;\n--_brc-line-state: none;\n}\n&:where([data-icon]:not([data-icon=''])) {\nunicode-bidi: isolate;\n}\n&:where([data-icon]:not([data-icon='']))::before {\ncontent: attr(data-icon);\ncontent: attr(data-icon) / '';\ndisplay: inline-block;\nflex: none;\noverflow: hidden;\ninline-size: var(--tanrei-comp-breadcrumbs-icon-size);\nblock-size: var(--tanrei-comp-breadcrumbs-icon-size);\nmargin-block-start: calc((var(--_brc-line) - var(--tanrei-comp-breadcrumbs-icon-size)) / 2);\nmargin-inline-end: var(--tanrei-comp-breadcrumbs-container-gap);\nvertical-align: top;\nfont-family: var(--tanrei-sys-icon-family-unselected);\nfont-size: var(--tanrei-comp-breadcrumbs-icon-size);\nfont-style: normal;\nfont-weight: normal;\nline-height: 1;\nletter-spacing: normal;\ntext-transform: none;\nwhite-space: nowrap;\nword-wrap: normal;\ndirection: ltr;\n-webkit-user-select: none;\nuser-select: none;\nfont-feature-settings: 'liga';\n-webkit-font-smoothing: antialiased;\nfont-optical-sizing: auto;\nfont-variation-settings:\n'FILL' var(--tanrei-sys-icon-fill-unselected),\n'wght' var(--tanrei-sys-icon-weight),\n'GRAD' 0;\nopacity: var(--tanrei-icons, 0);\n}\n@supports (font-variation-settings: 'opsz' tan(atan2(1em, 1px))) {\n&:where([data-icon]:not([data-icon='']))::before {\nfont-variation-settings: 'FILL' var(--tanrei-sys-icon-fill-unselected), 'wght' var(--tanrei-sys-icon-weight), 'GRAD' 0, 'opsz' clamp(var(--tanrei-sys-icon-optical-size-min), tan(atan2(var(--tanrei-comp-breadcrumbs-icon-size), 1px)), var(--tanrei-sys-icon-optical-size-max));\n}\n}\n&:where([data-icon]:not([data-icon='']):dir(rtl))::before {\nmargin-inline: var(--tanrei-comp-breadcrumbs-container-gap) 0;\n}\n&:where(:is([data-tanrei-mirrored], [data-mirror='always']):not([data-mirror='never']):dir(rtl))::before {\ntransform: scaleX(-1);\n}\n&:where([data-icon]:not([data-icon=''])):where([data-icon-only]:not([data-icon-only='false'])) {\ndisplay: flex;\nflex: none;\nalign-items: center;\njustify-content: center;\ninline-size: var(--_brc-line);\nblock-size: var(--_brc-line);\nfont-size: 0;\nletter-spacing: 0;\nwhite-space: nowrap;\n--_brc-line-rest: none;\n--_brc-line-state: none;\n}\n&:where([data-icon]:not([data-icon=''])):where([data-icon-only]:not([data-icon-only='false']))::before {\nmargin: 0;\n}\n@media (hover: hover) {\n&:where(:any-link:not([href=''], [href^='javascript:' i]):hover) {\n--_brc-now-container: var(--_brc-hovered-container);\n--_brc-now-content: var(--_brc-hovered-content);\n--tanrei-corner-radius: var(--tanrei-comp-breadcrumbs-hovered-container-shape);\n--tanrei-corner-pill: var(--tanrei-comp-breadcrumbs-hovered-container-shape-pill, 0);\nopacity: var(--tanrei-comp-breadcrumbs-hovered-opacity);\ntext-decoration-line: var(--_brc-line-state);\n}\n}\n&:where(:any-link:not([href=''], [href^='javascript:' i]):focus-visible) {\n--_brc-now-container: var(--_brc-focused-container);\n--_brc-now-content: var(--_brc-focused-content);\n--_brc-focus-inner-edge: calc(var(--tanrei-sys-focus-offset) + var(--tanrei-sys-focus-inner-width));\n--tanrei-corner-radius: var(--tanrei-comp-breadcrumbs-focused-container-shape);\n--tanrei-corner-pill: var(--tanrei-comp-breadcrumbs-focused-container-shape-pill, 0);\nopacity: var(--tanrei-comp-breadcrumbs-focused-opacity);\ntext-decoration-line: var(--_brc-line-state);\noutline: var(--tanrei-sys-focus-outer-width) solid var(--tanrei-sys-color-focus-ring);\noutline-offset: var(--_brc-focus-inner-edge);\nbox-shadow: 0 0 0 min(var(--_brc-focus-inner-edge), calc(var(--tanrei-sys-focus-inner-width) * 1000)) var(--tanrei-sys-color-focus-ring-inner);\n}\n@container style(--tanrei-sys-behavior-focus-style: glow) {\n&:where(:any-link:not([href=''], [href^='javascript:' i]):focus-visible) {\noutline-color: transparent;\nbox-shadow:\n0 0 var(--tanrei-sys-focus-inner-width) calc(var(--tanrei-sys-focus-offset) + var(--tanrei-sys-focus-inner-width)) var(--tanrei-sys-color-focus-ring-inner),\n0 0 var(--tanrei-sys-focus-outer-width) calc(var(--tanrei-sys-focus-offset) + var(--tanrei-sys-focus-inner-width) + var(--tanrei-sys-focus-outer-width)) var(--tanrei-sys-color-focus-ring);\n}\n}\n&:where(:any-link:not([href=''], [href^='javascript:' i])[data-focus-style='glow']:focus-visible) {\noutline-color: transparent;\nbox-shadow:\n0 0 var(--tanrei-sys-focus-inner-width) calc(var(--tanrei-sys-focus-offset) + var(--tanrei-sys-focus-inner-width)) var(--tanrei-sys-color-focus-ring-inner),\n0 0 var(--tanrei-sys-focus-outer-width) calc(var(--tanrei-sys-focus-offset) + var(--tanrei-sys-focus-inner-width) + var(--tanrei-sys-focus-outer-width)) var(--tanrei-sys-color-focus-ring);\n}\n&:where(:any-link:not([href=''], [href^='javascript:' i]):active:not([data-pressed])) {\n--_brc-held-image: linear-gradient(var(--_brc-pressed-container), var(--_brc-pressed-container)), none;\n--_brc-held-clip: border-box, text;\n--_brc-now-content: var(--_brc-pressed-content);\n--tanrei-corner-radius: var(--tanrei-comp-breadcrumbs-pressed-container-shape);\n--tanrei-corner-pill: var(--tanrei-comp-breadcrumbs-pressed-container-shape-pill, 0);\nopacity: var(--tanrei-comp-breadcrumbs-pressed-opacity);\ntext-decoration-line: var(--_brc-line-state);\ntransition-duration: 0s;\ntransition-delay: 0s;\n}\n&:where([data-pressed]:not([data-pressed='none'])) {\ntext-decoration-line: var(--_brc-line-state);\ntransition-duration: 0s;\n}\n&:where([data-pressed='overlay']) {\n--_brc-now-container: var(--_brc-pressed-container);\n--_brc-now-content: var(--_brc-pressed-content);\n--tanrei-corner-radius: var(--tanrei-comp-breadcrumbs-pressed-container-shape);\n--tanrei-corner-pill: var(--tanrei-comp-breadcrumbs-pressed-container-shape-pill, 0);\nopacity: var(--tanrei-comp-breadcrumbs-pressed-opacity);\n}\n&:where([data-pressed='ripple'], [data-pressed='dim']) {\n--_brc-now-content: var(--_brc-pressed-content);\n--tanrei-corner-radius: var(--tanrei-comp-breadcrumbs-pressed-container-shape);\n--tanrei-corner-pill: var(--tanrei-comp-breadcrumbs-pressed-container-shape-pill, 0);\nopacity: var(--tanrei-comp-breadcrumbs-pressed-opacity);\n}\n& > :where(.ripple) {\nposition: absolute;\nz-index: -1;\ninset: 0;\nborder-radius: inherit;\ncorner-shape: inherit;\nbackground: var(--_brc-pressed-container);\npointer-events: none;\nclip-path: circle(var(--_r) at var(--_x) var(--_y));\nanimation: tanrei-breadcrumbs-ripple var(--tanrei-comp-breadcrumbs-motion-feedback-duration) var(--tanrei-comp-breadcrumbs-motion-state-easing) both;\ntransition: opacity var(--tanrei-comp-breadcrumbs-motion-state-duration) var(--tanrei-comp-breadcrumbs-motion-state-easing);\n}\n& > :where(.ripple.leaving) {\nopacity: 0;\n}\n@media (prefers-reduced-motion: reduce) {\n&:where(:any-link:not([href=''], [href^='javascript:' i])) {\ntransition:\n--_brc-held-image 0s linear var(--tanrei-sys-motion-duration-press-hold),\n--_brc-held-clip 0s linear var(--tanrei-sys-motion-duration-press-hold);\ntransition-behavior: allow-discrete;\n}\n& > :where(.ripple) {\nanimation: none;\ntransition: none;\n}\n}\n@media (forced-colors: active) {\ncolor: CanvasText;\n&:where(:any-link:not([href=''], [href^='javascript:' i])) {\n--_brc-line-rest: underline;\n--_brc-line-state: underline;\nbackground-image: none;\nbackground-clip: border-box;\ncolor: LinkText;\n}\n&:where([aria-current]:not([aria-current='false'])):where(:last-child),\n&:where([data-icon]:not([data-icon=''])):where([data-icon-only]:not([data-icon-only='false'])) {\n--_brc-line-rest: none;\n--_brc-line-state: none;\n}\n&:where([aria-current]:not([aria-current='false'])):where(:last-child) {\ncolor: CanvasText;\n}\n&:where(:any-link:not([href=''], [href^='javascript:' i]):focus-visible) {\noutline-color: Highlight;\n}\n}\n}\n@keyframes tanrei-breadcrumbs-ripple {\nfrom {\nclip-path: circle(0 at var(--_x) var(--_y));\n}\n}\n:where(tanrei-breadcrumbs:defined) > :where(a:any-link:not([href=''], [href^='javascript:' i]))::after {\ncontent: '';\nposition: absolute;\ninset-block: min(0px, calc((100% - var(--_brc-target)) / 2));\ninset-inline: calc((var(--tanrei-comp-breadcrumbs-separator-size) / 2 + var(--tanrei-comp-breadcrumbs-separator-gap)) * -1);\n}\n:where(tanrei-breadcrumbs:defined) > :where(a:any-link:not([href=''], [href^='javascript:' i]):first-child)::after {\ninset-inline-start: 0;\n}\n:where(tanrei-breadcrumbs:defined) > :where(a:any-link:not([href=''], [href^='javascript:' i]):last-child)::after {\ninset-inline-end: 0;\n}\n:where(tanrei-breadcrumbs:not(:defined)) > :where(a, span):where(:not(:last-child)) {\nmargin-inline-end: calc(var(--tanrei-comp-breadcrumbs-separator-size) + var(--tanrei-comp-breadcrumbs-separator-gap) * 2);\n}\n:where(tanrei-breadcrumbs:not(:defined)) > :where(a, span):where(:not(:last-child))::after {\ncontent: 'chevron_right';\ncontent: 'chevron_right' / '';\nposition: absolute;\ninset-block-end: calc((var(--_brc-line) - var(--tanrei-comp-breadcrumbs-separator-size)) / 2);\ninset-inline-start: calc(100% + var(--tanrei-comp-breadcrumbs-separator-gap));\noverflow: hidden;\ninline-size: var(--tanrei-comp-breadcrumbs-separator-size);\nblock-size: var(--tanrei-comp-breadcrumbs-separator-size);\ncolor: var(--tanrei-comp-breadcrumbs-separator-color);\nfont-family: var(--tanrei-sys-icon-family-unselected);\nfont-size: var(--tanrei-comp-breadcrumbs-separator-size);\nfont-style: normal;\nfont-weight: normal;\nline-height: 1;\nletter-spacing: normal;\ntext-transform: none;\nwhite-space: nowrap;\nword-wrap: normal;\ndirection: ltr;\n-webkit-user-select: none;\nuser-select: none;\npointer-events: none;\nfont-feature-settings: 'liga';\n-webkit-font-smoothing: antialiased;\nfont-optical-sizing: auto;\nfont-variation-settings:\n'FILL' var(--tanrei-sys-icon-fill-unselected),\n'wght' var(--tanrei-sys-icon-weight),\n'GRAD' 0;\nopacity: var(--tanrei-icons, 0);\n}\n@supports (font-variation-settings: 'opsz' tan(atan2(1em, 1px))) {\n:where(tanrei-breadcrumbs:not(:defined)) > :where(a, span):where(:not(:last-child))::after {\nfont-variation-settings: 'FILL' var(--tanrei-sys-icon-fill-unselected), 'wght' var(--tanrei-sys-icon-weight), 'GRAD' 0, 'opsz' clamp(var(--tanrei-sys-icon-optical-size-min), tan(atan2(var(--tanrei-comp-breadcrumbs-separator-size), 1px)), var(--tanrei-sys-icon-optical-size-max));\n}\n}\n:where(tanrei-breadcrumbs:not(:defined):dir(rtl)) > :where(a, span):where(:not(:last-child))::after {\ntransform: scaleX(-1);\n}\n@media (forced-colors: active) {\n:where(tanrei-breadcrumbs:not(:defined)) > :where(a, span):where(:not(:last-child))::after {\ncolor: CanvasText;\n}\n}\n}";
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
})();
|
|
20
|
+
const OVERFLOWS = ['collapse', 'wrap'];
|
|
21
|
+
const UNDERLINES = ['auto', 'always', 'hover', 'never'];
|
|
22
|
+
/** BRC-30: the trail's own choice of when a link is underlined, as the choice's name; and the mark of it for a browser without style queries. */
|
|
23
|
+
const UNDERLINE = '--tanrei-comp-breadcrumbs-underline-visibility';
|
|
24
|
+
const UNDERLINE_MARK = 'data-tanrei-underline';
|
|
25
|
+
/** The glyphs the trail draws itself, by their names in the system's icon set (BRC-6, BRC-10). */
|
|
26
|
+
const SEPARATOR = 'chevron_right';
|
|
27
|
+
const MORE = 'more_horiz';
|
|
28
|
+
/** What the element writes on the product's elements (see breadcrumbs.css). */
|
|
29
|
+
const DIRECTED = 'dir';
|
|
30
|
+
/** What the observer re-reads a level for: everything the product says about it. */
|
|
31
|
+
const ATTRIBUTES = ['href', 'aria-current', 'data-icon', 'data-icon-only', 'data-mirror'];
|
|
32
|
+
/** A character with a direction of its own: a letter of any script (digits, signs and spaces have none). */
|
|
33
|
+
const STRONG = /\p{L}/u;
|
|
34
|
+
/** Boxes are laid out on fractions of a pixel: a trail that is this much wider than its room still fits. */
|
|
35
|
+
const SLACK = 0.05;
|
|
36
|
+
let sheet;
|
|
37
|
+
/** The levels' stylesheet, made once and shared by every root that needs it. */
|
|
38
|
+
function levelsSheet() {
|
|
39
|
+
if (sheet !== undefined)
|
|
40
|
+
return sheet;
|
|
41
|
+
if (typeof CSSStyleSheet === 'undefined')
|
|
42
|
+
return (sheet = null);
|
|
43
|
+
sheet = new CSSStyleSheet();
|
|
44
|
+
try {
|
|
45
|
+
sheet.replaceSync(LEVELS_CSS);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// A browser that cannot construct it: the page's own copy of breadcrumbs.css draws the levels.
|
|
49
|
+
}
|
|
50
|
+
return sheet;
|
|
51
|
+
}
|
|
52
|
+
/** Writes an attribute only when it differs: what is written here must settle. */
|
|
53
|
+
function mark(element, name, value) {
|
|
54
|
+
if (value === null) {
|
|
55
|
+
if (element.hasAttribute(name))
|
|
56
|
+
element.removeAttribute(name);
|
|
57
|
+
}
|
|
58
|
+
else if (element.getAttribute(name) !== value)
|
|
59
|
+
element.setAttribute(name, value);
|
|
60
|
+
}
|
|
61
|
+
const flagged = (element, name) => element.hasAttribute(name) && element.getAttribute(name) !== 'false';
|
|
62
|
+
const width = (element) => element?.getBoundingClientRect().width ?? 0;
|
|
63
|
+
/**
|
|
64
|
+
* BRC-9: the levels that are out of a trail of `count` levels when `out` of them are — first those between the first
|
|
65
|
+
* and the last, beginning next to the first; then the first. The last is never among them.
|
|
66
|
+
*/
|
|
67
|
+
function takenOut(count, out) {
|
|
68
|
+
const order = [...Array.from({ length: Math.max(0, count - 2) }, (_, index) => index + 1), ...(count > 1 ? [0] : [])];
|
|
69
|
+
return new Set(order.slice(0, out));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Shows where a page sits in a hierarchy of pages and leads back up it: the levels above as links, in order from the
|
|
73
|
+
* top, with the page itself last.
|
|
74
|
+
*
|
|
75
|
+
* Contract: specs/breadcrumbs.spec.json. The levels are the product's own children, which stay in the document
|
|
76
|
+
* (BRC-2, BRC-13): an `<a href>` for a level with a destination, a `<span>` for one without — the current page, or a
|
|
77
|
+
* level that has no page. Before the element is defined, and with scripting off, the page holds the whole trail as
|
|
78
|
+
* links that work.
|
|
79
|
+
*
|
|
80
|
+
* ```html
|
|
81
|
+
* <tanrei-breadcrumbs label="Breadcrumbs" overflow-label="Show hidden levels">
|
|
82
|
+
* <a href="/" data-icon="home">Home</a>
|
|
83
|
+
* <a href="/components/">Components</a>
|
|
84
|
+
* <span aria-current="page">Button</span>
|
|
85
|
+
* </tanrei-breadcrumbs>
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* A level's label is its text. `aria-current="page"` on the last level marks the current page; `data-icon` names a
|
|
89
|
+
* glyph of the system's icon set, drawn before the label; `data-icon-only` draws the glyph alone and keeps the text
|
|
90
|
+
* as the level's name; `data-mirror="always"` or `"never"` is the product's word on mirroring that glyph in a
|
|
91
|
+
* right-to-left layout. `underline` says when the links are underlined (BRC-30); a row of the overflow menu is a menu
|
|
92
|
+
* item and never is. A level's `click` is the anchor's own: cancel it and the browser follows nothing (BRC-22).
|
|
93
|
+
*
|
|
94
|
+
* Everything drawn on a level is `@tanrei/web/breadcrumbs.css` (every value a `--tanrei-comp-breadcrumbs-*` token),
|
|
95
|
+
* which draws the trail before and without this script; the element adds the same sheet to the root it is connected
|
|
96
|
+
* to. The shadow root holds only what the product did not write: a `<nav>` named by `label`, the ordered list with
|
|
97
|
+
* one item for each level, the separators, and the overflow button with its menu.
|
|
98
|
+
*
|
|
99
|
+
* `overflow="collapse"` (the default) keeps the trail on one line: when it is wider than the width it is given, its
|
|
100
|
+
* middle levels go behind the overflow button, beginning next to the first, as many as the width asks for; then the
|
|
101
|
+
* first; and the last label is cut only when the button and it alone do not fit. The button opens a menu of the
|
|
102
|
+
* levels taken out; choosing one is a click on that level's own anchor. The trail is measured when its width, a
|
|
103
|
+
* label, the text size or the direction changes; at rest it runs nothing. `overflow="wrap"` keeps every level and
|
|
104
|
+
* lets the trail run over as many lines as it needs.
|
|
105
|
+
*
|
|
106
|
+
* @tag tanrei-breadcrumbs
|
|
107
|
+
* @slot - The levels, from the top of the hierarchy to the page: `<a href>` and `<span>` children. They stay in the document.
|
|
108
|
+
* @csspart nav - The navigation landmark.
|
|
109
|
+
* @csspart list - The ordered list of the levels.
|
|
110
|
+
* @csspart separator - A separator between two entries (hidden from assistive technology).
|
|
111
|
+
* @csspart overflow-button - The button that stands for the levels taken out of the trail and opens their menu.
|
|
112
|
+
* @csspart overflow-icon - The overflow button's glyph.
|
|
113
|
+
*/
|
|
114
|
+
export class TanreiBreadcrumbs extends LitElement {
|
|
115
|
+
constructor() {
|
|
116
|
+
super(...arguments);
|
|
117
|
+
/** The accessible name of the navigation landmark ("Breadcrumbs"), in the product's language. Required: it tells this landmark from the page's other navigation. */
|
|
118
|
+
this.label = '';
|
|
119
|
+
/** What a trail longer than its width does: `collapse` keeps it on one line and puts its middle levels behind the overflow button; `wrap` keeps every level and runs over as many lines as it needs. */
|
|
120
|
+
this.overflow = 'collapse';
|
|
121
|
+
/** The accessible name of the overflow button ("Show hidden levels"), in the product's language. Required while `overflow` is `collapse`. */
|
|
122
|
+
this.overflowLabel = '';
|
|
123
|
+
/** When the levels that are links are underlined: `always` at rest and in every state; `hover` while a level is hovered, focused from the keyboard or pressed; `never` in no state. `auto` takes `comp.breadcrumbs.underline.visibility`, the design system's answer (always in the default system). Forced colors draw the line whatever is chosen. */
|
|
124
|
+
this.underline = 'auto';
|
|
125
|
+
/** BRC-9: how many levels are out of the trail. */
|
|
126
|
+
this.out = 0;
|
|
127
|
+
/** BRC-14: the last level's label is cut. */
|
|
128
|
+
this.cut = false;
|
|
129
|
+
this.menuOpen = false;
|
|
130
|
+
this.availability = new AvailabilityController(this, 'breadcrumbs');
|
|
131
|
+
/** The product's words, read where the instance gives none (src/primitives/words.ts). */
|
|
132
|
+
this.words = new WordsController(this);
|
|
133
|
+
/** BRC-12: a design system switched on the page's root changes the text style and the gaps the trail is measured with. */
|
|
134
|
+
this.system = new SystemWatchController(this);
|
|
135
|
+
/** BRC-12, BRC-26: the direction it inherits changed. */
|
|
136
|
+
this.direction = new DirectionController(this, () => this.decide());
|
|
137
|
+
this.glyphs = new GlyphDrawnController(this, () => this.renderRoot?.querySelectorAll('.separator, .more-glyph') ?? []);
|
|
138
|
+
/** BRC-27: chevron_right is drawn mirrored where the icon set marks its name; more_horiz where it marks that one. */
|
|
139
|
+
this.mirror = new GlyphMirrorController(this, { drawn: '.separator, .more-glyph' });
|
|
140
|
+
this.morePress = new PressController(this, {
|
|
141
|
+
container: () => this.more,
|
|
142
|
+
holdCarrier: () => this.renderRoot?.querySelector('.more-glyph .ink') ?? null,
|
|
143
|
+
disabled: () => false,
|
|
144
|
+
});
|
|
145
|
+
this.mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver((records) => this.mutated(records));
|
|
146
|
+
this.watched = null;
|
|
147
|
+
this.keeping = 0;
|
|
148
|
+
this.levels = [];
|
|
149
|
+
this.levelsStale = true;
|
|
150
|
+
/** The level this element gave its text's direction (BRC-28). */
|
|
151
|
+
this.directed = null;
|
|
152
|
+
this.presses = new WeakMap();
|
|
153
|
+
this.pressControllers = new Set();
|
|
154
|
+
this.heldPress = null;
|
|
155
|
+
this.heldAnchor = null;
|
|
156
|
+
/** A face arrived: the labels may be wider or narrower than they were measured. */
|
|
157
|
+
this.onFaces = () => this.decide();
|
|
158
|
+
// ── The overflow button and its menu (BRC-10, BRC-11) ─────────────────────────────────────────────────────────────
|
|
159
|
+
this.onMoreClick = () => {
|
|
160
|
+
this.menuOpen = !this.menuOpen;
|
|
161
|
+
};
|
|
162
|
+
// BRC-20: where the browser has no style queries, the focus style is read when focus arrives.
|
|
163
|
+
this.onMoreFocus = () => {
|
|
164
|
+
if (!styleQueries())
|
|
165
|
+
syncFocusStyle(this, this.more);
|
|
166
|
+
};
|
|
167
|
+
/** The menu asks to be closed — Escape, a press outside, Tab, a level chosen — and returns focus to the button itself. */
|
|
168
|
+
this.onMenuClose = (_event) => {
|
|
169
|
+
this.menuOpen = false;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* BRC-11, BRC-22: a level chosen in the menu is that level's own anchor activated. The row is a link to the level
|
|
173
|
+
* (the menu's link item, MNU-53), so the address, a new tab and the browser's own menu are there; a plain
|
|
174
|
+
* activation of it is handed to the product's anchor as one `click` — the event the product listens to and cancels
|
|
175
|
+
* (a router's link component) — and the browser follows that anchor unless it was cancelled. The row's own click
|
|
176
|
+
* opens nothing and goes no further than the menu. A modified or a middle click is the browser's, on the row.
|
|
177
|
+
*/
|
|
178
|
+
this.onMenuClick = (event) => {
|
|
179
|
+
const row = event.composedPath().find((node) => node instanceof HTMLElement && node.localName === 'tanrei-menu-item');
|
|
180
|
+
const index = Number(row?.dataset.level ?? -1);
|
|
181
|
+
const level = this.levels[index];
|
|
182
|
+
if (!row || !level || level.href === null)
|
|
183
|
+
return;
|
|
184
|
+
if ((event.button ?? 0) !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
185
|
+
return;
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
event.stopPropagation();
|
|
188
|
+
level.element.click();
|
|
189
|
+
};
|
|
190
|
+
this.releasePress = () => {
|
|
191
|
+
this.heldPress?.release();
|
|
192
|
+
this.heldPress = null;
|
|
193
|
+
this.heldAnchor = null;
|
|
194
|
+
};
|
|
195
|
+
this.onPointerDown = (event) => {
|
|
196
|
+
const a = this.linkOf(event);
|
|
197
|
+
const pointer = event;
|
|
198
|
+
if (!a || (pointer.button !== 0 && pointer.pointerType === 'mouse'))
|
|
199
|
+
return;
|
|
200
|
+
this.answered(a);
|
|
201
|
+
this.heldPress = this.pressOf(a);
|
|
202
|
+
this.heldAnchor = a;
|
|
203
|
+
this.heldPress.onPointerDown(pointer);
|
|
204
|
+
};
|
|
205
|
+
// `pointerleave` is not seen from here: the press ends when the pointer goes out of the level it holds.
|
|
206
|
+
this.onPointerOut = (event) => {
|
|
207
|
+
const to = event.relatedTarget;
|
|
208
|
+
if (this.heldAnchor && !(to instanceof Node && this.heldAnchor.contains(to)))
|
|
209
|
+
this.releasePress();
|
|
210
|
+
};
|
|
211
|
+
this.onLevelKeyDown = (event) => {
|
|
212
|
+
const a = this.linkOf(event);
|
|
213
|
+
const key = event;
|
|
214
|
+
if (!a || key.repeat || !LINK_KEYS.includes(key.key))
|
|
215
|
+
return;
|
|
216
|
+
this.answered(a);
|
|
217
|
+
this.pressOf(a).onKeyDown(key);
|
|
218
|
+
};
|
|
219
|
+
this.onLevelKeyUp = (event) => {
|
|
220
|
+
const a = this.linkOf(event);
|
|
221
|
+
if (a)
|
|
222
|
+
this.presses.get(a)?.onKeyUp(event);
|
|
223
|
+
};
|
|
224
|
+
this.onFocusIn = (event) => {
|
|
225
|
+
const a = this.linkOf(event);
|
|
226
|
+
if (a && !styleQueries())
|
|
227
|
+
syncFocusStyle(a, a);
|
|
228
|
+
};
|
|
229
|
+
this.onFocusOut = (event) => {
|
|
230
|
+
const a = this.linkOf(event);
|
|
231
|
+
if (a)
|
|
232
|
+
this.presses.get(a)?.onBlur();
|
|
233
|
+
};
|
|
234
|
+
this.pressListeners = [
|
|
235
|
+
['pointerdown', this.onPointerDown],
|
|
236
|
+
['pointerup', this.releasePress],
|
|
237
|
+
['pointercancel', this.releasePress],
|
|
238
|
+
['pointerout', this.onPointerOut],
|
|
239
|
+
['dragstart', this.releasePress],
|
|
240
|
+
['keydown', this.onLevelKeyDown],
|
|
241
|
+
['keyup', this.onLevelKeyUp],
|
|
242
|
+
['focusin', this.onFocusIn],
|
|
243
|
+
['focusout', this.onFocusOut],
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
static { this.styles = styles; }
|
|
247
|
+
// Each level stands in a list item of its own, so the element assigns each child to that item's slot (BRC-1).
|
|
248
|
+
static { this.shadowRootOptions = { ...LitElement.shadowRootOptions, slotAssignment: 'manual' }; }
|
|
249
|
+
static { this.properties = {
|
|
250
|
+
label: { type: String },
|
|
251
|
+
// The default is not reflected: a trail that is defined is the one that was written.
|
|
252
|
+
overflow: { type: String, reflect: true, useDefault: true },
|
|
253
|
+
overflowLabel: { type: String, attribute: 'overflow-label' },
|
|
254
|
+
underline: { type: String, reflect: true, useDefault: true },
|
|
255
|
+
out: { state: true },
|
|
256
|
+
cut: { state: true },
|
|
257
|
+
menuOpen: { state: true },
|
|
258
|
+
}; }
|
|
259
|
+
/**
|
|
260
|
+
* BRC-12: the width the layout gives, and a line of the trail's text — one observer for every trail of the page, so
|
|
261
|
+
* that the trails that change size in one frame (all of them, when a page is first laid out) are measured together.
|
|
262
|
+
*/
|
|
263
|
+
static { this.owners = new WeakMap(); }
|
|
264
|
+
static { this.sizes = typeof ResizeObserver === 'undefined'
|
|
265
|
+
? null
|
|
266
|
+
: new ResizeObserver((entries) => {
|
|
267
|
+
const trails = new Set(entries.map((entry) => TanreiBreadcrumbs.owners.get(entry.target)).filter((trail) => !!trail));
|
|
268
|
+
TanreiBreadcrumbs.decideTogether([...trails], true);
|
|
269
|
+
}); }
|
|
270
|
+
/** The trails drawn in this turn, which are measured together after it (`updated`). */
|
|
271
|
+
static { this.due = new Set(); }
|
|
272
|
+
get more() {
|
|
273
|
+
return this.renderRoot?.querySelector('.overflow') ?? null;
|
|
274
|
+
}
|
|
275
|
+
/** BRC-29: an overflow it does not have is collapse. */
|
|
276
|
+
get wraps() {
|
|
277
|
+
return this.overflow === 'wrap';
|
|
278
|
+
}
|
|
279
|
+
connectedCallback() {
|
|
280
|
+
super.connectedCallback();
|
|
281
|
+
adoptUnlessDrawn(this, levelsSheet(), '--_brc-start');
|
|
282
|
+
for (const [type, listener] of this.pressListeners)
|
|
283
|
+
this.addEventListener(type, listener, true);
|
|
284
|
+
this.mutations?.observe(this, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ATTRIBUTES });
|
|
285
|
+
this.watch(this, true);
|
|
286
|
+
document.fonts?.addEventListener('loadingdone', this.onFaces);
|
|
287
|
+
this.levelsStale = true;
|
|
288
|
+
if (this.hasUpdated)
|
|
289
|
+
this.requestUpdate();
|
|
290
|
+
}
|
|
291
|
+
disconnectedCallback() {
|
|
292
|
+
super.disconnectedCallback();
|
|
293
|
+
for (const [type, listener] of this.pressListeners)
|
|
294
|
+
this.removeEventListener(type, listener, true);
|
|
295
|
+
this.mutations?.disconnect();
|
|
296
|
+
this.watch(this, false);
|
|
297
|
+
if (this.watched)
|
|
298
|
+
this.watch(this.watched, false);
|
|
299
|
+
this.watched = null;
|
|
300
|
+
TanreiBreadcrumbs.due.delete(this);
|
|
301
|
+
cancelAnimationFrame(this.keeping);
|
|
302
|
+
this.keeping = 0;
|
|
303
|
+
document.fonts?.removeEventListener('loadingdone', this.onFaces);
|
|
304
|
+
for (const press of this.pressControllers)
|
|
305
|
+
press.hostDisconnected();
|
|
306
|
+
this.heldPress = null;
|
|
307
|
+
this.heldAnchor = null;
|
|
308
|
+
this.menuOpen = false;
|
|
309
|
+
}
|
|
310
|
+
// ── The levels ────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
311
|
+
/** What the observer saw. The ripple's layer is this package's own: its coming and going is not a change of the levels. */
|
|
312
|
+
mutated(records) {
|
|
313
|
+
const ripple = (node) => node instanceof Element && node.classList.contains('ripple');
|
|
314
|
+
if (records.every((record) => record.type === 'childList' && [...record.addedNodes, ...record.removedNodes].every(ripple)))
|
|
315
|
+
return;
|
|
316
|
+
this.levelsStale = true;
|
|
317
|
+
this.requestUpdate();
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Reads the product's children: every `<a>` and `<span>` is a level. An address that is no destination is taken off
|
|
321
|
+
* its anchor, which is then text (BRC-3) — as the Link does (LNK-21), so that it is no link to the browser either.
|
|
322
|
+
*/
|
|
323
|
+
readLevels() {
|
|
324
|
+
this.levelsStale = false;
|
|
325
|
+
const levels = [];
|
|
326
|
+
for (const element of this.children) {
|
|
327
|
+
if (!(element instanceof HTMLElement) || (element.localName !== 'a' && element.localName !== 'span')) {
|
|
328
|
+
report(this, 'BRC-1', `a <${element.localName}> child is not a level and is not drawn: a level is an <a href> or a <span>`);
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
const given = element.localName === 'a' ? element.getAttribute('href') : null;
|
|
332
|
+
let href = null;
|
|
333
|
+
if (given !== null) {
|
|
334
|
+
const read = readDestination(given);
|
|
335
|
+
href = read.href;
|
|
336
|
+
if (href === null) {
|
|
337
|
+
element.removeAttribute('href');
|
|
338
|
+
report(this, 'BRC-3', read.refusal === 'script'
|
|
339
|
+
? 'a level’s href names a script to run, not a place to go; it is taken off and the level is drawn as text'
|
|
340
|
+
: read.refusal === 'unreadable'
|
|
341
|
+
? `a level’s href "${given}" cannot be read as an address; it is taken off and the level is drawn as text`
|
|
342
|
+
: 'a level’s href is empty; it is taken off and the level is drawn as text');
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
levels.push({
|
|
346
|
+
element,
|
|
347
|
+
label: (element.textContent ?? '').replace(/\s+/g, ' ').trim(),
|
|
348
|
+
href,
|
|
349
|
+
current: flagged(element, 'aria-current'),
|
|
350
|
+
icon: (element.getAttribute('data-icon') ?? '').trim(),
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
this.levels = levels;
|
|
354
|
+
if (debugBuild())
|
|
355
|
+
this.check();
|
|
356
|
+
}
|
|
357
|
+
/** What a debug build says about a trail it still draws (BRC-1, BRC-4, BRC-7, BRC-10, BRC-29). */
|
|
358
|
+
check() {
|
|
359
|
+
// A trail that is still being parsed is read again when it is whole.
|
|
360
|
+
if (document.readyState === 'loading' || !this.levels.length)
|
|
361
|
+
return;
|
|
362
|
+
if (!this.label.trim())
|
|
363
|
+
report(this, 'BRC-1', 'label is empty: the navigation landmark has no accessible name; give it the words ("Breadcrumbs")');
|
|
364
|
+
this.levels.forEach((level, index) => {
|
|
365
|
+
if (level.current && index < this.levels.length - 1)
|
|
366
|
+
report(this, 'BRC-4', `the level "${level.label}" is marked as the current page and is not the last; it is drawn as if it were not current`);
|
|
367
|
+
if (!level.label)
|
|
368
|
+
report(this, 'BRC-7', 'a level has no label, so it has no name; give it its text (a glyph alone keeps its text as its name)');
|
|
369
|
+
});
|
|
370
|
+
if (!UNDERLINES.includes(this.underline))
|
|
371
|
+
report(this, 'BRC-30', `underline "${this.underline}" is not a value it defines ("auto", "always", "hover" or "never"); it is treated as "auto"`);
|
|
372
|
+
if (!OVERFLOWS.includes(this.overflow))
|
|
373
|
+
report(this, 'BRC-29', `overflow "${this.overflow}" is not a value it defines ("collapse" or "wrap"); it behaves as "collapse"`);
|
|
374
|
+
if (!this.wraps && this.out > 0 && this.words.lacks('breadcrumbsOverflowLabel', this.overflowLabel)) {
|
|
375
|
+
report(this, 'BRC-10', 'overflowLabel is empty: the overflow button has no accessible name; give it the words ("Show hidden levels")');
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
// ── What fits (BRC-9, BRC-12, BRC-14) ─────────────────────────────────────────────────────────────────────────────
|
|
379
|
+
/**
|
|
380
|
+
* Decides which levels are out of the trail, by the width the trail has: every entry is measured at its own width —
|
|
381
|
+
* a level with its separator, the overflow button with its own — in one task, so the measuring is never painted;
|
|
382
|
+
* then levels are taken out, in BRC-9's order, only while what is left does not fit. Nothing is written when the
|
|
383
|
+
* answer is the one already drawn.
|
|
384
|
+
*
|
|
385
|
+
* `observed`: it was asked for by the observer of sizes. What is decided is drawn at once all the same; only the
|
|
386
|
+
* width the whole trail needs — which may be the element's own width, in a layout that gives it the width of its
|
|
387
|
+
* content — is then written in the next frame, because a size changed while sizes are being told is told late and
|
|
388
|
+
* reported as a loop.
|
|
389
|
+
*/
|
|
390
|
+
decide({ observed = false } = {}) {
|
|
391
|
+
TanreiBreadcrumbs.decideTogether([this], observed);
|
|
392
|
+
}
|
|
393
|
+
/** Has the one observer of sizes tell this trail of `element`, or no longer. */
|
|
394
|
+
watch(element, on) {
|
|
395
|
+
if (on) {
|
|
396
|
+
TanreiBreadcrumbs.owners.set(element, this);
|
|
397
|
+
TanreiBreadcrumbs.sizes?.observe(element);
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
TanreiBreadcrumbs.sizes?.unobserve(element);
|
|
401
|
+
TanreiBreadcrumbs.owners.delete(element);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* `decide()` for every trail of `trails`: each is laid out for measuring, then all are read — one style pass and one
|
|
406
|
+
* layout between them — and only then does each write what it decided. A trail that measured in its own update, and
|
|
407
|
+
* again in its own report of sizes, had the page laid out for itself each time (fifty trails drawn at once: 251
|
|
408
|
+
* style passes and 152 layouts).
|
|
409
|
+
*/
|
|
410
|
+
static decideTogether(trails, observed) {
|
|
411
|
+
const live = trails.flatMap((trail) => {
|
|
412
|
+
const list = trail.renderRoot?.querySelector('ol');
|
|
413
|
+
return list && trail.isConnected && trail.hasUpdated ? [{ trail, list }] : [];
|
|
414
|
+
});
|
|
415
|
+
for (const { list } of live)
|
|
416
|
+
list.classList.add('measure');
|
|
417
|
+
const read = live.map(({ list }) => ({ widths: [...list.querySelectorAll('li.level')].map(width), button: width(list.querySelector('li.more')), room: width(list) }));
|
|
418
|
+
for (const { list } of live)
|
|
419
|
+
list.classList.remove('measure');
|
|
420
|
+
live.forEach(({ trail }, index) => trail.take(read[index], observed));
|
|
421
|
+
}
|
|
422
|
+
/** The writing half of `decide()`: what follows from the widths that were read. */
|
|
423
|
+
take({ widths, button, room }, observed) {
|
|
424
|
+
const count = this.levels.length;
|
|
425
|
+
const whole = widths.reduce((sum, each) => sum + each, 0);
|
|
426
|
+
let out = 0;
|
|
427
|
+
let cut = false;
|
|
428
|
+
if (!this.wraps && count) {
|
|
429
|
+
let shown = whole;
|
|
430
|
+
const order = [...takenOut(count, count)];
|
|
431
|
+
while (shown > room + SLACK && out < order.length) {
|
|
432
|
+
shown -= widths[order[out]] ?? 0;
|
|
433
|
+
if (out === 0)
|
|
434
|
+
shown += button;
|
|
435
|
+
out++;
|
|
436
|
+
}
|
|
437
|
+
cut = shown > room + SLACK;
|
|
438
|
+
}
|
|
439
|
+
this.keep(whole, observed);
|
|
440
|
+
if (out === this.out && cut === this.cut)
|
|
441
|
+
return;
|
|
442
|
+
const before = takenOut(count, this.out);
|
|
443
|
+
this.out = out;
|
|
444
|
+
this.cut = cut;
|
|
445
|
+
// (After the state is set: focus moves once what it moves to has been drawn.)
|
|
446
|
+
this.moveFocus(before, takenOut(count, out));
|
|
447
|
+
}
|
|
448
|
+
/** BRC-8: the width the whole trail needs stays the element's own widest size (see `.sizer`). */
|
|
449
|
+
keep(whole, later) {
|
|
450
|
+
const sizer = this.renderRoot?.querySelector('.sizer');
|
|
451
|
+
const kept = whole ? `${Math.ceil(whole * 100) / 100}px` : '';
|
|
452
|
+
if (!sizer || sizer.style.inlineSize === kept)
|
|
453
|
+
return;
|
|
454
|
+
cancelAnimationFrame(this.keeping);
|
|
455
|
+
this.keeping = 0;
|
|
456
|
+
if (!later) {
|
|
457
|
+
sizer.style.inlineSize = kept;
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
this.keeping = requestAnimationFrame(() => {
|
|
461
|
+
this.keeping = 0;
|
|
462
|
+
if (this.isConnected)
|
|
463
|
+
this.decide();
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* BRC-12: focus follows what it was on. A level that held keyboard focus and is taken out hands it to the overflow
|
|
468
|
+
* button; an overflow button that is removed while it holds focus, or while its menu is open, closes the menu and
|
|
469
|
+
* hands focus to the first level that returned.
|
|
470
|
+
*/
|
|
471
|
+
moveFocus(before, after) {
|
|
472
|
+
const active = this.getRootNode().activeElement;
|
|
473
|
+
const focused = this.levels.findIndex((level) => level.element === active);
|
|
474
|
+
if (focused >= 0 && after.has(focused) && !before.has(focused)) {
|
|
475
|
+
void this.updateComplete.then(() => this.more?.focus());
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
if (after.size || !before.size)
|
|
479
|
+
return;
|
|
480
|
+
const inside = !!this.shadowRoot?.activeElement;
|
|
481
|
+
if (!inside && !this.menuOpen)
|
|
482
|
+
return;
|
|
483
|
+
this.menuOpen = false;
|
|
484
|
+
const returned = this.levels.find((level, index) => before.has(index) && level.href !== null);
|
|
485
|
+
if (returned)
|
|
486
|
+
void this.updateComplete.then(() => returned.element.focus());
|
|
487
|
+
}
|
|
488
|
+
// ── A level's press and focus (BRC-18 to BRC-20): the shared primitives, on the product's anchors ─────────────────
|
|
489
|
+
linkOf(event) {
|
|
490
|
+
const path = event.composedPath();
|
|
491
|
+
return this.levels.find((level) => level.href !== null && path.includes(level.element))?.element ?? null;
|
|
492
|
+
}
|
|
493
|
+
pressOf(a) {
|
|
494
|
+
let press = this.presses.get(a);
|
|
495
|
+
if (!press) {
|
|
496
|
+
press = new PressController(a, {
|
|
497
|
+
container: () => a,
|
|
498
|
+
// The anchor's first transition is the hold (breadcrumbs.css), so its delay is press-hold as a time.
|
|
499
|
+
holdCarrier: () => a,
|
|
500
|
+
disabled: () => !a.hasAttribute('href'),
|
|
501
|
+
// BRC-18, BRC-22: Enter presses a link; Space does what it does on any link and shows no pressed state.
|
|
502
|
+
keys: LINK_KEYS,
|
|
503
|
+
});
|
|
504
|
+
this.presses.set(a, press);
|
|
505
|
+
this.pressControllers.add(press);
|
|
506
|
+
}
|
|
507
|
+
return press;
|
|
508
|
+
}
|
|
509
|
+
/** The press is this script's from here: the stylesheet's own answer to `:active` stands down for an anchor that carries `data-pressed`. */
|
|
510
|
+
answered(a) {
|
|
511
|
+
if (!a.hasAttribute('data-pressed'))
|
|
512
|
+
a.dataset.pressed = 'none';
|
|
513
|
+
}
|
|
514
|
+
// ── Drawing ───────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
515
|
+
willUpdate(changed) {
|
|
516
|
+
if (this.levelsStale)
|
|
517
|
+
this.readLevels();
|
|
518
|
+
else if (debugBuild() && (changed.has('label') || changed.has('overflow') || changed.has('overflowLabel') || changed.has('underline') || changed.has('out')))
|
|
519
|
+
this.check();
|
|
520
|
+
// BRC-10, BRC-15: no level out — no overflow button, and no menu of it.
|
|
521
|
+
if (this.wraps || this.out > this.levels.length - 1) {
|
|
522
|
+
this.out = 0;
|
|
523
|
+
this.cut = false;
|
|
524
|
+
}
|
|
525
|
+
if (!this.out)
|
|
526
|
+
this.menuOpen = false;
|
|
527
|
+
}
|
|
528
|
+
updated() {
|
|
529
|
+
// BRC-1: each level in the slot of its own list item; only a changed assignment is written (assigning again
|
|
530
|
+
// re-slots the child, which blurs a focused level).
|
|
531
|
+
const slots = this.renderRoot.querySelectorAll('li.level > slot');
|
|
532
|
+
this.levels.forEach((level, index) => {
|
|
533
|
+
const slot = slots[index];
|
|
534
|
+
if (slot && (slot.assignedNodes().length !== 1 || slot.assignedNodes()[0] !== level.element))
|
|
535
|
+
slot.assign(level.element);
|
|
536
|
+
});
|
|
537
|
+
mark(this, 'data-empty', this.levels.length ? null : '');
|
|
538
|
+
// BRC-30: where the browser has no style queries, the trail's token is read when it renders — again when the
|
|
539
|
+
// system is switched (SystemWatchController) — and named for the stylesheet. `always`, and a name that is not
|
|
540
|
+
// known, need no mark.
|
|
541
|
+
if (!styleQueries()) {
|
|
542
|
+
const named = getComputedStyle(this).getPropertyValue(UNDERLINE).trim();
|
|
543
|
+
mark(this, UNDERLINE_MARK, named === 'hover' || named === 'never' ? named : null);
|
|
544
|
+
}
|
|
545
|
+
// BRC-27: a level's own glyph is mirrored where the icon set marks its name — read where an icon is drawn.
|
|
546
|
+
const drawn = this.renderRoot.querySelector('.separator, .more-glyph') ?? this;
|
|
547
|
+
for (const level of this.levels)
|
|
548
|
+
mark(level.element, MIRRORED, level.icon && glyphMirrors(drawn, level.icon) ? '' : null);
|
|
549
|
+
// BRC-28: a label that is cut takes its text's direction as its own, so that every engine cuts it — and draws the
|
|
550
|
+
// ellipsis — at the text's own end. Not a level with a glyph, which stands at the layout's start, nor one whose
|
|
551
|
+
// direction the product named, nor a label without a letter, which has no direction of its own.
|
|
552
|
+
const last = this.levels.at(-1);
|
|
553
|
+
const direct = this.cut && last && !last.icon && STRONG.test(last.label) && (last.element === this.directed || !last.element.hasAttribute(DIRECTED)) ? last.element : null;
|
|
554
|
+
if (this.directed && this.directed !== direct)
|
|
555
|
+
this.directed.removeAttribute(DIRECTED);
|
|
556
|
+
if (direct)
|
|
557
|
+
mark(direct, DIRECTED, 'auto');
|
|
558
|
+
this.directed = direct;
|
|
559
|
+
// BRC-12: a line of the trail's text is watched once it is drawn.
|
|
560
|
+
const probe = this.renderRoot.querySelector('.text-probe');
|
|
561
|
+
if (probe !== this.watched) {
|
|
562
|
+
if (this.watched)
|
|
563
|
+
this.watch(this.watched, false);
|
|
564
|
+
if (probe)
|
|
565
|
+
this.watch(probe, true);
|
|
566
|
+
this.watched = probe;
|
|
567
|
+
}
|
|
568
|
+
// Measured with every other trail drawn in this turn, in one microtask after their updates — still in the task
|
|
569
|
+
// that drew them, before any frame.
|
|
570
|
+
const due = TanreiBreadcrumbs.due;
|
|
571
|
+
if (!due.size) {
|
|
572
|
+
queueMicrotask(() => {
|
|
573
|
+
const trails = [...due];
|
|
574
|
+
due.clear();
|
|
575
|
+
TanreiBreadcrumbs.decideTogether(trails, false);
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
due.add(this);
|
|
579
|
+
}
|
|
580
|
+
render() {
|
|
581
|
+
const levels = this.levels;
|
|
582
|
+
if (!levels.length)
|
|
583
|
+
return nothing;
|
|
584
|
+
const label = this.label ?? '';
|
|
585
|
+
// The product's words hold it under `breadcrumbsOverflowLabel`: the instance's prop, else that key.
|
|
586
|
+
const name = this.words.get('breadcrumbsOverflowLabel', this.overflowLabel ?? '');
|
|
587
|
+
const out = takenOut(levels.length, this.out);
|
|
588
|
+
const last = levels.length - 1;
|
|
589
|
+
const separator = html `<span part="separator" class="separator" aria-hidden="true"><span class="ink">${SEPARATOR}</span></span>`;
|
|
590
|
+
return html `
|
|
591
|
+
<nav part="nav" aria-label=${label.trim() ? label : nothing}>
|
|
592
|
+
<ol part="list" role="list" class=${this.wraps ? 'wrap' : 'collapse'}>
|
|
593
|
+
${levels.map((_level, index) => html `<li class=${classMap({ level: true, out: out.has(index), cut: this.cut && index === last })}><slot></slot>${index < last ? separator : nothing}</li>${index === 0 && last > 0 && !this.wraps
|
|
594
|
+
? html `<li class=${classMap({ more: true, none: !out.size })}>
|
|
595
|
+
<button
|
|
596
|
+
id="more"
|
|
597
|
+
part="overflow-button"
|
|
598
|
+
class="overflow"
|
|
599
|
+
type="button"
|
|
600
|
+
data-tanrei-shape
|
|
601
|
+
aria-label=${name.trim() ? name : nothing}
|
|
602
|
+
@click=${this.onMoreClick}
|
|
603
|
+
@pointerdown=${this.morePress.onPointerDown}
|
|
604
|
+
@pointerup=${this.morePress.release}
|
|
605
|
+
@pointercancel=${this.morePress.release}
|
|
606
|
+
@pointerleave=${this.morePress.release}
|
|
607
|
+
@keydown=${this.morePress.onKeyDown}
|
|
608
|
+
@keyup=${this.morePress.onKeyUp}
|
|
609
|
+
@blur=${this.morePress.onBlur}
|
|
610
|
+
@focus=${this.onMoreFocus}
|
|
611
|
+
>
|
|
612
|
+
<span part="overflow-icon" class="more-glyph" aria-hidden="true"><span class="ink">${MORE}</span></span>
|
|
613
|
+
</button>
|
|
614
|
+
${separator}
|
|
615
|
+
<tanrei-menu anchor="more" placement="bottom-start" .open=${this.menuOpen && out.size > 0} @close=${this.onMenuClose} @click=${this.onMenuClick}>
|
|
616
|
+
${levels.map((level, at) => out.has(at)
|
|
617
|
+
? html `<tanrei-menu-item
|
|
618
|
+
data-level=${at}
|
|
619
|
+
label=${level.label}
|
|
620
|
+
leading-icon=${level.icon || nothing}
|
|
621
|
+
href=${level.href ?? nothing}
|
|
622
|
+
?disabled=${level.href === null}
|
|
623
|
+
></tanrei-menu-item>`
|
|
624
|
+
: nothing)}
|
|
625
|
+
</tanrei-menu>
|
|
626
|
+
</li>`
|
|
627
|
+
: nothing}`)}
|
|
628
|
+
</ol>
|
|
629
|
+
<svg class="sizer" aria-hidden="true"></svg>
|
|
630
|
+
<span class="text-probe" aria-hidden="true">0</span>
|
|
631
|
+
${DIRECTION_PROBE}
|
|
632
|
+
</nav>
|
|
633
|
+
`;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
if (!customElements.get('tanrei-breadcrumbs'))
|
|
637
|
+
customElements.define('tanrei-breadcrumbs', TanreiBreadcrumbs);
|
|
638
|
+
//# sourceMappingURL=breadcrumbs.js.map
|