@botiverse/raft-ui 0.51.0 → 0.52.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/CHANGELOG.md +20 -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,556 @@
|
|
|
1
|
+
import { cn } from "../../cn.mjs";
|
|
2
|
+
import { tv } from "../../lib/tv.mjs";
|
|
3
|
+
import { useThemeScopeProps } from "../../lib/theme/theme-scope.mjs";
|
|
4
|
+
import { Spinner } from "../spinner/spinner.mjs";
|
|
5
|
+
import { hudTextAction } from "../../lib/hud-text-action.mjs";
|
|
6
|
+
import { CircleCheck, Info, TriangleAlert } from "lucide-react";
|
|
7
|
+
import { cloneElement, createContext, isValidElement, useCallback, useContext, useLayoutEffect, useMemo, useRef } from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Toast } from "@base-ui/react/toast";
|
|
10
|
+
//#region src/components/toast/toast.tsx
|
|
11
|
+
const toastStyles = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
viewport: ["pointer-events-none isolate z-70 w-[min(24rem,calc(100vw-2rem))]", "outline-none"],
|
|
14
|
+
positioner: ["isolate z-[calc(70-var(--toast-index))] outline-none"],
|
|
15
|
+
root: [
|
|
16
|
+
"group/toast pointer-events-auto",
|
|
17
|
+
"select-text",
|
|
18
|
+
"outline-1 outline-offset-2 outline-transparent",
|
|
19
|
+
"[--toast-scale:calc(max(0.84,1-(var(--toast-index)*0.04)))]",
|
|
20
|
+
"[--toast-peek:0.5rem]",
|
|
21
|
+
"[--toast-gap:0.5rem]",
|
|
22
|
+
"[--toast-stack-height:var(--toast-frontmost-height,var(--toast-height))]",
|
|
23
|
+
"[--toast-y:calc((var(--toast-offset-y)*-1)-(var(--toast-index)*var(--toast-gap))+var(--toast-swipe-movement-y))]",
|
|
24
|
+
"transition-[transform,opacity,height] duration-220 ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
25
|
+
"data-limited:opacity-0",
|
|
26
|
+
"data-starting-style:opacity-0",
|
|
27
|
+
"data-ending-style:opacity-0",
|
|
28
|
+
"motion-reduce:transition-none",
|
|
29
|
+
"rounded-container bg-layer-hud text-foreground-on-hud",
|
|
30
|
+
"shadow-float",
|
|
31
|
+
"focus-visible:keyboard:outline-2 focus-visible:keyboard:outline-foreground"
|
|
32
|
+
],
|
|
33
|
+
content: [
|
|
34
|
+
"relative grid grid-cols-[minmax(0,1fr)] items-center overflow-hidden",
|
|
35
|
+
"[&[data-has-description]_[data-slot=toast-body]]:self-start [&[data-has-description]_[data-slot=toast-icon]]:self-start",
|
|
36
|
+
"[&:not([data-has-icon]):not([data-has-actions]):not([data-has-description])]:min-h-(--toast-title-only-min-h,2.25rem)",
|
|
37
|
+
"[&:not([data-has-icon]):not([data-has-actions]):not([data-has-description])]:min-w-(--toast-title-only-min-w,7rem)",
|
|
38
|
+
"[&:not([data-has-icon]):not([data-has-actions]):not([data-has-description])]:px-(--toast-title-only-px,0.75rem)",
|
|
39
|
+
"[&:not([data-has-icon]):not([data-has-actions]):not([data-has-description])]:py-(--toast-title-only-py,0.5rem)",
|
|
40
|
+
"[&:not([data-has-description])>[data-slot=toast-body]:only-child]:justify-self-center [&:not([data-has-description])>[data-slot=toast-body]:only-child]:text-center",
|
|
41
|
+
"transition-opacity duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
42
|
+
"motion-reduce:transition-none",
|
|
43
|
+
"gap-x-3 gap-y-2 px-4 py-3 font-sans text-callout",
|
|
44
|
+
"[--toast-title-only-min-h:2.75rem] [--toast-title-only-px:1rem] [--toast-title-only-py:0.75rem]",
|
|
45
|
+
"data-has-icon:grid-cols-[auto_minmax(0,1fr)]",
|
|
46
|
+
"data-has-actions:grid-cols-[minmax(0,1fr)_auto]",
|
|
47
|
+
"[&[data-has-icon][data-has-actions]]:grid-cols-[auto_minmax(0,1fr)_auto]"
|
|
48
|
+
],
|
|
49
|
+
icon: [
|
|
50
|
+
"flex h-lh w-5 shrink-0 items-center justify-center",
|
|
51
|
+
"[&_svg]:shrink-0",
|
|
52
|
+
"[&_svg]:size-4"
|
|
53
|
+
],
|
|
54
|
+
body: ["min-w-0"],
|
|
55
|
+
title: ["m-0 truncate text-callout", "font-normal text-foreground-on-hud"],
|
|
56
|
+
description: ["m-0 text-callout", "text-foreground-on-hud/70"],
|
|
57
|
+
actions: ["flex items-center justify-end", "gap-4"],
|
|
58
|
+
progress: [
|
|
59
|
+
"pointer-events-none absolute h-[3px] origin-left",
|
|
60
|
+
"animate-[raft-toast-timeout-progress_var(--toast-progress-duration)_linear_forwards]",
|
|
61
|
+
"group-hover/toast:[animation-play-state:paused] group-focus-within/toast:[animation-play-state:paused]",
|
|
62
|
+
"motion-reduce:animate-none motion-reduce:scale-x-100",
|
|
63
|
+
"inset-x-4 bottom-1.5 rounded-[2px] bg-foreground-on-hud/40"
|
|
64
|
+
],
|
|
65
|
+
close: [
|
|
66
|
+
"inline-flex items-center justify-center",
|
|
67
|
+
"outline-1 outline-offset-2 outline-transparent",
|
|
68
|
+
"transition-[background-color,color,border-color,box-shadow,transform] duration-150",
|
|
69
|
+
"disabled:pointer-events-none disabled:opacity-40",
|
|
70
|
+
"relative inset-auto order-1 size-auto shrink-0 whitespace-nowrap",
|
|
71
|
+
"border-0 bg-transparent p-0 shadow-none",
|
|
72
|
+
"font-sans text-callout font-bold text-foreground-on-hud",
|
|
73
|
+
"decoration-[1.5px] underline-offset-[3px] not-disabled:hover:underline",
|
|
74
|
+
"after:absolute after:-inset-x-2 after:-inset-y-3 after:rounded-control after:content-['']",
|
|
75
|
+
"active:after:bg-foreground-on-hud/15",
|
|
76
|
+
"focus-visible:keyboard:outline-2 focus-visible:keyboard:outline-foreground-on-hud",
|
|
77
|
+
"[&_svg]:size-4"
|
|
78
|
+
],
|
|
79
|
+
arrow: [
|
|
80
|
+
"pointer-events-none flex",
|
|
81
|
+
"data-[side=top]:bottom-[-5px]",
|
|
82
|
+
"data-[side=bottom]:top-[-5px] data-[side=bottom]:rotate-180",
|
|
83
|
+
"data-[side=left]:right-[-7px] data-[side=left]:-rotate-90",
|
|
84
|
+
"data-[side=right]:left-[-7px] data-[side=right]:rotate-90",
|
|
85
|
+
"data-[side=inline-start]:right-[-7px] data-[side=inline-start]:-rotate-90",
|
|
86
|
+
"data-[side=inline-end]:left-[-7px] data-[side=inline-end]:rotate-90"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
variants: {
|
|
90
|
+
placement: {
|
|
91
|
+
"bottom-center": { viewport: ["bottom-[calc(max(var(--toast-viewport-bottom,0px),env(safe-area-inset-bottom))+1rem)]", "left-1/2 -translate-x-1/2"] },
|
|
92
|
+
"bottom-right": { viewport: ["bottom-[calc(max(var(--toast-viewport-bottom,0px),env(safe-area-inset-bottom))+1rem)]", "right-4"] },
|
|
93
|
+
"top-center": { viewport: ["top-[calc(max(var(--toast-viewport-top,0px),env(safe-area-inset-top))+1rem)]", "left-1/2 -translate-x-1/2"] },
|
|
94
|
+
"top-right": { viewport: ["top-[calc(max(var(--toast-viewport-top,0px),env(safe-area-inset-top))+1rem)]", "right-4"] },
|
|
95
|
+
none: { viewport: "contents" }
|
|
96
|
+
},
|
|
97
|
+
strategy: {
|
|
98
|
+
fixed: { viewport: "fixed" },
|
|
99
|
+
absolute: { viewport: "absolute" }
|
|
100
|
+
},
|
|
101
|
+
layout: {
|
|
102
|
+
stacked: { root: [
|
|
103
|
+
"absolute inset-x-0 bottom-0 mx-auto h-(--toast-stack-height) origin-bottom",
|
|
104
|
+
"z-[calc(70-var(--toast-index))]",
|
|
105
|
+
"before:pointer-events-auto before:absolute before:inset-x-0 before:top-full before:h-[calc(var(--toast-gap)+3px)] before:content-['']",
|
|
106
|
+
"[--toast-peek-dir:-1]",
|
|
107
|
+
"transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek)*var(--toast-peek-dir))))_scale(var(--toast-scale))]",
|
|
108
|
+
"data-expanded:h-(--toast-height)",
|
|
109
|
+
"data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-y))_scale(1)]",
|
|
110
|
+
"data-starting-style:transform-[translateY(120%)_scale(0.98)]",
|
|
111
|
+
"[&[data-ending-style]:not([data-swipe-direction])]:transform-[translateY(120%)_scale(0.98)]",
|
|
112
|
+
"data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+120%))_translateY(var(--toast-y))]",
|
|
113
|
+
"data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-120%))_translateY(var(--toast-y))]",
|
|
114
|
+
"data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+120%))]",
|
|
115
|
+
"data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-120%))]",
|
|
116
|
+
"[&_[data-slot=toast-content][data-behind]]:opacity-0 [&_[data-slot=toast-content][data-expanded]]:opacity-100",
|
|
117
|
+
"in-data-[toast-placement$=right]:left-auto in-data-[toast-placement$=right]:mx-0",
|
|
118
|
+
"in-data-[toast-placement^=top]:top-0 in-data-[toast-placement^=top]:bottom-auto in-data-[toast-placement^=top]:origin-top",
|
|
119
|
+
"in-data-[toast-placement^=top]:before:top-auto in-data-[toast-placement^=top]:before:bottom-full",
|
|
120
|
+
"in-data-[toast-placement^=top]:[--toast-y:calc(var(--toast-offset-y)+(var(--toast-index)*var(--toast-gap))+var(--toast-swipe-movement-y))]",
|
|
121
|
+
"in-data-[toast-placement^=top]:[--toast-peek-dir:1]",
|
|
122
|
+
"[[data-toast-placement^=top]_&[data-starting-style]]:transform-[translateY(-120%)_scale(0.98)]",
|
|
123
|
+
"[[data-toast-placement^=top]_&[data-ending-style]:not([data-swipe-direction])]:transform-[translateY(-120%)_scale(0.98)]",
|
|
124
|
+
"w-max max-w-full"
|
|
125
|
+
] },
|
|
126
|
+
inline: { root: [
|
|
127
|
+
"relative mx-auto w-max max-w-[min(24rem,var(--available-width,calc(100vw-2rem)))] overflow-visible",
|
|
128
|
+
"origin-(--transform-origin)",
|
|
129
|
+
"data-starting-style:transform-[scale(0.97)]",
|
|
130
|
+
"data-ending-style:transform-[scale(0.99)]",
|
|
131
|
+
"**:data-[slot=toast-content]:opacity-100"
|
|
132
|
+
] }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
defaultVariants: {
|
|
136
|
+
placement: "bottom-center",
|
|
137
|
+
layout: "stacked",
|
|
138
|
+
strategy: "fixed"
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
const toastProgressStyle = /* @__PURE__ */ jsx("style", {
|
|
142
|
+
href: "raft-ui-toast-progress",
|
|
143
|
+
precedence: "default",
|
|
144
|
+
children: `
|
|
145
|
+
@keyframes raft-toast-timeout-progress {
|
|
146
|
+
0% {
|
|
147
|
+
transform: scaleX(1);
|
|
148
|
+
}
|
|
149
|
+
100% {
|
|
150
|
+
transform: scaleX(0);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@media (prefers-reduced-motion: reduce) {
|
|
155
|
+
[data-slot="toast-progress"] {
|
|
156
|
+
animation: none;
|
|
157
|
+
transform: scaleX(1);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
`
|
|
161
|
+
});
|
|
162
|
+
const DEFAULT_TOAST_TIMEOUT_MS = 5e3;
|
|
163
|
+
const DEFAULT_TOAST_ACTION_TIMEOUT_MS = 8e3;
|
|
164
|
+
const ToastProviderConfigContext = createContext({ timeout: DEFAULT_TOAST_TIMEOUT_MS });
|
|
165
|
+
const ToastPlacementContext = createContext(void 0);
|
|
166
|
+
const SWIPE_DIRECTION_BY_EDGE = {
|
|
167
|
+
top: ["up"],
|
|
168
|
+
bottom: ["down", "right"]
|
|
169
|
+
};
|
|
170
|
+
function getSwipeDirection(placement) {
|
|
171
|
+
if (placement?.startsWith("top-")) return [...SWIPE_DIRECTION_BY_EDGE.top];
|
|
172
|
+
if (placement?.startsWith("bottom-")) return [...SWIPE_DIRECTION_BY_EDGE.bottom];
|
|
173
|
+
}
|
|
174
|
+
function resolveActionTimeout(timeout, actionTimeout) {
|
|
175
|
+
if (actionTimeout !== void 0) return actionTimeout;
|
|
176
|
+
return timeout > 0 ? Math.max(timeout, DEFAULT_TOAST_ACTION_TIMEOUT_MS) : 0;
|
|
177
|
+
}
|
|
178
|
+
const defaultManagerTiming = { actionTimeout: DEFAULT_TOAST_ACTION_TIMEOUT_MS };
|
|
179
|
+
const toastAction = tv({ slots: {
|
|
180
|
+
root: [
|
|
181
|
+
"relative order-2 inline-flex shrink-0 items-center justify-center whitespace-nowrap select-none",
|
|
182
|
+
"border-0 bg-transparent p-0",
|
|
183
|
+
...hudTextAction,
|
|
184
|
+
"disabled:pointer-events-none disabled:opacity-40 aria-disabled:cursor-not-allowed aria-disabled:opacity-40",
|
|
185
|
+
"data-[loading=true]:cursor-wait data-[loading=true]:opacity-100",
|
|
186
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 **:data-icon:size-[1em] [&_svg:not([class*='size-'])]:size-3"
|
|
187
|
+
],
|
|
188
|
+
content: "relative z-10 inline-flex items-center justify-center gap-[inherit] data-[loading=true]:invisible",
|
|
189
|
+
loadingIndicator: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center"
|
|
190
|
+
} });
|
|
191
|
+
const createToastManager = Toast.createToastManager;
|
|
192
|
+
const useToastManager = Toast.useToastManager;
|
|
193
|
+
const defaultToastManager = createToastManager();
|
|
194
|
+
function addDefaultToast(intent, title, options = {}) {
|
|
195
|
+
const { action, contentClassName, dismissible, icon, leading, priority, progress, timeout, ...toastOptions } = options;
|
|
196
|
+
const needsTimeToAct = Boolean(action) || intent === "error";
|
|
197
|
+
return defaultToastManager.add({
|
|
198
|
+
...toastOptions,
|
|
199
|
+
timeout: timeout ?? (needsTimeToAct ? defaultManagerTiming.actionTimeout : void 0),
|
|
200
|
+
actionProps: action ? {
|
|
201
|
+
children: action.label,
|
|
202
|
+
onClick: action.onClick
|
|
203
|
+
} : void 0,
|
|
204
|
+
title,
|
|
205
|
+
type: intent,
|
|
206
|
+
priority: priority ?? (intent === "error" ? "high" : void 0),
|
|
207
|
+
data: {
|
|
208
|
+
intent,
|
|
209
|
+
contentClassName,
|
|
210
|
+
hasClose: dismissible,
|
|
211
|
+
hasIcon: icon,
|
|
212
|
+
hasProgress: progress,
|
|
213
|
+
leading
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
const toast = {
|
|
218
|
+
add(options) {
|
|
219
|
+
const { title, type = "info", ...toastOptions } = options;
|
|
220
|
+
return addDefaultToast(type, title, toastOptions);
|
|
221
|
+
},
|
|
222
|
+
info(title, options) {
|
|
223
|
+
return addDefaultToast("info", title, options);
|
|
224
|
+
},
|
|
225
|
+
success(title, options) {
|
|
226
|
+
return addDefaultToast("success", title, options);
|
|
227
|
+
},
|
|
228
|
+
warning(title, options) {
|
|
229
|
+
return addDefaultToast("warning", title, options);
|
|
230
|
+
},
|
|
231
|
+
error(title, options) {
|
|
232
|
+
return addDefaultToast("error", title, options);
|
|
233
|
+
},
|
|
234
|
+
dismiss(id) {
|
|
235
|
+
return defaultToastManager.close(id);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
function getToastTone(type) {
|
|
239
|
+
if (type === "success" || type === "warning" || type === "error") return type;
|
|
240
|
+
return "info";
|
|
241
|
+
}
|
|
242
|
+
function ToastProvider({ actionTimeout, children, limit = 1, portalContainer, renderViewport = true, toastManager = defaultToastManager, timeout = DEFAULT_TOAST_TIMEOUT_MS, viewportClassName, viewportPlacement = "bottom-center", viewportStrategy = "fixed", ...props }) {
|
|
243
|
+
const config = useMemo(() => ({ timeout }), [timeout]);
|
|
244
|
+
const resolvedActionTimeout = resolveActionTimeout(timeout, actionTimeout);
|
|
245
|
+
useLayoutEffect(() => {
|
|
246
|
+
if (toastManager !== defaultToastManager) return;
|
|
247
|
+
defaultManagerTiming.actionTimeout = resolvedActionTimeout;
|
|
248
|
+
return () => {
|
|
249
|
+
defaultManagerTiming.actionTimeout = DEFAULT_TOAST_ACTION_TIMEOUT_MS;
|
|
250
|
+
};
|
|
251
|
+
}, [resolvedActionTimeout, toastManager]);
|
|
252
|
+
return /* @__PURE__ */ jsx(ToastProviderConfigContext.Provider, {
|
|
253
|
+
value: config,
|
|
254
|
+
children: /* @__PURE__ */ jsxs(Toast.Provider, {
|
|
255
|
+
toastManager,
|
|
256
|
+
timeout,
|
|
257
|
+
limit,
|
|
258
|
+
...props,
|
|
259
|
+
children: [children, renderViewport ? /* @__PURE__ */ jsx(DefaultToastLayer, {
|
|
260
|
+
placement: viewportPlacement,
|
|
261
|
+
portalContainer,
|
|
262
|
+
strategy: viewportStrategy,
|
|
263
|
+
viewportClassName
|
|
264
|
+
}) : null]
|
|
265
|
+
})
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
function ToastPortal(props) {
|
|
269
|
+
return /* @__PURE__ */ jsx(Toast.Portal, {
|
|
270
|
+
"data-slot": "toast-portal",
|
|
271
|
+
...useThemeScopeProps(props)
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
function ToastViewport({ placement = "bottom-center", strategy = "fixed", className, ...props }) {
|
|
275
|
+
const { viewport } = toastStyles({
|
|
276
|
+
placement,
|
|
277
|
+
strategy
|
|
278
|
+
});
|
|
279
|
+
return /* @__PURE__ */ jsx(ToastPlacementContext.Provider, {
|
|
280
|
+
value: placement,
|
|
281
|
+
children: /* @__PURE__ */ jsx(Toast.Viewport, {
|
|
282
|
+
"data-slot": "toast-viewport",
|
|
283
|
+
"data-toast-placement": placement,
|
|
284
|
+
className: viewport({ className }),
|
|
285
|
+
...props
|
|
286
|
+
})
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
function ToastPositioner({ className, ...props }) {
|
|
290
|
+
const { positioner } = toastStyles();
|
|
291
|
+
return /* @__PURE__ */ jsx(Toast.Positioner, {
|
|
292
|
+
"data-slot": "toast-positioner",
|
|
293
|
+
className: positioner({ className }),
|
|
294
|
+
...props
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* A toast pushed past the provider's `limit` by a newer one is closed, not
|
|
299
|
+
* held back: toasts replace each other and never queue, so an older toast
|
|
300
|
+
* can't come back when the newer one goes. Its swipe direction follows the
|
|
301
|
+
* viewport's edge unless `swipeDirection` is passed.
|
|
302
|
+
*/
|
|
303
|
+
function ToastRoot({ layout = "stacked", className, swipeDirection, toast: toastObject, ...props }) {
|
|
304
|
+
const { root } = toastStyles({ layout });
|
|
305
|
+
const placement = useContext(ToastPlacementContext);
|
|
306
|
+
const { close } = useToastManager();
|
|
307
|
+
const replaced = toastObject.limited === true && toastObject.transitionStatus !== "ending";
|
|
308
|
+
useLayoutEffect(() => {
|
|
309
|
+
if (replaced) close(toastObject.id);
|
|
310
|
+
}, [
|
|
311
|
+
close,
|
|
312
|
+
replaced,
|
|
313
|
+
toastObject.id
|
|
314
|
+
]);
|
|
315
|
+
return /* @__PURE__ */ jsx(Toast.Root, {
|
|
316
|
+
"data-slot": "toast",
|
|
317
|
+
"data-toast-type": toastObject.type ?? "info",
|
|
318
|
+
swipeDirection: swipeDirection ?? getSwipeDirection(placement),
|
|
319
|
+
toast: toastObject,
|
|
320
|
+
className: root({ className }),
|
|
321
|
+
...props
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* The content layout (self-start, title-only sizing, body centering) needs to
|
|
326
|
+
* know which parts actually rendered. That used to be an ancestor `:has()`
|
|
327
|
+
* styling descendants — a whole-page recalculation trap in Chromium (#386).
|
|
328
|
+
* It measures the rendered DOM after layout instead, so wrapped parts and
|
|
329
|
+
* parts that render nothing behave exactly like the old selectors did.
|
|
330
|
+
*
|
|
331
|
+
* The three attributes are not React-managed props: the layout effect toggles
|
|
332
|
+
* them on this element directly (an attribute write on the component's own
|
|
333
|
+
* node, not a structural change, so it stays outside the #386 invalidation
|
|
334
|
+
* pattern). The measurement re-runs whenever this component renders; the
|
|
335
|
+
* default item rebuilds the content on every toast update, and a hand-written
|
|
336
|
+
* composition that flips a part without re-rendering ToastContent is not
|
|
337
|
+
* observed.
|
|
338
|
+
*/
|
|
339
|
+
function ToastContent({ children, className, ref, ...props }) {
|
|
340
|
+
const { content } = toastStyles();
|
|
341
|
+
const internalRef = useRef(null);
|
|
342
|
+
const setRef = useCallback((node) => {
|
|
343
|
+
internalRef.current = node;
|
|
344
|
+
if (typeof ref === "function") ref(node);
|
|
345
|
+
else if (ref) ref.current = node;
|
|
346
|
+
}, [ref]);
|
|
347
|
+
useLayoutEffect(() => {
|
|
348
|
+
const el = internalRef.current;
|
|
349
|
+
if (!el) return;
|
|
350
|
+
for (const [attribute, selector] of [
|
|
351
|
+
["data-has-icon", "[data-slot=\"toast-icon\"]"],
|
|
352
|
+
["data-has-description", "[data-slot=\"toast-description\"]"],
|
|
353
|
+
["data-has-actions", "[data-slot=\"toast-actions\"]"]
|
|
354
|
+
]) {
|
|
355
|
+
const present = el.querySelector(selector) !== null;
|
|
356
|
+
if (present !== el.hasAttribute(attribute)) el.toggleAttribute(attribute, present);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
return /* @__PURE__ */ jsx(Toast.Content, {
|
|
360
|
+
ref: setRef,
|
|
361
|
+
"data-slot": "toast-content",
|
|
362
|
+
className: content({ className }),
|
|
363
|
+
...props,
|
|
364
|
+
children
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
function ToastIcon({ className, ...props }) {
|
|
368
|
+
const { icon } = toastStyles();
|
|
369
|
+
return /* @__PURE__ */ jsx("div", {
|
|
370
|
+
"data-slot": "toast-icon",
|
|
371
|
+
className: icon({ className }),
|
|
372
|
+
...props
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function ToastBody({ className, ...props }) {
|
|
376
|
+
const { body } = toastStyles();
|
|
377
|
+
return /* @__PURE__ */ jsx("div", {
|
|
378
|
+
"data-slot": "toast-body",
|
|
379
|
+
className: body({ className }),
|
|
380
|
+
...props
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
function ToastActions({ className, ...props }) {
|
|
384
|
+
const { actions } = toastStyles();
|
|
385
|
+
return /* @__PURE__ */ jsx("div", {
|
|
386
|
+
"data-slot": "toast-actions",
|
|
387
|
+
className: actions({ className }),
|
|
388
|
+
...props
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
function ToastProgress({ className, duration = DEFAULT_TOAST_TIMEOUT_MS, style, ...props }) {
|
|
392
|
+
const { progress } = toastStyles();
|
|
393
|
+
const progressStyle = {
|
|
394
|
+
...style,
|
|
395
|
+
"--toast-progress-duration": `${duration}ms`
|
|
396
|
+
};
|
|
397
|
+
return /* @__PURE__ */ jsx("div", {
|
|
398
|
+
"aria-hidden": true,
|
|
399
|
+
"data-slot": "toast-progress",
|
|
400
|
+
className: progress({ className }),
|
|
401
|
+
style: progressStyle,
|
|
402
|
+
...props,
|
|
403
|
+
children: toastProgressStyle
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
function ToastTitle({ className, ...props }) {
|
|
407
|
+
const { title } = toastStyles();
|
|
408
|
+
return /* @__PURE__ */ jsx(Toast.Title, {
|
|
409
|
+
"data-slot": "toast-title",
|
|
410
|
+
className: title({ className }),
|
|
411
|
+
...props
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
function ToastDescription({ className, ...props }) {
|
|
415
|
+
const { description } = toastStyles();
|
|
416
|
+
return /* @__PURE__ */ jsx(Toast.Description, {
|
|
417
|
+
"data-slot": "toast-description",
|
|
418
|
+
className: description({ className }),
|
|
419
|
+
...props
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
function ToastAction({ className, children, disabled, loading = false, loadingLabel = "Loading", render, ...props }) {
|
|
423
|
+
const { root, content, loadingIndicator } = toastAction();
|
|
424
|
+
const renderAction = useCallback((renderProps, state) => {
|
|
425
|
+
const actionChildren = /* @__PURE__ */ jsxs(Fragment$1, { children: [loading ? /* @__PURE__ */ jsx("span", {
|
|
426
|
+
"data-slot": "toast-action-loading-indicator",
|
|
427
|
+
className: loadingIndicator(),
|
|
428
|
+
children: /* @__PURE__ */ jsx(Spinner, { "aria-label": loadingLabel })
|
|
429
|
+
}) : null, /* @__PURE__ */ jsx("span", {
|
|
430
|
+
"data-slot": "toast-action-content",
|
|
431
|
+
"data-loading": loading ? "true" : void 0,
|
|
432
|
+
className: content(),
|
|
433
|
+
children: renderProps.children
|
|
434
|
+
})] });
|
|
435
|
+
const nextRenderProps = {
|
|
436
|
+
...renderProps,
|
|
437
|
+
children: actionChildren
|
|
438
|
+
};
|
|
439
|
+
if (typeof render === "function") return render(nextRenderProps, state);
|
|
440
|
+
if (isValidElement(render)) {
|
|
441
|
+
const renderElement = render;
|
|
442
|
+
return cloneElement(renderElement, {
|
|
443
|
+
...nextRenderProps,
|
|
444
|
+
className: cn(renderProps.className, renderElement.props.className),
|
|
445
|
+
children: actionChildren
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
return /* @__PURE__ */ jsx("button", { ...nextRenderProps });
|
|
449
|
+
}, [
|
|
450
|
+
content,
|
|
451
|
+
loading,
|
|
452
|
+
loadingIndicator,
|
|
453
|
+
loadingLabel,
|
|
454
|
+
render
|
|
455
|
+
]);
|
|
456
|
+
return /* @__PURE__ */ jsx(Toast.Action, {
|
|
457
|
+
"data-slot": "toast-action",
|
|
458
|
+
"data-loading": loading ? "true" : void 0,
|
|
459
|
+
className: root({ className }),
|
|
460
|
+
disabled: disabled || loading,
|
|
461
|
+
"aria-disabled": loading || void 0,
|
|
462
|
+
render: renderAction,
|
|
463
|
+
...props,
|
|
464
|
+
children
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
function ToastClose({ className, children, ...props }) {
|
|
468
|
+
const { close } = toastStyles();
|
|
469
|
+
const usesDefaultText = children == null;
|
|
470
|
+
return /* @__PURE__ */ jsx(Toast.Close, {
|
|
471
|
+
"aria-label": usesDefaultText ? void 0 : "Dismiss toast",
|
|
472
|
+
"data-slot": "toast-close",
|
|
473
|
+
className: close({ className }),
|
|
474
|
+
...props,
|
|
475
|
+
children: children ?? "Dismiss"
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
function ToastArrow({ className, ...props }) {
|
|
479
|
+
const { arrow } = toastStyles();
|
|
480
|
+
return /* @__PURE__ */ jsx(Toast.Arrow, {
|
|
481
|
+
"data-slot": "toast-arrow",
|
|
482
|
+
className: arrow({ className }),
|
|
483
|
+
...props,
|
|
484
|
+
children: /* @__PURE__ */ jsx(ToastArrowSvg, {})
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
function DefaultToastLayer({ placement, portalContainer, strategy, viewportClassName }) {
|
|
488
|
+
return /* @__PURE__ */ jsx(ToastPortal, {
|
|
489
|
+
container: portalContainer,
|
|
490
|
+
children: /* @__PURE__ */ jsx(ToastViewport, {
|
|
491
|
+
placement,
|
|
492
|
+
strategy,
|
|
493
|
+
className: viewportClassName,
|
|
494
|
+
children: /* @__PURE__ */ jsx(DefaultToastList, {})
|
|
495
|
+
})
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
function DefaultToastList() {
|
|
499
|
+
const { toasts } = useToastManager();
|
|
500
|
+
return toasts.map((toastObject) => /* @__PURE__ */ jsx(DefaultToastItem, { toast: toastObject }, toastObject.id));
|
|
501
|
+
}
|
|
502
|
+
function DefaultToastItem({ toast: toastObject }) {
|
|
503
|
+
const { timeout } = useContext(ToastProviderConfigContext);
|
|
504
|
+
const showDescription = Boolean(toastObject.description);
|
|
505
|
+
const showAction = Boolean(toastObject.actionProps?.children);
|
|
506
|
+
const showClose = toastObject.data?.hasClose === true;
|
|
507
|
+
const showIcon = hasLeading(toastObject) || toastObject.data?.hasIcon !== false;
|
|
508
|
+
const progressDuration = toastObject.timeout ?? timeout;
|
|
509
|
+
const showProgress = toastObject.data?.hasProgress === true && toastObject.type !== "loading" && progressDuration > 0;
|
|
510
|
+
return /* @__PURE__ */ jsx(ToastRoot, {
|
|
511
|
+
toast: toastObject,
|
|
512
|
+
children: /* @__PURE__ */ jsxs(ToastContent, {
|
|
513
|
+
className: toastObject.data?.contentClassName,
|
|
514
|
+
children: [
|
|
515
|
+
showIcon ? /* @__PURE__ */ jsx(DefaultToastIcon, { toast: toastObject }) : null,
|
|
516
|
+
/* @__PURE__ */ jsxs(ToastBody, { children: [/* @__PURE__ */ jsx(ToastTitle, {}), showDescription ? /* @__PURE__ */ jsx(ToastDescription, {}) : null] }),
|
|
517
|
+
showAction || showClose ? /* @__PURE__ */ jsxs(ToastActions, { children: [showClose ? /* @__PURE__ */ jsx(ToastClose, {}) : null, showAction ? /* @__PURE__ */ jsx(ToastAction, {}) : null] }) : null,
|
|
518
|
+
showProgress ? /* @__PURE__ */ jsx(ToastProgress, { duration: progressDuration }) : null
|
|
519
|
+
]
|
|
520
|
+
})
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
const TOAST_ICON = {
|
|
524
|
+
info: Info,
|
|
525
|
+
success: CircleCheck,
|
|
526
|
+
warning: TriangleAlert,
|
|
527
|
+
error: TriangleAlert
|
|
528
|
+
};
|
|
529
|
+
function hasLeading(toastObject) {
|
|
530
|
+
const leading = toastObject.data?.leading;
|
|
531
|
+
return leading !== void 0 && leading !== null && leading !== false;
|
|
532
|
+
}
|
|
533
|
+
function DefaultToastIcon({ toast: toastObject }) {
|
|
534
|
+
if (hasLeading(toastObject)) return /* @__PURE__ */ jsx(ToastIcon, {
|
|
535
|
+
"aria-hidden": true,
|
|
536
|
+
children: toastObject.data?.leading
|
|
537
|
+
});
|
|
538
|
+
const intent = toastObject.data?.intent ?? getToastTone(toastObject.type);
|
|
539
|
+
const Icon = TOAST_ICON[intent];
|
|
540
|
+
return /* @__PURE__ */ jsx(ToastIcon, { children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": true }) });
|
|
541
|
+
}
|
|
542
|
+
function ToastArrowSvg(props) {
|
|
543
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
544
|
+
width: "12",
|
|
545
|
+
height: "6",
|
|
546
|
+
viewBox: "0 0 12 6",
|
|
547
|
+
fill: "none",
|
|
548
|
+
...props,
|
|
549
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
550
|
+
d: "M1 0H11L6 5.25Z",
|
|
551
|
+
className: "fill-layer-hud"
|
|
552
|
+
})
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
//#endregion
|
|
556
|
+
export { ToastAction, ToastActions, ToastArrow, ToastBody, ToastClose, ToastContent, ToastDescription, ToastIcon, ToastPortal, ToastPositioner, ToastProgress, ToastProvider, ToastRoot, ToastTitle, ToastViewport, createToastManager, toast, useToastManager };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupLabel, ToggleGroupLabelProps, ToggleGroupProps } from "./toggle-group.mjs";
|
|
2
|
+
export { ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, ToggleGroupLabel, type ToggleGroupLabelProps, type ToggleGroupProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyledProps } from "../../lib/styled-props.mjs";
|
|
2
|
+
import { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
4
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
5
|
+
//#region src/components/toggle-group/toggle-group.d.ts
|
|
6
|
+
export type ToggleGroupProps<T extends string = string> = StyledProps<ToggleGroup.Props<T>>;
|
|
7
|
+
declare function ToggleGroup$1<T extends string = string>({ className, ...props }: ToggleGroupProps<T>): import("react").JSX.Element;
|
|
8
|
+
export type ToggleGroupItemProps<T extends string = string> = StyledProps<Omit<Toggle.Props<T>, "defaultPressed" | "pressed">> & {
|
|
9
|
+
value: T;
|
|
10
|
+
};
|
|
11
|
+
export declare function ToggleGroupItem<T extends string = string>({ className, nativeButton, render, ref, ...props }: ToggleGroupItemProps<T>): import("react").JSX.Element;
|
|
12
|
+
export type ToggleGroupLabelProps = ComponentPropsWithRef<"span">;
|
|
13
|
+
export declare function ToggleGroupLabel({ className, ...props }: ToggleGroupLabelProps): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ToggleGroup$1 as ToggleGroup };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { tv } from "../../lib/tv.mjs";
|
|
2
|
+
import { defaultNativeButton } from "../../lib/default-native-button.mjs";
|
|
3
|
+
import { useTapActivation } from "../../lib/tap-activation.mjs";
|
|
4
|
+
import { useMergedRef } from "../../lib/use-merged-ref.mjs";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
7
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
8
|
+
//#region src/components/toggle-group/toggle-group.tsx
|
|
9
|
+
const toggleGroup = tv({ slots: {
|
|
10
|
+
root: [
|
|
11
|
+
"inline-flex max-w-full items-center",
|
|
12
|
+
"data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:flex-wrap",
|
|
13
|
+
"data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",
|
|
14
|
+
"gap-[3px] rounded-[11px] bg-fill-muted p-[3px]"
|
|
15
|
+
],
|
|
16
|
+
item: [
|
|
17
|
+
"inline-flex h-8 min-w-0 shrink-0 items-center justify-center gap-1.5",
|
|
18
|
+
"whitespace-nowrap",
|
|
19
|
+
"outline-2 outline-offset-2 outline-transparent transition-[background-color,color,box-shadow,transform] duration-100",
|
|
20
|
+
"disabled:pointer-events-none data-disabled:cursor-not-allowed",
|
|
21
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
22
|
+
"rounded-control border-[1.5px] border-transparent bg-transparent px-3",
|
|
23
|
+
"font-sans text-callout font-semibold text-foreground-muted",
|
|
24
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
25
|
+
"hover:bg-fill-medium active:bg-fill-medium",
|
|
26
|
+
"data-pressed:border-sticker-ink data-pressed:bg-selected data-pressed:font-bold data-pressed:text-sticker-ink data-pressed:ring-[1.5px] data-pressed:ring-sticker-edge",
|
|
27
|
+
"data-pressed:hover:bg-selected data-pressed:active:bg-selected data-pressed:active:overlay-sticker-medium",
|
|
28
|
+
"focus-visible:shadow-focus",
|
|
29
|
+
"data-disabled:opacity-100 data-disabled:text-foreground-disabled data-disabled:hover:bg-transparent"
|
|
30
|
+
],
|
|
31
|
+
label: ["truncate"]
|
|
32
|
+
} });
|
|
33
|
+
function ToggleGroup$1({ className, ...props }) {
|
|
34
|
+
const { root } = toggleGroup();
|
|
35
|
+
return /* @__PURE__ */ jsx(ToggleGroup, {
|
|
36
|
+
"data-slot": "toggle-group",
|
|
37
|
+
className: root({ className }),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function ToggleGroupItem({ className, nativeButton, render, ref, ...props }) {
|
|
42
|
+
const { item } = toggleGroup();
|
|
43
|
+
const tapRef = useTapActivation();
|
|
44
|
+
const [setRef] = useMergedRef(tapRef, ref);
|
|
45
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
46
|
+
ref: setRef,
|
|
47
|
+
render,
|
|
48
|
+
nativeButton: nativeButton ?? defaultNativeButton(render),
|
|
49
|
+
type: "button",
|
|
50
|
+
"data-slot": "toggle-group-item",
|
|
51
|
+
className: item({ className }),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function ToggleGroupLabel({ className, ...props }) {
|
|
56
|
+
const { label } = toggleGroup();
|
|
57
|
+
return /* @__PURE__ */ jsx("span", {
|
|
58
|
+
"data-slot": "toggle-group-label",
|
|
59
|
+
className: label({ className }),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { ToggleGroup$1 as ToggleGroup, ToggleGroupItem, ToggleGroupLabel };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Tooltip, TooltipContent, TooltipContentProps, TooltipPortal, TooltipPortalProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipTrigger, TooltipTriggerProps } from "./tooltip.mjs";
|
|
2
|
+
export { Tooltip, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipPortalProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StyledProps } from "../../lib/styled-props.mjs";
|
|
2
|
+
import { Tooltip } from "@base-ui/react/tooltip";
|
|
3
|
+
//#region src/components/tooltip/tooltip.d.ts
|
|
4
|
+
export type TooltipProviderProps = Tooltip.Provider.Props;
|
|
5
|
+
export declare function TooltipProvider({ delay, ...props }: TooltipProviderProps): import("react").JSX.Element;
|
|
6
|
+
export type TooltipProps = Tooltip.Root.Props;
|
|
7
|
+
declare function Tooltip$1(props: TooltipProps): import("react").JSX.Element;
|
|
8
|
+
export type TooltipTriggerProps = StyledProps<Tooltip.Trigger.Props>;
|
|
9
|
+
export declare function TooltipTrigger({ className, ...props }: TooltipTriggerProps): import("react").JSX.Element;
|
|
10
|
+
export type TooltipPortalProps = Tooltip.Portal.Props;
|
|
11
|
+
export declare function TooltipPortal(props: TooltipPortalProps): import("react").JSX.Element;
|
|
12
|
+
export type TooltipContentProps = StyledProps<Tooltip.Popup.Props> & Pick<Tooltip.Positioner.Props, "align" | "alignOffset" | "anchor" | "arrowPadding" | "collisionAvoidance" | "collisionBoundary" | "collisionPadding" | "disableAnchorTracking" | "positionMethod" | "side" | "sideOffset" | "sticky"> & {
|
|
13
|
+
container?: TooltipPortalProps["container"];
|
|
14
|
+
portalProps?: TooltipPortalProps;
|
|
15
|
+
};
|
|
16
|
+
export declare function TooltipContent({ align, alignOffset, anchor, arrowPadding, collisionAvoidance, collisionBoundary, collisionPadding, disableAnchorTracking, positionMethod, side, sideOffset, sticky, container, portalProps, className, children, ...props }: TooltipContentProps): import("react").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Tooltip$1 as Tooltip };
|