@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,94 @@
|
|
|
1
|
+
import { LitElement, type PropertyDeclarations, type PropertyValues, nothing } from 'lit';
|
|
2
|
+
import { type ConventionReader } from '../../primitives/index.js';
|
|
3
|
+
import type { TanreiKeyboardShortcutSizeRegistry, TanreiKeyboardShortcutVariantRegistry } from '../../registry.js';
|
|
4
|
+
/** How the keys are drawn: in caps, or as a line of text. A design system may add values. */
|
|
5
|
+
export type TanreiKeyboardShortcutVariant = keyof TanreiKeyboardShortcutVariantRegistry;
|
|
6
|
+
/** The size of the caps and legends. A design system may add values. */
|
|
7
|
+
export type TanreiKeyboardShortcutSize = keyof TanreiKeyboardShortcutSizeRegistry;
|
|
8
|
+
/** Whose keyboard the keys are written for: `auto` is the nearest ancestor's `data-tanrei-keyboard-convention`, else the platform's. */
|
|
9
|
+
export type TanreiKeyboardShortcutConvention = 'auto' | 'apple' | 'standard';
|
|
10
|
+
/**
|
|
11
|
+
* Shows the keys that perform a command, as keys or as text, in the modifier symbols and names of the keyboard the
|
|
12
|
+
* person is using, read aloud in the product's own words.
|
|
13
|
+
*
|
|
14
|
+
* Contract: specs/keyboard-shortcut.spec.json. Write the keys once, in neutral names — `<tanrei-keyboard-shortcut
|
|
15
|
+
* keys="mod+shift+k">` draws ⇧⌘K on Apple platforms and Ctrl+Shift+K elsewhere; `keys="mod+k mod+c"` is a sequence of
|
|
16
|
+
* two chords. It only shows keys: it takes no focus and no input, and does not make them work (KBS-14). Every visual value
|
|
17
|
+
* is a `--tanrei-comp-keyboard-shortcut-*` token.
|
|
18
|
+
*
|
|
19
|
+
* What is drawn is hidden from assistive technology; one visually hidden text is read in its place, where the shortcut
|
|
20
|
+
* sits: `label`, the shortcut in the product's own words ("Shift Command K", KBS-10) — and without it the notation of
|
|
21
|
+
* `aria-keyshortcuts` ("Meta+Shift+K", KBS-11), because Tanrei has no names for keys in any language. The convention is `convention`, or under
|
|
22
|
+
* `auto` the nearest ancestor's `data-tanrei-keyboard-convention` (`apple` or `standard`), else the platform's (KBS-2).
|
|
23
|
+
*
|
|
24
|
+
* @tag tanrei-keyboard-shortcut
|
|
25
|
+
* @csspart sequence - The chords, in order, a sequence gap apart (hidden from assistive technology).
|
|
26
|
+
* @csspart chord - The `<kbd>` of one chord: the keys pressed together.
|
|
27
|
+
* @csspart container - One key's `<kbd>`: its cap in the keycap form.
|
|
28
|
+
* @csspart label - A key's legend.
|
|
29
|
+
* @csspart separator - The + between two keys of a chord in the standard convention.
|
|
30
|
+
* @cssprop --tanrei-comp-keyboard-shortcut-container-color - A cap's fill.
|
|
31
|
+
* @cssprop --tanrei-comp-keyboard-shortcut-outline-color - A cap's edge.
|
|
32
|
+
*/
|
|
33
|
+
export declare class TanreiKeyboardShortcut extends LitElement implements ConventionReader {
|
|
34
|
+
private readonly availability;
|
|
35
|
+
private readonly axes;
|
|
36
|
+
static styles: import("lit").CSSResult;
|
|
37
|
+
static properties: PropertyDeclarations;
|
|
38
|
+
/**
|
|
39
|
+
* The shortcut: one chord per string, pressed in order. A chord is key names joined by + (`mod+shift+k`): the modifiers
|
|
40
|
+
* mod (Command on Apple platforms, Control elsewhere), ctrl, alt and shift; the named keys enter, escape, tab,
|
|
41
|
+
* backspace, delete, space, arrow-up, arrow-down, arrow-left, arrow-right, home, end, page-up, page-down, caps-lock,
|
|
42
|
+
* f1 to f24 and plus; any other single character is that character's key. Names ignore case. The attribute holds the
|
|
43
|
+
* chords separated by spaces (`keys="mod+k mod+c"`).
|
|
44
|
+
*/
|
|
45
|
+
keys: string[];
|
|
46
|
+
/** How the keys are drawn: `keycap` puts each key in its own cap; `plain` writes the shortcut as a line of text. */
|
|
47
|
+
variant: TanreiKeyboardShortcutVariant;
|
|
48
|
+
/** `small` (20 caps, 12 text) sits in a line of body text or a menu row; `medium` (24 caps, 14 text) beside larger text. */
|
|
49
|
+
size: TanreiKeyboardShortcutSize;
|
|
50
|
+
/** Whose keyboard the keys are written for: `apple`, `standard`, or `auto` — the nearest ancestor's, else the platform's. */
|
|
51
|
+
convention: TanreiKeyboardShortcutConvention;
|
|
52
|
+
/** What assistive technology reads in place of the drawn keys: the shortcut in the product's own words ("Shift Command K"). Tanrei has no names for keys: without it the notation of `aria-keyshortcuts` is read ("Meta+Shift+K"). */
|
|
53
|
+
label: string;
|
|
54
|
+
/** Fades the legends, for the shortcut of a command that is unavailable. The keys still show. */
|
|
55
|
+
disabled: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @internal KBS-13: drawn in a part of another component (a menu item's trailing column), which exposes the shortcut
|
|
58
|
+
* itself: the legends take the part's text style and color (they inherit the host element's `font`, `letter-spacing`
|
|
59
|
+
* and `color`), and nothing is exposed to assistive technology.
|
|
60
|
+
*/
|
|
61
|
+
hosted: boolean;
|
|
62
|
+
/** The convention the keys are written in now (KBS-2). */
|
|
63
|
+
private resolved;
|
|
64
|
+
connectedCallback(): void;
|
|
65
|
+
disconnectedCallback(): void;
|
|
66
|
+
/** @internal KBS-2: an ancestor's `data-tanrei-keyboard-convention` changed somewhere; read it again. */
|
|
67
|
+
conventionChanged(): void;
|
|
68
|
+
/** KBS-2: `convention`, or under `auto` the nearest ancestor's, else the platform's — never the design system's. */
|
|
69
|
+
private resolveConvention;
|
|
70
|
+
/** The chords as drawn now, and what is wrong with each. */
|
|
71
|
+
private write;
|
|
72
|
+
/**
|
|
73
|
+
* KBS-12: the shortcut in the form `aria-keyshortcuts` takes — each chord's modifiers then its key joined by +, mod as
|
|
74
|
+
* Meta under the apple convention and Control under the standard one, the chords separated by spaces (`Meta+Shift+K`;
|
|
75
|
+
* `Control+K Control+C`) — or null without keys. Read-only: a component that hosts the shortcut (a menu item) sets it on
|
|
76
|
+
* its own element. The shortcut itself sets no `aria-keyshortcuts`: it only shows keys.
|
|
77
|
+
*/
|
|
78
|
+
get ariaKeyShortcuts(): string | null;
|
|
79
|
+
/**
|
|
80
|
+
* @internal KBS-10, KBS-11: what is read in place of the keys — `label`, the product's words, else the notation of
|
|
81
|
+
* `aria-keyshortcuts` ("Control+Backspace"), a standard's and the same in every language — for a component that hosts
|
|
82
|
+
* the shortcut and has to say it itself (a menu item without the property, MNU-24; a tooltip whose anchor states
|
|
83
|
+
* its own `aria-keyshortcuts`, TIP-27). Empty without keys.
|
|
84
|
+
*/
|
|
85
|
+
get spokenKeys(): string;
|
|
86
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
87
|
+
protected updated(changed: PropertyValues): void;
|
|
88
|
+
protected render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
89
|
+
}
|
|
90
|
+
declare global {
|
|
91
|
+
interface HTMLElementTagNameMap {
|
|
92
|
+
'tanrei-keyboard-shortcut': TanreiKeyboardShortcut;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
|
+
import { AvailabilityController, OpenAxesController, SHORTCUT_UPDATE, ambientConvention, chordsConverter, chordsOf, hostAria, notifyItemUpdate, platformConvention, report, unwatchConvention, watchConvention, } from '../../primitives/index.js';
|
|
3
|
+
import { AXES, styles } from './keyboard-shortcut.styles.js';
|
|
4
|
+
const CONVENTIONS = ['auto', 'apple', 'standard'];
|
|
5
|
+
const MODIFIERS = ['mod', 'ctrl', 'alt', 'shift'];
|
|
6
|
+
const same = (text) => ({ apple: text, standard: text });
|
|
7
|
+
const key = (legend, aria) => ({
|
|
8
|
+
legend: typeof legend === 'string' ? same(legend) : legend,
|
|
9
|
+
aria: typeof aria === 'string' ? same(aria) : aria,
|
|
10
|
+
});
|
|
11
|
+
/** KBS-3, KBS-4, KBS-12: the modifiers. */
|
|
12
|
+
const MODIFIER_FORMS = {
|
|
13
|
+
mod: key({ apple: '⌘', standard: 'Ctrl' }, { apple: 'Meta', standard: 'Control' }),
|
|
14
|
+
ctrl: key({ apple: '⌃', standard: 'Ctrl' }, 'Control'),
|
|
15
|
+
alt: key({ apple: '⌥', standard: 'Alt' }, 'Alt'),
|
|
16
|
+
shift: key({ apple: '⇧', standard: 'Shift' }, 'Shift'),
|
|
17
|
+
};
|
|
18
|
+
/** KBS-3, KBS-4: the order modifiers are drawn and read in, whatever order keys gives. */
|
|
19
|
+
const DRAWN_ORDER = {
|
|
20
|
+
apple: ['ctrl', 'alt', 'shift', 'mod'],
|
|
21
|
+
standard: ['mod', 'ctrl', 'alt', 'shift'],
|
|
22
|
+
};
|
|
23
|
+
/** KBS-12: the order of the modifiers in `aria-keyshortcuts` (Meta+Shift+K), as KBS-12 lists them. */
|
|
24
|
+
const ARIA_ORDER = ['mod', 'ctrl', 'alt', 'shift'];
|
|
25
|
+
/** KBS-1, KBS-3, KBS-4, KBS-12: the named keys. */
|
|
26
|
+
const NAMED = {
|
|
27
|
+
enter: key({ apple: '↩', standard: 'Enter' }, 'Enter'),
|
|
28
|
+
escape: key({ apple: '⎋', standard: 'Esc' }, 'Escape'),
|
|
29
|
+
tab: key({ apple: '⇥', standard: 'Tab' }, 'Tab'),
|
|
30
|
+
backspace: key({ apple: '⌫', standard: 'Backspace' }, 'Backspace'),
|
|
31
|
+
delete: key({ apple: '⌦', standard: 'Delete' }, 'Delete'),
|
|
32
|
+
space: key('Space', 'Space'),
|
|
33
|
+
'arrow-up': key('↑', 'ArrowUp'),
|
|
34
|
+
'arrow-down': key('↓', 'ArrowDown'),
|
|
35
|
+
'arrow-left': key('←', 'ArrowLeft'),
|
|
36
|
+
'arrow-right': key('→', 'ArrowRight'),
|
|
37
|
+
home: key({ apple: '↖', standard: 'Home' }, 'Home'),
|
|
38
|
+
end: key({ apple: '↘', standard: 'End' }, 'End'),
|
|
39
|
+
'page-up': key({ apple: '⇞', standard: 'PgUp' }, 'PageUp'),
|
|
40
|
+
'page-down': key({ apple: '⇟', standard: 'PgDn' }, 'PageDown'),
|
|
41
|
+
'caps-lock': key({ apple: '⇪', standard: 'Caps Lock' }, 'CapsLock'),
|
|
42
|
+
plus: key('+', 'Plus'),
|
|
43
|
+
...Object.fromEntries(Array.from({ length: 24 }, (_, i) => [`f${i + 1}`, key(`F${i + 1}`, `F${i + 1}`)])),
|
|
44
|
+
};
|
|
45
|
+
/** KBS-5: a letter key is its capital letter; any other character is as given. */
|
|
46
|
+
const capital = (char) => {
|
|
47
|
+
if (!/\p{L}/u.test(char))
|
|
48
|
+
return char;
|
|
49
|
+
const upper = char.toUpperCase();
|
|
50
|
+
return [...upper].length === 1 ? upper : char;
|
|
51
|
+
};
|
|
52
|
+
/** KBS-1, KBS-18: one key other than a modifier — named, a character, or an unknown name drawn as given. */
|
|
53
|
+
function keyForms(name) {
|
|
54
|
+
const named = NAMED[name.toLowerCase()];
|
|
55
|
+
if (named)
|
|
56
|
+
return { forms: named, unknown: false };
|
|
57
|
+
if ([...name].length === 1) {
|
|
58
|
+
const char = capital(name);
|
|
59
|
+
return { forms: key(char, char), unknown: false };
|
|
60
|
+
}
|
|
61
|
+
return { forms: key(name, name), unknown: true };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* KBS-1, KBS-3…5, KBS-18: a chord ("mod+shift+k") as the convention writes it — each modifier once, in the convention's
|
|
65
|
+
* order, then each other key once, in order — and what is wrong with it (reported in debug builds).
|
|
66
|
+
*/
|
|
67
|
+
function writeChord(chord, convention) {
|
|
68
|
+
const names = chord.split('+').map((name) => name.trim());
|
|
69
|
+
const problems = [];
|
|
70
|
+
const modifiers = new Set();
|
|
71
|
+
const others = [];
|
|
72
|
+
let repeated = false;
|
|
73
|
+
for (const name of names) {
|
|
74
|
+
if (!name)
|
|
75
|
+
continue;
|
|
76
|
+
const lower = name.toLowerCase();
|
|
77
|
+
if (MODIFIERS.includes(lower)) {
|
|
78
|
+
if (modifiers.has(lower))
|
|
79
|
+
repeated = true;
|
|
80
|
+
modifiers.add(lower);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const { forms, unknown } = keyForms(name);
|
|
84
|
+
if (unknown)
|
|
85
|
+
problems.push(`the key "${name}" is not a key name; it is drawn as given`);
|
|
86
|
+
if (others.some((other) => other.legend[convention] === forms.legend[convention]))
|
|
87
|
+
repeated = true;
|
|
88
|
+
else
|
|
89
|
+
others.push(forms);
|
|
90
|
+
}
|
|
91
|
+
// A modifier the convention writes like another (ctrl and mod are both Ctrl in the standard convention) is drawn once.
|
|
92
|
+
const drawnModifiers = [];
|
|
93
|
+
for (const modifier of DRAWN_ORDER[convention]) {
|
|
94
|
+
if (!modifiers.has(modifier))
|
|
95
|
+
continue;
|
|
96
|
+
const forms = MODIFIER_FORMS[modifier];
|
|
97
|
+
if (drawnModifiers.some((each) => each.legend[convention] === forms.legend[convention]))
|
|
98
|
+
repeated = true;
|
|
99
|
+
else
|
|
100
|
+
drawnModifiers.push(forms);
|
|
101
|
+
}
|
|
102
|
+
const aria = [];
|
|
103
|
+
for (const modifier of ARIA_ORDER) {
|
|
104
|
+
const name = MODIFIER_FORMS[modifier].aria[convention];
|
|
105
|
+
if (modifiers.has(modifier) && !aria.includes(name))
|
|
106
|
+
aria.push(name);
|
|
107
|
+
}
|
|
108
|
+
aria.push(...others.map((forms) => forms.aria[convention]));
|
|
109
|
+
if (!names.some(Boolean))
|
|
110
|
+
problems.push('a chord is empty');
|
|
111
|
+
else if (!others.length)
|
|
112
|
+
problems.push('it holds only modifiers');
|
|
113
|
+
if (others.length > 1)
|
|
114
|
+
problems.push('it holds more than one key other than modifiers');
|
|
115
|
+
if (repeated)
|
|
116
|
+
problems.push('it names a key twice once the convention has written it');
|
|
117
|
+
const keys = [...drawnModifiers, ...others].map((forms) => ({ legend: forms.legend[convention] }));
|
|
118
|
+
return { drawn: { keys, aria: aria.join('+') }, problems };
|
|
119
|
+
}
|
|
120
|
+
// ── The element ─────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
121
|
+
/**
|
|
122
|
+
* Shows the keys that perform a command, as keys or as text, in the modifier symbols and names of the keyboard the
|
|
123
|
+
* person is using, read aloud in the product's own words.
|
|
124
|
+
*
|
|
125
|
+
* Contract: specs/keyboard-shortcut.spec.json. Write the keys once, in neutral names — `<tanrei-keyboard-shortcut
|
|
126
|
+
* keys="mod+shift+k">` draws ⇧⌘K on Apple platforms and Ctrl+Shift+K elsewhere; `keys="mod+k mod+c"` is a sequence of
|
|
127
|
+
* two chords. It only shows keys: it takes no focus and no input, and does not make them work (KBS-14). Every visual value
|
|
128
|
+
* is a `--tanrei-comp-keyboard-shortcut-*` token.
|
|
129
|
+
*
|
|
130
|
+
* What is drawn is hidden from assistive technology; one visually hidden text is read in its place, where the shortcut
|
|
131
|
+
* sits: `label`, the shortcut in the product's own words ("Shift Command K", KBS-10) — and without it the notation of
|
|
132
|
+
* `aria-keyshortcuts` ("Meta+Shift+K", KBS-11), because Tanrei has no names for keys in any language. The convention is `convention`, or under
|
|
133
|
+
* `auto` the nearest ancestor's `data-tanrei-keyboard-convention` (`apple` or `standard`), else the platform's (KBS-2).
|
|
134
|
+
*
|
|
135
|
+
* @tag tanrei-keyboard-shortcut
|
|
136
|
+
* @csspart sequence - The chords, in order, a sequence gap apart (hidden from assistive technology).
|
|
137
|
+
* @csspart chord - The `<kbd>` of one chord: the keys pressed together.
|
|
138
|
+
* @csspart container - One key's `<kbd>`: its cap in the keycap form.
|
|
139
|
+
* @csspart label - A key's legend.
|
|
140
|
+
* @csspart separator - The + between two keys of a chord in the standard convention.
|
|
141
|
+
* @cssprop --tanrei-comp-keyboard-shortcut-container-color - A cap's fill.
|
|
142
|
+
* @cssprop --tanrei-comp-keyboard-shortcut-outline-color - A cap's edge.
|
|
143
|
+
*/
|
|
144
|
+
export class TanreiKeyboardShortcut extends LitElement {
|
|
145
|
+
constructor() {
|
|
146
|
+
super(...arguments);
|
|
147
|
+
this.availability = new AvailabilityController(this, 'keyboard-shortcut');
|
|
148
|
+
this.axes = new OpenAxesController(this, { component: 'keyboard-shortcut', behavior: 'KBS-6', axes: AXES });
|
|
149
|
+
/**
|
|
150
|
+
* The shortcut: one chord per string, pressed in order. A chord is key names joined by + (`mod+shift+k`): the modifiers
|
|
151
|
+
* mod (Command on Apple platforms, Control elsewhere), ctrl, alt and shift; the named keys enter, escape, tab,
|
|
152
|
+
* backspace, delete, space, arrow-up, arrow-down, arrow-left, arrow-right, home, end, page-up, page-down, caps-lock,
|
|
153
|
+
* f1 to f24 and plus; any other single character is that character's key. Names ignore case. The attribute holds the
|
|
154
|
+
* chords separated by spaces (`keys="mod+k mod+c"`).
|
|
155
|
+
*/
|
|
156
|
+
this.keys = [];
|
|
157
|
+
/** How the keys are drawn: `keycap` puts each key in its own cap; `plain` writes the shortcut as a line of text. */
|
|
158
|
+
this.variant = 'keycap';
|
|
159
|
+
/** `small` (20 caps, 12 text) sits in a line of body text or a menu row; `medium` (24 caps, 14 text) beside larger text. */
|
|
160
|
+
this.size = 'medium';
|
|
161
|
+
/** Whose keyboard the keys are written for: `apple`, `standard`, or `auto` — the nearest ancestor's, else the platform's. */
|
|
162
|
+
this.convention = 'auto';
|
|
163
|
+
/** What assistive technology reads in place of the drawn keys: the shortcut in the product's own words ("Shift Command K"). Tanrei has no names for keys: without it the notation of `aria-keyshortcuts` is read ("Meta+Shift+K"). */
|
|
164
|
+
this.label = '';
|
|
165
|
+
/** Fades the legends, for the shortcut of a command that is unavailable. The keys still show. */
|
|
166
|
+
this.disabled = false;
|
|
167
|
+
/**
|
|
168
|
+
* @internal KBS-13: drawn in a part of another component (a menu item's trailing column), which exposes the shortcut
|
|
169
|
+
* itself: the legends take the part's text style and color (they inherit the host element's `font`, `letter-spacing`
|
|
170
|
+
* and `color`), and nothing is exposed to assistive technology.
|
|
171
|
+
*/
|
|
172
|
+
this.hosted = false;
|
|
173
|
+
/** The convention the keys are written in now (KBS-2). */
|
|
174
|
+
this.resolved = 'standard';
|
|
175
|
+
}
|
|
176
|
+
static { this.styles = styles; }
|
|
177
|
+
static { this.properties = {
|
|
178
|
+
keys: { converter: chordsConverter },
|
|
179
|
+
variant: { type: String, reflect: true },
|
|
180
|
+
size: { type: String, reflect: true },
|
|
181
|
+
convention: { type: String, reflect: true },
|
|
182
|
+
label: { type: String },
|
|
183
|
+
disabled: { type: Boolean, reflect: true },
|
|
184
|
+
hosted: { type: Boolean, attribute: false },
|
|
185
|
+
resolved: { state: true },
|
|
186
|
+
}; }
|
|
187
|
+
connectedCallback() {
|
|
188
|
+
super.connectedCallback();
|
|
189
|
+
watchConvention(this, this);
|
|
190
|
+
this.resolved = this.resolveConvention();
|
|
191
|
+
}
|
|
192
|
+
disconnectedCallback() {
|
|
193
|
+
super.disconnectedCallback();
|
|
194
|
+
unwatchConvention(this);
|
|
195
|
+
}
|
|
196
|
+
/** @internal KBS-2: an ancestor's `data-tanrei-keyboard-convention` changed somewhere; read it again. */
|
|
197
|
+
conventionChanged() {
|
|
198
|
+
const now = this.resolveConvention();
|
|
199
|
+
if (now !== this.resolved)
|
|
200
|
+
this.resolved = now;
|
|
201
|
+
}
|
|
202
|
+
/** KBS-2: `convention`, or under `auto` the nearest ancestor's, else the platform's — never the design system's. */
|
|
203
|
+
resolveConvention() {
|
|
204
|
+
const convention = this.convention;
|
|
205
|
+
if (convention === 'apple' || convention === 'standard')
|
|
206
|
+
return convention;
|
|
207
|
+
return (this.isConnected ? ambientConvention(this) : null) ?? platformConvention();
|
|
208
|
+
}
|
|
209
|
+
/** The chords as drawn now, and what is wrong with each. */
|
|
210
|
+
write(convention = this.resolveConvention()) {
|
|
211
|
+
return chordsOf(this.keys).map((chord) => ({ chord, ...writeChord(chord, convention) }));
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* KBS-12: the shortcut in the form `aria-keyshortcuts` takes — each chord's modifiers then its key joined by +, mod as
|
|
215
|
+
* Meta under the apple convention and Control under the standard one, the chords separated by spaces (`Meta+Shift+K`;
|
|
216
|
+
* `Control+K Control+C`) — or null without keys. Read-only: a component that hosts the shortcut (a menu item) sets it on
|
|
217
|
+
* its own element. The shortcut itself sets no `aria-keyshortcuts`: it only shows keys.
|
|
218
|
+
*/
|
|
219
|
+
get ariaKeyShortcuts() {
|
|
220
|
+
const chords = this.write()
|
|
221
|
+
.map(({ drawn }) => drawn.aria)
|
|
222
|
+
.filter(Boolean);
|
|
223
|
+
return chords.length ? chords.join(' ') : null;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* @internal KBS-10, KBS-11: what is read in place of the keys — `label`, the product's words, else the notation of
|
|
227
|
+
* `aria-keyshortcuts` ("Control+Backspace"), a standard's and the same in every language — for a component that hosts
|
|
228
|
+
* the shortcut and has to say it itself (a menu item without the property, MNU-24; a tooltip whose anchor states
|
|
229
|
+
* its own `aria-keyshortcuts`, TIP-27). Empty without keys.
|
|
230
|
+
*/
|
|
231
|
+
get spokenKeys() {
|
|
232
|
+
return this.label.trim() || (this.ariaKeyShortcuts ?? '');
|
|
233
|
+
}
|
|
234
|
+
willUpdate(changed) {
|
|
235
|
+
if (changed.has('convention') && !CONVENTIONS.includes(this.convention)) {
|
|
236
|
+
report(this, 'KBS-2', `convention "${this.convention}" is not auto, apple or standard; it is read as auto`);
|
|
237
|
+
}
|
|
238
|
+
if (changed.has('convention') && this.isConnected)
|
|
239
|
+
this.resolved = this.resolveConvention();
|
|
240
|
+
// KBS-18: what is drawn as it can be is reported in debug builds, chord by chord.
|
|
241
|
+
if (changed.has('keys') || changed.has('resolved')) {
|
|
242
|
+
for (const { chord, problems } of this.write(this.resolved)) {
|
|
243
|
+
for (const problem of problems)
|
|
244
|
+
report(this, 'KBS-18', `the chord "${chord}": ${problem}`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
updated(changed) {
|
|
249
|
+
// KBS-11: a shortcut that is read where it sits, and has no words of the product's, reads the notation; the
|
|
250
|
+
// developer is told once. (A hosted one is said by its host, which has no label to give it.)
|
|
251
|
+
if (!this.hosted && !this.label.trim() && this.ariaKeyShortcuts) {
|
|
252
|
+
report(this, 'KBS-11', 'label is empty, so the shortcut is read in the notation of aria-keyshortcuts; give it the shortcut in the product\'s own words ("Shift Command K"): Tanrei has no names for keys');
|
|
253
|
+
}
|
|
254
|
+
// KBS-13: a hosted shortcut exposes nothing (the host exposes it); KBS-10: otherwise the one hidden text is read.
|
|
255
|
+
if (changed.has('hosted'))
|
|
256
|
+
hostAria(this, { 'aria-hidden': this.hosted ? 'true' : null });
|
|
257
|
+
// KBS-12: the host re-reads the form when the convention changes without it (an ancestor's attribute).
|
|
258
|
+
if (changed.has('resolved') && changed.get('resolved') !== undefined)
|
|
259
|
+
notifyItemUpdate(this, SHORTCUT_UPDATE);
|
|
260
|
+
}
|
|
261
|
+
render() {
|
|
262
|
+
const convention = this.resolved;
|
|
263
|
+
const chords = this.write(convention)
|
|
264
|
+
.map(({ drawn }) => drawn)
|
|
265
|
+
.filter((chord) => chord.keys.length);
|
|
266
|
+
// KBS-18: no keys draw nothing and expose nothing.
|
|
267
|
+
if (!chords.length)
|
|
268
|
+
return nothing;
|
|
269
|
+
// KBS-4, KBS-7: the standard convention joins a chord's keys with +; Apple's writes none.
|
|
270
|
+
const separator = convention === 'standard';
|
|
271
|
+
// KBS-10, KBS-11: the product's words, else the notation; never a name of a key of Tanrei's.
|
|
272
|
+
const spoken = this.spokenKeys;
|
|
273
|
+
// KBS-6…8, KBS-10, KBS-15, KBS-16: a <kbd> per chord holding a <kbd> per key, hidden; the text read in their place.
|
|
274
|
+
return html `${this.hosted ? nothing : html `<span class="spoken">${spoken}</span>`}<span part="sequence" class=${this.hosted ? 'sequence hosted' : 'sequence'} aria-hidden="true"
|
|
275
|
+
>${chords.map((chord) => html `<kbd part="chord" class="chord"
|
|
276
|
+
>${chord.keys.map((k, i) => html `${separator && i > 0 ? html `<span part="separator" class="separator">+</span>` : nothing}<kbd part="container" class="key" data-tanrei-shape
|
|
277
|
+
><span part="label" class="label">${k.legend}</span></kbd
|
|
278
|
+
>`)}</kbd
|
|
279
|
+
>`)}</span
|
|
280
|
+
>`;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (!customElements.get('tanrei-keyboard-shortcut'))
|
|
284
|
+
customElements.define('tanrei-keyboard-shortcut', TanreiKeyboardShortcut);
|
|
285
|
+
//# sourceMappingURL=keyboard-shortcut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard-shortcut.js","sourceRoot":"","sources":["../../../src/components/keyboard-shortcut/keyboard-shortcut.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkD,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChG,OAAO,EACL,sBAAsB,EAGtB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,MAAM,EACN,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAS7D,MAAM,WAAW,GAAgD,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAK/F,MAAM,SAAS,GAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAgBvE,MAAM,IAAI,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1E,MAAM,GAAG,GAAG,CAAC,MAAwB,EAAE,IAAsB,EAAY,EAAE,CAAC,CAAC;IAC3E,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC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,IAAI,CAAA,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA,wBAAwB,MAAM,SAAS,+BAA+B,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,UAAU;WACrJ,MAAM,CAAC,GAAG,CACX,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,CAAA;iBACC,KAAK,CAAC,IAAI,CAAC,GAAG,CACf,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACP,IAAI,CAAA,GAAG,SAAS,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,mDAAmD,CAAC,CAAC,CAAC,OAAO;0DACrD,CAAC,CAAC,MAAM;sBAC5C,CACP;cACD,CACL;QACD,CAAC;IACP,CAAC;CACF;AAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAAE,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OpenAxis } from '../../primitives/index.js';
|
|
2
|
+
/** The values every design system has. A layer may add more; those get their styles on demand. */
|
|
3
|
+
export declare const CORE_VARIANTS: readonly ['keycap', 'plain'];
|
|
4
|
+
export declare const CORE_SIZES: readonly ['small', 'medium'];
|
|
5
|
+
/**
|
|
6
|
+
* The open axes: a size or variant a layer added gets its block on demand, built by the same functions as the
|
|
7
|
+
* core blocks and falling back to the default's tokens; a value the active system lacks is reported in debug builds. A
|
|
8
|
+
* variant a layer adds is drawn in caps; only `plain` draws none (KBS-7).
|
|
9
|
+
*/
|
|
10
|
+
export declare const AXES: readonly OpenAxis[];
|
|
11
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { cornerRadius, shape } from '../../styles/shape.js';
|
|
3
|
+
// Every visual value is a token (tokens/comp/keyboard-shortcut.tokens.json). The shortcut is not a control: it has one
|
|
4
|
+
// state besides rest, disabled, which fades the legends of its variant and keeps the caps at rest (KBS-9).
|
|
5
|
+
/** The values every design system has. A layer may add more; those get their styles on demand. */
|
|
6
|
+
export const CORE_VARIANTS = ['keycap', 'plain'];
|
|
7
|
+
export const CORE_SIZES = ['small', 'medium'];
|
|
8
|
+
const DEFAULT_VARIANT = 'keycap';
|
|
9
|
+
const DEFAULT_SIZE = 'medium';
|
|
10
|
+
/** The members of the size axis (`dev.tanrei.axes.size.members`). */
|
|
11
|
+
const SIZE_MEMBERS = {
|
|
12
|
+
height: 'container-height',
|
|
13
|
+
pad: 'container-padding-inline',
|
|
14
|
+
shape: 'container-shape',
|
|
15
|
+
font: 'label-typescale',
|
|
16
|
+
chord: 'chord-gap',
|
|
17
|
+
sequence: 'sequence-gap',
|
|
18
|
+
};
|
|
19
|
+
const PREFIX = '--tanrei-comp-keyboard-shortcut';
|
|
20
|
+
const T = (name) => unsafeCSS(`var(${PREFIX}-${name})`);
|
|
21
|
+
// A value the core does not have may be missing from the active design system: fall back to the default's token.
|
|
22
|
+
const ref = (name, key, fallback) => (fallback ? `var(${name(key)}, var(${name(fallback)}))` : `var(${name(key)})`);
|
|
23
|
+
// The corner is a member of the size axis, so its pill mark (the emitter's `<token>-pill`) travels with it:
|
|
24
|
+
// `cornerRadius('--_shape')` reads `--_shape` and `--_shape-pill`. The legend's text role is used whole.
|
|
25
|
+
const sizeBlock = (size, selector, fallback = null) => `${selector} {\n${Object.entries(SIZE_MEMBERS)
|
|
26
|
+
.flatMap(([key, member]) => {
|
|
27
|
+
if (member === 'label-typescale') {
|
|
28
|
+
return [` --_font: ${ref((v) => `${PREFIX}-${member}-${v}-font`, size, fallback)};`, ` --_tracking: ${ref((v) => `${PREFIX}-${member}-${v}-letter-spacing`, size, fallback)};`];
|
|
29
|
+
}
|
|
30
|
+
const line = ` --_${key}: ${ref((v) => `${PREFIX}-${member}-${v}`, size, fallback)};`;
|
|
31
|
+
return member === 'container-shape' ? [line, ` --_${key}-pill: ${ref((v) => `${PREFIX}-${member}-${v}-pill`, size, fallback)};`] : [line];
|
|
32
|
+
})
|
|
33
|
+
.join('\n')}\n}`;
|
|
34
|
+
// The legend's color of each variant (`perVariant: label.color`), at rest and disabled.
|
|
35
|
+
const variantBlock = (variant, selector, fallback = null) => `${selector} {
|
|
36
|
+
--_legend: ${ref((v) => `${PREFIX}-${v}-label-color`, variant, fallback)};
|
|
37
|
+
--_legend-d: ${ref((v) => `${PREFIX}-${v}-disabled-label-color`, variant, fallback)};
|
|
38
|
+
}`;
|
|
39
|
+
/**
|
|
40
|
+
* The open axes: a size or variant a layer added gets its block on demand, built by the same functions as the
|
|
41
|
+
* core blocks and falling back to the default's tokens; a value the active system lacks is reported in debug builds. A
|
|
42
|
+
* variant a layer adds is drawn in caps; only `plain` draws none (KBS-7).
|
|
43
|
+
*/
|
|
44
|
+
export const AXES = [
|
|
45
|
+
{ name: 'size', core: CORE_SIZES, default: DEFAULT_SIZE, rules: (value, selector) => sizeBlock(value, selector, DEFAULT_SIZE), probe: (value) => `${PREFIX}-container-height-${value}` },
|
|
46
|
+
{ name: 'variant', core: CORE_VARIANTS, default: DEFAULT_VARIANT, rules: (value, selector) => variantBlock(value, selector, DEFAULT_VARIANT), probe: (value) => `${PREFIX}-${value}-label-color` },
|
|
47
|
+
];
|
|
48
|
+
const CAPS = ":host(:not([variant='plain'])) .key";
|
|
49
|
+
export const styles = css `
|
|
50
|
+
/* KBS-15: inline with the text around it, the legends on its baseline; KBS-16: left to right, isolated from the
|
|
51
|
+
surrounding direction. */
|
|
52
|
+
:host {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
position: relative;
|
|
55
|
+
align-items: baseline;
|
|
56
|
+
vertical-align: baseline;
|
|
57
|
+
max-inline-size: 100%;
|
|
58
|
+
direction: ltr;
|
|
59
|
+
unicode-bidi: isolate;
|
|
60
|
+
}
|
|
61
|
+
:host([hidden]) {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
${unsafeCSS(sizeBlock(DEFAULT_SIZE, ':host'))}
|
|
65
|
+
${unsafeCSS(CORE_SIZES.filter((size) => size !== DEFAULT_SIZE).map((size) => sizeBlock(size, `:host([size='${size}'])`)).join('\n'))}
|
|
66
|
+
${unsafeCSS(variantBlock(DEFAULT_VARIANT, ':host'))}
|
|
67
|
+
${unsafeCSS(CORE_VARIANTS.filter((v) => v !== DEFAULT_VARIANT).map((v) => variantBlock(v, `:host([variant='${v}'])`)).join('\n'))}
|
|
68
|
+
|
|
69
|
+
/* KBS-10: the one text read in place of the drawn keys, never drawn. */
|
|
70
|
+
.spoken {
|
|
71
|
+
position: absolute;
|
|
72
|
+
inline-size: 1px;
|
|
73
|
+
block-size: 1px;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
clip-path: inset(50%);
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* KBS-8, KBS-15: the chords in order, a sequence gap apart, breaking a line only between chords. */
|
|
80
|
+
.sequence {
|
|
81
|
+
display: inline-flex;
|
|
82
|
+
flex-wrap: wrap;
|
|
83
|
+
align-items: baseline;
|
|
84
|
+
column-gap: var(--_sequence);
|
|
85
|
+
row-gap: var(--_chord);
|
|
86
|
+
max-inline-size: 100%;
|
|
87
|
+
}
|
|
88
|
+
kbd {
|
|
89
|
+
font: inherit;
|
|
90
|
+
}
|
|
91
|
+
/* KBS-6, KBS-15: the keys of a chord, a chord gap apart (the separator between them where the convention writes one),
|
|
92
|
+
their legends on one baseline, never broken across lines. */
|
|
93
|
+
.chord {
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
align-items: baseline;
|
|
96
|
+
column-gap: var(--_chord);
|
|
97
|
+
white-space: nowrap;
|
|
98
|
+
}
|
|
99
|
+
.key {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
}
|
|
104
|
+
/* KBS-6: a cap at least its size's height tall and as wide as tall, growing with its legend (KBS-15), the legend centered
|
|
105
|
+
with the size's padding on each side; its fill, and its edge inside its size — the deeper edge at its bottom — and the
|
|
106
|
+
size's corners eased by the smoothing. The edge is a border of the tokens' widths and nothing else: a width of 0
|
|
107
|
+
(both, in the default system) is no border at all — no least width is applied — and the cap is its fill alone. */
|
|
108
|
+
${unsafeCSS(CAPS)} {
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
min-block-size: var(--_height);
|
|
111
|
+
min-inline-size: var(--_height);
|
|
112
|
+
padding-inline: var(--_pad);
|
|
113
|
+
background: ${T('container-color')};
|
|
114
|
+
border: ${T('outline-width')} solid ${T('outline-color')};
|
|
115
|
+
border-block-end-width: ${T('outline-bottom-width')};
|
|
116
|
+
${unsafeCSS(cornerRadius('--_shape'))}
|
|
117
|
+
}
|
|
118
|
+
${shape}
|
|
119
|
+
|
|
120
|
+
/* KBS-6, KBS-7: the legends and the separators in the size's text role and the variant's legend color. */
|
|
121
|
+
.label,
|
|
122
|
+
.separator {
|
|
123
|
+
font: var(--_font);
|
|
124
|
+
letter-spacing: var(--_tracking);
|
|
125
|
+
color: var(--_legend);
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
}
|
|
128
|
+
/* KBS-7: the plain form writes each chord as one run of text: no cap, fill or edge, and nothing between the keys. */
|
|
129
|
+
:host([variant='plain']) .chord {
|
|
130
|
+
column-gap: 0;
|
|
131
|
+
}
|
|
132
|
+
/* KBS-9: disabled fades the legends and separators; the caps stay at rest. */
|
|
133
|
+
:host([disabled]) .label,
|
|
134
|
+
:host([disabled]) .separator {
|
|
135
|
+
color: var(--_legend-d);
|
|
136
|
+
}
|
|
137
|
+
/* KBS-13: hosted in another component's part, the legends take that part's text style and color. */
|
|
138
|
+
.sequence.hosted .label,
|
|
139
|
+
.sequence.hosted .separator {
|
|
140
|
+
font: inherit;
|
|
141
|
+
letter-spacing: inherit;
|
|
142
|
+
color: inherit;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@media (forced-colors: active) {
|
|
146
|
+
${unsafeCSS(CAPS)} {
|
|
147
|
+
border-color: CanvasText;
|
|
148
|
+
}
|
|
149
|
+
:host([disabled]) .label,
|
|
150
|
+
:host([disabled]) .separator {
|
|
151
|
+
color: GrayText;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`;
|
|
155
|
+
//# sourceMappingURL=keyboard-shortcut.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard-shortcut.styles.js","sourceRoot":"","sources":["../../../src/components/keyboard-shortcut/keyboard-shortcut.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE5D,uHAAuH;AACvH,2GAA2G;AAC3G,kGAAkG;AAClG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AACvD,MAAM,eAAe,GAAG,QAAQ,CAAC;AACjC,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,qEAAqE;AACrE,MAAM,YAAY,GAAG;IACnB,MAAM,EAAE,kBAAkB;IAC1B,GAAG,EAAE,0BAA0B;IAC/B,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE,cAAc;CAChB,CAAC;AAEX,MAAM,MAAM,GAAG,iCAAiC,CAAC;AACjD,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC;AAChE,iHAAiH;AACjH,MAAM,GAAG,GAAG,CAAC,IAA6B,EAAE,GAAW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