@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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: a form cannot tell when its values differ from how it loaded, so script shows
|
|
3
|
+
* the save bar while it does, binds ⌘S/Ctrl+S to submitting it, and guards leaving the page.
|
|
4
|
+
* No-JS baseline: the bar stays hidden and the form submits through its own Save button.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { MixinFactory } from "remix/component";
|
|
10
|
+
/** Types for {@link saveBarSync}. */
|
|
11
|
+
export declare namespace SaveBarSync {
|
|
12
|
+
/** Configuration for {@link saveBarSync}. */
|
|
13
|
+
interface Options {
|
|
14
|
+
/** The `id` of the watched form; omit when the bar sits inside it. */
|
|
15
|
+
form?: string;
|
|
16
|
+
/** What the bar's live region announces once the form changes, such as "Unsaved changes". */
|
|
17
|
+
message: string;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Applied to the bar (`[data-slot="save-bar"]`): unhides it while the form's values differ
|
|
22
|
+
* from their baseline, which a submission moves to the submitted values, and ⌘S saves them
|
|
23
|
+
* unless the form's own primary save answers it. `[role="status"]` announces `message`.
|
|
24
|
+
*
|
|
25
|
+
* @example <div hidden mix={[saveBarSync({ message: "Unsaved changes" })]}>…</div>
|
|
26
|
+
*/
|
|
27
|
+
export declare const saveBarSync: MixinFactory<HTMLElement, [options: SaveBarSync.Options]>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: a form cannot tell when its values differ from how it loaded, so script shows
|
|
3
|
+
* the save bar while it does, binds ⌘S/Ctrl+S to submitting it, and guards leaving the page.
|
|
4
|
+
* No-JS baseline: the bar stays hidden and the form submits through its own Save button.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import { createMixin } from "remix/component";
|
|
10
|
+
import { bindSaveShortcut } from "./save-shortcut.js";
|
|
11
|
+
/**
|
|
12
|
+
* Applied to the bar (`[data-slot="save-bar"]`): unhides it while the form's values differ
|
|
13
|
+
* from their baseline, which a submission moves to the submitted values, and ⌘S saves them
|
|
14
|
+
* unless the form's own primary save answers it. `[role="status"]` announces `message`.
|
|
15
|
+
*
|
|
16
|
+
* @example <div hidden mix={[saveBarSync({ message: "Unsaved changes" })]}>…</div>
|
|
17
|
+
*/
|
|
18
|
+
export const saveBarSync = createMixin((handle) => {
|
|
19
|
+
let options;
|
|
20
|
+
let controller;
|
|
21
|
+
handle.addEventListener("insert", (event) => {
|
|
22
|
+
controller?.abort();
|
|
23
|
+
controller = new AbortController();
|
|
24
|
+
if (options)
|
|
25
|
+
connect(event.node, options, controller.signal);
|
|
26
|
+
});
|
|
27
|
+
handle.addEventListener("remove", () => {
|
|
28
|
+
controller?.abort();
|
|
29
|
+
controller = undefined;
|
|
30
|
+
});
|
|
31
|
+
return (next) => {
|
|
32
|
+
options = next;
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Reads a form's current values as one string, so two moments compare in one step. A
|
|
37
|
+
* file contributes its name and size, which is what changes when another is picked.
|
|
38
|
+
*
|
|
39
|
+
* @param form The form to read.
|
|
40
|
+
* @returns The form's entries, serialized in document order.
|
|
41
|
+
*/
|
|
42
|
+
function snapshot(form) {
|
|
43
|
+
let entries = [];
|
|
44
|
+
for (let [name, value] of new FormData(form)) {
|
|
45
|
+
entries.push([name, typeof value === "string" ? value : `${value.name}:${value.size}`]);
|
|
46
|
+
}
|
|
47
|
+
return JSON.stringify(entries);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Asks before the page unloads; attached only while the form has unsaved changes.
|
|
51
|
+
*
|
|
52
|
+
* @param event The unload the browser is about to perform.
|
|
53
|
+
*/
|
|
54
|
+
function guard(event) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Connects `bar` to its form until `signal` aborts.
|
|
59
|
+
*
|
|
60
|
+
* @param bar The save bar.
|
|
61
|
+
* @param options The form and the message to announce.
|
|
62
|
+
* @param signal Ends every listener once the bar leaves the document.
|
|
63
|
+
*/
|
|
64
|
+
function connect(bar, options, signal) {
|
|
65
|
+
let doc = bar.ownerDocument;
|
|
66
|
+
let view = doc.defaultView;
|
|
67
|
+
let form = options.form
|
|
68
|
+
? doc.getElementById(options.form)
|
|
69
|
+
: bar.closest("form");
|
|
70
|
+
if (!form)
|
|
71
|
+
return;
|
|
72
|
+
let status = bar.querySelector('[role="status"]');
|
|
73
|
+
let baseline = snapshot(form);
|
|
74
|
+
let dirty = false;
|
|
75
|
+
/** Shows or hides the bar and the leave guard to match `next`. */
|
|
76
|
+
let show = (next) => {
|
|
77
|
+
if (next === dirty)
|
|
78
|
+
return;
|
|
79
|
+
dirty = next;
|
|
80
|
+
bar.hidden = !next;
|
|
81
|
+
if (status)
|
|
82
|
+
status.textContent = next ? options.message : "";
|
|
83
|
+
if (next)
|
|
84
|
+
view?.addEventListener("beforeunload", guard);
|
|
85
|
+
else
|
|
86
|
+
view?.removeEventListener("beforeunload", guard);
|
|
87
|
+
};
|
|
88
|
+
/** Compares the form with its baseline. */
|
|
89
|
+
let compare = () => show(snapshot(form) !== baseline);
|
|
90
|
+
form.addEventListener("input", compare, { signal });
|
|
91
|
+
form.addEventListener("change", compare, { signal });
|
|
92
|
+
form.addEventListener("reset", () => setTimeout(compare), { signal });
|
|
93
|
+
form.addEventListener("submit", () => {
|
|
94
|
+
baseline = snapshot(form);
|
|
95
|
+
show(false);
|
|
96
|
+
}, { signal });
|
|
97
|
+
bindSaveShortcut({
|
|
98
|
+
form,
|
|
99
|
+
fallback: true,
|
|
100
|
+
save: () => {
|
|
101
|
+
if (dirty)
|
|
102
|
+
form.requestSubmit();
|
|
103
|
+
},
|
|
104
|
+
}, signal);
|
|
105
|
+
signal.addEventListener("abort", () => view?.removeEventListener("beforeunload", guard));
|
|
106
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: a page has no key binding for submitting a form, so script binds ⌘S/Ctrl+S to the
|
|
3
|
+
* form a person is editing, in place of the browser's own save-page dialog.
|
|
4
|
+
* No-JS baseline: every form keeps its Save button, and ⌘S saves the page as the browser does.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { MixinFactory } from "remix/component";
|
|
10
|
+
/** The keys that save, as the shortcut registry spells them. */
|
|
11
|
+
export declare const SAVE_SHORTCUT = "mod+s";
|
|
12
|
+
/** Types for {@link saveShortcut} and {@link bindSaveShortcut}. */
|
|
13
|
+
export declare namespace SaveShortcuts {
|
|
14
|
+
/** Configuration for {@link saveShortcut}. */
|
|
15
|
+
interface Options {
|
|
16
|
+
/** The `id` of the form ⌘S submits; omit to submit the form the host sits in. */
|
|
17
|
+
form?: string;
|
|
18
|
+
}
|
|
19
|
+
/** One form's answer to ⌘S. */
|
|
20
|
+
interface Binding {
|
|
21
|
+
form: HTMLFormElement;
|
|
22
|
+
/** Saves the form once ⌘S chose it. */
|
|
23
|
+
save(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Yields to every other binding of the same form, so a save bar steps aside for the
|
|
26
|
+
* form's own primary save and one keystroke submits once.
|
|
27
|
+
*/
|
|
28
|
+
fallback?: boolean;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Applied to any element in or beside a form: ⌘S (Ctrl+S elsewhere) submits that form through
|
|
33
|
+
* `requestSubmit`, while typing included. With several bound forms on a page, the one holding
|
|
34
|
+
* focus saves; with focus outside them all, the only bound form saves.
|
|
35
|
+
*
|
|
36
|
+
* @example <span hidden mix={[saveShortcut({ form: "post-form" })]} />
|
|
37
|
+
*/
|
|
38
|
+
export declare const saveShortcut: MixinFactory<HTMLElement, [options?: SaveShortcuts.Options]>;
|
|
39
|
+
/**
|
|
40
|
+
* Binds ⌘S to `binding.form` until `signal` aborts, through the page's shortcut registry. Every
|
|
41
|
+
* binding on the page agrees on one form per keystroke, so exactly one saves; a keystroke that
|
|
42
|
+
* chooses none is still held back from the browser's save-page dialog.
|
|
43
|
+
*
|
|
44
|
+
* @param binding The form and how it saves.
|
|
45
|
+
* @param signal Removes the binding.
|
|
46
|
+
*/
|
|
47
|
+
export declare function bindSaveShortcut(binding: SaveShortcuts.Binding, signal: AbortSignal): void;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: a page has no key binding for submitting a form, so script binds ⌘S/Ctrl+S to the
|
|
3
|
+
* form a person is editing, in place of the browser's own save-page dialog.
|
|
4
|
+
* No-JS baseline: every form keeps its Save button, and ⌘S saves the page as the browser does.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import { createMixin } from "remix/component";
|
|
10
|
+
import { shortcutRegistry } from "../behaviors/shortcuts.js";
|
|
11
|
+
/** The keys that save, as the shortcut registry spells them. */
|
|
12
|
+
export const SAVE_SHORTCUT = "mod+s";
|
|
13
|
+
/** Every form bound to ⌘S on each document, for choosing the one a keystroke saves. */
|
|
14
|
+
const BINDINGS = new WeakMap();
|
|
15
|
+
/**
|
|
16
|
+
* Applied to any element in or beside a form: ⌘S (Ctrl+S elsewhere) submits that form through
|
|
17
|
+
* `requestSubmit`, while typing included. With several bound forms on a page, the one holding
|
|
18
|
+
* focus saves; with focus outside them all, the only bound form saves.
|
|
19
|
+
*
|
|
20
|
+
* @example <span hidden mix={[saveShortcut({ form: "post-form" })]} />
|
|
21
|
+
*/
|
|
22
|
+
export const saveShortcut = createMixin((handle) => {
|
|
23
|
+
let options;
|
|
24
|
+
let controller;
|
|
25
|
+
handle.addEventListener("insert", (event) => {
|
|
26
|
+
controller?.abort();
|
|
27
|
+
controller = new AbortController();
|
|
28
|
+
let node = event.node;
|
|
29
|
+
let form = options?.form
|
|
30
|
+
? node.ownerDocument.getElementById(options.form)
|
|
31
|
+
: node.closest("form");
|
|
32
|
+
if (!(form instanceof HTMLFormElement))
|
|
33
|
+
return;
|
|
34
|
+
bindSaveShortcut({ form, save: () => form.requestSubmit() }, controller.signal);
|
|
35
|
+
});
|
|
36
|
+
handle.addEventListener("remove", () => {
|
|
37
|
+
controller?.abort();
|
|
38
|
+
controller = undefined;
|
|
39
|
+
});
|
|
40
|
+
return (next) => {
|
|
41
|
+
options = next;
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Binds ⌘S to `binding.form` until `signal` aborts, through the page's shortcut registry. Every
|
|
46
|
+
* binding on the page agrees on one form per keystroke, so exactly one saves; a keystroke that
|
|
47
|
+
* chooses none is still held back from the browser's save-page dialog.
|
|
48
|
+
*
|
|
49
|
+
* @param binding The form and how it saves.
|
|
50
|
+
* @param signal Removes the binding.
|
|
51
|
+
*/
|
|
52
|
+
export function bindSaveShortcut(binding, signal) {
|
|
53
|
+
let doc = binding.form.ownerDocument;
|
|
54
|
+
let bindings = BINDINGS.get(doc) ?? new Set();
|
|
55
|
+
BINDINGS.set(doc, bindings);
|
|
56
|
+
bindings.add(binding);
|
|
57
|
+
signal.addEventListener("abort", () => bindings.delete(binding), { once: true });
|
|
58
|
+
shortcutRegistry(doc).register({
|
|
59
|
+
keys: SAVE_SHORTCUT,
|
|
60
|
+
whileTyping: true,
|
|
61
|
+
scope: binding.form,
|
|
62
|
+
signal,
|
|
63
|
+
run: () => {
|
|
64
|
+
let chosen = chosenForm(doc, bindings);
|
|
65
|
+
if (chosen === null)
|
|
66
|
+
return true;
|
|
67
|
+
if (chosen !== binding.form)
|
|
68
|
+
return false;
|
|
69
|
+
if (binding.fallback && hasPrimary(bindings, binding.form))
|
|
70
|
+
return false;
|
|
71
|
+
binding.save();
|
|
72
|
+
return true;
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The form a ⌘S saves: the bound form holding focus, or with focus in no form, the only bound
|
|
78
|
+
* form on the page. Focus in a form nothing bound chooses none.
|
|
79
|
+
*/
|
|
80
|
+
function chosenForm(doc, bindings) {
|
|
81
|
+
let forms = [
|
|
82
|
+
...new Set([...bindings].map((binding) => binding.form).filter((form) => form.isConnected)),
|
|
83
|
+
];
|
|
84
|
+
let focused = formOf(doc.activeElement);
|
|
85
|
+
if (focused !== null)
|
|
86
|
+
return forms.includes(focused) ? focused : null;
|
|
87
|
+
return forms.length === 1 ? forms[0] : null;
|
|
88
|
+
}
|
|
89
|
+
/** The form `element` submits with: its `form` owner, or the form it sits in. */
|
|
90
|
+
function formOf(element) {
|
|
91
|
+
if (element === null)
|
|
92
|
+
return null;
|
|
93
|
+
let owner = element.form;
|
|
94
|
+
if (owner instanceof HTMLFormElement)
|
|
95
|
+
return owner;
|
|
96
|
+
return element.closest("form");
|
|
97
|
+
}
|
|
98
|
+
/** Whether `form` has a binding that saves it outright, which a fallback binding yields to. */
|
|
99
|
+
function hasPrimary(bindings, form) {
|
|
100
|
+
return [...bindings].some((binding) => binding.form === form && !binding.fallback);
|
|
101
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: an autosave's progress and the age of the last edit change after the page has
|
|
3
|
+
* rendered, so script moves a save status through Saving…, Saved and the edit time.
|
|
4
|
+
* No-JS baseline: the status shows the state the server rendered, and Retry submits its form.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { MixinFactory } from "remix/component";
|
|
10
|
+
/** Event an app dispatches on a save status, through {@link setSaveStatus}, to report a save. */
|
|
11
|
+
declare const SAVE_STATUS_EVENT: "ui:save-status";
|
|
12
|
+
/** Event a save status dispatches, bubbling, when Retry is pressed. */
|
|
13
|
+
declare const SAVE_STATUS_RETRY_EVENT: "ui:save-status-retry";
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementEventMap {
|
|
16
|
+
[SAVE_STATUS_EVENT]: SaveStatusEvent;
|
|
17
|
+
[SAVE_STATUS_RETRY_EVENT]: SaveStatusRetryEvent;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** Types for {@link saveStatusSync}. */
|
|
21
|
+
export declare namespace SaveStatusSync {
|
|
22
|
+
/** Where a save stands; `"idle"` shows the last edit time, or nothing without one. */
|
|
23
|
+
type State = "idle" | "saving" | "saved" | "failed";
|
|
24
|
+
/** Configuration for {@link saveStatusSync}. */
|
|
25
|
+
interface Options {
|
|
26
|
+
/** The state the server rendered. */
|
|
27
|
+
state: State;
|
|
28
|
+
/** When the content was last edited, as an ISO string. */
|
|
29
|
+
editedAt?: string;
|
|
30
|
+
labels: {
|
|
31
|
+
saving: string;
|
|
32
|
+
saved: string;
|
|
33
|
+
failed: string;
|
|
34
|
+
edited: string;
|
|
35
|
+
};
|
|
36
|
+
locale?: string;
|
|
37
|
+
holdMs: number;
|
|
38
|
+
savedMs: number;
|
|
39
|
+
decayMs: number;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** Reports a save to a save status: dispatched on it by {@link setSaveStatus}. */
|
|
43
|
+
export declare class SaveStatusEvent extends Event {
|
|
44
|
+
readonly state: SaveStatusSync.State;
|
|
45
|
+
/** When the content was saved; the moment the event arrives when omitted. */
|
|
46
|
+
readonly at: Date | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* @param state Where the save stands.
|
|
49
|
+
* @param at When the content was saved.
|
|
50
|
+
*/
|
|
51
|
+
constructor(state: SaveStatusSync.State, at?: Date);
|
|
52
|
+
}
|
|
53
|
+
/** Dispatched, bubbling, from a save status when its Retry is pressed, for an autosave to try again. */
|
|
54
|
+
export declare class SaveStatusRetryEvent extends Event {
|
|
55
|
+
constructor();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Reports a save to a save status, which is how an autosave drives it.
|
|
59
|
+
*
|
|
60
|
+
* @param target The status element or its `id`.
|
|
61
|
+
* @param state Where the save stands.
|
|
62
|
+
* @param at When the content was saved.
|
|
63
|
+
* @example
|
|
64
|
+
* setSaveStatus("post-status", "saving");
|
|
65
|
+
* let response = await fetch(url, { method: "POST", body });
|
|
66
|
+
* setSaveStatus("post-status", response.ok ? "saved" : "failed");
|
|
67
|
+
*/
|
|
68
|
+
export declare function setSaveStatus(target: Element | string, state: SaveStatusSync.State, at?: Date): void;
|
|
69
|
+
/**
|
|
70
|
+
* Applied to a save status (`[data-slot="save-status"]`): "Saving…" holds for `holdMs`
|
|
71
|
+
* however fast the save, "Saved" shows for `savedMs`, then the edit time shows and keeps
|
|
72
|
+
* its age current. It writes `data-state` and the texts of its `save-status-*` parts.
|
|
73
|
+
*
|
|
74
|
+
* @example <span data-slot="save-status" mix={[saveStatusSync({ state: "idle", labels, holdMs: 1000, savedMs: 3000, decayMs: 86_400_000 })]}>…</span>
|
|
75
|
+
*/
|
|
76
|
+
export declare const saveStatusSync: MixinFactory<HTMLElement, [options: SaveStatusSync.Options]>;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: an autosave's progress and the age of the last edit change after the page has
|
|
3
|
+
* rendered, so script moves a save status through Saving…, Saved and the edit time.
|
|
4
|
+
* No-JS baseline: the status shows the state the server rendered, and Retry submits its form.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import { createMixin } from "remix/component";
|
|
10
|
+
import { formatEditedTime } from "../utils/edited-time.js";
|
|
11
|
+
/** Event an app dispatches on a save status, through {@link setSaveStatus}, to report a save. */
|
|
12
|
+
const SAVE_STATUS_EVENT = "ui:save-status";
|
|
13
|
+
/** Event a save status dispatches, bubbling, when Retry is pressed. */
|
|
14
|
+
const SAVE_STATUS_RETRY_EVENT = "ui:save-status-retry";
|
|
15
|
+
/** How often the relative edit time redraws. */
|
|
16
|
+
const TICK_MS = 30_000;
|
|
17
|
+
/** Reports a save to a save status: dispatched on it by {@link setSaveStatus}. */
|
|
18
|
+
export class SaveStatusEvent extends Event {
|
|
19
|
+
state;
|
|
20
|
+
/** When the content was saved; the moment the event arrives when omitted. */
|
|
21
|
+
at;
|
|
22
|
+
/**
|
|
23
|
+
* @param state Where the save stands.
|
|
24
|
+
* @param at When the content was saved.
|
|
25
|
+
*/
|
|
26
|
+
constructor(state, at) {
|
|
27
|
+
super(SAVE_STATUS_EVENT);
|
|
28
|
+
this.state = state;
|
|
29
|
+
this.at = at;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Dispatched, bubbling, from a save status when its Retry is pressed, for an autosave to try again. */
|
|
33
|
+
export class SaveStatusRetryEvent extends Event {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(SAVE_STATUS_RETRY_EVENT, { bubbles: true });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Reports a save to a save status, which is how an autosave drives it.
|
|
40
|
+
*
|
|
41
|
+
* @param target The status element or its `id`.
|
|
42
|
+
* @param state Where the save stands.
|
|
43
|
+
* @param at When the content was saved.
|
|
44
|
+
* @example
|
|
45
|
+
* setSaveStatus("post-status", "saving");
|
|
46
|
+
* let response = await fetch(url, { method: "POST", body });
|
|
47
|
+
* setSaveStatus("post-status", response.ok ? "saved" : "failed");
|
|
48
|
+
*/
|
|
49
|
+
export function setSaveStatus(target, state, at) {
|
|
50
|
+
let element = typeof target === "string" ? document.getElementById(target) : target;
|
|
51
|
+
element?.dispatchEvent(new SaveStatusEvent(state, at));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Applied to a save status (`[data-slot="save-status"]`): "Saving…" holds for `holdMs`
|
|
55
|
+
* however fast the save, "Saved" shows for `savedMs`, then the edit time shows and keeps
|
|
56
|
+
* its age current. It writes `data-state` and the texts of its `save-status-*` parts.
|
|
57
|
+
*
|
|
58
|
+
* @example <span data-slot="save-status" mix={[saveStatusSync({ state: "idle", labels, holdMs: 1000, savedMs: 3000, decayMs: 86_400_000 })]}>…</span>
|
|
59
|
+
*/
|
|
60
|
+
export const saveStatusSync = createMixin((handle) => {
|
|
61
|
+
let options;
|
|
62
|
+
let controller;
|
|
63
|
+
handle.addEventListener("insert", (event) => {
|
|
64
|
+
controller?.abort();
|
|
65
|
+
controller = new AbortController();
|
|
66
|
+
if (options)
|
|
67
|
+
connect(event.node, () => options, controller.signal);
|
|
68
|
+
});
|
|
69
|
+
handle.addEventListener("remove", () => {
|
|
70
|
+
controller?.abort();
|
|
71
|
+
controller = undefined;
|
|
72
|
+
});
|
|
73
|
+
return (next) => {
|
|
74
|
+
options = next;
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Runs `root`'s state machine until `signal` aborts.
|
|
79
|
+
*
|
|
80
|
+
* @param root The status element.
|
|
81
|
+
* @param read Reads the latest options.
|
|
82
|
+
* @param signal Ends every timer and listener once the status leaves the document.
|
|
83
|
+
*/
|
|
84
|
+
function connect(root, read, signal) {
|
|
85
|
+
let text = root.querySelector('[data-slot="save-status-text"]');
|
|
86
|
+
let edited = root.querySelector('[data-slot="save-status-edited"]');
|
|
87
|
+
let retry = root.querySelector('[data-slot="save-status-retry"]');
|
|
88
|
+
let initial = read();
|
|
89
|
+
let shown = initial.state;
|
|
90
|
+
let editedAt = initial.editedAt ? new Date(initial.editedAt) : null;
|
|
91
|
+
let savingSince = shown === "saving" ? Date.now() : 0;
|
|
92
|
+
let pending;
|
|
93
|
+
/** Writes `shown` and the edit time into the element's parts. */
|
|
94
|
+
let draw = () => {
|
|
95
|
+
let { labels, locale, decayMs } = read();
|
|
96
|
+
root.dataset.state = shown;
|
|
97
|
+
if (text)
|
|
98
|
+
text.textContent = shown === "idle" ? "" : labels[shown];
|
|
99
|
+
if (retry)
|
|
100
|
+
retry.hidden = shown !== "failed";
|
|
101
|
+
if (!edited)
|
|
102
|
+
return;
|
|
103
|
+
edited.hidden = shown !== "idle" || editedAt === null;
|
|
104
|
+
if (!editedAt)
|
|
105
|
+
return;
|
|
106
|
+
edited.dateTime = editedAt.toISOString();
|
|
107
|
+
edited.title = editedAt.toLocaleString(locale);
|
|
108
|
+
edited.textContent = labels.edited.replace("{time}", formatEditedTime(editedAt, new Date(), decayMs, locale));
|
|
109
|
+
};
|
|
110
|
+
/** Shows `next` now. */
|
|
111
|
+
let show = (next) => {
|
|
112
|
+
shown = next;
|
|
113
|
+
draw();
|
|
114
|
+
};
|
|
115
|
+
/** Shows "Saved", then decays to the edit time. */
|
|
116
|
+
let settleSaved = (at) => {
|
|
117
|
+
editedAt = at;
|
|
118
|
+
show("saved");
|
|
119
|
+
pending = setTimeout(() => show("idle"), read().savedMs);
|
|
120
|
+
};
|
|
121
|
+
root.addEventListener(SAVE_STATUS_EVENT, (event) => {
|
|
122
|
+
clearTimeout(pending);
|
|
123
|
+
if (event.state === "saving") {
|
|
124
|
+
if (shown !== "saving")
|
|
125
|
+
savingSince = Date.now();
|
|
126
|
+
show("saving");
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
let held = shown === "saving" ? Date.now() - savingSince : Infinity;
|
|
130
|
+
let wait = Math.max(0, read().holdMs - held);
|
|
131
|
+
let settle = () => {
|
|
132
|
+
if (event.state === "saved")
|
|
133
|
+
return settleSaved(event.at ?? new Date());
|
|
134
|
+
if (event.at)
|
|
135
|
+
editedAt = event.at;
|
|
136
|
+
show(event.state);
|
|
137
|
+
};
|
|
138
|
+
if (wait > 0)
|
|
139
|
+
pending = setTimeout(settle, wait);
|
|
140
|
+
else
|
|
141
|
+
settle();
|
|
142
|
+
}, { signal });
|
|
143
|
+
retry
|
|
144
|
+
?.querySelector("button")
|
|
145
|
+
?.addEventListener("click", () => root.dispatchEvent(new SaveStatusRetryEvent()), {
|
|
146
|
+
signal,
|
|
147
|
+
});
|
|
148
|
+
let tick = setInterval(() => {
|
|
149
|
+
if (shown === "idle")
|
|
150
|
+
draw();
|
|
151
|
+
}, TICK_MS);
|
|
152
|
+
if (shown === "saved")
|
|
153
|
+
pending = setTimeout(() => show("idle"), initial.savedMs);
|
|
154
|
+
signal.addEventListener("abort", () => {
|
|
155
|
+
clearInterval(tick);
|
|
156
|
+
clearTimeout(pending);
|
|
157
|
+
});
|
|
158
|
+
draw();
|
|
159
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: counting checked rows elsewhere on the page, announcing the count and the Escape and
|
|
3
|
+
* action keys need script. No-JS baseline: the bar shows pagination and its page links; rows
|
|
4
|
+
* stay checkable and their form submits as usual.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { MixinFactory } from "remix/component";
|
|
10
|
+
/** Types for {@link selectionBarSync}. */
|
|
11
|
+
export declare namespace SelectionBarSync {
|
|
12
|
+
/** Configuration for {@link selectionBarSync}. */
|
|
13
|
+
interface Options {
|
|
14
|
+
/** The `id` of the region holding the rows' checkboxes. */
|
|
15
|
+
target: string;
|
|
16
|
+
/** The visible and announced count, with `{count}` replaced, such as "{count} selected". */
|
|
17
|
+
selected: string;
|
|
18
|
+
/** What is announced once the selection empties, such as "Selection cleared". */
|
|
19
|
+
cleared: string;
|
|
20
|
+
/** Locale for the count. Defaults to the runtime's. */
|
|
21
|
+
locale?: string;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Wires the bar around its host (`[data-slot="selection-bar"]`) to the target region; the
|
|
26
|
+
* host itself is the polite live region. The bar shows `data-state="selecting"` while any
|
|
27
|
+
* row is checked, its hidden layer is `inert`, and the count stays on the last non-zero value
|
|
28
|
+
* so the bar fades out still naming what was selected.
|
|
29
|
+
*
|
|
30
|
+
* @example <span role="status" mix={[selectionBarSync({ target: "monitors", selected: "{count} selected", cleared: "Selection cleared" })]} />
|
|
31
|
+
*/
|
|
32
|
+
export declare const selectionBarSync: MixinFactory<HTMLElement, [options: SelectionBarSync.Options]>;
|