@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,122 @@
|
|
|
1
|
+
import { LitElement, type PropertyDeclarations, type PropertyValues } from 'lit';
|
|
2
|
+
import { type FrameRequiredMark, type FrameRequirement } from '../../primitives/field-frame.js';
|
|
3
|
+
import { type GroupOrientation } from '../../primitives/field-group-frame.js';
|
|
4
|
+
import type { TanreiFieldGroupSpacingRegistry } from '../../registry.js';
|
|
5
|
+
/** What the form asks of the set: nothing, an answer, or that it may be left out. */
|
|
6
|
+
export type TanreiFieldGroupRequirement = FrameRequirement;
|
|
7
|
+
/** How a required set is marked: the design system's answer (auto), a tag, an asterisk, or nothing. */
|
|
8
|
+
export type TanreiFieldGroupRequiredMark = FrameRequiredMark;
|
|
9
|
+
/** A column, or a row that wraps. */
|
|
10
|
+
export type TanreiFieldGroupOrientation = GroupOrientation;
|
|
11
|
+
/** The core spacings (controls, fields), plus any a design system's generated `.d.ts` registers. */
|
|
12
|
+
export type TanreiFieldGroupSpacing = keyof TanreiFieldGroupSpacingRegistry;
|
|
13
|
+
/** What the set is to assistive technology: a group of controls that each answer for themselves, or the radio group of its radio buttons. */
|
|
14
|
+
export type TanreiFieldGroupKind = (typeof KINDS)[number];
|
|
15
|
+
/** FGR-22: the first is what an unknown kind is exposed as. */
|
|
16
|
+
declare const KINDS: readonly ['group', 'radio-group'];
|
|
17
|
+
/**
|
|
18
|
+
* Names a set of controls that answer one question — checkboxes, switches, or fields that belong together — with a
|
|
19
|
+
* label that can say the set is required or optional, a description, and one error for the set, and lays the controls
|
|
20
|
+
* out in a column or a row. It frames the set and never selects, moves focus or holds a value.
|
|
21
|
+
*
|
|
22
|
+
* Contract: specs/field-group.spec.json. `<tanrei-field-group label="Notify me by"><tanrei-checkbox label="Email">
|
|
23
|
+
* </tanrei-checkbox>…</tanrei-field-group>`: the controls are the elements of the default slot. They stay in the
|
|
24
|
+
* product's light DOM, so each keeps its place in a `<form>`, its `name` and `value` and its events; the group is not
|
|
25
|
+
* form-associated, holds no value and emits no event. Every visual value is a `--tanrei-comp-field-group-*` token.
|
|
26
|
+
*
|
|
27
|
+
* The shadow root holds a `<fieldset>` with a `<legend>` around the slot, so the controls are inside the group the
|
|
28
|
+
* label names. A group has neither a required nor an invalid state: its description is `supporting-text`, then
|
|
29
|
+
* `error-text` while `error` is true, then the requirement in words (`required-text`, `optional-text`); `error` puts
|
|
30
|
+
* each checkbox it holds in the checkbox's own error condition and gives it the error text as its description. A
|
|
31
|
+
* switch, which has no error condition, stays as it is drawn, and a field keeps the error the product gave it.
|
|
32
|
+
* `disabled` disables every control. The group gives these through the composed `tanrei-field-connect` event a control
|
|
33
|
+
* asks with (`src/primitives/field.ts`), or as attributes on any other element, and takes back exactly what it gave.
|
|
34
|
+
*
|
|
35
|
+
* It answers no press and no key and adds no stop to the focus order.
|
|
36
|
+
*
|
|
37
|
+
* `kind="radio-group"` (FGR-25) makes the same element the radio group of the radio buttons it holds — a set of radio
|
|
38
|
+
* buttons of one `name`, written by hand, or the radio buttons of the `<tanrei-radio-group>` built around it: the
|
|
39
|
+
* `<fieldset>` carries the radio group's role with `aria-required` while the set is required, `aria-invalid` while
|
|
40
|
+
* `error` is true and `aria-orientation`, and `required-text` is left out of its description, because the state says
|
|
41
|
+
* it. Nothing that is drawn changes, and the group still holds no value, moves no focus and handles no key: selection,
|
|
42
|
+
* the arrow keys and the one tab stop stay the radio buttons' own group's.
|
|
43
|
+
*
|
|
44
|
+
* @tag tanrei-field-group
|
|
45
|
+
* @slot - The controls of the set, in the order given.
|
|
46
|
+
* @csspart label - The label above the controls.
|
|
47
|
+
* @csspart requirement-label - The required or optional tag after the label, or the required asterisk.
|
|
48
|
+
* @csspart supporting-text - The description under the label.
|
|
49
|
+
* @csspart error-text - The error text below the controls.
|
|
50
|
+
*/
|
|
51
|
+
export declare class TanreiFieldGroup extends LitElement {
|
|
52
|
+
private readonly availability;
|
|
53
|
+
static styles: import("lit").CSSResult;
|
|
54
|
+
/**
|
|
55
|
+
* Its documented parts, once: what an element composed around it exports (src/primitives/composed.ts). Held equal to
|
|
56
|
+
* the `@csspart` lines above by src/primitives/composed.test.ts.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
static readonly parts: readonly string[];
|
|
61
|
+
static properties: PropertyDeclarations;
|
|
62
|
+
/** Names the set, visibly and to assistive technology: the question its controls answer ("Notify me by"). Required. */
|
|
63
|
+
label: string;
|
|
64
|
+
/** Does not draw the label, which stays the accessible name of the group (`label-hidden`). */
|
|
65
|
+
labelHidden: boolean;
|
|
66
|
+
/** The description: how to answer ("Choose all that apply"), drawn under the label and given to assistive technology as the group's description (`supporting-text`). */
|
|
67
|
+
supportingText: string;
|
|
68
|
+
/** What is wrong with the set as a whole and how to put it right, drawn below the controls while `error` is true (`error-text`). */
|
|
69
|
+
errorText: string;
|
|
70
|
+
/** Puts the set in the error condition: the error text is drawn, and each control that has an error condition of its own (a checkbox, a radio button) is drawn in it. The group never sets this itself. */
|
|
71
|
+
error: boolean;
|
|
72
|
+
/** Disables every control of the set and draws the frame as disabled. */
|
|
73
|
+
disabled: boolean;
|
|
74
|
+
/** What the form asks of the set: `required` draws the required mark and says so in the group's description; `optional` draws the optional tag; `none` says and draws nothing. It never validates. */
|
|
75
|
+
requirement: TanreiFieldGroupRequirement;
|
|
76
|
+
/** How this set shows that it is required (`required-mark`): `tag`, `asterisk` or `none`; `auto` takes the design system's answer (`--tanrei-comp-field-group-requirement-mark`, which follows `--tanrei-sys-behavior-requirement-mark`). */
|
|
77
|
+
requiredMark: TanreiFieldGroupRequiredMark;
|
|
78
|
+
/** The text of the required tag, also part of the group's description, because a group has no required state (`required-text`): this instance's words, else the product's (`setWords({ requiredText })`). Tanrei has none: without them the asterisk is drawn in the tag's place and nothing says the requirement to assistive technology. */
|
|
79
|
+
requiredText: string;
|
|
80
|
+
/** The text of the optional tag, also part of the group's description (`optional-text`): this instance's words, else the product's (`setWords({ optionalText })`). Tanrei has none: without them no tag is drawn and nothing is said. */
|
|
81
|
+
optionalText: string;
|
|
82
|
+
/** `vertical` stacks the controls in one column, the form to prefer; `horizontal` lays them out in a row that wraps. */
|
|
83
|
+
orientation: TanreiFieldGroupOrientation;
|
|
84
|
+
/** What the set holds, which decides the distance between its members: `controls` (checkboxes or switches, a touch target apart) or `fields` (the distance a form keeps between two fields). A design system may add values. */
|
|
85
|
+
spacing: TanreiFieldGroupSpacing;
|
|
86
|
+
/** What the set is to assistive technology. `group`: a named group of controls that each answer for themselves. `radio-group`: the radio group of the radio buttons it holds, which is required and invalid as a whole and says its orientation. It changes what is exposed and nothing that is drawn, and the group still holds no value: the radio buttons keep their selection, their arrow keys and their tab stop, which their own group gives them — the `<tanrei-radio-group>` they stand in, or their `name`. */
|
|
87
|
+
kind: TanreiFieldGroupKind;
|
|
88
|
+
/** The group has been drawn once. */
|
|
89
|
+
private drawn;
|
|
90
|
+
/** FGR-22: a spacing a design system adds, and one the active system does not have (src/primitives/axes.ts). */
|
|
91
|
+
private readonly axes;
|
|
92
|
+
/** A group inside a group follows the outer group's `disabled`, and takes nothing else from it (FGR-20). */
|
|
93
|
+
private readonly outer;
|
|
94
|
+
/** FGR-8, FGR-11, FGR-14, FGR-23: what the group gives each control, and takes back (src/primitives/field.ts). */
|
|
95
|
+
private readonly provider;
|
|
96
|
+
/** FGR-24: the product's words, read where the instance gives none (src/primitives/words.ts). */
|
|
97
|
+
private readonly words;
|
|
98
|
+
/** FGR-24: the frame's props with requiredText and optionalText read: the prop, else the product's words. */
|
|
99
|
+
private get framed();
|
|
100
|
+
/** FGR-25: the set is exposed as the radio group of its radio buttons; any other value of `kind` is a group (FGR-22). */
|
|
101
|
+
private get isRadioGroup();
|
|
102
|
+
/** Disabled by its own `disabled` or by a field group around it. */
|
|
103
|
+
private get isDisabled();
|
|
104
|
+
/** The elements in the default slot, in the order given. */
|
|
105
|
+
private get controls();
|
|
106
|
+
/** FGR-8, FGR-11: what a control with an error condition of its own is given. */
|
|
107
|
+
private get marked();
|
|
108
|
+
/** FGR-8, FGR-11: what a radio button is given — its error form, and no description: the group is described, not each option. */
|
|
109
|
+
private get drawnInError();
|
|
110
|
+
/** FGR-23: a control came, left or moved. */
|
|
111
|
+
private onSlotChange;
|
|
112
|
+
protected updated(changed: PropertyValues): void;
|
|
113
|
+
/** What a debug build tells the developer; the group still renders. */
|
|
114
|
+
private reports;
|
|
115
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
116
|
+
}
|
|
117
|
+
declare global {
|
|
118
|
+
interface HTMLElementTagNameMap {
|
|
119
|
+
'tanrei-field-group': TanreiFieldGroup;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
|
+
import { frameAnnounce, frameRequirement, frameWithWords, reportFrame, syncFrameMark } from '../../primitives/field-frame.js';
|
|
3
|
+
import { GROUP_ORIENTATIONS, groupDescribedBy, groupOrientation, groupRows } from '../../primitives/field-group-frame.js';
|
|
4
|
+
import { AvailabilityController, FieldControlController, FieldProviderController, OpenAxesController, WordsController, report } from '../../primitives/index.js';
|
|
5
|
+
import { AXES, CORE_SPACINGS, PREFIX, styles } from './field-group.styles.js';
|
|
6
|
+
/** FGR-22: the first is what an unknown kind is exposed as. */
|
|
7
|
+
const KINDS = ['group', 'radio-group'];
|
|
8
|
+
/** FGR-25: a radio group has a required state, so "required" is that state and never words of the description. */
|
|
9
|
+
const RADIO_GROUP = { requiredState: true };
|
|
10
|
+
/** The id of the legend, which names the radio group (FGR-25). */
|
|
11
|
+
const LEGEND = 'legend';
|
|
12
|
+
/** FGR-15, FGR-25: a radio button — Tanrei's or the platform's. */
|
|
13
|
+
const RADIO_BUTTON = 'tanrei-radio-button, input[type="radio"]';
|
|
14
|
+
/** The elements that hold a set of controls: a radio button inside one, inside this group, is that set's. */
|
|
15
|
+
const SETS = 'tanrei-radio-group, tanrei-field-group, tanrei-checkbox-group';
|
|
16
|
+
/** FGR-25: what can be operated among the product's own elements. */
|
|
17
|
+
const OPERABLE = 'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"]), [contenteditable]:not([contenteditable="false"])';
|
|
18
|
+
const state = (given) => ({ label: '', description: '', invalid: false, required: false, requiredText: '', disabled: false, ...given });
|
|
19
|
+
/** A native element that has an error condition of its own to be put in (FGR-8): a checkbox. */
|
|
20
|
+
const PLAIN_ERROR_CONDITION = 'input[type="checkbox"], [role="checkbox"]';
|
|
21
|
+
/**
|
|
22
|
+
* Names a set of controls that answer one question — checkboxes, switches, or fields that belong together — with a
|
|
23
|
+
* label that can say the set is required or optional, a description, and one error for the set, and lays the controls
|
|
24
|
+
* out in a column or a row. It frames the set and never selects, moves focus or holds a value.
|
|
25
|
+
*
|
|
26
|
+
* Contract: specs/field-group.spec.json. `<tanrei-field-group label="Notify me by"><tanrei-checkbox label="Email">
|
|
27
|
+
* </tanrei-checkbox>…</tanrei-field-group>`: the controls are the elements of the default slot. They stay in the
|
|
28
|
+
* product's light DOM, so each keeps its place in a `<form>`, its `name` and `value` and its events; the group is not
|
|
29
|
+
* form-associated, holds no value and emits no event. Every visual value is a `--tanrei-comp-field-group-*` token.
|
|
30
|
+
*
|
|
31
|
+
* The shadow root holds a `<fieldset>` with a `<legend>` around the slot, so the controls are inside the group the
|
|
32
|
+
* label names. A group has neither a required nor an invalid state: its description is `supporting-text`, then
|
|
33
|
+
* `error-text` while `error` is true, then the requirement in words (`required-text`, `optional-text`); `error` puts
|
|
34
|
+
* each checkbox it holds in the checkbox's own error condition and gives it the error text as its description. A
|
|
35
|
+
* switch, which has no error condition, stays as it is drawn, and a field keeps the error the product gave it.
|
|
36
|
+
* `disabled` disables every control. The group gives these through the composed `tanrei-field-connect` event a control
|
|
37
|
+
* asks with (`src/primitives/field.ts`), or as attributes on any other element, and takes back exactly what it gave.
|
|
38
|
+
*
|
|
39
|
+
* It answers no press and no key and adds no stop to the focus order.
|
|
40
|
+
*
|
|
41
|
+
* `kind="radio-group"` (FGR-25) makes the same element the radio group of the radio buttons it holds — a set of radio
|
|
42
|
+
* buttons of one `name`, written by hand, or the radio buttons of the `<tanrei-radio-group>` built around it: the
|
|
43
|
+
* `<fieldset>` carries the radio group's role with `aria-required` while the set is required, `aria-invalid` while
|
|
44
|
+
* `error` is true and `aria-orientation`, and `required-text` is left out of its description, because the state says
|
|
45
|
+
* it. Nothing that is drawn changes, and the group still holds no value, moves no focus and handles no key: selection,
|
|
46
|
+
* the arrow keys and the one tab stop stay the radio buttons' own group's.
|
|
47
|
+
*
|
|
48
|
+
* @tag tanrei-field-group
|
|
49
|
+
* @slot - The controls of the set, in the order given.
|
|
50
|
+
* @csspart label - The label above the controls.
|
|
51
|
+
* @csspart requirement-label - The required or optional tag after the label, or the required asterisk.
|
|
52
|
+
* @csspart supporting-text - The description under the label.
|
|
53
|
+
* @csspart error-text - The error text below the controls.
|
|
54
|
+
*/
|
|
55
|
+
export class TanreiFieldGroup extends LitElement {
|
|
56
|
+
constructor() {
|
|
57
|
+
super(...arguments);
|
|
58
|
+
this.availability = new AvailabilityController(this, 'field-group');
|
|
59
|
+
/** Names the set, visibly and to assistive technology: the question its controls answer ("Notify me by"). Required. */
|
|
60
|
+
this.label = '';
|
|
61
|
+
/** Does not draw the label, which stays the accessible name of the group (`label-hidden`). */
|
|
62
|
+
this.labelHidden = false;
|
|
63
|
+
/** The description: how to answer ("Choose all that apply"), drawn under the label and given to assistive technology as the group's description (`supporting-text`). */
|
|
64
|
+
this.supportingText = '';
|
|
65
|
+
/** What is wrong with the set as a whole and how to put it right, drawn below the controls while `error` is true (`error-text`). */
|
|
66
|
+
this.errorText = '';
|
|
67
|
+
/** Puts the set in the error condition: the error text is drawn, and each control that has an error condition of its own (a checkbox, a radio button) is drawn in it. The group never sets this itself. */
|
|
68
|
+
this.error = false;
|
|
69
|
+
/** Disables every control of the set and draws the frame as disabled. */
|
|
70
|
+
this.disabled = false;
|
|
71
|
+
/** What the form asks of the set: `required` draws the required mark and says so in the group's description; `optional` draws the optional tag; `none` says and draws nothing. It never validates. */
|
|
72
|
+
this.requirement = 'none';
|
|
73
|
+
/** How this set shows that it is required (`required-mark`): `tag`, `asterisk` or `none`; `auto` takes the design system's answer (`--tanrei-comp-field-group-requirement-mark`, which follows `--tanrei-sys-behavior-requirement-mark`). */
|
|
74
|
+
this.requiredMark = 'auto';
|
|
75
|
+
/** The text of the required tag, also part of the group's description, because a group has no required state (`required-text`): this instance's words, else the product's (`setWords({ requiredText })`). Tanrei has none: without them the asterisk is drawn in the tag's place and nothing says the requirement to assistive technology. */
|
|
76
|
+
this.requiredText = '';
|
|
77
|
+
/** The text of the optional tag, also part of the group's description (`optional-text`): this instance's words, else the product's (`setWords({ optionalText })`). Tanrei has none: without them no tag is drawn and nothing is said. */
|
|
78
|
+
this.optionalText = '';
|
|
79
|
+
/** `vertical` stacks the controls in one column, the form to prefer; `horizontal` lays them out in a row that wraps. */
|
|
80
|
+
this.orientation = 'vertical';
|
|
81
|
+
/** What the set holds, which decides the distance between its members: `controls` (checkboxes or switches, a touch target apart) or `fields` (the distance a form keeps between two fields). A design system may add values. */
|
|
82
|
+
this.spacing = 'controls';
|
|
83
|
+
/** What the set is to assistive technology. `group`: a named group of controls that each answer for themselves. `radio-group`: the radio group of the radio buttons it holds, which is required and invalid as a whole and says its orientation. It changes what is exposed and nothing that is drawn, and the group still holds no value: the radio buttons keep their selection, their arrow keys and their tab stop, which their own group gives them — the `<tanrei-radio-group>` they stand in, or their `name`. */
|
|
84
|
+
this.kind = 'group';
|
|
85
|
+
/** The group has been drawn once. */
|
|
86
|
+
this.drawn = false;
|
|
87
|
+
/** FGR-22: a spacing a design system adds, and one the active system does not have (src/primitives/axes.ts). */
|
|
88
|
+
this.axes = new OpenAxesController(this, { component: 'field-group', behavior: 'FGR-22', axes: AXES });
|
|
89
|
+
/** A group inside a group follows the outer group's `disabled`, and takes nothing else from it (FGR-20). */
|
|
90
|
+
this.outer = new FieldControlController(this, { takes: 'disabled', framed: true, named: () => true });
|
|
91
|
+
/** FGR-8, FGR-11, FGR-14, FGR-23: what the group gives each control, and takes back (src/primitives/field.ts). */
|
|
92
|
+
this.provider = new FieldProviderController(this, {
|
|
93
|
+
controls: () => this.controls,
|
|
94
|
+
// A control that draws an error condition of its own is put in it — a checkbox is told why too, and exposes the
|
|
95
|
+
// invalid state itself; a radio button is only drawn in its error form, because its role has no invalid state and
|
|
96
|
+
// the group says the error once (FGR-10, FGR-11). Every other control — a switch, a field, a group, a radio group —
|
|
97
|
+
// is given `disabled` and nothing else.
|
|
98
|
+
state: (connection) => connection.takes === 'all' && connection.errorCondition ? (connection.control.matches(RADIO_BUTTON) ? this.drawnInError : this.marked) : state({ disabled: this.isDisabled }),
|
|
99
|
+
plain: (element) => (element.matches(PLAIN_ERROR_CONDITION) ? this.marked : { disabled: this.isDisabled }),
|
|
100
|
+
});
|
|
101
|
+
/** FGR-24: the product's words, read where the instance gives none (src/primitives/words.ts). */
|
|
102
|
+
this.words = new WordsController(this);
|
|
103
|
+
}
|
|
104
|
+
static { this.styles = styles; }
|
|
105
|
+
/**
|
|
106
|
+
* Its documented parts, once: what an element composed around it exports (src/primitives/composed.ts). Held equal to
|
|
107
|
+
* the `@csspart` lines above by src/primitives/composed.test.ts.
|
|
108
|
+
*
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
static { this.parts = ['label', 'requirement-label', 'supporting-text', 'error-text']; }
|
|
112
|
+
static { this.properties = {
|
|
113
|
+
label: { type: String },
|
|
114
|
+
labelHidden: { type: Boolean, attribute: 'label-hidden', reflect: true },
|
|
115
|
+
supportingText: { type: String, attribute: 'supporting-text' },
|
|
116
|
+
errorText: { type: String, attribute: 'error-text' },
|
|
117
|
+
error: { type: Boolean, reflect: true },
|
|
118
|
+
disabled: { type: Boolean, reflect: true },
|
|
119
|
+
requirement: { type: String, reflect: true },
|
|
120
|
+
requiredMark: { type: String, attribute: 'required-mark', reflect: true },
|
|
121
|
+
requiredText: { type: String, attribute: 'required-text' },
|
|
122
|
+
optionalText: { type: String, attribute: 'optional-text' },
|
|
123
|
+
orientation: { type: String, reflect: true },
|
|
124
|
+
spacing: { type: String, reflect: true },
|
|
125
|
+
kind: { type: String, reflect: true },
|
|
126
|
+
}; }
|
|
127
|
+
/** FGR-24: the frame's props with requiredText and optionalText read: the prop, else the product's words. */
|
|
128
|
+
get framed() {
|
|
129
|
+
return frameWithWords(this, this.words);
|
|
130
|
+
}
|
|
131
|
+
/** FGR-25: the set is exposed as the radio group of its radio buttons; any other value of `kind` is a group (FGR-22). */
|
|
132
|
+
get isRadioGroup() {
|
|
133
|
+
return this.kind === 'radio-group';
|
|
134
|
+
}
|
|
135
|
+
/** Disabled by its own `disabled` or by a field group around it. */
|
|
136
|
+
get isDisabled() {
|
|
137
|
+
return this.disabled || this.outer.disabled;
|
|
138
|
+
}
|
|
139
|
+
/** The elements in the default slot, in the order given. */
|
|
140
|
+
get controls() {
|
|
141
|
+
const slot = this.renderRoot?.querySelector('slot:not([name])');
|
|
142
|
+
return slot ? slot.assignedElements({ flatten: true }) : [...this.children].filter((child) => !child.slot);
|
|
143
|
+
}
|
|
144
|
+
/** FGR-8, FGR-11: what a control with an error condition of its own is given. */
|
|
145
|
+
get marked() {
|
|
146
|
+
return state({ invalid: this.error, description: this.error ? this.errorText : '', disabled: this.isDisabled });
|
|
147
|
+
}
|
|
148
|
+
/** FGR-8, FGR-11: what a radio button is given — its error form, and no description: the group is described, not each option. */
|
|
149
|
+
get drawnInError() {
|
|
150
|
+
return state({ invalid: this.error, disabled: this.isDisabled });
|
|
151
|
+
}
|
|
152
|
+
/** FGR-23: a control came, left or moved. */
|
|
153
|
+
onSlotChange() {
|
|
154
|
+
this.requestUpdate();
|
|
155
|
+
}
|
|
156
|
+
updated(changed) {
|
|
157
|
+
// FGR-6: the design system's required mark, for a browser without style queries.
|
|
158
|
+
syncFrameMark(this, this.renderRoot, PREFIX);
|
|
159
|
+
// FGR-11, FGR-23: every control is told at once; one that left gets back what it had.
|
|
160
|
+
this.provider.sync();
|
|
161
|
+
// FGR-9: an error that appears, or changes its words, while focus is inside the group is announced once, politely.
|
|
162
|
+
if (this.drawn && this.error && (changed.has('error') || changed.has('errorText')) && this.matches(':focus-within'))
|
|
163
|
+
frameAnnounce(this.renderRoot, this.errorText);
|
|
164
|
+
this.drawn = true;
|
|
165
|
+
this.reports(changed);
|
|
166
|
+
}
|
|
167
|
+
/** What a debug build tells the developer; the group still renders. */
|
|
168
|
+
reports(changed) {
|
|
169
|
+
// FGR-24: a group says the requirement in words whichever mark is drawn; a radio group's required state needs none,
|
|
170
|
+
// so its word is missed only where the tag would be drawn.
|
|
171
|
+
reportFrame(this, this.framed, changed, { unknown: 'FGR-22', words: 'FGR-24' }, this.words, { prefix: PREFIX, always: !this.isRadioGroup });
|
|
172
|
+
if (changed.has('orientation') && !GROUP_ORIENTATIONS.includes(this.orientation)) {
|
|
173
|
+
report(this, 'FGR-22', `orientation "${this.orientation}" is not vertical or horizontal; it is drawn as "vertical"`);
|
|
174
|
+
}
|
|
175
|
+
// FGR-10: a set without a name still renders.
|
|
176
|
+
if (changed.has('label') && !this.label)
|
|
177
|
+
report(this, 'FGR-10', 'label is empty, so the set has no accessible name; give it a label (labelHidden hides it and keeps the name)');
|
|
178
|
+
const controls = this.controls;
|
|
179
|
+
// FGR-20: a set without a control still draws its rows.
|
|
180
|
+
if (!controls.length)
|
|
181
|
+
report(this, 'FGR-20', 'the field group holds no control; put the controls of the set in its default slot');
|
|
182
|
+
if (changed.has('kind') && !KINDS.includes(this.kind))
|
|
183
|
+
report(this, 'FGR-22', `kind "${this.kind}" is not group or radio-group; the set is exposed as a group`);
|
|
184
|
+
if (!this.isRadioGroup) {
|
|
185
|
+
// FGR-15: radio buttons are framed like any control, and nothing a set of them needs is added.
|
|
186
|
+
if (controls.some((element) => element.matches(RADIO_BUTTON))) {
|
|
187
|
+
report(this, 'FGR-15', 'the field group holds radio buttons, which it frames and does not group: a set of radio buttons is a radio group (RGP-1), or, written by hand, a field group whose kind is radio-group (FGR-25)');
|
|
188
|
+
}
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
// FGR-25: the radio buttons of one group, and no other control.
|
|
192
|
+
const other = [...this.provider.connections.keys()].some((control) => !control.matches(RADIO_BUTTON)) || controls.some((element) => !element.matches(RADIO_BUTTON) && (element.matches(OPERABLE) || !!element.querySelector(`:is(${OPERABLE}):not(${RADIO_BUTTON})`)));
|
|
193
|
+
if (other)
|
|
194
|
+
report(this, 'FGR-25', 'the field group is a radio group and holds a control that is not a radio button; it holds the radio buttons of one group and nothing else that can be operated');
|
|
195
|
+
// One group: the radio group they stand in, or one name. The set's radio buttons are its controls and those inside
|
|
196
|
+
// the product's own elements — none of a set of its own that stands among them, which is one member and reported above.
|
|
197
|
+
const radios = controls.flatMap((element) => (element.matches(RADIO_BUTTON) ? [element] : [...element.querySelectorAll(RADIO_BUTTON)].filter((radio) => !element.contains(radio.closest(SETS)))));
|
|
198
|
+
const groups = new Set(radios.map((radio) => radio.closest('tanrei-radio-group') ?? radio.name ?? radio.getAttribute('name') ?? ''));
|
|
199
|
+
if (groups.size > 1)
|
|
200
|
+
report(this, 'FGR-25', 'the field group is a radio group and holds radio buttons of more than one group; give the radio buttons of the set one name');
|
|
201
|
+
if (changed.has('spacing') || changed.has('kind')) {
|
|
202
|
+
if (this.spacing !== 'controls')
|
|
203
|
+
report(this, 'FGR-25', `the field group is a radio group, whose radio buttons are controls; spacing "${this.spacing}" is for another kind of set`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
render() {
|
|
207
|
+
const disabled = this.isDisabled;
|
|
208
|
+
const framed = this.framed;
|
|
209
|
+
const radioGroup = this.isRadioGroup;
|
|
210
|
+
const semantics = radioGroup ? RADIO_GROUP : undefined;
|
|
211
|
+
const rows = groupRows(framed, semantics);
|
|
212
|
+
const spacing = CORE_SPACINGS.includes(this.spacing) ? this.spacing : 'controls';
|
|
213
|
+
// FGR-10: a fieldset with a legend — a group that contains its controls (the accessibility tree is built from the
|
|
214
|
+
// flattened tree) and is named by its label, drawn or not. FGR-11: it is described by the rows of the same shadow
|
|
215
|
+
// root. FGR-14: the group is exposed as disabled; its `disabled` attribute would not reach the slotted controls,
|
|
216
|
+
// which are told one by one.
|
|
217
|
+
//
|
|
218
|
+
// FGR-25: in the radio-group kind the same fieldset carries the radio group's role — one radio group in the group's
|
|
219
|
+
// place, never one inside the other — named by its legend, with the role's required and invalid states and its
|
|
220
|
+
// orientation as attributes of this element, which the accessibility checks can see (they cannot see a role given
|
|
221
|
+
// through ElementInternals). Nothing else differs, so the two kinds are the same picture.
|
|
222
|
+
return html `
|
|
223
|
+
<fieldset
|
|
224
|
+
class="group"
|
|
225
|
+
role=${radioGroup ? 'radiogroup' : nothing}
|
|
226
|
+
aria-labelledby=${radioGroup && this.label ? LEGEND : nothing}
|
|
227
|
+
aria-describedby=${groupDescribedBy(framed, semantics) ?? nothing}
|
|
228
|
+
aria-required=${radioGroup && frameRequirement(this) === 'required' ? 'true' : nothing}
|
|
229
|
+
aria-invalid=${radioGroup && this.error ? 'true' : nothing}
|
|
230
|
+
aria-orientation=${radioGroup ? groupOrientation(this.orientation) : nothing}
|
|
231
|
+
aria-disabled=${disabled ? 'true' : nothing}
|
|
232
|
+
?data-labelled=${rows.labelled}
|
|
233
|
+
?data-described=${rows.described}
|
|
234
|
+
?data-error=${this.error}
|
|
235
|
+
?data-disabled=${disabled}
|
|
236
|
+
>
|
|
237
|
+
${this.label ? html `<legend class="legend" id=${radioGroup ? LEGEND : nothing} ?data-unseen=${!rows.labelled}>${rows.labelled ? rows.label : this.label}</legend>` : nothing} ${rows.description}
|
|
238
|
+
<div class="controls" data-orientation=${groupOrientation(this.orientation)} data-spacing=${spacing}><slot @slotchange=${this.onSlotChange}></slot></div>
|
|
239
|
+
${rows.error} ${rows.unseen}
|
|
240
|
+
</fieldset>
|
|
241
|
+
`;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (!customElements.get('tanrei-field-group'))
|
|
245
|
+
customElements.define('tanrei-field-group', TanreiFieldGroup);
|
|
246
|
+
//# sourceMappingURL=field-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-group.js","sourceRoot":"","sources":["../../../src/components/field-group/field-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkD,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChG,OAAO,EAAkE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC9L,OAAO,EAAE,kBAAkB,EAA8C,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACtK,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,uBAAuB,EAAmB,kBAAkB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAElL,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAa9E,+DAA+D;AAC/D,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,aAAa,CAAU,CAAC;AAEhD,kHAAkH;AAClH,MAAM,WAAW,GAAmB,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AAE5D,kEAAkE;AAClE,MAAM,MAAM,GAAG,QAAQ,CAAC;AAExB,mEAAmE;AACnE,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAEhE,6GAA6G;AAC7G,MAAM,IAAI,GAAG,+DAA+D,CAAC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cAAc,CAAC,GAAG,CAAC,oBAAoB,CAAC;IAAE,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OpenAxis } from '../../primitives/index.js';
|
|
2
|
+
export declare const PREFIX = "--tanrei-comp-field-group";
|
|
3
|
+
/** The values of `spacing` every design system has. A layer may add more; those get their styles on demand. */
|
|
4
|
+
export declare const CORE_SPACINGS: readonly ['controls', 'fields'];
|
|
5
|
+
/** The open axis (FGR-22): a spacing the active design system does not have is drawn as `controls` and reported. */
|
|
6
|
+
export declare const AXES: readonly OpenAxis[];
|
|
7
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { groupFrameStyles } from '../../primitives/field-group-frame.js';
|
|
3
|
+
// Every visual value is a token (tokens/comp/field-group.tokens.json). The group draws a frame and lays its controls
|
|
4
|
+
// out; it draws no container and nothing of a control (FGR-1). It has no state layer and no focused state: it answers
|
|
5
|
+
// no hover, no press and no key (FGR-12).
|
|
6
|
+
export const PREFIX = '--tanrei-comp-field-group';
|
|
7
|
+
/** The values of `spacing` every design system has. A layer may add more; those get their styles on demand. */
|
|
8
|
+
export const CORE_SPACINGS = ['controls', 'fields'];
|
|
9
|
+
const DEFAULT_SPACING = 'controls';
|
|
10
|
+
/** FGR-3, FGR-13: the distance between two members is the token of what the set holds; a value a layer added falls back to the default's. */
|
|
11
|
+
const spacingBlock = (spacing, selector, fallback = null) => `${selector} {\n --_frame-gap: ${fallback ? `var(${PREFIX}-gap-${spacing}, var(${PREFIX}-gap-${fallback}))` : `var(${PREFIX}-gap-${spacing})`};\n}`;
|
|
12
|
+
/** The open axis (FGR-22): a spacing the active design system does not have is drawn as `controls` and reported. */
|
|
13
|
+
export const AXES = [
|
|
14
|
+
{ name: 'spacing', core: CORE_SPACINGS, default: DEFAULT_SPACING, rules: (value, selector) => spacingBlock(value, selector, DEFAULT_SPACING), probe: (value) => `${PREFIX}-gap-${value}` },
|
|
15
|
+
];
|
|
16
|
+
export const styles = css `
|
|
17
|
+
/* FGR-1: a block as wide as its layout gives it, as tall as its rows and its controls together. */
|
|
18
|
+
:host {
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
:host([hidden]) {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
/* FGR-1 … FGR-9, FGR-13, FGR-16 … FGR-18, FGR-21: the group's frame, from the group's tokens. */
|
|
25
|
+
${groupFrameStyles({ prefix: PREFIX })}
|
|
26
|
+
${unsafeCSS(CORE_SPACINGS.filter((spacing) => spacing !== DEFAULT_SPACING).map((spacing) => spacingBlock(spacing, `:host([spacing='${spacing}'])`)).join('\n'))}
|
|
27
|
+
`;
|
|
28
|
+
//# sourceMappingURL=field-group.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-group.styles.js","sourceRoot":"","sources":["../../../src/components/field-group/field-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAGzE,qHAAqH;AACrH,sHAAsH;AACtH,0CAA0C;AAC1C,MAAM,CAAC,MAAM,MAAM,GAAG,2BAA2B,CAAC;AAClD,+GAA+G;AAC/G,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAU,CAAC;AAC7D,MAAM,eAAe,GAAG,UAAU,CAAC;AAEnC,6IAA6I;AAC7I,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,QAAgB,EAAE,QAAQ,GAAkB,IAAI,EAAE,EAAE,CACzF,GAAG,QAAQ,uBAAuB,QAAQ,CAAC,CAAC,CAAC,OAAO,MAAM,QAAQ,OAAO,SAAS,MAAM,QAAQ,QAAQ,IAAI,CAAC,CAAC,CAAC,OAAO,MAAM,QAAQ,OAAO,GAAG,MAAM,CAAC;AAEvJ,oHAAoH;AACpH,MAAM,CAAC,MAAM,IAAI,GAAwB;IACvC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,MAAM,QAAQ,KAAK,EAAE,EAAE;CAC3L,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;IASrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACpC,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,mBAAmB,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;CAChK,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { type PropertyDeclarations, type PropertyValues, ReactiveElement } from 'lit';
|
|
2
|
+
import { type SeparationProp } from '../../primitives/index.js';
|
|
3
|
+
import type { TanreiFigureVariantRegistry } from '../../registry.js';
|
|
4
|
+
/** The core looks (outlined, filled, plain), plus any a design system's generated `.d.ts` registers. */
|
|
5
|
+
export type TanreiFigureVariant = keyof TanreiFigureVariantRegistry;
|
|
6
|
+
/** How the parts inside the frame are told apart (FIG-12): `auto` takes `comp.figure.separation`. */
|
|
7
|
+
export type TanreiFigureSeparation = SeparationProp;
|
|
8
|
+
/**
|
|
9
|
+
* Sets one thing to look at — a picture, a chart, a specimen, a live example — on a stage of its own, framed or not,
|
|
10
|
+
* with a caption that says what it shows, and optionally a title with the product's controls above and a joined block
|
|
11
|
+
* beneath. It is never pressed and has no state; what stands in it stays as operable as it is anywhere else.
|
|
12
|
+
*
|
|
13
|
+
* Contract: specs/figure.spec.json. The element has **no shadow root**: it is the box around a native `<figure>`,
|
|
14
|
+
* which stays in the document — read without script, by a crawler and by a reader mode.
|
|
15
|
+
*
|
|
16
|
+
* ```html
|
|
17
|
+
* <tanrei-figure>
|
|
18
|
+
* <figure>
|
|
19
|
+
* <div data-part="frame">
|
|
20
|
+
* <header>
|
|
21
|
+
* <p data-part="title">Variants</p>
|
|
22
|
+
* <div data-part="actions"><tanrei-button variant="text" label="Open in a new tab"><span slot="icon">open_in_new</span></tanrei-button></div>
|
|
23
|
+
* </header>
|
|
24
|
+
* <div data-part="stage"><tanrei-button>Save</tanrei-button></div>
|
|
25
|
+
* <div data-part="attachment">…a code block, a table, a description list…</div>
|
|
26
|
+
* </div>
|
|
27
|
+
* <figcaption>A filled button, as the default system draws it.</figcaption>
|
|
28
|
+
* </figure>
|
|
29
|
+
* </tanrei-figure>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* Every part but the stage is optional. The title is any element with `data-part="title"` — a `<p>`, or the heading
|
|
33
|
+
* the page's outline needs, whose role and level are kept — and the attachment any element with
|
|
34
|
+
* `data-part="attachment"`, the product's own component included. A lone `<img>`, `<picture>`, `<video>`, `<svg>` or
|
|
35
|
+
* `<canvas>` in place of the stage element is its own stage, and one written as a child of the `<figure>` itself —
|
|
36
|
+
* `<figure><img …><figcaption>…</figcaption></figure>`, as a Markdown renderer writes it — is its own frame.
|
|
37
|
+
*
|
|
38
|
+
* Everything drawn is `@tanrei/web/figure.css` — every value a `--tanrei-comp-figure-*` token — which draws the figure
|
|
39
|
+
* before and without this script, so a page of figures does not move when the script arrives; the element adds the
|
|
40
|
+
* same sheet to the root it is connected to, so it also works inside another component's shadow root. The script adds
|
|
41
|
+
* what a stylesheet cannot: the title as the figure's name and the caption as its description where it has both, the
|
|
42
|
+
* caption as its name where it has no title (a browser does not name a figure by its `<figcaption>`), and `label` as
|
|
43
|
+
* its name where it draws neither; while the stage scrolls sideways it is a focus stop and a group with the
|
|
44
|
+
* figure's name, and Home and End take it to either end; and the debug reports.
|
|
45
|
+
*
|
|
46
|
+
* **A figure the element builds.** A `<tanrei-figure>` that holds no `<figure>` is given one: its children become the
|
|
47
|
+
* stage, except those that name a part with `slot` (`title`, `actions`, `caption`, `attachment`), and `headline` and
|
|
48
|
+
* `caption` are written as the title and the caption. That form is drawn when the element is defined, not before; and
|
|
49
|
+
* a framework that owns the element's children (React) must write the parts itself, because the element moves them.
|
|
50
|
+
*
|
|
51
|
+
* @tag tanrei-figure
|
|
52
|
+
* @slot - The native `<figure>` — a frame (`data-part="frame"`) around an optional `<header>`, the stage (`data-part="stage"`) and an optional attachment, then an optional `<figcaption>` — or, for a figure the element builds, what is shown. A child in the document, not a slotted node: the element has no shadow root.
|
|
53
|
+
* @slot title - For a figure the element builds: the product's own title content in place of `headline` (text with inline content, or a heading of the level the page's outline needs). In the native form it is the element with `data-part="title"`.
|
|
54
|
+
* @slot actions - For a figure the element builds: the controls at the end of the header. In the native form they are the children of the element with `data-part="actions"`.
|
|
55
|
+
* @slot caption - For a figure the element builds: the product's own caption content in place of `caption`. In the native form it is the `<figcaption>`.
|
|
56
|
+
* @slot attachment - For a figure the element builds: the block joined under the stage. In the native form it is the element with `data-part="attachment"`.
|
|
57
|
+
*/
|
|
58
|
+
export declare class TanreiFigure extends ReactiveElement {
|
|
59
|
+
private readonly availability;
|
|
60
|
+
static properties: PropertyDeclarations;
|
|
61
|
+
/**
|
|
62
|
+
* The title: a short line above the stage that names what is shown ("Variants", "Revenue by quarter"). Plain text,
|
|
63
|
+
* never a heading; an element with `data-part="title"` in the figure is drawn in its place. It is the figure's
|
|
64
|
+
* accessible name. (`headline`, because HTML's global `title` would show a tooltip over the whole figure.)
|
|
65
|
+
*/
|
|
66
|
+
headline: string;
|
|
67
|
+
/** The caption: the text below the frame that says what is shown. A `<figcaption>` written in the figure is drawn in its place. The figure's name where there is no title, and its description where there is one. */
|
|
68
|
+
caption: string;
|
|
69
|
+
/** The accessible name of a figure that draws neither a title nor a caption. Never drawn; ignored where a title or a caption is given. */
|
|
70
|
+
label: string;
|
|
71
|
+
/** How the stage is set apart: `outlined` is the surface inside one hairline, `filled` a quiet tone and no edge, `plain` no fill, no edge, no padding and no line. A design system may add values. */
|
|
72
|
+
variant: TanreiFigureVariant;
|
|
73
|
+
/** Whether the stage is padded inside the frame. False (the `flush` attribute) lets a picture, a chart or a map reach the frame's edges, clipped by its corners. The plain look is never padded. */
|
|
74
|
+
inset: boolean;
|
|
75
|
+
/** How the parts inside the frame are told apart: `divider` draws a line under the header and above the attachment, `gap` draws none and stands the attachment inside the frame; `auto` takes `comp.figure.separation`, the design system's answer. */
|
|
76
|
+
separation: TanreiFigureSeparation;
|
|
77
|
+
private readonly resizes;
|
|
78
|
+
private readonly mutations;
|
|
79
|
+
/** The stage the figure has now, and what the observer of sizes watches: the stage and what stands in it. */
|
|
80
|
+
private stage;
|
|
81
|
+
private readonly watched;
|
|
82
|
+
/** The title and the caption this element wrote for `headline` and `caption`. */
|
|
83
|
+
private ownTitle;
|
|
84
|
+
private ownCaption;
|
|
85
|
+
/** What this element wrote on the figure to name it, and on the stage to make it a focus stop: only that is taken off again. */
|
|
86
|
+
private readonly named;
|
|
87
|
+
private readonly stop;
|
|
88
|
+
/** No shadow root: the figure is the document's. */
|
|
89
|
+
protected createRenderRoot(): this;
|
|
90
|
+
connectedCallback(): void;
|
|
91
|
+
disconnectedCallback(): void;
|
|
92
|
+
protected updated(changed: PropertyValues): void;
|
|
93
|
+
/**
|
|
94
|
+
* FIG-24: a look the core does not have was added by a design system — its rule is added to the root, falling back
|
|
95
|
+
* to the default's tokens — or is unknown to the active one, which a debug build says.
|
|
96
|
+
*/
|
|
97
|
+
private readVariant;
|
|
98
|
+
private within;
|
|
99
|
+
/**
|
|
100
|
+
* Reads the figure the box holds and writes what follows from it: the parts of a figure the element builds, the
|
|
101
|
+
* title and the caption the properties ask for, the name, the separation where the browser cannot query it — then
|
|
102
|
+
* measures. Called when a property changes and when the figure's content does (FIG-17); it writes only what
|
|
103
|
+
* differs, so it settles.
|
|
104
|
+
*/
|
|
105
|
+
private read;
|
|
106
|
+
/**
|
|
107
|
+
* A figure the element builds: where it holds no `<figure>`, one is written around its children — those that name a
|
|
108
|
+
* part with `slot` go to that part, everything else is the stage — and children added later go the same way.
|
|
109
|
+
*/
|
|
110
|
+
private build;
|
|
111
|
+
private made;
|
|
112
|
+
/** The frame of a figure, written around its stage where the figure has none and a part needs one. */
|
|
113
|
+
private frame;
|
|
114
|
+
private stageOf;
|
|
115
|
+
/** The header's title or actions, written where the frame has none: the title first, the actions after it. */
|
|
116
|
+
private headerPart;
|
|
117
|
+
/**
|
|
118
|
+
* FIG-8, FIG-10: the title `headline` asks for and the caption `caption` asks for, as text. Where the figure holds
|
|
119
|
+
* a title or a caption of the product's own, that one is drawn and the property ignored.
|
|
120
|
+
*/
|
|
121
|
+
private readText;
|
|
122
|
+
private titleOf;
|
|
123
|
+
private captionOf;
|
|
124
|
+
/**
|
|
125
|
+
* FIG-16: the name. The title where the figure has one, with the caption as its description; the caption where it
|
|
126
|
+
* has no title — written too: a browser does not name a figure by its `<figcaption>` in the tree it gives assistive
|
|
127
|
+
* technology — unless the product wrote a label on the figure itself, which a labelling element would take the
|
|
128
|
+
* place of; `label` where it draws neither; and a figure with none of the three has no name, which a debug build
|
|
129
|
+
* says.
|
|
130
|
+
*/
|
|
131
|
+
private readName;
|
|
132
|
+
/** Writes `wanted` on `element`, leaving alone what the product wrote there itself, and takes off only what `own` says this element wrote. */
|
|
133
|
+
private give;
|
|
134
|
+
/** The stage and what stands in it are what the sizes are read from (FIG-5): content can outgrow a stage that stays as it is. */
|
|
135
|
+
private watch;
|
|
136
|
+
/**
|
|
137
|
+
* FIG-6: while the stage scrolls sideways it is one stop in the focus order and a group with the figure's name, and
|
|
138
|
+
* neither otherwise. Called when the stage or what stands in it changes size; it reads the layout once and writes
|
|
139
|
+
* attributes of the stage alone.
|
|
140
|
+
*/
|
|
141
|
+
private measure;
|
|
142
|
+
/**
|
|
143
|
+
* FIG-6: the arrow keys scroll a focused stage as the browser scrolls a region; Home and End, which a browser gives
|
|
144
|
+
* to the page's own scroll, take the stage to its start and its end.
|
|
145
|
+
*/
|
|
146
|
+
private readonly keyed;
|
|
147
|
+
}
|
|
148
|
+
declare global {
|
|
149
|
+
interface HTMLElementTagNameMap {
|
|
150
|
+
'tanrei-figure': TanreiFigure;
|
|
151
|
+
}
|
|
152
|
+
}
|