@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,542 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "remix/component/jsx-runtime";
|
|
2
|
+
import { ChevronLeftIcon, ChevronsUpDownIcon, MenuIcon, XIcon } from "@sdxc/icons";
|
|
3
|
+
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
4
|
+
import { bg, fg, outline } from "@sdxc/u/color";
|
|
5
|
+
import { rounded } from "@sdxc/u/effects";
|
|
6
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
7
|
+
import { hidden } from "@sdxc/u/layout";
|
|
8
|
+
import { media, supports } from "@sdxc/u/responsive";
|
|
9
|
+
import { focusVisible, hover, when } from "@sdxc/u/state";
|
|
10
|
+
import { tabularNums, text, truncate, weight } from "@sdxc/u/typography";
|
|
11
|
+
import { Button } from "../components/button.js";
|
|
12
|
+
import { AppShellToggle } from "./app-shell-toggle.js";
|
|
13
|
+
import { appShellQueries } from "./mixins/app-shell-controls.js";
|
|
14
|
+
import { APP_SHELL_COOKIE } from "./utils/app-shell-cookie.js";
|
|
15
|
+
export { APP_SHELL_COOKIE, readAppShellCookie } from "./utils/app-shell-cookie.js";
|
|
16
|
+
/**
|
|
17
|
+
* Width from which the rail styles of groups and rows apply: the narrowest a shell docks at.
|
|
18
|
+
* A wider `sheetBelow` keeps them off its sheet, which the rail rules exclude as a popover.
|
|
19
|
+
*/
|
|
20
|
+
const DOCKED = "(min-width: 48rem)";
|
|
21
|
+
/** Where the sidebar becomes a sheet when `sheetBelow` is omitted. */
|
|
22
|
+
const DEFAULT_SHEET_BELOW = "48rem";
|
|
23
|
+
/** The shell while its collapse checkbox is checked, which is the server-rendered preference. */
|
|
24
|
+
const COLLAPSED = '[data-slot="app-shell"]:has([data-app-shell-collapse]:checked)';
|
|
25
|
+
/** The shell while its collapse checkbox is unchecked. */
|
|
26
|
+
const EXPANDED = '[data-slot="app-shell"]:not(:has([data-app-shell-collapse]:checked))';
|
|
27
|
+
/**
|
|
28
|
+
* The collapsed sidebar's state while it stays a rail: always without peek, and otherwise until
|
|
29
|
+
* a pointer rests on it or keyboard focus enters it.
|
|
30
|
+
*/
|
|
31
|
+
const RAIL_STATE = ':is([data-peek="false"], :not(:hover):not(:has(:focus-visible)))';
|
|
32
|
+
/** The collapsed sidebar's state while a resting pointer or keyboard focus opens it over the content. */
|
|
33
|
+
const PEEK_STATE = '[data-peek="true"]:is(:hover, :has(:focus-visible))';
|
|
34
|
+
/** The collapsed sidebar while it stays a rail, for rules on the parts inside it. */
|
|
35
|
+
const RAIL_SIDEBAR = `${COLLAPSED} [data-slot="app-shell-sidebar"]:not(:popover-open)${RAIL_STATE}`;
|
|
36
|
+
/** The sidebar's width as a column, and as an overlay while it peeks. */
|
|
37
|
+
const SIDEBAR_WIDTH = "var(--ui-app-sidebar-width, 16rem)";
|
|
38
|
+
/** The collapsed rail's width. */
|
|
39
|
+
const RAIL_WIDTH = "var(--ui-app-rail-width, 3.25rem)";
|
|
40
|
+
/** Whether the rail opens over the content on hover or focus when `peek` is omitted. */
|
|
41
|
+
const DEFAULT_PEEK = true;
|
|
42
|
+
/** How the current row is marked when `indicator` is omitted. */
|
|
43
|
+
const DEFAULT_INDICATOR = "fill";
|
|
44
|
+
/** Prefix for the sidebar's and main's ids when `id` is omitted. */
|
|
45
|
+
const DEFAULT_ID = "app-shell";
|
|
46
|
+
/** The tone of a row's count when `countTone` is omitted. */
|
|
47
|
+
const DEFAULT_COUNT_TONE = "neutral";
|
|
48
|
+
/** Motion for width and fade changes; reduced motion drops it. */
|
|
49
|
+
const EASE = "200ms cubic-bezier(0.2, 0, 0, 1)";
|
|
50
|
+
/**
|
|
51
|
+
* Renders the shell. The sidebar is one `<aside popover="auto">`: a grid column from `sheetBelow`,
|
|
52
|
+
* the icon rail while `collapsed`, and a sheet the top bar's menu button opens below it. Load
|
|
53
|
+
* `@sdxc/ui/app/app-shell-toggle` in the browser entry for the cookie, ⌘B and Esc-back.
|
|
54
|
+
*
|
|
55
|
+
* @param handle Runtime handle carrying the shell's props.
|
|
56
|
+
* @returns The render function producing the shell's markup.
|
|
57
|
+
* @example
|
|
58
|
+
* <AppShell labels={labels} collapsed={readAppShellCookie(request.headers.get("Cookie"))} workspace={<AppShell.Identity … />} nav={<AppShell.Group title="Monitoring"><AppShell.Item href="/monitors" icon={<ActivityIcon />} label="Monitors" current /></AppShell.Group>}>
|
|
59
|
+
* <PageHeader title="Monitors" />
|
|
60
|
+
* </AppShell>
|
|
61
|
+
*/
|
|
62
|
+
export function AppShell(handle) {
|
|
63
|
+
return () => {
|
|
64
|
+
let { labels, collapsed = false, workspace, nav, footer, topbar, banner, children, peek = DEFAULT_PEEK, indicator = DEFAULT_INDICATOR, id = DEFAULT_ID, cookieName = APP_SHELL_COOKIE, sheetBelow = DEFAULT_SHEET_BELOW, } = handle.props;
|
|
65
|
+
let { docked, sheet } = appShellQueries(sheetBelow);
|
|
66
|
+
let sidebarId = `${id}-sidebar`;
|
|
67
|
+
let mainId = `${id}-main`;
|
|
68
|
+
return (_jsxs("div", { "data-slot": "app-shell", "data-indicator": indicator, mix: [
|
|
69
|
+
raw({ display: "flex", flexDirection: "column", minBlockSize: "100dvh" }),
|
|
70
|
+
bg(),
|
|
71
|
+
media(docked, [
|
|
72
|
+
raw({ blockSize: "100dvh", minBlockSize: "0", overflow: "hidden" }),
|
|
73
|
+
bg("neutral.tint"),
|
|
74
|
+
]),
|
|
75
|
+
], children: [_jsx("a", { href: `#${mainId}`, "data-slot": "app-shell-skip", mix: [
|
|
76
|
+
when("&:not(:focus)", visuallyHidden()),
|
|
77
|
+
when("&:focus", [
|
|
78
|
+
raw({
|
|
79
|
+
position: "fixed",
|
|
80
|
+
insetBlockStart: "0.5rem",
|
|
81
|
+
insetInlineStart: "0.5rem",
|
|
82
|
+
zIndex: "10",
|
|
83
|
+
paddingBlock: "0.5rem",
|
|
84
|
+
paddingInline: "0.75rem",
|
|
85
|
+
boxShadow: "var(--ui-shadow-surface)",
|
|
86
|
+
}),
|
|
87
|
+
rounded("md"),
|
|
88
|
+
bg(),
|
|
89
|
+
fg("neutral.emphasis"),
|
|
90
|
+
text("sm"),
|
|
91
|
+
weight("medium"),
|
|
92
|
+
outline({ color: "brand.ring", offset: 2 }),
|
|
93
|
+
]),
|
|
94
|
+
], children: labels.skip }), banner ? _jsx("div", { "data-slot": "app-shell-banner", children: banner }) : null, _jsxs("div", { "data-slot": "app-shell-frame", mix: [
|
|
95
|
+
raw({ display: "flex", flexDirection: "column", flex: "1 0 auto" }),
|
|
96
|
+
media(docked, [
|
|
97
|
+
raw({
|
|
98
|
+
display: "grid",
|
|
99
|
+
flex: "1 1 0%",
|
|
100
|
+
minBlockSize: "0",
|
|
101
|
+
transition: `grid-template-columns ${EASE}`,
|
|
102
|
+
}),
|
|
103
|
+
when(`${EXPANDED} &`, raw({ gridTemplateColumns: `${SIDEBAR_WIDTH} minmax(0, 1fr)` })),
|
|
104
|
+
when(`${COLLAPSED} &`, raw({ gridTemplateColumns: `${RAIL_WIDTH} minmax(0, 1fr)` })),
|
|
105
|
+
]),
|
|
106
|
+
media("(prefers-reduced-motion: reduce)", raw({ transition: "none" })),
|
|
107
|
+
], children: [_jsxs("aside", { id: sidebarId, popover: "auto", "aria-label": labels.nav, "data-slot": "app-shell-sidebar", "data-peek": peek ? "true" : "false", mix: [
|
|
108
|
+
raw({ flexDirection: "column", boxSizing: "border-box", color: "inherit" }),
|
|
109
|
+
media(sheet, [
|
|
110
|
+
/**
|
|
111
|
+
* The sheet keeps its box while it slides out: only `display` and `translate`
|
|
112
|
+
* follow the open state, so closing is one slide at full width.
|
|
113
|
+
*/
|
|
114
|
+
raw({
|
|
115
|
+
position: "fixed",
|
|
116
|
+
insetBlock: "0",
|
|
117
|
+
insetInlineStart: "0",
|
|
118
|
+
insetInlineEnd: "auto",
|
|
119
|
+
margin: "0",
|
|
120
|
+
padding: "0 0 env(safe-area-inset-bottom, 0px)",
|
|
121
|
+
inlineSize: "min(var(--ui-app-sheet-width, 18rem), 85vw)",
|
|
122
|
+
blockSize: "100dvh",
|
|
123
|
+
maxBlockSize: "100dvh",
|
|
124
|
+
border: "0",
|
|
125
|
+
borderInlineEnd: "1px solid var(--ui-neutral-border)",
|
|
126
|
+
boxShadow: "var(--ui-shadow-surface)",
|
|
127
|
+
overflow: "hidden",
|
|
128
|
+
translate: "-100%",
|
|
129
|
+
transition: `translate 250ms cubic-bezier(0.2, 0, 0, 1), display 250ms allow-discrete, overlay 250ms allow-discrete`,
|
|
130
|
+
}),
|
|
131
|
+
bg("neutral.tint"),
|
|
132
|
+
when("&:popover-open", raw({ display: "flex", translate: "0" })),
|
|
133
|
+
when("@starting-style", when("&:popover-open", raw({ translate: "-100%" }))),
|
|
134
|
+
when("&::backdrop", raw({
|
|
135
|
+
backgroundColor: "color-mix(in oklab, var(--ui-neutral-fg-emphasis, CanvasText) 40%, transparent)",
|
|
136
|
+
})),
|
|
137
|
+
]),
|
|
138
|
+
media(docked, [
|
|
139
|
+
raw({
|
|
140
|
+
display: "flex",
|
|
141
|
+
position: "relative",
|
|
142
|
+
inset: "auto",
|
|
143
|
+
margin: "0",
|
|
144
|
+
padding: "0",
|
|
145
|
+
border: "0",
|
|
146
|
+
blockSize: "auto",
|
|
147
|
+
minBlockSize: "0",
|
|
148
|
+
overflow: "hidden",
|
|
149
|
+
zIndex: "2",
|
|
150
|
+
backgroundColor: "transparent",
|
|
151
|
+
transition: `inline-size ${EASE}, box-shadow ${EASE}, background-color ${EASE}`,
|
|
152
|
+
}),
|
|
153
|
+
when(`${EXPANDED} &`, raw({ inlineSize: SIDEBAR_WIDTH })),
|
|
154
|
+
when(`${COLLAPSED} &${RAIL_STATE}`, [raw({ inlineSize: RAIL_WIDTH })]),
|
|
155
|
+
when(`${COLLAPSED} &${PEEK_STATE}`, [
|
|
156
|
+
raw({
|
|
157
|
+
inlineSize: SIDEBAR_WIDTH,
|
|
158
|
+
backgroundColor: "var(--ui-neutral-bg-tint)",
|
|
159
|
+
boxShadow: "var(--ui-shadow-surface)",
|
|
160
|
+
transitionDelay: "150ms",
|
|
161
|
+
}),
|
|
162
|
+
]),
|
|
163
|
+
when("& [data-app-shell-label]", raw({ transition: `opacity ${EASE}`, whiteSpace: "nowrap" })),
|
|
164
|
+
when(`${COLLAPSED} &${RAIL_STATE} [data-app-shell-label]`, raw({ opacity: "0" })),
|
|
165
|
+
]),
|
|
166
|
+
media("(prefers-reduced-motion: reduce)", [
|
|
167
|
+
raw({ transition: "none", transitionDelay: "0s" }),
|
|
168
|
+
when("& [data-app-shell-label]", raw({ transition: "none" })),
|
|
169
|
+
]),
|
|
170
|
+
], children: [_jsxs("div", { "data-slot": "app-shell-sidebar-header", mix: [
|
|
171
|
+
raw({
|
|
172
|
+
display: "flex",
|
|
173
|
+
alignItems: "center",
|
|
174
|
+
gap: "0.25rem",
|
|
175
|
+
minBlockSize: "var(--ui-app-header-height, 3.5rem)",
|
|
176
|
+
paddingInline: "0.5rem",
|
|
177
|
+
paddingBlockStart: "env(safe-area-inset-top, 0px)",
|
|
178
|
+
boxSizing: "border-box",
|
|
179
|
+
flexShrink: "0",
|
|
180
|
+
}),
|
|
181
|
+
media(docked, raw({ marginBlockStart: "var(--ui-app-inset-gap, 0.5rem)" })),
|
|
182
|
+
], children: [_jsx("div", { mix: [raw({ flex: "1 1 0%", minInlineSize: "0" })], children: workspace }), _jsx("span", { "data-slot": "app-shell-close", mix: [
|
|
183
|
+
when('[data-slot="app-shell-sidebar"]:not(:popover-open) &', raw({ display: "none" })),
|
|
184
|
+
when('[data-slot="app-shell-sidebar"]:popover-open &', raw({ display: "inline-flex" })),
|
|
185
|
+
], children: _jsx(Button, { type: "button", variant: "ghost", color: "neutral", size: "sm", popovertarget: sidebarId, popovertargetaction: "hide", "aria-label": labels.close, children: _jsx(XIcon, { size: 16, "aria-hidden": "true" }) }) })] }), _jsx("nav", { "aria-label": labels.nav, "data-slot": "app-shell-nav", mix: [
|
|
186
|
+
raw({
|
|
187
|
+
display: "flex",
|
|
188
|
+
flexDirection: "column",
|
|
189
|
+
gap: "1rem",
|
|
190
|
+
flex: "1 1 auto",
|
|
191
|
+
minBlockSize: "0",
|
|
192
|
+
overflowX: "hidden",
|
|
193
|
+
overflowY: "auto",
|
|
194
|
+
overscrollBehavior: "contain",
|
|
195
|
+
scrollbarWidth: "thin",
|
|
196
|
+
padding: "0.5rem",
|
|
197
|
+
}),
|
|
198
|
+
], children: nav }), footer ? (_jsx("div", { "data-slot": "app-shell-sidebar-footer", mix: [
|
|
199
|
+
raw({
|
|
200
|
+
flexShrink: "0",
|
|
201
|
+
padding: "0.5rem",
|
|
202
|
+
paddingBlockEnd: "max(0.5rem, env(safe-area-inset-bottom, 0px))",
|
|
203
|
+
}),
|
|
204
|
+
], children: footer })) : null] }), _jsxs("div", { "data-slot": "app-shell-content", mix: [
|
|
205
|
+
raw({
|
|
206
|
+
minInlineSize: "0",
|
|
207
|
+
flex: "1 0 auto",
|
|
208
|
+
containerType: "inline-size",
|
|
209
|
+
containerName: "ui-app-content",
|
|
210
|
+
"--ui-app-sticky-top": "var(--ui-app-header-height, 3.5rem)",
|
|
211
|
+
}),
|
|
212
|
+
bg(),
|
|
213
|
+
media(docked, [
|
|
214
|
+
raw({
|
|
215
|
+
marginBlock: "var(--ui-app-inset-gap, 0.5rem)",
|
|
216
|
+
marginInlineEnd: "var(--ui-app-inset-gap, 0.5rem)",
|
|
217
|
+
borderRadius: "var(--ui-app-inset-radius, 0.75rem)",
|
|
218
|
+
border: "1px solid var(--ui-neutral-border)",
|
|
219
|
+
/**
|
|
220
|
+
* The border is the card's one edge; the shadow only lifts it off the frame,
|
|
221
|
+
* so it carries no ring of its own.
|
|
222
|
+
*/
|
|
223
|
+
boxShadow: "var(--ui-app-inset-shadow, 0 1px 3px rgb(0 0 0 / 0.04))",
|
|
224
|
+
overflowY: "auto",
|
|
225
|
+
overflowX: "hidden",
|
|
226
|
+
minBlockSize: "0",
|
|
227
|
+
scrollbarWidth: "thin",
|
|
228
|
+
position: "relative",
|
|
229
|
+
zIndex: "1",
|
|
230
|
+
}),
|
|
231
|
+
]),
|
|
232
|
+
], children: [_jsxs("header", { "data-slot": "app-shell-topbar", mix: [
|
|
233
|
+
raw({
|
|
234
|
+
position: "sticky",
|
|
235
|
+
insetBlockStart: "0",
|
|
236
|
+
zIndex: "3",
|
|
237
|
+
display: "flex",
|
|
238
|
+
alignItems: "center",
|
|
239
|
+
gap: "0.5rem",
|
|
240
|
+
blockSize: "var(--ui-app-header-height, 3.5rem)",
|
|
241
|
+
boxSizing: "border-box",
|
|
242
|
+
paddingInline: "0.75rem",
|
|
243
|
+
borderBlockEnd: "1px solid var(--ui-neutral-border)",
|
|
244
|
+
}),
|
|
245
|
+
bg(),
|
|
246
|
+
media(docked, raw({ paddingInline: "1rem" })),
|
|
247
|
+
], children: [_jsx("span", { "data-slot": "app-shell-menu", mix: [
|
|
248
|
+
media(sheet, raw({ display: "inline-flex" })),
|
|
249
|
+
media(docked, raw({ display: "none" })),
|
|
250
|
+
], children: _jsx(Button, { type: "button", variant: "ghost", color: "neutral", size: "sm", popovertarget: sidebarId, "aria-label": labels.menu, children: _jsx(MenuIcon, { size: 16, "aria-hidden": "true" }) }) }), _jsx(AppShellToggle, { collapsed: collapsed, label: labels.collapse, cookieName: cookieName, sidebarId: sidebarId, sheetBelow: sheetBelow }), _jsx("div", { "data-slot": "app-shell-topbar-content", mix: [
|
|
251
|
+
raw({
|
|
252
|
+
display: "flex",
|
|
253
|
+
alignItems: "center",
|
|
254
|
+
gap: "0.5rem",
|
|
255
|
+
flex: "1 1 auto",
|
|
256
|
+
minInlineSize: "0",
|
|
257
|
+
}),
|
|
258
|
+
], children: topbar })] }), _jsx("main", { id: mainId, tabIndex: -1, "data-slot": "app-shell-main", mix: [
|
|
259
|
+
raw({
|
|
260
|
+
"--ui-app-gutter": "var(--ui-app-content-padding, 1rem)",
|
|
261
|
+
display: "block",
|
|
262
|
+
minInlineSize: "0",
|
|
263
|
+
padding: "var(--ui-app-gutter)",
|
|
264
|
+
outline: "none",
|
|
265
|
+
}),
|
|
266
|
+
media(docked, raw({ "--ui-app-gutter": "var(--ui-app-content-padding, 1.5rem)" })),
|
|
267
|
+
], children: children })] })] })] }));
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Renders a titled group of rows. The title is a plain label, and in the rail it becomes a
|
|
272
|
+
* hairline so groups stay apart while every icon keeps its place.
|
|
273
|
+
*
|
|
274
|
+
* @param handle Runtime handle carrying the group's props.
|
|
275
|
+
* @returns The render function producing the group's markup.
|
|
276
|
+
* @example
|
|
277
|
+
* <AppShell.Group title="Settings"><AppShell.Item … /></AppShell.Group>
|
|
278
|
+
*/
|
|
279
|
+
AppShell.Group = function AppShellGroup(handle) {
|
|
280
|
+
return () => {
|
|
281
|
+
let { title, children, mix, ...rest } = handle.props;
|
|
282
|
+
let titleId = `${handle.id}-title`;
|
|
283
|
+
return (_jsxs("div", { ...rest, role: "group", "aria-labelledby": title ? titleId : undefined, "data-slot": "app-shell-group", mix: mergeMix([raw({ display: "flex", flexDirection: "column", gap: "0.125rem" })], mix), children: [title ? (_jsx("span", { id: titleId, "data-slot": "app-shell-group-title", mix: [
|
|
284
|
+
raw({
|
|
285
|
+
position: "relative",
|
|
286
|
+
display: "flex",
|
|
287
|
+
alignItems: "center",
|
|
288
|
+
blockSize: "1.75rem",
|
|
289
|
+
paddingInline: "0.625rem",
|
|
290
|
+
fontSize: "0.75rem",
|
|
291
|
+
whiteSpace: "nowrap",
|
|
292
|
+
}),
|
|
293
|
+
fg("neutral.muted"),
|
|
294
|
+
weight("medium"),
|
|
295
|
+
media(DOCKED, [
|
|
296
|
+
raw({ transition: `color ${EASE}` }),
|
|
297
|
+
when(`${RAIL_SIDEBAR} &`, raw({ color: "transparent" })),
|
|
298
|
+
when("&::after", raw({
|
|
299
|
+
content: '""',
|
|
300
|
+
position: "absolute",
|
|
301
|
+
insetInline: "0.625rem",
|
|
302
|
+
insetBlockStart: "50%",
|
|
303
|
+
borderBlockStart: "1px solid var(--ui-neutral-border)",
|
|
304
|
+
opacity: "0",
|
|
305
|
+
transition: `opacity ${EASE}`,
|
|
306
|
+
})),
|
|
307
|
+
when(`${RAIL_SIDEBAR} &::after`, raw({ opacity: "1" })),
|
|
308
|
+
]),
|
|
309
|
+
], children: title })) : null, _jsx("ul", { mix: [
|
|
310
|
+
raw({
|
|
311
|
+
listStyle: "none",
|
|
312
|
+
margin: "0",
|
|
313
|
+
padding: "0",
|
|
314
|
+
display: "flex",
|
|
315
|
+
flexDirection: "column",
|
|
316
|
+
gap: "0.125rem",
|
|
317
|
+
}),
|
|
318
|
+
], children: children })] }));
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Renders one row: a 16px icon at reduced ink, the label, and an optional count pill. The
|
|
323
|
+
* current page carries `aria-current="page"`; `active` marks a parent on its child routes. In the
|
|
324
|
+
* rail the label fades out, the count becomes a dot on the icon and, without peek, a tooltip names it.
|
|
325
|
+
*
|
|
326
|
+
* @param handle Runtime handle carrying the row's props.
|
|
327
|
+
* @returns The render function producing the row's markup.
|
|
328
|
+
* @example
|
|
329
|
+
* <AppShell.Item href="/monitors" icon={<ActivityIcon />} label="Monitors" count={2} countTone="danger" countLabel="2 down" active />
|
|
330
|
+
*/
|
|
331
|
+
AppShell.Item = function AppShellItem(handle) {
|
|
332
|
+
return () => {
|
|
333
|
+
let { href, icon, label, count, countLabel, countTone = DEFAULT_COUNT_TONE, unread = false, current = false, active = false, children: _children, mix, ...rest } = handle.props;
|
|
334
|
+
let marked = current || active;
|
|
335
|
+
let hasCount = count !== undefined && count > 0;
|
|
336
|
+
return (_jsx("li", { "data-slot": "app-shell-item", mix: [raw({ display: "block" })], children: _jsxs("a", { ...rest, href: href, "aria-current": current ? "page" : rest["aria-current"], "data-current": marked ? "" : undefined, "data-unread": unread ? "" : undefined, mix: mergeMix([navRow(), raw({ anchorName: "--ui-app-nav-row", anchorScope: "--ui-app-nav-row" })], mix), children: [icon ? (_jsx("span", { "data-slot": "app-shell-icon", "aria-hidden": "true", mix: [navIcon()], children: icon })) : null, _jsx("span", { "data-app-shell-label": true, mix: [truncate(), raw({ flex: "1 1 auto", minInlineSize: "0" })], children: label }), hasCount ? (_jsx("span", { "data-slot": "app-shell-count", "data-tone": countTone, mix: [
|
|
337
|
+
raw({
|
|
338
|
+
flexShrink: "0",
|
|
339
|
+
minInlineSize: "1.25rem",
|
|
340
|
+
paddingInline: "0.375rem",
|
|
341
|
+
borderRadius: "0.3125rem",
|
|
342
|
+
fontSize: "0.75rem",
|
|
343
|
+
lineHeight: "1.25rem",
|
|
344
|
+
textAlign: "center",
|
|
345
|
+
boxSizing: "border-box",
|
|
346
|
+
}),
|
|
347
|
+
weight("semibold"),
|
|
348
|
+
tabularNums(),
|
|
349
|
+
countToneMixins(),
|
|
350
|
+
media(DOCKED, [
|
|
351
|
+
when(`${RAIL_SIDEBAR} &`, raw({
|
|
352
|
+
position: "absolute",
|
|
353
|
+
insetBlockStart: "0.25rem",
|
|
354
|
+
insetInlineStart: "1.375rem",
|
|
355
|
+
minInlineSize: "0",
|
|
356
|
+
inlineSize: "0.5rem",
|
|
357
|
+
blockSize: "0.5rem",
|
|
358
|
+
padding: "0",
|
|
359
|
+
borderRadius: "999px",
|
|
360
|
+
fontSize: "0",
|
|
361
|
+
lineHeight: "0",
|
|
362
|
+
boxShadow: "0 0 0 2px var(--ui-neutral-bg-tint)",
|
|
363
|
+
})),
|
|
364
|
+
]),
|
|
365
|
+
], children: countLabel ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: count }), _jsx("span", { mix: [visuallyHidden()], children: countLabel })] })) : (count) })) : null, _jsx("span", { "data-slot": "app-shell-tooltip", "aria-hidden": "true", mix: [
|
|
366
|
+
hidden(),
|
|
367
|
+
supports("(anchor-name: --a)", media(DOCKED, [
|
|
368
|
+
when(`${RAIL_SIDEBAR} a:is(:hover, :focus-visible) > &`, raw({
|
|
369
|
+
display: "block",
|
|
370
|
+
position: "fixed",
|
|
371
|
+
positionAnchor: "--ui-app-nav-row",
|
|
372
|
+
positionArea: "center right",
|
|
373
|
+
marginInlineStart: "0.5rem",
|
|
374
|
+
paddingBlock: "0.25rem",
|
|
375
|
+
paddingInline: "0.5rem",
|
|
376
|
+
borderRadius: "0.375rem",
|
|
377
|
+
fontSize: "0.75rem",
|
|
378
|
+
whiteSpace: "nowrap",
|
|
379
|
+
pointerEvents: "none",
|
|
380
|
+
zIndex: "20",
|
|
381
|
+
backgroundColor: "var(--ui-neutral-fg-emphasis, CanvasText)",
|
|
382
|
+
color: "var(--ui-bg, Canvas)",
|
|
383
|
+
})),
|
|
384
|
+
])),
|
|
385
|
+
], children: label })] }) }));
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* Renders the back row of a swapped panel ("‹ Settings"), drawn by the server in place of the
|
|
390
|
+
* app's nav. With the toggle island loaded, Esc follows it unless a field, menu or dialog owns Esc.
|
|
391
|
+
*
|
|
392
|
+
* @param handle Runtime handle carrying the row's props.
|
|
393
|
+
* @returns The render function producing the row's markup.
|
|
394
|
+
* @example
|
|
395
|
+
* <AppShell.Back href="/monitors" label="Settings" />
|
|
396
|
+
*/
|
|
397
|
+
AppShell.Back = function AppShellBack(handle) {
|
|
398
|
+
return () => {
|
|
399
|
+
let { href, label, children: _children, mix, ...rest } = handle.props;
|
|
400
|
+
return (_jsxs("a", { ...rest, href: href, "data-app-shell-back": true, "aria-keyshortcuts": "Escape", mix: mergeMix([navRow(), fg("neutral.emphasis"), weight("semibold")], mix), children: [_jsx("span", { "aria-hidden": "true", mix: [navIcon(), raw({ opacity: "1" })], children: _jsx(ChevronLeftIcon, { size: 16 }) }), _jsx("span", { "data-app-shell-label": true, mix: [truncate()], children: label })] }));
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* Renders a switcher or account row: a 24px avatar, a name and an optional detail line. With
|
|
405
|
+
* `commandfor` or `popovertarget` it is a menu button with an up-down chevron that opens that
|
|
406
|
+
* `Menu` from the column and the rail alike; without either it is static, unfocusable content.
|
|
407
|
+
*
|
|
408
|
+
* @param handle Runtime handle carrying the row's props.
|
|
409
|
+
* @returns The render function producing the row's markup.
|
|
410
|
+
* @example
|
|
411
|
+
* <AppShell.Identity avatar={<Logo />} name="Acme Ops" detail="Pro plan" commandfor="workspaces" command="toggle-popover" />
|
|
412
|
+
* <Menu id="workspaces" aria-label="Workspace"><Menu.Item href="/workspaces">Switch workspace</Menu.Item></Menu>
|
|
413
|
+
* @example
|
|
414
|
+
* <AppShell.Identity avatar={<Avatar />} name="Ada Lovelace" detail="ada@acme.dev" />
|
|
415
|
+
*/
|
|
416
|
+
AppShell.Identity = function AppShellIdentity(handle) {
|
|
417
|
+
return () => {
|
|
418
|
+
let { avatar, name, detail, chevron = true, mix, ...rest } = handle.props;
|
|
419
|
+
let content = (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", mix: [
|
|
420
|
+
raw({
|
|
421
|
+
display: "inline-flex",
|
|
422
|
+
flexShrink: "0",
|
|
423
|
+
inlineSize: "1.5rem",
|
|
424
|
+
blockSize: "1.5rem",
|
|
425
|
+
alignItems: "center",
|
|
426
|
+
justifyContent: "center",
|
|
427
|
+
overflow: "hidden",
|
|
428
|
+
borderRadius: "0.375rem",
|
|
429
|
+
"--ui-image-placeholder-size-sm": "1.5rem",
|
|
430
|
+
"--ui-image-placeholder-size-md": "1.5rem",
|
|
431
|
+
"--ui-image-placeholder-size-lg": "1.5rem",
|
|
432
|
+
}),
|
|
433
|
+
when("& > *", raw({ maxInlineSize: "100%", maxBlockSize: "100%" })),
|
|
434
|
+
when("& > img", raw({ inlineSize: "100%", blockSize: "100%", objectFit: "cover" })),
|
|
435
|
+
], children: avatar }), _jsxs("span", { "data-app-shell-label": true, mix: [
|
|
436
|
+
raw({ display: "flex", flexDirection: "column", flex: "1 1 auto", minInlineSize: "0" }),
|
|
437
|
+
], children: [_jsx("span", { mix: [truncate(), text("sm"), weight("medium"), fg("neutral.emphasis")], children: name }), detail ? (_jsx("span", { mix: [truncate(), raw({ fontSize: "0.75rem" }), fg("neutral.muted")], children: detail })) : null] })] }));
|
|
438
|
+
if (rest.commandfor === undefined && rest.popovertarget === undefined) {
|
|
439
|
+
let { command: _command, popovertargetaction: _action, disabled: _disabled, type: _type, value: _value, form: _form, ...shared } = rest;
|
|
440
|
+
/** What a row shares with a `<div>`: its global attributes, data-* and event props. */
|
|
441
|
+
let divProps = shared;
|
|
442
|
+
let divMix = mix;
|
|
443
|
+
return (_jsx("div", { ...divProps, "data-slot": "app-shell-identity", mix: mergeMix([identityRow(), raw({ cursor: "default" })], divMix), children: content }));
|
|
444
|
+
}
|
|
445
|
+
return (_jsxs("button", { type: "button", "aria-haspopup": "menu", ...rest, "data-slot": "app-shell-identity", mix: mergeMix([
|
|
446
|
+
identityRow(),
|
|
447
|
+
raw({ cursor: "pointer" }),
|
|
448
|
+
hover(bg("neutral.bg-tint-hover")),
|
|
449
|
+
focusVisible(outline({ color: "brand.ring", offset: -2 })),
|
|
450
|
+
], mix), children: [content, chevron ? (_jsx("span", { "data-app-shell-label": true, "aria-hidden": "true", mix: [raw({ display: "inline-flex", flexShrink: "0" }), fg("neutral.muted")], children: _jsx(ChevronsUpDownIcon, { size: 14 }) })) : null] }));
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
/** An identity row's box, shared by its static and menu-button forms. */
|
|
454
|
+
function identityRow() {
|
|
455
|
+
return [
|
|
456
|
+
raw({
|
|
457
|
+
display: "flex",
|
|
458
|
+
alignItems: "center",
|
|
459
|
+
gap: "0.5rem",
|
|
460
|
+
inlineSize: "100%",
|
|
461
|
+
minBlockSize: "2.5rem",
|
|
462
|
+
padding: "0.375rem",
|
|
463
|
+
border: "0",
|
|
464
|
+
borderRadius: "0.5rem",
|
|
465
|
+
background: "transparent",
|
|
466
|
+
color: "inherit",
|
|
467
|
+
font: "inherit",
|
|
468
|
+
textAlign: "start",
|
|
469
|
+
boxSizing: "border-box",
|
|
470
|
+
overflow: "hidden",
|
|
471
|
+
}),
|
|
472
|
+
];
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* A nav row's box: 32px, 14px text, quiet until hovered, and marked when current or active by a
|
|
476
|
+
* soft fill or, under `indicator="pill"`, a 2px pill on the leading edge. The focus ring sits
|
|
477
|
+
* inside the row so the nav's scroll box never clips it.
|
|
478
|
+
*/
|
|
479
|
+
function navRow() {
|
|
480
|
+
return [
|
|
481
|
+
raw({
|
|
482
|
+
position: "relative",
|
|
483
|
+
display: "flex",
|
|
484
|
+
alignItems: "center",
|
|
485
|
+
gap: "0.5rem",
|
|
486
|
+
blockSize: "var(--ui-app-nav-row-size, 2rem)",
|
|
487
|
+
paddingInline: "0.625rem",
|
|
488
|
+
borderRadius: "0.375rem",
|
|
489
|
+
textDecoration: "none",
|
|
490
|
+
whiteSpace: "nowrap",
|
|
491
|
+
boxSizing: "border-box",
|
|
492
|
+
transition: "background-color 150ms ease-out, color 150ms ease-out",
|
|
493
|
+
}),
|
|
494
|
+
text("sm"),
|
|
495
|
+
fg("neutral"),
|
|
496
|
+
hover([bg("neutral.bg-tint-hover"), fg("neutral.emphasis")]),
|
|
497
|
+
focusVisible(outline({ color: "brand.ring", offset: -2 })),
|
|
498
|
+
when("&[data-unread]", [weight("semibold"), fg("neutral.emphasis")]),
|
|
499
|
+
when('[data-indicator="fill"] &[data-current]', [
|
|
500
|
+
bg("neutral.bg-tint-pressed"),
|
|
501
|
+
fg("neutral.emphasis"),
|
|
502
|
+
weight("medium"),
|
|
503
|
+
]),
|
|
504
|
+
when('[data-indicator="pill"] &[data-current]', [fg("neutral.emphasis"), weight("medium")]),
|
|
505
|
+
when('[data-indicator="pill"] &[data-current]::before', raw({
|
|
506
|
+
content: '""',
|
|
507
|
+
position: "absolute",
|
|
508
|
+
insetInlineStart: "0",
|
|
509
|
+
insetBlock: "0.375rem",
|
|
510
|
+
inlineSize: "2px",
|
|
511
|
+
borderRadius: "2px",
|
|
512
|
+
backgroundColor: "var(--ui-brand-bg-solid)",
|
|
513
|
+
})),
|
|
514
|
+
media("(prefers-reduced-motion: reduce)", raw({ transition: "none" })),
|
|
515
|
+
];
|
|
516
|
+
}
|
|
517
|
+
/** A row's icon box: 16px at reduced ink, full ink on the current row, so labels carry meaning. */
|
|
518
|
+
function navIcon() {
|
|
519
|
+
return [
|
|
520
|
+
raw({
|
|
521
|
+
display: "inline-flex",
|
|
522
|
+
flexShrink: "0",
|
|
523
|
+
inlineSize: "1rem",
|
|
524
|
+
blockSize: "1rem",
|
|
525
|
+
alignItems: "center",
|
|
526
|
+
justifyContent: "center",
|
|
527
|
+
opacity: "0.6",
|
|
528
|
+
}),
|
|
529
|
+
when("[data-current] > &, a:hover > &", raw({ opacity: "1" })),
|
|
530
|
+
when("& > svg", raw({ inlineSize: "1rem", blockSize: "1rem" })),
|
|
531
|
+
];
|
|
532
|
+
}
|
|
533
|
+
/** The count pill's colours: a soft tally for `neutral`, a solid pill for every other tone. */
|
|
534
|
+
function countToneMixins() {
|
|
535
|
+
return [
|
|
536
|
+
when('&[data-tone="neutral"]', [bg("neutral.bg-tint-pressed"), fg("neutral.emphasis")]),
|
|
537
|
+
when('&[data-tone="brand"]', [bg("brand.solid"), fg("brand.onSolid")]),
|
|
538
|
+
when('&[data-tone="success"]', [bg("success.solid"), fg("success.onSolid")]),
|
|
539
|
+
when('&[data-tone="warning"]', [bg("warning.solid"), fg("warning.onSolid")]),
|
|
540
|
+
when('&[data-tone="danger"]', [bg("danger.solid"), fg("danger.onSolid")]),
|
|
541
|
+
];
|
|
542
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Auto-refresh: 30s ▾" for a live list: a menu of intervals whose choice lives in the URL (or
|
|
3
|
+
* wherever `hrefFor` points, such as a cookie endpoint), and the time the list was last
|
|
4
|
+
* fetched, which an island advances while it reloads a frame or the page on that interval.
|
|
5
|
+
* Either half renders alone, so the intervals can sit in a View menu and the time beside it.
|
|
6
|
+
*
|
|
7
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
8
|
+
* @copyright Sergio Xalambrí 2026
|
|
9
|
+
*/
|
|
10
|
+
import type { EntryComponent, Handle, Props as TagProps } from "remix/component";
|
|
11
|
+
/** Prop types for {@link AutoRefresh} and {@link AutoRefreshStatus}. */
|
|
12
|
+
export declare namespace AutoRefresh {
|
|
13
|
+
/** An interval the menu offers. */
|
|
14
|
+
interface Option {
|
|
15
|
+
/** Seconds between reloads; 0 is off. */
|
|
16
|
+
value: number;
|
|
17
|
+
/** Its name in the menu and on the trigger, such as "30s" or "Off". */
|
|
18
|
+
label: string;
|
|
19
|
+
}
|
|
20
|
+
/** Every string the control shows. */
|
|
21
|
+
interface Labels {
|
|
22
|
+
/** The trigger's lead and the menu's name, such as "Auto-refresh". */
|
|
23
|
+
trigger: string;
|
|
24
|
+
/**
|
|
25
|
+
* The status line, with `{time}` where the last-fetched time goes, such as
|
|
26
|
+
* "Updated {time}" or "{time} — last fetch"; text without `{time}` leads the time.
|
|
27
|
+
*/
|
|
28
|
+
updated: string;
|
|
29
|
+
}
|
|
30
|
+
/** Props accepted by {@link AutoRefresh}; the host is a `<div>`. */
|
|
31
|
+
interface Props extends Omit<TagProps<"div">, "children" | "id"> {
|
|
32
|
+
/** Prefix for the menu id; unique on the page. */
|
|
33
|
+
id: string;
|
|
34
|
+
/** The page's current URL, which holds the choice. @default "/" */
|
|
35
|
+
url?: URL | string;
|
|
36
|
+
/** The search parameter holding the interval. @default "refresh" */
|
|
37
|
+
name?: string;
|
|
38
|
+
/** The interval in force, overriding the URL, for a choice stored in a cookie. */
|
|
39
|
+
value?: number;
|
|
40
|
+
/** The interval while neither `value` nor the URL names one. @default 0 */
|
|
41
|
+
defaultValue?: number;
|
|
42
|
+
/** The intervals offered, such as Off, 10s, 30s, 1m and 5m. */
|
|
43
|
+
options?: Option[];
|
|
44
|
+
/** Where choosing `value` leads; defaults to the URL with the parameter set (removed for the default). */
|
|
45
|
+
hrefFor?: (value: number) => string;
|
|
46
|
+
/** The named frame to reload; unset reloads the page through its top frame. A name not on the page reloads nothing. */
|
|
47
|
+
frame?: string;
|
|
48
|
+
/** When the list on screen was fetched. Defaults to the time of rendering. */
|
|
49
|
+
refreshedAt?: Date;
|
|
50
|
+
/** Locale for the time. Defaults to the runtime's. */
|
|
51
|
+
locale?: string;
|
|
52
|
+
/** Time zone the server writes the first time in. Defaults to the runtime's. */
|
|
53
|
+
timeZone?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Which half to draw: `"all"`, the interval menu and the time; `"choices"`, the intervals
|
|
56
|
+
* as a row of links for a menu that already has a trigger; `"status"`, the time alone,
|
|
57
|
+
* which does the reloading, so a page drawing `"choices"` draws `"status"` too.
|
|
58
|
+
*
|
|
59
|
+
* @default "all"
|
|
60
|
+
*/
|
|
61
|
+
show?: Show;
|
|
62
|
+
labels: Labels;
|
|
63
|
+
}
|
|
64
|
+
/** The halves {@link AutoRefresh} can draw; see `Props.show`. */
|
|
65
|
+
type Show = "all" | "choices" | "status";
|
|
66
|
+
/** Props {@link AutoRefreshStatus} serializes for hydration, which is why they are a `type`. */
|
|
67
|
+
type StatusProps = {
|
|
68
|
+
/** Milliseconds between reloads; 0 never reloads. */
|
|
69
|
+
every: number;
|
|
70
|
+
frame?: string;
|
|
71
|
+
/** The status template; `{time}` marks where the time sits, else the text leads it. */
|
|
72
|
+
label: string;
|
|
73
|
+
/** ISO timestamp of the content on screen. */
|
|
74
|
+
refreshedAt: string;
|
|
75
|
+
/** That time as the server wrote it. */
|
|
76
|
+
text: string;
|
|
77
|
+
locale?: string;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Renders the interval menu and the last-updated time. Each menu item is a link, so a choice
|
|
82
|
+
* works without script and lands in the URL; the time island does the reloading.
|
|
83
|
+
*
|
|
84
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
85
|
+
* @returns The render function producing the control.
|
|
86
|
+
* @example
|
|
87
|
+
* <AutoRefresh
|
|
88
|
+
* id="monitors-refresh"
|
|
89
|
+
* url={request.url}
|
|
90
|
+
* frame="monitor-list"
|
|
91
|
+
* refreshedAt={new Date()}
|
|
92
|
+
* options={[{ value: 0, label: "Off" }, { value: 30, label: "30s" }, { value: 60, label: "1m" }]}
|
|
93
|
+
* labels={{ trigger: "Auto-refresh", updated: "Updated {time}" }}
|
|
94
|
+
* />
|
|
95
|
+
*/
|
|
96
|
+
export declare function AutoRefresh(handle: Handle<AutoRefresh.Props>): () => import("remix/component").RemixElement;
|
|
97
|
+
/**
|
|
98
|
+
* The island naming when the list was fetched. Once hydrated it reloads the `frame` it names,
|
|
99
|
+
* or the page, every `every` milliseconds while the tab is visible, and rewrites the time after
|
|
100
|
+
* each reload. Load `@sdxc/ui/app/auto-refresh` in the browser entry.
|
|
101
|
+
*
|
|
102
|
+
* @example <AutoRefreshStatus every={30_000} label="Updated {time}" refreshedAt={iso} text="10:42:07" />
|
|
103
|
+
*/
|
|
104
|
+
export declare const AutoRefreshStatus: EntryComponent<AutoRefresh.StatusProps>;
|