@sdxc/ui 2026.10.30 → 2026.11.3
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/README.md +187 -113
- package/dist/app/app-shell-toggle.d.ts +31 -0
- package/dist/app/app-shell-toggle.js +43 -0
- package/dist/app/app-shell.d.ts +131 -0
- package/dist/app/app-shell.js +542 -0
- package/dist/app/auto-refresh.d.ts +104 -0
- package/dist/app/auto-refresh.js +126 -0
- package/dist/{behaviors → app/behaviors}/drag-session.js +1 -1
- package/dist/app/behaviors/refresh-schedule.d.ts +53 -0
- package/dist/app/behaviors/refresh-schedule.js +95 -0
- package/dist/app/behaviors/shortcuts.d.ts +175 -0
- package/dist/app/behaviors/shortcuts.js +401 -0
- package/dist/{behaviors → app/behaviors}/toaster.d.ts +31 -2
- package/dist/{behaviors → app/behaviors}/toaster.js +63 -6
- package/dist/{components → app}/chart.d.ts +63 -9
- package/dist/{components → app}/chart.js +222 -40
- package/dist/app/command-palette.d.ts +132 -0
- package/dist/app/command-palette.js +181 -0
- package/dist/{components → app}/context-menu.d.ts +2 -2
- package/dist/{components → app}/context-menu.js +8 -7
- package/dist/app/danger-zone.d.ts +66 -0
- package/dist/app/danger-zone.js +66 -0
- package/dist/app/detail-sheet.d.ts +119 -0
- package/dist/app/detail-sheet.js +173 -0
- package/dist/{components → app}/drop-indicator.js +3 -3
- package/dist/{components → app}/drop-zone.d.ts +2 -1
- package/dist/{components → app}/drop-zone.js +7 -4
- package/dist/app/editor-layout.d.ts +69 -0
- package/dist/app/editor-layout.js +143 -0
- package/dist/app/empty.d.ts +128 -0
- package/dist/app/empty.js +248 -0
- package/dist/{components → app}/file-trigger.js +2 -2
- package/dist/app/filter-bar.d.ts +169 -0
- package/dist/app/filter-bar.js +346 -0
- package/dist/{components → app}/grid-list.d.ts +1 -1
- package/dist/{components → app}/grid-list.js +16 -18
- package/dist/app/index.d.ts +92 -0
- package/dist/app/index.js +92 -0
- package/dist/app/keyboard-help.d.ts +66 -0
- package/dist/app/keyboard-help.js +56 -0
- package/dist/{components → app}/menubar.js +5 -7
- package/dist/app/mixins/app-shell-controls.d.ts +46 -0
- package/dist/app/mixins/app-shell-controls.js +131 -0
- package/dist/app/mixins/auto-refresh.d.ts +29 -0
- package/dist/app/mixins/auto-refresh.js +66 -0
- package/dist/app/mixins/command-palette.d.ts +56 -0
- package/dist/app/mixins/command-palette.js +297 -0
- package/dist/app/mixins/copy-permalink.d.ts +26 -0
- package/dist/app/mixins/copy-permalink.js +54 -0
- package/dist/app/mixins/detail-sheet-keys.d.ts +28 -0
- package/dist/app/mixins/detail-sheet-keys.js +88 -0
- package/dist/{mixins → app/mixins}/drag-reorder.js +1 -1
- package/dist/{mixins → app/mixins}/drop-zone.js +1 -1
- package/dist/app/mixins/escape-link.d.ts +17 -0
- package/dist/app/mixins/escape-link.js +35 -0
- package/dist/{mixins → app/mixins}/grid-list-keys.js +2 -2
- package/dist/app/mixins/keyboard-help.d.ts +38 -0
- package/dist/app/mixins/keyboard-help.js +51 -0
- package/dist/{mixins → app/mixins}/menubar-keys.js +2 -2
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +80 -0
- package/dist/app/mixins/optimistic-toggle-sync.js +153 -0
- package/dist/app/mixins/range-picker-keys.d.ts +18 -0
- package/dist/app/mixins/range-picker-keys.js +94 -0
- package/dist/{mixins → app/mixins}/resize-handle.js +3 -3
- package/dist/app/mixins/row-navigation.d.ts +85 -0
- package/dist/app/mixins/row-navigation.js +208 -0
- package/dist/app/mixins/save-bar-sync.d.ts +27 -0
- package/dist/app/mixins/save-bar-sync.js +106 -0
- package/dist/app/mixins/save-shortcut.d.ts +47 -0
- package/dist/app/mixins/save-shortcut.js +101 -0
- package/dist/app/mixins/save-status-sync.d.ts +77 -0
- package/dist/app/mixins/save-status-sync.js +159 -0
- package/dist/app/mixins/selection-bar-sync.d.ts +32 -0
- package/dist/app/mixins/selection-bar-sync.js +151 -0
- package/dist/app/mixins/split-view.d.ts +66 -0
- package/dist/app/mixins/split-view.js +319 -0
- package/dist/app/mixins/status-strip-keys.d.ts +17 -0
- package/dist/app/mixins/status-strip-keys.js +79 -0
- package/dist/app/mixins/submit-on-change.d.ts +16 -0
- package/dist/app/mixins/submit-on-change.js +28 -0
- package/dist/app/mixins/table-selection.d.ts +39 -0
- package/dist/app/mixins/table-selection.js +272 -0
- package/dist/app/mixins/toast-queue.d.ts +36 -0
- package/dist/app/mixins/toast-queue.js +77 -0
- package/dist/app/mixins/toast-stack.d.ts +20 -0
- package/dist/app/mixins/toast-stack.js +55 -0
- package/dist/{mixins/treeKeys.js → app/mixins/tree-keys.js} +2 -2
- package/dist/app/optimistic-toggle.d.ts +48 -0
- package/dist/app/optimistic-toggle.js +38 -0
- package/dist/app/page-header.d.ts +71 -0
- package/dist/app/page-header.js +249 -0
- package/dist/app/range-picker.d.ts +102 -0
- package/dist/app/range-picker.js +118 -0
- package/dist/{components → app}/resizable.js +7 -10
- package/dist/app/save-bar.d.ts +54 -0
- package/dist/app/save-bar.js +64 -0
- package/dist/app/save-status.d.ts +50 -0
- package/dist/app/save-status.js +54 -0
- package/dist/app/selection-bar.d.ts +101 -0
- package/dist/app/selection-bar.js +157 -0
- package/dist/app/settings-layout.d.ts +70 -0
- package/dist/app/settings-layout.js +112 -0
- package/dist/app/settings-section.d.ts +140 -0
- package/dist/app/settings-section.js +182 -0
- package/dist/{components → app}/shortcut-list.js +4 -3
- package/dist/app/skeleton.d.ts +79 -0
- package/dist/app/skeleton.js +185 -0
- package/dist/app/sparkline.d.ts +61 -0
- package/dist/app/sparkline.js +145 -0
- package/dist/app/split-view.d.ts +154 -0
- package/dist/app/split-view.js +272 -0
- package/dist/app/stat-card.d.ts +109 -0
- package/dist/app/stat-card.js +379 -0
- package/dist/app/status-strip.d.ts +70 -0
- package/dist/app/status-strip.js +155 -0
- package/dist/app/styles/action-row.d.ts +41 -0
- package/dist/app/styles/action-row.js +59 -0
- package/dist/{styles → app/styles}/chart-palette.d.ts +1 -1
- package/dist/{styles → app/styles}/graphic-host.d.ts +1 -1
- package/dist/{styles → app/styles}/legend-toggle.d.ts +1 -1
- package/dist/app/styles/stat-delta.d.ts +29 -0
- package/dist/app/styles/stat-delta.js +36 -0
- package/dist/app/styles/toast-stack.d.ts +21 -0
- package/dist/app/styles/toast-stack.js +54 -0
- package/dist/app/table.d.ts +327 -0
- package/dist/app/table.js +839 -0
- package/dist/{components → app}/toast.d.ts +105 -5
- package/dist/{components → app}/toast.js +101 -35
- package/dist/app/toasts.d.ts +49 -0
- package/dist/app/toasts.js +103 -0
- package/dist/{components → app}/toolbar.js +3 -3
- package/dist/{components → app}/tree.d.ts +1 -1
- package/dist/{components → app}/tree.js +10 -14
- package/dist/app/utils/app-shell-cookie.d.ts +21 -0
- package/dist/app/utils/app-shell-cookie.js +33 -0
- package/dist/{utils → app/utils}/chart-marker-indices.d.ts +9 -5
- package/dist/{utils → app/utils}/chart-marker-indices.js +9 -8
- package/dist/{utils → app/utils}/chart-path.d.ts +15 -11
- package/dist/{utils → app/utils}/chart-path.js +48 -20
- package/dist/{utils → app/utils}/chart-scale.js +1 -1
- package/dist/app/utils/edited-time.d.ts +19 -0
- package/dist/app/utils/edited-time.js +35 -0
- package/dist/app/utils/key-target.d.ts +23 -0
- package/dist/app/utils/key-target.js +48 -0
- package/dist/app/utils/search-params.d.ts +69 -0
- package/dist/app/utils/search-params.js +132 -0
- package/dist/app/utils/shortcut-groups.d.ts +21 -0
- package/dist/app/utils/shortcut-groups.js +53 -0
- package/dist/app/utils/split-view-layout.d.ts +48 -0
- package/dist/app/utils/split-view-layout.js +71 -0
- package/dist/app/view-options.d.ts +99 -0
- package/dist/app/view-options.js +182 -0
- package/dist/behaviors/index.d.ts +0 -5
- package/dist/behaviors/index.js +0 -5
- package/dist/{components → chat}/attachment.d.ts +1 -1
- package/dist/{components → chat}/attachment.js +17 -23
- package/dist/{behaviors → chat/behaviors}/scroll-follow-model.js +1 -1
- package/dist/{components → chat}/bubble.js +14 -14
- package/dist/chat/index.d.ts +16 -0
- package/dist/chat/index.js +16 -0
- package/dist/{components → chat}/marker.js +6 -8
- package/dist/{components → chat}/message-scroller.d.ts +1 -1
- package/dist/{components → chat}/message-scroller.js +12 -18
- package/dist/{components → chat}/message.js +10 -12
- package/dist/{mixins → chat/mixins}/message-follow.js +2 -2
- package/dist/{components → color}/color-area.js +7 -10
- package/dist/{components → color}/color-field.js +7 -6
- package/dist/{components → color}/color-picker.d.ts +1 -1
- package/dist/{components → color}/color-picker.js +9 -12
- package/dist/{components → color}/color-slider.js +10 -13
- package/dist/{components → color}/color-swatch-picker.js +4 -5
- package/dist/{components → color}/color-swatch.js +3 -4
- package/dist/{components → color}/color-wheel.js +5 -6
- package/dist/color/index.d.ts +21 -0
- package/dist/color/index.js +21 -0
- package/dist/{mixins → color/mixins}/color-area-drag.d.ts +1 -1
- package/dist/{mixins → color/mixins}/color-area-drag.js +2 -2
- package/dist/{mixins → color/mixins}/color-preview.js +1 -1
- package/dist/{mixins → color/mixins}/color-wheel-drag.js +1 -1
- package/dist/{styles → color/styles}/rtl-aware-gradient-direction.d.ts +1 -1
- package/dist/components/accordion.d.ts +3 -3
- package/dist/components/accordion.js +19 -15
- package/dist/components/alert-dialog.js +5 -4
- package/dist/components/alert.js +10 -20
- package/dist/components/aspect-ratio.js +3 -4
- package/dist/components/avatar.d.ts +6 -6
- package/dist/components/avatar.js +56 -8
- package/dist/components/badge.js +11 -9
- package/dist/components/banner.d.ts +61 -0
- package/dist/components/banner.js +101 -0
- package/dist/components/breadcrumbs.js +7 -9
- package/dist/components/button.d.ts +8 -6
- package/dist/components/button.js +22 -14
- package/dist/components/calendar.js +13 -24
- package/dist/components/card.js +9 -11
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.js +12 -20
- package/dist/components/checkbox-group.js +3 -3
- package/dist/components/checkbox.js +2 -2
- package/dist/components/combobox.js +6 -6
- package/dist/components/command.js +10 -14
- package/dist/components/confirm.d.ts +54 -5
- package/dist/components/confirm.js +44 -5
- package/dist/components/cta-group.d.ts +30 -14
- package/dist/components/cta-group.js +29 -10
- package/dist/components/date-field.js +2 -1
- package/dist/components/date-picker.js +4 -5
- package/dist/components/date-range-picker.js +3 -2
- package/dist/components/description.js +2 -1
- package/dist/components/dialog-dismiss.d.ts +18 -0
- package/dist/components/dialog-dismiss.js +15 -0
- package/dist/components/dialog.js +11 -15
- package/dist/components/disclosure.js +10 -14
- package/dist/components/drawer.js +3 -4
- package/dist/components/field-error.js +3 -3
- package/dist/components/form.js +2 -1
- package/dist/components/group.d.ts +14 -0
- package/dist/components/group.js +68 -13
- package/dist/components/header.js +3 -3
- package/dist/components/heading-scope.js +2 -1
- package/dist/components/heading.d.ts +4 -4
- package/dist/components/heading.js +7 -7
- package/dist/components/highlight.js +17 -12
- package/dist/components/hover-card.js +6 -8
- package/dist/components/image-placeholder.js +13 -19
- package/dist/components/index.d.ts +11 -38
- package/dist/components/index.js +11 -38
- package/dist/components/input.js +12 -7
- package/dist/components/item.js +10 -19
- package/dist/components/keyboard.js +3 -3
- package/dist/components/label.js +2 -1
- package/dist/components/link-button.d.ts +7 -5
- package/dist/components/link-button.js +24 -13
- package/dist/components/link.js +3 -4
- package/dist/components/listbox.js +6 -11
- package/dist/components/menu.js +5 -6
- package/dist/components/meter.js +5 -6
- package/dist/components/modal.js +9 -11
- package/dist/components/nav-link.d.ts +1 -1
- package/dist/components/nav-link.js +3 -4
- package/dist/components/navigation-menu.js +17 -23
- package/dist/components/number-field.js +8 -10
- package/dist/components/otp-field.js +2 -1
- package/dist/components/overlay-arrow.js +3 -4
- package/dist/components/pagination.js +8 -10
- package/dist/components/popover.js +3 -4
- package/dist/components/progress-bar.js +5 -5
- package/dist/components/property-list.d.ts +76 -0
- package/dist/components/property-list.js +175 -0
- package/dist/components/radio-group.js +5 -7
- package/dist/components/range-calendar.js +3 -3
- package/dist/components/relative-time.d.ts +72 -0
- package/dist/components/relative-time.js +45 -0
- package/dist/components/scroll-area.js +4 -5
- package/dist/components/search-field.js +8 -11
- package/dist/components/section.js +2 -1
- package/dist/components/select.js +10 -22
- package/dist/components/selection-indicator.js +3 -3
- package/dist/components/sentinel-row.js +3 -3
- package/dist/components/separator.js +3 -3
- package/dist/components/shared-element.js +2 -1
- package/dist/components/sheet.js +6 -7
- package/dist/components/sidebar.js +48 -76
- package/dist/components/slider.js +8 -10
- package/dist/components/spinner.js +3 -3
- package/dist/components/status-dot.d.ts +62 -0
- package/dist/components/status-dot.js +99 -0
- package/dist/components/switch.js +3 -3
- package/dist/components/tabs.js +9 -12
- package/dist/components/tag-group.js +7 -9
- package/dist/components/text-field.d.ts +17 -2
- package/dist/components/text-field.js +14 -4
- package/dist/components/text.js +2 -1
- package/dist/components/textarea.js +3 -4
- package/dist/components/time-field.js +2 -1
- package/dist/components/timeline.d.ts +67 -0
- package/dist/components/timeline.js +159 -0
- package/dist/components/toggle-button.js +5 -7
- package/dist/components/tooltip.js +3 -3
- package/dist/components/typeset.d.ts +2 -1
- package/dist/components/typeset.js +131 -123
- package/dist/components/youtube-embed.js +2 -1
- package/dist/docs/anchor-heading.d.ts +41 -0
- package/dist/docs/anchor-heading.js +62 -0
- package/dist/docs/callout.d.ts +46 -0
- package/dist/docs/callout.js +61 -0
- package/dist/docs/code-block.d.ts +74 -0
- package/dist/docs/code-block.js +322 -0
- package/dist/docs/code-tabs-sync.d.ts +26 -0
- package/dist/docs/code-tabs-sync.js +12 -0
- package/dist/docs/code-tabs.d.ts +53 -0
- package/dist/docs/code-tabs.js +102 -0
- package/dist/docs/copy-button.d.ts +31 -0
- package/dist/docs/copy-button.js +49 -0
- package/dist/docs/docs-feedback.d.ts +67 -0
- package/dist/docs/docs-feedback.js +74 -0
- package/dist/docs/docs-footer.d.ts +40 -0
- package/dist/docs/docs-footer.js +45 -0
- package/dist/docs/docs-hub.d.ts +93 -0
- package/dist/docs/docs-hub.js +142 -0
- package/dist/docs/docs-layout.d.ts +90 -0
- package/dist/docs/docs-layout.js +166 -0
- package/dist/docs/docs-nav-tools.d.ts +25 -0
- package/dist/docs/docs-nav-tools.js +14 -0
- package/dist/docs/docs-nav.d.ts +57 -0
- package/dist/docs/docs-nav.js +76 -0
- package/dist/docs/docs-not-found.d.ts +68 -0
- package/dist/docs/docs-not-found.js +100 -0
- package/dist/docs/docs-page-header.d.ts +55 -0
- package/dist/docs/docs-page-header.js +54 -0
- package/dist/docs/docs-pager.d.ts +50 -0
- package/dist/docs/docs-pager.js +75 -0
- package/dist/docs/file-tree.d.ts +57 -0
- package/dist/docs/file-tree.js +142 -0
- package/dist/docs/index.d.ts +38 -0
- package/dist/docs/index.js +38 -0
- package/dist/docs/install-command.d.ts +54 -0
- package/dist/docs/install-command.js +33 -0
- package/dist/docs/mixins/code-tabs-sync.d.ts +47 -0
- package/dist/docs/mixins/code-tabs-sync.js +137 -0
- package/dist/docs/mixins/copy-feedback.d.ts +25 -0
- package/dist/docs/mixins/copy-feedback.js +49 -0
- package/dist/docs/mixins/copy-from-url.d.ts +27 -0
- package/dist/docs/mixins/copy-from-url.js +95 -0
- package/dist/docs/mixins/docs-nav-tools.d.ts +27 -0
- package/dist/docs/mixins/docs-nav-tools.js +124 -0
- package/dist/docs/mixins/toc-spy.d.ts +30 -0
- package/dist/docs/mixins/toc-spy.js +165 -0
- package/dist/docs/next-steps.d.ts +45 -0
- package/dist/docs/next-steps.js +80 -0
- package/dist/docs/page-actions.d.ts +77 -0
- package/dist/docs/page-actions.js +78 -0
- package/dist/docs/plan-notice.d.ts +28 -0
- package/dist/docs/plan-notice.js +33 -0
- package/dist/docs/props-table.d.ts +64 -0
- package/dist/docs/props-table.js +147 -0
- package/dist/docs/steps.d.ts +51 -0
- package/dist/docs/steps.js +112 -0
- package/dist/docs/table-of-contents.d.ts +49 -0
- package/dist/docs/table-of-contents.js +139 -0
- package/dist/docs/ui-label.d.ts +51 -0
- package/dist/docs/ui-label.js +64 -0
- package/dist/docs/utils/docs-tree.d.ts +81 -0
- package/dist/docs/utils/docs-tree.js +57 -0
- package/dist/docs/utils/reveal-in-scroller.d.ts +19 -0
- package/dist/docs/utils/reveal-in-scroller.js +43 -0
- package/dist/landing/accent-text.d.ts +47 -0
- package/dist/landing/accent-text.js +107 -0
- package/dist/landing/animations/entrance.d.ts +40 -0
- package/dist/landing/animations/entrance.js +52 -0
- package/dist/landing/announcement-chip.d.ts +45 -0
- package/dist/landing/announcement-chip.js +36 -0
- package/dist/landing/author-band.d.ts +78 -0
- package/dist/landing/author-band.js +190 -0
- package/dist/landing/bento.d.ts +99 -0
- package/dist/landing/bento.js +138 -0
- package/dist/landing/changelog-strip.d.ts +74 -0
- package/dist/landing/changelog-strip.js +201 -0
- package/dist/{patterns → landing}/check-row.js +5 -7
- package/dist/{patterns → landing}/closing-cta.d.ts +4 -4
- package/dist/{patterns → landing}/closing-cta.js +8 -8
- package/dist/landing/code-stage.d.ts +93 -0
- package/dist/landing/code-stage.js +434 -0
- package/dist/landing/crosshair.d.ts +44 -0
- package/dist/landing/crosshair.js +48 -0
- package/dist/landing/curriculum.d.ts +79 -0
- package/dist/landing/curriculum.js +194 -0
- package/dist/landing/drawn-chart.d.ts +74 -0
- package/dist/landing/drawn-chart.js +377 -0
- package/dist/landing/event-ticker.d.ts +71 -0
- package/dist/landing/event-ticker.js +331 -0
- package/dist/landing/fan-out-diagram.d.ts +70 -0
- package/dist/landing/fan-out-diagram.js +481 -0
- package/dist/{patterns → landing}/faq-band.d.ts +5 -5
- package/dist/{patterns → landing}/faq-band.js +13 -14
- package/dist/landing/feature-band.d.ts +108 -0
- package/dist/landing/feature-band.js +67 -0
- package/dist/landing/feature.d.ts +148 -0
- package/dist/landing/feature.js +219 -0
- package/dist/landing/flow-diagram.d.ts +62 -0
- package/dist/landing/flow-diagram.js +240 -0
- package/dist/{patterns → landing}/icon-well.d.ts +17 -7
- package/dist/landing/icon-well.js +31 -0
- package/dist/landing/index.d.ts +52 -0
- package/dist/landing/index.js +52 -0
- package/dist/{patterns → landing}/install-tabs.js +4 -5
- package/dist/landing/landing-header.d.ts +103 -0
- package/dist/landing/landing-header.js +110 -0
- package/dist/landing/landing-hero.d.ts +119 -0
- package/dist/landing/landing-hero.js +172 -0
- package/dist/{components/marketing-section.d.ts → landing/landing-section.d.ts} +38 -15
- package/dist/landing/landing-section.js +183 -0
- package/dist/landing/logo-cloud.d.ts +56 -0
- package/dist/landing/logo-cloud.js +160 -0
- package/dist/landing/logo-sentence.d.ts +38 -0
- package/dist/landing/logo-sentence.js +51 -0
- package/dist/landing/marquee.d.ts +44 -0
- package/dist/landing/marquee.js +97 -0
- package/dist/landing/motion-loop.d.ts +43 -0
- package/dist/landing/motion-loop.js +42 -0
- package/dist/landing/pricing-band.d.ts +94 -0
- package/dist/landing/pricing-band.js +151 -0
- package/dist/landing/product-frame.d.ts +108 -0
- package/dist/landing/product-frame.js +202 -0
- package/dist/{patterns → landing}/proof-strip.d.ts +4 -4
- package/dist/{patterns → landing}/proof-strip.js +3 -3
- package/dist/landing/rails.d.ts +45 -0
- package/dist/landing/rails.js +69 -0
- package/dist/landing/rotating-text.d.ts +44 -0
- package/dist/landing/rotating-text.js +67 -0
- package/dist/landing/segmented-stage.d.ts +75 -0
- package/dist/landing/segmented-stage.js +141 -0
- package/dist/landing/sequence-diagram.d.ts +65 -0
- package/dist/landing/sequence-diagram.js +348 -0
- package/dist/landing/site-footer.d.ts +100 -0
- package/dist/landing/site-footer.js +274 -0
- package/dist/landing/site-header.d.ts +126 -0
- package/dist/landing/site-header.js +595 -0
- package/dist/{components → landing}/split.d.ts +12 -5
- package/dist/{components → landing}/split.js +26 -18
- package/dist/landing/sponsor-wall.d.ts +81 -0
- package/dist/landing/sponsor-wall.js +241 -0
- package/dist/{components → landing}/stat-strip.d.ts +31 -7
- package/dist/landing/stat-strip.js +105 -0
- package/dist/landing/step-list.d.ts +73 -0
- package/dist/landing/step-list.js +182 -0
- package/dist/landing/styles/card-grid.d.ts +115 -0
- package/dist/landing/styles/card-grid.js +295 -0
- package/dist/{patterns → landing}/tabbed-stage.d.ts +26 -8
- package/dist/landing/tabbed-stage.js +233 -0
- package/dist/landing/testimonial-band.d.ts +110 -0
- package/dist/landing/testimonial-band.js +164 -0
- package/dist/landing/typed-terminal.d.ts +62 -0
- package/dist/landing/typed-terminal.js +233 -0
- package/dist/landing/utils/pause-toggle.d.ts +37 -0
- package/dist/landing/utils/pause-toggle.js +71 -0
- package/dist/mixins/confirm-phrase.d.ts +19 -0
- package/dist/mixins/confirm-phrase.js +56 -0
- package/dist/mixins/copy-to-clipboard.d.ts +6 -0
- package/dist/mixins/copy-to-clipboard.js +17 -1
- package/dist/mixins/dialog-dismiss.d.ts +21 -0
- package/dist/mixins/dialog-dismiss.js +62 -0
- package/dist/mixins/index.d.ts +4 -15
- package/dist/mixins/index.js +4 -15
- package/dist/mixins/viewer-time.d.ts +20 -0
- package/dist/mixins/viewer-time.js +40 -0
- package/dist/styles/index.d.ts +3 -5
- package/dist/styles/index.js +3 -5
- package/dist/styles/landing.d.ts +200 -0
- package/dist/styles/landing.js +516 -0
- package/dist/styles/segmented-control.d.ts +49 -0
- package/dist/styles/segmented-control.js +71 -0
- package/dist/styles/surface-control.d.ts +18 -0
- package/dist/styles/surface-control.js +31 -0
- package/dist/test/table.d.ts +65 -0
- package/dist/test/table.js +108 -0
- package/dist/utils/eyebrow.d.ts +39 -0
- package/dist/utils/eyebrow.js +21 -0
- package/dist/utils/index.d.ts +2 -5
- package/dist/utils/index.js +2 -5
- package/dist/utils/relative-time.d.ts +44 -0
- package/dist/utils/relative-time.js +69 -0
- package/package.json +16 -6
- package/src/theme.css +87 -22
- package/dist/components/empty.d.ts +0 -91
- package/dist/components/empty.js +0 -151
- package/dist/components/feature.d.ts +0 -102
- package/dist/components/feature.js +0 -150
- package/dist/components/logo-cloud.d.ts +0 -42
- package/dist/components/logo-cloud.js +0 -41
- package/dist/components/marketing-header.d.ts +0 -71
- package/dist/components/marketing-header.js +0 -81
- package/dist/components/marketing-section.js +0 -117
- package/dist/components/skeleton.d.ts +0 -36
- package/dist/components/skeleton.js +0 -38
- package/dist/components/stat-strip.js +0 -65
- package/dist/components/table.d.ts +0 -152
- package/dist/components/table.js +0 -238
- package/dist/patterns/accent-text.d.ts +0 -30
- package/dist/patterns/accent-text.js +0 -17
- package/dist/patterns/announcement-chip.d.ts +0 -41
- package/dist/patterns/announcement-chip.js +0 -49
- package/dist/patterns/bento.d.ts +0 -68
- package/dist/patterns/bento.js +0 -94
- package/dist/patterns/code-stage.d.ts +0 -63
- package/dist/patterns/code-stage.js +0 -82
- package/dist/patterns/feature-band.d.ts +0 -85
- package/dist/patterns/feature-band.js +0 -50
- package/dist/patterns/icon-well.js +0 -38
- package/dist/patterns/index.d.ts +0 -23
- package/dist/patterns/index.js +0 -23
- package/dist/patterns/landing-hero.d.ts +0 -93
- package/dist/patterns/landing-hero.js +0 -126
- package/dist/patterns/product-frame.d.ts +0 -60
- package/dist/patterns/product-frame.js +0 -70
- package/dist/patterns/step-list.d.ts +0 -47
- package/dist/patterns/step-list.js +0 -85
- package/dist/patterns/tabbed-stage.js +0 -77
- package/dist/styles/marketing.d.ts +0 -120
- package/dist/styles/marketing.js +0 -225
- package/dist/utils/semantic-color-panel.d.ts +0 -35
- package/dist/utils/semantic-color-panel.js +0 -28
- /package/dist/{behaviors → app/behaviors}/drag-session.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/resize-session.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/resize-session.js +0 -0
- /package/dist/{behaviors → app/behaviors}/selection-model.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/selection-model.js +0 -0
- /package/dist/{components → app}/drop-indicator.d.ts +0 -0
- /package/dist/{components → app}/file-trigger.d.ts +0 -0
- /package/dist/{components → app}/menubar.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/chart-tooltip.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/chart-tooltip.js +0 -0
- /package/dist/{mixins → app/mixins}/context-menu.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/context-menu.js +0 -0
- /package/dist/{mixins → app/mixins}/drag-reorder.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/drop-zone.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/grid-list-keys.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/menubar-keys.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/resize-handle.d.ts +0 -0
- /package/dist/{mixins/treeKeys.d.ts → app/mixins/tree-keys.d.ts} +0 -0
- /package/dist/{components → app}/resizable.d.ts +0 -0
- /package/dist/{components → app}/shortcut-list.d.ts +0 -0
- /package/dist/{styles → app/styles}/chart-palette.js +0 -0
- /package/dist/{styles → app/styles}/graphic-host.js +0 -0
- /package/dist/{styles → app/styles}/legend-toggle.js +0 -0
- /package/dist/{components → app}/toolbar.d.ts +0 -0
- /package/dist/{utils → app/utils}/chart-scale.d.ts +0 -0
- /package/dist/{behaviors → chat/behaviors}/scroll-follow-model.d.ts +0 -0
- /package/dist/{components → chat}/bubble.d.ts +0 -0
- /package/dist/{components → chat}/marker.d.ts +0 -0
- /package/dist/{components → chat}/message.d.ts +0 -0
- /package/dist/{mixins → chat/mixins}/attachment-trigger.d.ts +0 -0
- /package/dist/{mixins → chat/mixins}/attachment-trigger.js +0 -0
- /package/dist/{mixins → chat/mixins}/message-follow.d.ts +0 -0
- /package/dist/{components → color}/color-area.d.ts +0 -0
- /package/dist/{components → color}/color-field.d.ts +0 -0
- /package/dist/{components → color}/color-slider.d.ts +0 -0
- /package/dist/{components → color}/color-swatch-picker.d.ts +0 -0
- /package/dist/{components → color}/color-swatch.d.ts +0 -0
- /package/dist/{components → color}/color-wheel.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-channel-sync.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-channel-sync.js +0 -0
- /package/dist/{mixins → color/mixins}/color-preview.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-wheel-drag.d.ts +0 -0
- /package/dist/{styles → color/styles}/rtl-aware-gradient-direction.js +0 -0
- /package/dist/{utils → color/utils}/hue-spectrum.d.ts +0 -0
- /package/dist/{utils → color/utils}/hue-spectrum.js +0 -0
- /package/dist/{patterns → landing}/check-row.d.ts +0 -0
- /package/dist/{patterns → landing}/install-tabs.d.ts +0 -0
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A transient notification panel
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* loading graphic, a title/description block, and trailing actions.
|
|
2
|
+
* A transient notification panel reporting the outcome of an action, in one of
|
|
3
|
+
* five semantic tones, plus the region that stacks them and the page queue the
|
|
4
|
+
* `Toasts` island draws, shared by server flash toasts and client toasts alike.
|
|
6
5
|
*
|
|
7
6
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
8
7
|
* @copyright Sergio Xalambrí 2026
|
|
9
8
|
*/
|
|
10
9
|
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
import { Toaster } from "./behaviors/toaster.js";
|
|
11
|
+
/**
|
|
12
|
+
* How long a toast offering Undo stays, in milliseconds: long enough to read
|
|
13
|
+
* the outcome and reach the button, short enough that the change settles soon.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* pageToaster().add({ title: "Monitor deleted", action: { label: "Undo", onAction: restore } }, { duration: TOAST_UNDO_DURATION });
|
|
17
|
+
*/
|
|
18
|
+
export declare const TOAST_UNDO_DURATION = 8000;
|
|
11
19
|
/**
|
|
12
20
|
* Prop types for {@link Toast} and its compound parts, including
|
|
13
21
|
* {@link Toast.Region}.
|
|
@@ -106,8 +114,87 @@ export declare namespace Toast {
|
|
|
106
114
|
interface RegionProps extends TagProps<"div"> {
|
|
107
115
|
/** Corner of the viewport the stack renders in. Default: `"bottom-end"`. */
|
|
108
116
|
placement?: Placement;
|
|
117
|
+
/**
|
|
118
|
+
* Most toasts shown at once; older ones wait out of sight until a newer
|
|
119
|
+
* one leaves. Default: `3`.
|
|
120
|
+
*/
|
|
121
|
+
max?: number;
|
|
122
|
+
/**
|
|
123
|
+
* `"peek"` folds older toasts behind the newest, scaled to 0.95 and 0.9,
|
|
124
|
+
* and fans them out while the pointer or focus is on the stack; `"list"`
|
|
125
|
+
* always shows them one under another. Default: `"peek"`.
|
|
126
|
+
*/
|
|
127
|
+
stack?: Stack;
|
|
109
128
|
/** Every currently queued {@link Toast}. */
|
|
110
|
-
children
|
|
129
|
+
children?: RemixNode;
|
|
130
|
+
}
|
|
131
|
+
/** How {@link Toast.Region} lays out more than one toast. */
|
|
132
|
+
type Stack = "peek" | "list";
|
|
133
|
+
/**
|
|
134
|
+
* One toast as data, the shape {@link Toasts} draws and {@link pageToaster}
|
|
135
|
+
* queues. Copy reads as an outcome: "Monitor deleted", six words at most,
|
|
136
|
+
* and an error ends with its recovery step ("Couldn't save. Try again.").
|
|
137
|
+
*/
|
|
138
|
+
interface Message {
|
|
139
|
+
/** Semantic tone. Default: `"neutral"`. */
|
|
140
|
+
color?: Color;
|
|
141
|
+
/** The outcome, as a noun and a past participle. */
|
|
142
|
+
title: string;
|
|
143
|
+
/** A second line, only when it adds something the title cannot. */
|
|
144
|
+
description?: string;
|
|
145
|
+
/** Draws a spinner in place of the icon while the work is still running. */
|
|
146
|
+
loading?: boolean;
|
|
147
|
+
/** One action: Undo for a reversible destructive change, Retry for a failure. */
|
|
148
|
+
action?: MessageAction;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The single action a {@link Message} offers. `form` posts from server
|
|
152
|
+
* HTML with or without JavaScript; `onAction` runs in the browser, after
|
|
153
|
+
* which the toast leaves.
|
|
154
|
+
*/
|
|
155
|
+
interface MessageAction {
|
|
156
|
+
/** Visible label, a verb: "Undo", "Retry", "View". */
|
|
157
|
+
label: string;
|
|
158
|
+
/** Runs on click in the browser; a function survives only a client-side {@link Toaster.add}. */
|
|
159
|
+
onAction?: () => void;
|
|
160
|
+
/** Submits a form, so the action works from a server-rendered flash toast. */
|
|
161
|
+
form?: MessageForm;
|
|
162
|
+
}
|
|
163
|
+
/** The form a {@link MessageAction} submits. */
|
|
164
|
+
interface MessageForm {
|
|
165
|
+
/** URL the form submits to. */
|
|
166
|
+
action: string;
|
|
167
|
+
/** Default: `"post"`. */
|
|
168
|
+
method?: "get" | "post";
|
|
169
|
+
/** Hidden fields sent with it, such as the id of the record to restore. */
|
|
170
|
+
fields?: Record<string, string>;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* A toast the server rendered from a session flash. The `id` keys the
|
|
174
|
+
* element the browser adopts on hydration, so it must be stable within
|
|
175
|
+
* the response and safe inside an HTML id.
|
|
176
|
+
*/
|
|
177
|
+
interface Flash extends Omit<Message, "action"> {
|
|
178
|
+
/** A form-backed action, the kind that survives the trip from the server. */
|
|
179
|
+
action?: FlashAction;
|
|
180
|
+
/** Stable id, such as a `generateUUID()` minted when the flash was set. */
|
|
181
|
+
id: string;
|
|
182
|
+
/** Milliseconds it stays once hydrated, or `null` to wait for the close button. */
|
|
183
|
+
duration?: number | null;
|
|
184
|
+
}
|
|
185
|
+
/** The action a {@link Flash} offers: a labelled form, such as Undo posting the record id back. */
|
|
186
|
+
interface FlashAction {
|
|
187
|
+
/** Visible label, a verb: "Undo", "Retry", "View". */
|
|
188
|
+
label: string;
|
|
189
|
+
/** The form the action submits. */
|
|
190
|
+
form: MessageForm;
|
|
191
|
+
}
|
|
192
|
+
/** Strings {@link Toasts} announces. */
|
|
193
|
+
interface Labels {
|
|
194
|
+
/** Accessible name of the region landmark, such as "Notifications". */
|
|
195
|
+
region: string;
|
|
196
|
+
/** Accessible name of each toast's close button, such as "Dismiss". */
|
|
197
|
+
dismiss: string;
|
|
111
198
|
}
|
|
112
199
|
}
|
|
113
200
|
/**
|
|
@@ -147,3 +234,16 @@ export declare namespace Toast {
|
|
|
147
234
|
var Close: (handle: Handle<Toast.CloseProps>) => () => import("remix/component").RemixElement;
|
|
148
235
|
var Region: (handle: Handle<Toast.RegionProps>) => () => import("remix/component").RemixElement;
|
|
149
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* The page's toast queue, shared by every island in the document so a toast
|
|
239
|
+
* raised anywhere lands in the one {@link Toasts} stack. On the server each
|
|
240
|
+
* call returns a fresh queue, keeping one request's toasts out of another's.
|
|
241
|
+
*
|
|
242
|
+
* @param queue Name of the queue, matching {@link Toasts.Props.queue}. Default: `"page"`.
|
|
243
|
+
* @returns The queue {@link Toasts} draws.
|
|
244
|
+
* @example
|
|
245
|
+
* pageToaster().add({ color: "success", title: "Monitor saved" });
|
|
246
|
+
* @example
|
|
247
|
+
* pageToaster().promise(save(), { loading: { title: "Saving monitor", loading: true }, success: { title: "Monitor saved", color: "success" }, error: { title: "Couldn't save monitor. Try again.", color: "danger" } });
|
|
248
|
+
*/
|
|
249
|
+
export declare function pageToaster(queue?: string): Toaster<Toast.Message>;
|
|
@@ -2,17 +2,18 @@ import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
|
2
2
|
import { XIcon } from "@sdxc/icons";
|
|
3
3
|
import { bg, border, colorMix, fg } from "@sdxc/u/color";
|
|
4
4
|
import { backdropBlur, backdropSaturate, rounded, shadow, transition } from "@sdxc/u/effects";
|
|
5
|
-
import { pointerEvents, raw } from "@sdxc/u/general";
|
|
6
|
-
import {
|
|
5
|
+
import { combine, pointerEvents, raw, mergeMix } from "@sdxc/u/general";
|
|
6
|
+
import { basis, fixed, flex, flexCol, gap, grow, inlineFlex, insBe, insBs, insIe, insIs, items, justify, relative, shrink, } from "@sdxc/u/layout";
|
|
7
7
|
import { media, supports } from "@sdxc/u/responsive";
|
|
8
|
-
import { is, bs, maxIs, minIs, pb, pi
|
|
8
|
+
import { is, bs, maxIs, mb, mie, minIs, pb, pi } from "@sdxc/u/size";
|
|
9
9
|
import { active, data, hover, when } from "@sdxc/u/state";
|
|
10
10
|
import { translateX } from "@sdxc/u/transform";
|
|
11
11
|
import { balance, fontSize, leading, pretty, weight } from "@sdxc/u/typography";
|
|
12
12
|
import { attrs } from "remix/component";
|
|
13
|
-
import { graphicHostStyle } from "../styles/graphic-host.js";
|
|
14
13
|
import { hitArea } from "../styles/hit-area.js";
|
|
15
14
|
import { warnIfNoAccessibleLabel } from "../utils/warn-if-no-accessible-name.js";
|
|
15
|
+
import { Toaster } from "./behaviors/toaster.js";
|
|
16
|
+
import { toastStackStyle } from "./styles/toast-stack.js";
|
|
16
17
|
/**
|
|
17
18
|
* `role` applied to {@link Toast} through {@link attrs} unless a consumer
|
|
18
19
|
* supplies its own, announcing the panel as a status update that assistive
|
|
@@ -48,10 +49,38 @@ const DEFAULT_GRAPHIC_ARIA_HIDDEN = "true";
|
|
|
48
49
|
* actions run; pass `type="submit"` for a form control.
|
|
49
50
|
*/
|
|
50
51
|
const DEFAULT_BUTTON_TYPE = "button";
|
|
52
|
+
/**
|
|
53
|
+
* Block size of a toast's first line of text, the centre line its icon,
|
|
54
|
+
* action and close button sit on; an app overrides `--ui-toast-line`.
|
|
55
|
+
*/
|
|
56
|
+
const LINE = "var(--ui-toast-line, 1.25rem)";
|
|
57
|
+
/** Block size of a toast's action, cancel and close buttons. */
|
|
58
|
+
const CONTROL = "1.5rem";
|
|
59
|
+
/**
|
|
60
|
+
* Block margin that centres a {@link CONTROL}-tall button on the first line
|
|
61
|
+
* while letting it overhang that line evenly, so it never pushes the text down.
|
|
62
|
+
*/
|
|
63
|
+
const CONTROL_MARGIN = `calc((${LINE} - ${CONTROL}) / 2)`;
|
|
51
64
|
/**
|
|
52
65
|
* Corner {@link Toast.Region} renders in when `placement` is left unset.
|
|
53
66
|
*/
|
|
54
67
|
const DEFAULT_PLACEMENT = "bottom-end";
|
|
68
|
+
/** Default {@link Toast.RegionProps.max}: three toasts show, the rest wait. */
|
|
69
|
+
const DEFAULT_MAX = 3;
|
|
70
|
+
/** Default {@link Toast.RegionProps.stack}: older toasts fold behind the newest. */
|
|
71
|
+
const DEFAULT_STACK = "peek";
|
|
72
|
+
/**
|
|
73
|
+
* How long a toast offering Undo stays, in milliseconds: long enough to read
|
|
74
|
+
* the outcome and reach the button, short enough that the change settles soon.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* pageToaster().add({ title: "Monitor deleted", action: { label: "Undo", onAction: restore } }, { duration: TOAST_UNDO_DURATION });
|
|
78
|
+
*/
|
|
79
|
+
export const TOAST_UNDO_DURATION = 8000;
|
|
80
|
+
/** One queue per document and name, so every island on a page raises toasts into the same stack. */
|
|
81
|
+
const PAGE_TOASTERS = new WeakMap();
|
|
82
|
+
/** Name of the queue {@link pageToaster} and {@link Toasts} share when none is given. */
|
|
83
|
+
const DEFAULT_QUEUE = "page";
|
|
55
84
|
/**
|
|
56
85
|
* `role` applied to {@link Toast.Region} through {@link attrs} unless a
|
|
57
86
|
* consumer supplies its own, exposing the stack of toasts as a landmark
|
|
@@ -87,7 +116,7 @@ export function Toast(handle) {
|
|
|
87
116
|
return () => {
|
|
88
117
|
let { color = DEFAULT_COLOR, live = DEFAULT_LIVE, "aria-live": ariaLiveProp, children, mix, ...rest } = handle.props;
|
|
89
118
|
let ariaLive = ariaLiveProp ?? (live === "off" ? undefined : live);
|
|
90
|
-
return (_jsx("div", { ...rest, "aria-live": ariaLive, "data-color": color, "data-slot": "toast", mix: [
|
|
119
|
+
return (_jsx("div", { ...rest, "aria-live": ariaLive, "data-color": color, "data-slot": "toast", mix: mergeMix([
|
|
91
120
|
attrs({ role: DEFAULT_ROLE, "aria-atomic": DEFAULT_ARIA_ATOMIC }),
|
|
92
121
|
relative(),
|
|
93
122
|
flex(),
|
|
@@ -98,7 +127,6 @@ export function Toast(handle) {
|
|
|
98
127
|
fg("neutral.fg-emphasis"),
|
|
99
128
|
pb("1rem"),
|
|
100
129
|
pi("1rem"),
|
|
101
|
-
when('&:has(> [data-slot="close"])', pie("2.5rem")),
|
|
102
130
|
when('&[data-color="brand"]', [border("brand"), fg("brand.fg-emphasis")]),
|
|
103
131
|
when('&[data-color="neutral"]', [border("neutral"), fg("neutral.fg-emphasis")]),
|
|
104
132
|
when('&[data-color="success"]', [border("success"), fg("success.fg-emphasis")]),
|
|
@@ -137,10 +165,18 @@ export function Toast(handle) {
|
|
|
137
165
|
backdropBlur("md"),
|
|
138
166
|
backdropSaturate(1.4),
|
|
139
167
|
])),
|
|
140
|
-
|
|
141
|
-
], children: children }));
|
|
168
|
+
], mix), children: children }));
|
|
142
169
|
};
|
|
143
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Lays out {@link Toast.Icon} and {@link Toast.Loader} identically, centring
|
|
173
|
+
* the graphic on the toast's first line so swapping them never moves it.
|
|
174
|
+
*
|
|
175
|
+
* @returns A mixin ready for the graphic slot's `mix` prop.
|
|
176
|
+
*/
|
|
177
|
+
function graphicSlotStyle() {
|
|
178
|
+
return combine([shrink(), inlineFlex(), items("center"), bs(LINE), fg("currentcolor")]);
|
|
179
|
+
}
|
|
144
180
|
/**
|
|
145
181
|
* Renders {@link Toast.IconProps.children} as the toast's leading icon,
|
|
146
182
|
* hidden from assistive technology since the toast's color and text already
|
|
@@ -152,7 +188,7 @@ export function Toast(handle) {
|
|
|
152
188
|
Toast.Icon = function ToastIcon(handle) {
|
|
153
189
|
return () => {
|
|
154
190
|
let { children, mix, ...rest } = handle.props;
|
|
155
|
-
return (_jsx("div", { ...rest, "data-slot": "icon", mix: [attrs({ "aria-hidden": DEFAULT_GRAPHIC_ARIA_HIDDEN }),
|
|
191
|
+
return (_jsx("div", { ...rest, "data-slot": "icon", mix: mergeMix([attrs({ "aria-hidden": DEFAULT_GRAPHIC_ARIA_HIDDEN }), graphicSlotStyle()], mix), children: children }));
|
|
156
192
|
};
|
|
157
193
|
};
|
|
158
194
|
/**
|
|
@@ -166,7 +202,7 @@ Toast.Icon = function ToastIcon(handle) {
|
|
|
166
202
|
Toast.Loader = function ToastLoader(handle) {
|
|
167
203
|
return () => {
|
|
168
204
|
let { children, mix, ...rest } = handle.props;
|
|
169
|
-
return (_jsx("div", { ...rest, "data-slot": "loader", mix: [attrs({ "aria-hidden": DEFAULT_GRAPHIC_ARIA_HIDDEN }),
|
|
205
|
+
return (_jsx("div", { ...rest, "data-slot": "loader", mix: mergeMix([attrs({ "aria-hidden": DEFAULT_GRAPHIC_ARIA_HIDDEN }), graphicSlotStyle()], mix), children: children }));
|
|
170
206
|
};
|
|
171
207
|
};
|
|
172
208
|
/**
|
|
@@ -180,7 +216,7 @@ Toast.Loader = function ToastLoader(handle) {
|
|
|
180
216
|
Toast.Content = function ToastContent(handle) {
|
|
181
217
|
return () => {
|
|
182
218
|
let { children, mix, ...rest } = handle.props;
|
|
183
|
-
return (_jsx("div", { ...rest, "data-slot": "content", mix: [flex(), flexCol(), gap("0.25rem"), minIs(0), grow(), shrink(1), basis("0%"), mix
|
|
219
|
+
return (_jsx("div", { ...rest, "data-slot": "content", mix: mergeMix([flex(), flexCol(), gap("0.25rem"), minIs(0), grow(), shrink(1), basis("0%")], mix), children: children }));
|
|
184
220
|
};
|
|
185
221
|
};
|
|
186
222
|
/**
|
|
@@ -194,7 +230,7 @@ Toast.Content = function ToastContent(handle) {
|
|
|
194
230
|
Toast.Title = function ToastTitle(handle) {
|
|
195
231
|
return () => {
|
|
196
232
|
let { children, mix, ...rest } = handle.props;
|
|
197
|
-
return (_jsx("h3", { ...rest, "data-slot": "title", mix: [weight(500), leading(
|
|
233
|
+
return (_jsx("h3", { ...rest, "data-slot": "title", mix: mergeMix([weight(500), leading(LINE), fontSize("sm"), balance()], mix), children: children }));
|
|
198
234
|
};
|
|
199
235
|
};
|
|
200
236
|
/**
|
|
@@ -208,12 +244,12 @@ Toast.Title = function ToastTitle(handle) {
|
|
|
208
244
|
Toast.Description = function ToastDescription(handle) {
|
|
209
245
|
return () => {
|
|
210
246
|
let { children, mix, ...rest } = handle.props;
|
|
211
|
-
return (_jsx("p", { ...rest, "data-slot": "description", mix: [
|
|
247
|
+
return (_jsx("p", { ...rest, "data-slot": "description", mix: mergeMix([
|
|
212
248
|
fontSize("sm"),
|
|
249
|
+
leading(LINE),
|
|
213
250
|
pretty(),
|
|
214
251
|
fg(colorMix("oklab", { color: "currentcolor", weight: 70 }, "transparent")),
|
|
215
|
-
|
|
216
|
-
], children: children }));
|
|
252
|
+
], mix), children: children }));
|
|
217
253
|
};
|
|
218
254
|
};
|
|
219
255
|
/**
|
|
@@ -230,14 +266,16 @@ Toast.Action = function ToastAction(handle) {
|
|
|
230
266
|
return () => {
|
|
231
267
|
let { type, children, mix, ...rest } = handle.props;
|
|
232
268
|
let resolvedType = type ?? DEFAULT_BUTTON_TYPE;
|
|
233
|
-
return (_jsx("button", { type: resolvedType, ...rest, "data-slot": "action", mix: [
|
|
269
|
+
return (_jsx("button", { type: resolvedType, ...rest, "data-slot": "action", mix: mergeMix([
|
|
234
270
|
inlineFlex(),
|
|
235
271
|
items("center"),
|
|
236
272
|
justify("center"),
|
|
237
273
|
rounded("md"),
|
|
238
274
|
border({ width: 1 }),
|
|
239
275
|
pi("0.75rem"),
|
|
240
|
-
|
|
276
|
+
bs(CONTROL),
|
|
277
|
+
mb(CONTROL_MARGIN),
|
|
278
|
+
leading(1),
|
|
241
279
|
weight(500),
|
|
242
280
|
shrink(),
|
|
243
281
|
transition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"),
|
|
@@ -246,8 +284,7 @@ Toast.Action = function ToastAction(handle) {
|
|
|
246
284
|
fontSize("xs"),
|
|
247
285
|
hover(bg(colorMix("oklab", { color: "currentcolor", weight: 10 }, "transparent"))),
|
|
248
286
|
active(bg(colorMix("oklab", { color: "currentcolor", weight: 20 }, "transparent"))),
|
|
249
|
-
|
|
250
|
-
], children: children }));
|
|
287
|
+
], mix), children: children }));
|
|
251
288
|
};
|
|
252
289
|
};
|
|
253
290
|
/**
|
|
@@ -264,14 +301,16 @@ Toast.Cancel = function ToastCancel(handle) {
|
|
|
264
301
|
return () => {
|
|
265
302
|
let { type, children, mix, ...rest } = handle.props;
|
|
266
303
|
let resolvedType = type ?? DEFAULT_BUTTON_TYPE;
|
|
267
|
-
return (_jsx("button", { type: resolvedType, ...rest, "data-slot": "cancel", mix: [
|
|
304
|
+
return (_jsx("button", { type: resolvedType, ...rest, "data-slot": "cancel", mix: mergeMix([
|
|
268
305
|
inlineFlex(),
|
|
269
306
|
items("center"),
|
|
270
307
|
justify("center"),
|
|
271
308
|
rounded("md"),
|
|
272
309
|
border({ color: "neutral", width: 1 }),
|
|
273
310
|
pi("0.75rem"),
|
|
274
|
-
|
|
311
|
+
bs(CONTROL),
|
|
312
|
+
mb(CONTROL_MARGIN),
|
|
313
|
+
leading(1),
|
|
275
314
|
weight(500),
|
|
276
315
|
fg("neutral.fg"),
|
|
277
316
|
hover([bg("neutral.bg-tint-hover"), fg("neutral.fg-emphasis")]),
|
|
@@ -279,8 +318,7 @@ Toast.Cancel = function ToastCancel(handle) {
|
|
|
279
318
|
shrink(),
|
|
280
319
|
transition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"),
|
|
281
320
|
fontSize("xs"),
|
|
282
|
-
|
|
283
|
-
], children: children }));
|
|
321
|
+
], mix), children: children }));
|
|
284
322
|
};
|
|
285
323
|
};
|
|
286
324
|
/**
|
|
@@ -296,22 +334,23 @@ Toast.Cancel = function ToastCancel(handle) {
|
|
|
296
334
|
Toast.Close = function ToastClose(handle) {
|
|
297
335
|
return () => {
|
|
298
336
|
let { mix, ...rest } = handle.props;
|
|
299
|
-
return (_jsx("button", { type: "button", ...rest, "data-slot": "close", mix: [
|
|
300
|
-
|
|
337
|
+
return (_jsx("button", { type: "button", ...rest, "data-slot": "close", mix: mergeMix([
|
|
338
|
+
relative(),
|
|
301
339
|
inlineFlex(),
|
|
302
340
|
items("center"),
|
|
303
341
|
justify("center"),
|
|
304
|
-
|
|
305
|
-
|
|
342
|
+
shrink(),
|
|
343
|
+
is(CONTROL),
|
|
344
|
+
bs(CONTROL),
|
|
345
|
+
mb(CONTROL_MARGIN),
|
|
346
|
+
mie("-0.5rem"),
|
|
347
|
+
raw({ order: "1" }),
|
|
306
348
|
rounded("md"),
|
|
307
349
|
fg("neutral.fg-muted"),
|
|
308
350
|
hover([bg("neutral.bg-tint-hover"), fg("neutral.fg-emphasis")]),
|
|
309
351
|
transition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"),
|
|
310
|
-
insBs("0.5rem"),
|
|
311
|
-
insIe("0.5rem"),
|
|
312
352
|
hitArea(),
|
|
313
|
-
|
|
314
|
-
], children: _jsx(XIcon, { size: 16 }) }));
|
|
353
|
+
], mix), children: _jsx(XIcon, { size: 16 }) }));
|
|
315
354
|
};
|
|
316
355
|
};
|
|
317
356
|
/**
|
|
@@ -342,10 +381,10 @@ Toast.Close = function ToastClose(handle) {
|
|
|
342
381
|
*/
|
|
343
382
|
Toast.Region = function ToastRegion(handle) {
|
|
344
383
|
return () => {
|
|
345
|
-
let { placement, children, mix, ...rest } = handle.props;
|
|
384
|
+
let { placement, max = DEFAULT_MAX, stack = DEFAULT_STACK, children, mix, ...rest } = handle.props;
|
|
346
385
|
let resolvedPlacement = placement ?? DEFAULT_PLACEMENT;
|
|
347
386
|
warnIfNoAccessibleLabel(handle.props, 'Toast.Region: needs an "aria-label" or "aria-labelledby" identifying this landmark for assistive technology.');
|
|
348
|
-
return (_jsx("div", { ...rest, "data-placement": resolvedPlacement, "data-slot": "region", mix: [
|
|
387
|
+
return (_jsx("div", { ...rest, "data-placement": resolvedPlacement, "data-stack": stack, "data-slot": "region", mix: mergeMix([
|
|
349
388
|
attrs({ role: DEFAULT_REGION_ROLE }),
|
|
350
389
|
fixed(),
|
|
351
390
|
flex(),
|
|
@@ -362,7 +401,34 @@ Toast.Region = function ToastRegion(handle) {
|
|
|
362
401
|
when('&[data-placement$="start"]', insIs("0")),
|
|
363
402
|
when('&[data-placement$="end"]', insIe("0")),
|
|
364
403
|
when('&[data-placement$="center"]', [insIs("50%"), translateX("-50%")]),
|
|
365
|
-
|
|
366
|
-
], children: children }));
|
|
404
|
+
toastStackStyle(max),
|
|
405
|
+
], mix), children: children }));
|
|
367
406
|
};
|
|
368
407
|
};
|
|
408
|
+
/**
|
|
409
|
+
* The page's toast queue, shared by every island in the document so a toast
|
|
410
|
+
* raised anywhere lands in the one {@link Toasts} stack. On the server each
|
|
411
|
+
* call returns a fresh queue, keeping one request's toasts out of another's.
|
|
412
|
+
*
|
|
413
|
+
* @param queue Name of the queue, matching {@link Toasts.Props.queue}. Default: `"page"`.
|
|
414
|
+
* @returns The queue {@link Toasts} draws.
|
|
415
|
+
* @example
|
|
416
|
+
* pageToaster().add({ color: "success", title: "Monitor saved" });
|
|
417
|
+
* @example
|
|
418
|
+
* pageToaster().promise(save(), { loading: { title: "Saving monitor", loading: true }, success: { title: "Monitor saved", color: "success" }, error: { title: "Couldn't save monitor. Try again.", color: "danger" } });
|
|
419
|
+
*/
|
|
420
|
+
export function pageToaster(queue = DEFAULT_QUEUE) {
|
|
421
|
+
if (typeof document === "undefined")
|
|
422
|
+
return new Toaster();
|
|
423
|
+
let queues = PAGE_TOASTERS.get(document);
|
|
424
|
+
if (!queues) {
|
|
425
|
+
queues = new Map();
|
|
426
|
+
PAGE_TOASTERS.set(document, queues);
|
|
427
|
+
}
|
|
428
|
+
let toaster = queues.get(queue);
|
|
429
|
+
if (!toaster) {
|
|
430
|
+
toaster = new Toaster();
|
|
431
|
+
queues.set(queue, toaster);
|
|
432
|
+
}
|
|
433
|
+
return toaster;
|
|
434
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The island that draws the page's one toast stack: server flash toasts and
|
|
3
|
+
* toasts raised through `pageToaster()` share a region, timing, pause on hover
|
|
4
|
+
* or focus, and close, so an app runs a single toast system.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { EntryComponent } from "remix/component";
|
|
10
|
+
import type { Toaster } from "./behaviors/toaster.js";
|
|
11
|
+
import { Toast } from "./toast.js";
|
|
12
|
+
/** Prop types for {@link Toasts}. */
|
|
13
|
+
export declare namespace Toasts {
|
|
14
|
+
/** Props accepted by {@link Toasts}. */
|
|
15
|
+
interface Props {
|
|
16
|
+
/** Strings the region and its close buttons announce. */
|
|
17
|
+
labels: Toast.Labels;
|
|
18
|
+
/** Toasts the server rendered from a session flash; hydration adopts each element and starts its timer. */
|
|
19
|
+
initial?: Toast.Flash[];
|
|
20
|
+
/** Corner of the viewport. Default: `"bottom-end"`. */
|
|
21
|
+
placement?: Toast.Placement;
|
|
22
|
+
/** Most toasts shown at once. Default: `3`. */
|
|
23
|
+
max?: number;
|
|
24
|
+
/** Peek stack or plain list. Default: `"peek"`. */
|
|
25
|
+
stack?: Toast.Stack;
|
|
26
|
+
/** Which `pageToaster()` queue to draw; a page normally has one. Default: `"page"`. */
|
|
27
|
+
queue?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Props of one drawn toast inside {@link Toasts}. */
|
|
30
|
+
interface ItemProps {
|
|
31
|
+
/** Queue id, also the base of the element id the close button targets. */
|
|
32
|
+
id: string;
|
|
33
|
+
/** What the toast says and offers. */
|
|
34
|
+
message: Toast.Message;
|
|
35
|
+
/** Strings the close button announces. */
|
|
36
|
+
labels: Toast.Labels;
|
|
37
|
+
/** The queue the toast belongs to, which its close and action report to. */
|
|
38
|
+
toaster: Toaster<Toast.Message>;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The app's one toast stack. A flash toast shows and closes without JavaScript;
|
|
43
|
+
* hydration adopts the same element and only then starts its timer. Reach for a
|
|
44
|
+
* toast last, after an inline message or a banner.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <Toasts labels={{ region: t("toasts.region"), dismiss: t("toasts.dismiss") }} initial={flash ? [flash] : []} />
|
|
48
|
+
*/
|
|
49
|
+
export declare const Toasts: EntryComponent<Toasts.Props>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { CircleAlertIcon, CircleCheckIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon, } from "@sdxc/icons";
|
|
3
|
+
import { raw } from "@sdxc/u/general";
|
|
4
|
+
import { clientEntry } from "remix/component";
|
|
5
|
+
import { spin } from "../animations/keyframes.js";
|
|
6
|
+
import { whileLive } from "../mixins/while-live.js";
|
|
7
|
+
import { toastAction, toastClose, toastHold } from "./mixins/toast-queue.js";
|
|
8
|
+
import { toastStack } from "./mixins/toast-stack.js";
|
|
9
|
+
import { pageToaster, Toast } from "./toast.js";
|
|
10
|
+
/** Tone a {@link Toast.Message} takes when it names none. */
|
|
11
|
+
const DEFAULT_COLOR = "neutral";
|
|
12
|
+
/**
|
|
13
|
+
* The app's one toast stack. A flash toast shows and closes without JavaScript;
|
|
14
|
+
* hydration adopts the same element and only then starts its timer. Reach for a
|
|
15
|
+
* toast last, after an inline message or a banner.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Toasts labels={{ region: t("toasts.region"), dismiss: t("toasts.dismiss") }} initial={flash ? [flash] : []} />
|
|
19
|
+
*/
|
|
20
|
+
export const Toasts = clientEntry("@sdxc/ui/app/toasts#Toasts", function Toasts(handle) {
|
|
21
|
+
let toaster = pageToaster(handle.props.queue);
|
|
22
|
+
let adopted = false;
|
|
23
|
+
let seen = new Set();
|
|
24
|
+
whileLive(handle, (queue, signal) => {
|
|
25
|
+
queue.addEventListener("change", () => void handle.update(), { signal });
|
|
26
|
+
})(toaster);
|
|
27
|
+
/**
|
|
28
|
+
* Queues every flash not seen before, so one a later render brings (a page the client
|
|
29
|
+
* runtime fetched after a form post) shows too, and a dismissed one never comes back.
|
|
30
|
+
*/
|
|
31
|
+
function adopt() {
|
|
32
|
+
for (let flash of handle.props.initial ?? []) {
|
|
33
|
+
if (seen.has(flash.id))
|
|
34
|
+
continue;
|
|
35
|
+
seen.add(flash.id);
|
|
36
|
+
if (toaster.get(flash.id))
|
|
37
|
+
continue;
|
|
38
|
+
toaster.add(flash, { id: flash.id, duration: flash.duration });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handle.queueTask(() => {
|
|
42
|
+
adopt();
|
|
43
|
+
adopted = true;
|
|
44
|
+
void handle.update();
|
|
45
|
+
});
|
|
46
|
+
return () => {
|
|
47
|
+
let { labels, initial = [], placement, max, stack } = handle.props;
|
|
48
|
+
if (adopted && initial.some((flash) => !seen.has(flash.id)))
|
|
49
|
+
handle.queueTask(adopt);
|
|
50
|
+
let items = adopted
|
|
51
|
+
? toaster.toasts.map((toast) => ({ id: toast.id, message: toast.data }))
|
|
52
|
+
: initial.map((flash) => ({ id: flash.id, message: flash }));
|
|
53
|
+
return (_jsx(Toast.Region, { "aria-label": labels.region, placement: placement, max: max, stack: stack, mix: [toastHold(toaster), toastStack()], children: items.map((item) => (_jsx(ToastItem, { id: item.id, message: item.message, labels: labels, toaster: toaster }, item.id))) }));
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Draws one queued {@link Toast.Message} inside an open, non-modal `<dialog>`,
|
|
58
|
+
* whose close button uses the native `close` command, so a server-rendered
|
|
59
|
+
* toast closes without JavaScript and the queue hears the same `close` event.
|
|
60
|
+
*
|
|
61
|
+
* @param handle Runtime handle carrying {@link Toasts.ItemProps}.
|
|
62
|
+
* @returns The render function producing the toast's markup.
|
|
63
|
+
*/
|
|
64
|
+
function ToastItem(handle) {
|
|
65
|
+
return () => {
|
|
66
|
+
let { id, message, labels, toaster } = handle.props;
|
|
67
|
+
let domId = `toast-${id}`;
|
|
68
|
+
let color = message.color ?? DEFAULT_COLOR;
|
|
69
|
+
let action = message.action;
|
|
70
|
+
return (_jsx("dialog", { open: true, id: domId, "aria-labelledby": `${domId}-title`, "data-slot": "toast-item", mix: [
|
|
71
|
+
toastClose(toaster, id),
|
|
72
|
+
raw({
|
|
73
|
+
position: "relative",
|
|
74
|
+
inset: "auto",
|
|
75
|
+
inlineSize: "100%",
|
|
76
|
+
margin: "0",
|
|
77
|
+
padding: "0",
|
|
78
|
+
border: "0",
|
|
79
|
+
background: "transparent",
|
|
80
|
+
color: "inherit",
|
|
81
|
+
}),
|
|
82
|
+
], children: _jsxs(Toast, { color: color, live: color === "danger" ? "assertive" : "polite", "aria-busy": message.loading ? "true" : undefined, children: [message.loading ? (_jsx(Toast.Loader, { mix: [spin()], children: _jsx(LoaderCircleIcon, { size: 16 }) })) : (_jsx(Toast.Icon, { children: _jsx(ToastColorIcon, { color: color }) })), _jsxs(Toast.Content, { children: [_jsx(Toast.Title, { id: `${domId}-title`, children: message.title }), message.description ? (_jsx(Toast.Description, { children: message.description })) : null] }), action?.form ? (_jsxs("form", { method: action.form.method ?? "post", action: action.form.action, mix: [raw({ display: "contents" })], children: [Object.entries(action.form.fields ?? {}).map(([name, value]) => (_jsx("input", { type: "hidden", name: name, value: value }, name))), _jsx(Toast.Action, { type: "submit", mix: [toastAction(toaster, id, action.onAction)], children: action.label })] })) : null, action && !action.form ? (_jsx(Toast.Action, { mix: [toastAction(toaster, id, action.onAction)], children: action.label })) : null, _jsx(Toast.Close, { "aria-label": labels.dismiss, commandfor: domId, command: "close" })] }) }));
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Picks the icon a tone carries, so a success, warning and failure read apart
|
|
87
|
+
* at a glance before the title is read.
|
|
88
|
+
*
|
|
89
|
+
* @param handle Runtime handle carrying the toast's tone.
|
|
90
|
+
* @returns The render function producing the icon.
|
|
91
|
+
*/
|
|
92
|
+
function ToastColorIcon(handle) {
|
|
93
|
+
return () => {
|
|
94
|
+
let { color } = handle.props;
|
|
95
|
+
if (color === "success")
|
|
96
|
+
return _jsx(CircleCheckIcon, { size: 16 });
|
|
97
|
+
if (color === "danger")
|
|
98
|
+
return _jsx(CircleAlertIcon, { size: 16 });
|
|
99
|
+
if (color === "warning")
|
|
100
|
+
return _jsx(TriangleAlertIcon, { size: 16 });
|
|
101
|
+
return _jsx(InfoIcon, { size: 16 });
|
|
102
|
+
};
|
|
103
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
2
2
|
import { bg, border } from "@sdxc/u/color";
|
|
3
3
|
import { rounded } from "@sdxc/u/effects";
|
|
4
|
+
import { mergeMix } from "@sdxc/u/general";
|
|
4
5
|
import { flexCol, hstack, items } from "@sdxc/u/layout";
|
|
5
6
|
import { pb, pi } from "@sdxc/u/size";
|
|
6
7
|
import { when } from "@sdxc/u/state";
|
|
@@ -39,7 +40,7 @@ const DEFAULT_ORIENTATION = "horizontal";
|
|
|
39
40
|
export function Toolbar(handle) {
|
|
40
41
|
return () => {
|
|
41
42
|
let { mix, ...rest } = handle.props;
|
|
42
|
-
return (_jsx("div", { ...rest, mix: [
|
|
43
|
+
return (_jsx("div", { ...rest, mix: mergeMix([
|
|
43
44
|
attrs({ role: DEFAULT_ROLE, "aria-orientation": DEFAULT_ORIENTATION }),
|
|
44
45
|
hstack({ gap: 2, align: "center" }),
|
|
45
46
|
rounded("lg"),
|
|
@@ -48,7 +49,6 @@ export function Toolbar(handle) {
|
|
|
48
49
|
pb(2),
|
|
49
50
|
pi(2),
|
|
50
51
|
when('&[aria-orientation="vertical"]', [flexCol(), items("start")]),
|
|
51
|
-
|
|
52
|
-
] }));
|
|
52
|
+
], mix) }));
|
|
53
53
|
};
|
|
54
54
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @copyright Sergio Xalambrí 2026
|
|
12
12
|
*/
|
|
13
13
|
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
14
|
-
import { SentinelRow } from "
|
|
14
|
+
import { SentinelRow } from "../components/sentinel-row.js";
|
|
15
15
|
/**
|
|
16
16
|
* Prop and context types for {@link Tree} and its compound parts.
|
|
17
17
|
*/
|