@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,702 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
|
+
import { AvailabilityController, DismissController, FieldControlController, GlyphDrawnController, GlyphMirrorController, OpenAxesController, SEPARATION_VALUES, SystemWatchController, keepOverlayFocusAfterPress, registerOverlay, report, slottedInteractive, syncFocusStyle, } from '../../primitives/index.js';
|
|
3
|
+
import { FormSays } from '../../primitives/form-says.js';
|
|
4
|
+
import { missingValueMessage } from '../../primitives/missing-value.js';
|
|
5
|
+
import { FloatingLabelController, floatingAsterisk, floatingLabel, triggerEdges } from '../../primitives/field-trigger.js';
|
|
6
|
+
import { OPTION_GLYPHS, OPTION_GROUP_TAG, OPTION_MIRRORED, OPTION_TAG, OptionListController, OptionsController, anchoredOptionList, } from '../../primitives/option-list.js';
|
|
7
|
+
import { ownDirection } from '../../styles/product-text.js';
|
|
8
|
+
import '../option/option.js';
|
|
9
|
+
import { takeFormDisabled } from '../../primitives/form-disabled.js';
|
|
10
|
+
import { AXES, INSET, styles } from './select.styles.js';
|
|
11
|
+
import { FocusedStop, disabledWaitsWhileFocused } from '../../primitives/disabled-while-focused.js';
|
|
12
|
+
import { focusedAtFirst } from '../../primitives/autofocus.js';
|
|
13
|
+
/** Runs `task` once the document has been read: an element upgraded while its children are still being parsed has none yet. */
|
|
14
|
+
function whenParsed(task) {
|
|
15
|
+
if (document.readyState === 'loading')
|
|
16
|
+
document.addEventListener('DOMContentLoaded', task, { once: true });
|
|
17
|
+
else
|
|
18
|
+
task();
|
|
19
|
+
}
|
|
20
|
+
/** What left the element with the frame: each is an attribute of `<tanrei-select-field>`, or of the Field that frames a select. */
|
|
21
|
+
const LEFT_ATTRIBUTES = ['supporting-text', 'error-text', 'requirement', 'required-mark', 'required-text', 'optional-text'];
|
|
22
|
+
/**
|
|
23
|
+
* Lets people choose one value from a closed list: a trigger that looks and measures like a text input's box and
|
|
24
|
+
* shows the chosen option, and a list of options, optionally grouped, that opens from it. The bare control: it draws
|
|
25
|
+
* no label row, no requirement mark, no help and no error text.
|
|
26
|
+
*
|
|
27
|
+
* Contract: specs/select.spec.json. The options are `<tanrei-option>` children, optionally in
|
|
28
|
+
* `<tanrei-option-group>` elements (the pair a combobox holds too); the select reads them — and reads them again when
|
|
29
|
+
* they change — and renders the rows itself. Every visual value is a token: the trigger is drawn from
|
|
30
|
+
* `--tanrei-comp-input-box-*`, the one set every input box is drawn from (SEL-65), and the list from
|
|
31
|
+
* `--tanrei-comp-select-*`, which hold the menu's values in every shipped design system.
|
|
32
|
+
*
|
|
33
|
+
* ```html
|
|
34
|
+
* <tanrei-select size="small" label="Theme" value="auto">
|
|
35
|
+
* <tanrei-option value="auto">Follow the device</tanrei-option>
|
|
36
|
+
* <tanrei-option value="light">Light</tanrei-option>
|
|
37
|
+
* </tanrei-select>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* Alone it is for a place where its label stands elsewhere or is plain from where it stands — a theme or a language
|
|
41
|
+
* in a bar, a toolbar, a column of a table — and `label` names it for assistive technology; a filled or an outlined
|
|
42
|
+
* select also draws that name, floating in its box. In a form it stands in a `<tanrei-field>`, which names it,
|
|
43
|
+
* describes it and marks it: that pair as one element is `<tanrei-select-field>`. The select says to its Field what
|
|
44
|
+
* only it knows (`src/primitives/field.ts`): that it draws the label while its look floats one, where its value
|
|
45
|
+
* starts and ends, and that it is drawn focused while its list is open.
|
|
46
|
+
*
|
|
47
|
+
* Bare and given no width it is an inline box as wide as its widest option; in a Field it is a block that fills the
|
|
48
|
+
* Field's width.
|
|
49
|
+
*
|
|
50
|
+
* It is a form-associated element: it takes `name`, submits `value`, resets to the `value` attribute, is restored on
|
|
51
|
+
* navigation, follows `<fieldset disabled>` and reports `valueMissing` while the Field that frames it says it is
|
|
52
|
+
* required and `value` is empty. It never validates beyond that: `error` is the product's to set.
|
|
53
|
+
*
|
|
54
|
+
* The options may also reach it through a `<slot>` among its children: the elements assigned to that slot stand in
|
|
55
|
+
* the slot's place. That is how a select field's options reach the select inside it, and how a product's own element
|
|
56
|
+
* passes options on (`<tanrei-select label="Plan"><slot></slot></tanrei-select>` in its shadow root).
|
|
57
|
+
*
|
|
58
|
+
* The pattern is the select-only combobox. Focus stays on the trigger while the list is open and one option is the
|
|
59
|
+
* active one: Enter, Space, Down or Up Arrow, or a printable character open the list; the arrow keys, Home, End, Page
|
|
60
|
+
* Down and Page Up and typing move the active option; Enter or Space choose it; Escape, Tab, a press outside or on the
|
|
61
|
+
* trigger close the list without choosing. The value changes only when the person confirms an option.
|
|
62
|
+
*
|
|
63
|
+
* An option is a value, never a destination: a list of places to go is a menu or links.
|
|
64
|
+
*
|
|
65
|
+
* @tag tanrei-select
|
|
66
|
+
* @slot - The options: `<tanrei-option>` elements, optionally in `<tanrei-option-group>` elements. They are read, not drawn in place.
|
|
67
|
+
* @slot leading-icon - A glyph at the start of the container that stands for the field whatever is chosen (a globe before a language). It takes the place of the chosen option's own glyph. A glyph the icon set flags is mirrored in right-to-left; `data-mirror="auto | always | never"` on the element decides for one use.
|
|
68
|
+
* @csspart container - The trigger's box: the combobox.
|
|
69
|
+
* @csspart outline - A stacked select's inner line, or an outlined select's border.
|
|
70
|
+
* @csspart active-indicator - The line along the bottom of a filled select.
|
|
71
|
+
* @csspart label - The label that floats in a filled or an outlined select's box.
|
|
72
|
+
* @csspart requirement-label - The required asterisk after a floating label.
|
|
73
|
+
* @csspart value - The chosen option's label.
|
|
74
|
+
* @csspart placeholder - The hint shown while nothing is chosen.
|
|
75
|
+
* @csspart leading-icon - The box of the glyph at the start of the container.
|
|
76
|
+
* @csspart chevron - The glyph at the end of the container.
|
|
77
|
+
* @csspart list - The raised sheet that holds the options.
|
|
78
|
+
* @csspart option - An option's row.
|
|
79
|
+
* @csspart option-label - An option's label.
|
|
80
|
+
* @csspart option-supporting-text - An option's supporting text.
|
|
81
|
+
* @csspart option-leading-icon - The box of an option's glyph.
|
|
82
|
+
* @csspart mark - The check of the chosen option.
|
|
83
|
+
* @csspart group - A group of options.
|
|
84
|
+
* @csspart group-title - A group's title.
|
|
85
|
+
* @csspart divider - The line between two groups while the separation is divider.
|
|
86
|
+
* @attr {string} form - The id of the form the select belongs to, where it stands outside it: the platform's own attribute, which then wins over a form around it. The `form` property is read-only and returns the form element.
|
|
87
|
+
* @fires change - The person chose an option whose value differs from the select's; `value` is already the new one. A composed, bubbling Event, as a native select's. Never fired when the product sets `value`, when the chosen option is chosen again, or while the person only moves through the list.
|
|
88
|
+
* @fires {CustomEvent<TanreiSelectToggleDetail>} toggle - The list was opened or closed by the person; `open` is already the new one. `detail.open`, and for a close `detail.reason`: `select`, `escape`, `outside`, `focus-out`, `anchor-hidden`, `press` or `tab`. After a choice it follows `change`. Composed and not bubbling: heard on the element — and on an element composed around it — and by no ancestor. Never fired when the product sets `open`.
|
|
89
|
+
*/
|
|
90
|
+
export class TanreiSelect extends LitElement {
|
|
91
|
+
static { this.styles = styles; }
|
|
92
|
+
static { this.formAssociated = true; }
|
|
93
|
+
/**
|
|
94
|
+
* Its documented parts, once: what an element composed around it exports (src/primitives/composed.ts). Held equal to
|
|
95
|
+
* the `@csspart` lines above by src/primitives/composed.test.ts.
|
|
96
|
+
*
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
static { this.parts = [
|
|
100
|
+
'container',
|
|
101
|
+
'outline',
|
|
102
|
+
'active-indicator',
|
|
103
|
+
'label',
|
|
104
|
+
'requirement-label',
|
|
105
|
+
'value',
|
|
106
|
+
'placeholder',
|
|
107
|
+
'leading-icon',
|
|
108
|
+
'chevron',
|
|
109
|
+
'list',
|
|
110
|
+
'option',
|
|
111
|
+
'option-label',
|
|
112
|
+
'option-supporting-text',
|
|
113
|
+
'option-leading-icon',
|
|
114
|
+
'mark',
|
|
115
|
+
'group',
|
|
116
|
+
'group-title',
|
|
117
|
+
'divider',
|
|
118
|
+
]; }
|
|
119
|
+
static { this.properties = {
|
|
120
|
+
variant: { type: String, reflect: true },
|
|
121
|
+
size: { type: String, reflect: true },
|
|
122
|
+
value: { type: String },
|
|
123
|
+
name: { type: String, reflect: true },
|
|
124
|
+
label: { type: String },
|
|
125
|
+
labelHidden: { type: Boolean, attribute: 'label-hidden', reflect: true },
|
|
126
|
+
placeholder: { type: String },
|
|
127
|
+
error: { type: Boolean, reflect: true },
|
|
128
|
+
disabled: { type: Boolean, reflect: true },
|
|
129
|
+
readOnly: { type: Boolean, attribute: 'readonly', reflect: true },
|
|
130
|
+
open: { type: Boolean, reflect: true },
|
|
131
|
+
separation: { type: String, reflect: true },
|
|
132
|
+
inline: { type: Boolean, reflect: true },
|
|
133
|
+
hasLeading: { state: true },
|
|
134
|
+
focused: { state: true },
|
|
135
|
+
formDisabled: { state: true },
|
|
136
|
+
}; }
|
|
137
|
+
constructor() {
|
|
138
|
+
super();
|
|
139
|
+
this.availability = new AvailabilityController(this, 'select');
|
|
140
|
+
/** Disabled under the focus it holds, its stop keeps its `tabindex` for one frame, as the platform's own control keeps focus (src/primitives/disabled-while-focused.ts). */
|
|
141
|
+
this.stop = new FocusedStop(this);
|
|
142
|
+
/** The look, as the text inputs beside it: `stacked` is a filled box whose label is the row of the Field that frames it; `filled` and `outlined` float the label inside the box. Use one style per form. A value the select does not know by name is laid out as stacked. Reflected. */
|
|
143
|
+
this.variant = 'stacked';
|
|
144
|
+
/** The container's minimum height: `small`, `medium` or `large` (40 / 48 / 56 in the default system). The hit area always meets the minimum target. Reflected. */
|
|
145
|
+
this.size = 'medium';
|
|
146
|
+
/** The value of the chosen option. The select shows that option's label; while `value` names no option it shows the placeholder. An option whose value is the empty string is a choice like any other. The `value` attribute is the value a form reset returns to. */
|
|
147
|
+
this.value = '';
|
|
148
|
+
/** The name the value is submitted under in a form. Reflected. */
|
|
149
|
+
this.name = '';
|
|
150
|
+
/** Names the select for assistive technology, where no Field frames it or its visible label is elsewhere; it then wins over the Field's label. A filled or an outlined select also draws it, floating in its box; a stacked select draws no label. A select no Field frames needs one. */
|
|
151
|
+
this.label = '';
|
|
152
|
+
/** Does not draw the floating label of a filled or an outlined select, which stays the accessible name (`label-hidden`). It changes nothing on a stacked select, which draws no label. */
|
|
153
|
+
this.labelHidden = false;
|
|
154
|
+
/** A hint shown while nothing is chosen and the label is not in the line. Never a replacement for `label`, and never a choice. */
|
|
155
|
+
this.placeholder = '';
|
|
156
|
+
/** Puts the select in the error condition: it is exposed as invalid and drawn in its error parts. The select never sets this itself and shows no error text: the words are the `errorText` of the Field that frames it, which puts its select in this condition too. */
|
|
157
|
+
this.error = false;
|
|
158
|
+
/** Disables the select: it takes no focus, does not open and is left out of form submission. Disable a framed select on its Field, so that the label follows. */
|
|
159
|
+
this.disabled = false;
|
|
160
|
+
/** The value is shown, can be focused and is submitted, but cannot be changed: the list does not open and no chevron is drawn. The attribute is `readonly`. */
|
|
161
|
+
this.readOnly = false;
|
|
162
|
+
/** Whether the list is shown. The select opens and closes itself and emits `toggle`; the product may also set it. Ignored while the select is disabled or read-only or holds no option. Reflected. */
|
|
163
|
+
this.open = false;
|
|
164
|
+
/** How a group of options is told from what is next to it: `divider`, `gap`, or `auto` for the design system's answer (`--tanrei-comp-select-separation`). */
|
|
165
|
+
this.separation = 'auto';
|
|
166
|
+
/** For tests and fixtures: draws the open list in place below the trigger — inside its positioned ancestor, which stands for the window — not in the top layer; it then answers no dismissal. */
|
|
167
|
+
this.inline = false;
|
|
168
|
+
/** Whether the leading-icon slot has content. */
|
|
169
|
+
this.hasLeading = false;
|
|
170
|
+
/** SEL-20: the container has focus, however it was gained. */
|
|
171
|
+
this.focused = false;
|
|
172
|
+
/** Set by an ancestor `<fieldset disabled>` (the element's `formDisabledCallback`). */
|
|
173
|
+
this.formDisabled = false;
|
|
174
|
+
/** Whether the list is presented: open, usable, and beside a container in the page. */
|
|
175
|
+
this.presented = false;
|
|
176
|
+
/** What opened the list last: a key shows the active option's focus indicator, a press does not (SEL-32). */
|
|
177
|
+
this.byKeyboard = false;
|
|
178
|
+
/** A mouse press on the container was answered as it went down: the click that follows it is not a second press. */
|
|
179
|
+
this.pressed = false;
|
|
180
|
+
/** SEL-64: what left the element with the frame has been reported for this element. */
|
|
181
|
+
this.reportedLeft = false;
|
|
182
|
+
this.unregister = null;
|
|
183
|
+
/** SEL-60: sizes and variants a design system adds, and a value the active system does not have (src/primitives/axes.ts). */
|
|
184
|
+
this.axes = new OpenAxesController(this, { component: 'select', behavior: 'SEL-60', axes: AXES });
|
|
185
|
+
/** SEL-45: where style queries are missing, what parts two groups is read by script, again when the system is switched. */
|
|
186
|
+
this.system = new SystemWatchController(this);
|
|
187
|
+
/**
|
|
188
|
+
* SEL-63: the select's side of the exchange with the Field that frames it (src/primitives/field.ts). It takes the
|
|
189
|
+
* Field's name, description and states, whether the label is hidden and whether an asterisk follows it; and it says
|
|
190
|
+
* what only it knows — that it draws the label, where its value starts and ends, that it is drawn focused while its
|
|
191
|
+
* list is open. It has an error condition of its own (SEL-9). No Field: it is drawn as a bare select.
|
|
192
|
+
*/
|
|
193
|
+
this.frame = new FieldControlController(this, {
|
|
194
|
+
errorCondition: true,
|
|
195
|
+
named: () => !!this.label.trim(),
|
|
196
|
+
says: () => this.saysToField,
|
|
197
|
+
changed: () => this.framedChanged(),
|
|
198
|
+
});
|
|
199
|
+
/** The Field's answer changed since the last update: the floating label may have other lines (SEL-15). */
|
|
200
|
+
this.frameChanged = false;
|
|
201
|
+
/** SEL-17, SEL-36: the options, read from the children and read again when they change (src/primitives/option-list.ts). */
|
|
202
|
+
this.options$ = new OptionsController(this);
|
|
203
|
+
/** SEL-26, SEL-31 … SEL-35, SEL-41, SEL-42: the active option, the keys that move it, the press and the choice. */
|
|
204
|
+
this.list = new OptionListController(this, {
|
|
205
|
+
model: () => this.options$.model,
|
|
206
|
+
chosen: () => this.chosen,
|
|
207
|
+
choose: (option, event) => this.choose(option, event),
|
|
208
|
+
});
|
|
209
|
+
/** SEL-24, SEL-25, SEL-30: where the list is — the anchored surface a popover is drawn on, as wide as the container. */
|
|
210
|
+
this.anchored = anchoredOptionList(this, {
|
|
211
|
+
anchor: () => this.container,
|
|
212
|
+
inline: () => this.inline,
|
|
213
|
+
gone: () => this.closeList('anchor-hidden'),
|
|
214
|
+
});
|
|
215
|
+
/** SEL-27, SEL-28: Escape, a press outside and focus leaving (src/primitives/dismiss.ts); Tab closes at once. */
|
|
216
|
+
this.dismiss = new DismissController(this, {
|
|
217
|
+
related: () => [this],
|
|
218
|
+
request: (reason) => this.closeList(reason),
|
|
219
|
+
tab: (event) => {
|
|
220
|
+
if (!event.ctrlKey && !event.metaKey)
|
|
221
|
+
this.closeList('tab');
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
/** SEL-15: a floating label that does not fit on one line is given the room its lines take (src/primitives/field-trigger.ts). */
|
|
225
|
+
this.floating = new FloatingLabelController(this);
|
|
226
|
+
/** SEL-57: the glyph of the slot, the chosen option's own and the options' are marked when the icon set mirrors them. */
|
|
227
|
+
this.mirror = new GlyphMirrorController(this, { slots: 'slot[name="leading-icon"]', drawn: `.leading-own, ${OPTION_MIRRORED}` });
|
|
228
|
+
/** SEL-19: a glyph the select draws by name is drawn once the icon set can draw it; until then nothing stands in its place. */
|
|
229
|
+
this.glyphs = new GlyphDrawnController(this, () => this.renderRoot.querySelectorAll(`.chevron, .leading-own, ${OPTION_GLYPHS}`));
|
|
230
|
+
this.sized = null;
|
|
231
|
+
this.reportedOptions = '';
|
|
232
|
+
this.internals = this.attachInternals();
|
|
233
|
+
this.says = new FormSays(this, this.internals);
|
|
234
|
+
// A `<label for>` of the page activates the element itself: its container takes focus, and nothing opens.
|
|
235
|
+
this.addEventListener('click', (event) => {
|
|
236
|
+
if (event.composedPath()[0] === this)
|
|
237
|
+
this.focus();
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
get container() {
|
|
241
|
+
return this.renderRoot?.querySelector('.container') ?? null;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* SEL-49: a select a Field frames is a block that fills the Field's width; a bare one is an inline box as wide as its
|
|
245
|
+
* widest option. Said on the element as a state (`:state(framed)`), at the moment the Field answers or lets go, so
|
|
246
|
+
* that the Field reads the control's display as it is.
|
|
247
|
+
*/
|
|
248
|
+
framedChanged() {
|
|
249
|
+
this.frameChanged = true;
|
|
250
|
+
try {
|
|
251
|
+
if (this.frame.framed)
|
|
252
|
+
this.internals.states.add('framed');
|
|
253
|
+
else
|
|
254
|
+
this.internals.states.delete('framed');
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
// A browser without custom states keeps the inline box; a width given to the select still sizes it.
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/** SEL-11: the accessible name — its own label, else the label of the Field that frames it. */
|
|
261
|
+
get name_() {
|
|
262
|
+
return this.frame.name(this.label.trim() ? this.label : '');
|
|
263
|
+
}
|
|
264
|
+
/** SEL-9: in the error condition — its own `error`, or its Field's. */
|
|
265
|
+
get invalid() {
|
|
266
|
+
return this.error || this.frame.invalid;
|
|
267
|
+
}
|
|
268
|
+
/** SEL-15: the label floats in the box — a filled or an outlined select with a name, unless its own `labelHidden` or its Field's says to draw none. */
|
|
269
|
+
get labelled() {
|
|
270
|
+
return this.layout !== 'stacked' && !!this.name_ && !this.labelHidden && !this.frame.labelHidden;
|
|
271
|
+
}
|
|
272
|
+
/** SEL-18: what stands at the start of the container — the slot's glyph, else the chosen option's own, else nothing. */
|
|
273
|
+
get leading() {
|
|
274
|
+
return this.hasLeading ? 'slot' : this.chosen?.leadingIcon ? 'option' : null;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* SEL-63: what the select says to the Field that frames it. That it draws the label while its look floats one — its
|
|
278
|
+
* name, or nothing while the label is hidden; the Field draws no label row either way. How far its value stands from
|
|
279
|
+
* its start edge and the padding it keeps at its end edge, as lengths of the box's tokens (`INSET`, in the styles).
|
|
280
|
+
* And that it is drawn focused for as long as its list is open, whether or not it has focus (SEL-20).
|
|
281
|
+
*/
|
|
282
|
+
get saysToField() {
|
|
283
|
+
const size = /^[a-z0-9][a-z0-9-]*$/.test(this.size) ? this.size : 'medium';
|
|
284
|
+
return {
|
|
285
|
+
drawsLabel: this.layout !== 'stacked',
|
|
286
|
+
inset: INSET(size, { leading: this.leading !== null, chevron: !this.readOnly }),
|
|
287
|
+
drawnFocused: this.open && this.usable,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
/** Disabled by its own `disabled`, a fieldset's, its Field's or a field group's. */
|
|
291
|
+
get inert_() {
|
|
292
|
+
return this.disabled || this.formDisabled || this.frame.disabled;
|
|
293
|
+
}
|
|
294
|
+
/** How the variant is laid out: filled and outlined by name, every other value as stacked (SEL-60). */
|
|
295
|
+
get layout() {
|
|
296
|
+
return this.variant === 'filled' || this.variant === 'outlined' ? this.variant : 'stacked';
|
|
297
|
+
}
|
|
298
|
+
/** SEL-17: the chosen option — the first, in order and across groups, whose value equals `value`; a disabled one and one whose value is empty included. */
|
|
299
|
+
get chosen() {
|
|
300
|
+
return this.options$.model.options.find((option) => option.value === this.value) ?? null;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* SEL-49: what the select's own width is measured from — every option's label and the placeholder, one to a line of
|
|
304
|
+
* one hidden text, each as it would be drawn in the line (spaces collapsed). One element whatever the number of
|
|
305
|
+
* options; made again only when the options or the placeholder change.
|
|
306
|
+
*
|
|
307
|
+
* SEL-59: an option that says a language is shown, once chosen, in that language, and a browser may draw it in
|
|
308
|
+
* another face than the field's: its label is measured in a line of its own that says the same language — an
|
|
309
|
+
* element for each such option only, so a list that says none stays one text.
|
|
310
|
+
*/
|
|
311
|
+
sizerLines(model) {
|
|
312
|
+
if (this.sized?.model !== model || this.sized.placeholder !== this.placeholder) {
|
|
313
|
+
const line = (text) => text.replace(/\s+/g, ' ').trim();
|
|
314
|
+
const lines = model.options.filter((option) => !option.lang).map((option) => line(option.label));
|
|
315
|
+
if (this.placeholder)
|
|
316
|
+
lines.push(line(this.placeholder));
|
|
317
|
+
const said = model.options.filter((option) => !!option.lang).map((option) => ({ label: line(option.label), lang: option.lang }));
|
|
318
|
+
this.sized = { model, placeholder: this.placeholder, text: lines.join('\n'), said };
|
|
319
|
+
}
|
|
320
|
+
const { text, said } = this.sized;
|
|
321
|
+
return html `${text}${said.map((own) => html `${'\n'}<span lang=${own.lang}>${own.label}</span>`)}`;
|
|
322
|
+
}
|
|
323
|
+
/** SEL-23, SEL-46, SEL-47, SEL-61: whether the list can be shown at all. */
|
|
324
|
+
get usable() {
|
|
325
|
+
return !this.inert_ && !this.readOnly && this.options$.model.options.length > 0;
|
|
326
|
+
}
|
|
327
|
+
/** The form it belongs to, if any. */
|
|
328
|
+
get form() {
|
|
329
|
+
return this.internals.form;
|
|
330
|
+
}
|
|
331
|
+
/** The native constraint validity: `valueMissing` while the Field that frames the select says it is required and its value is empty. */
|
|
332
|
+
get validity() {
|
|
333
|
+
return this.internals.validity;
|
|
334
|
+
}
|
|
335
|
+
get validationMessage() {
|
|
336
|
+
return this.internals.validationMessage;
|
|
337
|
+
}
|
|
338
|
+
get willValidate() {
|
|
339
|
+
return this.internals.willValidate;
|
|
340
|
+
}
|
|
341
|
+
checkValidity() {
|
|
342
|
+
return this.internals.checkValidity();
|
|
343
|
+
}
|
|
344
|
+
reportValidity() {
|
|
345
|
+
return this.internals.reportValidity();
|
|
346
|
+
}
|
|
347
|
+
/** Moves focus to the container: the select's one stop in the focus order. */
|
|
348
|
+
focus(options) {
|
|
349
|
+
this.container?.focus(options);
|
|
350
|
+
}
|
|
351
|
+
blur() {
|
|
352
|
+
this.container?.blur();
|
|
353
|
+
}
|
|
354
|
+
formResetCallback() {
|
|
355
|
+
this.value = this.getAttribute('value') ?? '';
|
|
356
|
+
}
|
|
357
|
+
formStateRestoreCallback(state) {
|
|
358
|
+
this.value = typeof state === 'string' ? state : '';
|
|
359
|
+
}
|
|
360
|
+
formDisabledCallback(disabled) {
|
|
361
|
+
takeFormDisabled(this, disabled, (value) => (this.formDisabled = value));
|
|
362
|
+
}
|
|
363
|
+
// ── SEL-23, SEL-27, SEL-34: opening, closing and choosing ─────────────────────────────────────────────────────
|
|
364
|
+
/** SEL-23: the person opens the list. `open` is true before `toggle` is fired; the list is presented by the render that follows. */
|
|
365
|
+
openList(keyboard) {
|
|
366
|
+
if (this.open || !this.usable)
|
|
367
|
+
return;
|
|
368
|
+
this.byKeyboard = keyboard;
|
|
369
|
+
this.focus({ preventScroll: true });
|
|
370
|
+
this.open = true;
|
|
371
|
+
// The active option is there for the key that opened the list (a character typed on a closed select).
|
|
372
|
+
this.list.start(keyboard);
|
|
373
|
+
// Composed, so that it is heard on an element composed around the select; not bubbling, so that an ancestor's own
|
|
374
|
+
// `toggle` listener — a `<details>`'s — never hears a select's.
|
|
375
|
+
this.dispatchEvent(new CustomEvent('toggle', { composed: true, detail: { open: true } }));
|
|
376
|
+
}
|
|
377
|
+
/** SEL-27: the person closes the list, for `reason`. `open` is false, and the list no longer takes input, before `toggle` is fired. */
|
|
378
|
+
closeList(reason) {
|
|
379
|
+
if (!this.open)
|
|
380
|
+
return;
|
|
381
|
+
this.open = false;
|
|
382
|
+
const container = this.container;
|
|
383
|
+
this.withdraw();
|
|
384
|
+
// A press outside that landed on nothing focusable takes focus from the page: the container takes it again.
|
|
385
|
+
if (reason === 'outside' && this.focused)
|
|
386
|
+
keepOverlayFocusAfterPress(container);
|
|
387
|
+
this.dispatchEvent(new CustomEvent('toggle', { composed: true, detail: { open: false, reason } }));
|
|
388
|
+
}
|
|
389
|
+
/** SEL-34: the person confirmed `option`. `value` is the new one before `change`; the list then closes, so `toggle` follows. */
|
|
390
|
+
choose(option, _event) {
|
|
391
|
+
if (option.disabled || this.inert_ || this.readOnly)
|
|
392
|
+
return;
|
|
393
|
+
if (option.value !== this.value) {
|
|
394
|
+
this.value = option.value;
|
|
395
|
+
this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
|
|
396
|
+
}
|
|
397
|
+
this.closeList('select');
|
|
398
|
+
}
|
|
399
|
+
/** SEL-24, SEL-26: into the overlay layer beside the container. Focus stays where it is. */
|
|
400
|
+
present() {
|
|
401
|
+
if (!this.anchored.show())
|
|
402
|
+
return;
|
|
403
|
+
this.presented = true;
|
|
404
|
+
// SEL-25: the whole of the chosen option is in view when the list opens.
|
|
405
|
+
this.list.reveal();
|
|
406
|
+
if (!this.inline)
|
|
407
|
+
this.dismiss.start();
|
|
408
|
+
}
|
|
409
|
+
/** SEL-27, SEL-29, SEL-30: out of it, fading; closed or closing it takes no pointer input. */
|
|
410
|
+
withdraw(fade = true) {
|
|
411
|
+
if (!this.presented)
|
|
412
|
+
return;
|
|
413
|
+
this.presented = false;
|
|
414
|
+
if (this.dismiss.active) {
|
|
415
|
+
this.dismiss.closeOwned();
|
|
416
|
+
this.dismiss.stop();
|
|
417
|
+
}
|
|
418
|
+
this.anchored.hide(fade);
|
|
419
|
+
}
|
|
420
|
+
// ── SEL-22, SEL-23, SEL-31 … SEL-34: the container's input ─────────────────────────────────────────────────────
|
|
421
|
+
/** A press on the container opens the list with the press, or closes an open one (`press`). Never while disabled or read-only. */
|
|
422
|
+
toggleByPress() {
|
|
423
|
+
if (this.inert_)
|
|
424
|
+
return;
|
|
425
|
+
if (this.open && this.presented)
|
|
426
|
+
this.closeList('press');
|
|
427
|
+
else if (!this.readOnly)
|
|
428
|
+
this.openList(false);
|
|
429
|
+
}
|
|
430
|
+
onPointerDown(event) {
|
|
431
|
+
if (event.pointerType !== 'mouse' || event.button !== 0)
|
|
432
|
+
return;
|
|
433
|
+
this.pressed = true;
|
|
434
|
+
// A press that ends somewhere else brings no click: it is over once the pointer is lifted.
|
|
435
|
+
const over = () => {
|
|
436
|
+
window.removeEventListener('pointerup', over, true);
|
|
437
|
+
window.removeEventListener('pointercancel', over, true);
|
|
438
|
+
setTimeout(() => (this.pressed = false), 0);
|
|
439
|
+
};
|
|
440
|
+
window.addEventListener('pointerup', over, true);
|
|
441
|
+
window.addEventListener('pointercancel', over, true);
|
|
442
|
+
this.toggleByPress();
|
|
443
|
+
}
|
|
444
|
+
/** A touch, a pen and assistive technology press with a click; a mouse press was answered as it went down. */
|
|
445
|
+
onClick(event) {
|
|
446
|
+
if (this.pressed) {
|
|
447
|
+
this.pressed = false;
|
|
448
|
+
// The click of that mouse press; a click made by script or by assistive technology (detail 0) is a press of its own.
|
|
449
|
+
if (event.detail > 0)
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
this.toggleByPress();
|
|
453
|
+
}
|
|
454
|
+
onKeyDown(event) {
|
|
455
|
+
if (event.defaultPrevented || event.isComposing || this.inert_ || this.readOnly)
|
|
456
|
+
return;
|
|
457
|
+
const { key } = event;
|
|
458
|
+
const plain = !event.ctrlKey && !event.metaKey && !event.altKey;
|
|
459
|
+
const printable = plain && [...key].length === 1;
|
|
460
|
+
if (!(this.open && this.usable)) {
|
|
461
|
+
if (!this.usable || event.ctrlKey || event.metaKey)
|
|
462
|
+
return;
|
|
463
|
+
// SEL-23: the list opens; the value never changes from the keyboard while it is closed.
|
|
464
|
+
if (key === 'Enter' || key === ' ' || key === 'ArrowDown' || key === 'ArrowUp') {
|
|
465
|
+
event.preventDefault();
|
|
466
|
+
this.openList(true);
|
|
467
|
+
}
|
|
468
|
+
else if (printable) {
|
|
469
|
+
// SEL-33: the first character opens the list, and then looks for an option as it does in an open one.
|
|
470
|
+
event.preventDefault();
|
|
471
|
+
this.openList(true);
|
|
472
|
+
this.list.key(key);
|
|
473
|
+
}
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
// SEL-34: Enter chooses the active option; so does a Space that is not a character of what is being typed.
|
|
477
|
+
if (key === 'Enter' || (key === ' ' && !this.list.searching())) {
|
|
478
|
+
event.preventDefault();
|
|
479
|
+
this.list.activate(event);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const moves = key === 'ArrowDown' || key === 'ArrowUp' || key === 'Home' || key === 'End' || key === 'PageDown' || key === 'PageUp';
|
|
483
|
+
if (!moves && !printable)
|
|
484
|
+
return;
|
|
485
|
+
if (event.ctrlKey || event.metaKey)
|
|
486
|
+
return;
|
|
487
|
+
// SEL-31, SEL-33: the key is the list's, and scrolls nothing else.
|
|
488
|
+
event.preventDefault();
|
|
489
|
+
this.byKeyboard = true;
|
|
490
|
+
this.list.key(key);
|
|
491
|
+
}
|
|
492
|
+
onFocus() {
|
|
493
|
+
this.focused = true;
|
|
494
|
+
// SEL-21: where style queries are missing, the focus style is read when focus arrives.
|
|
495
|
+
syncFocusStyle(this, this.renderRoot.querySelector('.field'));
|
|
496
|
+
}
|
|
497
|
+
onBlur() {
|
|
498
|
+
this.focused = false;
|
|
499
|
+
}
|
|
500
|
+
onLeadingSlotChange(event) {
|
|
501
|
+
const slot = event.target;
|
|
502
|
+
this.hasLeading = slot.assignedNodes({ flatten: true }).some((node) => node.nodeType === Node.ELEMENT_NODE || !!node.textContent?.trim());
|
|
503
|
+
// SEL-18: the slot's content is a glyph only.
|
|
504
|
+
void slottedInteractive(slot).then((found) => {
|
|
505
|
+
if (found)
|
|
506
|
+
report(this, 'SEL-18', `the leading-icon slot holds an interactive element (<${found.localName}>); it takes a glyph only, and the whole container is one target`);
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
connectedCallback() {
|
|
510
|
+
super.connectedCallback();
|
|
511
|
+
// SEL-29: the list belongs to the overlay the select stands in, and closes with it.
|
|
512
|
+
this.unregister = registerOverlay(this, {
|
|
513
|
+
openers: () => [this],
|
|
514
|
+
open: () => this.presented,
|
|
515
|
+
close: () => this.closeList('anchor-hidden'),
|
|
516
|
+
kind: 'select',
|
|
517
|
+
});
|
|
518
|
+
// Put back in the page while open: presented again, as mounted.
|
|
519
|
+
if (this.hasUpdated)
|
|
520
|
+
this.requestUpdate();
|
|
521
|
+
}
|
|
522
|
+
disconnectedCallback() {
|
|
523
|
+
super.disconnectedCallback();
|
|
524
|
+
this.unregister?.();
|
|
525
|
+
this.unregister = null;
|
|
526
|
+
// The controllers take the surface out of the top layer and stop listening.
|
|
527
|
+
this.presented = false;
|
|
528
|
+
this.focused = false;
|
|
529
|
+
}
|
|
530
|
+
willUpdate(changed) {
|
|
531
|
+
// The first render already draws the glyphs' room: the light-DOM children are there before the slots say so.
|
|
532
|
+
if (!this.hasUpdated)
|
|
533
|
+
this.hasLeading = [...this.children].some((child) => child.slot === 'leading-icon');
|
|
534
|
+
if (this.inert_)
|
|
535
|
+
this.focused = false;
|
|
536
|
+
// SEL-26, SEL-31: one option is the active one for as long as the list is shown, from the render that shows it.
|
|
537
|
+
const shown = this.open && this.usable && this.isConnected;
|
|
538
|
+
if (shown) {
|
|
539
|
+
if (!this.list.activeId)
|
|
540
|
+
this.list.start(changed.has('open') ? this.byKeyboard : false);
|
|
541
|
+
}
|
|
542
|
+
else
|
|
543
|
+
this.list.stop();
|
|
544
|
+
}
|
|
545
|
+
updated(changed) {
|
|
546
|
+
const container = this.container;
|
|
547
|
+
// SEL-15: the floating label's lines follow its text, its asterisk, the look and the size — its own, or its Field's.
|
|
548
|
+
if (changed.has('label') || changed.has('labelHidden') || changed.has('variant') || changed.has('size') || this.frameChanged)
|
|
549
|
+
this.floating.measure();
|
|
550
|
+
this.frameChanged = false;
|
|
551
|
+
// SEL-36: the product's `open`, and what makes the list unusable, show or remove the list without `toggle`.
|
|
552
|
+
const want = this.open && this.usable && this.isConnected;
|
|
553
|
+
if (changed.has('inline') && this.presented)
|
|
554
|
+
this.withdraw(false);
|
|
555
|
+
if (want && !this.presented)
|
|
556
|
+
this.present();
|
|
557
|
+
else if (!want && this.presented) {
|
|
558
|
+
this.withdraw();
|
|
559
|
+
// …disabled, read-only or without its last option while open: it is closed, and says nothing.
|
|
560
|
+
if (this.open)
|
|
561
|
+
this.open = false;
|
|
562
|
+
}
|
|
563
|
+
else if (this.presented)
|
|
564
|
+
this.anchored.request();
|
|
565
|
+
// The form's view: the value, left out while disabled; a missing value while its Field says it is required (SEL-11).
|
|
566
|
+
// Said where an element composed around the select hears it (src/primitives/form-says.ts).
|
|
567
|
+
this.says.value(this.inert_ ? null : this.value, this.value);
|
|
568
|
+
if (this.frame.required && this.value === '' && !this.inert_ && !this.readOnly) {
|
|
569
|
+
this.says.validity({ valueMissing: true }, missingValueMessage('select', { errorText: '', requiredText: this.frame.state?.requiredText ?? '', label: this.name_ }), container ?? undefined);
|
|
570
|
+
}
|
|
571
|
+
else
|
|
572
|
+
this.says.validity();
|
|
573
|
+
whenParsed(() => this.reports(changed));
|
|
574
|
+
}
|
|
575
|
+
/** What a debug build tells the developer; the select still renders. */
|
|
576
|
+
reports(changed) {
|
|
577
|
+
if (!this.isConnected)
|
|
578
|
+
return;
|
|
579
|
+
// SEL-64: what left the element with the frame — the six attributes and a child for `label-icon` — is the Field's,
|
|
580
|
+
// and draws nothing here. Said once for each element, permanently: nothing is kept for them in a production build.
|
|
581
|
+
if (!this.reportedLeft) {
|
|
582
|
+
const left = [...LEFT_ATTRIBUTES.filter((name) => this.hasAttribute(name)), ...(this.querySelector(':scope > [slot="label-icon"]') ? ['a child for the label-icon slot'] : [])];
|
|
583
|
+
if (left.length) {
|
|
584
|
+
this.reportedLeft = true;
|
|
585
|
+
report(this, 'SEL-64', `${left.join(', ')}: the select is the bare control and draws no label row, requirement mark, help or error text, so ${left.length > 1 ? 'these do' : 'this does'} nothing here; use <tanrei-select-field>, or put the select in a <tanrei-field>`);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
// SEL-11: a select with neither name — no label of its own, and no Field that gives it one — still renders.
|
|
589
|
+
if (!this.name_)
|
|
590
|
+
report(this, 'SEL-11', 'label is empty and no Field names the select, so it has no accessible name; give it a label, or put it in a <tanrei-field> that has one');
|
|
591
|
+
if (changed.has('separation') && !SEPARATION_VALUES.includes(this.separation)) {
|
|
592
|
+
report(this, 'SEL-45', `separation "${this.separation}" is not auto, divider or gap; it behaves as "auto"`);
|
|
593
|
+
}
|
|
594
|
+
const { options, nested } = this.options$.model;
|
|
595
|
+
// The options are reported when they, or the value, change — not on every render.
|
|
596
|
+
const signature = `${this.value}\u0000${options.map((option) => `${option.value}\u0001${option.label}`).join('\u0000')}\u0000${nested.length}`;
|
|
597
|
+
if (signature === this.reportedOptions)
|
|
598
|
+
return;
|
|
599
|
+
this.reportedOptions = signature;
|
|
600
|
+
if (options.length === 0) {
|
|
601
|
+
report(this, 'SEL-61', `the select holds no option, so it does not open; give it <${OPTION_TAG}> children`);
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
if (options.some((option) => !option.label))
|
|
605
|
+
report(this, 'SEL-11', `an option has an empty label, so it has no accessible name; give each <${OPTION_TAG}> a label or a text`);
|
|
606
|
+
if (this.value !== '' && !this.chosen)
|
|
607
|
+
report(this, 'SEL-17', `value "${this.value}" names no option; the select is drawn with nothing chosen and keeps the value`, { once: false });
|
|
608
|
+
const seen = new Set();
|
|
609
|
+
for (const option of options) {
|
|
610
|
+
if (seen.has(option.value))
|
|
611
|
+
report(this, 'SEL-17', `two options share the value "${option.value}"; the first is the one both stand for`);
|
|
612
|
+
seen.add(option.value);
|
|
613
|
+
}
|
|
614
|
+
if (nested.length)
|
|
615
|
+
report(this, 'SEL-44', `a <${OPTION_GROUP_TAG}> stands inside another; its options are drawn as the outer group's, with no title or separation of its own`);
|
|
616
|
+
}
|
|
617
|
+
render() {
|
|
618
|
+
const { model } = this.options$;
|
|
619
|
+
const layout = this.layout;
|
|
620
|
+
const stacked = layout === 'stacked';
|
|
621
|
+
const inert = this.inert_;
|
|
622
|
+
const chosen = this.chosen;
|
|
623
|
+
const name = this.name_;
|
|
624
|
+
const described = this.frame.description();
|
|
625
|
+
const expanded = this.open && this.usable;
|
|
626
|
+
const leading = this.leading;
|
|
627
|
+
const floating = this.labelled;
|
|
628
|
+
// SEL-7: the asterisk follows a floating label while the Field says so (FLD-25); hidden from assistive technology,
|
|
629
|
+
// because the required state already says it. A bare select draws none.
|
|
630
|
+
const asterisk = floating && this.frame.requiredMark === 'asterisk' ? floatingAsterisk('asterisk') : nothing;
|
|
631
|
+
// The edge: a stacked select's inner line (SEL-20); an outlined select's three-piece outline with the gap for the
|
|
632
|
+
// floated label, and a filled select's active indicator (SEL-15).
|
|
633
|
+
const edges = triggerEdges({ stacked, floating, label: name, asterisk });
|
|
634
|
+
// SEL-11, SEL-48: the combobox is named by its own label or its Field's — drawn or not, and never by the
|
|
635
|
+
// placeholder — and described by what its Field gives. The name and the description are values, written here: an
|
|
636
|
+
// id cannot be referenced across the roots. Its value is what it holds that is not hidden: the chosen option's
|
|
637
|
+
// label. The floating label, the placeholder and every glyph are kept from assistive technology.
|
|
638
|
+
return html `
|
|
639
|
+
<div
|
|
640
|
+
class="field"
|
|
641
|
+
data-layout=${layout}
|
|
642
|
+
?data-error=${this.invalid}
|
|
643
|
+
?data-disabled=${inert}
|
|
644
|
+
?data-focused=${(this.focused || expanded) && !inert}
|
|
645
|
+
?data-labelled=${floating}
|
|
646
|
+
?data-has-value=${!!chosen}
|
|
647
|
+
data-leading=${leading ?? nothing}
|
|
648
|
+
?data-chevron=${!this.readOnly}
|
|
649
|
+
?data-option-icons=${model.hasIcons}
|
|
650
|
+
>
|
|
651
|
+
<div
|
|
652
|
+
part="container"
|
|
653
|
+
class="container"
|
|
654
|
+
data-tanrei-shape
|
|
655
|
+
role="combobox"
|
|
656
|
+
tabindex=${this.stop.keeps(inert) || !inert ? '0' : nothing}
|
|
657
|
+
aria-label=${name || nothing}
|
|
658
|
+
aria-describedby=${described ? 'description' : nothing}
|
|
659
|
+
aria-invalid=${this.invalid ? 'true' : nothing}
|
|
660
|
+
aria-required=${this.frame.required ? 'true' : nothing}
|
|
661
|
+
aria-readonly=${this.readOnly ? 'true' : nothing}
|
|
662
|
+
aria-disabled=${inert ? 'true' : nothing}
|
|
663
|
+
aria-haspopup="listbox"
|
|
664
|
+
aria-expanded=${expanded ? 'true' : 'false'}
|
|
665
|
+
aria-controls="list"
|
|
666
|
+
aria-activedescendant=${(expanded && this.list.activeId) || nothing}
|
|
667
|
+
@pointerdown=${this.onPointerDown}
|
|
668
|
+
@click=${this.onClick}
|
|
669
|
+
@keydown=${this.onKeyDown}
|
|
670
|
+
@focus=${this.onFocus}
|
|
671
|
+
@blur=${this.onBlur}
|
|
672
|
+
>
|
|
673
|
+
<span part="leading-icon" class="icon leading-slot" aria-hidden="true"><slot name="leading-icon" @slotchange=${this.onLeadingSlotChange}></slot></span>
|
|
674
|
+
<span part="leading-icon" class="icon leading-own" aria-hidden="true"><span class="ink">${leading === 'option' ? chosen?.leadingIcon : nothing}</span></span>
|
|
675
|
+
<div class="body">
|
|
676
|
+
<span class="sizer" aria-hidden="true">${this.sizerLines(model)}</span>
|
|
677
|
+
<span class="line"
|
|
678
|
+
>${chosen
|
|
679
|
+
? html `<span part="value" class="value" lang=${chosen.lang || nothing} dir=${chosen.dir || ownDirection(chosen.label)}>${chosen.label}</span>`
|
|
680
|
+
: this.placeholder
|
|
681
|
+
? html `<span part="placeholder" class="placeholder" aria-hidden="true" dir=${ownDirection(this.placeholder)}>${this.placeholder}</span>`
|
|
682
|
+
: nothing}</span
|
|
683
|
+
>
|
|
684
|
+
</div>
|
|
685
|
+
${this.readOnly ? nothing : html `<span part="chevron" class="icon chevron" aria-hidden="true"><span class="ink">expand_more</span></span>`}
|
|
686
|
+
${floatingLabel({ floating, label: name, asterisk })}
|
|
687
|
+
${edges}
|
|
688
|
+
</div>
|
|
689
|
+
<span id="name" hidden>${name}</span>
|
|
690
|
+
${described ? html `<span id="description" hidden>${described}</span>` : nothing}
|
|
691
|
+
</div>
|
|
692
|
+
${this.list.render({ labelledBy: 'name', inline: this.inline })}
|
|
693
|
+
`;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
// Its `disabled` attribute, written while it holds focus, waits until focus has left: a frame at most.
|
|
697
|
+
disabledWaitsWhileFocused(TanreiSelect);
|
|
698
|
+
// `autofocus` on it gives it focus when the page first loads too (src/primitives/autofocus.ts).
|
|
699
|
+
focusedAtFirst(TanreiSelect);
|
|
700
|
+
if (!customElements.get('tanrei-select'))
|
|
701
|
+
customElements.define('tanrei-select', TanreiSelect);
|
|
702
|
+
//# sourceMappingURL=select.js.map
|