@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,616 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
+
import { hiddenHost } from '../../primitives/hidden.js';
|
|
4
|
+
import { ANCHORED_PLACEMENTS, ActionPlacement, AnchoredSurfaceController, AvailabilityController, BUTTON_VARIANTS, DismissController, GROUP_ITEM, GROUP_PLACE, HOST_VARIANT, assignSlot, choiceAttribute, compChoice, crossOffsetAttribute, deepActive, focusOverlay, giveVariant, hostAria, keepOverlayFocusAfterPress, numericAttribute, overlayDepth, registerOverlay, report, returnOverlayFocus, shadeFilter, syncFocusStyle, tabThroughOverlay, usableLength, watchInput, WordsController, } from '../../primitives/index.js';
|
|
5
|
+
import '../button/button.js';
|
|
6
|
+
import { ARRANGEMENTS, ARROW_PROPERTY, CHOICE, PREFIX, styles } from './popover.styles.js';
|
|
7
|
+
const PLACEMENTS = ANCHORED_PLACEMENTS;
|
|
8
|
+
const DEFAULT_PLACEMENT = 'bottom-start';
|
|
9
|
+
const WIDTHS = ['content', 'anchor'];
|
|
10
|
+
const INITIAL_FOCUS = ['popover', 'anchor'];
|
|
11
|
+
/** POP-24: a popover in a popover is the most a product should need; a third level is reported. */
|
|
12
|
+
const DEEP = 3;
|
|
13
|
+
/**
|
|
14
|
+
* POP-30: what an action is told through the Button's internal channel (src/primitives/group-item.ts) — the one thing a
|
|
15
|
+
* button group's standard item has that a Button alone has not: its label may wrap when its share of the row, or the
|
|
16
|
+
* column, gives it less than one line needs. First and last, so its hit area reaches as far as it would alone.
|
|
17
|
+
*/
|
|
18
|
+
const ACTION_PLACE = { variant: 'standard', first: true, last: true };
|
|
19
|
+
let ids = 0;
|
|
20
|
+
/**
|
|
21
|
+
* Shows content a person can read and operate on a small surface that opens beside the control they pressed and stays
|
|
22
|
+
* with it, without dimming or blocking the rest of the page.
|
|
23
|
+
*
|
|
24
|
+
* Contract: specs/popover.spec.json. The product owns the control: `anchor` is the id of the element the popover stands
|
|
25
|
+
* beside, in the popover's own tree (`anchorElement` for an element an id cannot reach), and that element is also the
|
|
26
|
+
* opener — the one that carries `aria-haspopup="dialog"`, `aria-expanded` and `aria-controls` and takes focus back —
|
|
27
|
+
* unless `opener` / `openerElement` names another (a field that anchors the surface, with a button inside it that
|
|
28
|
+
* opens it). The product sets `open` when the opener is pressed, and to false when the popover fires `close`: the
|
|
29
|
+
* popover never opens or closes by itself, on hover, on focus or after a time.
|
|
30
|
+
*
|
|
31
|
+
* The drawn popover is a `popover="manual"` element in the shadow root, in the top layer (above an open modal
|
|
32
|
+
* `<dialog>` the element stands in), holding a `role="dialog"` container that is not modal: no scrim, no focus trap,
|
|
33
|
+
* nothing behind it inert. It is placed against the anchor by script — the side and the alignment `placement` names,
|
|
34
|
+
* `offset` away and moved along the side by `crossOffset`; flipped to the opposite side, limited to the room where
|
|
35
|
+
* neither side has enough (its content then scrolls between the header and the actions), shifted along the side and,
|
|
36
|
+
* in a window smaller than its least size, moved back over the anchor — and follows the anchor while open. When
|
|
37
|
+
* nothing of the anchor can be seen it fires `close` with the reason `anchor-hidden`.
|
|
38
|
+
*
|
|
39
|
+
* Focus: opening moves focus to the slotted element marked `autofocus`, else to the container (`initialFocus="anchor"`
|
|
40
|
+
* leaves it where it is). The popover stands in the focus order directly after its opener wherever it is in the
|
|
41
|
+
* document: Tab on the opener enters it, Shift+Tab from its first element returns to the opener, Tab from its last
|
|
42
|
+
* element moves on to what follows the opener. Escape, a press outside, focus leaving, the close button and the
|
|
43
|
+
* anchor going out of sight each fire `close` once, with the reason; an action never does. An overlay opened from an
|
|
44
|
+
* element inside it (a menu, a tooltip, another popover, a dialog) is its own: a press or focus in it is not outside,
|
|
45
|
+
* Escape closes it first, and it closes with the popover. Closing returns focus to the opener if it was inside.
|
|
46
|
+
*
|
|
47
|
+
* The actions are `<tanrei-button slot="actions">` children, each marked `confirming` or `dismissive` where it is one,
|
|
48
|
+
* placed as a Button group places them; a Button without a `variant` attribute takes the popover's
|
|
49
|
+
* (`comp.popover.actions.variant`). `arrow` draws a triangle that points at the anchor, one shape with the container
|
|
50
|
+
* (unset, the system's `comp.popover.arrow.visible` decides).
|
|
51
|
+
*
|
|
52
|
+
* Every visual value comes from `--tanrei-comp-popover-*` tokens.
|
|
53
|
+
*
|
|
54
|
+
* @tag tanrei-popover
|
|
55
|
+
* @slot - The content: it gets `content.color` as its color, and plain text the body role; it scrolls between the header and the actions.
|
|
56
|
+
* @slot actions - Tanrei Buttons, each marked `confirming` or `dismissive` where it is one. The popover places them and gives those without a `variant` its own; it never restyles them.
|
|
57
|
+
* @csspart container - The raised surface: its color, corners and elevation. It is the dialog.
|
|
58
|
+
* @csspart arrow - The triangle that points at the anchor, while one is drawn.
|
|
59
|
+
* @csspart header - The row that holds the headline and the close button.
|
|
60
|
+
* @csspart headline - The headline (a heading).
|
|
61
|
+
* @csspart close-button - The close button, an icon-only `<tanrei-button>`.
|
|
62
|
+
* @csspart content - The scrolling box that holds the content.
|
|
63
|
+
* @csspart divider - A hairline below the header and above the actions, while the content scrolls (hidden from assistive technology).
|
|
64
|
+
* @csspart actions - The row (or column) of actions.
|
|
65
|
+
* @fires {CustomEvent<TanreiPopoverCloseDetail>} close - The popover asks to be closed: `detail.reason` is `escape`, `outside`, `focus-out`, `close` (its close button) or `anchor-hidden`. Set `open` to false.
|
|
66
|
+
*/
|
|
67
|
+
export class TanreiPopover extends LitElement {
|
|
68
|
+
constructor() {
|
|
69
|
+
super(...arguments);
|
|
70
|
+
this.availability = new AvailabilityController(this, 'popover');
|
|
71
|
+
/** The product's words, read where the instance gives none (src/primitives/words.ts). */
|
|
72
|
+
this.words = new WordsController(this);
|
|
73
|
+
/** Whether the popover is shown. Controlled: set it when the opener is pressed, and to false in answer to `close`. Reflected. */
|
|
74
|
+
this.open = false;
|
|
75
|
+
/**
|
|
76
|
+
* Where it prefers to stand: a side of the anchor and how it lines up along it, or `auto`. It flips to the opposite
|
|
77
|
+
* side when that one has no room, keeping the alignment. Anything else is placed as `bottom-start` (POP-37). Reflected.
|
|
78
|
+
*/
|
|
79
|
+
this.placement = DEFAULT_PLACEMENT;
|
|
80
|
+
/** The distance from the anchor's edge, in CSS pixels; 0 lets them touch. Null takes `offset`, the token. */
|
|
81
|
+
this.offset = null;
|
|
82
|
+
/**
|
|
83
|
+
* How far it moves along the side it stands on, in CSS pixels: positive towards the end above or below the anchor,
|
|
84
|
+
* towards the bottom beside it. It never moves the popover off the anchor's side. The attribute is `cross-offset`.
|
|
85
|
+
*/
|
|
86
|
+
this.crossOffset = 0;
|
|
87
|
+
/**
|
|
88
|
+
* Whether it draws an arrow that points at the anchor. Null, the default, takes the system's choice
|
|
89
|
+
* (`arrow.visible`, off in the default system). The attribute: absent is null, `arrow` is true, `arrow="false"` is false.
|
|
90
|
+
*/
|
|
91
|
+
this.arrow = null;
|
|
92
|
+
/** `content`: as wide as its content, between its least and greatest width. `anchor`: as wide as the anchor. Anything else is `content` (POP-37). Reflected. */
|
|
93
|
+
this.width = 'content';
|
|
94
|
+
/** Insets the content by the container's paddings. False — the attribute `no-inset` — lets content that pads itself reach the edges. */
|
|
95
|
+
this.inset = true;
|
|
96
|
+
/**
|
|
97
|
+
* `popover`: focus moves into it when it opens. `anchor`: focus stays where it is (a surface under a field the person
|
|
98
|
+
* is typing in). Anything else is `popover` (POP-37). The attribute is `initial-focus`.
|
|
99
|
+
*/
|
|
100
|
+
this.initialFocus = 'popover';
|
|
101
|
+
/** What the popover is about, drawn in its header and used as its accessible name. Empty draws none; the popover is then named by `label`. */
|
|
102
|
+
this.headline = '';
|
|
103
|
+
/** Names the popover for assistive technology where it draws no headline. Never drawn; ignored while `headline` is given. */
|
|
104
|
+
this.label = '';
|
|
105
|
+
/** Draws the close button at the end of the header. Reflected. */
|
|
106
|
+
this.closable = false;
|
|
107
|
+
/** The close button's accessible name ("Close filters"). Required while `closable` (POP-13). The attribute is `close-label`. */
|
|
108
|
+
this.closeLabel = '';
|
|
109
|
+
/** The id of the anchor — the element the popover stands beside — in the popover's own tree (its document or shadow root). */
|
|
110
|
+
this.anchor = '';
|
|
111
|
+
/** The anchor as an element, for one an id cannot reach (another shadow root). It wins over `anchor`. */
|
|
112
|
+
this.anchorElement = null;
|
|
113
|
+
/** The id of the opener, where it is not the anchor: the element that is pressed, carries the open state and takes focus back. */
|
|
114
|
+
this.opener = '';
|
|
115
|
+
/** The opener as an element, for one an id cannot reach. It wins over `opener`. */
|
|
116
|
+
this.openerElement = null;
|
|
117
|
+
/** For tests: draws the open container in place — inside its positioned ancestor, which stands for the window — not in the top layer; it then answers no dismissal and moves no focus. */
|
|
118
|
+
this.inline = false;
|
|
119
|
+
/** POP-9: whether the popover has at least one action, and any content. */
|
|
120
|
+
this.hasActions = false;
|
|
121
|
+
this.hasContent = false;
|
|
122
|
+
/** POP-14: the content children, assigned to the default slot. */
|
|
123
|
+
this.content = [];
|
|
124
|
+
/** POP-15, POP-16: the actions, by run, placed and given the popover's variant. */
|
|
125
|
+
this.placement$ = new ActionPlacement(this, (action) => this.resize$?.observe(action));
|
|
126
|
+
/** POP-30: the actions that were told their place. */
|
|
127
|
+
this.placed = new Set();
|
|
128
|
+
this.mutation$ = new MutationObserver(() => this.readSlots());
|
|
129
|
+
this.resize$ = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => this.onResize());
|
|
130
|
+
/** Whether the surface is presented: open, with an anchor and something to show. */
|
|
131
|
+
this.presented = false;
|
|
132
|
+
this.first = true;
|
|
133
|
+
/** The reason of the last `close` it fired (POP-22: a press outside may leave focus nowhere). */
|
|
134
|
+
this.lastReason = null;
|
|
135
|
+
/** POP-18: the element it wrote the opener's ARIA states on. */
|
|
136
|
+
this.stated = null;
|
|
137
|
+
this.unregister = null;
|
|
138
|
+
/** POP-1 to POP-5, POP-7, POP-8, POP-10, POP-26, POP-27, POP-36: where the surface is (src/primitives/anchored.ts). */
|
|
139
|
+
this.anchored = new AnchoredSurfaceController(this, {
|
|
140
|
+
surface: () => this.surface,
|
|
141
|
+
motion: () => this.find('.motion'),
|
|
142
|
+
box: () => this.container,
|
|
143
|
+
anchor: () => this.anchorNode,
|
|
144
|
+
placement: () => this.placement,
|
|
145
|
+
fallback: DEFAULT_PLACEMENT,
|
|
146
|
+
// POP-3: bottom, top, end, start, with start edges (top edges, beside the anchor) together.
|
|
147
|
+
auto: ['bottom', 'top', 'end', 'start'],
|
|
148
|
+
autoAlign: 'start',
|
|
149
|
+
offset: () => this.offset,
|
|
150
|
+
crossOffset: () => this.crossOffset,
|
|
151
|
+
arrow: () => this.wantsArrow,
|
|
152
|
+
matchWidth: () => this.width === 'anchor',
|
|
153
|
+
inline: () => this.inline,
|
|
154
|
+
// POP-5: its least size — the least width, and the parts that do not scroll.
|
|
155
|
+
least: () => ({
|
|
156
|
+
width: Number.parseFloat(getComputedStyle(this.find('.shade') ?? this).scrollMarginBlockStart) || 0,
|
|
157
|
+
height: (this.find('.header')?.offsetHeight ?? 0) + (this.hasActions ? (this.find('.footer')?.offsetHeight ?? 0) : 0),
|
|
158
|
+
}),
|
|
159
|
+
scroller: () => this.find('.content'),
|
|
160
|
+
shade: () => this.find('.shade'),
|
|
161
|
+
gone: () => this.requestClose('anchor-hidden'),
|
|
162
|
+
arrange: () => this.arrange(),
|
|
163
|
+
placed: () => this.syncScroll(),
|
|
164
|
+
depends: () => getComputedStyle(this).getPropertyValue(ARROW_PROPERTY).trim(),
|
|
165
|
+
});
|
|
166
|
+
/** POP-21, POP-23, POP-24: Escape, a press outside and focus leaving (src/primitives/dismiss.ts); POP-20: Tab at its ends. */
|
|
167
|
+
this.dismiss = new DismissController(this, {
|
|
168
|
+
related: () => [this.anchorNode, this.openerNode],
|
|
169
|
+
request: (reason) => this.requestClose(reason),
|
|
170
|
+
tab: (event) => {
|
|
171
|
+
const surface = this.container;
|
|
172
|
+
if (surface)
|
|
173
|
+
tabThroughOverlay(event, { surface, host: this, opener: this.openerNode });
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
/** POP-13: the close button asks once for each activation. */
|
|
177
|
+
this.onCloseClick = () => this.requestClose('close');
|
|
178
|
+
this.onScroll = () => this.syncScroll();
|
|
179
|
+
}
|
|
180
|
+
static { this.styles = [styles, hiddenHost]; }
|
|
181
|
+
// The children are assigned by hand: the content to the default slot, the actions to three slots in the order the
|
|
182
|
+
// orientation places them (BGR-15), so that focus and the accessibility tree follow the placed order without CSS `order`.
|
|
183
|
+
static { this.shadowRootOptions = { ...LitElement.shadowRootOptions, slotAssignment: 'manual' }; }
|
|
184
|
+
static { this.properties = {
|
|
185
|
+
open: { type: Boolean, reflect: true },
|
|
186
|
+
placement: { type: String, reflect: true },
|
|
187
|
+
offset: { converter: numericAttribute },
|
|
188
|
+
crossOffset: { attribute: 'cross-offset', converter: crossOffsetAttribute },
|
|
189
|
+
arrow: { reflect: true, converter: choiceAttribute },
|
|
190
|
+
width: { type: String, reflect: true },
|
|
191
|
+
inset: {
|
|
192
|
+
type: Boolean,
|
|
193
|
+
attribute: 'no-inset',
|
|
194
|
+
reflect: true,
|
|
195
|
+
converter: { fromAttribute: (value) => value === null, toAttribute: (value) => (value ? null : '') },
|
|
196
|
+
},
|
|
197
|
+
initialFocus: { type: String, attribute: 'initial-focus' },
|
|
198
|
+
headline: { type: String },
|
|
199
|
+
label: { type: String },
|
|
200
|
+
closable: { type: Boolean, reflect: true },
|
|
201
|
+
closeLabel: { type: String, attribute: 'close-label' },
|
|
202
|
+
anchor: { type: String },
|
|
203
|
+
anchorElement: { attribute: false },
|
|
204
|
+
opener: { type: String },
|
|
205
|
+
openerElement: { attribute: false },
|
|
206
|
+
inline: { type: Boolean, reflect: true },
|
|
207
|
+
hasActions: { state: true },
|
|
208
|
+
hasContent: { state: true },
|
|
209
|
+
}; }
|
|
210
|
+
get surface() {
|
|
211
|
+
return this.renderRoot?.querySelector('.surface') ?? null;
|
|
212
|
+
}
|
|
213
|
+
/** The dialog: the painted box, which takes focus when the popover opens. */
|
|
214
|
+
get container() {
|
|
215
|
+
return this.renderRoot?.querySelector('.container') ?? null;
|
|
216
|
+
}
|
|
217
|
+
find(selector) {
|
|
218
|
+
return this.renderRoot?.querySelector(selector) ?? null;
|
|
219
|
+
}
|
|
220
|
+
byId(id) {
|
|
221
|
+
if (!id)
|
|
222
|
+
return null;
|
|
223
|
+
const root = this.getRootNode();
|
|
224
|
+
return root.getElementById?.(id) ?? null;
|
|
225
|
+
}
|
|
226
|
+
/** The element the popover stands beside. */
|
|
227
|
+
get anchorNode() {
|
|
228
|
+
return this.anchorElement ?? this.byId(this.anchor);
|
|
229
|
+
}
|
|
230
|
+
/** POP-18: the element that opens it — the anchor, unless the product names another. */
|
|
231
|
+
get openerNode() {
|
|
232
|
+
return this.openerElement ?? this.byId(this.opener) ?? this.anchorNode;
|
|
233
|
+
}
|
|
234
|
+
/** Where the opener's ARIA states go: the opener, or the button a custom element draws in its open shadow root. */
|
|
235
|
+
get openerTarget() {
|
|
236
|
+
const opener = this.openerNode;
|
|
237
|
+
return opener?.shadowRoot?.querySelector('button, [role="button"]') ?? opener;
|
|
238
|
+
}
|
|
239
|
+
/** A choice of kind, by name, as the cascade gives it now — never cached, so a system switch is seen; unknown is the first. */
|
|
240
|
+
choice(token, values) {
|
|
241
|
+
return compChoice(this, `${PREFIX}-${token}`, values);
|
|
242
|
+
}
|
|
243
|
+
/** POP-10: whether an arrow is asked for right now: `arrow` when it is true or false, else the system's choice. */
|
|
244
|
+
get wantsArrow() {
|
|
245
|
+
return compChoice(this, ARROW_PROPERTY, CHOICE) === 'on';
|
|
246
|
+
}
|
|
247
|
+
/** @internal POP-30: where an action stands, for the Button that asks when it connects (src/primitives/group-item.ts); null for anything else. */
|
|
248
|
+
[GROUP_PLACE](child) {
|
|
249
|
+
return child.parentElement === this && child.getAttribute('slot') === 'actions' ? ACTION_PLACE : null;
|
|
250
|
+
}
|
|
251
|
+
/** POP-30: every action is told its place, and one that is an action no more is told it has none. */
|
|
252
|
+
place() {
|
|
253
|
+
const actions = new Set(this.placement$.actions);
|
|
254
|
+
for (const gone of this.placed)
|
|
255
|
+
if (!actions.has(gone) && gone.parentElement === this)
|
|
256
|
+
gone[GROUP_ITEM]?.set(null);
|
|
257
|
+
for (const action of actions)
|
|
258
|
+
action[GROUP_ITEM]?.set(ACTION_PLACE);
|
|
259
|
+
this.placed = actions;
|
|
260
|
+
}
|
|
261
|
+
/** @internal POP-16: the variant it gives one of its actions whose own is not set (src/primitives/group-item.ts). */
|
|
262
|
+
[HOST_VARIANT](child) {
|
|
263
|
+
return child.parentElement === this && child.getAttribute('slot') === 'actions' ? this.choice('actions-variant', BUTTON_VARIANTS) : null;
|
|
264
|
+
}
|
|
265
|
+
connectedCallback() {
|
|
266
|
+
super.connectedCallback();
|
|
267
|
+
// POP-19: whether it is opened by a key or by a press is seen from now on.
|
|
268
|
+
watchInput();
|
|
269
|
+
this.mutation$.observe(this, {
|
|
270
|
+
childList: true,
|
|
271
|
+
subtree: true,
|
|
272
|
+
characterData: true,
|
|
273
|
+
attributes: true,
|
|
274
|
+
attributeFilter: ['slot', 'confirming', 'dismissive'],
|
|
275
|
+
});
|
|
276
|
+
// POP-24: what opened it, for the surface it was opened from; when that surface closes, this one asks to be closed
|
|
277
|
+
// with it — its anchor is going out of sight — and the product closes it, as for every other reason.
|
|
278
|
+
this.unregister = registerOverlay(this, {
|
|
279
|
+
openers: () => [this.anchorNode, this.openerNode],
|
|
280
|
+
open: () => this.presented,
|
|
281
|
+
close: () => this.requestClose('anchor-hidden'),
|
|
282
|
+
kind: 'popover',
|
|
283
|
+
});
|
|
284
|
+
if (this.hasUpdated) {
|
|
285
|
+
this.readSlots();
|
|
286
|
+
this.observe();
|
|
287
|
+
// Put back in the page while open: presented again, as mounted.
|
|
288
|
+
this.requestUpdate();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
disconnectedCallback() {
|
|
292
|
+
super.disconnectedCallback();
|
|
293
|
+
this.mutation$.disconnect();
|
|
294
|
+
this.resize$?.disconnect();
|
|
295
|
+
this.unregister?.();
|
|
296
|
+
this.unregister = null;
|
|
297
|
+
// The controllers take the surface out of the top layer and stop listening; POP-18: what it wrote on the opener goes.
|
|
298
|
+
this.presented = false;
|
|
299
|
+
this.first = true;
|
|
300
|
+
this.state(null);
|
|
301
|
+
}
|
|
302
|
+
// ---- POP-21: asking to close ----
|
|
303
|
+
/** POP-21: `close` with the reason, while it is shown. The product sets `open` to false. */
|
|
304
|
+
requestClose(reason) {
|
|
305
|
+
if (!this.open || !this.presented)
|
|
306
|
+
return;
|
|
307
|
+
this.lastReason = reason;
|
|
308
|
+
this.dispatchEvent(new CustomEvent('close', { detail: { reason } }));
|
|
309
|
+
}
|
|
310
|
+
// ---- POP-18: the opener ----
|
|
311
|
+
/** POP-18: the opener says that it opens a dialog, whether that dialog is open, and which it is; what was written is taken back. */
|
|
312
|
+
state(target) {
|
|
313
|
+
const was = this.stated;
|
|
314
|
+
if (was && was !== target)
|
|
315
|
+
hostAria(was, { 'aria-haspopup': null, 'aria-expanded': null, 'aria-controls': null });
|
|
316
|
+
this.stated = target;
|
|
317
|
+
if (!target)
|
|
318
|
+
return;
|
|
319
|
+
if (!this.id)
|
|
320
|
+
this.id = `tanrei-popover-${++ids}`;
|
|
321
|
+
hostAria(target, {
|
|
322
|
+
'aria-haspopup': 'dialog',
|
|
323
|
+
'aria-expanded': String(this.presented),
|
|
324
|
+
'aria-controls': target.getRootNode() === this.getRootNode() ? this.id : null,
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
// ---- POP-8, POP-9, POP-15, POP-16: the parts and their layout ----
|
|
328
|
+
/** POP-9, POP-15: which child goes to which slot, and the actions' runs (BGR-13, BGR-14, BGR-18). */
|
|
329
|
+
readSlots() {
|
|
330
|
+
const nodes = [...this.childNodes];
|
|
331
|
+
this.content = nodes.filter((node) => (node instanceof Element && !node.hasAttribute('slot')) || (node.nodeType === Node.TEXT_NODE && !!node.textContent?.trim()));
|
|
332
|
+
this.placement$.read(nodes.filter((node) => node instanceof Element && node.getAttribute('slot') === 'actions'));
|
|
333
|
+
this.placement$.give(this.choice('actions-variant', BUTTON_VARIANTS));
|
|
334
|
+
this.place();
|
|
335
|
+
const [actions, content] = [this.placement$.actions.length > 0, this.content.length > 0];
|
|
336
|
+
if (actions !== this.hasActions || content !== this.hasContent) {
|
|
337
|
+
this.hasActions = actions;
|
|
338
|
+
this.hasContent = content;
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
this.assign();
|
|
342
|
+
this.onResize();
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/** The slots assigned by hand: the content, and the actions in the order of the orientation (BGR-15). */
|
|
346
|
+
assign() {
|
|
347
|
+
const root = this.renderRoot;
|
|
348
|
+
if (!root)
|
|
349
|
+
return;
|
|
350
|
+
assignSlot(root.querySelector('slot:not([name])'), this.content);
|
|
351
|
+
this.placement$.assign(root.querySelectorAll('.actions slot'));
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* POP-13, POP-15, POP-16: the variants the popover's tokens name, read now (a system switch is seen at the next
|
|
355
|
+
* layout), and the actions as the system's arrangement places them — `fill` a row while every label fits its equal
|
|
356
|
+
* share, `end` while the row at their own widths fits the inner width, and a column otherwise.
|
|
357
|
+
*/
|
|
358
|
+
arrange() {
|
|
359
|
+
const container = this.container;
|
|
360
|
+
if (!container)
|
|
361
|
+
return;
|
|
362
|
+
giveVariant(this.find('tanrei-button.close'), this.choice('close-button-variant', BUTTON_VARIANTS));
|
|
363
|
+
this.placement$.give(this.choice('actions-variant', BUTTON_VARIANTS));
|
|
364
|
+
const arrangement = this.choice('actions-arrangement', ARRANGEMENTS);
|
|
365
|
+
if (container.dataset.arrangement !== arrangement)
|
|
366
|
+
container.dataset.arrangement = arrangement;
|
|
367
|
+
const actions = this.find('.actions');
|
|
368
|
+
if (actions && this.hasActions && actions.getClientRects().length) {
|
|
369
|
+
// POP-7: the container is at least as wide as its actions in one row at their own widths — whether they are a
|
|
370
|
+
// row or a column, so that the width the decision is made for does not depend on what was decided before.
|
|
371
|
+
container.style.removeProperty('--_actions-row');
|
|
372
|
+
const { changed, natural } = this.placement$.measure(actions, arrangement === 'end' ? 'packed' : 'fill');
|
|
373
|
+
if (changed)
|
|
374
|
+
this.assign();
|
|
375
|
+
const style = getComputedStyle(actions);
|
|
376
|
+
container.style.setProperty('--_actions-row', `${natural + (Number.parseFloat(style.paddingInlineStart) || 0) + (Number.parseFloat(style.paddingInlineEnd) || 0)}px`);
|
|
377
|
+
}
|
|
378
|
+
else if (container.style.getPropertyValue('--_actions-row'))
|
|
379
|
+
container.style.removeProperty('--_actions-row');
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* POP-8: what scrolls, and the dividers. The content scrolls between the header and the actions — a Tab stop while it
|
|
383
|
+
* does, so the keyboard can scroll it — with a divider below the header while it is scrolled away from its top and
|
|
384
|
+
* one above the actions while more of it lies below; where the header and the actions alone leave no room for it,
|
|
385
|
+
* everything scrolls together and no divider is drawn. At once, without motion.
|
|
386
|
+
*/
|
|
387
|
+
syncScroll() {
|
|
388
|
+
const clip = this.find('.clip');
|
|
389
|
+
const content = this.find('.content');
|
|
390
|
+
if (!clip || !content)
|
|
391
|
+
return;
|
|
392
|
+
const header = this.find('.header');
|
|
393
|
+
const footer = this.hasActions ? this.find('.footer') : null;
|
|
394
|
+
const fixed = (header?.offsetHeight ?? 0) + (footer?.offsetHeight ?? 0);
|
|
395
|
+
const room = clip.clientHeight;
|
|
396
|
+
const crowded = this.hasContent && fixed > 0 && fixed + content.scrollHeight > room + 0.5 && fixed >= room - 0.5;
|
|
397
|
+
if (clip.classList.contains('crowded') !== crowded)
|
|
398
|
+
clip.classList.toggle('crowded', crowded);
|
|
399
|
+
const stop = (element, on) => {
|
|
400
|
+
if (on && element.getAttribute('tabindex') !== '0')
|
|
401
|
+
element.setAttribute('tabindex', '0');
|
|
402
|
+
else if (!on && element.hasAttribute('tabindex'))
|
|
403
|
+
element.removeAttribute('tabindex');
|
|
404
|
+
};
|
|
405
|
+
const scrolls = (element) => element.scrollHeight > element.clientHeight + 0.5;
|
|
406
|
+
stop(content, !crowded && scrolls(content));
|
|
407
|
+
stop(clip, crowded && scrolls(clip));
|
|
408
|
+
const scrolled = !crowded && !!header && content.scrollTop > 0.5;
|
|
409
|
+
const more = !crowded && !!footer && content.scrollTop + content.clientHeight < content.scrollHeight - 0.5;
|
|
410
|
+
if (clip.hasAttribute('data-scrolled') !== scrolled)
|
|
411
|
+
clip.toggleAttribute('data-scrolled', scrolled);
|
|
412
|
+
if (clip.hasAttribute('data-more') !== more)
|
|
413
|
+
clip.toggleAttribute('data-more', more);
|
|
414
|
+
}
|
|
415
|
+
/** A part changed size (its text, the text size, the window): the actions are placed again, and the surface with them. */
|
|
416
|
+
onResize() {
|
|
417
|
+
if (!this.presented)
|
|
418
|
+
return;
|
|
419
|
+
this.arrange();
|
|
420
|
+
this.syncScroll();
|
|
421
|
+
this.anchored.request();
|
|
422
|
+
}
|
|
423
|
+
/** What changes whether the actions fit and whether the content scrolls: the container, the content and the row. */
|
|
424
|
+
observe() {
|
|
425
|
+
for (const selector of ['.container', '.header', '.content', '.inner', '.actions']) {
|
|
426
|
+
const element = this.find(selector);
|
|
427
|
+
if (element)
|
|
428
|
+
this.resize$?.observe(element);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
// ---- POP-1, POP-19, POP-22, POP-24: presenting and focus ----
|
|
432
|
+
/** POP-29: whether it has anything to draw. */
|
|
433
|
+
get empty() {
|
|
434
|
+
return !this.hasContent && !this.hasActions && !this.headline.trim();
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* POP-1, POP-19: into the top layer beside the anchor, and focus in — to the slotted element marked `autofocus`, else
|
|
438
|
+
* to the container — unless it is mounted open, drawn in place, or `initialFocus` is `anchor`.
|
|
439
|
+
*/
|
|
440
|
+
present(moveFocus) {
|
|
441
|
+
const before = deepActive();
|
|
442
|
+
if (!this.anchored.show())
|
|
443
|
+
return;
|
|
444
|
+
this.presented = true;
|
|
445
|
+
this.lastReason = null;
|
|
446
|
+
this.syncScroll();
|
|
447
|
+
if (this.inline)
|
|
448
|
+
return;
|
|
449
|
+
this.dismiss.start();
|
|
450
|
+
const container = this.container;
|
|
451
|
+
if (moveFocus && this.initialFocus !== 'anchor' && container)
|
|
452
|
+
focusOverlay(this, container);
|
|
453
|
+
else if (deepActive() !== before) {
|
|
454
|
+
// The browser's own popover steps focus an `autofocus` element: focus stays where it was.
|
|
455
|
+
if (before instanceof HTMLElement && before !== document.body)
|
|
456
|
+
before.focus({ preventScroll: true });
|
|
457
|
+
else
|
|
458
|
+
deepActive()?.blur?.();
|
|
459
|
+
}
|
|
460
|
+
// POP-24: nesting works at any depth; a third level is reported.
|
|
461
|
+
const depth = overlayDepth(this, 'popover');
|
|
462
|
+
if (depth >= DEEP)
|
|
463
|
+
report(this, 'POP-24', `it is the popover at depth ${depth} of popovers opened from inside popovers; one popover inside a popover is the most a product should need`, { once: false });
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* POP-1, POP-22, POP-24, POP-27: every overlay opened from inside closes with it; focus goes back to the opener if it
|
|
467
|
+
* was inside or lost, and stays where the person put it otherwise; the surface fades out, taking no pointer and no
|
|
468
|
+
* focus, and leaves the top layer.
|
|
469
|
+
*/
|
|
470
|
+
withdraw() {
|
|
471
|
+
if (!this.presented)
|
|
472
|
+
return;
|
|
473
|
+
this.presented = false;
|
|
474
|
+
if (!this.inline && this.dismiss.active) {
|
|
475
|
+
const opener = this.openerNode;
|
|
476
|
+
this.dismiss.closeOwned();
|
|
477
|
+
returnOverlayFocus(opener, (node) => this.dismiss.owns(node));
|
|
478
|
+
if (this.lastReason === 'outside')
|
|
479
|
+
keepOverlayFocusAfterPress(opener);
|
|
480
|
+
this.dismiss.stop();
|
|
481
|
+
}
|
|
482
|
+
this.lastReason = null;
|
|
483
|
+
this.anchored.hide();
|
|
484
|
+
}
|
|
485
|
+
firstUpdated() {
|
|
486
|
+
this.readSlots();
|
|
487
|
+
this.observe();
|
|
488
|
+
}
|
|
489
|
+
updated(changed) {
|
|
490
|
+
// Before it is presented or measured: the slots of the element just rendered hold their children.
|
|
491
|
+
this.assign();
|
|
492
|
+
this.reportProps(changed);
|
|
493
|
+
const opening = changed.has('open') && this.open;
|
|
494
|
+
const anchor = this.anchorNode;
|
|
495
|
+
const want = this.open && this.isConnected && !!anchor && !this.empty;
|
|
496
|
+
if (opening && !anchor && this.first && document.readyState === 'loading') {
|
|
497
|
+
// Its anchor may stand after it in a document that is still being read: looked for again once it has been.
|
|
498
|
+
document.addEventListener('DOMContentLoaded', () => this.requestUpdate(), { once: true });
|
|
499
|
+
}
|
|
500
|
+
else if (opening && !want) {
|
|
501
|
+
// POP-29: it stays closed, emits nothing, and says why.
|
|
502
|
+
if (!anchor)
|
|
503
|
+
report(this, 'POP-29', this.anchor || this.anchorElement ? `no element with the id "${this.anchor}" was found in its tree, so it stays closed; give it the id of its anchor` : 'it has no anchor, so it stays closed; set anchor to the id of the element it stands beside', { once: false });
|
|
504
|
+
else if (this.empty)
|
|
505
|
+
report(this, 'POP-29', 'it opened with no content, no headline and no action, so it draws nothing; give it content', { once: false });
|
|
506
|
+
}
|
|
507
|
+
const mode = changed.has('inline') && this.presented;
|
|
508
|
+
if (mode) {
|
|
509
|
+
// Another presentation: taken out at once, and presented again below as mounted.
|
|
510
|
+
this.presented = false;
|
|
511
|
+
this.dismiss.stop();
|
|
512
|
+
this.anchored.hide(false);
|
|
513
|
+
}
|
|
514
|
+
if (want && !this.presented) {
|
|
515
|
+
// POP-19: a popover mounted with open true (or shown again by anything but `open`) moves no focus.
|
|
516
|
+
this.present(opening && !this.first && !mode);
|
|
517
|
+
if (this.presented)
|
|
518
|
+
this.observe();
|
|
519
|
+
}
|
|
520
|
+
else if (!want && this.presented)
|
|
521
|
+
this.withdraw();
|
|
522
|
+
else if (this.presented) {
|
|
523
|
+
// POP-2, POP-33: a prop that decides the place takes effect at once; the parts are laid out for what was drawn.
|
|
524
|
+
this.arrange();
|
|
525
|
+
this.anchored.place();
|
|
526
|
+
this.syncScroll();
|
|
527
|
+
}
|
|
528
|
+
this.state(this.openerTarget);
|
|
529
|
+
this.first = false;
|
|
530
|
+
}
|
|
531
|
+
/** What a debug build reports (POP-4, POP-13, POP-29, POP-37). */
|
|
532
|
+
reportProps(changed) {
|
|
533
|
+
if (changed.has('placement') && !PLACEMENTS.includes(this.placement)) {
|
|
534
|
+
report(this, 'POP-37', `placement "${String(this.placement)}" is not one of ${PLACEMENTS.join(', ')}; the popover is placed as "${DEFAULT_PLACEMENT}"`);
|
|
535
|
+
}
|
|
536
|
+
if (changed.has('width') && !WIDTHS.includes(this.width))
|
|
537
|
+
report(this, 'POP-37', `width "${String(this.width)}" is not one of ${WIDTHS.join(', ')}; the popover is as wide as its content`);
|
|
538
|
+
if (changed.has('initialFocus') && !INITIAL_FOCUS.includes(this.initialFocus)) {
|
|
539
|
+
report(this, 'POP-37', `initial-focus "${String(this.initialFocus)}" is not one of ${INITIAL_FOCUS.join(', ')}; focus moves into the popover`);
|
|
540
|
+
}
|
|
541
|
+
const offset = this.offset;
|
|
542
|
+
if (changed.has('offset') && offset !== null && offset !== undefined && !usableLength(offset)) {
|
|
543
|
+
const why = typeof offset === 'number' && Number.isFinite(offset) ? 'is negative' : 'is not a finite number';
|
|
544
|
+
report(this, 'POP-4', `offset ${JSON.stringify(String(offset))} ${why}; comp.popover.offset is used in its place`);
|
|
545
|
+
}
|
|
546
|
+
const cross = this.crossOffset;
|
|
547
|
+
if (changed.has('crossOffset') && cross !== null && cross !== undefined && !Number.isFinite(cross)) {
|
|
548
|
+
report(this, 'POP-4', `cross-offset ${JSON.stringify(String(cross))} is not a finite number; 0 is used in its place`);
|
|
549
|
+
}
|
|
550
|
+
if ((changed.has('closable') || changed.has('closeLabel')) && this.closable && this.words.lacks('closeLabel', this.closeLabel)) {
|
|
551
|
+
report(this, 'POP-13', 'close-label is empty, so the close button has no accessible name; give it a close-label');
|
|
552
|
+
}
|
|
553
|
+
if (changed.has('open') && this.open && !this.headline.trim() && !this.label.trim() && !this.empty) {
|
|
554
|
+
report(this, 'POP-29', 'headline and label are both empty, so the dialog has no accessible name; give it a headline, or a label where it draws none');
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
render() {
|
|
558
|
+
const headline = this.headline.trim() ? this.headline : '';
|
|
559
|
+
const header = !!headline || this.closable;
|
|
560
|
+
// POP-28: a dialog that is not modal (no aria-modal), named by the headline, or by label where it draws none.
|
|
561
|
+
const name = headline || this.label.trim() || nothing;
|
|
562
|
+
// POP-19: a value the popover does not define moves focus in (POP-37).
|
|
563
|
+
return html `
|
|
564
|
+
<div class="surface" popover=${this.inline ? nothing : 'manual'} role="none">
|
|
565
|
+
<div class="motion">
|
|
566
|
+
<span part="arrow" class="arrow" aria-hidden="true"></span>
|
|
567
|
+
<div
|
|
568
|
+
part="container"
|
|
569
|
+
class="container"
|
|
570
|
+
role="dialog"
|
|
571
|
+
aria-label=${name}
|
|
572
|
+
tabindex="-1"
|
|
573
|
+
data-tanrei-shape
|
|
574
|
+
@focus=${(event) => syncFocusStyle(this, event.currentTarget)}
|
|
575
|
+
>
|
|
576
|
+
<div class="clip" data-tanrei-shape @focus=${(event) => syncFocusStyle(this, event.currentTarget)}>
|
|
577
|
+
${header
|
|
578
|
+
? html `<div part="header" class=${classMap({ header: true, closable: this.closable, last: !this.hasContent && !this.hasActions })}>
|
|
579
|
+
${headline ? html `<h2 part="headline" class="headline">${headline}</h2>` : nothing}
|
|
580
|
+
${this.closable
|
|
581
|
+
? html `<span class="close-box"
|
|
582
|
+
><tanrei-button part="close-button" class="close" size="small" label=${this.words.get('closeLabel', this.closeLabel)} @click=${this.onCloseClick}><span slot="icon">close</span></tanrei-button></span
|
|
583
|
+
>`
|
|
584
|
+
: nothing}
|
|
585
|
+
<div part="divider" class="divider below-header" aria-hidden="true"></div>
|
|
586
|
+
</div>`
|
|
587
|
+
: nothing}
|
|
588
|
+
<div class=${classMap({ middle: true, empty: !this.hasContent })}>
|
|
589
|
+
<div
|
|
590
|
+
part="content"
|
|
591
|
+
class=${classMap({ content: true, top: !header, bottom: !this.hasActions, empty: !this.hasContent })}
|
|
592
|
+
data-tanrei-shape
|
|
593
|
+
@scroll=${this.onScroll}
|
|
594
|
+
@focus=${(event) => syncFocusStyle(this, event.currentTarget)}
|
|
595
|
+
>
|
|
596
|
+
<div class="inner"><slot @slotchange=${() => this.onResize()}></slot></div>
|
|
597
|
+
</div>
|
|
598
|
+
<span class="focus" data-tanrei-shape></span>
|
|
599
|
+
</div>
|
|
600
|
+
<div class="footer" ?hidden=${!this.hasActions}>
|
|
601
|
+
<div part="divider" class="divider above-actions" aria-hidden="true"></div>
|
|
602
|
+
<div part="actions" class="actions"><slot name="actions-first"></slot><slot name="actions-between"></slot><slot name="actions-last"></slot></div>
|
|
603
|
+
</div>
|
|
604
|
+
</div>
|
|
605
|
+
<span class="focus whole" data-tanrei-shape></span>
|
|
606
|
+
</div>
|
|
607
|
+
</div>
|
|
608
|
+
<span class="shade" aria-hidden="true"></span>
|
|
609
|
+
${shadeFilter(this.anchored.layers)}
|
|
610
|
+
</div>
|
|
611
|
+
`;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
if (!customElements.get('tanrei-popover'))
|
|
615
|
+
customElements.define('tanrei-popover', TanreiPopover);
|
|
616
|
+
//# sourceMappingURL=popover.js.map
|