@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,256 @@
|
|
|
1
|
+
// `@tanrei/web/pagination` — the script side of `@tanrei/web/pagination.css` (specs/pagination.spec.json), for a
|
|
2
|
+
// page that uses `class="tanrei-pagination"` without the components. `@tanrei/web` loads it too.
|
|
3
|
+
//
|
|
4
|
+
// The pagination is classes on the product's own `nav` and anchors, and the stylesheet alone draws it in every state.
|
|
5
|
+
// This adds what a stylesheet cannot, through listeners on the document, as the Link's script does (src/link.ts) — no
|
|
6
|
+
// anchor is wrapped, replaced or given a listener of its own:
|
|
7
|
+
//
|
|
8
|
+
// - the shared press primitive (PGN-10, PGN-11): `data-pressed` named after `sys.behavior.pressed-feedback`
|
|
9
|
+
// (overlay, ripple, dim, none), on pointer down and on Enter — never Space (PGN-14) — held for press-hold;
|
|
10
|
+
// - the order (PGN-1): items given next-first are put previous-first, so the focus order is the reading order;
|
|
11
|
+
// - `rel="prev"` and `rel="next"` where the product left them out (PGN-2);
|
|
12
|
+
// - the refusals of PGN-3: an address that is only white space, names a script or cannot be read is taken off the
|
|
13
|
+
// anchor, which is then not drawn;
|
|
14
|
+
// - `data-focus-style`, where the browser has no style queries to read `sys.behavior.focus-style` with (PGN-12);
|
|
15
|
+
// - `data-tanrei-unmirrored`, where the active icon set does not mark the arrows as mirrored (PGN-21);
|
|
16
|
+
// - every debug report (PGN-1, PGN-3, PGN-7).
|
|
17
|
+
//
|
|
18
|
+
// What the browser gives an anchor stays the browser's (PGN-2, PGN-14): Enter fires `click` and then follows the
|
|
19
|
+
// address unless the product cancelled the click; a modified or a middle click opens a tab. Nothing here follows a link.
|
|
20
|
+
import { syncFocusStyle } from './primitives/focus-ring.js';
|
|
21
|
+
import { iconSets, systemIconSets } from './generated/icon-sets.js';
|
|
22
|
+
import { LINK_KEYS, readDestination } from './primitives/link.js';
|
|
23
|
+
import { PressController } from './primitives/press.js';
|
|
24
|
+
import { report } from './primitives/report.js';
|
|
25
|
+
const ROOT = 'tanrei-pagination';
|
|
26
|
+
const ITEM = 'tanrei-pagination-item';
|
|
27
|
+
const LABEL = 'tanrei-pagination-label';
|
|
28
|
+
const UNMIRRORED = 'data-tanrei-unmirrored';
|
|
29
|
+
/** The glyph each direction draws (PGN-6), which the stylesheet writes; named here to ask the icon set about it. */
|
|
30
|
+
const ARROWS = { previous: 'arrow_back', next: 'arrow_forward' };
|
|
31
|
+
const REL = { previous: 'prev', next: 'next' };
|
|
32
|
+
/** What the observer re-reads a pagination for. */
|
|
33
|
+
const ATTRIBUTES = ['href', 'class', 'data-direction', 'aria-label', 'aria-labelledby', 'data-tanrei-system'];
|
|
34
|
+
/** The item a node is in: an anchor with the item's class. */
|
|
35
|
+
function itemOf(node) {
|
|
36
|
+
const anchor = node instanceof Element ? node.closest('a') : null;
|
|
37
|
+
return anchor instanceof HTMLAnchorElement && anchor.classList.contains(ITEM) ? anchor : null;
|
|
38
|
+
}
|
|
39
|
+
/** An item's direction: the two the pagination has, `next` where none is written (the prop's default), or null. */
|
|
40
|
+
function directionOf(item) {
|
|
41
|
+
const written = item.getAttribute('data-direction');
|
|
42
|
+
return written === null || written === 'next' ? 'next' : written === 'previous' ? 'previous' : null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The icon set the item's arrow is drawn from, as `activeIconSet()` finds it for a glyph (src/primitives/
|
|
46
|
+
* glyph-mirror.ts): the set of the design system around the item, and for a system Tanrei does not ship the set that
|
|
47
|
+
* holds the icon family the arrow is drawn with — the item's own font is its text's, so the family is read from the
|
|
48
|
+
* token. Null: no set describes it, and nothing is mirrored by itself.
|
|
49
|
+
*/
|
|
50
|
+
function arrowSet(item) {
|
|
51
|
+
const system = item.closest('[data-tanrei-system]')?.getAttribute('data-tanrei-system') || 'tanrei';
|
|
52
|
+
if (Object.hasOwn(systemIconSets, system)) {
|
|
53
|
+
const id = systemIconSets[system];
|
|
54
|
+
return id && Object.hasOwn(iconSets, id) ? iconSets[id] : null;
|
|
55
|
+
}
|
|
56
|
+
const family = getComputedStyle(item).getPropertyValue('--tanrei-sys-icon-family-unselected').split(',')[0]?.trim().replace(/^["']|["']$/g, '').toLowerCase();
|
|
57
|
+
if (!family)
|
|
58
|
+
return null;
|
|
59
|
+
return Object.values(iconSets).find((set) => set.families.some((name) => name.toLowerCase() === family)) ?? null;
|
|
60
|
+
}
|
|
61
|
+
/** An item that can be followed now. */
|
|
62
|
+
const live = (item) => item.hasAttribute('href');
|
|
63
|
+
/** The anchors whose address was refused and taken off: said once, as a refusal. */
|
|
64
|
+
const refused = new WeakSet();
|
|
65
|
+
/** One item, read when it is seen and again when it changes (PGN-2, PGN-3, PGN-7, PGN-21). */
|
|
66
|
+
function readItem(item) {
|
|
67
|
+
const given = item.getAttribute('href');
|
|
68
|
+
if (given !== null) {
|
|
69
|
+
const { href, refusal } = readDestination(given);
|
|
70
|
+
if (href === null) {
|
|
71
|
+
// White space is no destination and no finding (PGN-3): the sequence has no page on that side.
|
|
72
|
+
item.removeAttribute('href');
|
|
73
|
+
if (refusal) {
|
|
74
|
+
refused.add(item);
|
|
75
|
+
report(item, 'PGN-3', refusal === 'script' ? 'href names a script to run, not a place to go; it is taken off and the item is not drawn' : `href "${given}" cannot be read as an address; it is taken off and the item is not drawn`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const direction = directionOf(item);
|
|
80
|
+
if (!direction) {
|
|
81
|
+
report(item, 'PGN-3', `data-direction "${item.getAttribute('data-direction')}" is not a direction it has ("previous" or "next"); the item is not drawn`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (!live(item))
|
|
85
|
+
return;
|
|
86
|
+
// PGN-2: how the destination relates to the page.
|
|
87
|
+
if (!item.hasAttribute('rel'))
|
|
88
|
+
item.setAttribute('rel', REL[direction]);
|
|
89
|
+
// PGN-7: the direction is said in words by the label.
|
|
90
|
+
if (!(item.querySelector(`:scope > .${LABEL}`)?.textContent ?? '').trim()) {
|
|
91
|
+
report(item, 'PGN-7', 'its label is empty, so it does not say its direction in words: the arrow is hidden from assistive technology; give it a span with class "tanrei-pagination-label"');
|
|
92
|
+
}
|
|
93
|
+
// PGN-21: the icon set says whether the arrow is mirrored in a right-to-left layout; the stylesheet mirrors it
|
|
94
|
+
// unless this mark says the active set does not.
|
|
95
|
+
item.toggleAttribute(UNMIRRORED, !arrowSet(item)?.mirrored.has(ARROWS[direction]));
|
|
96
|
+
}
|
|
97
|
+
/** One landmark (PGN-1, PGN-3): its name, the order of its items, and a second item of a direction. */
|
|
98
|
+
function readRoot(root) {
|
|
99
|
+
const items = [...root.querySelectorAll(`:scope > a.${ITEM}`)];
|
|
100
|
+
for (const item of items)
|
|
101
|
+
readItem(item);
|
|
102
|
+
const seen = new Map();
|
|
103
|
+
for (const item of items) {
|
|
104
|
+
const direction = directionOf(item);
|
|
105
|
+
if (!direction)
|
|
106
|
+
continue;
|
|
107
|
+
if (seen.has(direction))
|
|
108
|
+
report(item, 'PGN-3', `it is a second "${direction}" item; a pagination holds at most one of each, and this one is not drawn`);
|
|
109
|
+
else
|
|
110
|
+
seen.set(direction, item);
|
|
111
|
+
}
|
|
112
|
+
// PGN-1: previous, then next, in the document and so in the focus order, whatever order the product gave them in.
|
|
113
|
+
const [previous, next] = [seen.get('previous'), seen.get('next')];
|
|
114
|
+
if (previous && next && next.compareDocumentPosition(previous) & Node.DOCUMENT_POSITION_FOLLOWING)
|
|
115
|
+
next.before(previous);
|
|
116
|
+
if (items.some(live) && !(root.getAttribute('aria-label') ?? '').trim() && !root.hasAttribute('aria-labelledby')) {
|
|
117
|
+
report(root, 'PGN-1', 'the landmark has no accessible name; give it aria-label ("Pages"), which tells it from the page’s other navigation');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** See src/link.ts: `data-pressed` is written before the press primitive reads a style, so the stylesheet's own `:active` answer stands down. */
|
|
121
|
+
function answered(item) {
|
|
122
|
+
if (!item.hasAttribute('data-pressed'))
|
|
123
|
+
item.dataset.pressed = 'none';
|
|
124
|
+
}
|
|
125
|
+
const presses = new WeakMap();
|
|
126
|
+
/** The press of one item (the shared primitive), made when it is first pressed. */
|
|
127
|
+
function pressOf(item) {
|
|
128
|
+
let press = presses.get(item);
|
|
129
|
+
if (!press) {
|
|
130
|
+
press = new PressController(item, {
|
|
131
|
+
container: () => item,
|
|
132
|
+
// The item's first transition is the hold (pagination.css), so its delay is press-hold as a time.
|
|
133
|
+
holdCarrier: () => item,
|
|
134
|
+
disabled: () => !live(item),
|
|
135
|
+
keys: LINK_KEYS,
|
|
136
|
+
});
|
|
137
|
+
presses.set(item, press);
|
|
138
|
+
}
|
|
139
|
+
return press;
|
|
140
|
+
}
|
|
141
|
+
const OBSERVING = Symbol.for('tanrei.observe-pagination');
|
|
142
|
+
const OWNER = {};
|
|
143
|
+
/**
|
|
144
|
+
* Adds the script side of the pagination to every `.tanrei-pagination` under `root`, now and as the page changes.
|
|
145
|
+
* `@tanrei/web` and `@tanrei/web/pagination` call it for the document when they load; call it yourself for a shadow
|
|
146
|
+
* root of your own. Calling it twice for one root observes once. Returns a function that stops.
|
|
147
|
+
*/
|
|
148
|
+
export function observePagination(root = document) {
|
|
149
|
+
const observed = root;
|
|
150
|
+
const running = observed[OBSERVING];
|
|
151
|
+
if (running?.owner === OWNER)
|
|
152
|
+
return running;
|
|
153
|
+
if (typeof MutationObserver === 'undefined')
|
|
154
|
+
return () => { };
|
|
155
|
+
running?.();
|
|
156
|
+
let held = null;
|
|
157
|
+
const release = () => {
|
|
158
|
+
held?.press.release();
|
|
159
|
+
held = null;
|
|
160
|
+
};
|
|
161
|
+
const onPointerDown = (event) => {
|
|
162
|
+
const item = itemOf(event.target);
|
|
163
|
+
if (!item || !live(item))
|
|
164
|
+
return;
|
|
165
|
+
const pointer = event;
|
|
166
|
+
if (pointer.button !== 0 && pointer.pointerType === 'mouse')
|
|
167
|
+
return;
|
|
168
|
+
answered(item);
|
|
169
|
+
held = { item, press: pressOf(item) };
|
|
170
|
+
held.press.onPointerDown(pointer);
|
|
171
|
+
};
|
|
172
|
+
// `pointerleave` does not reach the document: the press ends when the pointer goes out of the item it holds.
|
|
173
|
+
const onPointerOut = (event) => {
|
|
174
|
+
const to = event.relatedTarget;
|
|
175
|
+
if (held && !(to instanceof Node && held.item.contains(to)))
|
|
176
|
+
release();
|
|
177
|
+
};
|
|
178
|
+
const onKeyDown = (event) => {
|
|
179
|
+
const item = itemOf(event.target);
|
|
180
|
+
const key = event;
|
|
181
|
+
if (!item || !live(item) || key.repeat || !LINK_KEYS.includes(key.key))
|
|
182
|
+
return;
|
|
183
|
+
answered(item);
|
|
184
|
+
pressOf(item).onKeyDown(key);
|
|
185
|
+
};
|
|
186
|
+
const onKeyUp = (event) => {
|
|
187
|
+
const item = itemOf(event.target);
|
|
188
|
+
if (item)
|
|
189
|
+
presses.get(item)?.onKeyUp(event);
|
|
190
|
+
};
|
|
191
|
+
const onFocusIn = (event) => {
|
|
192
|
+
const item = itemOf(event.target);
|
|
193
|
+
if (item)
|
|
194
|
+
syncFocusStyle(item, item);
|
|
195
|
+
};
|
|
196
|
+
const onFocusOut = (event) => {
|
|
197
|
+
const item = itemOf(event.target);
|
|
198
|
+
if (item)
|
|
199
|
+
presses.get(item)?.onBlur();
|
|
200
|
+
};
|
|
201
|
+
const listeners = [
|
|
202
|
+
['pointerdown', onPointerDown],
|
|
203
|
+
['pointerup', release],
|
|
204
|
+
['pointercancel', release],
|
|
205
|
+
['pointerout', onPointerOut],
|
|
206
|
+
['dragstart', release],
|
|
207
|
+
['keydown', onKeyDown],
|
|
208
|
+
['keyup', onKeyUp],
|
|
209
|
+
['focusin', onFocusIn],
|
|
210
|
+
['focusout', onFocusOut],
|
|
211
|
+
];
|
|
212
|
+
for (const [type, listener] of listeners)
|
|
213
|
+
root.addEventListener(type, listener, true);
|
|
214
|
+
const observer = new MutationObserver((records) => {
|
|
215
|
+
const roots = new Set();
|
|
216
|
+
let system = false;
|
|
217
|
+
for (const record of records) {
|
|
218
|
+
if (record.type === 'attributes' && record.attributeName === 'data-tanrei-system')
|
|
219
|
+
system = true;
|
|
220
|
+
const around = record.target instanceof Element ? record.target.closest(`.${ROOT}`) : null;
|
|
221
|
+
if (around)
|
|
222
|
+
roots.add(around);
|
|
223
|
+
for (const node of record.addedNodes) {
|
|
224
|
+
if (!(node instanceof Element))
|
|
225
|
+
continue;
|
|
226
|
+
if (node.classList.contains(ROOT))
|
|
227
|
+
roots.add(node);
|
|
228
|
+
for (const inner of node.querySelectorAll(`.${ROOT}`))
|
|
229
|
+
roots.add(inner);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Another design system around the page: another icon set may say otherwise of the arrows.
|
|
233
|
+
if (system)
|
|
234
|
+
for (const every of root.querySelectorAll(`.${ROOT}`))
|
|
235
|
+
roots.add(every);
|
|
236
|
+
for (const one of roots)
|
|
237
|
+
if (one.isConnected)
|
|
238
|
+
readRoot(one);
|
|
239
|
+
});
|
|
240
|
+
observer.observe(root, { attributes: true, attributeFilter: ATTRIBUTES, childList: true, subtree: true, characterData: true });
|
|
241
|
+
for (const one of root.querySelectorAll(`.${ROOT}`))
|
|
242
|
+
readRoot(one);
|
|
243
|
+
const stop = () => {
|
|
244
|
+
observer.disconnect();
|
|
245
|
+
for (const [type, listener] of listeners)
|
|
246
|
+
root.removeEventListener(type, listener, true);
|
|
247
|
+
release();
|
|
248
|
+
if (observed[OBSERVING] === stop)
|
|
249
|
+
delete observed[OBSERVING];
|
|
250
|
+
};
|
|
251
|
+
observed[OBSERVING] = Object.assign(stop, { owner: OWNER });
|
|
252
|
+
return stop;
|
|
253
|
+
}
|
|
254
|
+
if (typeof document !== 'undefined')
|
|
255
|
+
observePagination(document);
|
|
256
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,iGAAiG;AACjG,EAAE;AACF,sHAAsH;AACtH,sHAAsH;AACtH,8DAA8D;AAC9D,EAAE;AACF,8GAA8G;AAC9G,+GAA+G;AAC/G,iHAAiH;AACjH,6EAA6E;AAC7E,oHAAoH;AACpH,uCAAuC;AACvC,mHAAmH;AACnH,yGAAyG;AACzG,gDAAgD;AAChD,EAAE;AACF,iHAAiH;AACjH,yHAAyH;AACzH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAgB,QAAQ,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,IAAI,GAAG,wBAAwB,CAAC;AACtC,MAAM,KAAK,GAAG,yBAAyB,CAAC;AACxC,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAE5C,oHAAoH;AACpH,MAAM,MAAM,GAA8B,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;AAC5F,MAAM,GAAG,GAA8B,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1E,mDAAmD;AACnD,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;AAE9G,8DAA8D;AAC9D,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S,CAAC,KAAK,IAAI;YAAE,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC,CAAC;IACF,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,IAAI,OAAO,QAAQ,KAAK,WAAW;IAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type CSSResult } from 'lit';
|
|
2
|
+
/** Where a flagged action goes (BGR-13, BGR-14): the dismissive run, the unflagged one, the confirming one. */
|
|
3
|
+
export type ActionRun = 'dismissive' | 'neutral' | 'confirming';
|
|
4
|
+
/** The three runs in the order of a row (start to end) and of a column (top to bottom). */
|
|
5
|
+
export declare const ACTION_ROW: readonly ActionRun[];
|
|
6
|
+
export declare const ACTION_COLUMN: readonly ActionRun[];
|
|
7
|
+
/** The core Button variants, in the order of a `dev.tanrei.enum` choice of them: the first is the fallback. */
|
|
8
|
+
export declare const BUTTON_VARIANTS: readonly ['filled', 'tonal', 'elevated', 'outlined', 'text'];
|
|
9
|
+
/** Assigns `nodes` to a manually assigned `slot`, unless it already holds exactly them. */
|
|
10
|
+
export declare function assignSlot(slot: HTMLSlotElement | null, nodes: readonly Node[]): void;
|
|
11
|
+
/**
|
|
12
|
+
* A choice of kind that a comp token names, read from the cascade on `host` now — never cached, so a system
|
|
13
|
+
* switch is seen; an unknown name is the first value.
|
|
14
|
+
*/
|
|
15
|
+
export declare function compChoice<T extends string>(host: Element, property: string, values: readonly T[]): T;
|
|
16
|
+
/** Gives `element` the variant its host chose for it (null: none), through the Button's group-item channel (BTN-10). */
|
|
17
|
+
export declare function giveVariant(element: Element | null | undefined, variant: string | null): void;
|
|
18
|
+
/** How the actions share the row: `fill` (equal shares of the inner width) or packed at their own widths. */
|
|
19
|
+
export type ActionArrangement = 'fill' | 'packed';
|
|
20
|
+
/** One layout of the actions: whether they stack, and the row's width at the widths it would draw them. */
|
|
21
|
+
export interface ActionMeasure {
|
|
22
|
+
stacked: boolean;
|
|
23
|
+
/** Packed: the sum of their own widths; fill: equal shares, each as wide as the widest action. Gaps included. */
|
|
24
|
+
row: number;
|
|
25
|
+
/** The row at their own widths, whatever the arrangement: the sum of them, gaps included (POP-7). */
|
|
26
|
+
natural: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A host's actions: which runs they fall into, whether they are a column, and the variant it gave them. The host calls
|
|
30
|
+
* `read()` when its children change, `measure()` when it lays out, `assign()` after either, and `give()` when it reads
|
|
31
|
+
* its variant token.
|
|
32
|
+
*/
|
|
33
|
+
export declare class ActionPlacement {
|
|
34
|
+
private readonly host;
|
|
35
|
+
/** Called with each action as it is read: what changes the row's fit (a label drawn or changed) is observed. */
|
|
36
|
+
private readonly observe?;
|
|
37
|
+
actions: Element[];
|
|
38
|
+
runs: Record<ActionRun, Element[]>;
|
|
39
|
+
/** The actions are a column. */
|
|
40
|
+
stacked: boolean;
|
|
41
|
+
/** The actions it gave its variant to. */
|
|
42
|
+
private given;
|
|
43
|
+
constructor(host: Element,
|
|
44
|
+
/** Called with each action as it is read: what changes the row's fit (a label drawn or changed) is observed. */
|
|
45
|
+
observe?: ((action: Element) => void) | undefined);
|
|
46
|
+
/** BGR-13, BGR-14, BGR-18: the actions by run, in the order given within each run; both flags are unflagged, reported. */
|
|
47
|
+
read(actions: Element[]): void;
|
|
48
|
+
/** Every action is told the host's variant, which it draws while its own is not set; a former action, none. */
|
|
49
|
+
give(variant: string | null): void;
|
|
50
|
+
/** The three slots, first to last, get the runs in the order of the orientation (BGR-15). */
|
|
51
|
+
assign(slots: ArrayLike<HTMLSlotElement>): void;
|
|
52
|
+
/**
|
|
53
|
+
* BGR-16, BGR-17: measured as a row at their own widths, one line each (the `measuring` class on `box`, whose CSS
|
|
54
|
+
* gives the actions their own widths), then drawn as they fit: `fill` stays a row while every label fits its equal
|
|
55
|
+
* share of the box's inner width, `packed` while the row at their own widths fits it. Sets `stacked` on the box.
|
|
56
|
+
* Returns whether the orientation changed (the host then assigns the slots again) and the measure.
|
|
57
|
+
*/
|
|
58
|
+
measure(box: HTMLElement, arrangement: ActionArrangement): ActionMeasure & {
|
|
59
|
+
changed: boolean;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The actions' box `box` (a flex container of the three slots) as a full-width Button group (BGR-17): a row the actions
|
|
64
|
+
* share equally — each Button's container stretched across its share, its label centred — or, `stacked`, a column of
|
|
65
|
+
* actions as wide as the box; `measuring`, a row at their own widths. `gap` is the host's gap token. A packed
|
|
66
|
+
* arrangement is the host's own rules on top (each action `flex: none`).
|
|
67
|
+
*/
|
|
68
|
+
export declare function actionBoxStyles(box: string, gap: string): CSSResult;
|
|
69
|
+
/**
|
|
70
|
+
* A choice of kind that a comp token names (its value is the choice's name), drawn by CSS: a style query
|
|
71
|
+
* where the browser has them, and the name the script read into `data-<attribute>` on `element` where it does not.
|
|
72
|
+
* `rules` gets `element`'s selector; the query is answered by the element's own style, so only its descendants are
|
|
73
|
+
* styled by it.
|
|
74
|
+
*/
|
|
75
|
+
export declare function whenChosen(property: string, element: string, attribute: string, value: string, rules: (element: string) => string): CSSResult;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { unsafeCSS } from 'lit';
|
|
2
|
+
import { GROUP_ITEM } from './group-item.js';
|
|
3
|
+
import { report } from './report.js';
|
|
4
|
+
/** The three runs in the order of a row (start to end) and of a column (top to bottom). */
|
|
5
|
+
export const ACTION_ROW = ['dismissive', 'neutral', 'confirming'];
|
|
6
|
+
export const ACTION_COLUMN = ['confirming', 'neutral', 'dismissive'];
|
|
7
|
+
/** The core Button variants, in the order of a `dev.tanrei.enum` choice of them: the first is the fallback. */
|
|
8
|
+
export const BUTTON_VARIANTS = ['filled', 'tonal', 'elevated', 'outlined', 'text'];
|
|
9
|
+
const sameNodes = (a, b) => a.length === b.length && a.every((node, i) => node === b[i]);
|
|
10
|
+
/** Assigns `nodes` to a manually assigned `slot`, unless it already holds exactly them. */
|
|
11
|
+
export function assignSlot(slot, nodes) {
|
|
12
|
+
if (slot && !sameNodes(slot.assignedNodes(), nodes))
|
|
13
|
+
slot.assign(...nodes);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A choice of kind that a comp token names, read from the cascade on `host` now — never cached, so a system
|
|
17
|
+
* switch is seen; an unknown name is the first value.
|
|
18
|
+
*/
|
|
19
|
+
export function compChoice(host, property, values) {
|
|
20
|
+
const named = getComputedStyle(host).getPropertyValue(property).trim();
|
|
21
|
+
return values.includes(named) ? named : values[0];
|
|
22
|
+
}
|
|
23
|
+
/** Gives `element` the variant its host chose for it (null: none), through the Button's group-item channel (BTN-10). */
|
|
24
|
+
export function giveVariant(element, variant) {
|
|
25
|
+
element?.[GROUP_ITEM]?.give(variant);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A host's actions: which runs they fall into, whether they are a column, and the variant it gave them. The host calls
|
|
29
|
+
* `read()` when its children change, `measure()` when it lays out, `assign()` after either, and `give()` when it reads
|
|
30
|
+
* its variant token.
|
|
31
|
+
*/
|
|
32
|
+
export class ActionPlacement {
|
|
33
|
+
constructor(host,
|
|
34
|
+
/** Called with each action as it is read: what changes the row's fit (a label drawn or changed) is observed. */
|
|
35
|
+
observe) {
|
|
36
|
+
this.host = host;
|
|
37
|
+
this.observe = observe;
|
|
38
|
+
this.actions = [];
|
|
39
|
+
this.runs = { dismissive: [], neutral: [], confirming: [] };
|
|
40
|
+
/** The actions are a column. */
|
|
41
|
+
this.stacked = false;
|
|
42
|
+
/** The actions it gave its variant to. */
|
|
43
|
+
this.given = new Set();
|
|
44
|
+
}
|
|
45
|
+
/** BGR-13, BGR-14, BGR-18: the actions by run, in the order given within each run; both flags are unflagged, reported. */
|
|
46
|
+
read(actions) {
|
|
47
|
+
this.actions = actions;
|
|
48
|
+
const runs = { dismissive: [], neutral: [], confirming: [] };
|
|
49
|
+
for (const action of actions) {
|
|
50
|
+
const confirming = action.hasAttribute('confirming');
|
|
51
|
+
const dismissive = action.hasAttribute('dismissive');
|
|
52
|
+
if (confirming && dismissive) {
|
|
53
|
+
report(this.host, 'BGR-18', `the action "${action.textContent?.trim() ?? ''}" is both confirming and dismissive; it is placed among the actions with neither`);
|
|
54
|
+
}
|
|
55
|
+
runs[confirming === dismissive ? 'neutral' : confirming ? 'confirming' : 'dismissive'].push(action);
|
|
56
|
+
this.observe?.(action);
|
|
57
|
+
}
|
|
58
|
+
this.runs = runs;
|
|
59
|
+
}
|
|
60
|
+
/** Every action is told the host's variant, which it draws while its own is not set; a former action, none. */
|
|
61
|
+
give(variant) {
|
|
62
|
+
const now = new Set(this.actions);
|
|
63
|
+
for (const element of this.given)
|
|
64
|
+
if (!now.has(element))
|
|
65
|
+
giveVariant(element, null);
|
|
66
|
+
for (const action of this.actions)
|
|
67
|
+
giveVariant(action, variant);
|
|
68
|
+
this.given = now;
|
|
69
|
+
}
|
|
70
|
+
/** The three slots, first to last, get the runs in the order of the orientation (BGR-15). */
|
|
71
|
+
assign(slots) {
|
|
72
|
+
const order = this.stacked ? ACTION_COLUMN : ACTION_ROW;
|
|
73
|
+
for (let i = 0; i < slots.length && i < order.length; i++)
|
|
74
|
+
assignSlot(slots[i], this.runs[order[i]]);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* BGR-16, BGR-17: measured as a row at their own widths, one line each (the `measuring` class on `box`, whose CSS
|
|
78
|
+
* gives the actions their own widths), then drawn as they fit: `fill` stays a row while every label fits its equal
|
|
79
|
+
* share of the box's inner width, `packed` while the row at their own widths fits it. Sets `stacked` on the box.
|
|
80
|
+
* Returns whether the orientation changed (the host then assigns the slots again) and the measure.
|
|
81
|
+
*/
|
|
82
|
+
measure(box, arrangement) {
|
|
83
|
+
box.classList.remove('stacked');
|
|
84
|
+
box.classList.add('measuring');
|
|
85
|
+
const drawn = this.actions.filter((action) => action.getClientRects().length > 0);
|
|
86
|
+
const widths = drawn.map((action) => action.getBoundingClientRect().width);
|
|
87
|
+
const style = getComputedStyle(box);
|
|
88
|
+
const gap = Number.parseFloat(style.columnGap) || 0;
|
|
89
|
+
const gaps = gap * Math.max(0, widths.length - 1);
|
|
90
|
+
const packed = arrangement === 'packed';
|
|
91
|
+
const natural = widths.reduce((sum, width) => sum + width, 0) + gaps;
|
|
92
|
+
const row = packed ? natural : Math.max(0, ...widths) * widths.length + gaps;
|
|
93
|
+
const inner = box.clientWidth - (Number.parseFloat(style.paddingInlineStart) || 0) - (Number.parseFloat(style.paddingInlineEnd) || 0);
|
|
94
|
+
const share = widths.length ? (inner - gaps) / widths.length : inner;
|
|
95
|
+
const fits = packed ? row <= inner + 0.5 : widths.every((width) => width <= share + 0.5);
|
|
96
|
+
box.classList.remove('measuring');
|
|
97
|
+
const stacked = widths.length > 0 && !fits;
|
|
98
|
+
box.classList.toggle('stacked', stacked);
|
|
99
|
+
const changed = stacked !== this.stacked;
|
|
100
|
+
this.stacked = stacked;
|
|
101
|
+
return { stacked, row, natural, changed };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The actions' box `box` (a flex container of the three slots) as a full-width Button group (BGR-17): a row the actions
|
|
106
|
+
* share equally — each Button's container stretched across its share, its label centred — or, `stacked`, a column of
|
|
107
|
+
* actions as wide as the box; `measuring`, a row at their own widths. `gap` is the host's gap token. A packed
|
|
108
|
+
* arrangement is the host's own rules on top (each action `flex: none`).
|
|
109
|
+
*/
|
|
110
|
+
export function actionBoxStyles(box, gap) {
|
|
111
|
+
return unsafeCSS(`
|
|
112
|
+
${box} {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex: none;
|
|
115
|
+
gap: var(${gap});
|
|
116
|
+
}
|
|
117
|
+
${box} ::slotted(*) {
|
|
118
|
+
display: grid;
|
|
119
|
+
flex: 1 1 0;
|
|
120
|
+
min-inline-size: 0;
|
|
121
|
+
}
|
|
122
|
+
${box}.stacked {
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
}
|
|
125
|
+
${box}.stacked ::slotted(*),
|
|
126
|
+
${box}.measuring ::slotted(*) {
|
|
127
|
+
flex: none;
|
|
128
|
+
}`);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* A choice of kind that a comp token names (its value is the choice's name), drawn by CSS: a style query
|
|
132
|
+
* where the browser has them, and the name the script read into `data-<attribute>` on `element` where it does not.
|
|
133
|
+
* `rules` gets `element`'s selector; the query is answered by the element's own style, so only its descendants are
|
|
134
|
+
* styled by it.
|
|
135
|
+
*/
|
|
136
|
+
export function whenChosen(property, element, attribute, value, rules) {
|
|
137
|
+
return unsafeCSS(`@container style(${property}: ${value}) {
|
|
138
|
+
${rules(element)}
|
|
139
|
+
}
|
|
140
|
+
${rules(`${element}[data-${attribute}='${value}']`)}`);
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/primitives/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,UAAU,EAAkB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWrC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,UAAU,GAAyB,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,aAAa,GAAyB,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAC3F,+GAA+G;AAC/G,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAE5F,MAAM,SAAS,GAAG,CAAC,CAAkB,EAAE,CAAkB,E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EAAE,CAAC;IAC5C,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,GAAW;IACtD,OAAO,SAAS,CAAC;IACf,GAAG;;;eAGQ,GAAG;;IAEd,GAAG;;;;;IAKH,GAAG;;;IAGH,GAAG;IACH,GAAG;;IAEH,CAAC,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,EAAE,KAAkC;IAChI,OAAO,SAAS,CAAC,oBAAoB,QAAQ,KAAK,KAAK;EACvD,KAAK,CAAC,OAAO,CAAC;;EAEd,KAAK,CAAC,GAAG,OAAO,SAAS,SAAS,KAAK,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `fire` once the click being dispatched now has finished its way through the page — the order and timing of a
|
|
3
|
+
* native checkbox's `change` after its `click` (CHP-11, BTN-14). A click's last stop is the window, so `fire` runs from a
|
|
4
|
+
* listener added there for this click; when a listener stops the click on its way, `fire` still runs, in the next task.
|
|
5
|
+
* Call it from the component's own click handler, after switching its state, so a `click` listener already sees the new
|
|
6
|
+
* value.
|
|
7
|
+
*/
|
|
8
|
+
export declare function afterClick(fire: () => void): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `fire` once the click being dispatched now has finished its way through the page — the order and timing of a
|
|
3
|
+
* native checkbox's `change` after its `click` (CHP-11, BTN-14). A click's last stop is the window, so `fire` runs from a
|
|
4
|
+
* listener added there for this click; when a listener stops the click on its way, `fire` still runs, in the next task.
|
|
5
|
+
* Call it from the component's own click handler, after switching its state, so a `click` listener already sees the new
|
|
6
|
+
* value.
|
|
7
|
+
*/
|
|
8
|
+
export function afterClick(fire) {
|
|
9
|
+
let pending = true;
|
|
10
|
+
const run = () => {
|
|
11
|
+
if (!pending)
|
|
12
|
+
return;
|
|
13
|
+
pending = false;
|
|
14
|
+
window.removeEventListener('click', run);
|
|
15
|
+
clearTimeout(timer);
|
|
16
|
+
fire();
|
|
17
|
+
};
|
|
18
|
+
window.addEventListener('click', run, { once: true });
|
|
19
|
+
const timer = setTimeout(run);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=after-click.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"after-click.js","sourceRoot":"","sources":["../../src/primitives/after-click.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAgB;IACzC,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,MAAM,GAAG,GAAG,GAAG,EAAE;QACf,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,OAAO,GAAG,KAAK,CAAC;QAChB,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzC,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;IACF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC"}
|