@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,38 @@
|
|
|
1
|
+
export declare const modalLayer: {
|
|
2
|
+
/** Whether a Tanrei modal overlay is open in this window. */
|
|
3
|
+
readonly covered: boolean;
|
|
4
|
+
add(element: Element): void;
|
|
5
|
+
delete(element: Element): void;
|
|
6
|
+
/** Calls `listener` whenever a modal overlay opens or closes; returns the unsubscribe. */
|
|
7
|
+
subscribe(listener: () => void): () => void;
|
|
8
|
+
};
|
|
9
|
+
/** The element that has focus, through shadow roots. */
|
|
10
|
+
export declare function deepActive(): Element | null;
|
|
11
|
+
/** Whether focus is inside `host`: in its light DOM, its shadow root, or a shadow root nested in either. */
|
|
12
|
+
export declare function focusWithin(host: Element): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Focus back to `opener`, the element that had it when an overlay or a region opened (BSH-3, SSH-3) — or, where that
|
|
15
|
+
* element is gone, cannot take focus or is inert, dropped from inside `host` (the platform's default: the document).
|
|
16
|
+
*/
|
|
17
|
+
export declare function returnFocus(opener: Element | null, host: Element): void;
|
|
18
|
+
/**
|
|
19
|
+
* The elements Tab stops at inside `root`, in the order Tab visits them: through shadow roots and slots (a Tanrei
|
|
20
|
+
* Button's native button, a slotted field), skipping what is disabled, hidden or inert.
|
|
21
|
+
*
|
|
22
|
+
* `root` itself is never one of them, whatever `tabIndex` it has: it is what the stops are inside of (Firefox reports
|
|
23
|
+
* 0 for a `<dialog>` with no `tabindex`, and a trap that counted it wrapped to the dialog instead of its first
|
|
24
|
+
* control). And what a shadow host holds is reached through its shadow tree alone — its slots, in the order the tree
|
|
25
|
+
* places them — so a slotted element is listed once, where it is drawn, and a child that no slot takes is not listed.
|
|
26
|
+
*/
|
|
27
|
+
export declare function tabbables(root: Node): HTMLElement[];
|
|
28
|
+
/**
|
|
29
|
+
* The focus trap of a modal overlay (DLG-3, NVD-19): Tab from the last focusable element inside `container` goes to the
|
|
30
|
+
* first, Shift+Tab from the first (or from the container itself) to the last; with nothing focusable, the container keeps
|
|
31
|
+
* focus. Call it from the container's `keydown` for Tab.
|
|
32
|
+
*/
|
|
33
|
+
export declare function trapFocus(event: KeyboardEvent, container: HTMLElement): void;
|
|
34
|
+
/**
|
|
35
|
+
* The page's scroll, held while any modal overlay is open (DLG-1, NVD-19): `overflow: hidden` on the root from the first
|
|
36
|
+
* holder until the last lets go, then the root's own value back.
|
|
37
|
+
*/
|
|
38
|
+
export declare function holdPageScroll(holder: Element, hold: boolean): void;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Tanrei modal overlays open in this window (a `<tanrei-dialog>` shown modally), for the overlays that wait for them
|
|
3
|
+
* or pause under them: a snackbar that is not shown yet waits until the last one closes (SNK-12), and a showing one
|
|
4
|
+
* pauses its timeout while one covers it (SNK-9). A modal overlay adds itself when it opens and removes itself when it
|
|
5
|
+
* closes; anyone may subscribe to the change.
|
|
6
|
+
*/
|
|
7
|
+
const open = new Set();
|
|
8
|
+
const listeners = new Set();
|
|
9
|
+
export const modalLayer = {
|
|
10
|
+
/** Whether a Tanrei modal overlay is open in this window. */
|
|
11
|
+
get covered() {
|
|
12
|
+
return open.size > 0;
|
|
13
|
+
},
|
|
14
|
+
add(element) {
|
|
15
|
+
if (open.has(element))
|
|
16
|
+
return;
|
|
17
|
+
// The overlays already open are now under this one, and inert: the platform says so of everything outside the
|
|
18
|
+
// topmost modal dialog. WebKit keeps the style it computed for a `<dialog>` while it was the topmost — "not
|
|
19
|
+
// inert" — when another opens above it, so a script could still focus what is inside the lower one (it
|
|
20
|
+
// does the same with two bare `<dialog>`s).
|
|
21
|
+
// Its shadow tree is styled again — the same sheets, given again — and the engine then reads it as it is.
|
|
22
|
+
for (const under of open) {
|
|
23
|
+
const root = under.shadowRoot;
|
|
24
|
+
if (root)
|
|
25
|
+
root.adoptedStyleSheets = [...root.adoptedStyleSheets];
|
|
26
|
+
}
|
|
27
|
+
open.add(element);
|
|
28
|
+
for (const listener of [...listeners])
|
|
29
|
+
listener();
|
|
30
|
+
},
|
|
31
|
+
delete(element) {
|
|
32
|
+
if (!open.delete(element))
|
|
33
|
+
return;
|
|
34
|
+
for (const listener of [...listeners])
|
|
35
|
+
listener();
|
|
36
|
+
},
|
|
37
|
+
/** Calls `listener` whenever a modal overlay opens or closes; returns the unsubscribe. */
|
|
38
|
+
subscribe(listener) {
|
|
39
|
+
listeners.add(listener);
|
|
40
|
+
return () => listeners.delete(listener);
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
/** The element that has focus, through shadow roots. */
|
|
44
|
+
export function deepActive() {
|
|
45
|
+
let active = document.activeElement;
|
|
46
|
+
while (active?.shadowRoot?.activeElement)
|
|
47
|
+
active = active.shadowRoot.activeElement;
|
|
48
|
+
return active;
|
|
49
|
+
}
|
|
50
|
+
/** Whether focus is inside `host`: in its light DOM, its shadow root, or a shadow root nested in either. */
|
|
51
|
+
export function focusWithin(host) {
|
|
52
|
+
const active = deepActive();
|
|
53
|
+
if (!active)
|
|
54
|
+
return false;
|
|
55
|
+
if (host.contains(active) || host.shadowRoot?.contains(active))
|
|
56
|
+
return true;
|
|
57
|
+
let root = active.getRootNode();
|
|
58
|
+
while (root instanceof ShadowRoot) {
|
|
59
|
+
if (root.host === host || host.contains(root.host))
|
|
60
|
+
return true;
|
|
61
|
+
root = root.host.getRootNode();
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Focus back to `opener`, the element that had it when an overlay or a region opened (BSH-3, SSH-3) — or, where that
|
|
67
|
+
* element is gone, cannot take focus or is inert, dropped from inside `host` (the platform's default: the document).
|
|
68
|
+
*/
|
|
69
|
+
export function returnFocus(opener, host) {
|
|
70
|
+
const element = opener;
|
|
71
|
+
if (element && element.isConnected && typeof element.focus === 'function' && !element.closest('[inert]'))
|
|
72
|
+
element.focus();
|
|
73
|
+
else if (focusWithin(host))
|
|
74
|
+
deepActive()?.blur();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The elements Tab stops at inside `root`, in the order Tab visits them: through shadow roots and slots (a Tanrei
|
|
78
|
+
* Button's native button, a slotted field), skipping what is disabled, hidden or inert.
|
|
79
|
+
*
|
|
80
|
+
* `root` itself is never one of them, whatever `tabIndex` it has: it is what the stops are inside of (Firefox reports
|
|
81
|
+
* 0 for a `<dialog>` with no `tabindex`, and a trap that counted it wrapped to the dialog instead of its first
|
|
82
|
+
* control). And what a shadow host holds is reached through its shadow tree alone — its slots, in the order the tree
|
|
83
|
+
* places them — so a slotted element is listed once, where it is drawn, and a child that no slot takes is not listed.
|
|
84
|
+
*/
|
|
85
|
+
export function tabbables(root) {
|
|
86
|
+
const found = [];
|
|
87
|
+
const inside = (node) => {
|
|
88
|
+
// A host's light children are in the flat tree only where a slot of its shadow tree takes them.
|
|
89
|
+
if (node instanceof Element && node.shadowRoot)
|
|
90
|
+
visit(node.shadowRoot);
|
|
91
|
+
else
|
|
92
|
+
for (const child of node.childNodes)
|
|
93
|
+
visit(child);
|
|
94
|
+
};
|
|
95
|
+
const visit = (node) => {
|
|
96
|
+
if (node instanceof HTMLSlotElement) {
|
|
97
|
+
for (const assigned of node.assignedNodes({ flatten: true }))
|
|
98
|
+
visit(assigned);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!(node instanceof HTMLElement)) {
|
|
102
|
+
inside(node);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (node.inert || node.hidden)
|
|
106
|
+
return;
|
|
107
|
+
if (typeof node.checkVisibility === 'function' && !node.checkVisibility({ visibilityProperty: true }))
|
|
108
|
+
return;
|
|
109
|
+
const disabled = 'disabled' in node && node.disabled === true;
|
|
110
|
+
if (!node.shadowRoot && node.tabIndex >= 0 && !disabled)
|
|
111
|
+
found.push(node);
|
|
112
|
+
else if (node.shadowRoot && node.hasAttribute('tabindex') && node.tabIndex >= 0)
|
|
113
|
+
found.push(node);
|
|
114
|
+
inside(node);
|
|
115
|
+
};
|
|
116
|
+
// The root is asked what it holds, not whether it is a stop.
|
|
117
|
+
if (root instanceof HTMLSlotElement)
|
|
118
|
+
visit(root);
|
|
119
|
+
else if (!(root instanceof HTMLElement) || !(root.inert || root.hidden))
|
|
120
|
+
inside(root);
|
|
121
|
+
return found;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The focus trap of a modal overlay (DLG-3, NVD-19): Tab from the last focusable element inside `container` goes to the
|
|
125
|
+
* first, Shift+Tab from the first (or from the container itself) to the last; with nothing focusable, the container keeps
|
|
126
|
+
* focus. Call it from the container's `keydown` for Tab.
|
|
127
|
+
*/
|
|
128
|
+
export function trapFocus(event, container) {
|
|
129
|
+
const order = tabbables(container);
|
|
130
|
+
if (order.length === 0) {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
container.focus();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const active = deepActive();
|
|
136
|
+
const first = order[0];
|
|
137
|
+
const last = order[order.length - 1];
|
|
138
|
+
const at = (element) => active === element || (active instanceof Element && element.shadowRoot?.contains(active));
|
|
139
|
+
if (event.shiftKey && (active === container || at(first))) {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
last.focus();
|
|
142
|
+
}
|
|
143
|
+
else if (!event.shiftKey && at(last)) {
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
first.focus();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/** The overlays holding the page's scroll, and what the root's own overflow was before the first of them. */
|
|
149
|
+
const holders = new Set();
|
|
150
|
+
let heldOverflow = null;
|
|
151
|
+
/**
|
|
152
|
+
* The page's scroll, held while any modal overlay is open (DLG-1, NVD-19): `overflow: hidden` on the root from the first
|
|
153
|
+
* holder until the last lets go, then the root's own value back.
|
|
154
|
+
*/
|
|
155
|
+
export function holdPageScroll(holder, hold) {
|
|
156
|
+
if (hold)
|
|
157
|
+
holders.add(holder);
|
|
158
|
+
else
|
|
159
|
+
holders.delete(holder);
|
|
160
|
+
const root = document.documentElement;
|
|
161
|
+
// A document being torn down has no root element left to give back.
|
|
162
|
+
if (!root) {
|
|
163
|
+
heldOverflow = null;
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (holders.size > 0 && heldOverflow === null) {
|
|
167
|
+
heldOverflow = root.style.overflow;
|
|
168
|
+
root.style.overflow = 'hidden';
|
|
169
|
+
}
|
|
170
|
+
else if (holders.size === 0 && heldOverflow !== null) {
|
|
171
|
+
root.style.overflow = heldOverflow;
|
|
172
|
+
heldOverflow = null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../src/primitives/modal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,IAAI,GAAG,IAAI,GAAG,EAAW,CAAC;AAChC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;AAExC,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,6DAA6D;IAC7D,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,GAAG,CAAC,OAAgB;QAClB,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,OAAO;QAC9B,8GAA8G;QAC9G,4GAA4G;QAC5G,uGAAuG;QACvG,4CAA4C;QAC5C,0GAA0G;QAC1G,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC;YA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AY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACjC,CAAC;SAAM,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QACvD,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,YAAY,CAAC;QACnC,YAAY,GAAG,IAAI,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** The native element a component edits its text in. */
|
|
2
|
+
export type NativeText = HTMLInputElement | HTMLTextAreaElement;
|
|
3
|
+
export interface NativeTextOptions {
|
|
4
|
+
/** The native element, when it is rendered. */
|
|
5
|
+
input: () => NativeText | null;
|
|
6
|
+
/** The component's value now. */
|
|
7
|
+
value: () => string;
|
|
8
|
+
/** The component takes a value the person gave the element (no event of its own: the element's `input` is it). */
|
|
9
|
+
setValue: (value: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* What a committed composition may leave in the element, before the component takes it: the text field's limit
|
|
12
|
+
* (TXF-18). `from` is the value when the composition began. Not called when a value the product set is applied.
|
|
13
|
+
*/
|
|
14
|
+
commit?: (input: NativeText, from: string) => void;
|
|
15
|
+
/** After a committed composition has reached the component's value (a multi-line field's height, the count). */
|
|
16
|
+
settled?: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A component's `value` and its native text element kept in step without breaking an input method (TXF-1, TXF-4, and
|
|
20
|
+
* every component that edits text as the text field does: SRC-4). The element's own `input` event is the component's —
|
|
21
|
+
* it is composed, so it leaves the shadow root by itself, after the element has taken the new value — and a value the
|
|
22
|
+
* product sets is shown and fires nothing.
|
|
23
|
+
*
|
|
24
|
+
* While an input method composes, the composition is the platform's: the component's value follows the element and
|
|
25
|
+
* nothing is written back; a value the product sets meanwhile waits for the end. A committed composition always
|
|
26
|
+
* produces one `input` that is not composing — where the browser sent its last one before the end (Chromium, WebKit),
|
|
27
|
+
* one more is sent.
|
|
28
|
+
*
|
|
29
|
+
* Bind `onCompositionStart` / `onCompositionEnd` on the element, call `composingInput(event)` first in its `input`
|
|
30
|
+
* listener (and stop there when it returns true), and `show()` from `updated()`.
|
|
31
|
+
*/
|
|
32
|
+
export declare class NativeTextController {
|
|
33
|
+
private readonly options;
|
|
34
|
+
/** An input method is composing text in the element. */
|
|
35
|
+
composing: boolean;
|
|
36
|
+
/** The value when the composition began. */
|
|
37
|
+
private from;
|
|
38
|
+
/** A value the product set during a composition; it is applied when the composition ends. */
|
|
39
|
+
private deferred;
|
|
40
|
+
constructor(options: NativeTextOptions);
|
|
41
|
+
/** An `input` from the element during a composition: the value follows it and the caller does nothing else. */
|
|
42
|
+
composingInput(event: Event): boolean;
|
|
43
|
+
readonly onCompositionStart: () => void;
|
|
44
|
+
readonly onCompositionEnd: (event: CompositionEvent) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Shows the component's value in the element — never into a composition: a value set meanwhile waits for its end (the
|
|
47
|
+
* composition's own inputs keep the value in step with the element, so a difference is the product's). Returns
|
|
48
|
+
* whether the element was written.
|
|
49
|
+
*/
|
|
50
|
+
show(): boolean;
|
|
51
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A component's `value` and its native text element kept in step without breaking an input method (TXF-1, TXF-4, and
|
|
3
|
+
* every component that edits text as the text field does: SRC-4). The element's own `input` event is the component's —
|
|
4
|
+
* it is composed, so it leaves the shadow root by itself, after the element has taken the new value — and a value the
|
|
5
|
+
* product sets is shown and fires nothing.
|
|
6
|
+
*
|
|
7
|
+
* While an input method composes, the composition is the platform's: the component's value follows the element and
|
|
8
|
+
* nothing is written back; a value the product sets meanwhile waits for the end. A committed composition always
|
|
9
|
+
* produces one `input` that is not composing — where the browser sent its last one before the end (Chromium, WebKit),
|
|
10
|
+
* one more is sent.
|
|
11
|
+
*
|
|
12
|
+
* Bind `onCompositionStart` / `onCompositionEnd` on the element, call `composingInput(event)` first in its `input`
|
|
13
|
+
* listener (and stop there when it returns true), and `show()` from `updated()`.
|
|
14
|
+
*/
|
|
15
|
+
export class NativeTextController {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this.options = options;
|
|
18
|
+
/** An input method is composing text in the element. */
|
|
19
|
+
this.composing = false;
|
|
20
|
+
/** The value when the composition began. */
|
|
21
|
+
this.from = '';
|
|
22
|
+
this.onCompositionStart = () => {
|
|
23
|
+
this.composing = true;
|
|
24
|
+
this.from = this.options.value();
|
|
25
|
+
};
|
|
26
|
+
this.onCompositionEnd = (event) => {
|
|
27
|
+
this.composing = false;
|
|
28
|
+
const input = this.options.input();
|
|
29
|
+
if (!input)
|
|
30
|
+
return;
|
|
31
|
+
if (this.deferred !== undefined) {
|
|
32
|
+
input.value = this.deferred;
|
|
33
|
+
this.deferred = undefined;
|
|
34
|
+
}
|
|
35
|
+
else
|
|
36
|
+
this.options.commit?.(input, this.from);
|
|
37
|
+
let heard = false;
|
|
38
|
+
const hear = () => (heard = true);
|
|
39
|
+
input.addEventListener('input', hear, { once: true });
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
input.removeEventListener('input', hear);
|
|
42
|
+
const changed = input.value !== this.options.value();
|
|
43
|
+
this.options.setValue(input.value);
|
|
44
|
+
this.options.settled?.();
|
|
45
|
+
if (!heard || changed)
|
|
46
|
+
input.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true, inputType: 'insertCompositionText', data: event.data }));
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** An `input` from the element during a composition: the value follows it and the caller does nothing else. */
|
|
51
|
+
composingInput(event) {
|
|
52
|
+
if (!this.composing && !event.isComposing)
|
|
53
|
+
return false;
|
|
54
|
+
const input = this.options.input();
|
|
55
|
+
if (input)
|
|
56
|
+
this.options.setValue(input.value);
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Shows the component's value in the element — never into a composition: a value set meanwhile waits for its end (the
|
|
61
|
+
* composition's own inputs keep the value in step with the element, so a difference is the product's). Returns
|
|
62
|
+
* whether the element was written.
|
|
63
|
+
*/
|
|
64
|
+
show() {
|
|
65
|
+
const input = this.options.input();
|
|
66
|
+
const value = this.options.value();
|
|
67
|
+
if (!input || input.value === value)
|
|
68
|
+
return false;
|
|
69
|
+
if (this.composing) {
|
|
70
|
+
this.deferred = value;
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
input.value = value;
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=native-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-text.js","sourceRoot":"","sources":["../../src/primitives/native-text.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,oBAAoB;IAQ/B,YAA6B,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;QAPvD,wDAAwD;QACxD,cAAS,GAAG,KAAK,CAAC;QAClB,4CAA4C;QACpC,SAAI,GAAG,EAAE,CAAC;QAcT,uBAAkB,GAAG,GAAG,EAAE;YACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnC,CAAC,CAAC;QAEO,qBAAgB,GAAG,CAAC,KAAuB,EAAE,EAAE;YACtD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK;gBAAE,OAAO;YACnB,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAChC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAC5B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;YAC5B,CAAC;;gBAAM,I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BD;;;;OAIG;IACH,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK;YAAE,OAAO,KAAK,CAAC;QAClD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An overlay's height with nothing capping it (menu MNU-2, date picker DTP-2, search SRC-7), which `placeMenu` compares
|
|
3
|
+
* with the room on each side: the height the surface has now, plus what its scrolling box holds beyond its own height.
|
|
4
|
+
* `scroller` is the one part of the surface that gives way to the cap; every other part keeps its size.
|
|
5
|
+
*
|
|
6
|
+
* Measured as the surface stands, never by lifting the cap: laid out uncapped, the box would not scroll, the browser
|
|
7
|
+
* would clamp its scroll offset to 0, and capping it again would not bring the offset back — every placement (the anchor
|
|
8
|
+
* moving, the window resizing, a font arriving) would send a scrolled list back to its top.
|
|
9
|
+
*/
|
|
10
|
+
export declare function naturalHeight(surface: HTMLElement, scroller: HTMLElement | null | undefined): number;
|
|
11
|
+
/**
|
|
12
|
+
* A box's border-box size as it is laid out: fractional, and untouched by a transform. `offsetWidth` / `offsetHeight`
|
|
13
|
+
* are snapped to whole pixels, so a surface placed by `anchor edge − size` would land up to a pixel off the edge it is
|
|
14
|
+
* aligned to; `getBoundingClientRect()` is scaled by the enter motion these surfaces are placed under. The used value
|
|
15
|
+
* of the box's own size is neither — with its paddings and borders added where the box is a content box. A box without
|
|
16
|
+
* a used size (not rendered, or inline) falls back to the snapped one.
|
|
17
|
+
*/
|
|
18
|
+
export declare function layoutSize(element: HTMLElement): {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An overlay's height with nothing capping it (menu MNU-2, date picker DTP-2, search SRC-7), which `placeMenu` compares
|
|
3
|
+
* with the room on each side: the height the surface has now, plus what its scrolling box holds beyond its own height.
|
|
4
|
+
* `scroller` is the one part of the surface that gives way to the cap; every other part keeps its size.
|
|
5
|
+
*
|
|
6
|
+
* Measured as the surface stands, never by lifting the cap: laid out uncapped, the box would not scroll, the browser
|
|
7
|
+
* would clamp its scroll offset to 0, and capping it again would not bring the offset back — every placement (the anchor
|
|
8
|
+
* moving, the window resizing, a font arriving) would send a scrolled list back to its top.
|
|
9
|
+
*/
|
|
10
|
+
export function naturalHeight(surface, scroller) {
|
|
11
|
+
// What the scrolling box holds beyond its own height has no fractional form (`scrollHeight`, `clientHeight`): 0 while
|
|
12
|
+
// the content fits, so an uncapped surface is measured exactly.
|
|
13
|
+
const hidden = scroller ? Math.max(0, scroller.scrollHeight - scroller.clientHeight) : 0;
|
|
14
|
+
return layoutSize(surface).height + hidden;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A box's border-box size as it is laid out: fractional, and untouched by a transform. `offsetWidth` / `offsetHeight`
|
|
18
|
+
* are snapped to whole pixels, so a surface placed by `anchor edge − size` would land up to a pixel off the edge it is
|
|
19
|
+
* aligned to; `getBoundingClientRect()` is scaled by the enter motion these surfaces are placed under. The used value
|
|
20
|
+
* of the box's own size is neither — with its paddings and borders added where the box is a content box. A box without
|
|
21
|
+
* a used size (not rendered, or inline) falls back to the snapped one.
|
|
22
|
+
*/
|
|
23
|
+
export function layoutSize(element) {
|
|
24
|
+
const style = getComputedStyle(element);
|
|
25
|
+
const [width, height] = [Number.parseFloat(style.width), Number.parseFloat(style.height)];
|
|
26
|
+
if (!Number.isFinite(width) || !Number.isFinite(height))
|
|
27
|
+
return { width: element.offsetWidth, height: element.offsetHeight };
|
|
28
|
+
if (style.boxSizing === 'border-box')
|
|
29
|
+
return { width, height };
|
|
30
|
+
const px = (value) => Number.parseFloat(value) || 0;
|
|
31
|
+
return {
|
|
32
|
+
width: width + px(style.paddingLeft) + px(style.paddingRight) + px(style.borderLeftWidth) + px(style.borderRightWidth),
|
|
33
|
+
height: height + px(style.paddingTop) + px(style.paddingBottom) + px(style.borderTopWidth) + px(style.borderBottomWidth),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=natural-height.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"natural-height.js","sourceRoot":"","sources":["../../src/primitives/natural-height.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,OAAoB,EAAE,QAAwC;IAC1F,sHAAsH;IACtH,gEAAgE;IAChE,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,OAAoB;IAC7C,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1F,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,KAAK,EAA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