@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,232 @@
|
|
|
1
|
+
import { deepActive } from './modal.js';
|
|
2
|
+
const overlays = new Map();
|
|
3
|
+
/** Makes an overlay known to the window for as long as it is connected; returns the function that withdraws it. */
|
|
4
|
+
export function registerOverlay(host, entry) {
|
|
5
|
+
overlays.set(host, entry);
|
|
6
|
+
return () => {
|
|
7
|
+
if (overlays.get(host) === entry)
|
|
8
|
+
overlays.delete(host);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A node's logical ancestors, itself first: its ancestors in the flat tree (through slots and shadow roots) and, at
|
|
13
|
+
* each registered overlay on the way, the ancestors of what opened it.
|
|
14
|
+
*/
|
|
15
|
+
export function* logicalAncestors(node) {
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
const queue = node ? [node] : [];
|
|
18
|
+
while (queue.length) {
|
|
19
|
+
let at = queue.shift();
|
|
20
|
+
while (at && !seen.has(at)) {
|
|
21
|
+
seen.add(at);
|
|
22
|
+
yield at;
|
|
23
|
+
if (at instanceof Element) {
|
|
24
|
+
const entry = overlays.get(at);
|
|
25
|
+
if (entry)
|
|
26
|
+
for (const opener of entry.openers())
|
|
27
|
+
if (opener)
|
|
28
|
+
queue.push(opener);
|
|
29
|
+
}
|
|
30
|
+
const parent = (at instanceof Element ? at.assignedSlot : null) ?? at.parentNode;
|
|
31
|
+
at = parent instanceof ShadowRoot ? parent.host : parent;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** How many overlays of `kind` a node is logically inside, the node's own overlay included (POP-24). */
|
|
36
|
+
export function overlayDepth(node, kind) {
|
|
37
|
+
let depth = 0;
|
|
38
|
+
for (const ancestor of logicalAncestors(node))
|
|
39
|
+
if (ancestor instanceof Element && overlays.get(ancestor)?.kind === kind)
|
|
40
|
+
depth++;
|
|
41
|
+
return depth;
|
|
42
|
+
}
|
|
43
|
+
/** The surfaces shown now, the topmost last: Escape is the last one's. */
|
|
44
|
+
const shown = [];
|
|
45
|
+
/** The window's one key listener, there while any surface is shown. */
|
|
46
|
+
function onKey(event) {
|
|
47
|
+
if (event.key !== 'Escape' && event.key !== 'Tab')
|
|
48
|
+
return;
|
|
49
|
+
const path = event.composedPath();
|
|
50
|
+
const escape = event.key === 'Escape';
|
|
51
|
+
// Tab is each surface's own business; Escape is the topmost one's, wherever in the window the key was pressed.
|
|
52
|
+
const controller = escape ? shown[shown.length - 1] : [...shown].reverse().find((each) => each.edge(path) !== null);
|
|
53
|
+
if (!controller)
|
|
54
|
+
return;
|
|
55
|
+
// Where the key leaves the surface: the outermost node it passes that is the surface's — or, pressed outside every
|
|
56
|
+
// surface, the window.
|
|
57
|
+
const edge = controller.edge(path) ?? shown.map((each) => each.edge(path)).find((found) => found !== null) ?? window;
|
|
58
|
+
const answer = (at) => {
|
|
59
|
+
const key = at;
|
|
60
|
+
if (key !== event || !controller.active)
|
|
61
|
+
return;
|
|
62
|
+
if (!escape) {
|
|
63
|
+
controller.options.tab?.(key);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// POP-23: something inside took the key for itself (it stopped it or cancelled it), or it is composing text.
|
|
67
|
+
if (key.defaultPrevented || key.cancelBubble || key.isComposing)
|
|
68
|
+
return;
|
|
69
|
+
key.preventDefault();
|
|
70
|
+
key.stopPropagation();
|
|
71
|
+
controller.ask('escape', key);
|
|
72
|
+
};
|
|
73
|
+
edge.addEventListener('keydown', answer, { once: true });
|
|
74
|
+
// A key stopped before it reached the edge never calls the listener: it is taken back once the key has been heard.
|
|
75
|
+
setTimeout(() => edge.removeEventListener('keydown', answer), 0);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Asks its host to close on Escape, on a press outside and on focus leaving (POP-21, POP-23, POP-24). `start()` when
|
|
79
|
+
* the surface is shown, `stop()` when it is hidden; it also stops when the host is disconnected.
|
|
80
|
+
*/
|
|
81
|
+
export class DismissController {
|
|
82
|
+
constructor(host, options) {
|
|
83
|
+
this.host = host;
|
|
84
|
+
this.options = options;
|
|
85
|
+
this.active = false;
|
|
86
|
+
/** Modal overlays opened from inside the surface, which the DOM does not put inside it (POP-24). */
|
|
87
|
+
this.adopted = new WeakSet();
|
|
88
|
+
/** Whether the person's last press or key was inside the surface: a modal overlay that opens next is its own. */
|
|
89
|
+
this.actedInside = false;
|
|
90
|
+
this.asked = false;
|
|
91
|
+
/** A key: a new act of the person's, which may ask again. */
|
|
92
|
+
this.onAct = (event) => {
|
|
93
|
+
this.asked = false;
|
|
94
|
+
this.actedInside = this.owns(event.composedPath()[0]);
|
|
95
|
+
};
|
|
96
|
+
/** POP-21: a press outside the surface, its anchor, its opener and every overlay opened from inside it. */
|
|
97
|
+
this.onPress = (event) => {
|
|
98
|
+
// A new act of the person's, which may ask again.
|
|
99
|
+
this.asked = false;
|
|
100
|
+
const target = event.composedPath()[0];
|
|
101
|
+
const inside = this.owns(target) || this.adopt(target);
|
|
102
|
+
this.actedInside = inside;
|
|
103
|
+
if (!inside)
|
|
104
|
+
this.ask('outside', event);
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* POP-21: focus arriving on an element outside all of those. Focus that leaves the window arrives nowhere, and a
|
|
108
|
+
* reading cursor moves no focus: neither is seen here.
|
|
109
|
+
*/
|
|
110
|
+
this.onFocus = (event) => {
|
|
111
|
+
const target = event.composedPath()[0];
|
|
112
|
+
if (this.owns(target) || this.adopt(target))
|
|
113
|
+
return;
|
|
114
|
+
this.ask('focus-out', event);
|
|
115
|
+
};
|
|
116
|
+
host.addController(this);
|
|
117
|
+
}
|
|
118
|
+
hostDisconnected() {
|
|
119
|
+
this.stop();
|
|
120
|
+
}
|
|
121
|
+
start() {
|
|
122
|
+
if (this.active || typeof window === 'undefined')
|
|
123
|
+
return;
|
|
124
|
+
this.active = true;
|
|
125
|
+
this.asked = false;
|
|
126
|
+
this.actedInside = this.owns(deepActive());
|
|
127
|
+
if (shown.length === 0)
|
|
128
|
+
window.addEventListener('keydown', onKey, true);
|
|
129
|
+
shown.push(this);
|
|
130
|
+
document.addEventListener('pointerdown', this.onPress, true);
|
|
131
|
+
document.addEventListener('focusin', this.onFocus, true);
|
|
132
|
+
document.addEventListener('keydown', this.onAct, true);
|
|
133
|
+
}
|
|
134
|
+
stop() {
|
|
135
|
+
if (!this.active)
|
|
136
|
+
return;
|
|
137
|
+
this.active = false;
|
|
138
|
+
clearTimeout(this.reset);
|
|
139
|
+
this.asked = false;
|
|
140
|
+
const at = shown.indexOf(this);
|
|
141
|
+
if (at >= 0)
|
|
142
|
+
shown.splice(at, 1);
|
|
143
|
+
if (shown.length === 0)
|
|
144
|
+
window.removeEventListener('keydown', onKey, true);
|
|
145
|
+
document.removeEventListener('pointerdown', this.onPress, true);
|
|
146
|
+
document.removeEventListener('focusin', this.onFocus, true);
|
|
147
|
+
document.removeEventListener('keydown', this.onAct, true);
|
|
148
|
+
}
|
|
149
|
+
/** Whether `node` is the surface's: the host itself, a related element, or an adopted modal overlay. */
|
|
150
|
+
own(node) {
|
|
151
|
+
if (!(node instanceof Element))
|
|
152
|
+
return false;
|
|
153
|
+
if (node === this.host || this.adopted.has(node))
|
|
154
|
+
return true;
|
|
155
|
+
for (const related of this.options.related())
|
|
156
|
+
if (related === node)
|
|
157
|
+
return true;
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Whether `node` is inside the surface (POP-21, POP-24): in the host, in its anchor or its opener, or in an overlay
|
|
162
|
+
* opened from inside any of them, however deep.
|
|
163
|
+
*/
|
|
164
|
+
owns(node) {
|
|
165
|
+
for (const ancestor of logicalAncestors(node))
|
|
166
|
+
if (this.own(ancestor))
|
|
167
|
+
return true;
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
/** @internal Where a key that came along `path` leaves the surface: the outermost node of the path that is its own. */
|
|
171
|
+
edge(path) {
|
|
172
|
+
for (let i = path.length - 1; i >= 0; i--) {
|
|
173
|
+
const node = path[i];
|
|
174
|
+
if (this.own(node))
|
|
175
|
+
return node;
|
|
176
|
+
// An overlay opened from inside, standing somewhere else in the document: the key leaves the surface where it leaves that overlay.
|
|
177
|
+
if (node instanceof Element && overlays.has(node) && this.owns(node))
|
|
178
|
+
return node;
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
/** @internal Asks once for one act of the person: a press outside that also moves focus is one request. */
|
|
183
|
+
ask(reason, event) {
|
|
184
|
+
if (!this.active || this.asked)
|
|
185
|
+
return;
|
|
186
|
+
this.asked = true;
|
|
187
|
+
clearTimeout(this.reset);
|
|
188
|
+
// The host may decline (a product that keeps the surface open): the next act asks again. A press or a key says
|
|
189
|
+
// itself that it is a new act; a press is over only at the next one (a touch moves focus after it is lifted, which
|
|
190
|
+
// is still that press); anything else is over once this task is.
|
|
191
|
+
if (reason !== 'outside')
|
|
192
|
+
this.reset = setTimeout(() => (this.asked = false), 0);
|
|
193
|
+
this.options.request(reason, event);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* POP-24: every overlay opened from inside the surface that is not modal closes with it, at once. Called by the host
|
|
197
|
+
* when it closes.
|
|
198
|
+
*/
|
|
199
|
+
closeOwned() {
|
|
200
|
+
for (const [overlay, entry] of [...overlays]) {
|
|
201
|
+
if (overlay === this.host || !entry.close || !entry.open() || entry.modal?.())
|
|
202
|
+
continue;
|
|
203
|
+
if ([...entry.openers()].some((opener) => !!opener && this.owns(opener)))
|
|
204
|
+
entry.close();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* POP-24: a modal overlay (a dialog, a modal sheet) that opened after the person acted inside the surface is the
|
|
209
|
+
* surface's own, wherever it stands in the document: `node` is in one, and it is adopted.
|
|
210
|
+
*/
|
|
211
|
+
adopt(node) {
|
|
212
|
+
if (!this.actedInside)
|
|
213
|
+
return false;
|
|
214
|
+
// A modal overlay the surface itself stands in is not one it opened (POP-25).
|
|
215
|
+
const around = new Set(logicalAncestors(this.host));
|
|
216
|
+
for (const ancestor of logicalAncestors(node)) {
|
|
217
|
+
if (!(ancestor instanceof Element) || around.has(ancestor))
|
|
218
|
+
continue;
|
|
219
|
+
const modal = (ancestor instanceof HTMLDialogElement && ancestor.matches(':modal')) || (overlays.get(ancestor)?.modal?.() ?? false);
|
|
220
|
+
if (!modal)
|
|
221
|
+
continue;
|
|
222
|
+
// The dialog element of a component is in its shadow root: the component is adopted with it.
|
|
223
|
+
this.adopted.add(ancestor);
|
|
224
|
+
const root = ancestor.getRootNode();
|
|
225
|
+
if (root instanceof ShadowRoot)
|
|
226
|
+
this.adopted.add(root.host);
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=dismiss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dismiss.js","sourceRoot":"","sources":["../../src/primitives/dismiss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAqCxC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;AAElD,mHAAmH;AACnH,MAAM,UAAU,eAAe,CAAC,IAAa,EAAE,KAAmB;IAChE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1B,OAAO,GAAG,EAAE;QACV,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK;YAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC,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,CAAC,CAAC;YAC3B,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;YACpC,IAAI,IAAI,YAAY,UAAU;gBAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5D,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { type CSSResult, type TemplateResult, nothing } from 'lit';
|
|
2
|
+
import '../components/tag/tag.js';
|
|
3
|
+
import type { WordsController } from './words.js';
|
|
4
|
+
/** What the form asks of a control (FLD-4). The first value is what an unknown one behaves as (FLD-22). */
|
|
5
|
+
export declare const REQUIREMENTS: readonly ['none', 'required', 'optional'];
|
|
6
|
+
export type FrameRequirement = (typeof REQUIREMENTS)[number];
|
|
7
|
+
/** How a required control is marked (FLD-6). The first value is what an unknown one behaves as (FLD-22). */
|
|
8
|
+
export declare const REQUIRED_MARKS: readonly ['auto', 'tag', 'asterisk', 'none'];
|
|
9
|
+
export type FrameRequiredMark = (typeof REQUIRED_MARKS)[number];
|
|
10
|
+
/**
|
|
11
|
+
* `comp.<name>.requirement.mark`, the design system's answer — the component's token, which follows
|
|
12
|
+
* `sys.behavior.requirement-mark` unless a layer sets it apart: the first value is what an unknown name
|
|
13
|
+
* falls back to.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SYSTEM_MARKS: readonly ['tag', 'asterisk', 'none'];
|
|
16
|
+
/** The frame's props, as every component that draws it has them (the same ten names, types and defaults). */
|
|
17
|
+
export interface FrameProps {
|
|
18
|
+
label: string;
|
|
19
|
+
labelHidden: boolean;
|
|
20
|
+
supportingText: string;
|
|
21
|
+
errorText: string;
|
|
22
|
+
error: boolean;
|
|
23
|
+
requirement: string;
|
|
24
|
+
requiredMark: string;
|
|
25
|
+
requiredText: string;
|
|
26
|
+
optionalText: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* FLD-24 and its copies: the frame's props with its two words read — the instance's prop, else the product's words
|
|
30
|
+
* (`setWords()`), else nothing. Tanrei has no words of its own: every function of the frame takes what this returns.
|
|
31
|
+
*/
|
|
32
|
+
export declare function frameWithWords(props: FrameProps, words: WordsController): FrameProps;
|
|
33
|
+
/** FLD-4, FLD-22: the requirement, an unknown value behaving as none. */
|
|
34
|
+
export declare const frameRequirement: (props: Pick<FrameProps, 'requirement'>) => FrameRequirement;
|
|
35
|
+
/** FLD-2: the label row is drawn. */
|
|
36
|
+
export declare const frameLabelled: (props: Pick<FrameProps, 'label' | 'labelHidden'>) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* FLD-6, FLD-22: the required mark this frame draws — `auto` leaves it to the styles, which read the design system's
|
|
39
|
+
* choice; `none` while the control is not required or the label is not drawn. An unknown value behaves as auto.
|
|
40
|
+
*/
|
|
41
|
+
export declare function frameMark(props: Pick<FrameProps, 'label' | 'labelHidden' | 'requirement' | 'requiredMark'>): FrameRequiredMark;
|
|
42
|
+
/** FLD-7, FLD-31: the error text the supporting row shows below the help, which stays — `errorText` while the frame is in error; nothing otherwise. */
|
|
43
|
+
export declare const frameErrorText: (props: Pick<FrameProps, 'errorText' | 'error'>) => string;
|
|
44
|
+
/** FLD-4, FLD-11: the optional text that joins the description (assistive technology has no state for it). */
|
|
45
|
+
export declare const frameOptionalText: (props: Pick<FrameProps, 'requirement' | 'optionalText'>) => string;
|
|
46
|
+
/**
|
|
47
|
+
* The debug reports every frame makes about its own props (FLD-22, FLD-24 and their copies): an unknown requirement or
|
|
48
|
+
* required mark, and a requirement word that neither the instance nor the product's words gave (recorded for
|
|
49
|
+
* `missingWords()` in every build). `props` are the frame's with its words read (`frameWithWords()`); `ids` are the
|
|
50
|
+
* component's own behaviour ids for the two sentences and `prefix` its token prefix. The required word is needed only
|
|
51
|
+
* where the tag would be drawn — the mark is tag, by the frame's own prop or by the design system's answer, and the
|
|
52
|
+
* label row is drawn (`row`: false for a label that floats) — or, for a frame that says the requirement in words
|
|
53
|
+
* whichever mark is drawn (`always`: a field group, which has no required state — FGR-24), wherever it is required.
|
|
54
|
+
*/
|
|
55
|
+
export declare function reportFrame(host: Element, props: FrameProps, changed: {
|
|
56
|
+
has: (name: never) => boolean;
|
|
57
|
+
}, ids: {
|
|
58
|
+
unknown: string;
|
|
59
|
+
words: string;
|
|
60
|
+
}, words: WordsController, { prefix, always, row, tag }: {
|
|
61
|
+
prefix: string;
|
|
62
|
+
always?: boolean;
|
|
63
|
+
row?: boolean;
|
|
64
|
+
tag?: string;
|
|
65
|
+
}): void;
|
|
66
|
+
export interface FrameLabelRow extends Pick<FrameProps, 'label' | 'labelHidden' | 'requirement' | 'requiredMark' | 'requiredText' | 'optionalText'> {
|
|
67
|
+
/** The label glyph's box and slot, for a frame that has one (`frameLabelIcon()`); nothing for one that has none (a group). */
|
|
68
|
+
glyph?: TemplateResult | typeof nothing;
|
|
69
|
+
/** The glyph's slot holds something: the row keeps the glyph's room (`data-label-icon`). */
|
|
70
|
+
hasGlyph?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* The label's text is kept from assistive technology: the control is named some other way (a string, `aria-label`)
|
|
73
|
+
* and the drawn text would be read a second time. False where the row itself is the name (a legend, or the target of
|
|
74
|
+
* an `aria-labelledby` in the same root).
|
|
75
|
+
*/
|
|
76
|
+
labelHidden_?: boolean;
|
|
77
|
+
/** The id of the label's text, for a control in the same shadow root to be named by (`aria-labelledby`). */
|
|
78
|
+
labelId?: string;
|
|
79
|
+
/**
|
|
80
|
+
* The frame is disabled: the row says so (`aria-disabled`), as the label of a disabled native control is known to be
|
|
81
|
+
* one — what it holds is disabled content. Left out where an ancestor in the same root already says it (a fieldset).
|
|
82
|
+
*/
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
/** A press on the row (FLD-12): the component moves focus to its control. */
|
|
85
|
+
onPress?: (event: MouseEvent) => void;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The label row (FLD-2, FLD-3, FLD-5, FLD-6): the glyph, the label with the asterisk as its last character, and the
|
|
89
|
+
* requirement tag — a `<tanrei-tag size="small">`, filled for required and tonal for optional, with nothing of the
|
|
90
|
+
* frame's set on it: it reads the Tag's tokens as every tag does. It stands in a box one label line high
|
|
91
|
+
* (`.requirement-box`), which is what the row's layout sees of it. `nothing` while the label is not drawn. Under `requiredMark: auto` both marks
|
|
92
|
+
* are in the row and the styles draw the one the design system names. The asterisk and the tag are kept from assistive
|
|
93
|
+
* technology: the required state, or the description, says what they say.
|
|
94
|
+
*/
|
|
95
|
+
export declare function frameLabelRow(row: FrameLabelRow): TemplateResult | typeof nothing;
|
|
96
|
+
/** The label glyph's box around the `label-icon` slot (FLD-3): decorative, drawn by the icon helper. */
|
|
97
|
+
export declare const frameLabelIcon: (onSlotChange: (event: Event) => void) => TemplateResult;
|
|
98
|
+
/** A row of the frame's small text (FLD-7; a group's description and its error): `nothing` while it has no text. */
|
|
99
|
+
export declare function frameText(text: string, { id, part, className, disabled }: {
|
|
100
|
+
id: string;
|
|
101
|
+
part?: string;
|
|
102
|
+
className?: string;
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
}): TemplateResult | typeof nothing;
|
|
105
|
+
/** What is announced politely and drawn nowhere (FLD-9). */
|
|
106
|
+
export declare const frameAnnouncer: () => TemplateResult;
|
|
107
|
+
/**
|
|
108
|
+
* FLD-9: has assistive technology read `text` once, politely. A new text node in a cleared region is announced even
|
|
109
|
+
* when it repeats the last one. The caller decides when: an error that appeared, or changed its words, while focus is
|
|
110
|
+
* inside the frame.
|
|
111
|
+
*/
|
|
112
|
+
export declare function frameAnnounce(root: ParentNode, text: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* FLD-6 for a browser without style queries: the design system's required mark, by name, on the label row
|
|
115
|
+
* (`data-required-mark`), which the styles read where the query is missing. Call it after every render.
|
|
116
|
+
*/
|
|
117
|
+
export declare function syncFrameMark(host: Element, root: ParentNode, prefix: string): void;
|
|
118
|
+
/**
|
|
119
|
+
* The parts of the frame that a look and a state color, by the names their tokens have. The requirement tag is not one:
|
|
120
|
+
* it is a Tag and takes the Tag's colors (FLD-5).
|
|
121
|
+
*/
|
|
122
|
+
export declare const FRAME_PARTS: readonly ['label', 'label-icon', 'supporting-text', 'required-asterisk'];
|
|
123
|
+
/** Where each look and state of the frame is read: selectors of equal specificity, later ones winning. */
|
|
124
|
+
export interface FrameColorSelectors {
|
|
125
|
+
rest: string;
|
|
126
|
+
error: string;
|
|
127
|
+
/** Left out by a frame that has no focused state (a group). */
|
|
128
|
+
focused?: string;
|
|
129
|
+
focusedError?: string;
|
|
130
|
+
disabled: string;
|
|
131
|
+
disabledError: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The current color of every part, as `--_frame-<part>`, from the tokens of the look (plain, or `error.`) and the state
|
|
135
|
+
* (resting, focused, disabled) the component is in: `<prefix>-<variant>-[<state>-][error-]<part>-color`. The component
|
|
136
|
+
* never computes how a state looks (FLD-8, FLD-13, FLD-14). `plain` names the parts that have no `error.` form of
|
|
137
|
+
* their own — the error text, which is drawn only in error (`<prefix>-<variant>-[<state>-]error-text-color`): they
|
|
138
|
+
* take the same token in both looks. `fallback` names the variant whose token is read where the
|
|
139
|
+
* active design system has none for `variant` — a value a layer added that another system lacks.
|
|
140
|
+
*/
|
|
141
|
+
export declare function frameColors(prefix: string, variant: string, on: FrameColorSelectors, parts?: readonly string[], fallback?: string | null, plain?: readonly string[]): CSSResult;
|
|
142
|
+
export interface FrameStyleOptions {
|
|
143
|
+
/** The component's token prefix: `--tanrei-comp-field`. */
|
|
144
|
+
prefix: `--tanrei-comp-${string}`;
|
|
145
|
+
/** The label's text style, for a component whose label follows its size (the defaults read `<prefix>-label-typescale-*`). */
|
|
146
|
+
label?: {
|
|
147
|
+
font: string;
|
|
148
|
+
letterSpacing: string;
|
|
149
|
+
line: string;
|
|
150
|
+
};
|
|
151
|
+
/** The state motion's tokens; a frame that has none (a group) changes at once. */
|
|
152
|
+
motion?: {
|
|
153
|
+
duration: string;
|
|
154
|
+
easing: string;
|
|
155
|
+
} | null;
|
|
156
|
+
/** The frame has a label glyph (FLD-3). */
|
|
157
|
+
glyph?: boolean;
|
|
158
|
+
/** Where the frame is disabled, for the forced-colors rule (`:host([disabled])`). */
|
|
159
|
+
disabled: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The frame's styles: the label row with its glyph, its asterisk and its requirement tag, the supporting text, and the
|
|
163
|
+
* announcer. Every length, text style and choice is a token of `prefix`; every color is the `--_frame-*` property
|
|
164
|
+
* `frameColors()` wrote. The private names start with `--_frame-` because a control in the default slot inherits them.
|
|
165
|
+
*/
|
|
166
|
+
export declare function frameStyles({ prefix, label, motion, glyph, disabled }: FrameStyleOptions): CSSResult;
|