@botiverse/raft-ui 0.51.0 → 0.52.1
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/CHANGELOG.md +26 -0
- package/dist/components/activity-inbox/activity-inbox-shell.d.mts +12 -0
- package/dist/components/activity-inbox/activity-inbox-shell.mjs +39 -0
- package/dist/components/activity-inbox/activity-inbox-shell.recipe.mjs +14 -0
- package/dist/components/activity-inbox/activity-inbox-sidebar.d.mts +6 -0
- package/dist/components/activity-inbox/activity-inbox-sidebar.mjs +22 -0
- package/dist/components/activity-inbox/activity-inbox-sidebar.recipe.mjs +22 -0
- package/dist/components/activity-inbox/activity-inbox-toolbar.d.mts +9 -0
- package/dist/components/activity-inbox/activity-inbox-toolbar.mjs +29 -0
- package/dist/components/activity-inbox/activity-inbox-toolbar.recipe.mjs +14 -0
- package/dist/components/activity-inbox/index.d.mts +4 -0
- package/dist/components/alert-dialog/alert-dialog.d.mts +41 -0
- package/dist/components/alert-dialog/alert-dialog.mjs +163 -0
- package/dist/components/alert-dialog/index.d.mts +2 -0
- package/dist/components/announcement-dialog/announcement-dialog.d.mts +18 -0
- package/dist/components/announcement-dialog/announcement-dialog.mjs +121 -0
- package/dist/components/announcement-dialog/index.d.mts +3 -0
- package/dist/components/app-rail/app-rail.d.mts +31 -0
- package/dist/components/app-rail/app-rail.mjs +126 -0
- package/dist/components/app-rail/app-rail.recipe.mjs +47 -0
- package/dist/components/app-rail/index.d.mts +2 -0
- package/dist/components/app-shell/app-shell.d.mts +27 -0
- package/dist/components/app-shell/app-shell.mjs +217 -0
- package/dist/components/app-shell/index.d.mts +2 -0
- package/dist/components/avatar/avatar.d.mts +169 -0
- package/dist/components/avatar/avatar.mjs +298 -0
- package/dist/components/avatar/index.d.mts +2 -0
- package/dist/components/badge/badge.d.mts +89 -0
- package/dist/components/badge/badge.mjs +203 -0
- package/dist/components/badge/index.d.mts +2 -0
- package/dist/components/banner/banner.d.mts +141 -0
- package/dist/components/banner/banner.mjs +228 -0
- package/dist/components/banner/index.d.mts +2 -0
- package/dist/components/button/button.d.mts +257 -0
- package/dist/components/button/button.mjs +177 -0
- package/dist/components/button/index.d.mts +2 -0
- package/dist/components/card/card.d.mts +21 -0
- package/dist/components/card/card.mjs +114 -0
- package/dist/components/card/card.recipe.d.mts +105 -0
- package/dist/components/card/card.recipe.mjs +67 -0
- package/dist/components/card/index.d.mts +2 -0
- package/dist/components/checkbox/checkbox-indicator.d.mts +92 -0
- package/dist/components/checkbox/checkbox-indicator.mjs +61 -0
- package/dist/components/checkbox/checkbox.d.mts +9 -0
- package/dist/components/checkbox/checkbox.mjs +40 -0
- package/dist/components/checkbox/index.d.mts +3 -0
- package/dist/components/choice-list/choice-list.d.mts +103 -0
- package/dist/components/choice-list/choice-list.mjs +301 -0
- package/dist/components/choice-list/choice-list.recipe.mjs +44 -0
- package/dist/components/choice-list/index.d.mts +2 -0
- package/dist/components/code-block/code-block.d.mts +30 -0
- package/dist/components/code-block/code-block.mjs +151 -0
- package/dist/components/code-block/code-block.recipe.mjs +47 -0
- package/dist/components/code-block/index.d.mts +2 -0
- package/dist/components/combobox/combobox.d.mts +69 -0
- package/dist/components/combobox/combobox.mjs +438 -0
- package/dist/components/combobox/index.d.mts +2 -0
- package/dist/components/combobox-select/combobox-select.d.mts +4 -0
- package/dist/components/combobox-select/combobox-select.list-side.mjs +16 -0
- package/dist/components/combobox-select/combobox-select.mjs +473 -0
- package/dist/components/combobox-select/combobox-select.options.mjs +21 -0
- package/dist/components/combobox-select/combobox-select.types.d.mts +83 -0
- package/dist/components/combobox-select/index.d.mts +3 -0
- package/dist/components/comment/comment-card.d.mts +40 -0
- package/dist/components/comment/comment-card.mjs +83 -0
- package/dist/components/comment/comment-entry.d.mts +24 -0
- package/dist/components/comment/comment-entry.mjs +75 -0
- package/dist/components/comment/comment-highlight.d.mts +18 -0
- package/dist/components/comment/comment-highlight.mjs +33 -0
- package/dist/components/comment/comment-margin-layout.d.mts +32 -0
- package/dist/components/comment/comment-margin-layout.mjs +44 -0
- package/dist/components/comment/comment-margin.d.mts +29 -0
- package/dist/components/comment/comment-margin.mjs +164 -0
- package/dist/components/comment/comment-marker.d.mts +16 -0
- package/dist/components/comment/comment-marker.mjs +24 -0
- package/dist/components/comment/comment.recipe.mjs +58 -0
- package/dist/components/comment/index.d.mts +8 -0
- package/dist/components/comment/use-comment-margin-fits.d.mts +16 -0
- package/dist/components/comment/use-comment-margin-fits.mjs +34 -0
- package/dist/components/composer/composer-attachment.recipe.mjs +85 -0
- package/dist/components/composer/composer-attachments-scroll-area.d.mts +5 -0
- package/dist/components/composer/composer-attachments-scroll-area.mjs +93 -0
- package/dist/components/composer/composer-attachments.d.mts +27 -0
- package/dist/components/composer/composer-attachments.mjs +147 -0
- package/dist/components/composer/composer-drop-overlay.d.mts +9 -0
- package/dist/components/composer/composer-drop-overlay.mjs +60 -0
- package/dist/components/composer/composer-drop-overlay.recipe.mjs +23 -0
- package/dist/components/composer/composer-root.d.mts +5 -0
- package/dist/components/composer/composer-root.mjs +18 -0
- package/dist/components/composer/composer-suggestion-list.d.mts +139 -0
- package/dist/components/composer/composer-suggestion-list.mjs +160 -0
- package/dist/components/composer/composer-toolbar-label.d.mts +5 -0
- package/dist/components/composer/composer-toolbar-label.mjs +24 -0
- package/dist/components/composer/composer.d.mts +20 -0
- package/dist/components/composer/composer.mjs +88 -0
- package/dist/components/composer/composer.recipe.mjs +29 -0
- package/dist/components/composer/index.d.mts +10 -0
- package/dist/components/composer/sortable-composer-attachments.d.mts +37 -0
- package/dist/components/composer/sortable-composer-attachments.mjs +247 -0
- package/dist/components/composer/use-composer-suggestions.d.mts +83 -0
- package/dist/components/composer/use-composer-suggestions.mjs +207 -0
- package/dist/components/context-menu/context-menu.d.mts +53 -0
- package/dist/components/context-menu/context-menu.mjs +275 -0
- package/dist/components/context-menu/index.d.mts +2 -0
- package/dist/components/conversation-panel/conversation-panel-empty-state.d.mts +9 -0
- package/dist/components/conversation-panel/conversation-panel-empty-state.mjs +57 -0
- package/dist/components/conversation-panel/conversation-panel.d.mts +20 -0
- package/dist/components/conversation-panel/conversation-panel.mjs +63 -0
- package/dist/components/conversation-panel/conversation-panel.recipe.mjs +15 -0
- package/dist/components/conversation-panel/index.d.mts +3 -0
- package/dist/components/copyable-code/copyable-code.d.mts +72 -0
- package/dist/components/copyable-code/copyable-code.mjs +153 -0
- package/dist/components/copyable-code/index.d.mts +2 -0
- package/dist/components/description-list/description-list.d.mts +59 -0
- package/dist/components/description-list/description-list.mjs +96 -0
- package/dist/components/description-list/index.d.mts +2 -0
- package/dist/components/dialog/dialog-sheet-context.mjs +58 -0
- package/dist/components/dialog/dialog-sheet.d.mts +31 -0
- package/dist/components/dialog/dialog-sheet.mjs +194 -0
- package/dist/components/dialog/dialog.d.mts +85 -0
- package/dist/components/dialog/dialog.mjs +371 -0
- package/dist/components/dialog/index.d.mts +3 -0
- package/dist/components/drag/drag-announcements.d.mts +72 -0
- package/dist/components/drag/drag-announcements.mjs +115 -0
- package/dist/components/drag/drag-lift.d.mts +100 -0
- package/dist/components/drag/drag-lift.mjs +276 -0
- package/dist/components/drag/drag-lists.d.mts +98 -0
- package/dist/components/drag/drag-lists.mjs +258 -0
- package/dist/components/drag/drag-sensors.d.mts +87 -0
- package/dist/components/drag/drag-sensors.mjs +169 -0
- package/dist/components/drag/drag.recipe.d.mts +7 -0
- package/dist/components/drag/drag.recipe.mjs +30 -0
- package/dist/components/drag/drop-placeholder.d.mts +41 -0
- package/dist/components/drag/drop-placeholder.mjs +161 -0
- package/dist/components/drag/index.d.mts +8 -0
- package/dist/components/drawer/drawer.d.mts +34 -0
- package/dist/components/drawer/drawer.mjs +202 -0
- package/dist/components/drawer/drawer.recipe.mjs +175 -0
- package/dist/components/drawer/index.d.mts +2 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.mts +62 -0
- package/dist/components/dropdown-menu/dropdown-menu.mjs +319 -0
- package/dist/components/dropdown-menu/index.d.mts +2 -0
- package/dist/components/ellipsis/ellipsis.d.mts +55 -0
- package/dist/components/ellipsis/ellipsis.mjs +320 -0
- package/dist/components/ellipsis/index.d.mts +3 -0
- package/dist/components/empty-state/empty-state.d.mts +15 -0
- package/dist/components/empty-state/empty-state.mjs +102 -0
- package/dist/components/empty-state/index.d.mts +2 -0
- package/dist/components/field/field.d.mts +79 -0
- package/dist/components/field/field.mjs +100 -0
- package/dist/components/field/index.d.mts +2 -0
- package/dist/components/file-preview/file-preview.d.mts +17 -0
- package/dist/components/file-preview/file-preview.mjs +210 -0
- package/dist/components/file-preview/file-preview.recipe.d.mts +99 -0
- package/dist/components/file-preview/file-preview.recipe.mjs +39 -0
- package/dist/components/file-preview/index.d.mts +2 -0
- package/dist/components/files/files.d.mts +35 -0
- package/dist/components/files/files.mjs +69 -0
- package/dist/components/files/files.recipe.mjs +40 -0
- package/dist/components/files/index.d.mts +2 -0
- package/dist/components/filter-chip/filter-chip.d.mts +25 -0
- package/dist/components/filter-chip/filter-chip.mjs +59 -0
- package/dist/components/filter-chip/index.d.mts +2 -0
- package/dist/components/float-button/float-button.d.mts +36 -0
- package/dist/components/float-button/float-button.mjs +116 -0
- package/dist/components/float-button/float-button.position.d.mts +6 -0
- package/dist/components/float-button/float-button.position.mjs +41 -0
- package/dist/components/float-button/index.d.mts +3 -0
- package/dist/components/form-section/form-section.d.mts +16 -0
- package/dist/components/form-section/form-section.mjs +53 -0
- package/dist/components/form-section/index.d.mts +2 -0
- package/dist/components/icon-tile/icon-tile.d.mts +97 -0
- package/dist/components/icon-tile/icon-tile.mjs +49 -0
- package/dist/components/icon-tile/index.d.mts +2 -0
- package/dist/components/icons/action-icons.d.mts +34 -0
- package/dist/components/icons/action-icons.mjs +383 -0
- package/dist/components/icons/conversation-icons.d.mts +12 -0
- package/dist/components/icons/conversation-icons.mjs +147 -0
- package/dist/components/icons/index.d.mts +4 -0
- package/dist/components/icons/object-icons.d.mts +6 -0
- package/dist/components/icons/object-icons.mjs +27 -0
- package/dist/components/inbox-item/inbox-item-leading-badge.d.mts +13 -0
- package/dist/components/inbox-item/inbox-item-leading-badge.mjs +27 -0
- package/dist/components/inbox-item/inbox-item-skeleton.d.mts +46 -0
- package/dist/components/inbox-item/inbox-item-skeleton.mjs +89 -0
- package/dist/components/inbox-item/inbox-item-skeleton.recipe.mjs +20 -0
- package/dist/components/inbox-item/inbox-item.d.mts +71 -0
- package/dist/components/inbox-item/inbox-item.mjs +276 -0
- package/dist/components/inbox-item/inbox-item.recipe.mjs +137 -0
- package/dist/components/inbox-item/index.d.mts +2 -0
- package/dist/components/inline-code/index.d.mts +2 -0
- package/dist/components/inline-code/inline-code.d.mts +8 -0
- package/dist/components/inline-code/inline-code.mjs +30 -0
- package/dist/components/input/index.d.mts +2 -0
- package/dist/components/input/input.d.mts +16 -0
- package/dist/components/input/input.mjs +20 -0
- package/dist/components/input/input.recipe.mjs +12 -0
- package/dist/components/input-group/index.d.mts +2 -0
- package/dist/components/input-group/input-group.d.mts +93 -0
- package/dist/components/input-group/input-group.mjs +178 -0
- package/dist/components/kbd/index.d.mts +2 -0
- package/dist/components/kbd/kbd.d.mts +7 -0
- package/dist/components/kbd/kbd.mjs +34 -0
- package/dist/components/label/index.d.mts +2 -0
- package/dist/components/label/label.d.mts +60 -0
- package/dist/components/label/label.mjs +75 -0
- package/dist/components/legacy-task-panel/index.d.mts +2 -0
- package/dist/components/legacy-task-panel/legacy-task-panel.d.mts +57 -0
- package/dist/components/legacy-task-panel/legacy-task-panel.mjs +234 -0
- package/dist/components/legacy-task-panel/legacy-task-panel.recipe.mjs +30 -0
- package/dist/components/lightbox/index.d.mts +2 -0
- package/dist/components/lightbox/lightbox.d.mts +55 -0
- package/dist/components/lightbox/lightbox.mjs +336 -0
- package/dist/components/list-row/index.d.mts +2 -0
- package/dist/components/list-row/list-row-skeleton.d.mts +21 -0
- package/dist/components/list-row/list-row-skeleton.mjs +43 -0
- package/dist/components/list-row/list-row.d.mts +66 -0
- package/dist/components/list-row/list-row.mjs +167 -0
- package/dist/components/list-row/list-row.recipe.d.mts +126 -0
- package/dist/components/list-row/list-row.recipe.mjs +94 -0
- package/dist/components/live-agent-activity-bar/index.d.mts +2 -0
- package/dist/components/live-agent-activity-bar/live-agent-activity-bar.d.mts +25 -0
- package/dist/components/live-agent-activity-bar/live-agent-activity-bar.mjs +107 -0
- package/dist/components/logo/index.d.mts +2 -0
- package/dist/components/logo/raft-logo.d.mts +9 -0
- package/dist/components/logo/raft-logo.mjs +63 -0
- package/dist/components/markdown/index.d.mts +2 -0
- package/dist/components/markdown/markdown-parts.d.mts +54 -0
- package/dist/components/markdown/markdown-parts.mjs +153 -0
- package/dist/components/markdown/markdown.recipe.mjs +77 -0
- package/dist/components/message-action-card/index.d.mts +2 -0
- package/dist/components/message-action-card/message-action-card-content.recipe.mjs +50 -0
- package/dist/components/message-action-card/message-action-card.d.mts +95 -0
- package/dist/components/message-action-card/message-action-card.mjs +298 -0
- package/dist/components/message-action-card/message-action-card.recipe.mjs +47 -0
- package/dist/components/message-attachment/index.d.mts +5 -0
- package/dist/components/message-attachment/message-attachment.d.mts +27 -0
- package/dist/components/message-attachment/message-attachment.mjs +129 -0
- package/dist/components/message-attachment/message-attachment.recipe.mjs +36 -0
- package/dist/components/message-attachment/message-image-gallery-rows.d.mts +47 -0
- package/dist/components/message-attachment/message-image-gallery-rows.mjs +55 -0
- package/dist/components/message-attachment/message-image-gallery.d.mts +32 -0
- package/dist/components/message-attachment/message-image-gallery.mjs +105 -0
- package/dist/components/message-attachment/message-image-gallery.recipe.mjs +61 -0
- package/dist/components/message-attachment/message-video-preview.d.mts +19 -0
- package/dist/components/message-attachment/message-video-preview.mjs +92 -0
- package/dist/components/message-attachment/message-video-preview.recipe.mjs +33 -0
- package/dist/components/message-embed/index.d.mts +2 -0
- package/dist/components/message-embed/message-embed.d.mts +12 -0
- package/dist/components/message-embed/message-embed.mjs +42 -0
- package/dist/components/message-embed/message-embed.recipe.mjs +14 -0
- package/dist/components/message-forwarded-bundle/index.d.mts +2 -0
- package/dist/components/message-forwarded-bundle/message-forwarded-bundle.d.mts +92 -0
- package/dist/components/message-forwarded-bundle/message-forwarded-bundle.mjs +324 -0
- package/dist/components/message-forwarded-bundle/message-forwarded-bundle.recipe.mjs +81 -0
- package/dist/components/message-item/index.d.mts +13 -0
- package/dist/components/message-item/message-footer.d.mts +20 -0
- package/dist/components/message-item/message-footer.mjs +54 -0
- package/dist/components/message-item/message-footer.recipe.mjs +46 -0
- package/dist/components/message-item/message-item-content.d.mts +22 -0
- package/dist/components/message-item/message-item-content.mjs +81 -0
- package/dist/components/message-item/message-item-delegated.d.mts +38 -0
- package/dist/components/message-item/message-item-delegated.mjs +72 -0
- package/dist/components/message-item/message-item-gutter.d.mts +10 -0
- package/dist/components/message-item/message-item-gutter.mjs +41 -0
- package/dist/components/message-item/message-item-header.d.mts +29 -0
- package/dist/components/message-item/message-item-header.mjs +107 -0
- package/dist/components/message-item/message-item-label.mjs +113 -0
- package/dist/components/message-item/message-item-root.d.mts +25 -0
- package/dist/components/message-item/message-item-root.mjs +39 -0
- package/dist/components/message-item/message-item-toolbar.d.mts +9 -0
- package/dist/components/message-item/message-item-toolbar.mjs +131 -0
- package/dist/components/message-item/message-item.recipe.d.mts +101 -0
- package/dist/components/message-item/message-item.recipe.mjs +114 -0
- package/dist/components/message-item/message-multi-select.d.mts +15 -0
- package/dist/components/message-item/message-multi-select.mjs +49 -0
- package/dist/components/message-item/message-multi-select.recipe.mjs +23 -0
- package/dist/components/message-item/message-reaction.d.mts +39 -0
- package/dist/components/message-item/message-reaction.mjs +188 -0
- package/dist/components/message-item/message-reaction.recipe.mjs +76 -0
- package/dist/components/message-item/message-reference.d.mts +50 -0
- package/dist/components/message-item/message-reference.mjs +111 -0
- package/dist/components/message-item/message-reference.recipe.d.mts +6 -0
- package/dist/components/message-item/message-reference.recipe.mjs +63 -0
- package/dist/components/message-item/message-text-selection-toolbar.d.mts +24 -0
- package/dist/components/message-item/message-text-selection-toolbar.mjs +13 -0
- package/dist/components/message-list/index.d.mts +4 -0
- package/dist/components/message-list/message-list-jump.d.mts +21 -0
- package/dist/components/message-list/message-list-jump.mjs +73 -0
- package/dist/components/message-list/message-list-markers.d.mts +13 -0
- package/dist/components/message-list/message-list-markers.mjs +70 -0
- package/dist/components/message-list/message-list.d.mts +7 -0
- package/dist/components/message-list/message-list.mjs +52 -0
- package/dist/components/message-list/message-list.recipe.mjs +54 -0
- package/dist/components/message-quoted-preview/index.d.mts +2 -0
- package/dist/components/message-quoted-preview/message-quoted-preview.d.mts +40 -0
- package/dist/components/message-quoted-preview/message-quoted-preview.mjs +144 -0
- package/dist/components/message-quoted-preview/message-quoted-preview.recipe.mjs +38 -0
- package/dist/components/message-replies/index.d.mts +2 -0
- package/dist/components/message-replies/message-replies.d.mts +17 -0
- package/dist/components/message-replies/message-replies.mjs +79 -0
- package/dist/components/message-replies/message-replies.recipe.mjs +25 -0
- package/dist/components/message-translation/index.d.mts +2 -0
- package/dist/components/message-translation/message-translation.d.mts +20 -0
- package/dist/components/message-translation/message-translation.mjs +64 -0
- package/dist/components/message-translation/message-translation.recipe.mjs +27 -0
- package/dist/components/meter/index.d.mts +2 -0
- package/dist/components/meter/meter.d.mts +107 -0
- package/dist/components/meter/meter.mjs +118 -0
- package/dist/components/mobile-nav/index.d.mts +3 -0
- package/dist/components/mobile-nav/mobile-nav-server.d.mts +71 -0
- package/dist/components/mobile-nav/mobile-nav-server.mjs +287 -0
- package/dist/components/mobile-nav/mobile-nav.d.mts +12 -0
- package/dist/components/mobile-nav/mobile-nav.mjs +73 -0
- package/dist/components/mode-bar/index.d.mts +2 -0
- package/dist/components/mode-bar/mode-bar.d.mts +33 -0
- package/dist/components/mode-bar/mode-bar.mjs +115 -0
- package/dist/components/notification-center/index.d.mts +2 -0
- package/dist/components/notification-center/notification-center.d.mts +225 -0
- package/dist/components/notification-center/notification-center.mjs +340 -0
- package/dist/components/panel/index.d.mts +7 -0
- package/dist/components/panel/panel-action.d.mts +15 -0
- package/dist/components/panel/panel-action.mjs +23 -0
- package/dist/components/panel/panel-action.recipe.mjs +40 -0
- package/dist/components/panel/panel-header.d.mts +34 -0
- package/dist/components/panel/panel-header.mjs +135 -0
- package/dist/components/panel/panel-header.recipe.mjs +78 -0
- package/dist/components/panel/panel-notice.d.mts +16 -0
- package/dist/components/panel/panel-notice.mjs +77 -0
- package/dist/components/panel/panel-split-action.d.mts +34 -0
- package/dist/components/panel/panel-split-action.mjs +69 -0
- package/dist/components/panel/panel-split-action.recipe.mjs +53 -0
- package/dist/components/panel/panel-toggle-action.d.mts +6 -0
- package/dist/components/panel/panel-toggle-action.mjs +15 -0
- package/dist/components/panel/panel.d.mts +25 -0
- package/dist/components/panel/panel.mjs +96 -0
- package/dist/components/panel/panel.recipe.mjs +24 -0
- package/dist/components/picker-trigger-button/index.d.mts +2 -0
- package/dist/components/picker-trigger-button/picker-trigger-button.d.mts +7 -0
- package/dist/components/picker-trigger-button/picker-trigger-button.mjs +36 -0
- package/dist/components/popover/index.d.mts +2 -0
- package/dist/components/popover/popover.d.mts +41 -0
- package/dist/components/popover/popover.mjs +184 -0
- package/dist/components/preview-card/index.d.mts +2 -0
- package/dist/components/preview-card/preview-card.d.mts +43 -0
- package/dist/components/preview-card/preview-card.mjs +197 -0
- package/dist/components/profile-panel/index.d.mts +2 -0
- package/dist/components/profile-panel/profile-panel.d.mts +14 -0
- package/dist/components/profile-panel/profile-panel.mjs +46 -0
- package/dist/components/profile-panel/profile-panel.recipe.mjs +14 -0
- package/dist/components/progress/index.d.mts +2 -0
- package/dist/components/progress/progress.d.mts +119 -0
- package/dist/components/progress/progress.mjs +139 -0
- package/dist/components/pull-to-refresh/index.d.mts +4 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-gesture.d.mts +30 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-gesture.mjs +134 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-indicator.d.mts +21 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-indicator.mjs +153 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-material-progress.mjs +150 -0
- package/dist/components/pull-to-refresh/use-pull-to-refresh.d.mts +55 -0
- package/dist/components/pull-to-refresh/use-pull-to-refresh.mjs +156 -0
- package/dist/components/radio-group/index.d.mts +2 -0
- package/dist/components/radio-group/radio-group.d.mts +14 -0
- package/dist/components/radio-group/radio-group.mjs +59 -0
- package/dist/components/resizable/index.d.mts +2 -0
- package/dist/components/resizable/resizable.d.mts +15 -0
- package/dist/components/resizable/resizable.mjs +39 -0
- package/dist/components/resizable/resizable.recipe.mjs +24 -0
- package/dist/components/scroll-area/index.d.mts +2 -0
- package/dist/components/scroll-area/scroll-area.d.mts +17 -0
- package/dist/components/scroll-area/scroll-area.mjs +55 -0
- package/dist/components/scroll-area/scroll-area.recipe.mjs +23 -0
- package/dist/components/search/index.d.mts +6 -0
- package/dist/components/search/search-entity.d.mts +24 -0
- package/dist/components/search/search-entity.mjs +106 -0
- package/dist/components/search/search-entity.recipe.mjs +41 -0
- package/dist/components/search/search-message.d.mts +25 -0
- package/dist/components/search/search-message.mjs +115 -0
- package/dist/components/search/search-message.recipe.mjs +32 -0
- package/dist/components/search/search-thread.d.mts +17 -0
- package/dist/components/search/search-thread.mjs +79 -0
- package/dist/components/search/search-thread.recipe.mjs +16 -0
- package/dist/components/search/search-trigger.d.mts +15 -0
- package/dist/components/search/search-trigger.mjs +59 -0
- package/dist/components/search/search.d.mts +23 -0
- package/dist/components/search/search.mjs +88 -0
- package/dist/components/search/search.recipe.mjs +22 -0
- package/dist/components/segmented-control/index.d.mts +2 -0
- package/dist/components/segmented-control/segmented-control.d.mts +38 -0
- package/dist/components/segmented-control/segmented-control.mjs +306 -0
- package/dist/components/select/index.d.mts +2 -0
- package/dist/components/select/select.d.mts +95 -0
- package/dist/components/select/select.mjs +483 -0
- package/dist/components/separator/index.d.mts +2 -0
- package/dist/components/separator/separator.d.mts +10 -0
- package/dist/components/separator/separator.mjs +49 -0
- package/dist/components/sidebar/index.d.mts +5 -0
- package/dist/components/sidebar/sidebar-item.d.mts +64 -0
- package/dist/components/sidebar/sidebar-item.mjs +201 -0
- package/dist/components/sidebar/sidebar-item.recipe.mjs +100 -0
- package/dist/components/sidebar/sidebar-menu.d.mts +13 -0
- package/dist/components/sidebar/sidebar-menu.mjs +67 -0
- package/dist/components/sidebar/sidebar-menu.recipe.mjs +22 -0
- package/dist/components/sidebar/sidebar-section.d.mts +41 -0
- package/dist/components/sidebar/sidebar-section.mjs +164 -0
- package/dist/components/sidebar/sidebar-section.recipe.mjs +45 -0
- package/dist/components/sidebar/sidebar.d.mts +17 -0
- package/dist/components/sidebar/sidebar.mjs +149 -0
- package/dist/components/sidebar/sidebar.recipe.mjs +37 -0
- package/dist/components/skeleton/index.d.mts +2 -0
- package/dist/components/skeleton/skeleton.d.mts +50 -0
- package/dist/components/skeleton/skeleton.mjs +29 -0
- package/dist/components/spinner/index.d.mts +2 -0
- package/dist/components/spinner/spinner.d.mts +77 -0
- package/dist/components/spinner/spinner.mjs +118 -0
- package/dist/components/status/index.d.mts +2 -0
- package/dist/components/status/status.d.mts +143 -0
- package/dist/components/status/status.mjs +56 -0
- package/dist/components/steps/index.d.mts +3 -0
- package/dist/components/steps/otter-indicator.d.mts +17 -0
- package/dist/components/steps/otter-indicator.mjs +331 -0
- package/dist/components/steps/steps.d.mts +50 -0
- package/dist/components/steps/steps.mjs +174 -0
- package/dist/components/switch/index.d.mts +2 -0
- package/dist/components/switch/switch.d.mts +9 -0
- package/dist/components/switch/switch.mjs +50 -0
- package/dist/components/system-message/index.d.mts +2 -0
- package/dist/components/system-message/system-message.d.mts +27 -0
- package/dist/components/system-message/system-message.mjs +113 -0
- package/dist/components/system-message/system-message.recipe.mjs +34 -0
- package/dist/components/table/index.d.mts +2 -0
- package/dist/components/table/table.d.mts +35 -0
- package/dist/components/table/table.mjs +102 -0
- package/dist/components/table/table.recipe.mjs +31 -0
- package/dist/components/tabs/index.d.mts +2 -0
- package/dist/components/tabs/tabs.d.mts +185 -0
- package/dist/components/tabs/tabs.mjs +528 -0
- package/dist/components/task-board/index.d.mts +2 -0
- package/dist/components/task-board/task-board-column.recipe.mjs +46 -0
- package/dist/components/task-board/task-board.d.mts +40 -0
- package/dist/components/task-board/task-board.mjs +155 -0
- package/dist/components/task-card/index.d.mts +2 -0
- package/dist/components/task-card/task-card-status.recipe.mjs +17 -0
- package/dist/components/task-card/task-card.d.mts +30 -0
- package/dist/components/task-card/task-card.mjs +141 -0
- package/dist/components/task-card/task-card.recipe.mjs +39 -0
- package/dist/components/task-dnd/index.d.mts +2 -0
- package/dist/components/task-dnd/task-dnd.d.mts +75 -0
- package/dist/components/task-dnd/task-dnd.mjs +341 -0
- package/dist/components/task-dnd/task-dnd.recipe.mjs +20 -0
- package/dist/components/task-list/index.d.mts +2 -0
- package/dist/components/task-list/task-list-section.recipe.mjs +37 -0
- package/dist/components/task-list/task-list.d.mts +34 -0
- package/dist/components/task-list/task-list.mjs +119 -0
- package/dist/components/tasks/index.d.mts +7 -0
- package/dist/components/tasks/task-chip.d.mts +14 -0
- package/dist/components/tasks/task-chip.mjs +81 -0
- package/dist/components/tasks/task-loading.d.mts +7 -0
- package/dist/components/tasks/task-loading.mjs +32 -0
- package/dist/components/tasks/task-loading.recipe.mjs +8 -0
- package/dist/components/tasks/task-status-badge.d.mts +24 -0
- package/dist/components/tasks/task-status-badge.mjs +24 -0
- package/dist/components/tasks/task-status-icon.d.mts +13 -0
- package/dist/components/tasks/task-status-icon.mjs +90 -0
- package/dist/components/tasks/task-status.recipe.d.mts +62 -0
- package/dist/components/tasks/task-status.recipe.mjs +33 -0
- package/dist/components/tasks/tasks-panel.d.mts +22 -0
- package/dist/components/tasks/tasks-panel.mjs +114 -0
- package/dist/components/tasks/tasks-panel.recipe.mjs +36 -0
- package/dist/components/text/index.d.mts +2 -0
- package/dist/components/text/text.d.mts +186 -0
- package/dist/components/text/text.mjs +114 -0
- package/dist/components/text-link/index.d.mts +2 -0
- package/dist/components/text-link/text-link.d.mts +36 -0
- package/dist/components/text-link/text-link.mjs +60 -0
- package/dist/components/text-selection-toolbar/index.d.mts +3 -0
- package/dist/components/text-selection-toolbar/text-selection-anchor.d.mts +22 -0
- package/dist/components/text-selection-toolbar/text-selection-anchor.mjs +106 -0
- package/dist/components/text-selection-toolbar/text-selection-toolbar.d.mts +20 -0
- package/dist/components/text-selection-toolbar/text-selection-toolbar.mjs +41 -0
- package/dist/components/text-selection-toolbar/text-selection-toolbar.recipe.mjs +19 -0
- package/dist/components/textarea/index.d.mts +2 -0
- package/dist/components/textarea/textarea.d.mts +16 -0
- package/dist/components/textarea/textarea.mjs +62 -0
- package/dist/components/thread-panel/index.d.mts +2 -0
- package/dist/components/thread-panel/thread-panel.d.mts +31 -0
- package/dist/components/thread-panel/thread-panel.mjs +162 -0
- package/dist/components/thread-panel/thread-panel.recipe.mjs +36 -0
- package/dist/components/timeline/index.d.mts +2 -0
- package/dist/components/timeline/timeline.d.mts +44 -0
- package/dist/components/timeline/timeline.mjs +81 -0
- package/dist/components/toast/index.d.mts +2 -0
- package/dist/components/toast/toast.d.mts +263 -0
- package/dist/components/toast/toast.mjs +556 -0
- package/dist/components/toggle-group/index.d.mts +2 -0
- package/dist/components/toggle-group/toggle-group.d.mts +15 -0
- package/dist/components/toggle-group/toggle-group.mjs +64 -0
- package/dist/components/tooltip/index.d.mts +2 -0
- package/dist/components/tooltip/tooltip.d.mts +18 -0
- package/dist/components/tooltip/tooltip.mjs +197 -0
- package/dist/components/virtual-list/ItemColumns.mjs +37 -0
- package/dist/components/virtual-list/VirtualList.d.mts +4 -0
- package/dist/components/virtual-list/VirtualList.mjs +1401 -0
- package/dist/components/virtual-list/VirtualListContext.mjs +5 -0
- package/dist/components/virtual-list/hooks/use-event-callback.mjs +10 -0
- package/dist/components/virtual-list/hooks/use-ios-momentum-compensation.mjs +148 -0
- package/dist/components/virtual-list/hooks/use-keyboard-scroll.mjs +42 -0
- package/dist/components/virtual-list/hooks/use-latest-ref.mjs +10 -0
- package/dist/components/virtual-list/hooks/use-layout-effect-with-previous.mjs +16 -0
- package/dist/components/virtual-list/hooks/use-memo-with-previous.mjs +22 -0
- package/dist/components/virtual-list/hooks/use-non-passive-wheel.mjs +23 -0
- package/dist/components/virtual-list/hooks/use-non-virtual-content-resize.mjs +28 -0
- package/dist/components/virtual-list/hooks/use-scroll-anchor.mjs +55 -0
- package/dist/components/virtual-list/index.d.mts +5 -0
- package/dist/components/virtual-list/public-types.d.mts +341 -0
- package/dist/components/virtual-list/resize-observer/ResizeObserverWrapper.d.mts +5 -0
- package/dist/components/virtual-list/resize-observer/ResizeObserverWrapper.mjs +70 -0
- package/dist/components/virtual-list/resize-observer/resize-observer-delegate.d.mts +6 -0
- package/dist/components/virtual-list/resize-observer/resize-observer-delegate.mjs +54 -0
- package/dist/components/virtual-list/utils/align.mjs +19 -0
- package/dist/components/virtual-list/utils/constants.mjs +30 -0
- package/dist/components/virtual-list/utils/fenwick-tree.mjs +66 -0
- package/dist/components/virtual-list/utils/items-anchor.mjs +49 -0
- package/dist/components/virtual-list/utils/measure.mjs +77 -0
- package/dist/components/virtual-list/utils/platform.mjs +39 -0
- package/dist/components/virtual-list/utils/range.mjs +103 -0
- package/dist/components/virtual-list/utils/size-cache.mjs +35 -0
- package/dist/components/workspace-button/index.d.mts +2 -0
- package/dist/components/workspace-button/workspace-button.d.mts +9 -0
- package/dist/components/workspace-button/workspace-button.mjs +28 -0
- package/dist/index.d.mts +239 -4864
- package/dist/index.mjs +142 -17054
- package/dist/lib/chip-remove.mjs +17 -0
- package/dist/lib/data-attributes.d.mts +5 -0
- package/dist/lib/decision-width.mjs +9 -0
- package/dist/lib/default-native-button.mjs +8 -0
- package/dist/lib/desktop-media.mjs +10 -0
- package/dist/lib/drag-escape.mjs +37 -0
- package/dist/lib/frame-insets.mjs +127 -0
- package/dist/lib/head-edges.mjs +44 -0
- package/dist/lib/hud-text-action.mjs +10 -0
- package/dist/lib/inline-chip.mjs +30 -0
- package/dist/lib/input-modality.d.mts +36 -0
- package/dist/lib/input-modality.mjs +186 -0
- package/dist/lib/list-cell.mjs +21 -0
- package/dist/lib/located.d.mts +25 -0
- package/dist/lib/located.mjs +28 -0
- package/dist/lib/overlay-depth.d.mts +42 -0
- package/dist/lib/overlay-depth.mjs +59 -0
- package/dist/lib/phone-media.mjs +24 -0
- package/dist/lib/presence.d.mts +16 -0
- package/dist/lib/presence.mjs +16 -0
- package/dist/lib/row-tone.d.mts +8 -0
- package/dist/lib/search-hit.mjs +18 -0
- package/dist/lib/stacked-actions.mjs +112 -0
- package/dist/lib/styled-props.d.mts +15 -0
- package/dist/lib/tap-activation.mjs +133 -0
- package/dist/lib/theme/theme-context.d.mts +10 -0
- package/dist/lib/theme/theme-context.mjs +9 -0
- package/dist/lib/theme/theme-provider.d.mts +23 -0
- package/dist/lib/theme/theme-provider.mjs +61 -0
- package/dist/lib/theme/theme-scope.mjs +19 -0
- package/dist/lib/theme/use-theme.d.mts +5 -0
- package/dist/lib/theme/use-theme.mjs +9 -0
- package/dist/lib/touch-drag.d.mts +55 -0
- package/dist/lib/touch-drag.mjs +151 -0
- package/dist/lib/truncation.d.mts +26 -0
- package/dist/lib/truncation.mjs +153 -0
- package/dist/lib/tv.d.mts +2 -0
- package/dist/lib/tv.mjs +14 -0
- package/dist/lib/use-copy-to-clipboard.mjs +58 -0
- package/dist/lib/use-merged-ref.mjs +60 -0
- package/dist/lib/use-mobile-viewport.mjs +17 -0
- package/dist/lib/use-overflow-title.mjs +49 -0
- package/dist/lib/use-scrollbar-size.d.mts +16 -0
- package/dist/lib/use-scrollbar-size.mjs +46 -0
- package/dist/lib/use-truncated.d.mts +20 -0
- package/dist/lib/use-truncated.mjs +34 -0
- package/dist/lib/without-children.d.mts +8 -0
- package/dist/wip.d.mts +61 -1190
- package/dist/wip.mjs +43 -2970
- package/package.json +8 -1
- package/dist/index-C3ymUW98.d.mts +0 -1816
- package/dist/mode-bar-tGnYByXp.mjs +0 -7564
- package/dist/style.css +0 -1395
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/lib/chip-remove.ts
|
|
2
|
+
/**
|
|
3
|
+
* The × that removes a chip: a tag in a Combobox field (`ComboboxChipRemove`)
|
|
4
|
+
* and an applied filter (`FilterChipRemove`). A `foreground-hint` glyph on a
|
|
5
|
+
* `rounded-sticker` square that takes the medium fill on hover and press, and
|
|
6
|
+
* an inset ink ring when the keyboard reaches it (the chip around it is too
|
|
7
|
+
* tight for an outer ring). Each chip gives it its own size.
|
|
8
|
+
*/
|
|
9
|
+
const chipRemoveBase = [
|
|
10
|
+
"inline-flex shrink-0 items-center justify-center outline-none transition-colors",
|
|
11
|
+
"rounded-sticker text-foreground-hint",
|
|
12
|
+
"hover:bg-fill-medium active:bg-fill-medium",
|
|
13
|
+
"focus-visible:keyboard:inset-ring-2 focus-visible:keyboard:inset-ring-foreground",
|
|
14
|
+
"[&>svg]:size-3.5"
|
|
15
|
+
];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { chipRemoveBase };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/lib/decision-width.ts
|
|
2
|
+
/**
|
|
3
|
+
* The width of every decision dialog (dialog.md#variants): AlertDialog and a
|
|
4
|
+
* `size="sm"` Dialog are both 400px, so every confirmation in a product is one
|
|
5
|
+
* width whichever of the two it is built on.
|
|
6
|
+
*/
|
|
7
|
+
const decisionWidth = "max-w-100";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { decisionWidth };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/lib/default-native-button.ts
|
|
2
|
+
function defaultNativeButton(render) {
|
|
3
|
+
if (!render || typeof render !== "object" || !("type" in render)) return;
|
|
4
|
+
const element = render;
|
|
5
|
+
if (typeof element.type === "string") return element.type === "button";
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { defaultNativeButton };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/lib/desktop-media.ts
|
|
2
|
+
/**
|
|
3
|
+
* Where the desktop layout and its metrics begin: from 768px, with a mouse or
|
|
4
|
+
* a trackpad (design/foundations/spacing.md#hit-targets). The same query as
|
|
5
|
+
* the desktop blocks in styles.css and foundation.css, for code that has to
|
|
6
|
+
* decide in JavaScript what CSS decides with `md:pointer-fine:`.
|
|
7
|
+
*/
|
|
8
|
+
const DESKTOP_MEDIA_QUERY = "(width >= 48rem) and (pointer: fine)";
|
|
9
|
+
//#endregion
|
|
10
|
+
export { DESKTOP_MEDIA_QUERY };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/lib/drag-escape.ts
|
|
2
|
+
/** The drags in progress in each window, each with its own cancel. */
|
|
3
|
+
const holds = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function onKeydown(event) {
|
|
5
|
+
if (event.key !== "Escape" && event.code !== "Escape") return;
|
|
6
|
+
const drags = holds.get(this);
|
|
7
|
+
if (!drags || drags.size === 0) return;
|
|
8
|
+
event.preventDefault();
|
|
9
|
+
event.stopImmediatePropagation();
|
|
10
|
+
for (const cancel of drags.values()) cancel(event);
|
|
11
|
+
}
|
|
12
|
+
function guard(win) {
|
|
13
|
+
let drags = holds.get(win);
|
|
14
|
+
if (!drags) {
|
|
15
|
+
drags = /* @__PURE__ */ new Map();
|
|
16
|
+
holds.set(win, drags);
|
|
17
|
+
win.addEventListener("keydown", onKeydown, { capture: true });
|
|
18
|
+
}
|
|
19
|
+
return drags;
|
|
20
|
+
}
|
|
21
|
+
if (typeof window !== "undefined") guard(window);
|
|
22
|
+
/** A sensor's drag has started: Escape now cancels it, and only it. */
|
|
23
|
+
function holdEscape(win, sensor, cancel) {
|
|
24
|
+
if (!win) return;
|
|
25
|
+
guard(win).set(sensor, cancel);
|
|
26
|
+
}
|
|
27
|
+
/** The sensor's drag is over: Escape behaves as it does everywhere else again. */
|
|
28
|
+
function releaseEscape(win, sensor) {
|
|
29
|
+
if (!win) return;
|
|
30
|
+
holds.get(win)?.delete(sensor);
|
|
31
|
+
}
|
|
32
|
+
/** The window an event happened in. */
|
|
33
|
+
function eventWindow(event) {
|
|
34
|
+
return (event?.target)?.ownerDocument?.defaultView ?? (typeof window === "undefined" ? null : window);
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { eventWindow, holdEscape, releaseEscape };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
//#region src/lib/frame-insets.ts
|
|
3
|
+
const NO_FRAME_INSETS = Object.freeze({
|
|
4
|
+
top: 0,
|
|
5
|
+
right: 0,
|
|
6
|
+
bottom: 0,
|
|
7
|
+
left: 0
|
|
8
|
+
});
|
|
9
|
+
const PX_LENGTH = /^-?(\d+\.?\d*|\.\d+)px$/;
|
|
10
|
+
/**
|
|
11
|
+
* Turns the variables' values into physical px insets. An unset value is 0, a
|
|
12
|
+
* px value is read as written, and any other CSS length (a calc() is kept as
|
|
13
|
+
* written in the computed value of an unregistered custom property) is
|
|
14
|
+
* measured. In left to right -start is the left side and -end the right; in
|
|
15
|
+
* right to left they swap.
|
|
16
|
+
*/
|
|
17
|
+
function frameInsetsFrom(values, rtl, measure) {
|
|
18
|
+
const read = (raw, axis) => {
|
|
19
|
+
const value = raw.trim();
|
|
20
|
+
if (value === "") return 0;
|
|
21
|
+
const px = PX_LENGTH.test(value) ? Number.parseFloat(value) : measure(value, axis);
|
|
22
|
+
return Number.isFinite(px) ? Math.max(0, px) : 0;
|
|
23
|
+
};
|
|
24
|
+
const top = read(values.top, "block");
|
|
25
|
+
const start = read(values.start, "inline");
|
|
26
|
+
const end = read(values.end, "inline");
|
|
27
|
+
if (top === 0 && start === 0 && end === 0) return NO_FRAME_INSETS;
|
|
28
|
+
return {
|
|
29
|
+
top,
|
|
30
|
+
right: rtl ? start : end,
|
|
31
|
+
bottom: 0,
|
|
32
|
+
left: rtl ? end : start
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function contextElement(container) {
|
|
36
|
+
const node = container && "current" in container ? container.current : container;
|
|
37
|
+
if (node instanceof Element) return node;
|
|
38
|
+
if (node && "host" in node) return node.host;
|
|
39
|
+
return document.body ?? document.documentElement;
|
|
40
|
+
}
|
|
41
|
+
function measureWithProbe(root) {
|
|
42
|
+
let probe = null;
|
|
43
|
+
const measure = (value, axis) => {
|
|
44
|
+
if (!probe) {
|
|
45
|
+
probe = document.createElement("div");
|
|
46
|
+
probe.style.cssText = "position:fixed;top:0;left:0;width:0;height:0;visibility:hidden;pointer-events:none";
|
|
47
|
+
root.append(probe);
|
|
48
|
+
}
|
|
49
|
+
probe.style.width = "0";
|
|
50
|
+
probe.style.height = "0";
|
|
51
|
+
probe.style.setProperty(axis === "block" ? "height" : "width", value);
|
|
52
|
+
const box = probe.getBoundingClientRect();
|
|
53
|
+
return axis === "block" ? box.height : box.width;
|
|
54
|
+
};
|
|
55
|
+
return Object.assign(measure, { done: () => probe?.remove() });
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Reads the frame insets once, as physical px. The direction is the one the
|
|
59
|
+
* popup renders in: the computed `direction` of its portal container (the
|
|
60
|
+
* body by default), so `dir="rtl"` on the document or on the nearest ancestor
|
|
61
|
+
* of the container counts.
|
|
62
|
+
*/
|
|
63
|
+
function readFrameInsets(container) {
|
|
64
|
+
if (typeof document === "undefined") return NO_FRAME_INSETS;
|
|
65
|
+
const root = document.documentElement;
|
|
66
|
+
const style = getComputedStyle(root);
|
|
67
|
+
const values = {
|
|
68
|
+
top: style.getPropertyValue("--raft-frame-inset-top"),
|
|
69
|
+
start: style.getPropertyValue("--raft-frame-inset-start"),
|
|
70
|
+
end: style.getPropertyValue("--raft-frame-inset-end")
|
|
71
|
+
};
|
|
72
|
+
if (values.top.trim() === "" && values.start.trim() === "" && values.end.trim() === "") return NO_FRAME_INSETS;
|
|
73
|
+
const rtl = getComputedStyle(contextElement(container)).direction === "rtl";
|
|
74
|
+
const measure = measureWithProbe(root);
|
|
75
|
+
try {
|
|
76
|
+
return frameInsetsFrom(values, rtl, measure);
|
|
77
|
+
} finally {
|
|
78
|
+
measure.done();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The collision padding with the insets added: on each side with an inset,
|
|
83
|
+
* at least the inset plus `gap`; elsewhere `padding` as it is. With no inset
|
|
84
|
+
* the padding comes back unchanged, so nothing moves on the web.
|
|
85
|
+
*/
|
|
86
|
+
function frameCollisionPadding(padding, insets, gap) {
|
|
87
|
+
if (insets.top === 0 && insets.right === 0 && insets.bottom === 0 && insets.left === 0) return padding;
|
|
88
|
+
const base = typeof padding === "number" ? {
|
|
89
|
+
top: padding,
|
|
90
|
+
right: padding,
|
|
91
|
+
bottom: padding,
|
|
92
|
+
left: padding
|
|
93
|
+
} : padding;
|
|
94
|
+
const side = (key) => {
|
|
95
|
+
const own = base[key] ?? 0;
|
|
96
|
+
return insets[key] > 0 ? Math.max(own, insets[key] + gap) : own;
|
|
97
|
+
};
|
|
98
|
+
return {
|
|
99
|
+
top: side("top"),
|
|
100
|
+
right: side("right"),
|
|
101
|
+
bottom: side("bottom"),
|
|
102
|
+
left: side("left")
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The frame insets, read when the calling component mounts. Call it from a
|
|
107
|
+
* part inside the popup's portal, which mounts each time the popup opens.
|
|
108
|
+
*/
|
|
109
|
+
function useFrameInsets(container) {
|
|
110
|
+
const [insets] = useState(() => readFrameInsets(container));
|
|
111
|
+
return insets;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A popup's collision padding (a popover, a menu, a select or combobox list,
|
|
115
|
+
* a preview card): `defaultPadding` where there is no inset, and 8px inside
|
|
116
|
+
* each inset. A `collisionPadding` the caller passes wins as it is.
|
|
117
|
+
*/
|
|
118
|
+
function usePopupCollisionPadding(collisionPadding, defaultPadding, container) {
|
|
119
|
+
const insets = useFrameInsets(container);
|
|
120
|
+
return useMemo(() => collisionPadding ?? frameCollisionPadding(defaultPadding, insets, 8), [
|
|
121
|
+
collisionPadding,
|
|
122
|
+
defaultPadding,
|
|
123
|
+
insets
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { NO_FRAME_INSETS, frameCollisionPadding, frameInsetsFrom, readFrameInsets, useFrameInsets, usePopupCollisionPadding };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/lib/head-edges.ts
|
|
2
|
+
/**
|
|
3
|
+
* The ends of a header (design/foundations/alignment.md#the-ends-of-a-header).
|
|
4
|
+
*
|
|
5
|
+
* A head pads both sides by its column's content margin, so a shape (a
|
|
6
|
+
* sticker, a filled button) and text land on the margin as they are. A
|
|
7
|
+
* frameless icon button declares how far its icon box sits inside its edge,
|
|
8
|
+
* `--icon-inset` = (button - icon) / 2, and the head pulls its first and last
|
|
9
|
+
* child outward by that much: the icon box lands on the margin and the
|
|
10
|
+
* button's empty hit area hangs past it, toward the edge. The two ends mirror,
|
|
11
|
+
* and the line holds at every button size (32px with an 18px icon on a
|
|
12
|
+
* desktop, 44px with a 22px icon on a phone and a touch screen) without a
|
|
13
|
+
* number per size or per breakpoint. A title, a sticker or a filled button
|
|
14
|
+
* declares no inset and stays on the margin.
|
|
15
|
+
*
|
|
16
|
+
* An element that declares an inset also carries `data-icon-inset`, which
|
|
17
|
+
* anchors the head's `:first-child` / `:last-child` (packages/ui/CLAUDE.md,
|
|
18
|
+
* Selector Cost). A group of actions declares its buttons' inset itself, so
|
|
19
|
+
* the pull holds when its last action is hidden at some width.
|
|
20
|
+
*/
|
|
21
|
+
/** The pull alone, for a head whose padding is already its margin (a dialog's 20px). */
|
|
22
|
+
const headEdgePull = ["[&>[data-icon-inset]:first-child]:-ml-icon-inset", "[&>[data-icon-inset]:last-child]:-mr-icon-inset"];
|
|
23
|
+
/**
|
|
24
|
+
* A panel's head: its column's margin, and the pull. The margin is
|
|
25
|
+
* `--column-margin` (styles.css): 20px on a desktop and 16px on a phone,
|
|
26
|
+
* and 20px at every width in a column of list cells, whose rows put their
|
|
27
|
+
* content 8 + 12 = 20px in (lib/list-cell.ts). The column sets it (an
|
|
28
|
+
* ActivityInboxPanel, a SidebarRoot, a Search frame), so its head, its
|
|
29
|
+
* toolbar and its rows start on one line on a phone as on a desktop.
|
|
30
|
+
*/
|
|
31
|
+
const headEdges = ["px-(--column-margin)", ...headEdgePull];
|
|
32
|
+
/**
|
|
33
|
+
* Sets a column of list cells' margin to 20px at every width: the rows'
|
|
34
|
+
* content edge (lib/list-cell.ts), which the heads and notices in it follow.
|
|
35
|
+
*/
|
|
36
|
+
const listColumnMargin = "[--column-margin:20px]";
|
|
37
|
+
/**
|
|
38
|
+
* The inset of a control-height icon button (a PanelAction, a Button at
|
|
39
|
+
* `icon-lg`): 7px on a desktop, 11px on a phone and on a touch screen. Written
|
|
40
|
+
* as the arithmetic so it follows the control tokens wherever they switch.
|
|
41
|
+
*/
|
|
42
|
+
const controlIconInset = "[--icon-inset:calc((var(--control-height)-var(--control-icon-size))/2)]";
|
|
43
|
+
//#endregion
|
|
44
|
+
export { controlIconInset, headEdgePull, headEdges, listColumnMargin };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/lib/hud-text-action.ts
|
|
2
|
+
const hudTextAction = [
|
|
3
|
+
"font-sans text-callout font-bold text-foreground-on-hud",
|
|
4
|
+
"decoration-[1.5px] underline-offset-[3px] not-disabled:not-aria-disabled:hover:underline",
|
|
5
|
+
"after:absolute after:-inset-x-2 after:-inset-y-3 after:rounded-control after:content-['']",
|
|
6
|
+
"active:after:bg-foreground-on-hud/15",
|
|
7
|
+
"outline-1 outline-offset-2 outline-transparent focus-visible:keyboard:outline-2 focus-visible:keyboard:outline-foreground-on-hud"
|
|
8
|
+
];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { hudTextAction };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/lib/inline-chip.ts
|
|
2
|
+
/**
|
|
3
|
+
* The one box every chip in message text shares: a reference chip (any
|
|
4
|
+
* variant, loading or unavailable too), the yellow sticker of a mention of the
|
|
5
|
+
* person reading, and an inline task chip. The rule and its numbers are in
|
|
6
|
+
* message-item.md, Chips in running text.
|
|
7
|
+
*
|
|
8
|
+
* - Type: 0.875em of the sentence, semibold.
|
|
9
|
+
* - Height: the line box of its text, the body line less 2px, with no padding
|
|
10
|
+
* above or below: 20px on a desktop (body 14/22), 22px on a phone (16/24). A
|
|
11
|
+
* chip is always 2px shorter than its line, so it never makes the line taller.
|
|
12
|
+
* `--chip-line-height` overrides it for text that isn't on the body line.
|
|
13
|
+
* - Alignment: the chip's text on the sentence's baseline, a leading mark
|
|
14
|
+
* centred on the chip (alignment.md, Marks in running text).
|
|
15
|
+
* - Sides: 6px at each end. A chip with a leading mark (a 14px icon, an app's
|
|
16
|
+
* image or avatar in `MessageReferenceIcon`'s 14px box, the loading spinner,
|
|
17
|
+
* a task's 10px status pixel, each in its own box) takes
|
|
18
|
+
* 4.5px at each end, so the ink at its two ends sits equally far in
|
|
19
|
+
* (alignment.md, Chips), and the mark is 4px from the text. A note after the
|
|
20
|
+
* label keeps the same 4px.
|
|
21
|
+
* - Corners: `rounded-sticker`.
|
|
22
|
+
*/
|
|
23
|
+
const inlineChip = [
|
|
24
|
+
"items-baseline gap-1 px-1.5 py-0 align-baseline",
|
|
25
|
+
"has-[>svg,>[data-slot=spinner],>[data-slot=message-reference-icon]]:px-[4.5px]",
|
|
26
|
+
"[font-size:0.875em] leading-[var(--chip-line-height,calc(var(--text-body--line-height)-2px))] font-semibold",
|
|
27
|
+
"rounded-sticker"
|
|
28
|
+
];
|
|
29
|
+
//#endregion
|
|
30
|
+
export { inlineChip };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/lib/input-modality.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Input modality: whether the person last moved through the page with a
|
|
4
|
+
* pointer, with the keyboard, or by a virtual cursor (a screen reader). raft-ui shows a focus indicator only after
|
|
5
|
+
* keyboard navigation (design/foundations/states.md#focus): styles.css clears
|
|
6
|
+
* `--focus-ring` and the `keyboard:` variant stops matching while the root
|
|
7
|
+
* carries `data-input-modality="pointer"`. With no attribute (no script, or
|
|
8
|
+
* the tracker not installed) every focus indicator shows, as it did before.
|
|
9
|
+
*/
|
|
10
|
+
export type InputModality = "pointer" | "keyboard" | "virtual";
|
|
11
|
+
/**
|
|
12
|
+
* Track the input modality on `doc.documentElement` as
|
|
13
|
+
* `data-input-modality="pointer" | "keyboard" | "virtual"`. Only `pointer`
|
|
14
|
+
* hides focus rings, so every uncertain case keeps them visible:
|
|
15
|
+
*
|
|
16
|
+
* - **Unknown at first.** No attribute until there is evidence, so a keyboard
|
|
17
|
+
* user who hasn't pressed Tab yet still sees focus moved by code. The first
|
|
18
|
+
* real mouse movement or press makes it `pointer`.
|
|
19
|
+
* - **Keyboard**: Tab and F6 anywhere; the arrows, Home, End, Page Up, Page
|
|
20
|
+
* Down, Enter, Space and Esc outside a text field. Inside a text field those
|
|
21
|
+
* keys edit and leave the modality alone, unless focus leaves the field
|
|
22
|
+
* right after (Esc closing a dialog, Enter submitting): then it is
|
|
23
|
+
* `keyboard`. Typing and Cmd or Ctrl shortcuts never count; a shortcut that
|
|
24
|
+
* moves focus to a control is caught by the next rule.
|
|
25
|
+
* - **Virtual**: focus that arrives with no key or pointer press just before
|
|
26
|
+
* it (a screen reader's browse cursor, a timer), and a screen reader's
|
|
27
|
+
* synthesized pointer press. Rings show.
|
|
28
|
+
* - **Pointer**: a real pointer press, or real pointer movement while the
|
|
29
|
+
* modality is still unknown or virtual.
|
|
30
|
+
*
|
|
31
|
+
* `ThemeProvider` calls this for you. Installing twice adds no second set of
|
|
32
|
+
* listeners. Returns a function that undoes this installation; the listeners
|
|
33
|
+
* and the attribute go once every installation is undone.
|
|
34
|
+
*/
|
|
35
|
+
export declare function installInputModality(doc?: Document): () => void;
|
|
36
|
+
//#endregion
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
//#region src/lib/input-modality.ts
|
|
2
|
+
const INPUT_MODALITY_ATTRIBUTE = "data-input-modality";
|
|
3
|
+
/** Keys that move focus wherever focus is. */
|
|
4
|
+
const NAVIGATION_KEYS = /* @__PURE__ */ new Set(["Tab", "F6"]);
|
|
5
|
+
/** Keys that navigate a widget, but move the caret in a text field. */
|
|
6
|
+
const CARET_KEYS = /* @__PURE__ */ new Set([
|
|
7
|
+
"ArrowUp",
|
|
8
|
+
"ArrowDown",
|
|
9
|
+
"ArrowLeft",
|
|
10
|
+
"ArrowRight",
|
|
11
|
+
"Home",
|
|
12
|
+
"End",
|
|
13
|
+
"PageUp",
|
|
14
|
+
"PageDown"
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* Keys that activate or dismiss a control, but belong to editing in a text
|
|
18
|
+
* field. Esc in the composer closes a suggestion list or cancels an edit; it
|
|
19
|
+
* must not turn the composer's ring on for someone using a mouse.
|
|
20
|
+
*/
|
|
21
|
+
const ACTIVATION_KEYS = /* @__PURE__ */ new Set([
|
|
22
|
+
"Enter",
|
|
23
|
+
" ",
|
|
24
|
+
"Spacebar",
|
|
25
|
+
"Escape"
|
|
26
|
+
]);
|
|
27
|
+
/** Input types that take typed text (and whose arrow keys move a caret or step a value). */
|
|
28
|
+
const TEXT_INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
29
|
+
"text",
|
|
30
|
+
"search",
|
|
31
|
+
"url",
|
|
32
|
+
"tel",
|
|
33
|
+
"email",
|
|
34
|
+
"password",
|
|
35
|
+
"number",
|
|
36
|
+
"date",
|
|
37
|
+
"datetime-local",
|
|
38
|
+
"month",
|
|
39
|
+
"time",
|
|
40
|
+
"week"
|
|
41
|
+
]);
|
|
42
|
+
/** `isContentEditable`, for DOMs that don't implement it. */
|
|
43
|
+
const EDITABLE = "[contenteditable=\"\"], [contenteditable=\"true\"], [contenteditable=\"plaintext-only\"]";
|
|
44
|
+
function isTextEntry(target) {
|
|
45
|
+
if (!target || typeof target !== "object" || !("nodeType" in target)) return false;
|
|
46
|
+
const element = target;
|
|
47
|
+
if (element.tagName === "TEXTAREA") return true;
|
|
48
|
+
if (element.tagName === "INPUT") return TEXT_INPUT_TYPES.has(element.type);
|
|
49
|
+
return element.isContentEditable === true || element.closest?.(EDITABLE) != null;
|
|
50
|
+
}
|
|
51
|
+
function keyboardNavigates(event) {
|
|
52
|
+
if (event.metaKey || event.ctrlKey) return false;
|
|
53
|
+
if (NAVIGATION_KEYS.has(event.key)) return true;
|
|
54
|
+
if (!CARET_KEYS.has(event.key) && !ACTIVATION_KEYS.has(event.key)) return false;
|
|
55
|
+
return !isTextEntry(eventTarget(event));
|
|
56
|
+
}
|
|
57
|
+
/** A key that edits in a text field, but may also send focus out of it (Esc closing a dialog, Enter submitting). */
|
|
58
|
+
function editingKeyInField(event) {
|
|
59
|
+
if (event.metaKey || event.ctrlKey) return null;
|
|
60
|
+
if (!CARET_KEYS.has(event.key) && !ACTIVATION_KEYS.has(event.key)) return null;
|
|
61
|
+
const target = eventTarget(event);
|
|
62
|
+
return isTextEntry(target) ? target : null;
|
|
63
|
+
}
|
|
64
|
+
/** The focused element may sit in a shadow root; the path's first entry is it. */
|
|
65
|
+
function eventTarget(event) {
|
|
66
|
+
return event.composedPath?.()[0] ?? event.target;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A pointer event a screen reader synthesizes (VoiceOver, TalkBack, NVDA
|
|
70
|
+
* activating an element): it has no real contact area. Same test as React
|
|
71
|
+
* Aria's `isVirtualPointerEvent`.
|
|
72
|
+
*/
|
|
73
|
+
function isVirtualPointerEvent(event) {
|
|
74
|
+
return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse";
|
|
75
|
+
}
|
|
76
|
+
/** How long after a key or a pointer press a focus move still counts as caused by it. */
|
|
77
|
+
const CAUSE_WINDOW_MS = 1e3;
|
|
78
|
+
const installations = /* @__PURE__ */ new WeakMap();
|
|
79
|
+
/**
|
|
80
|
+
* Track the input modality on `doc.documentElement` as
|
|
81
|
+
* `data-input-modality="pointer" | "keyboard" | "virtual"`. Only `pointer`
|
|
82
|
+
* hides focus rings, so every uncertain case keeps them visible:
|
|
83
|
+
*
|
|
84
|
+
* - **Unknown at first.** No attribute until there is evidence, so a keyboard
|
|
85
|
+
* user who hasn't pressed Tab yet still sees focus moved by code. The first
|
|
86
|
+
* real mouse movement or press makes it `pointer`.
|
|
87
|
+
* - **Keyboard**: Tab and F6 anywhere; the arrows, Home, End, Page Up, Page
|
|
88
|
+
* Down, Enter, Space and Esc outside a text field. Inside a text field those
|
|
89
|
+
* keys edit and leave the modality alone, unless focus leaves the field
|
|
90
|
+
* right after (Esc closing a dialog, Enter submitting): then it is
|
|
91
|
+
* `keyboard`. Typing and Cmd or Ctrl shortcuts never count; a shortcut that
|
|
92
|
+
* moves focus to a control is caught by the next rule.
|
|
93
|
+
* - **Virtual**: focus that arrives with no key or pointer press just before
|
|
94
|
+
* it (a screen reader's browse cursor, a timer), and a screen reader's
|
|
95
|
+
* synthesized pointer press. Rings show.
|
|
96
|
+
* - **Pointer**: a real pointer press, or real pointer movement while the
|
|
97
|
+
* modality is still unknown or virtual.
|
|
98
|
+
*
|
|
99
|
+
* `ThemeProvider` calls this for you. Installing twice adds no second set of
|
|
100
|
+
* listeners. Returns a function that undoes this installation; the listeners
|
|
101
|
+
* and the attribute go once every installation is undone.
|
|
102
|
+
*/
|
|
103
|
+
function installInputModality(doc) {
|
|
104
|
+
const target = doc ?? (typeof document === "undefined" ? void 0 : document);
|
|
105
|
+
if (!target) return () => void 0;
|
|
106
|
+
let installation = installations.get(target);
|
|
107
|
+
if (!installation) {
|
|
108
|
+
const root = target.documentElement;
|
|
109
|
+
const current = () => root.getAttribute(INPUT_MODALITY_ATTRIBUTE);
|
|
110
|
+
const set = (modality) => {
|
|
111
|
+
if (current() !== modality) root.setAttribute(INPUT_MODALITY_ATTRIBUTE, modality);
|
|
112
|
+
};
|
|
113
|
+
const now = () => target.defaultView?.performance?.now() ?? Date.now();
|
|
114
|
+
let lastInputAt = -Infinity;
|
|
115
|
+
let editingIn = null;
|
|
116
|
+
let editingAt = -Infinity;
|
|
117
|
+
const onPointerDown = (event) => {
|
|
118
|
+
lastInputAt = now();
|
|
119
|
+
editingIn = null;
|
|
120
|
+
set(isVirtualPointerEvent(event) ? "virtual" : "pointer");
|
|
121
|
+
};
|
|
122
|
+
const onPointerMove = (event) => {
|
|
123
|
+
if (current() === "keyboard" || current() === "pointer") return;
|
|
124
|
+
if (event.pointerType === "mouse" && !isVirtualPointerEvent(event)) set("pointer");
|
|
125
|
+
};
|
|
126
|
+
const onKeyDown = (event) => {
|
|
127
|
+
if (event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta") return;
|
|
128
|
+
lastInputAt = now();
|
|
129
|
+
if (keyboardNavigates(event)) {
|
|
130
|
+
editingIn = null;
|
|
131
|
+
set("keyboard");
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const field = editingKeyInField(event);
|
|
135
|
+
if (field) {
|
|
136
|
+
editingIn = field;
|
|
137
|
+
editingAt = now();
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const onFocusIn = (event) => {
|
|
141
|
+
const focused = eventTarget(event);
|
|
142
|
+
if (editingIn && now() - editingAt < CAUSE_WINDOW_MS) {
|
|
143
|
+
if (!focused || focused !== editingIn && !editingIn.contains(focused)) {
|
|
144
|
+
editingIn = null;
|
|
145
|
+
set("keyboard");
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (now() - lastInputAt > CAUSE_WINDOW_MS) set("virtual");
|
|
151
|
+
};
|
|
152
|
+
const options = {
|
|
153
|
+
capture: true,
|
|
154
|
+
passive: true
|
|
155
|
+
};
|
|
156
|
+
target.addEventListener("pointerdown", onPointerDown, options);
|
|
157
|
+
target.addEventListener("pointermove", onPointerMove, options);
|
|
158
|
+
target.addEventListener("keydown", onKeyDown, options);
|
|
159
|
+
target.addEventListener("focusin", onFocusIn, options);
|
|
160
|
+
installation = {
|
|
161
|
+
count: 0,
|
|
162
|
+
remove: () => {
|
|
163
|
+
target.removeEventListener("pointerdown", onPointerDown, options);
|
|
164
|
+
target.removeEventListener("pointermove", onPointerMove, options);
|
|
165
|
+
target.removeEventListener("keydown", onKeyDown, options);
|
|
166
|
+
target.removeEventListener("focusin", onFocusIn, options);
|
|
167
|
+
root.removeAttribute(INPUT_MODALITY_ATTRIBUTE);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
installations.set(target, installation);
|
|
171
|
+
}
|
|
172
|
+
installation.count += 1;
|
|
173
|
+
let undone = false;
|
|
174
|
+
const current = installation;
|
|
175
|
+
return () => {
|
|
176
|
+
if (undone) return;
|
|
177
|
+
undone = true;
|
|
178
|
+
current.count -= 1;
|
|
179
|
+
if (current.count === 0) {
|
|
180
|
+
current.remove();
|
|
181
|
+
installations.delete(target);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
export { installInputModality };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/lib/list-cell.ts
|
|
2
|
+
const listCell = [
|
|
3
|
+
"list-cell relative isolate bg-transparent shadow-none outline-none",
|
|
4
|
+
"[--cell-inset-x:8px] [--cell-pad-x:12px] [--cell-radius:var(--radius-control)]",
|
|
5
|
+
"[--cell-inset-end:max(0px,calc(var(--cell-inset-x)-var(--scrollbar-size,0px)))]",
|
|
6
|
+
"pr-[calc(var(--cell-inset-end)+var(--cell-pad-x))] pl-[calc(var(--cell-inset-x)+var(--cell-pad-x))]",
|
|
7
|
+
"before:pointer-events-none before:absolute before:-z-1 before:block before:content-['']",
|
|
8
|
+
"before:inset-y-0 before:right-(--cell-inset-end) before:left-(--cell-inset-x)",
|
|
9
|
+
"before:rounded-(--cell-radius) before:border-0",
|
|
10
|
+
"before:transition-colors before:duration-150 before:ease-out"
|
|
11
|
+
];
|
|
12
|
+
const listCellStates = [
|
|
13
|
+
"not-data-active:not-data-selected:not-data-disabled:not-disabled:not-aria-disabled:hover:before:bg-fill-cell-hover",
|
|
14
|
+
"not-data-active:not-data-selected:not-data-disabled:not-disabled:not-aria-disabled:active:before:bg-fill-cell-press",
|
|
15
|
+
"active:before:transition-none",
|
|
16
|
+
"not-data-active:not-data-selected:data-popup-open:before:bg-fill-cell-hover",
|
|
17
|
+
"not-data-active:not-data-selected:has-data-popup-open:before:bg-fill-cell-hover"
|
|
18
|
+
];
|
|
19
|
+
const listCellFocus = ["focus-visible:keyboard:before:inset-ring-2 focus-visible:keyboard:before:inset-ring-foreground"];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { listCell, listCellFocus, listCellStates };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/lib/located.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* How long the located highlight lasts: `info-soft` at once, held 1.2s, faded
|
|
4
|
+
* out by 2s (design/foundations/states.md#located). styles.css runs the
|
|
5
|
+
* animation; useLocated drops `data-located` after this long.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LOCATED_MS = 2000;
|
|
8
|
+
/**
|
|
9
|
+
* Whether an item shows the located highlight: pass it to MessageItem's
|
|
10
|
+
* `located`, or set `data-located` while it is true.
|
|
11
|
+
*
|
|
12
|
+
* `request` names one jump to this item: a counter or token that changes on
|
|
13
|
+
* every jump, `null` or `undefined` for none. Not the item's own id: a second
|
|
14
|
+
* jump to the same item would pass the same value and show nothing. A string
|
|
15
|
+
* or number, never an object: a new object each render would restart the
|
|
16
|
+
* highlight on every render, and it would never show. Pass it once the item is on
|
|
17
|
+
* screen, after the scroll that brings it there. Each new request turns the
|
|
18
|
+
* highlight off, back on two frames later (the animation restarts only after
|
|
19
|
+
* the attribute was gone for a frame, so a second jump to the same item shows
|
|
20
|
+
* again), and off after LOCATED_MS, so the attribute never stays behind and
|
|
21
|
+
* hover comes back. Re-renders with the same request change nothing.
|
|
22
|
+
*/
|
|
23
|
+
export type LocatedRequest = string | number | null | undefined;
|
|
24
|
+
export declare function useLocated(request: LocatedRequest): boolean;
|
|
25
|
+
//#endregion
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
//#region src/lib/located.ts
|
|
3
|
+
/**
|
|
4
|
+
* How long the located highlight lasts: `info-soft` at once, held 1.2s, faded
|
|
5
|
+
* out by 2s (design/foundations/states.md#located). styles.css runs the
|
|
6
|
+
* animation; useLocated drops `data-located` after this long.
|
|
7
|
+
*/
|
|
8
|
+
const LOCATED_MS = 2e3;
|
|
9
|
+
function useLocated(request) {
|
|
10
|
+
const [on, setOn] = useState(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (request == null) return;
|
|
13
|
+
let timer;
|
|
14
|
+
let frame = requestAnimationFrame(() => {
|
|
15
|
+
frame = requestAnimationFrame(() => {
|
|
16
|
+
setOn(() => request);
|
|
17
|
+
timer = setTimeout(() => setOn(null), LOCATED_MS);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
return () => {
|
|
21
|
+
cancelAnimationFrame(frame);
|
|
22
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
23
|
+
};
|
|
24
|
+
}, [request]);
|
|
25
|
+
return request != null && on === request;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { LOCATED_MS, useLocated };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/lib/overlay-depth.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A modal surface: a centred dialog (Dialog, AlertDialog, or an app's own
|
|
5
|
+
* modal) or a sheet (Drawer).
|
|
6
|
+
*/
|
|
7
|
+
export type OverlayLayerKind = "dialog" | "drawer";
|
|
8
|
+
export type OverlayLayerProviderProps = {
|
|
9
|
+
/**
|
|
10
|
+
* What the surface is. Use `"dialog"` for an app's own modal, whatever it
|
|
11
|
+
* looks like: `"drawer"` is for a Base UI Drawer, which nests under another
|
|
12
|
+
* drawer by itself and only draws its own scrim over a `"dialog"`.
|
|
13
|
+
*/
|
|
14
|
+
kind: OverlayLayerKind;
|
|
15
|
+
/** Whether it dims what is under it. A non-modal surface adds nothing. */
|
|
16
|
+
modal: boolean;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Tells everything under it that a modal surface is open, so a raft-ui
|
|
21
|
+
* Dialog, AlertDialog or Drawer opened from inside draws the lighter nested
|
|
22
|
+
* scrim (design/foundations/elevation.md#stacked-overlays). raft-ui's own
|
|
23
|
+
* roots add one by themselves; an app's own modal (its own backdrop, Esc and
|
|
24
|
+
* focus) wraps its scrim and its content in one to join the stack, and reads
|
|
25
|
+
* `useParentOverlayKind` inside it to pick its own scrim. Modal overlays only:
|
|
26
|
+
* a non-modal one passes `modal={false}`, adds nothing, and must not call
|
|
27
|
+
* `useParentOverlayKind` (it would read the layer below as its own).
|
|
28
|
+
*/
|
|
29
|
+
export declare function OverlayLayerProvider({ kind, modal, children }: OverlayLayerProviderProps): import("react").JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* The modal surface this overlay's own surface was opened from, or null when
|
|
32
|
+
* it is the first. Call it inside the surface's own `OverlayLayerProvider`
|
|
33
|
+
* (for raft-ui's overlays, inside their root): the last entry is the surface
|
|
34
|
+
* itself and the one before it is its parent. Not null means the surface is
|
|
35
|
+
* stacked over another and draws `layer-backdrop-nested` instead of
|
|
36
|
+
* `layer-backdrop`. Modal overlays only: under `modal={false}` nothing is
|
|
37
|
+
* added, so the last entry is the parent and this returns the wrong layer. It reads React context, so it sees the surfaces whose
|
|
38
|
+
* tree this one is rendered in, portals included; one opened from outside
|
|
39
|
+
* that tree is not stacked on it here.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useParentOverlayKind(): OverlayLayerKind | null;
|
|
42
|
+
//#endregion
|