@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,237 @@
|
|
|
1
|
+
import { unsafeCSS } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* The mark of a glyph that is drawn mirrored in a right-to-left layout: an attribute without a value on
|
|
4
|
+
* the element that holds the glyph's name. Script writes it — `GlyphMirrorController` for a component's own glyphs and
|
|
5
|
+
* the glyphs in its slots, `observeIcons()` for a bare `.tanrei-icon` (src/primitives/glyph-mirror.ts) — because a
|
|
6
|
+
* stylesheet cannot read a name from text; the styles below do the rest, so a change of direction needs no script.
|
|
7
|
+
*/
|
|
8
|
+
export const MIRRORED = 'data-tanrei-mirrored';
|
|
9
|
+
/** The product's word for one use: `data-mirror="auto | always | never"` on the glyph's element. */
|
|
10
|
+
export const MIRROR = 'data-mirror';
|
|
11
|
+
/**
|
|
12
|
+
* The compound a mirrored glyph's element matches, wherever it is: marked by script or forced by the product, not
|
|
13
|
+
* forbidden by the product, in a right-to-left layout. `:dir()` reads the `dir` the element inherits (HTML's rule,
|
|
14
|
+
* across shadow roots), not the `direction` the glyph box sets for its ligature.
|
|
15
|
+
*/
|
|
16
|
+
export const MIRRORED_GLYPH = `:is([${MIRRORED}], [${MIRROR}='always']):not([${MIRROR}='never']):dir(rtl)`;
|
|
17
|
+
/** What mirrors it: left to right, in its own box, its place unchanged. */
|
|
18
|
+
const MIRROR_DECLARATION = 'transform: scaleX(-1);';
|
|
19
|
+
/**
|
|
20
|
+
* The mirroring `iconGlyph()` includes for its box `on`: the box itself when it holds a name the component wrote, and
|
|
21
|
+
* the element in a slot inside it (or `on` itself being the slot) when the product placed the glyph. A slotted `<span>`
|
|
22
|
+
* is an inline box, which cannot be transformed, so a mirrored one is an inline block. Each selector is its own rule: a
|
|
23
|
+
* selector a browser rejects must not take the others with it.
|
|
24
|
+
*/
|
|
25
|
+
const mirrorRules = (on) => `
|
|
26
|
+
${on}${MIRRORED_GLYPH} {
|
|
27
|
+
${MIRROR_DECLARATION}
|
|
28
|
+
}
|
|
29
|
+
${on} ::slotted(${MIRRORED_GLYPH}) {
|
|
30
|
+
display: inline-block;
|
|
31
|
+
${MIRROR_DECLARATION}
|
|
32
|
+
}
|
|
33
|
+
${on}::slotted(${MIRRORED_GLYPH}) {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
${MIRROR_DECLARATION}
|
|
36
|
+
}`;
|
|
37
|
+
/**
|
|
38
|
+
* How a glyph of the system's icon set is drawn — the one source for `icons.css` (`.tanrei-icon` in the
|
|
39
|
+
* light DOM) and for a component that draws its own icon in its shadow root (`iconGlyph()`), the way `shape.ts` is for
|
|
40
|
+
* corners. Every value is a token or a custom property that holds one; the glyph itself belongs to the product.
|
|
41
|
+
*
|
|
42
|
+
* The optical size is the box's, clamped to `sys.icon.optical-size.min/max` (ICB-13), and written into
|
|
43
|
+
* `font-variation-settings` by hand: `font-optical-sizing: auto` alone is not drawn by every engine — WebKit on Linux
|
|
44
|
+
* (its Skia font path) ignores it and draws the font's default opsz (24 for Material Symbols) at every size. The box
|
|
45
|
+
* size becomes a number through `tan(atan2(<length>, 1px))`, which every current engine evaluates, never through
|
|
46
|
+
* `calc(<length> / 1px)`: where that is missing (Firefox) the WHOLE declaration is invalid at computed-value time and
|
|
47
|
+
* fill and weight would be lost with it. The axis is written only where the engine parses that arithmetic
|
|
48
|
+
* (`@supports`); elsewhere `font-optical-sizing: auto` stays the browser's own reading. The grade is left at 0.
|
|
49
|
+
*
|
|
50
|
+
* The weight is `sys.icon.weight` unless the caller names another: a control's own mark is drawn at the weight its
|
|
51
|
+
* component token holds, which changes the stroke and nothing of the box.
|
|
52
|
+
*
|
|
53
|
+
* Every declaration is inherited, so text slotted into the element that carries them — `favorite`, a ligature — is
|
|
54
|
+
* drawn by them too.
|
|
55
|
+
*/
|
|
56
|
+
const glyph = (o) => `
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
font-family: ${o.family};
|
|
59
|
+
font-size: ${o.size};
|
|
60
|
+
font-style: normal;
|
|
61
|
+
font-weight: normal;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
letter-spacing: normal;
|
|
64
|
+
text-transform: none;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
word-wrap: normal;
|
|
67
|
+
direction: ltr;
|
|
68
|
+
-webkit-user-select: none;
|
|
69
|
+
user-select: none;
|
|
70
|
+
font-feature-settings: 'liga';
|
|
71
|
+
-webkit-font-smoothing: antialiased;
|
|
72
|
+
font-optical-sizing: auto;
|
|
73
|
+
font-variation-settings: ${axes(o)};${o.duration && o.easing ? `\n transition: font-variation-settings ${o.duration} ${o.easing};` : ''}`;
|
|
74
|
+
/** The glyph's axes: fill and weight (sys.icon.weight unless the caller names another), and — with `opticalSize` — the box's optical size, clamped to sys.icon.optical-size. */
|
|
75
|
+
const axes = (o, opticalSize = false) => `'FILL' ${o.fill}, 'wght' ${o.weight ?? 'var(--tanrei-sys-icon-weight)'}, 'GRAD' 0${opticalSize ? `, 'opsz' clamp(var(--tanrei-sys-icon-optical-size-min), tan(atan2(${o.size}, 1px)), var(--tanrei-sys-icon-optical-size-max))` : ''}`;
|
|
76
|
+
/**
|
|
77
|
+
* The optical size, set by hand on `selector` wherever the engine can turn the box size into a number (see above). One
|
|
78
|
+
* rule after the glyph's, so an engine that cannot keeps the whole declaration without the axis.
|
|
79
|
+
*/
|
|
80
|
+
const OPTICAL_SIZE_WRITTEN = `(font-variation-settings: 'opsz' tan(atan2(1em, 1px)))`;
|
|
81
|
+
const opticalSize = (selector, o, indent = ' ') => `
|
|
82
|
+
${indent}@supports ${OPTICAL_SIZE_WRITTEN} {
|
|
83
|
+
${indent} ${selector} {
|
|
84
|
+
${indent} font-variation-settings: ${axes(o, true)};
|
|
85
|
+
${indent} }
|
|
86
|
+
${indent}}`;
|
|
87
|
+
/**
|
|
88
|
+
* The same axis for a stylesheet that draws a glyph of the icon set in a box of its own — a generated box (a chevron, an
|
|
89
|
+
* arrow, a check), which cannot carry `.tanrei-icon` — and so writes the glyph's declarations by hand. Such a sheet
|
|
90
|
+
* names the box's size after its glyph rule and leaves the arithmetic and the condition to this one source:
|
|
91
|
+
*
|
|
92
|
+
* @supports glyph-optical-size {
|
|
93
|
+
* <the glyph rule's selector> {
|
|
94
|
+
* font-variation-settings: glyph-axes(<size>); the unselected fill, sys.icon.weight
|
|
95
|
+
* font-variation-settings: glyph-axes(<size>, selected); the selected fill
|
|
96
|
+
* }
|
|
97
|
+
* }
|
|
98
|
+
*
|
|
99
|
+
* scripts/build.js writes the condition and the axes in place (`writeGlyphAxes()`), so what reaches dist/ is the rule
|
|
100
|
+
* `iconGlyph()` and `.tanrei-icon` carry. The source as it stands is a rule no engine reads: unbuilt, the glyph keeps
|
|
101
|
+
* `font-optical-sizing: auto`.
|
|
102
|
+
*/
|
|
103
|
+
export function writeGlyphAxes(css) {
|
|
104
|
+
return css
|
|
105
|
+
.replaceAll('@supports glyph-optical-size {', `@supports ${OPTICAL_SIZE_WRITTEN} {`)
|
|
106
|
+
.replace(/glyph-axes\(((?:[^()]|\((?:[^()]|\([^()]*\))*\))*?)(,\s*selected)?\)/g, (_, size, selected) => axes({ size: size.trim(), fill: `var(--tanrei-sys-icon-fill-${selected ? 'selected' : 'unselected'})` }, true));
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The icon of a component, drawn in its shadow root: `on` is the box that holds the glyph (the slot's
|
|
110
|
+
* parent), at the component's icon size token; `selected` is a selector for an ancestor of `on` that is true when the
|
|
111
|
+
* icon stands for something selected — the component's own `[aria-pressed='true']` — which switches BOTH the family and
|
|
112
|
+
* the fill of the selection (a static icon set is two families, a variable one uses the FILL axis). The fill changes
|
|
113
|
+
* over the component's state duration and easing; a component whose icon never stands for a selection and that has no
|
|
114
|
+
* motion of its own (a tag, TAG-12) leaves `duration` and `easing` out, and the glyph is drawn without a transition.
|
|
115
|
+
*
|
|
116
|
+
* `weight` is the token of the glyph's weight, as `size` is of its box. Left out, the glyph is drawn at
|
|
117
|
+
* `sys.icon.weight`, as every icon is; a control's own mark — the check of a checkbox, the glyph on a
|
|
118
|
+
* switch's handle — names its component token. The weight is the stroke only: the box stays `size`.
|
|
119
|
+
*
|
|
120
|
+
* The box passes its size and selection on as `--tanrei-icon-size`, `--tanrei-icon-fill` and `--tanrei-icon-family`, so
|
|
121
|
+
* a `.tanrei-icon` slotted into it (whose own `icons.css` rules cannot see a shadow root's `aria-pressed`) follows them.
|
|
122
|
+
*
|
|
123
|
+
* In a right-to-left layout it draws mirrored the glyph that carries `data-tanrei-mirrored`: `on` itself,
|
|
124
|
+
* or the element in a slot inside `on`. The component's `GlyphMirrorController` writes that mark, by the glyph's name.
|
|
125
|
+
*/
|
|
126
|
+
export function iconGlyph(on, tokens) {
|
|
127
|
+
const moves = !!tokens.duration && !!tokens.easing;
|
|
128
|
+
return unsafeCSS(`
|
|
129
|
+
${on} {
|
|
130
|
+
--tanrei-icon-size: var(${tokens.size});
|
|
131
|
+
--tanrei-icon-fill: var(--tanrei-sys-icon-fill-unselected);
|
|
132
|
+
--tanrei-icon-family: var(--tanrei-sys-icon-family-unselected);
|
|
133
|
+
display: inline-block;
|
|
134
|
+
flex: none;
|
|
135
|
+
inline-size: var(--tanrei-icon-size);
|
|
136
|
+
block-size: var(--tanrei-icon-size);${glyph({ size: 'var(--tanrei-icon-size)', fill: 'var(--tanrei-icon-fill)', family: 'var(--tanrei-icon-family)', ...(tokens.weight ? { weight: `var(${tokens.weight})` } : {}), ...(moves ? { duration: `var(${tokens.duration})`, easing: `var(${tokens.easing})` } : {}) })}
|
|
137
|
+
}${opticalSize(on, { size: 'var(--tanrei-icon-size)', fill: 'var(--tanrei-icon-fill)', ...(tokens.weight ? { weight: `var(${tokens.weight})` } : {}) })}
|
|
138
|
+
${tokens.selected} ${on} {
|
|
139
|
+
--tanrei-icon-fill: var(--tanrei-sys-icon-fill-selected);
|
|
140
|
+
--tanrei-icon-family: var(--tanrei-sys-icon-family-selected);
|
|
141
|
+
}${mirrorRules(on)}${moves
|
|
142
|
+
? `
|
|
143
|
+
@media (prefers-reduced-motion: reduce) {
|
|
144
|
+
${on} {
|
|
145
|
+
transition: none;
|
|
146
|
+
}
|
|
147
|
+
}`
|
|
148
|
+
: ''}
|
|
149
|
+
`);
|
|
150
|
+
}
|
|
151
|
+
/** `@tanrei/web/icons.css`, written to dist/ by scripts/build.js. */
|
|
152
|
+
export const ICONS_CSS = `/*
|
|
153
|
+
* Tanrei icons on the web. Token-driven; no icon is bundled.
|
|
154
|
+
*
|
|
155
|
+
* The default design system draws icons with Material Symbols Rounded at weight 300. Load that font in your
|
|
156
|
+
* product (it is referenced by name, like the text faces; \`tanrei build\` lists the families a system names), then:
|
|
157
|
+
*
|
|
158
|
+
* <span class="tanrei-icon" aria-hidden="true">favorite</span>
|
|
159
|
+
*
|
|
160
|
+
* THE SIZE. A bare icon is drawn at sys.icon.medium, the default size; data-size="extra-small" | "small" |
|
|
161
|
+
* "medium" | "large" picks a step of sys.icon.
|
|
162
|
+
*
|
|
163
|
+
* THE FILL RULE. An icon that stands for something UNSELECTED is outlined (FILL 0); the same icon in its
|
|
164
|
+
* SELECTED state is filled (FILL 1). You never choose the fill by hand: it follows the state of the control the
|
|
165
|
+
* icon sits in — aria-pressed, aria-selected, aria-checked, aria-current — or \`data-selected\` on the icon or
|
|
166
|
+
* any ancestor. Inside <tanrei-button slot="icon"> it takes the button's icon size; inside a component that draws
|
|
167
|
+
* the selection in its shadow root (<tanrei-button toggle selected>) it takes that component's size, family
|
|
168
|
+
* and fill (--tanrei-icon-size, --tanrei-icon-fill, --tanrei-icon-family, inherited).
|
|
169
|
+
*
|
|
170
|
+
* THE ICON SET belongs to the design system: \`sys.icon.family.unselected\` and \`.selected\`. A variable
|
|
171
|
+
* font (Material Symbols) is one family and the FILL axis tells the two states apart; a static set (Material Icons
|
|
172
|
+
* Outlined / Material Icons) is two families, and the axes below are harmless to it. A selected icon therefore
|
|
173
|
+
* always switches BOTH the family and the fill.
|
|
174
|
+
*
|
|
175
|
+
* RIGHT TO LEFT. A glyph that shows a direction along the line — arrow_back, chevron_right, send, undo — is
|
|
176
|
+
* drawn mirrored in a right-to-left layout (the \`dir\` it inherits), in its own box; a check mark, a magnifier or a
|
|
177
|
+
* play arrow is not. Which names mirror is a fact about the icon set (Google's autoMirrored flag for Material
|
|
178
|
+
* Symbols), so it is resolved by script: Tanrei's components do it for the glyphs in their slots, and
|
|
179
|
+
* \`@tanrei/web\` (or \`@tanrei/web/icons\` alone) does it for every bare .tanrei-icon of the document. Say
|
|
180
|
+
* otherwise for one use with \`data-mirror\`:
|
|
181
|
+
*
|
|
182
|
+
* <span class="tanrei-icon" data-mirror="never">format_align_left</span> a physical direction: never mirrored
|
|
183
|
+
* <span class="tanrei-icon" data-mirror="always">my_arrow</span> mirrored, whatever the list says
|
|
184
|
+
*
|
|
185
|
+
* WITH NO SCRIPT AT ALL nothing reads the names: write data-mirror="always" yourself on each glyph that shows a
|
|
186
|
+
* direction. An image or an SVG is never mirrored for you.
|
|
187
|
+
*
|
|
188
|
+
* GENERATED from src/styles/icons.ts by scripts/build.js (one source with the components' own icons).
|
|
189
|
+
*/
|
|
190
|
+
@layer tanrei.components {
|
|
191
|
+
/* Says that this stylesheet is loaded, to a stylesheet that draws a glyph only where it is (prose.css's task marks, PRS-10). */
|
|
192
|
+
:root {
|
|
193
|
+
--tanrei-icons: 1;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.tanrei-icon {
|
|
197
|
+
--_size: var(--tanrei-icon-size, var(--tanrei-sys-icon-medium));
|
|
198
|
+
--_fill: var(--tanrei-icon-fill, var(--tanrei-sys-icon-fill-unselected));
|
|
199
|
+
--_family: var(--tanrei-icon-family, var(--tanrei-sys-icon-family-unselected));
|
|
200
|
+
display: inline-block;
|
|
201
|
+
flex: none;
|
|
202
|
+
inline-size: var(--_size);
|
|
203
|
+
block-size: var(--_size);${glyph({ size: 'var(--_size)', fill: 'var(--_fill)', family: 'var(--_family)', duration: 'var(--tanrei-sys-motion-duration-short3)', easing: 'var(--tanrei-sys-motion-easing-standard)' })}
|
|
204
|
+
vertical-align: middle;
|
|
205
|
+
}
|
|
206
|
+
${opticalSize('.tanrei-icon', { size: 'var(--_size)', fill: 'var(--_fill)' })}
|
|
207
|
+
|
|
208
|
+
.tanrei-icon[data-size='extra-small'] { --tanrei-icon-size: var(--tanrei-sys-icon-extra-small); }
|
|
209
|
+
.tanrei-icon[data-size='small'] { --tanrei-icon-size: var(--tanrei-sys-icon-small); }
|
|
210
|
+
.tanrei-icon[data-size='medium'] { --tanrei-icon-size: var(--tanrei-sys-icon-medium); }
|
|
211
|
+
.tanrei-icon[data-size='large'] { --tanrei-icon-size: var(--tanrei-sys-icon-large); }
|
|
212
|
+
|
|
213
|
+
/* Selected → the selected family, filled. One rule, everywhere. */
|
|
214
|
+
/* :where() keeps these at the specificity of one class, so the opt-out below always wins. */
|
|
215
|
+
:where([aria-pressed='true'], [aria-selected='true'], [aria-checked='true'], [aria-current]:not([aria-current='false']), [data-selected]:not([data-selected='false'])) .tanrei-icon,
|
|
216
|
+
.tanrei-icon:where([data-selected]:not([data-selected='false'])) {
|
|
217
|
+
--_fill: var(--tanrei-sys-icon-fill-selected);
|
|
218
|
+
--_family: var(--tanrei-sys-icon-family-selected);
|
|
219
|
+
}
|
|
220
|
+
/* An explicitly unselected icon inside a selected region stays outlined. */
|
|
221
|
+
.tanrei-icon[data-selected='false'] {
|
|
222
|
+
--_fill: var(--tanrei-sys-icon-fill-unselected);
|
|
223
|
+
--_family: var(--tanrei-sys-icon-family-unselected);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* Right to left: a glyph the icon set flags (marked by script) or the product forces, unless the product forbids it. */
|
|
227
|
+
.tanrei-icon${MIRRORED_GLYPH} { ${MIRROR_DECLARATION} }
|
|
228
|
+
|
|
229
|
+
@media (prefers-reduced-motion: reduce) {
|
|
230
|
+
.tanrei-icon { transition: none; }
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* Hidden: the icon's own display is an author's rule, and beats the browser's for the attribute. */
|
|
234
|
+
.tanrei-icon[hidden]:not([hidden='until-found' i]) { display: none; }
|
|
235
|
+
}
|
|
236
|
+
`;
|
|
237
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/styles/icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,KAAK,CAAC;AAIhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAE/C,oGAAoG;AACpG,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,QAAQ,OAAO,MAAM,oBAAoB,MAAM,qBAAqB,CAAC;AAE3G,2EAA2E;AAC3E,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC;IAChC,EAAE,GAAG,cAAc;MACjB,kBAAkB;;IAEpB,EAAE,cAAc,cAAc;;MAE5B,kBAAkB;;IAEpB,EAAE,aAAa,cAAc;;MAE3B,kBAAkB;IACpB,CAAC;AAEL;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,KAAK,GAAG,CAAC,CAAsG,EAAE,EAAE,CAAC;;mBAEvG,CAAC,CAAC,MAAM;iBACV,CAAC,CAAC,IAAI;;;;;;;;;;;;;;+BAcQ,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,6CAA6C,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAEjJ,gLAAgL;AAChL,MAAM,IAAI,GAAG,CAAC,CAAkD,EAAE,WAAW,GAAG,KAAK,EAAE,EAAE,CACvF,UAAU,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,MAAM,IAAI,+BAA+B,aAAa,WAAW,CAAC,CAAC,CAAC,qEAAqE,CAAC,CAAC,IAAI,mDAAmD,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAE1O;;;GAGG;AACH,MAAM,oBAAoB,GAAG,wDAAwD,CAAC;AACtF,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,CAAkD,EAAE,MAAM,GAAG,IAAI,EAAE,EAAE,CAAC;EAC3G,MAAM,aAAa,oBAAoB;EACvC,MAAM,KAAK,QAAQ;EACnB,MAAM,gCAAgC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;EACnD,MAAM;EACN,MAAM,GAAG,CAAC;AAEZ;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG;SACP,UAAU,CAAC,gCAAgC,EAAE,aAAa,oBAAoB,IAAI,CAAC;SACnF,OAAO,CAAC,uEAAuE,EAAE,CAAC,CAAC,EAAE,IAAY,EAAE,QAA4B,EAAE,EAAE,CAClI,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,8BAA8B,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,GAAG,EAAE,EAAE,IAAI,CAAC,CAC/G,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,SAAS,CAAC,EAAU,EAAE,MAAuG;IAC3I,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACnD,OAAO,SAAS,CAAC;IACf,EAAE;8BACwB,MAAM,CAAC,IAAI;;;;;;0CAMC,KAAK,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,IAAI,EAAE,yBAAyB,EAAE,MAAM,EAAE,2BAA2B,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,MAAM,CAAC,QAAQ,GAAG,EAAE,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;KAChT,WAAW,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACrJ,MAAM,CAAC,QAAQ,IAAI,EAAE;;;KAGpB,WAAW,CAAC,EAAE,CAAC,GAChB,KAAK;QACH,CAAC,CAAC;;MAEF,EAAE;;;IAGJ;QACE,CAAC,CAAC,EACN;CACD,CAAC,CAAC;AACH,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAmDM,KAAK,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,0CAA0C,EAAE,MAAM,EAAE,0CAA0C,EAAE,CAAC;;;EAGtN,WAAW,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;gBAqB7D,cAAc,MAAM,kBAAkB;;;;;;;;;CASrD,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type CSSResult, nothing } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Text the product gives a component — a label, a value — laid out as text of its own direction (BTN-20
|
|
4
|
+
* and its like): `on` is the box in the component's shadow root that holds the text (a slot's parent, or the element the
|
|
5
|
+
* component writes the string into).
|
|
6
|
+
*
|
|
7
|
+
* - **Isolated, by its first strong character**: `unicode-bidi: plaintext`. On a block it gives each paragraph
|
|
8
|
+
* the base direction of its first strong character; on an inline box it is an isolate of that direction. So
|
|
9
|
+
* `Call +1 555 0100` keeps its order in a right-to-left layout and reorders nothing beside it. The box's own
|
|
10
|
+
* `direction` — what its paddings, its `:dir()` and its children's order follow — is untouched.
|
|
11
|
+
* - **A text without a letter is left to right** in every layout: a paragraph with no strong character is, under
|
|
12
|
+
* `plaintext`, in every engine (UAX #9, P3), whatever the box's `direction`. That is the drawing meant: `−5`, `40 %`
|
|
13
|
+
* and `+1 555 0100` keep their order in a right-to-left layout, where a right-to-left paragraph would draw `5−`,
|
|
14
|
+
* `% 40` and `0100 555 1+` (`product-text-direction.test.ts` holds it). A range given as one
|
|
15
|
+
* string (`10 – 20`) is then read from the left too.
|
|
16
|
+
* - **Cut at its own end**: a line that does not fit must overflow, and take its `text-overflow` ellipsis, at the
|
|
17
|
+
* end of the text's own direction, so a left-to-right label in a right-to-left layout loses its right end. `plaintext`
|
|
18
|
+
* alone gives that in Chromium only, which places the ellipsis by the paragraph's direction. WebKit and Firefox place
|
|
19
|
+
* it by the BOX's `direction`, which is still the layout's: WebKit then cuts a label of the other direction at its
|
|
20
|
+
* beginning, and Firefox clips it mid-letter with no ellipsis (its overflow lies on the side the box cannot scroll
|
|
21
|
+
* to). So a box that can be cut also takes the text's direction as its own: `dir=${'${ownDirection(text)}'}` on the
|
|
22
|
+
* element in the template (below). A box that is never cut — it wraps, or is as wide as its line — needs nothing.
|
|
23
|
+
* - **Placed and aligned by the layout**: where the component places the box — the flex order, the paddings — is
|
|
24
|
+
* the layout's already. The LINES inside it would follow the paragraph (`text-align: start` is resolved against the
|
|
25
|
+
* paragraph's direction under `plaintext`), so `align: 'start'` aligns them physically by the direction the box
|
|
26
|
+
* inherits: left, and right under `:dir(rtl)` — its own where it has no `dir`, and its parent's where it took the
|
|
27
|
+
* text's direction with `ownDirection()` (so `on` is then a selector whose first compound is the box itself or an
|
|
28
|
+
* ancestor of the layout's direction). A line too long for such a box still overflows at the text's own end, whatever
|
|
29
|
+
* the alignment. (`text-align: match-parent` says the same in one word and is not used: Chrome knows it only as
|
|
30
|
+
* `-webkit-match-parent`, and an unknown value would drop the declaration.) Leave `align` out for a box whose lines
|
|
31
|
+
* are centred, or that is exactly as wide as its one line.
|
|
32
|
+
* - **Its two inline paddings are equal** (or it has none): room on one side of the text — a gap to an icon, an
|
|
33
|
+
* inset — is a margin of the box or a padding of its parent. WebKit lays a paragraph whose direction is not the
|
|
34
|
+
* layout's over the padding where the two differ (the main action button's label stood against its icon, MAB-19;
|
|
35
|
+
* a description in prose at its term's edge). `product-text.test.ts` looks at every fixture for it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function productText(on: string, { align }?: {
|
|
38
|
+
align?: 'start';
|
|
39
|
+
}): CSSResult;
|
|
40
|
+
/**
|
|
41
|
+
* The `dir` attribute of a box that holds a product's text on one line and cuts it (`overflow: hidden` with
|
|
42
|
+
* `text-overflow: ellipsis`): `auto` — the direction of the text's first strong character becomes the box's own, so
|
|
43
|
+
* every engine cuts the text, and draws the ellipsis, at the text's own end (see `productText()`) —
|
|
44
|
+
* and no attribute at all for a text without a letter (a count, a date): its box keeps the layout's direction, which
|
|
45
|
+
* places it, and its text is left to right there as everywhere (see `productText()`).
|
|
46
|
+
*
|
|
47
|
+
* Use it only on a box whose own `direction` places nothing: no inline-start or inline-end inset, padding or margin of
|
|
48
|
+
* its own, no `text-align: start` and no `:dir()` rule of the component's (`productText()`'s `align: 'start'` is
|
|
49
|
+
* written for it: it aligns such a box by its parent's direction). A box that needs those keeps them and holds the
|
|
50
|
+
* text in a child that takes this attribute.
|
|
51
|
+
*/
|
|
52
|
+
export declare function ownDirection(text: string): 'auto' | typeof nothing;
|
|
53
|
+
/** The direction of a text's first strong character — a letter, or a direction mark — or null where it has none. */
|
|
54
|
+
export declare function firstStrong(text: string | null | undefined): 'ltr' | 'rtl' | null;
|
|
55
|
+
/**
|
|
56
|
+
* The direction of the one run of writing a value makes with its prefix and its suffix (NMI-39, TXI-67): that of the
|
|
57
|
+
* first strong character of the prefix, then of the suffix, and left-to-right where neither has one — no affix, or
|
|
58
|
+
* signs alone — because a number is written left to right. It is the `dir` of the box that holds the three, in every
|
|
59
|
+
* layout direction; nothing but the two affixes is read (not the text being typed, the value or the locale), so
|
|
60
|
+
* nothing changes sides while a person types.
|
|
61
|
+
*
|
|
62
|
+
* The box's own `direction` then differs from the layout's wherever the run runs against it. So the box places nothing
|
|
63
|
+
* of its own by a logical side that is meant as the layout's (a margin toward an icon is written from the layout's
|
|
64
|
+
* side for that case), and the native element inside it is aligned physically.
|
|
65
|
+
*/
|
|
66
|
+
export declare function runDirection(prefixText: string | null | undefined, suffixText: string | null | undefined): 'ltr' | 'rtl';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { nothing, unsafeCSS } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Text the product gives a component — a label, a value — laid out as text of its own direction (BTN-20
|
|
4
|
+
* and its like): `on` is the box in the component's shadow root that holds the text (a slot's parent, or the element the
|
|
5
|
+
* component writes the string into).
|
|
6
|
+
*
|
|
7
|
+
* - **Isolated, by its first strong character**: `unicode-bidi: plaintext`. On a block it gives each paragraph
|
|
8
|
+
* the base direction of its first strong character; on an inline box it is an isolate of that direction. So
|
|
9
|
+
* `Call +1 555 0100` keeps its order in a right-to-left layout and reorders nothing beside it. The box's own
|
|
10
|
+
* `direction` — what its paddings, its `:dir()` and its children's order follow — is untouched.
|
|
11
|
+
* - **A text without a letter is left to right** in every layout: a paragraph with no strong character is, under
|
|
12
|
+
* `plaintext`, in every engine (UAX #9, P3), whatever the box's `direction`. That is the drawing meant: `−5`, `40 %`
|
|
13
|
+
* and `+1 555 0100` keep their order in a right-to-left layout, where a right-to-left paragraph would draw `5−`,
|
|
14
|
+
* `% 40` and `0100 555 1+` (`product-text-direction.test.ts` holds it). A range given as one
|
|
15
|
+
* string (`10 – 20`) is then read from the left too.
|
|
16
|
+
* - **Cut at its own end**: a line that does not fit must overflow, and take its `text-overflow` ellipsis, at the
|
|
17
|
+
* end of the text's own direction, so a left-to-right label in a right-to-left layout loses its right end. `plaintext`
|
|
18
|
+
* alone gives that in Chromium only, which places the ellipsis by the paragraph's direction. WebKit and Firefox place
|
|
19
|
+
* it by the BOX's `direction`, which is still the layout's: WebKit then cuts a label of the other direction at its
|
|
20
|
+
* beginning, and Firefox clips it mid-letter with no ellipsis (its overflow lies on the side the box cannot scroll
|
|
21
|
+
* to). So a box that can be cut also takes the text's direction as its own: `dir=${'${ownDirection(text)}'}` on the
|
|
22
|
+
* element in the template (below). A box that is never cut — it wraps, or is as wide as its line — needs nothing.
|
|
23
|
+
* - **Placed and aligned by the layout**: where the component places the box — the flex order, the paddings — is
|
|
24
|
+
* the layout's already. The LINES inside it would follow the paragraph (`text-align: start` is resolved against the
|
|
25
|
+
* paragraph's direction under `plaintext`), so `align: 'start'` aligns them physically by the direction the box
|
|
26
|
+
* inherits: left, and right under `:dir(rtl)` — its own where it has no `dir`, and its parent's where it took the
|
|
27
|
+
* text's direction with `ownDirection()` (so `on` is then a selector whose first compound is the box itself or an
|
|
28
|
+
* ancestor of the layout's direction). A line too long for such a box still overflows at the text's own end, whatever
|
|
29
|
+
* the alignment. (`text-align: match-parent` says the same in one word and is not used: Chrome knows it only as
|
|
30
|
+
* `-webkit-match-parent`, and an unknown value would drop the declaration.) Leave `align` out for a box whose lines
|
|
31
|
+
* are centred, or that is exactly as wide as its one line.
|
|
32
|
+
* - **Its two inline paddings are equal** (or it has none): room on one side of the text — a gap to an icon, an
|
|
33
|
+
* inset — is a margin of the box or a padding of its parent. WebKit lays a paragraph whose direction is not the
|
|
34
|
+
* layout's over the padding where the two differ (the main action button's label stood against its icon, MAB-19;
|
|
35
|
+
* a description in prose at its term's edge). `product-text.test.ts` looks at every fixture for it.
|
|
36
|
+
*/
|
|
37
|
+
export function productText(on, { align } = {}) {
|
|
38
|
+
// Each selector of the right-to-left rule weighs what `on:dir(rtl)` weighs, so a component's own rule after this one
|
|
39
|
+
// overrides it as it always did.
|
|
40
|
+
return unsafeCSS(`
|
|
41
|
+
${on} {
|
|
42
|
+
unicode-bidi: plaintext;${align === 'start' ? '\n text-align: left;' : ''}
|
|
43
|
+
}${align === 'start'
|
|
44
|
+
? `
|
|
45
|
+
${on}:dir(rtl):where(:not([dir])),
|
|
46
|
+
:dir(rtl) > ${on}:where([dir]),
|
|
47
|
+
:host(:where(:dir(rtl))) > ${on}:where([dir]) {
|
|
48
|
+
text-align: right;
|
|
49
|
+
}`
|
|
50
|
+
: ''}
|
|
51
|
+
`);
|
|
52
|
+
}
|
|
53
|
+
/** A character with a direction of its own: a letter of any script (digits, signs and spaces have none). */
|
|
54
|
+
const STRONG = /\p{L}/u;
|
|
55
|
+
/**
|
|
56
|
+
* A run the product isolated already (U+2066, U+2067 or U+2068 … U+2069): it has a direction of its own and gives the
|
|
57
|
+
* text around it none (UAX #9, P2 — the first strong character is looked for outside the isolates).
|
|
58
|
+
*/
|
|
59
|
+
const ISOLATED = /[\u2066-\u2068][^\u2066-\u2069]*\u2069/g;
|
|
60
|
+
/** Whether `text` has a first strong character: a letter outside every run the product isolated. */
|
|
61
|
+
function hasLetter(text) {
|
|
62
|
+
let outside = text;
|
|
63
|
+
// An isolate inside an isolate: the innermost go first.
|
|
64
|
+
for (let before = ''; before !== outside;) {
|
|
65
|
+
before = outside;
|
|
66
|
+
outside = outside.replace(ISOLATED, '');
|
|
67
|
+
}
|
|
68
|
+
return STRONG.test(outside);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The `dir` attribute of a box that holds a product's text on one line and cuts it (`overflow: hidden` with
|
|
72
|
+
* `text-overflow: ellipsis`): `auto` — the direction of the text's first strong character becomes the box's own, so
|
|
73
|
+
* every engine cuts the text, and draws the ellipsis, at the text's own end (see `productText()`) —
|
|
74
|
+
* and no attribute at all for a text without a letter (a count, a date): its box keeps the layout's direction, which
|
|
75
|
+
* places it, and its text is left to right there as everywhere (see `productText()`).
|
|
76
|
+
*
|
|
77
|
+
* Use it only on a box whose own `direction` places nothing: no inline-start or inline-end inset, padding or margin of
|
|
78
|
+
* its own, no `text-align: start` and no `:dir()` rule of the component's (`productText()`'s `align: 'start'` is
|
|
79
|
+
* written for it: it aligns such a box by its parent's direction). A box that needs those keeps them and holds the
|
|
80
|
+
* text in a child that takes this attribute.
|
|
81
|
+
*/
|
|
82
|
+
export function ownDirection(text) {
|
|
83
|
+
return hasLetter(text) ? 'auto' : nothing;
|
|
84
|
+
}
|
|
85
|
+
/** The scripts written from right to left (the bidirectional classes R and AL, as far as a product writes a unit in them). */
|
|
86
|
+
const RIGHT_TO_LEFT = /[\p{Script=Hebrew}\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Nko}\p{Script=Adlam}\p{Script=Samaritan}\p{Script=Mandaic}\p{Script=Hanifi_Rohingya}]/u;
|
|
87
|
+
/** The direction marks a product may write to say which way a text without a letter of that direction runs. */
|
|
88
|
+
const MARKS = { '': 'ltr', '': 'rtl', '': 'rtl' };
|
|
89
|
+
/** The direction of a text's first strong character — a letter, or a direction mark — or null where it has none. */
|
|
90
|
+
export function firstStrong(text) {
|
|
91
|
+
for (const character of text ?? '') {
|
|
92
|
+
const mark = MARKS[character];
|
|
93
|
+
if (mark)
|
|
94
|
+
return mark;
|
|
95
|
+
if (STRONG.test(character))
|
|
96
|
+
return RIGHT_TO_LEFT.test(character) ? 'rtl' : 'ltr';
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The direction of the one run of writing a value makes with its prefix and its suffix (NMI-39, TXI-67): that of the
|
|
102
|
+
* first strong character of the prefix, then of the suffix, and left-to-right where neither has one — no affix, or
|
|
103
|
+
* signs alone — because a number is written left to right. It is the `dir` of the box that holds the three, in every
|
|
104
|
+
* layout direction; nothing but the two affixes is read (not the text being typed, the value or the locale), so
|
|
105
|
+
* nothing changes sides while a person types.
|
|
106
|
+
*
|
|
107
|
+
* The box's own `direction` then differs from the layout's wherever the run runs against it. So the box places nothing
|
|
108
|
+
* of its own by a logical side that is meant as the layout's (a margin toward an icon is written from the layout's
|
|
109
|
+
* side for that case), and the native element inside it is aligned physically.
|
|
110
|
+
*/
|
|
111
|
+
export function runDirection(prefixText, suffixText) {
|
|
112
|
+
return firstStrong(prefixText) ?? firstStrong(suffixText) ?? 'ltr';
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=product-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-text.js","sourceRoot":"","sources":["../../src/styles/product-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,WAAW,CAAC,EAAU,EAAE,EAAE,KAAK,EAAE,GAAwB,EAAE;IACzE,qHAAqH;IACrH,iCAAiC;IACjC,OAAO,SAAS,CAAC;IACf,EAAE;8BACwB,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE;KAE5E,KAAK,KAAK,OAAO;QACf,CAAC,CAAC;IACJ,EAAE;gBACU,EAAE;+BACa,EAAE;;IAE7B;QACE,CAAC,CAAC,EACN;CACD,CAAC,CAAC;AACH,CAAC;AAED,4GAA4G;AAC5G,MAAM,MAAM,GAAG,QAAQ,CAAC;AAExB;;;GAGG;AACH,MAAM,QAAQ,GAAG,yCAAyC,CAAC;AAE3D,oGAAoG;AACpG,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,wDAAwD;IACxD,KAAK,IAAI,MAAM,GAAG,EAAE,EAAE,MAAM,KAAK,OAAO,GAAI,CAAC;QAC3C,MAAM,GAAG,OAAO,CAAC;QACjB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AAC5C,CAAC;AAED,8HAA8H;AAC9H,MAAM,aAAa,GAAG,uKAAuK,CAAC;AAC9L,+GAA+G;AAC/G,MAAM,KAAK,GAAkC,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAEpF,oHAAoH;AACpH,MAAM,UAAU,WAAW,CAAC,IAA+B;IACzD,KAAK,MAAM,SAAS,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;QAC9B,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;QACtB,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;YAAE,OAAO,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACnF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,UAAqC,EAAE,UAAqC;IACvG,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names the package uses where a registered property would otherwise serve, kept unregistered. A page has none of
|
|
3
|
+
* them registered,
|
|
4
|
+
* whatever it loads: a registered property has its initial value on the root, and these have none.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RETIRED_NAMES: readonly string[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// The custom properties the package registers: none — and why none.
|
|
2
|
+
//
|
|
3
|
+
// A registered custom property is not free for the page it is registered on. On a page whose elements inherit the ten
|
|
4
|
+
// thousand custom properties of `tokens.css`, ONE registered name anywhere in the document — by an `@property` rule or
|
|
5
|
+
// by `CSS.registerProperty()`, used or not — makes every element on which a transition starts cost Chromium about
|
|
6
|
+
// 0.7 ms a restyle, where it costs 0.01 ms without; and one that inherits makes WebKit pay the same for every element
|
|
7
|
+
// whose `transition-property` is `all` (a change of contrast on
|
|
8
|
+
// 300 buttons takes 278 ms against 41). So:
|
|
9
|
+
//
|
|
10
|
+
// - `dist/tokens.css` registers NOTHING, and no element of a shadow root needs a registered name. The switch draws
|
|
11
|
+
// its one progress by real properties — a `translate`, layers' opacities, a share of a ruler — and the calendar
|
|
12
|
+
// writes its progress in each frame of a clock of its own; neither name is registered.
|
|
13
|
+
// - No stylesheet that draws a component where no script runs registers a name either — not the link's,
|
|
14
|
+
// prose's, the accordion's or the tree view's. What a registered name would do is done without one:
|
|
15
|
+
// · a line's height as a length, for a part whose font is its own (a glyph, a task's mark, a trailing text): the
|
|
16
|
+
// part says `1lh` in its own `line-height`, where the unit is the PARENT's line, and reads it back as its own
|
|
17
|
+
// `1lh`; a glyph's one line of text, now taller than its box, is centred on the box by a flex container;
|
|
18
|
+
// · a state's color changing over the state motion: the background's own transition;
|
|
19
|
+
// · the hold of a press that no script answers, on an inline box that can hold no layer: the pressed color is
|
|
20
|
+
// an image of one color and the state's color under it is clipped away, both said by two unregistered names
|
|
21
|
+
// that step back after press-hold — properties with no transition of their own, so nothing fades while it is
|
|
22
|
+
// held. The hold ends in a step, where a registered number would leave over the state motion;
|
|
23
|
+
// · the accordion's clock, whose transition the element hears: an unregistered name that changes in one step
|
|
24
|
+
// over the disclosure motion (`allow-discrete`) — nothing is drawn from it;
|
|
25
|
+
// · the tree view's depth as a length: the sum as it is written, one `calc()` longer a level, handed down in
|
|
26
|
+
// two unregistered names and computed where a real property reads it;
|
|
27
|
+
// · a length the tree view's element reads from script (the indent of a level, the least width of a chevron's
|
|
28
|
+
// hit area): said in a real property that draws nothing on the tree (`object-position`), which computes it.
|
|
29
|
+
// The press that a stylesheet holds where no script answers it (the table of contents, the breadcrumbs, a table's
|
|
30
|
+
// sort button, the pagination) is an unregistered property that steps as well: `transition-behavior: allow-discrete`.
|
|
31
|
+
//
|
|
32
|
+
// src/styles/registered-properties.test.ts holds it in three engines: no `@property` rule in any stylesheet of `dist/`,
|
|
33
|
+
// no `CSS.registerProperty()` in any source, and none of the names below answering on a page of every element.
|
|
34
|
+
/**
|
|
35
|
+
* The names the package uses where a registered property would otherwise serve, kept unregistered. A page has none of
|
|
36
|
+
* them registered,
|
|
37
|
+
* whatever it loads: a registered property has its initial value on the root, and these have none.
|
|
38
|
+
*/
|
|
39
|
+
export const RETIRED_NAMES = [
|
|
40
|
+
// The switch's progress and the two ends of each of its six mixed parts; the calendar's progress.
|
|
41
|
+
'--_tanrei-switch-progress',
|
|
42
|
+
...['c', 't', 'o', 'h', 'l', 'hs'].flatMap((key) => [`--_tanrei-switch-${key}0`, `--_tanrei-switch-${key}1`]),
|
|
43
|
+
'--_tanrei-calendar-progress',
|
|
44
|
+
// The press a stylesheet holds where no script answers it (TOC-20, BRC-18, TBL-37, PGN-10): a property that steps.
|
|
45
|
+
'--_toc-pressed',
|
|
46
|
+
'--_brc-pressed',
|
|
47
|
+
'--_table-pressed',
|
|
48
|
+
'--_pgn-pressed',
|
|
49
|
+
// The link's and prose's four: a line's height as a length, the hold of a press on an inline box and the color
|
|
50
|
+
// under it (LNK-8, LNK-11).
|
|
51
|
+
'--_link-line',
|
|
52
|
+
'--_link-pressed',
|
|
53
|
+
'--_link-shown-container',
|
|
54
|
+
'--_prose-line-height',
|
|
55
|
+
// The accordion's three: the label's line as a length, the held press, and the item's clock, which is
|
|
56
|
+
// `--_acc-open`, unregistered, and so has no value where no item sets it.
|
|
57
|
+
'--_acc-line',
|
|
58
|
+
'--_acc-pressed',
|
|
59
|
+
'--_acc-open',
|
|
60
|
+
// The tree view's five: a row's line as a length, the indent of a level and the depth as lengths computed once, and
|
|
61
|
+
// the least width of a chevron's hit area.
|
|
62
|
+
'--_trv-line',
|
|
63
|
+
'--_trv-step',
|
|
64
|
+
'--_trv-inset',
|
|
65
|
+
'--_trv-outer',
|
|
66
|
+
'--_trv-target',
|
|
67
|
+
];
|
|
68
|
+
//# sourceMappingURL=registered-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registered-properties.js","sourceRoot":"","sources":["../../src/styles/registered-properties.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,sHAAsH;AACtH,uHAAuH;AACvH,kHAAkH;AAClH,sHAAsH;AACtH,gEAAgE;AAChE,4CAA4C;AAC5C,EAAE;AACF,qHAAqH;AACrH,oHAAoH;AACpH,2FAA2F;AAC3F,0GAA0G;AAC1G,wGAAwG;AACxG,uHAAuH;AACvH,sHAAsH;AACtH,iHAAiH;AACjH,2FAA2F;AAC3F,oHAAoH;AACpH,oHAAoH;AACpH,qHAAqH;AACrH,sGAAsG;AACtG,mHAAmH;AACnH,oFAAoF;AACpF,mHAAmH;AACnH,8EAA8E;AAC9E,oHAAoH;AACpH,oHAAoH;AACpH,sHAAsH;AACtH,0HAA0H;AAC1H,EAAE;AACF,wHAAwH;AACxH,+GAA+G;AAE/G;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,kGAAkG;IAClG,2BAA2B;IAC3B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,oBAAoB,GAAG,GAAG,EAAE,oBAAoB,GAAG,GAAG,CAAC,CAAC;IAC7G,6BAA6B;IAC7B,mHAAmH;IACnH,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,+GAA+G;IAC/G,4BAA4B;IAC5B,cAAc;IACd,iBAAiB;IACjB,yBAAyB;IACzB,sBAAsB;IACtB,sGAAsG;IACtG,0EAA0E;IAC1E,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,oHAAoH;IACpH,2CAA2C;IAC3C,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;CAChB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Corner smoothing: how a corner eases into the straight edge, `--tanrei-sys-shape-corner-smoothing`
|
|
3
|
+
* 0–1 with Figma's meaning — 0 a quarter circle, 0.6 the iOS continuous corner. One rule, shared by every component
|
|
4
|
+
* that rounds a box (and by `shape.css` for light-DOM boxes): an element with `data-tanrei-shape` draws its corners
|
|
5
|
+
* at the radius it names in `--tanrei-corner-radius`, eased by the amount where the browser has `corner-shape`
|
|
6
|
+
* (Chromium 139+, WebKit 26.6), and circular — the amount at 0 — where it does not. A box names its radius with
|
|
7
|
+
* `cornerRadius(token)`, which also carries whether that token is a pill (below).
|
|
8
|
+
*
|
|
9
|
+
* The web has no Bézier corners on a box, only the superellipse `corner-shape: superellipse(k)` (k = log2 of the
|
|
10
|
+
* exponent; round is k = 1). A superellipse at the token's radius can never come nearer Apple's corner than a circle
|
|
11
|
+
* does (every k ≠ 1 measured farther: 18 px² for the circle, 27+ for the rest on the 180×80 r20 box), because Apple's
|
|
12
|
+
* curve is as deep as the circle on the diagonal but reaches 1.53 r along the edges. So the amount moves TWO things,
|
|
13
|
+
* both linear in the amount and both the identity at 0:
|
|
14
|
+
*
|
|
15
|
+
* exponent n = 2 + s → `superellipse(log(2 + s, 2))` (2 = a circle; 2.6 at s = 0.6)
|
|
16
|
+
* radius r · (1 + 0.4 s) → `--_corner-scale` (1.24 r at s = 0.6)
|
|
17
|
+
*
|
|
18
|
+
* Linear, because the token defines two points — 0 = circle, 0.6 = the iOS corner — and between them nothing else is
|
|
19
|
+
* measured; the exponent's form is the natural one (each tenth of smoothing adds a tenth to the exponent). Measured
|
|
20
|
+
* in Chromium at 8× on the 180×80 r20 box: at s = 0.6 the symmetric difference is 9.5 px² from Figma's construction
|
|
21
|
+
* (the floor of the whole superellipse family is
|
|
22
|
+
* 9.3, a circle is 15.9 away) and 5.7 px² from CoreGraphics' `RoundedRectangle(style: .continuous)`
|
|
23
|
+
* (`packages/flutter/tool/continuous_corner_reference.swift`; a circle: 18.2, Figma's construction itself: 4.6), and
|
|
24
|
+
* 1.4 px² from CoreGraphics on 180×80 r10 and 180×36 r10 (cupertino's button). Above 0.6 the superellipse family
|
|
25
|
+
* drifts from Figma's construction (22 px² at 0.8, 60 at 1 on the r20 box) — the amounts a shipped system uses are
|
|
26
|
+
* 0 and 0.6. The tool: `scripts/measure-corner-smoothing.mjs`.
|
|
27
|
+
*
|
|
28
|
+
* A pill: a radius of at least half the short side is clamped by the browser, so only the exponent would apply and
|
|
29
|
+
* the caps would flatten where Figma's construction (whose per-corner budget clamps the smoothing to 0) draws a
|
|
30
|
+
* circle. CSS cannot tell an element its radius was clamped, but the build knows which shape tokens are the full step:
|
|
31
|
+
* the CSS emitter writes, next to every comp token whose alias chain reaches `sys.shape.corner.full`, a companion
|
|
32
|
+
* `<token>-pill: 1` (0 for every other comp shape token). A box names it with its radius — `cornerRadius(token)` does
|
|
33
|
+
* both — and `--tanrei-corner-pill: 1` takes the smoothing to 0 for that box: `corner-shape` round, radius unscaled,
|
|
34
|
+
* whatever the amount. It follows the token file, not a runtime override of the radius alone; a light-DOM pill of your
|
|
35
|
+
* own sets `--tanrei-corner-pill: 1` itself.
|
|
36
|
+
*
|
|
37
|
+
* The radius in `border-radius` is scaled, so every derived radius (a focus ring's, a ripple's) must multiply by
|
|
38
|
+
* `--_corner-scale` too, and pseudo-elements inherit the curve with `corner-shape: inherit`.
|
|
39
|
+
*/
|
|
40
|
+
export declare const SHAPE_CSS = ":where([data-tanrei-shape]) {\n --tanrei-corner-pill: 0;\n}\n[data-tanrei-shape] {\n --_corner-scale: 1;\n border-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale));\n}\n@supports (corner-shape: superellipse(log(2, 2))) {\n [data-tanrei-shape] {\n --_corner-smoothing: calc(var(--tanrei-sys-shape-corner-smoothing, 0) * (1 - var(--tanrei-corner-pill, 0)));\n --_corner-scale: calc(1 + 0.4 * var(--_corner-smoothing));\n corner-shape: superellipse(log(calc(2 + var(--_corner-smoothing)), 2));\n }\n}\n[data-tanrei-shape]::before,\n[data-tanrei-shape]::after {\n corner-shape: inherit;\n}";
|
|
41
|
+
/**
|
|
42
|
+
* The declarations with which a box names its shape token: its radius, and whether that token is the full step (a
|
|
43
|
+
* pill, drawn round whatever the smoothing — the emitter's `<token>-pill` companion). Use it wherever the component
|
|
44
|
+
* would otherwise write `--tanrei-corner-radius`, once per state that has its own shape token.
|
|
45
|
+
*/
|
|
46
|
+
export declare const cornerRadius: (token: `--${string}`) => string;
|
|
47
|
+
/**
|
|
48
|
+
* The same corner for a box that HOLDS other components — the container of a composed element: the rule
|
|
49
|
+
* written out for one selector, with no custom property. A custom property on such a box is inherited by every member
|
|
50
|
+
* inside it, and a composed element's stylesheet writes none (web-composing.md W3), so it cannot carry
|
|
51
|
+
* `data-tanrei-shape`. `radius` is the box's radius as a CSS length expression, and `pill` the emitter's
|
|
52
|
+
* `<token>-pill` mark of its shape token, as a CSS number expression (`var(--tanrei-comp-…-container-shape-pill, 0)`).
|
|
53
|
+
* What is concentric with the box gets its radius from `heldRadius()`, and its pseudo-elements inherit the curve.
|
|
54
|
+
*/
|
|
55
|
+
export declare const heldShape: (selector: string, radius: string, pill: string) => string;
|
|
56
|
+
/** The radius a box of `heldShape()` is drawn with where the browser eases corners: `radius`, scaled as the one rule scales it. */
|
|
57
|
+
export declare const heldRadius: (radius: string, pill: string) => string;
|
|
58
|
+
/** The same rule, for a component's shadow styles. */
|
|
59
|
+
export declare const shape: import("lit").CSSResult;
|