@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,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One group of settings: a title and description beside or above a bordered card of
|
|
3
|
+
* 1px-ruled rows. A section saves one way only: `"explicit"` for typed inputs, with its own
|
|
4
|
+
* primary Save at the bottom start, `"instant"` for switches, or `"none"` for a table or list.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
import type { ActionPlacement as ActionPlacementType } from "./styles/action-row.js";
|
|
11
|
+
/**
|
|
12
|
+
* Prop types for {@link SettingsSection} and {@link SettingsSection.Row}.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace SettingsSection {
|
|
15
|
+
/**
|
|
16
|
+
* How the section's changes persist. Typed inputs save explicitly, so a half-typed
|
|
17
|
+
* value never applies; switches save the moment they flip. Mixing them in one section
|
|
18
|
+
* leaves a person unsure what is saved, so a section picks one; a section holding a table
|
|
19
|
+
* or list whose rows act on their own saves nothing.
|
|
20
|
+
*/
|
|
21
|
+
type Save = "explicit" | "instant" | "none";
|
|
22
|
+
/** Where a row's label sits against its control. */
|
|
23
|
+
type RowLayout = "split" | "stacked" | "inline-switch" | "action";
|
|
24
|
+
/** Where an action row's control sits: at the end on its label's first line, or below its text. */
|
|
25
|
+
type ActionPlacement = ActionPlacementType;
|
|
26
|
+
/** The form the card submits. */
|
|
27
|
+
interface FormProps {
|
|
28
|
+
/** URL the section submits to; omit to submit to the current URL. */
|
|
29
|
+
action?: string;
|
|
30
|
+
/** @default "post" */
|
|
31
|
+
method?: "get" | "post";
|
|
32
|
+
/** Hidden inputs submitted with the section: a CSRF token, an intent. */
|
|
33
|
+
fields?: RemixNode;
|
|
34
|
+
}
|
|
35
|
+
/** Every string the section shows. */
|
|
36
|
+
interface Labels {
|
|
37
|
+
/**
|
|
38
|
+
* The Save button's text. An instant section shows it only to a browser running no
|
|
39
|
+
* script, which needs a button to submit its switches.
|
|
40
|
+
*/
|
|
41
|
+
save: string;
|
|
42
|
+
}
|
|
43
|
+
/** Props every section accepts, whatever it saves. */
|
|
44
|
+
interface BaseProps extends Omit<TagProps<"section">, "title"> {
|
|
45
|
+
title: RemixNode;
|
|
46
|
+
description?: RemixNode;
|
|
47
|
+
/**
|
|
48
|
+
* Controls on the title's row, at its end, that wrap under the title when the
|
|
49
|
+
* container is too narrow for both: an "Invite member" or "Add domain" button.
|
|
50
|
+
*/
|
|
51
|
+
actions?: RemixNode;
|
|
52
|
+
/**
|
|
53
|
+
* Puts the heading in a column beside the card on a wide container.
|
|
54
|
+
*
|
|
55
|
+
* @default "above"
|
|
56
|
+
*/
|
|
57
|
+
heading?: "above" | "beside";
|
|
58
|
+
}
|
|
59
|
+
/** A section that saves its controls, explicitly or as they change. */
|
|
60
|
+
interface SavingProps extends BaseProps {
|
|
61
|
+
/** @default "explicit" */
|
|
62
|
+
save?: "explicit" | "instant";
|
|
63
|
+
/** The form the card becomes; omit for a section whose controls submit on their own. */
|
|
64
|
+
form?: FormProps;
|
|
65
|
+
/** Content after the Save button in an explicit section's footer, such as a `SaveStatus`. */
|
|
66
|
+
footer?: RemixNode;
|
|
67
|
+
labels: Labels;
|
|
68
|
+
}
|
|
69
|
+
/** A section holding a table or list: its card is a plain container with no Save. */
|
|
70
|
+
interface ListProps extends BaseProps {
|
|
71
|
+
save: "none";
|
|
72
|
+
form?: never;
|
|
73
|
+
footer?: never;
|
|
74
|
+
labels?: never;
|
|
75
|
+
}
|
|
76
|
+
/** Props accepted by {@link SettingsSection}. */
|
|
77
|
+
type Props = SavingProps | ListProps;
|
|
78
|
+
/** Props accepted by {@link SettingsSection.Row}. */
|
|
79
|
+
interface RowProps extends TagProps<"div"> {
|
|
80
|
+
label: RemixNode;
|
|
81
|
+
/** Help under the label: what the setting changes, in a sentence. */
|
|
82
|
+
description?: RemixNode;
|
|
83
|
+
/** The control's `id`, which turns the label into a `<label for>`. */
|
|
84
|
+
htmlFor?: string;
|
|
85
|
+
/** The label's `id`, for a control named through `aria-labelledby`, such as a `Switch`. */
|
|
86
|
+
labelId?: string;
|
|
87
|
+
/** The description's `id`, for a control's `aria-describedby`. */
|
|
88
|
+
descriptionId?: string;
|
|
89
|
+
/**
|
|
90
|
+
* `"split"` puts the label at the start and the control at the end, stacking under
|
|
91
|
+
* 32rem; `"stacked"` puts the control under the label; `"inline-switch"` keeps a
|
|
92
|
+
* small control at the end at every width; `"action"` gives the text the row's width
|
|
93
|
+
* and puts a button that acts at once, such as "Open billing portal", where
|
|
94
|
+
* `actionPlacement` says, stacking under the text below 32rem.
|
|
95
|
+
*
|
|
96
|
+
* @default "split"
|
|
97
|
+
*/
|
|
98
|
+
layout?: RowLayout;
|
|
99
|
+
/**
|
|
100
|
+
* Where an `"action"` row's control sits on a wide card.
|
|
101
|
+
*
|
|
102
|
+
* @default "end"
|
|
103
|
+
*/
|
|
104
|
+
actionPlacement?: ActionPlacement;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Renders the section. The card is a `<form>` when `form` is set; an explicit section ends
|
|
109
|
+
* in a footer holding its own Save, which ⌘S presses while focus is in the section, an
|
|
110
|
+
* instant one submits whenever a control changes, and a `"none"` one is a plain card.
|
|
111
|
+
*
|
|
112
|
+
* @param handle Runtime handle carrying the section's props.
|
|
113
|
+
* @returns The render function producing the section's markup.
|
|
114
|
+
* @example
|
|
115
|
+
* <SettingsSection title="Monitor defaults" save="explicit" form={{ action: "/settings/monitors" }} labels={{ save: "Save" }}>
|
|
116
|
+
* <SettingsSection.Row label="Check interval" htmlFor="interval"><Select id="interval" name="interval">…</Select></SettingsSection.Row>
|
|
117
|
+
* </SettingsSection>
|
|
118
|
+
* @example
|
|
119
|
+
* <SettingsSection title="Notifications" save="instant" form={{ action: "/settings/notifications" }} labels={{ save: "Save" }}>
|
|
120
|
+
* <SettingsSection.Row layout="inline-switch" label="Email me when a monitor goes down" labelId="down-label">
|
|
121
|
+
* <Switch name="emailOnDown" aria-labelledby="down-label" />
|
|
122
|
+
* </SettingsSection.Row>
|
|
123
|
+
* </SettingsSection>
|
|
124
|
+
* @example
|
|
125
|
+
* <SettingsSection title="Members" save="none" actions={<Button commandfor="invite" command="show-modal">Invite member</Button>}>
|
|
126
|
+
* <Table.Container>…</Table.Container>
|
|
127
|
+
* </SettingsSection>
|
|
128
|
+
*/
|
|
129
|
+
export declare function SettingsSection(handle: Handle<SettingsSection.Props>): () => import("remix/component").RemixElement;
|
|
130
|
+
export declare namespace SettingsSection {
|
|
131
|
+
var Row: (handle: Handle<SettingsSection.RowProps>) => () => import("remix/component").RemixElement;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Client island: what makes an instant section save as it changes, attaching
|
|
135
|
+
* `submitOnChange()` to the enclosing form so every flipped control submits it.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* <form method="post"><Switch name="weekly" /><SettingsInstantSave /></form>
|
|
139
|
+
*/
|
|
140
|
+
export declare const SettingsInstantSave: EntryComponent<{}>;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "remix/component/jsx-runtime";
|
|
2
|
+
import { bg, border, borderEdge, fg } from "@sdxc/u/color";
|
|
3
|
+
import { rounded } from "@sdxc/u/effects";
|
|
4
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
5
|
+
import { container, hstack, vstack } from "@sdxc/u/layout";
|
|
6
|
+
import { divide, overflow } from "@sdxc/u/overflow";
|
|
7
|
+
import { m, minIs, p } from "@sdxc/u/size";
|
|
8
|
+
import { balance, pretty, text, weight } from "@sdxc/u/typography";
|
|
9
|
+
import { clientEntry } from "remix/component";
|
|
10
|
+
import { Button } from "../components/button.js";
|
|
11
|
+
import { submitOnChange } from "./mixins/submit-on-change.js";
|
|
12
|
+
import { SaveShortcut } from "./save-bar.js";
|
|
13
|
+
import { actionRowGrid, onTitleLine } from "./styles/action-row.js";
|
|
14
|
+
/** Container the card measures, so a row stacks in a narrow pane as well as on a phone. */
|
|
15
|
+
const CARD_CONTAINER = "ui-settings-card";
|
|
16
|
+
/** Container the section measures to put its heading beside the card. */
|
|
17
|
+
const SECTION_CONTAINER = "ui-settings-section";
|
|
18
|
+
/** Card width below which a split row stacks its label over its control. */
|
|
19
|
+
const SPLIT_MIN = "32rem";
|
|
20
|
+
/** HTTP method a section's form falls back to, since saving changes state. */
|
|
21
|
+
const DEFAULT_METHOD = "post";
|
|
22
|
+
/** How a section saves when `save` is omitted. */
|
|
23
|
+
const DEFAULT_SAVE = "explicit";
|
|
24
|
+
/** Where the heading sits when `heading` is omitted. */
|
|
25
|
+
const DEFAULT_HEADING = "above";
|
|
26
|
+
/** How a row lays out when `layout` is omitted. */
|
|
27
|
+
const DEFAULT_ROW_LAYOUT = "split";
|
|
28
|
+
/** Gap between a row's text and its control, stacked or side by side. */
|
|
29
|
+
const ROW_GAP = "0.5rem 1.5rem";
|
|
30
|
+
/** Where an action row's control sits when `actionPlacement` is omitted. */
|
|
31
|
+
const DEFAULT_ACTION_PLACEMENT = "end";
|
|
32
|
+
/**
|
|
33
|
+
* Renders the section. The card is a `<form>` when `form` is set; an explicit section ends
|
|
34
|
+
* in a footer holding its own Save, which ⌘S presses while focus is in the section, an
|
|
35
|
+
* instant one submits whenever a control changes, and a `"none"` one is a plain card.
|
|
36
|
+
*
|
|
37
|
+
* @param handle Runtime handle carrying the section's props.
|
|
38
|
+
* @returns The render function producing the section's markup.
|
|
39
|
+
* @example
|
|
40
|
+
* <SettingsSection title="Monitor defaults" save="explicit" form={{ action: "/settings/monitors" }} labels={{ save: "Save" }}>
|
|
41
|
+
* <SettingsSection.Row label="Check interval" htmlFor="interval"><Select id="interval" name="interval">…</Select></SettingsSection.Row>
|
|
42
|
+
* </SettingsSection>
|
|
43
|
+
* @example
|
|
44
|
+
* <SettingsSection title="Notifications" save="instant" form={{ action: "/settings/notifications" }} labels={{ save: "Save" }}>
|
|
45
|
+
* <SettingsSection.Row layout="inline-switch" label="Email me when a monitor goes down" labelId="down-label">
|
|
46
|
+
* <Switch name="emailOnDown" aria-labelledby="down-label" />
|
|
47
|
+
* </SettingsSection.Row>
|
|
48
|
+
* </SettingsSection>
|
|
49
|
+
* @example
|
|
50
|
+
* <SettingsSection title="Members" save="none" actions={<Button commandfor="invite" command="show-modal">Invite member</Button>}>
|
|
51
|
+
* <Table.Container>…</Table.Container>
|
|
52
|
+
* </SettingsSection>
|
|
53
|
+
*/
|
|
54
|
+
export function SettingsSection(handle) {
|
|
55
|
+
return () => {
|
|
56
|
+
let props = handle.props;
|
|
57
|
+
let saveLabel = props.save === "none" ? null : props.labels.save;
|
|
58
|
+
let { title, description, actions, save: saveProp, form, heading: headingProp, footer, labels: _labels, children, mix, ...rest } = props;
|
|
59
|
+
let save = saveProp ?? DEFAULT_SAVE;
|
|
60
|
+
let heading = headingProp ?? DEFAULT_HEADING;
|
|
61
|
+
let titleId = `${handle.id}-title`;
|
|
62
|
+
let isExplicit = save === "explicit";
|
|
63
|
+
let cardMix = [
|
|
64
|
+
container(CARD_CONTAINER),
|
|
65
|
+
minIs(0),
|
|
66
|
+
rounded("lg"),
|
|
67
|
+
border({ color: "neutral", width: 1 }),
|
|
68
|
+
bg(),
|
|
69
|
+
overflow("hidden"),
|
|
70
|
+
];
|
|
71
|
+
let rows = (_jsx("div", { "data-slot": "settings-rows", mix: [vstack({ gap: 0, align: "stretch" }), divide("block", "neutral")], children: children }));
|
|
72
|
+
let saveFooter = isExplicit ? (_jsxs("footer", { "data-slot": "settings-footer", mix: [
|
|
73
|
+
hstack({ gap: 3, align: "center" }),
|
|
74
|
+
raw({ flexWrap: "wrap" }),
|
|
75
|
+
p(3, 4),
|
|
76
|
+
borderEdge("block-start", { color: "neutral", width: 1, style: "solid" }),
|
|
77
|
+
bg("neutral.bg-tint"),
|
|
78
|
+
], children: [_jsx(Button, { type: "submit", color: "brand", variant: "solid", size: "sm", children: saveLabel }), footer] })) : null;
|
|
79
|
+
/**
|
|
80
|
+
* An instant section saves through script, so a browser running none gets the Save
|
|
81
|
+
* button an explicit section shows.
|
|
82
|
+
*/
|
|
83
|
+
let instantSave = save !== "instant" ? null : (_jsxs(_Fragment, { children: [_jsx("noscript", { children: _jsx("div", { mix: [
|
|
84
|
+
p(3, 4),
|
|
85
|
+
borderEdge("block-start", { color: "neutral", width: 1, style: "solid" }),
|
|
86
|
+
], children: _jsx(Button, { type: "submit", color: "brand", variant: "solid", size: "sm", children: saveLabel }) }) }), _jsx(SettingsInstantSave, {})] }));
|
|
87
|
+
return (_jsx("section", { ...rest, "aria-labelledby": titleId, "data-slot": "settings-section", "data-save": save, mix: mergeMix([container(SECTION_CONTAINER)], mix), children: _jsxs("div", { mix: [
|
|
88
|
+
raw({
|
|
89
|
+
display: "grid",
|
|
90
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
91
|
+
gap: "0.75rem",
|
|
92
|
+
...(heading === "beside"
|
|
93
|
+
? {
|
|
94
|
+
[`@container ${SECTION_CONTAINER} (min-width: 48rem)`]: {
|
|
95
|
+
gridTemplateColumns: "minmax(0, 16rem) minmax(0, 1fr)",
|
|
96
|
+
gap: "2rem",
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
: {}),
|
|
100
|
+
}),
|
|
101
|
+
], children: [_jsxs("header", { mix: [vstack({ gap: 1, align: "stretch" }), minIs(0)], children: [_jsxs("div", { "data-slot": "settings-title-row", mix: [
|
|
102
|
+
hstack({ gap: 2, align: "center" }),
|
|
103
|
+
raw({ flexWrap: "wrap", columnGap: "1rem" }),
|
|
104
|
+
], children: [_jsx("h2", { id: titleId, mix: [
|
|
105
|
+
m(0),
|
|
106
|
+
raw({ flex: "1 1 auto" }),
|
|
107
|
+
minIs(0),
|
|
108
|
+
text("base"),
|
|
109
|
+
weight("semibold"),
|
|
110
|
+
fg("neutral.emphasis"),
|
|
111
|
+
balance(),
|
|
112
|
+
], children: title }), actions ? (_jsx("div", { "data-slot": "settings-actions", mix: [
|
|
113
|
+
hstack({ gap: 2, align: "center" }),
|
|
114
|
+
raw({ flexWrap: "wrap", flex: "0 1 auto" }),
|
|
115
|
+
minIs(0),
|
|
116
|
+
], children: actions })) : null] }), description ? (_jsx("p", { mix: [m(0), text("sm"), fg("neutral.muted"), pretty()], children: description })) : null] }), form ? (_jsxs("form", { action: form.action, method: form.method ?? DEFAULT_METHOD, "data-slot": "settings-card", mix: cardMix, children: [form.fields, rows, saveFooter, isExplicit ? _jsx(SaveShortcut, {}) : null, instantSave] })) : (_jsxs("div", { "data-slot": "settings-card", mix: cardMix, children: [rows, saveFooter] }))] }) }));
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Renders one setting as a label and help beside or above its control. A split row reads
|
|
121
|
+
* its card's width, so it stacks in a narrow pane as well as on a phone.
|
|
122
|
+
*
|
|
123
|
+
* @param handle Runtime handle carrying the row's props.
|
|
124
|
+
* @returns The render function producing the row's markup.
|
|
125
|
+
* @example
|
|
126
|
+
* <SettingsSection.Row label="Alert email" description="Where down alerts go." htmlFor="alert-email">
|
|
127
|
+
* <Input id="alert-email" name="alertEmail" type="email" />
|
|
128
|
+
* </SettingsSection.Row>
|
|
129
|
+
* @example
|
|
130
|
+
* <SettingsSection.Row layout="action" label="Subscription" description="Plan, card and invoices.">
|
|
131
|
+
* <LinkButton href="/billing/portal" size="sm" variant="outline">Open billing portal</LinkButton>
|
|
132
|
+
* </SettingsSection.Row>
|
|
133
|
+
*/
|
|
134
|
+
SettingsSection.Row = function SettingsSectionRow(handle) {
|
|
135
|
+
return () => {
|
|
136
|
+
let { label, description, htmlFor, labelId, descriptionId, layout: layoutProp, actionPlacement: actionPlacementProp, children, mix, ...rest } = handle.props;
|
|
137
|
+
let layout = layoutProp ?? DEFAULT_ROW_LAYOUT;
|
|
138
|
+
let actionPlacement = actionPlacementProp ?? DEFAULT_ACTION_PLACEMENT;
|
|
139
|
+
let isEndAction = layout === "action" && actionPlacement === "end";
|
|
140
|
+
let labelMix = [text("sm"), weight("medium"), fg("neutral.emphasis")];
|
|
141
|
+
return (_jsxs("div", { ...rest, "data-slot": "settings-row", "data-layout": layout, "data-action-placement": layout === "action" ? actionPlacement : undefined, mix: mergeMix([
|
|
142
|
+
p(4),
|
|
143
|
+
layout === "action"
|
|
144
|
+
? actionRowGrid(CARD_CONTAINER, actionPlacement, ROW_GAP)
|
|
145
|
+
: raw({
|
|
146
|
+
display: "grid",
|
|
147
|
+
gap: ROW_GAP,
|
|
148
|
+
alignItems: rowAlign(layout, Boolean(description)),
|
|
149
|
+
gridTemplateColumns: layout === "inline-switch" ? "minmax(0, 1fr) auto" : "minmax(0, 1fr)",
|
|
150
|
+
...(layout === "split"
|
|
151
|
+
? {
|
|
152
|
+
[`@container ${CARD_CONTAINER} (min-width: ${SPLIT_MIN})`]: {
|
|
153
|
+
gridTemplateColumns: "minmax(0, 1fr) minmax(0, 1fr)",
|
|
154
|
+
},
|
|
155
|
+
}
|
|
156
|
+
: {}),
|
|
157
|
+
}),
|
|
158
|
+
], mix), children: [_jsxs("div", { "data-slot": "settings-row-text", mix: [vstack({ gap: 0.5, align: "stretch" }), minIs(0)], children: [htmlFor ? (_jsx("label", { id: labelId, for: htmlFor, mix: labelMix, children: label })) : (_jsx("div", { id: labelId, mix: labelMix, children: label })), description ? (_jsx("p", { id: descriptionId, mix: [m(0), text("sm"), fg("neutral.muted"), pretty()], children: description })) : null] }), _jsx("div", { "data-slot": "settings-row-control", mix: [minIs(0), isEndAction ? onTitleLine(CARD_CONTAINER) : undefined], children: children })] }));
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Where a row's label meets its control: a lone label centres on the control's text line,
|
|
163
|
+
* while a label carrying a description keeps its top on the control's top so the help reads
|
|
164
|
+
* down from it. An inline switch centres on the whole text block.
|
|
165
|
+
*/
|
|
166
|
+
function rowAlign(layout, hasDescription) {
|
|
167
|
+
if (layout === "inline-switch")
|
|
168
|
+
return "center";
|
|
169
|
+
if (layout === "split" && !hasDescription)
|
|
170
|
+
return "center";
|
|
171
|
+
return "start";
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Client island: what makes an instant section save as it changes, attaching
|
|
175
|
+
* `submitOnChange()` to the enclosing form so every flipped control submits it.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* <form method="post"><Switch name="weekly" /><SettingsInstantSave /></form>
|
|
179
|
+
*/
|
|
180
|
+
export const SettingsInstantSave = clientEntry("@sdxc/ui/app/settings-section#SettingsInstantSave", function SettingsInstantSave() {
|
|
181
|
+
return () => _jsx("span", { hidden: true, "data-slot": "settings-instant-save", mix: [submitOnChange()] });
|
|
182
|
+
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
2
|
import { fg } from "@sdxc/u/color";
|
|
3
|
+
import { mergeMix } from "@sdxc/u/general";
|
|
3
4
|
import { contents, flex, gap, grid, gridTemplate, items, justify } from "@sdxc/u/layout";
|
|
4
5
|
import { m } from "@sdxc/u/size";
|
|
5
6
|
import { pretty, text, weight } from "@sdxc/u/typography";
|
|
6
|
-
import { Keyboard } from "
|
|
7
|
+
import { Keyboard } from "../components/keyboard.js";
|
|
7
8
|
/**
|
|
8
9
|
* Renders the list's host `<dl>`, a two-column grid whose first column takes the actions
|
|
9
10
|
* and whose second sizes itself to the widest run of caps.
|
|
@@ -19,7 +20,7 @@ import { Keyboard } from "./keyboard.js";
|
|
|
19
20
|
export function ShortcutList(handle) {
|
|
20
21
|
return () => {
|
|
21
22
|
let { children, mix, ...rest } = handle.props;
|
|
22
|
-
return (_jsx("dl", { ...rest, "data-slot": "shortcut-list", mix: [m(0), grid(), gap(2, 4), items("center"), gridTemplate({ columns: "1fr auto" }), mix
|
|
23
|
+
return (_jsx("dl", { ...rest, "data-slot": "shortcut-list", mix: mergeMix([m(0), grid(), gap(2, 4), items("center"), gridTemplate({ columns: "1fr auto" })], mix), children: children }));
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
@@ -34,6 +35,6 @@ export function ShortcutList(handle) {
|
|
|
34
35
|
ShortcutList.Item = function ShortcutListItem(handle) {
|
|
35
36
|
return () => {
|
|
36
37
|
let { children, keys, mix, ...rest } = handle.props;
|
|
37
|
-
return (_jsxs("div", { ...rest, "data-slot": "shortcut", mix:
|
|
38
|
+
return (_jsxs("div", { ...rest, "data-slot": "shortcut", mix: mergeMix(contents(), mix), children: [_jsx("dt", { mix: [text("sm"), fg("neutral"), pretty()], children: children }), _jsx("dd", { mix: [m(0), flex(), gap(1), items("center"), justify("end")], children: keys.map((key, index) => (_jsx(Keyboard, { mix: [m(0), weight("medium")], children: key }, `${index}-${key}`))) })] }));
|
|
38
39
|
};
|
|
39
40
|
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loading placeholders: a single static block, plus presets that keep the real
|
|
3
|
+
* height of what they stand in for (a table row, a stat card, a table body, a
|
|
4
|
+
* list), so content lands without the page shifting.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Props accepted by {@link Skeleton} and its presets.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace Skeleton {
|
|
14
|
+
/**
|
|
15
|
+
* Every native `<div>` attribute, unchanged, plus the `mix` passthrough.
|
|
16
|
+
* A placeholder's box shape comes from the space it renders into, tuned
|
|
17
|
+
* through `style`, a wrapping layout, or a `css()` mixin via `mix`.
|
|
18
|
+
*/
|
|
19
|
+
interface Props extends TagProps<"div"> {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Names the loading cluster for assistive technology. Given, the preset's
|
|
23
|
+
* root becomes one busy `role="status"` named by it; left out, the whole
|
|
24
|
+
* preset stays hidden, for a parent that already announces the wait.
|
|
25
|
+
*/
|
|
26
|
+
interface Labelled {
|
|
27
|
+
/** What is loading, such as "Loading monitors". */
|
|
28
|
+
label?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Props accepted by {@link Skeleton.Row}. */
|
|
31
|
+
interface RowProps extends TagProps<"tr"> {
|
|
32
|
+
/** Cells in the row; match the real table's columns. Default: `4`. */
|
|
33
|
+
columns?: number;
|
|
34
|
+
}
|
|
35
|
+
/** Props accepted by {@link Skeleton.Table}. */
|
|
36
|
+
interface TableProps extends TagProps<"tbody">, Labelled {
|
|
37
|
+
/** Placeholder rows. Default: `5`. */
|
|
38
|
+
rows?: number;
|
|
39
|
+
/** Cells per row; match the real table's columns. Default: `4`. */
|
|
40
|
+
columns?: number;
|
|
41
|
+
}
|
|
42
|
+
/** Props accepted by {@link Skeleton.Stat}. */
|
|
43
|
+
interface StatProps extends Omit<TagProps<"div">, "children">, Labelled {
|
|
44
|
+
/** Draws the delta pill where a card with a delta sets it. */
|
|
45
|
+
delta?: boolean;
|
|
46
|
+
/** Draws the chart band under the value, as a card with a sparkline has. */
|
|
47
|
+
chart?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Props accepted by {@link Skeleton.List}. */
|
|
50
|
+
interface ListProps extends TagProps<"div">, Labelled {
|
|
51
|
+
/** Placeholder rows. Default: `5`. */
|
|
52
|
+
rows?: number;
|
|
53
|
+
/** Leads each row with a round avatar placeholder. */
|
|
54
|
+
avatar?: boolean;
|
|
55
|
+
/** Text lines per row. Default: `2`. */
|
|
56
|
+
lines?: 1 | 2;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A static loading placeholder: a rounded block filled with the neutral
|
|
61
|
+
* border color, sized to its container and one text line tall by default.
|
|
62
|
+
* Compose `pulse()` or `shimmer()` through `mix` for a motion cue.
|
|
63
|
+
*
|
|
64
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
65
|
+
* @returns The render function producing the placeholder's markup.
|
|
66
|
+
* @example
|
|
67
|
+
* <Skeleton mix={[pulse()]} />
|
|
68
|
+
* @example
|
|
69
|
+
* <Skeleton style={{ blockSize: "2.5rem", inlineSize: "2.5rem", borderRadius: "9999px" }} />
|
|
70
|
+
* @example
|
|
71
|
+
* <Skeleton aria-hidden="false" aria-label={t("status.loadingProfile")} />
|
|
72
|
+
*/
|
|
73
|
+
export declare function Skeleton(handle: Handle<Skeleton.Props>): () => import("remix/component").RemixElement;
|
|
74
|
+
export declare namespace Skeleton {
|
|
75
|
+
var Row: (handle: Handle<Skeleton.RowProps>) => () => import("remix/component").RemixElement;
|
|
76
|
+
var Table: (handle: Handle<Skeleton.TableProps>) => () => import("remix/component").RemixElement;
|
|
77
|
+
var Stat: (handle: Handle<Skeleton.StatProps>) => () => import("remix/component").RemixElement;
|
|
78
|
+
var List: (handle: Handle<Skeleton.ListProps>) => () => import("remix/component").RemixElement;
|
|
79
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { animationHost, keyframes } from "@sdxc/u/animation";
|
|
3
|
+
import { bg } from "@sdxc/u/color";
|
|
4
|
+
import { rounded } from "@sdxc/u/effects";
|
|
5
|
+
import { combine, mergeMix, raw } from "@sdxc/u/general";
|
|
6
|
+
import { flex, flexCol, gap, grow, items, shrink } from "@sdxc/u/layout";
|
|
7
|
+
import { media } from "@sdxc/u/responsive";
|
|
8
|
+
import { bs, is } from "@sdxc/u/size";
|
|
9
|
+
import { attrs } from "remix/component";
|
|
10
|
+
import { StatCard } from "./stat-card.js";
|
|
11
|
+
import { statDeltaPlacement } from "./styles/stat-delta.js";
|
|
12
|
+
import { Table } from "./table.js";
|
|
13
|
+
/**
|
|
14
|
+
* Default `aria-hidden` value applied through {@link attrs}, keeping a
|
|
15
|
+
* placeholder out of the accessibility tree unless a consumer sets
|
|
16
|
+
* `aria-hidden="false"` to expose a loading label to assistive tech.
|
|
17
|
+
*/
|
|
18
|
+
const DEFAULT_ARIA_HIDDEN = "true";
|
|
19
|
+
/** Bar widths a preset cycles through, so placeholder rows read as text of varied length. */
|
|
20
|
+
const BAR_WIDTHS = ["72%", "48%", "60%", "36%", "54%"];
|
|
21
|
+
/**
|
|
22
|
+
* A sweeping highlight across a placeholder bar while motion is allowed; under
|
|
23
|
+
* reduced motion the bar holds still, since the wait is already visible.
|
|
24
|
+
*
|
|
25
|
+
* @returns A mixin for a placeholder bar.
|
|
26
|
+
*/
|
|
27
|
+
function shimmerBar() {
|
|
28
|
+
return combine([
|
|
29
|
+
keyframes("ui-skeleton-shimmer", {
|
|
30
|
+
from: { backgroundPosition: "150% 0" },
|
|
31
|
+
to: { backgroundPosition: "-50% 0" },
|
|
32
|
+
}),
|
|
33
|
+
media("(prefers-reduced-motion: no-preference)", combine([
|
|
34
|
+
raw({
|
|
35
|
+
backgroundImage: "linear-gradient(90deg, transparent, color-mix(in oklab, var(--ui-bg, Canvas) 45%, transparent), transparent)",
|
|
36
|
+
backgroundSize: "50% 100%",
|
|
37
|
+
backgroundRepeat: "no-repeat",
|
|
38
|
+
}),
|
|
39
|
+
animationHost("ui-skeleton-shimmer", {
|
|
40
|
+
duration: "var(--ui-skeleton-shimmer-duration, 1.6s)",
|
|
41
|
+
easing: "ease-in-out",
|
|
42
|
+
iterationCount: "infinite",
|
|
43
|
+
}),
|
|
44
|
+
])),
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* One shimmering placeholder bar, inline-block so it sits on a text line
|
|
49
|
+
* without changing the line's height.
|
|
50
|
+
*
|
|
51
|
+
* @param handle Runtime handle carrying the bar's size.
|
|
52
|
+
* @returns The render function producing the bar's markup.
|
|
53
|
+
*/
|
|
54
|
+
function SkeletonBar(handle) {
|
|
55
|
+
return () => {
|
|
56
|
+
let { width, height = "0.75rem", round = false } = handle.props;
|
|
57
|
+
return (_jsx("span", { "data-slot": "skeleton-bar", mix: [
|
|
58
|
+
raw({
|
|
59
|
+
display: "inline-block",
|
|
60
|
+
verticalAlign: "middle",
|
|
61
|
+
inlineSize: width,
|
|
62
|
+
maxInlineSize: "100%",
|
|
63
|
+
blockSize: height,
|
|
64
|
+
borderRadius: round ? "9999px" : "var(--ui-radius-sm, 0.25rem)",
|
|
65
|
+
}),
|
|
66
|
+
bg("neutral.border"),
|
|
67
|
+
shimmerBar(),
|
|
68
|
+
] }));
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The attributes a preset root carries: one busy, named status when the
|
|
73
|
+
* caller labels the cluster, otherwise hidden whole.
|
|
74
|
+
*
|
|
75
|
+
* @param label What is loading, or `undefined` to hide the preset.
|
|
76
|
+
* @returns Attributes to spread onto the preset's root element.
|
|
77
|
+
*/
|
|
78
|
+
function busyAttributes(label) {
|
|
79
|
+
if (label === undefined)
|
|
80
|
+
return { "aria-hidden": "true" };
|
|
81
|
+
return { role: "status", "aria-busy": "true", "aria-label": label };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A static loading placeholder: a rounded block filled with the neutral
|
|
85
|
+
* border color, sized to its container and one text line tall by default.
|
|
86
|
+
* Compose `pulse()` or `shimmer()` through `mix` for a motion cue.
|
|
87
|
+
*
|
|
88
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
89
|
+
* @returns The render function producing the placeholder's markup.
|
|
90
|
+
* @example
|
|
91
|
+
* <Skeleton mix={[pulse()]} />
|
|
92
|
+
* @example
|
|
93
|
+
* <Skeleton style={{ blockSize: "2.5rem", inlineSize: "2.5rem", borderRadius: "9999px" }} />
|
|
94
|
+
* @example
|
|
95
|
+
* <Skeleton aria-hidden="false" aria-label={t("status.loadingProfile")} />
|
|
96
|
+
*/
|
|
97
|
+
export function Skeleton(handle) {
|
|
98
|
+
return () => {
|
|
99
|
+
let { mix, ...rest } = handle.props;
|
|
100
|
+
return (_jsx("div", { ...rest, mix: mergeMix([
|
|
101
|
+
attrs({ "aria-hidden": DEFAULT_ARIA_HIDDEN }),
|
|
102
|
+
bs("var(--ui-skeleton-block-size, 1rem)"),
|
|
103
|
+
is("full"),
|
|
104
|
+
rounded("md"),
|
|
105
|
+
bg("neutral.border"),
|
|
106
|
+
], mix) }));
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A placeholder table row built from the real `Table.Row` and `Table.Cell`, so it
|
|
111
|
+
* takes `--ui-table-row-block-size` and the table's cell padding and rules; place
|
|
112
|
+
* it in a real table body. Hidden from assistive technology.
|
|
113
|
+
*
|
|
114
|
+
* @param handle Runtime handle carrying the host `<tr>`'s props.
|
|
115
|
+
* @returns The render function producing the row's markup.
|
|
116
|
+
* @example
|
|
117
|
+
* <Table.Body aria-busy="true">{rows.map((n) => <Skeleton.Row key={n} columns={4} />)}</Table.Body>
|
|
118
|
+
*/
|
|
119
|
+
Skeleton.Row = function SkeletonRow(handle) {
|
|
120
|
+
return () => {
|
|
121
|
+
let { columns = 4, mix, ...rest } = handle.props;
|
|
122
|
+
return (_jsx(Table.Row, { "aria-hidden": "true", "data-skeleton": "row", ...rest, mix: mix, children: Array.from({ length: columns }, (_, column) => (_jsx(Table.Cell, { children: _jsx(SkeletonBar, { width: BAR_WIDTHS[column % BAR_WIDTHS.length] }) }, column))) }));
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* A placeholder table body of `rows` {@link Skeleton.Row}s, for under the real
|
|
127
|
+
* table header while the first page loads, so the header, columns and height
|
|
128
|
+
* hold still when the data arrives.
|
|
129
|
+
*
|
|
130
|
+
* @param handle Runtime handle carrying the host `<tbody>`'s props.
|
|
131
|
+
* @returns The render function producing the body's markup.
|
|
132
|
+
* @example
|
|
133
|
+
* <Table><Table.Header>…</Table.Header><Skeleton.Table rows={10} columns={5} label={t("monitors.loading")} /></Table>
|
|
134
|
+
*/
|
|
135
|
+
Skeleton.Table = function SkeletonTable(handle) {
|
|
136
|
+
return () => {
|
|
137
|
+
let { rows = 5, columns = 4, label, mix, ...rest } = handle.props;
|
|
138
|
+
let busy = label === undefined
|
|
139
|
+
? { "aria-hidden": "true" }
|
|
140
|
+
: { "aria-busy": "true", "aria-label": label };
|
|
141
|
+
return (_jsx(Table.Body, { ...busy, "data-skeleton": "table", ...rest, mix: mix, children: Array.from({ length: rows }, (_, row) => (_jsx(Skeleton.Row, { columns: columns }, row))) }));
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* A placeholder stat card drawn inside the real `StatCard` frame, with bars on
|
|
146
|
+
* the label and value lines and the delta placed as a real one is in every group
|
|
147
|
+
* layout, so it is as tall as the card it precedes; `delta` and `chart` add parts.
|
|
148
|
+
*
|
|
149
|
+
* @param handle Runtime handle carrying the card's props.
|
|
150
|
+
* @returns The render function producing the card's markup.
|
|
151
|
+
* @example
|
|
152
|
+
* <StatCard.Group>{[1, 2, 3, 4].map((n) => <Skeleton.Stat key={n} delta />)}</StatCard.Group>
|
|
153
|
+
*/
|
|
154
|
+
Skeleton.Stat = function SkeletonStat(handle) {
|
|
155
|
+
return () => {
|
|
156
|
+
let { delta = false, chart = false, label, mix, ...rest } = handle.props;
|
|
157
|
+
return (_jsxs(StatCard, { ...busyAttributes(label), "data-skeleton": "stat", ...rest, mix: mix, children: [_jsx(StatCard.Label, { children: _jsx(SkeletonBar, { width: "6rem", height: "0.75rem" }) }), delta ? (_jsx("span", { mix: [raw({ display: "inline-flex", alignItems: "center" }), statDeltaPlacement()], children: _jsx(SkeletonBar, { width: "3.5rem", height: "var(--ui-stat-delta-block-size, 1.375rem)", round: true }) })) : null, _jsx(StatCard.Value, { children: _jsx(SkeletonBar, { width: "5ch", height: "1em" }) }), chart ? (_jsx(StatCard.Chart, { children: _jsx(SkeletonBar, { width: "100%", height: "100%" }) })) : null] }));
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* A placeholder list of `rows` rows at `--ui-skeleton-list-row-block-size`
|
|
162
|
+
* (3.5rem, a two-line row), each an optional avatar and one or two text bars;
|
|
163
|
+
* set the variable to the real list's row height.
|
|
164
|
+
*
|
|
165
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
166
|
+
* @returns The render function producing the list's markup.
|
|
167
|
+
* @example
|
|
168
|
+
* <Skeleton.List rows={8} avatar label={t("inbox.loading")} />
|
|
169
|
+
*/
|
|
170
|
+
Skeleton.List = function SkeletonList(handle) {
|
|
171
|
+
return () => {
|
|
172
|
+
let { rows = 5, avatar = false, lines = 2, label, mix, ...rest } = handle.props;
|
|
173
|
+
return (_jsx("div", { ...busyAttributes(label), "data-slot": "skeleton-list", ...rest, mix: mergeMix([flex(), flexCol()], mix), children: Array.from({ length: rows }, (_, row) => (_jsxs("div", { "data-slot": "skeleton-list-row", mix: [
|
|
174
|
+
flex(),
|
|
175
|
+
items("center"),
|
|
176
|
+
gap(3),
|
|
177
|
+
raw({
|
|
178
|
+
boxSizing: "border-box",
|
|
179
|
+
blockSize: "var(--ui-skeleton-list-row-block-size, 3.5rem)",
|
|
180
|
+
paddingInline: "0.75rem",
|
|
181
|
+
}),
|
|
182
|
+
raw({ borderBlockEnd: "1px solid var(--ui-neutral-border, currentColor)" }),
|
|
183
|
+
], children: [avatar ? (_jsx("span", { mix: [shrink(0), raw({ display: "inline-flex" })], children: _jsx(SkeletonBar, { width: "2rem", height: "2rem", round: true }) })) : null, _jsxs("span", { mix: [flex(), flexCol(), gap(2), grow()], children: [_jsx(SkeletonBar, { width: BAR_WIDTHS[row % BAR_WIDTHS.length] }), lines === 2 ? (_jsx(SkeletonBar, { width: BAR_WIDTHS[(row + 2) % BAR_WIDTHS.length], height: "0.625rem" })) : null] })] }, row))) }));
|
|
184
|
+
};
|
|
185
|
+
};
|