@sdxc/ui 2026.11.26 → 2026.11.29
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 +265 -162
- package/dist/app/app-shell.d.ts +85 -50
- package/dist/app/app-shell.js +419 -222
- package/dist/app/auto-refresh.d.ts +68 -51
- package/dist/app/auto-refresh.js +193 -61
- package/dist/app/board.d.ts +40 -17
- package/dist/app/board.js +173 -88
- package/dist/app/chart.d.ts +10 -63
- package/dist/app/chart.js +22 -29
- package/dist/app/code-view.d.ts +12 -11
- package/dist/app/code-view.js +83 -19
- package/dist/app/command-palette.d.ts +61 -33
- package/dist/app/command-palette.js +178 -32
- package/dist/app/contribution-graph.d.ts +30 -14
- package/dist/app/contribution-graph.js +87 -26
- package/dist/app/danger-zone.d.ts +40 -35
- package/dist/app/danger-zone.js +177 -34
- package/dist/app/detail-sheet.d.ts +42 -51
- package/dist/app/detail-sheet.js +156 -37
- package/dist/app/diff.d.ts +6 -5
- package/dist/app/diff.js +9 -6
- package/dist/app/drop-zone.d.ts +3 -13
- package/dist/app/drop-zone.js +2 -2
- package/dist/app/editor-layout.d.ts +69 -47
- package/dist/app/editor-layout.js +256 -115
- package/dist/app/empty.d.ts +16 -12
- package/dist/app/empty.js +45 -19
- package/dist/app/file-trigger.d.ts +5 -13
- package/dist/app/file-trigger.js +3 -4
- package/dist/app/filter-bar.d.ts +182 -120
- package/dist/app/filter-bar.js +509 -161
- package/dist/app/filter-menu.d.ts +51 -33
- package/dist/app/filter-menu.js +105 -40
- package/dist/app/gantt.d.ts +67 -27
- package/dist/app/gantt.js +320 -163
- package/dist/app/grid-list.d.ts +2 -15
- package/dist/app/grid-list.js +3 -3
- package/dist/app/merge-box.d.ts +58 -52
- package/dist/app/merge-box.js +107 -46
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +2 -2
- package/dist/app/mixins/optimistic-toggle-sync.js +3 -2
- package/dist/app/mixins/range-picker-keys.d.ts +1 -1
- package/dist/app/mixins/range-picker-keys.js +1 -1
- package/dist/app/mixins/save-bar-sync.d.ts +1 -1
- package/dist/app/mixins/save-bar-sync.js +3 -2
- package/dist/app/mixins/split-view.d.ts +3 -1
- package/dist/app/mixins/split-view.js +16 -8
- package/dist/app/optimistic-toggle.d.ts +65 -37
- package/dist/app/optimistic-toggle.js +38 -15
- package/dist/app/page-header.d.ts +80 -58
- package/dist/app/page-header.js +329 -154
- package/dist/app/profile-picker.d.ts +31 -24
- package/dist/app/profile-picker.js +134 -58
- package/dist/app/range-picker.d.ts +62 -59
- package/dist/app/range-picker.js +124 -37
- package/dist/app/review-thread.d.ts +69 -66
- package/dist/app/review-thread.js +203 -53
- package/dist/app/save-bar.d.ts +56 -27
- package/dist/app/save-bar.js +66 -14
- package/dist/app/selection-bar.d.ts +64 -66
- package/dist/app/selection-bar.js +157 -56
- package/dist/app/settings-layout.d.ts +65 -52
- package/dist/app/settings-layout.js +198 -71
- package/dist/app/settings-section.d.ts +86 -93
- package/dist/app/settings-section.js +297 -120
- package/dist/app/shortcut-list.d.ts +19 -8
- package/dist/app/shortcut-list.js +50 -9
- package/dist/app/sparkline.d.ts +14 -16
- package/dist/app/sparkline.js +20 -7
- package/dist/app/split-view.d.ts +66 -42
- package/dist/app/split-view.js +235 -128
- package/dist/app/stat-card.d.ts +16 -4
- package/dist/app/stat-card.js +57 -21
- package/dist/app/status-strip.d.ts +24 -25
- package/dist/app/status-strip.js +82 -25
- package/dist/app/tab-bar.d.ts +15 -7
- package/dist/app/tab-bar.js +74 -37
- package/dist/app/table.d.ts +37 -38
- package/dist/app/table.js +101 -45
- package/dist/app/view-options.d.ts +100 -76
- package/dist/app/view-options.js +263 -129
- package/dist/audio/media-tile.d.ts +33 -21
- package/dist/audio/media-tile.js +139 -79
- package/dist/audio/player-bar.d.ts +24 -43
- package/dist/audio/player-bar.js +183 -118
- package/dist/audio/queue-list.d.ts +40 -36
- package/dist/audio/queue-list.js +172 -73
- package/dist/audio/track-list.d.ts +53 -54
- package/dist/audio/track-list.js +127 -35
- package/dist/blog/archive-list.d.ts +158 -0
- package/dist/blog/archive-list.js +353 -0
- package/dist/blog/article-layout.d.ts +81 -0
- package/dist/blog/article-layout.js +211 -0
- package/dist/blog/author-card.d.ts +99 -0
- package/dist/blog/author-card.js +184 -0
- package/dist/blog/blog-masthead.d.ts +55 -0
- package/dist/blog/blog-masthead.js +143 -0
- package/dist/blog/index.d.ts +21 -0
- package/dist/blog/index.js +21 -0
- package/dist/blog/link-host.d.ts +47 -0
- package/dist/blog/link-host.js +61 -0
- package/dist/blog/newsletter-form.d.ts +66 -0
- package/dist/blog/newsletter-form.js +100 -0
- package/dist/blog/post-byline.d.ts +96 -0
- package/dist/blog/post-byline.js +180 -0
- package/dist/blog/post-entry.d.ts +153 -0
- package/dist/blog/post-entry.js +402 -0
- package/dist/blog/post-stream.d.ts +92 -0
- package/dist/blog/post-stream.js +163 -0
- package/dist/blog/series-nav.d.ts +144 -0
- package/dist/blog/series-nav.js +275 -0
- package/dist/blog/tag-cloud.d.ts +103 -0
- package/dist/blog/tag-cloud.js +138 -0
- package/dist/blog/tag-list.d.ts +91 -0
- package/dist/blog/tag-list.js +92 -0
- package/dist/blog/widget.d.ts +68 -0
- package/dist/blog/widget.js +61 -0
- package/dist/chat/activity.d.ts +47 -15
- package/dist/chat/activity.js +124 -46
- package/dist/chat/mention-menu.d.ts +6 -7
- package/dist/chat/mention-menu.js +4 -4
- package/dist/chat/message-group.d.ts +17 -4
- package/dist/chat/message-group.js +29 -6
- package/dist/color/color-field.d.ts +41 -68
- package/dist/color/color-field.js +21 -38
- package/dist/color/color-picker.d.ts +10 -61
- package/dist/color/color-picker.js +7 -15
- package/dist/color/color-swatch-picker.d.ts +0 -11
- package/dist/color/color-swatch-picker.js +2 -3
- package/dist/color/color-wheel.d.ts +3 -13
- package/dist/color/color-wheel.js +1 -2
- package/dist/commerce/cart-drawer.d.ts +41 -24
- package/dist/commerce/cart-drawer.js +129 -58
- package/dist/commerce/cart-line.d.ts +34 -19
- package/dist/commerce/cart-line.js +94 -28
- package/dist/commerce/checkout-layout.d.ts +23 -19
- package/dist/commerce/checkout-layout.js +53 -24
- package/dist/commerce/facet-filters.d.ts +57 -59
- package/dist/commerce/facet-filters.js +219 -129
- package/dist/commerce/item-options-dialog.d.ts +69 -40
- package/dist/commerce/item-options-dialog.js +231 -104
- package/dist/commerce/menu-item-card.d.ts +36 -20
- package/dist/commerce/menu-item-card.js +114 -61
- package/dist/commerce/option-group.d.ts +46 -27
- package/dist/commerce/option-group.js +123 -52
- package/dist/commerce/order-summary.d.ts +41 -26
- package/dist/commerce/order-summary.js +103 -49
- package/dist/commerce/order-tracker.d.ts +32 -16
- package/dist/commerce/order-tracker.js +91 -66
- package/dist/commerce/price.d.ts +41 -25
- package/dist/commerce/price.js +131 -68
- package/dist/commerce/product-card.d.ts +66 -36
- package/dist/commerce/product-card.js +215 -100
- package/dist/commerce/product-gallery.d.ts +72 -38
- package/dist/commerce/product-gallery.js +187 -82
- package/dist/commerce/promo-code.d.ts +73 -37
- package/dist/commerce/promo-code.js +172 -77
- package/dist/commerce/question-list.d.ts +43 -35
- package/dist/commerce/question-list.js +146 -72
- package/dist/commerce/shipping-estimate.d.ts +68 -33
- package/dist/commerce/shipping-estimate.js +149 -25
- package/dist/commerce/sort-select.d.ts +33 -22
- package/dist/commerce/sort-select.js +55 -26
- package/dist/commerce/variant-picker.d.ts +25 -23
- package/dist/commerce/variant-picker.js +103 -29
- package/dist/{docs → components}/anchor-heading.d.ts +1 -1
- package/dist/{docs → components}/anchor-heading.js +1 -1
- package/dist/components/autocomplete.d.ts +19 -21
- package/dist/components/autocomplete.js +57 -21
- package/dist/components/banner.d.ts +48 -37
- package/dist/components/banner.js +69 -27
- package/dist/components/button.d.ts +2 -18
- package/dist/components/button.js +4 -3
- package/dist/components/callout.d.ts +52 -0
- package/dist/components/callout.js +77 -0
- package/dist/components/checkbox.d.ts +3 -12
- package/dist/components/checkbox.js +1 -2
- package/dist/components/code-block.d.ts +110 -0
- package/dist/{docs → components}/code-block.js +92 -23
- package/dist/components/confirm.d.ts +63 -130
- package/dist/components/confirm.js +133 -52
- package/dist/{docs → components}/copy-button.d.ts +1 -1
- package/dist/{docs → components}/copy-button.js +3 -3
- package/dist/components/date-field.d.ts +40 -60
- package/dist/components/date-field.js +23 -36
- package/dist/components/date-picker.d.ts +11 -67
- package/dist/components/date-picker.js +4 -15
- package/dist/components/date-range-picker.d.ts +20 -91
- package/dist/components/date-range-picker.js +13 -27
- package/dist/components/dialog-dismiss.d.ts +1 -1
- package/dist/components/dialog-dismiss.js +1 -1
- package/dist/components/field-parts.d.ts +158 -0
- package/dist/components/field-parts.js +237 -0
- package/dist/components/filter-links.d.ts +107 -0
- package/dist/components/filter-links.js +120 -0
- package/dist/components/form.d.ts +3 -1
- package/dist/components/form.js +3 -1
- package/dist/components/index.d.ts +14 -7
- package/dist/components/index.js +14 -7
- package/dist/components/lightbox.js +12 -6
- package/dist/components/listbox.d.ts +0 -9
- package/dist/components/listbox.js +2 -2
- package/dist/components/media-grid.d.ts +15 -16
- package/dist/components/media-grid.js +75 -34
- package/dist/components/pager.d.ts +103 -0
- package/dist/components/pager.js +187 -0
- package/dist/components/property-list.d.ts +38 -39
- package/dist/components/property-list.js +149 -96
- package/dist/components/radio-group.d.ts +0 -11
- package/dist/components/radio-group.js +5 -6
- package/dist/components/range-calendar.d.ts +2 -14
- package/dist/components/range-calendar.js +2 -2
- package/dist/components/range-months.d.ts +12 -2
- package/dist/components/range-months.js +32 -16
- package/dist/components/rating-input.d.ts +14 -6
- package/dist/components/rating-input.js +26 -12
- package/dist/components/rating.d.ts +13 -8
- package/dist/components/rating.js +19 -5
- package/dist/components/review-card.d.ts +51 -26
- package/dist/components/review-card.js +173 -40
- package/dist/components/search-field.js +18 -8
- package/dist/components/section-bar.d.ts +23 -15
- package/dist/components/section-bar.js +59 -37
- package/dist/components/sidebar.d.ts +27 -0
- package/dist/components/sidebar.js +49 -20
- package/dist/{docs → components}/table-of-contents.d.ts +1 -1
- package/dist/{docs → components}/table-of-contents.js +3 -3
- package/dist/components/text-field.d.ts +54 -81
- package/dist/components/text-field.js +30 -44
- package/dist/components/time-field.d.ts +45 -65
- package/dist/components/time-field.js +23 -35
- package/dist/components/timeline.d.ts +80 -86
- package/dist/components/timeline.js +383 -170
- package/dist/components/typeset.d.ts +5 -0
- package/dist/components/typeset.js +17 -2
- package/dist/docs/code-tabs.d.ts +50 -24
- package/dist/docs/code-tabs.js +91 -25
- package/dist/docs/docs-feedback.d.ts +70 -27
- package/dist/docs/docs-feedback.js +156 -27
- package/dist/docs/docs-footer.d.ts +36 -22
- package/dist/docs/docs-footer.js +76 -23
- package/dist/docs/docs-hub.d.ts +103 -73
- package/dist/docs/docs-hub.js +333 -83
- package/dist/docs/docs-layout.d.ts +111 -42
- package/dist/docs/docs-layout.js +371 -97
- package/dist/docs/docs-nav-tools.d.ts +11 -7
- package/dist/docs/docs-nav-tools.js +4 -3
- package/dist/docs/docs-nav.d.ts +53 -17
- package/dist/docs/docs-nav.js +125 -14
- package/dist/docs/docs-not-found.d.ts +61 -35
- package/dist/docs/docs-not-found.js +198 -52
- package/dist/docs/docs-page-header.d.ts +47 -30
- package/dist/docs/docs-page-header.js +114 -31
- package/dist/docs/docs-pager.d.ts +43 -27
- package/dist/docs/docs-pager.js +73 -23
- package/dist/docs/file-tree.d.ts +16 -6
- package/dist/docs/file-tree.js +19 -4
- package/dist/docs/index.d.ts +0 -7
- package/dist/docs/index.js +0 -7
- package/dist/docs/install-command.d.ts +7 -6
- package/dist/docs/install-command.js +8 -10
- package/dist/docs/mixins/docs-nav-tools.js +1 -1
- package/dist/docs/next-steps.d.ts +56 -23
- package/dist/docs/next-steps.js +121 -35
- package/dist/docs/page-actions.d.ts +68 -46
- package/dist/docs/page-actions.js +129 -21
- package/dist/docs/steps.d.ts +14 -11
- package/dist/docs/steps.js +36 -18
- package/dist/docs/ui-label.d.ts +7 -6
- package/dist/docs/ui-label.js +21 -8
- package/dist/finance/ledger.d.ts +33 -29
- package/dist/finance/ledger.js +190 -43
- package/dist/finance/payment-card.d.ts +43 -31
- package/dist/finance/payment-card.js +170 -67
- package/dist/landing/author-band.d.ts +57 -54
- package/dist/landing/author-band.js +218 -64
- package/dist/landing/case-study.d.ts +57 -57
- package/dist/landing/case-study.js +148 -17
- package/dist/landing/changelog-strip.d.ts +56 -36
- package/dist/landing/changelog-strip.js +176 -68
- package/dist/landing/closing-cta.d.ts +21 -41
- package/dist/landing/closing-cta.js +13 -19
- package/dist/landing/code-stage.d.ts +55 -47
- package/dist/landing/code-stage.js +198 -67
- package/dist/landing/contributor-wall.d.ts +4 -4
- package/dist/landing/contributor-wall.js +4 -4
- package/dist/landing/curriculum.d.ts +74 -45
- package/dist/landing/curriculum.js +220 -62
- package/dist/landing/drawn-chart.d.ts +18 -10
- package/dist/landing/drawn-chart.js +57 -26
- package/dist/landing/episode-player.d.ts +69 -43
- package/dist/landing/episode-player.js +213 -48
- package/dist/landing/event-ticker.d.ts +13 -7
- package/dist/landing/event-ticker.js +67 -32
- package/dist/landing/fan-out-diagram.d.ts +19 -8
- package/dist/landing/fan-out-diagram.js +60 -19
- package/dist/landing/faq-band.d.ts +30 -48
- package/dist/landing/faq-band.js +37 -30
- package/dist/landing/feature-band.d.ts +48 -76
- package/dist/landing/feature-band.js +71 -49
- package/dist/landing/flow-diagram.d.ts +16 -8
- package/dist/landing/flow-diagram.js +50 -18
- package/dist/landing/install-tabs.d.ts +16 -14
- package/dist/landing/install-tabs.js +87 -39
- package/dist/landing/landing-header.d.ts +75 -66
- package/dist/landing/landing-header.js +284 -57
- package/dist/landing/landing-hero.d.ts +59 -87
- package/dist/landing/landing-hero.js +157 -128
- package/dist/landing/landing-section.d.ts +0 -9
- package/dist/landing/landing-section.js +1 -2
- package/dist/landing/logo-cloud.d.ts +26 -9
- package/dist/landing/logo-cloud.js +62 -18
- package/dist/landing/phone-fan.d.ts +15 -7
- package/dist/landing/phone-fan.js +60 -17
- package/dist/landing/price-list.d.ts +29 -22
- package/dist/landing/price-list.js +175 -77
- package/dist/landing/pricing-band.d.ts +46 -53
- package/dist/landing/pricing-band.js +167 -51
- package/dist/landing/product-frame.d.ts +44 -42
- package/dist/landing/product-frame.js +182 -85
- package/dist/landing/proof-strip.d.ts +7 -2
- package/dist/landing/proof-strip.js +7 -2
- package/dist/landing/rails.d.ts +1 -1
- package/dist/landing/rails.js +1 -1
- package/dist/landing/segmented-stage.d.ts +19 -8
- package/dist/landing/segmented-stage.js +60 -16
- package/dist/landing/sequence-diagram.d.ts +18 -8
- package/dist/landing/sequence-diagram.js +49 -18
- package/dist/landing/site-footer.d.ts +89 -68
- package/dist/landing/site-footer.js +344 -111
- package/dist/landing/site-header.d.ts +118 -80
- package/dist/landing/site-header.js +482 -67
- package/dist/landing/sponsor-wall.d.ts +34 -15
- package/dist/landing/sponsor-wall.js +111 -34
- package/dist/landing/stat-strip.d.ts +7 -9
- package/dist/landing/stat-strip.js +57 -22
- package/dist/landing/step-list.d.ts +18 -21
- package/dist/landing/step-list.js +132 -38
- package/dist/landing/tabbed-stage.d.ts +23 -15
- package/dist/landing/tabbed-stage.js +103 -21
- package/dist/landing/testimonial-band.d.ts +58 -61
- package/dist/landing/testimonial-band.js +209 -71
- package/dist/landing/typed-terminal.d.ts +9 -6
- package/dist/landing/typed-terminal.js +16 -5
- package/dist/landing/usage-estimate.d.ts +83 -74
- package/dist/landing/usage-estimate.js +254 -113
- package/dist/landing/utils/has-parts.d.ts +17 -0
- package/dist/landing/utils/has-parts.js +24 -0
- package/dist/map/map-canvas.d.ts +15 -16
- package/dist/map/map-canvas.js +40 -24
- package/dist/map/map.d.ts +42 -33
- package/dist/map/map.js +149 -38
- package/dist/mixins/aria-checked.d.ts +1 -4
- package/dist/mixins/aria-checked.js +1 -4
- package/dist/mixins/clear-field.d.ts +2 -4
- package/dist/mixins/clear-field.js +2 -4
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.js +2 -0
- package/dist/schedule/agenda.d.ts +69 -41
- package/dist/schedule/agenda.js +273 -134
- package/dist/schedule/day-strip.d.ts +38 -26
- package/dist/schedule/day-strip.js +119 -88
- package/dist/test/map.d.ts +1 -1
- package/dist/test/map.js +1 -6
- package/dist/test/reels.js +1 -1
- package/dist/test/stories.js +2 -2
- package/dist/travel/boarding-pass.d.ts +94 -70
- package/dist/travel/boarding-pass.js +341 -144
- package/dist/travel/car-offer.d.ts +109 -49
- package/dist/travel/car-offer.js +424 -64
- package/dist/travel/fare-options.d.ts +58 -34
- package/dist/travel/fare-options.js +210 -69
- package/dist/travel/flight-itinerary.d.ts +62 -55
- package/dist/travel/flight-itinerary.js +230 -55
- package/dist/travel/flight-option.d.ts +65 -33
- package/dist/travel/flight-option.js +250 -69
- package/dist/travel/flight-segment.d.ts +121 -70
- package/dist/travel/flight-segment.js +358 -96
- package/dist/travel/package-savings.d.ts +79 -39
- package/dist/travel/package-savings.js +309 -65
- package/dist/travel/price-breakdown.d.ts +30 -22
- package/dist/travel/price-breakdown.js +72 -17
- package/dist/travel/rating-breakdown.d.ts +25 -18
- package/dist/travel/rating-breakdown.js +60 -23
- package/dist/travel/seat-map.d.ts +29 -22
- package/dist/travel/seat-map.js +140 -78
- package/dist/travel/trip-timeline.d.ts +77 -39
- package/dist/travel/trip-timeline.js +316 -107
- package/dist/utils/eyebrow.d.ts +2 -2
- package/dist/utils/eyebrow.js +3 -3
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/video/episode-list.d.ts +22 -14
- package/dist/video/episode-list.js +89 -53
- package/dist/video/reel-feed.d.ts +21 -15
- package/dist/video/reel-feed.js +59 -24
- package/dist/video/story-viewer.d.ts +6 -5
- package/dist/video/story-viewer.js +84 -53
- package/dist/video/title-hero.d.ts +8 -8
- package/dist/video/title-hero.js +48 -34
- package/dist/video/video-card.d.ts +34 -20
- package/dist/video/video-card.js +119 -76
- package/dist/video/video-player.d.ts +17 -14
- package/dist/video/video-player.js +68 -30
- package/dist/video/video-shelf.d.ts +26 -14
- package/dist/video/video-shelf.js +88 -50
- package/package.json +4 -2
- package/dist/docs/callout.d.ts +0 -46
- package/dist/docs/callout.js +0 -61
- package/dist/docs/code-block.d.ts +0 -74
- package/dist/utils/field-parts.d.ts +0 -26
- package/dist/utils/field-parts.js +0 -12
- /package/dist/{docs/mixins → mixins}/copy-feedback.d.ts +0 -0
- /package/dist/{docs/mixins → mixins}/copy-feedback.js +0 -0
- /package/dist/{docs/mixins → mixins}/toc-spy.d.ts +0 -0
- /package/dist/{docs/mixins → mixins}/toc-spy.js +0 -0
- /package/dist/{docs/utils → utils}/reveal-in-scroller.d.ts +0 -0
- /package/dist/{docs/utils → utils}/reveal-in-scroller.js +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
2
|
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
3
3
|
import { keyframes } from "@sdxc/u/animation";
|
|
4
|
-
import { raw } from "@sdxc/u/general";
|
|
4
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
5
5
|
import { motionSafe } from "@sdxc/u/responsive";
|
|
6
|
+
import { when } from "@sdxc/u/state";
|
|
6
7
|
import { landingSurface } from "../styles/landing.js";
|
|
7
8
|
import { MotionLoop } from "./motion-loop.js";
|
|
8
9
|
/** Length of one loop: the figure draws, holds the finished chart, then resets. */
|
|
@@ -46,6 +47,8 @@ const GROW_EASING = "cubic-bezier(0.2, 0.7, 0.2, 1)";
|
|
|
46
47
|
const PAUSE_CLEARANCE = "2.75rem";
|
|
47
48
|
/** Locale the headline number formats in when `metric.locale` is omitted. */
|
|
48
49
|
const DEFAULT_LOCALE = "en-US";
|
|
50
|
+
/** Selects a chart's headline metric among the surface's children. */
|
|
51
|
+
const METRIC = "[data-drawn-chart-part='metric']";
|
|
49
52
|
/**
|
|
50
53
|
* Renders the figure on a raised surface inside a {@link MotionLoop}. The markup is the
|
|
51
54
|
* finished figure: full bars or line and the real formatted number, which is what reduced
|
|
@@ -56,40 +59,47 @@ const DEFAULT_LOCALE = "en-US";
|
|
|
56
59
|
* @example
|
|
57
60
|
* <DrawnChart
|
|
58
61
|
* aria-label="Median time between checks, by how often a feed posts"
|
|
59
|
-
* metric={{ value: 15, suffix: " min", label: "Between checks of an hourly feed" }}
|
|
60
62
|
* series={[{ label: "Hourly", value: 15, display: "15 min" }, { label: "Daily", value: 240, display: "4 h" }]}
|
|
61
63
|
* highlight={0}
|
|
62
|
-
*
|
|
64
|
+
* >
|
|
65
|
+
* <DrawnChart.Metric value={15} suffix=" min">Between checks of an hourly feed</DrawnChart.Metric>
|
|
66
|
+
* </DrawnChart>
|
|
63
67
|
*/
|
|
64
68
|
export function DrawnChart(handle) {
|
|
65
69
|
return () => {
|
|
66
|
-
let { "aria-label": label,
|
|
70
|
+
let { "aria-label": label, children, highlight, max, mix, pauseLabel, series, variant, ...rest } = handle.props;
|
|
67
71
|
let scale = max ?? Math.max(0, ...series.map((datum) => datum.value));
|
|
68
|
-
let chart = (variant ?? "bars") === "line" ? (_jsx(LineChart, { label: label, series: series, scale: scale, highlight: highlight })) : (_jsx(BarChart, { label: label, series: series, scale: scale, highlight: highlight
|
|
72
|
+
let chart = (variant ?? "bars") === "line" ? (_jsx(LineChart, { label: label, series: series, scale: scale, highlight: highlight })) : (_jsx(BarChart, { label: label, series: series, scale: scale, highlight: highlight }));
|
|
69
73
|
return (_jsx(MotionLoop, { ...rest, pauseLabel: pauseLabel, placement: "start-end", mix: mix, children: _jsxs("div", { "data-slot": "drawn-chart", mix: [
|
|
70
74
|
landingSurface(),
|
|
71
75
|
raw({ display: "grid", gap: "1.5rem", padding: "clamp(1.25rem, 4cqi, 2rem)" }),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
raw({
|
|
75
|
-
margin: "0",
|
|
76
|
-
paddingBlockStart: "1rem",
|
|
77
|
-
borderBlockStart: "1px solid var(--ui-landing-hairline, var(--ui-neutral-border))",
|
|
78
|
-
}),
|
|
79
|
-
], children: footnote })) : null] }) }));
|
|
76
|
+
when(`&:not(:has(> ${METRIC})) [data-drawn-chart-clear]`, raw({ paddingInlineEnd: PAUSE_CLEARANCE })),
|
|
77
|
+
], children: [children, chart] }) }));
|
|
80
78
|
};
|
|
81
79
|
}
|
|
82
80
|
/**
|
|
83
|
-
* The large number over
|
|
84
|
-
*
|
|
85
|
-
*
|
|
81
|
+
* The large headline number over what it measures, set over the chart wherever it is written.
|
|
82
|
+
* An integer value also gets a decorative counter whose `::before` steps through precomputed
|
|
83
|
+
* formatted frames while motion is allowed; the real number stays in the DOM as text.
|
|
84
|
+
*
|
|
85
|
+
* @param handle Runtime handle carrying the host `<div>`'s props and the number.
|
|
86
|
+
* @returns The render function producing the metric.
|
|
87
|
+
* @example <DrawnChart.Metric value={15} suffix=" min">Between checks</DrawnChart.Metric>
|
|
86
88
|
*/
|
|
87
|
-
function
|
|
89
|
+
DrawnChart.Metric = function DrawnChartMetric(handle) {
|
|
88
90
|
return () => {
|
|
89
|
-
let {
|
|
90
|
-
let
|
|
91
|
-
let
|
|
92
|
-
|
|
91
|
+
let { children, format, locale, mix, prefix, suffix, value, ...rest } = handle.props;
|
|
92
|
+
let metric = { value, format, locale, prefix, suffix };
|
|
93
|
+
let text = formatMetric(metric, value);
|
|
94
|
+
let counts = Number.isInteger(value) && value !== 0;
|
|
95
|
+
return (_jsxs("div", { ...rest, "data-slot": "drawn-chart-metric", "data-drawn-chart-part": "metric", mix: mergeMix([
|
|
96
|
+
raw({
|
|
97
|
+
order: "-1",
|
|
98
|
+
display: "grid",
|
|
99
|
+
gap: "0.25rem",
|
|
100
|
+
paddingInlineEnd: PAUSE_CLEARANCE,
|
|
101
|
+
}),
|
|
102
|
+
], mix), children: [_jsxs("p", { "data-slot": "drawn-chart-number", mix: [
|
|
93
103
|
raw({
|
|
94
104
|
position: "relative",
|
|
95
105
|
margin: "0",
|
|
@@ -100,9 +110,31 @@ function Headline(handle) {
|
|
|
100
110
|
fontVariantNumeric: "tabular-nums",
|
|
101
111
|
color: "var(--ui-neutral-fg-emphasis)",
|
|
102
112
|
}),
|
|
103
|
-
], children: [counts ? _jsx(Counter, { metric: metric, text: text }) : null, _jsx("span", { "data-slot": "drawn-chart-number-text", mix: [counts ? motionSafe(visuallyHidden()) : []], children: text })] }), _jsx("p", { mix: [small(), raw({ margin: "0" })], children:
|
|
113
|
+
], children: [counts ? _jsx(Counter, { metric: metric, text: text }) : null, _jsx("span", { "data-slot": "drawn-chart-number-text", mix: [counts ? motionSafe(visuallyHidden()) : []], children: text })] }), _jsx("p", { mix: [small(), raw({ margin: "0" })], children: children })] }));
|
|
104
114
|
};
|
|
105
|
-
}
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* A note under the chart on a ruled line, such as the period or the source of the numbers.
|
|
118
|
+
* It sits under the chart wherever it is written.
|
|
119
|
+
*
|
|
120
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
121
|
+
* @returns The render function producing the note.
|
|
122
|
+
* @example <DrawnChart.Footnote>Median over 30 days</DrawnChart.Footnote>
|
|
123
|
+
*/
|
|
124
|
+
DrawnChart.Footnote = function DrawnChartFootnote(handle) {
|
|
125
|
+
return () => {
|
|
126
|
+
let { mix, ...rest } = handle.props;
|
|
127
|
+
return (_jsx("p", { ...rest, "data-slot": "drawn-chart-footnote", "data-drawn-chart-part": "footnote", mix: mergeMix([
|
|
128
|
+
small(),
|
|
129
|
+
raw({
|
|
130
|
+
order: "1",
|
|
131
|
+
margin: "0",
|
|
132
|
+
paddingBlockStart: "1rem",
|
|
133
|
+
borderBlockStart: "1px solid var(--ui-landing-hairline, var(--ui-neutral-border))",
|
|
134
|
+
}),
|
|
135
|
+
], mix) }));
|
|
136
|
+
};
|
|
137
|
+
};
|
|
106
138
|
/**
|
|
107
139
|
* The counting number, drawn only by a pseudo-element and hidden from assistive technology.
|
|
108
140
|
* Its resting content is the finished number, so a browser that skips animating `content`
|
|
@@ -177,7 +209,7 @@ function share(value, scale) {
|
|
|
177
209
|
*/
|
|
178
210
|
function BarChart(handle) {
|
|
179
211
|
return () => {
|
|
180
|
-
let {
|
|
212
|
+
let { highlight, label, scale, series } = handle.props;
|
|
181
213
|
let gap = series.length > 0 ? Math.min(MAX_BAR_GAP, BAR_STAGGER_SPAN / series.length) : 0;
|
|
182
214
|
return (_jsx("ol", { "aria-label": label, "data-slot": "drawn-chart-bars", mix: [
|
|
183
215
|
raw({ display: "grid", gap: "0.875rem", margin: "0", padding: "0", listStyle: "none" }),
|
|
@@ -185,14 +217,13 @@ function BarChart(handle) {
|
|
|
185
217
|
let lit = index === highlight;
|
|
186
218
|
let name = `ui-drawn-chart-bar-${series.length}-${index}`;
|
|
187
219
|
let start = DRAW_FROM + index * gap;
|
|
188
|
-
return (_jsxs("li", { mix: [raw({ display: "grid", gap: "0.375rem" })], children: [_jsxs("span", { mix: [
|
|
220
|
+
return (_jsxs("li", { mix: [raw({ display: "grid", gap: "0.375rem" })], children: [_jsxs("span", { "data-drawn-chart-clear": index === 0 ? "" : undefined, mix: [
|
|
189
221
|
raw({
|
|
190
222
|
display: "flex",
|
|
191
223
|
justifyContent: "space-between",
|
|
192
224
|
alignItems: "baseline",
|
|
193
225
|
gap: "0.75rem",
|
|
194
226
|
}),
|
|
195
|
-
clearance && index === 0 ? raw({ paddingInlineEnd: PAUSE_CLEARANCE }) : [],
|
|
196
227
|
], children: [_jsx("span", { mix: [caption(lit)], children: datum.label }), _jsx("span", { mix: [caption(lit), raw({ flexShrink: "0", fontVariantNumeric: "tabular-nums" })], children: datum.display ?? datum.value })] }), _jsx("span", { "aria-hidden": "true", mix: [
|
|
197
228
|
raw({
|
|
198
229
|
display: "block",
|
|
@@ -1,62 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* An episode player for a podcast or a read-aloud letter: the browser's own
|
|
3
|
-
* controls, a list of chapters and a timed transcript. Every time is a media-fragment
|
|
4
|
-
*
|
|
2
|
+
* An episode player for a podcast or a read-aloud letter, built from parts: the browser's own
|
|
3
|
+
* `<audio>` controls, a list of chapters and a timed transcript. Every time is a media-fragment
|
|
4
|
+
* link that plays from that point with no script; the island makes it seek the player instead.
|
|
5
5
|
*
|
|
6
6
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
7
|
* @copyright Sergio Xalambrí 2026
|
|
8
8
|
*/
|
|
9
9
|
import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
import { Heading } from "../components/heading.js";
|
|
10
11
|
/**
|
|
11
12
|
* Prop types for {@link EpisodePlayer}.
|
|
12
13
|
*/
|
|
13
14
|
export declare namespace EpisodePlayer {
|
|
14
|
-
/** One chapter: where it starts and what it is called. */
|
|
15
|
-
interface Chapter {
|
|
16
|
-
/** Seconds from the start of the audio. */
|
|
17
|
-
start: number;
|
|
18
|
-
/** The chapter's name, the link text a reader presses to play from its start. */
|
|
19
|
-
title: RemixNode;
|
|
20
|
-
}
|
|
21
|
-
/** One transcript passage: where it starts, who speaks, and what they say. */
|
|
22
|
-
interface Cue {
|
|
23
|
-
/** Seconds from the start of the audio. */
|
|
24
|
-
start: number;
|
|
25
|
-
/** The speaker's name, shown once at the start of the passage. */
|
|
26
|
-
speaker?: RemixNode;
|
|
27
|
-
/** What is said, set after the time link and the speaker. */
|
|
28
|
-
text: RemixNode;
|
|
29
|
-
}
|
|
30
15
|
/**
|
|
31
16
|
* Props accepted by {@link EpisodePlayer}.
|
|
32
17
|
*/
|
|
33
|
-
interface Props extends
|
|
18
|
+
interface Props extends TagProps<"div"> {
|
|
34
19
|
/** Address of the audio file; every time link appends `#t=<whole seconds>` to it. */
|
|
35
20
|
src: string;
|
|
21
|
+
/**
|
|
22
|
+
* The player's parts in reading order: a {@link EpisodePlayer.Header}, the
|
|
23
|
+
* {@link EpisodePlayer.Audio}, {@link EpisodePlayer.Chapters}, a
|
|
24
|
+
* {@link EpisodePlayer.Transcript} and a {@link EpisodePlayer.Note}.
|
|
25
|
+
*/
|
|
26
|
+
children: RemixNode;
|
|
27
|
+
}
|
|
28
|
+
/** What {@link EpisodePlayer} resolves for its time links. */
|
|
29
|
+
interface Context {
|
|
30
|
+
src: string;
|
|
31
|
+
}
|
|
32
|
+
/** Every native `<audio>` attribute, plus the file's media type. */
|
|
33
|
+
interface AudioProps extends TagProps<"audio"> {
|
|
36
34
|
/** Media type of the file, such as `audio/mpeg`, so a browser skips a format it cannot play. */
|
|
37
35
|
type?: string;
|
|
38
|
-
/** The episode's title, rendered as a heading at the surrounding level. */
|
|
39
|
-
title: RemixNode;
|
|
40
|
-
/** A line under the title, such as the number, date and running time. */
|
|
41
|
-
meta?: RemixNode;
|
|
42
|
-
/** Chapters in playing order; the list is left out when empty. */
|
|
43
|
-
chapters?: readonly Chapter[];
|
|
44
|
-
/** Transcript passages in playing order; the disclosure is left out when empty. */
|
|
45
|
-
transcript?: readonly Cue[];
|
|
46
|
-
/** Accessible name of the chapter list, such as "Chapters". */
|
|
47
|
-
chaptersLabel: string;
|
|
48
|
-
/** Visible label of the transcript disclosure, such as "Read the transcript". */
|
|
49
|
-
transcriptLabel: string;
|
|
50
36
|
/** The WebVTT captions file for the audio, which assistive technology can read out. */
|
|
51
37
|
captions: {
|
|
52
38
|
src: string;
|
|
53
39
|
srclang: string;
|
|
54
40
|
label: string;
|
|
55
41
|
};
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
/** What a browser without audio support shows, such as a download link. */
|
|
43
|
+
children?: RemixNode;
|
|
44
|
+
}
|
|
45
|
+
/** Every native `<li>` attribute, plus where the chapter starts. */
|
|
46
|
+
interface ChapterProps extends TagProps<"li"> {
|
|
47
|
+
/** Seconds from the start of the audio. */
|
|
48
|
+
start: number;
|
|
49
|
+
/** The chapter's name, the link text a reader presses to play from its start. */
|
|
50
|
+
children: RemixNode;
|
|
51
|
+
}
|
|
52
|
+
/** Every native `<p>` attribute, plus where the passage starts. */
|
|
53
|
+
interface CueProps extends TagProps<"p"> {
|
|
54
|
+
/** Seconds from the start of the audio. */
|
|
55
|
+
start: number;
|
|
56
|
+
/** An optional {@link EpisodePlayer.Speaker}, then what is said. */
|
|
57
|
+
children: RemixNode;
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
/**
|
|
@@ -67,18 +65,46 @@ export declare namespace EpisodePlayer {
|
|
|
67
65
|
*/
|
|
68
66
|
export declare function formatEpisodeTime(seconds: number): string;
|
|
69
67
|
/**
|
|
70
|
-
* The
|
|
71
|
-
*
|
|
72
|
-
* to seek in place and mark what plays.
|
|
68
|
+
* The player's column: its parts in the order written, each time link opening the file at its
|
|
69
|
+
* moment with no script. Map {@link EpisodeSync} (`@sdxc/ui/landing/episode-player`) in the
|
|
70
|
+
* browser entry to seek in place and mark what plays.
|
|
73
71
|
*
|
|
74
72
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
75
73
|
* @returns The render function producing the player.
|
|
76
74
|
* @example
|
|
77
|
-
* <EpisodePlayer src="/audio/63.mp3"
|
|
78
|
-
*
|
|
79
|
-
*
|
|
75
|
+
* <EpisodePlayer src="/audio/63.mp3">
|
|
76
|
+
* <EpisodePlayer.Header>
|
|
77
|
+
* <EpisodePlayer.Title>No. 63</EpisodePlayer.Title>
|
|
78
|
+
* <EpisodePlayer.Meta>Episode 63 · 14:20</EpisodePlayer.Meta>
|
|
79
|
+
* </EpisodePlayer.Header>
|
|
80
|
+
* <EpisodePlayer.Audio type="audio/mpeg" captions={{ src: "/audio/63.vtt", srclang: "en", label: "English" }}>
|
|
81
|
+
* <a href="/audio/63.mp3">Download</a>
|
|
82
|
+
* </EpisodePlayer.Audio>
|
|
83
|
+
* <EpisodePlayer.Chapters aria-label="Chapters">
|
|
84
|
+
* <EpisodePlayer.Chapter start={0}>Opening</EpisodePlayer.Chapter>
|
|
85
|
+
* </EpisodePlayer.Chapters>
|
|
86
|
+
* <EpisodePlayer.Transcript>
|
|
87
|
+
* <EpisodePlayer.Summary>Read the transcript</EpisodePlayer.Summary>
|
|
88
|
+
* <EpisodePlayer.Cue start={0}>
|
|
89
|
+
* <EpisodePlayer.Speaker>Tove</EpisodePlayer.Speaker> This is Undercurrent.
|
|
90
|
+
* </EpisodePlayer.Cue>
|
|
91
|
+
* </EpisodePlayer.Transcript>
|
|
92
|
+
* </EpisodePlayer>
|
|
80
93
|
*/
|
|
81
|
-
export declare function EpisodePlayer(handle: Handle<EpisodePlayer.Props>): () => import("remix/component").RemixElement;
|
|
94
|
+
export declare function EpisodePlayer(handle: Handle<EpisodePlayer.Props, EpisodePlayer.Context>): () => import("remix/component").RemixElement;
|
|
95
|
+
export declare namespace EpisodePlayer {
|
|
96
|
+
var Header: (handle: Handle<TagProps<"div">>) => () => import("remix/component").RemixElement;
|
|
97
|
+
var Title: (handle: Handle<Heading.Props>) => () => import("remix/component").RemixElement;
|
|
98
|
+
var Meta: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
|
|
99
|
+
var Audio: (handle: Handle<EpisodePlayer.AudioProps>) => () => import("remix/component").RemixElement;
|
|
100
|
+
var Chapters: (handle: Handle<TagProps<"nav">>) => () => import("remix/component").RemixElement;
|
|
101
|
+
var Chapter: (handle: Handle<EpisodePlayer.ChapterProps>) => () => import("remix/component").RemixElement;
|
|
102
|
+
var Transcript: (handle: Handle<TagProps<"details">>) => () => import("remix/component").RemixElement;
|
|
103
|
+
var Summary: (handle: Handle<TagProps<"summary">>) => () => import("remix/component").RemixElement;
|
|
104
|
+
var Cue: (handle: Handle<EpisodePlayer.CueProps>) => () => import("remix/component").RemixElement;
|
|
105
|
+
var Speaker: (handle: Handle<TagProps<"strong">>) => () => import("remix/component").RemixElement;
|
|
106
|
+
var Note: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
|
|
107
|
+
}
|
|
82
108
|
/**
|
|
83
109
|
* The island inside every {@link EpisodePlayer}: a hidden marker running {@link mediaSync},
|
|
84
110
|
* so a time link seeks and plays, and the playing chapter and passage carry `aria-current`.
|
|
@@ -40,63 +40,228 @@ function timeLink() {
|
|
|
40
40
|
];
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* The
|
|
44
|
-
*
|
|
45
|
-
* to seek in place and mark what plays.
|
|
43
|
+
* The player's column: its parts in the order written, each time link opening the file at its
|
|
44
|
+
* moment with no script. Map {@link EpisodeSync} (`@sdxc/ui/landing/episode-player`) in the
|
|
45
|
+
* browser entry to seek in place and mark what plays.
|
|
46
46
|
*
|
|
47
47
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
48
48
|
* @returns The render function producing the player.
|
|
49
49
|
* @example
|
|
50
|
-
* <EpisodePlayer src="/audio/63.mp3"
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* <EpisodePlayer src="/audio/63.mp3">
|
|
51
|
+
* <EpisodePlayer.Header>
|
|
52
|
+
* <EpisodePlayer.Title>No. 63</EpisodePlayer.Title>
|
|
53
|
+
* <EpisodePlayer.Meta>Episode 63 · 14:20</EpisodePlayer.Meta>
|
|
54
|
+
* </EpisodePlayer.Header>
|
|
55
|
+
* <EpisodePlayer.Audio type="audio/mpeg" captions={{ src: "/audio/63.vtt", srclang: "en", label: "English" }}>
|
|
56
|
+
* <a href="/audio/63.mp3">Download</a>
|
|
57
|
+
* </EpisodePlayer.Audio>
|
|
58
|
+
* <EpisodePlayer.Chapters aria-label="Chapters">
|
|
59
|
+
* <EpisodePlayer.Chapter start={0}>Opening</EpisodePlayer.Chapter>
|
|
60
|
+
* </EpisodePlayer.Chapters>
|
|
61
|
+
* <EpisodePlayer.Transcript>
|
|
62
|
+
* <EpisodePlayer.Summary>Read the transcript</EpisodePlayer.Summary>
|
|
63
|
+
* <EpisodePlayer.Cue start={0}>
|
|
64
|
+
* <EpisodePlayer.Speaker>Tove</EpisodePlayer.Speaker> This is Undercurrent.
|
|
65
|
+
* </EpisodePlayer.Cue>
|
|
66
|
+
* </EpisodePlayer.Transcript>
|
|
67
|
+
* </EpisodePlayer>
|
|
53
68
|
*/
|
|
54
69
|
export function EpisodePlayer(handle) {
|
|
55
70
|
return () => {
|
|
56
|
-
let {
|
|
57
|
-
|
|
58
|
-
return (_jsxs("div", { ...rest, "data-slot": "episode-player", mix: mergeMix([raw({ display: "flex", flexDirection: "column", gap: "1.25rem", minInlineSize: "0" })], mix), children: [
|
|
59
|
-
fg("neutral.muted"),
|
|
60
|
-
raw({ margin: "0.25rem 0 0", fontVariantNumeric: "tabular-nums" }),
|
|
61
|
-
], children: meta })) : null] }), _jsxs("audio", { controls: true, preload: "metadata", "data-slot": "episode-player-audio", mix: [raw({ display: "block", inlineSize: "100%" })], children: [_jsx("source", { src: src, type: type }), _jsx("track", { kind: "captions", src: captions.src, srclang: captions.srclang, label: captions.label }), fallback] }), _jsx(EpisodeSync, {}), chapters.length > 0 ? (_jsx("nav", { "aria-label": chaptersLabel, "data-slot": "episode-player-chapters", children: _jsx("ol", { mix: [
|
|
62
|
-
raw({
|
|
63
|
-
margin: "0",
|
|
64
|
-
padding: "0",
|
|
65
|
-
listStyle: "none",
|
|
66
|
-
borderBlockStart: `1px solid ${HAIRLINE}`,
|
|
67
|
-
}),
|
|
68
|
-
], children: chapters.map((chapter) => (_jsx("li", { mix: [raw({ borderBlockEnd: `1px solid ${HAIRLINE}` })], children: _jsxs("a", { href: at(chapter.start), "data-start": chapter.start, mix: [
|
|
69
|
-
raw({
|
|
70
|
-
display: "grid",
|
|
71
|
-
gridTemplateColumns: "4.5rem minmax(0, 1fr)",
|
|
72
|
-
gap: "1rem",
|
|
73
|
-
paddingBlock: "0.625rem",
|
|
74
|
-
color: "var(--ui-neutral-fg)",
|
|
75
|
-
textDecoration: "none",
|
|
76
|
-
}),
|
|
77
|
-
hover(raw({ color: "var(--ui-brand-fg)" })),
|
|
78
|
-
focusVisible(raw({ outline: "2px solid var(--ui-focus-ring, var(--ui-brand-fg))" })),
|
|
79
|
-
when('&[aria-current="true"]', raw({ color: "var(--ui-brand-fg)", fontWeight: "600" })),
|
|
80
|
-
], children: [_jsx("time", { dateTime: isoDuration(chapter.start), mix: [raw({ fontVariantNumeric: "tabular-nums", opacity: "0.75" })], children: formatEpisodeTime(chapter.start) }), _jsx("span", { children: chapter.title })] }) }, chapter.start))) }) })) : null, transcript.length > 0 ? (_jsxs("details", { "data-slot": "episode-player-transcript", children: [_jsx("summary", { mix: [
|
|
81
|
-
raw({ cursor: "pointer", fontWeight: "600", inlineSize: "fit-content" }),
|
|
82
|
-
focusVisible(raw({ outline: "2px solid var(--ui-focus-ring, var(--ui-brand-fg))" })),
|
|
83
|
-
], children: transcriptLabel }), _jsx("div", { mix: [
|
|
84
|
-
raw({
|
|
85
|
-
display: "flex",
|
|
86
|
-
flexDirection: "column",
|
|
87
|
-
gap: "1rem",
|
|
88
|
-
marginBlockStart: "1rem",
|
|
89
|
-
}),
|
|
90
|
-
], children: transcript.map((cue) => (_jsxs("p", { "data-slot": "episode-player-cue", "data-cue": cue.start, mix: [
|
|
91
|
-
raw({
|
|
92
|
-
margin: "0",
|
|
93
|
-
paddingInlineStart: "0.875rem",
|
|
94
|
-
borderInlineStart: "2px solid transparent",
|
|
95
|
-
}),
|
|
96
|
-
when('&[aria-current="true"]', raw({ borderInlineStartColor: "var(--ui-brand-fg)" })),
|
|
97
|
-
], children: [_jsx("a", { href: at(cue.start), "data-start": cue.start, mix: timeLink(), children: _jsx("time", { dateTime: isoDuration(cue.start), children: formatEpisodeTime(cue.start) }) }), " ", cue.speaker ? (_jsx("strong", { mix: [raw({ fontWeight: "600" })], children: cue.speaker })) : null, " ", cue.text] }, cue.start))) })] })) : null, note ? _jsx("p", { mix: [fg("neutral.muted"), raw({ margin: "0" })], children: note }) : null] }));
|
|
71
|
+
let { children, mix, src, ...rest } = handle.props;
|
|
72
|
+
handle.context.set({ src });
|
|
73
|
+
return (_jsxs("div", { ...rest, "data-slot": "episode-player", mix: mergeMix([raw({ display: "flex", flexDirection: "column", gap: "1.25rem", minInlineSize: "0" })], mix), children: [children, _jsx(EpisodeSync, {})] }));
|
|
98
74
|
};
|
|
99
75
|
}
|
|
76
|
+
/** The `#t=` link to `start` seconds into the player's file. */
|
|
77
|
+
function timeHref(handle, start) {
|
|
78
|
+
let context = handle.context.get(EpisodePlayer);
|
|
79
|
+
return `${context?.src ?? ""}#t=${Math.floor(start)}`;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The episode's title over its meta line, held close together apart from the rest.
|
|
83
|
+
*
|
|
84
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
85
|
+
* @returns The render function producing the header.
|
|
86
|
+
* @example
|
|
87
|
+
* <EpisodePlayer.Header>
|
|
88
|
+
* <EpisodePlayer.Title>No. 63</EpisodePlayer.Title>
|
|
89
|
+
* </EpisodePlayer.Header>
|
|
90
|
+
*/
|
|
91
|
+
EpisodePlayer.Header = function EpisodePlayerHeader(handle) {
|
|
92
|
+
return () => _jsx("div", { ...handle.props, "data-slot": "episode-player-header" });
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* The episode's title as a heading at the surrounding level.
|
|
96
|
+
*
|
|
97
|
+
* @param handle Runtime handle carrying the heading's props.
|
|
98
|
+
* @returns The render function producing the heading.
|
|
99
|
+
* @example <EpisodePlayer.Title>No. 63</EpisodePlayer.Title>
|
|
100
|
+
*/
|
|
101
|
+
EpisodePlayer.Title = function EpisodePlayerTitle(handle) {
|
|
102
|
+
return () => {
|
|
103
|
+
let { mix, ...rest } = handle.props;
|
|
104
|
+
return (_jsx(Heading, { ...rest, "data-slot": "episode-player-title", mix: mergeMix([raw({ margin: "0", fontSize: "1.25rem", lineHeight: "1.3" })], mix) }));
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* A muted line under the title in tabular figures, such as the number, date and running time.
|
|
109
|
+
*
|
|
110
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
111
|
+
* @returns The render function producing the line.
|
|
112
|
+
* @example <EpisodePlayer.Meta>Episode 63 · 14:20</EpisodePlayer.Meta>
|
|
113
|
+
*/
|
|
114
|
+
EpisodePlayer.Meta = function EpisodePlayerMeta(handle) {
|
|
115
|
+
return () => {
|
|
116
|
+
let { mix, ...rest } = handle.props;
|
|
117
|
+
return (_jsx("p", { ...rest, "data-slot": "episode-player-meta", mix: mergeMix([fg("neutral.muted"), raw({ margin: "0.25rem 0 0", fontVariantNumeric: "tabular-nums" })], mix) }));
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* The browser's own audio controls across the column, loading only metadata until played,
|
|
122
|
+
* with the episode's captions track; its children are the fallback for a browser without audio.
|
|
123
|
+
*
|
|
124
|
+
* @param handle Runtime handle carrying the host `<audio>`'s props.
|
|
125
|
+
* @returns The render function producing the player.
|
|
126
|
+
* @example
|
|
127
|
+
* <EpisodePlayer.Audio type="audio/mpeg" captions={{ src: "/audio/63.vtt", srclang: "en", label: "English" }}>
|
|
128
|
+
* <a href="/audio/63.mp3">Download</a>
|
|
129
|
+
* </EpisodePlayer.Audio>
|
|
130
|
+
*/
|
|
131
|
+
EpisodePlayer.Audio = function EpisodePlayerAudio(handle) {
|
|
132
|
+
return () => {
|
|
133
|
+
let { captions, children, mix, type, ...rest } = handle.props;
|
|
134
|
+
let context = handle.context.get(EpisodePlayer);
|
|
135
|
+
return (_jsxs("audio", { controls: true, preload: "metadata", ...rest, "data-slot": "episode-player-audio", mix: mergeMix([raw({ display: "block", inlineSize: "100%" })], mix), children: [_jsx("source", { src: context?.src, type: type }), _jsx("track", { kind: "captions", src: captions.src, srclang: captions.srclang, label: captions.label }), children] }));
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* The chapter list as a named navigation of ruled rows; give it an `aria-label` such as
|
|
140
|
+
* "Chapters". `--ui-landing-hairline` colours the rules.
|
|
141
|
+
*
|
|
142
|
+
* @param handle Runtime handle carrying the host `<nav>`'s props.
|
|
143
|
+
* @returns The render function producing the list.
|
|
144
|
+
* @example
|
|
145
|
+
* <EpisodePlayer.Chapters aria-label="Chapters">
|
|
146
|
+
* <EpisodePlayer.Chapter start={0}>Opening</EpisodePlayer.Chapter>
|
|
147
|
+
* </EpisodePlayer.Chapters>
|
|
148
|
+
*/
|
|
149
|
+
EpisodePlayer.Chapters = function EpisodePlayerChapters(handle) {
|
|
150
|
+
return () => {
|
|
151
|
+
let { children, ...rest } = handle.props;
|
|
152
|
+
return (_jsx("nav", { ...rest, "data-slot": "episode-player-chapters", children: _jsx("ol", { mix: [
|
|
153
|
+
raw({
|
|
154
|
+
margin: "0",
|
|
155
|
+
padding: "0",
|
|
156
|
+
listStyle: "none",
|
|
157
|
+
borderBlockStart: `1px solid ${HAIRLINE}`,
|
|
158
|
+
}),
|
|
159
|
+
], children: children }) }));
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* One chapter: its start time beside its name, the whole row a link that plays from there.
|
|
164
|
+
* The playing chapter takes the brand ink.
|
|
165
|
+
*
|
|
166
|
+
* @param handle Runtime handle carrying the host `<li>`'s props.
|
|
167
|
+
* @returns The render function producing the row.
|
|
168
|
+
* @example <EpisodePlayer.Chapter start={112}>Pressure</EpisodePlayer.Chapter>
|
|
169
|
+
*/
|
|
170
|
+
EpisodePlayer.Chapter = function EpisodePlayerChapter(handle) {
|
|
171
|
+
return () => {
|
|
172
|
+
let { children, mix, start, ...rest } = handle.props;
|
|
173
|
+
return (_jsx("li", { ...rest, "data-slot": "episode-player-chapter", mix: mergeMix([raw({ borderBlockEnd: `1px solid ${HAIRLINE}` })], mix), children: _jsxs("a", { href: timeHref(handle, start), "data-start": start, mix: [
|
|
174
|
+
raw({
|
|
175
|
+
display: "grid",
|
|
176
|
+
gridTemplateColumns: "4.5rem minmax(0, 1fr)",
|
|
177
|
+
gap: "1rem",
|
|
178
|
+
paddingBlock: "0.625rem",
|
|
179
|
+
color: "var(--ui-neutral-fg)",
|
|
180
|
+
textDecoration: "none",
|
|
181
|
+
}),
|
|
182
|
+
hover(raw({ color: "var(--ui-brand-fg)" })),
|
|
183
|
+
focusVisible(raw({ outline: "2px solid var(--ui-focus-ring, var(--ui-brand-fg))" })),
|
|
184
|
+
when('&[aria-current="true"]', raw({ color: "var(--ui-brand-fg)", fontWeight: "600" })),
|
|
185
|
+
], children: [_jsx("time", { dateTime: isoDuration(start), mix: [raw({ fontVariantNumeric: "tabular-nums", opacity: "0.75" })], children: formatEpisodeTime(start) }), _jsx("span", { children: children })] }) }));
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* The timed transcript in a closed disclosure: a {@link EpisodePlayer.Summary}, then one
|
|
190
|
+
* {@link EpisodePlayer.Cue} per passage.
|
|
191
|
+
*
|
|
192
|
+
* @param handle Runtime handle carrying the host `<details>`'s props.
|
|
193
|
+
* @returns The render function producing the disclosure.
|
|
194
|
+
* @example
|
|
195
|
+
* <EpisodePlayer.Transcript>
|
|
196
|
+
* <EpisodePlayer.Summary>Read the transcript</EpisodePlayer.Summary>
|
|
197
|
+
* </EpisodePlayer.Transcript>
|
|
198
|
+
*/
|
|
199
|
+
EpisodePlayer.Transcript = function EpisodePlayerTranscript(handle) {
|
|
200
|
+
return () => _jsx("details", { ...handle.props, "data-slot": "episode-player-transcript" });
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* The transcript disclosure's visible label, such as "Read the transcript".
|
|
204
|
+
*
|
|
205
|
+
* @param handle Runtime handle carrying the host `<summary>`'s props.
|
|
206
|
+
* @returns The render function producing the label.
|
|
207
|
+
* @example <EpisodePlayer.Summary>Read the transcript</EpisodePlayer.Summary>
|
|
208
|
+
*/
|
|
209
|
+
EpisodePlayer.Summary = function EpisodePlayerSummary(handle) {
|
|
210
|
+
return () => {
|
|
211
|
+
let { mix, ...rest } = handle.props;
|
|
212
|
+
return (_jsx("summary", { ...rest, "data-slot": "episode-player-summary", mix: mergeMix([
|
|
213
|
+
raw({ cursor: "pointer", fontWeight: "600", inlineSize: "fit-content" }),
|
|
214
|
+
focusVisible(raw({ outline: "2px solid var(--ui-focus-ring, var(--ui-brand-fg))" })),
|
|
215
|
+
], mix) }));
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* One transcript passage: a time link to its start, then its speaker and words. The playing
|
|
220
|
+
* passage carries a brand rule on its start edge.
|
|
221
|
+
*
|
|
222
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
223
|
+
* @returns The render function producing the passage.
|
|
224
|
+
* @example <EpisodePlayer.Cue start={0}>This is Undercurrent.</EpisodePlayer.Cue>
|
|
225
|
+
*/
|
|
226
|
+
EpisodePlayer.Cue = function EpisodePlayerCue(handle) {
|
|
227
|
+
return () => {
|
|
228
|
+
let { children, mix, start, ...rest } = handle.props;
|
|
229
|
+
return (_jsxs("p", { ...rest, "data-slot": "episode-player-cue", "data-cue": start, mix: mergeMix([
|
|
230
|
+
raw({
|
|
231
|
+
margin: "1rem 0 0",
|
|
232
|
+
paddingInlineStart: "0.875rem",
|
|
233
|
+
borderInlineStart: "2px solid transparent",
|
|
234
|
+
}),
|
|
235
|
+
when('&[aria-current="true"]', raw({ borderInlineStartColor: "var(--ui-brand-fg)" })),
|
|
236
|
+
], mix), children: [_jsx("a", { href: timeHref(handle, start), "data-start": start, mix: timeLink(), children: _jsx("time", { dateTime: isoDuration(start), children: formatEpisodeTime(start) }) }), " ", children] }));
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* The speaker's name at the start of a passage, in semibold.
|
|
241
|
+
*
|
|
242
|
+
* @param handle Runtime handle carrying the host `<strong>`'s props.
|
|
243
|
+
* @returns The render function producing the name.
|
|
244
|
+
* @example <EpisodePlayer.Speaker>Tove</EpisodePlayer.Speaker>
|
|
245
|
+
*/
|
|
246
|
+
EpisodePlayer.Speaker = function EpisodePlayerSpeaker(handle) {
|
|
247
|
+
return () => {
|
|
248
|
+
let { mix, ...rest } = handle.props;
|
|
249
|
+
return (_jsx("strong", { ...rest, "data-slot": "episode-player-speaker", mix: mergeMix([raw({ fontWeight: "600" })], mix) }));
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* A muted line under the player, such as a credit or a download link.
|
|
254
|
+
*
|
|
255
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
256
|
+
* @returns The render function producing the line.
|
|
257
|
+
* @example <EpisodePlayer.Note>Produced by Undercurrent</EpisodePlayer.Note>
|
|
258
|
+
*/
|
|
259
|
+
EpisodePlayer.Note = function EpisodePlayerNote(handle) {
|
|
260
|
+
return () => {
|
|
261
|
+
let { mix, ...rest } = handle.props;
|
|
262
|
+
return (_jsx("p", { ...rest, "data-slot": "episode-player-note", mix: mergeMix([fg("neutral.muted"), raw({ margin: "0" })], mix) }));
|
|
263
|
+
};
|
|
264
|
+
};
|
|
100
265
|
/**
|
|
101
266
|
* The island inside every {@link EpisodePlayer}: a hidden marker running {@link mediaSync},
|
|
102
267
|
* so a time link seeks and plays, and the playing chapter and passage carry `aria-current`.
|
|
@@ -37,19 +37,20 @@ export declare namespace EventTicker {
|
|
|
37
37
|
/**
|
|
38
38
|
* Props accepted by {@link EventTicker}.
|
|
39
39
|
*/
|
|
40
|
-
interface Props extends
|
|
40
|
+
interface Props extends TagProps<"div"> {
|
|
41
41
|
/** Accessible name of the feed's list. Required — the library ships no copy. */
|
|
42
42
|
"aria-label": string;
|
|
43
43
|
/** Accessible name of the pause toggle. */
|
|
44
44
|
pauseLabel?: string;
|
|
45
|
-
/** Header line over the feed, drawn beside a live dot. */
|
|
46
|
-
title?: RemixNode;
|
|
47
45
|
/** The events, oldest first; the feed renders them newest first. */
|
|
48
46
|
rows: readonly Row[];
|
|
49
47
|
/** The text of each status chip, such as `{ ok: "Passed", fail: "Failed", … }`. */
|
|
50
48
|
statusLabels: Record<Status, string>;
|
|
51
|
-
/**
|
|
52
|
-
|
|
49
|
+
/**
|
|
50
|
+
* {@link EventTicker.Title} and {@link EventTicker.Footnote}; the title always sits over
|
|
51
|
+
* the feed and the footnote under it, whatever order they are written in.
|
|
52
|
+
*/
|
|
53
|
+
children?: RemixNode;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
@@ -63,9 +64,14 @@ export declare namespace EventTicker {
|
|
|
63
64
|
* @example
|
|
64
65
|
* <EventTicker
|
|
65
66
|
* aria-label="Recent checks"
|
|
66
|
-
* title="Checkout flow"
|
|
67
67
|
* rows={[{ time: "09:40", label: "Run passed", status: "ok" }]}
|
|
68
68
|
* statusLabels={{ ok: "Passed", warn: "Slow", fail: "Failed", pending: "Running" }}
|
|
69
|
-
*
|
|
69
|
+
* >
|
|
70
|
+
* <EventTicker.Title>Checkout flow</EventTicker.Title>
|
|
71
|
+
* </EventTicker>
|
|
70
72
|
*/
|
|
71
73
|
export declare function EventTicker(handle: Handle<EventTicker.Props>): () => import("remix/component").RemixElement;
|
|
74
|
+
export declare namespace EventTicker {
|
|
75
|
+
var Title: (handle: Handle<TagProps<"div">>) => () => import("remix/component").RemixElement;
|
|
76
|
+
var Footnote: (handle: Handle<TagProps<"div">>) => () => import("remix/component").RemixElement;
|
|
77
|
+
}
|