@sdxc/ui 2026.11.27 → 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/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,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A course or book curriculum: parts with their totals, each a list of
|
|
3
|
-
* visitor can open
|
|
2
|
+
* A course or book curriculum assembled from parts: parts with their totals, each a list of
|
|
3
|
+
* numbered lessons a visitor can open for subtopics or a preview link, under a totals row,
|
|
4
4
|
* so "what's inside" reads at a glance and in depth without leaving the page.
|
|
5
5
|
*
|
|
6
6
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
7
|
* @copyright Sergio Xalambrí 2026
|
|
8
8
|
*/
|
|
9
|
-
import type { Handle, Props as TagProps
|
|
9
|
+
import type { Handle, Props as TagProps } from "remix/component";
|
|
10
|
+
import { Badge } from "../components/badge.js";
|
|
10
11
|
/**
|
|
11
12
|
* Prop types for {@link Curriculum} and its compound parts.
|
|
12
13
|
*/
|
|
@@ -16,64 +17,92 @@ export declare namespace Curriculum {
|
|
|
16
17
|
* other at every width (`stack`) for a course with many or long parts.
|
|
17
18
|
*/
|
|
18
19
|
type Layout = "columns" | "stack";
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/** Value {@link Curriculum} provides to its parts. */
|
|
21
|
+
interface Context {
|
|
22
|
+
/** How parts sit. */
|
|
23
|
+
layout: Layout;
|
|
24
|
+
}
|
|
25
|
+
/** Value {@link Curriculum.Lesson} provides to its row. */
|
|
26
|
+
interface LessonContext {
|
|
27
|
+
/** Whether the lesson opens, making its row a disclosure summary. */
|
|
28
|
+
expandable: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Every native `<div>` attribute of the curriculum, plus its arrangement. */
|
|
22
31
|
interface Props extends TagProps<"div"> {
|
|
23
32
|
/** Arrangement. Defaults to {@link DEFAULT_LAYOUT}. */
|
|
24
33
|
layout?: Layout;
|
|
25
|
-
/** Totals above the parts, such as a `StatStrip` of chapters, pages and hours. */
|
|
26
|
-
summary?: RemixNode;
|
|
27
|
-
/** {@link Curriculum.Part} children. */
|
|
28
|
-
children: RemixNode;
|
|
29
34
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
interface PartProps extends Omit<TagProps<"section">, "title"> {
|
|
34
|
-
/** The part's title, rendered as a heading at the ambient depth. */
|
|
35
|
-
title: RemixNode;
|
|
36
|
-
/** The part's totals, such as "5 chapters · 112 pages". */
|
|
37
|
-
meta?: RemixNode;
|
|
38
|
-
/** {@link Curriculum.Lesson} children. */
|
|
39
|
-
children: RemixNode;
|
|
35
|
+
/** Every native `<div>` attribute of the parts' grid. */
|
|
36
|
+
interface PartsProps extends TagProps<"div"> {
|
|
40
37
|
}
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
/** Every native `<section>` attribute of one part. */
|
|
39
|
+
interface PartProps extends TagProps<"section"> {
|
|
40
|
+
}
|
|
41
|
+
/** Every native `<header>` attribute of a part's title block. */
|
|
42
|
+
interface PartHeaderProps extends TagProps<"header"> {
|
|
43
|
+
}
|
|
44
|
+
/** Every native heading attribute of a part's title. */
|
|
45
|
+
interface PartTitleProps extends TagProps<"h3"> {
|
|
46
|
+
}
|
|
47
|
+
/** Every native `<p>` attribute of a part's totals. */
|
|
48
|
+
interface PartMetaProps extends TagProps<"p"> {
|
|
49
|
+
}
|
|
50
|
+
/** Every native `<ol>` attribute of a part's lessons. */
|
|
51
|
+
interface LessonsProps extends TagProps<"ol"> {
|
|
52
|
+
}
|
|
53
|
+
/** Every native `<li>` attribute of one lesson, plus whether it opens. */
|
|
54
|
+
interface LessonProps extends TagProps<"li"> {
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
56
|
+
* Makes the lesson a native disclosure: its {@link Curriculum.Row} becomes the summary
|
|
57
|
+
* with a chevron, and its {@link Curriculum.Body} opens under it.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
expandable?: boolean;
|
|
60
|
+
/** Starts an expandable lesson open. */
|
|
61
|
+
open?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** Every native attribute of the lesson's row. */
|
|
64
|
+
interface RowProps extends TagProps<"summary"> {
|
|
65
|
+
}
|
|
66
|
+
/** Every native `<span>` attribute of a row cell. */
|
|
67
|
+
interface CellProps extends TagProps<"span"> {
|
|
68
|
+
}
|
|
69
|
+
/** Every {@link Badge} prop of the flag after a lesson's title. */
|
|
70
|
+
interface BadgeProps extends Badge.Props {
|
|
71
|
+
}
|
|
72
|
+
/** Every native `<div>` attribute of what opens under the row. */
|
|
73
|
+
interface BodyProps extends TagProps<"div"> {
|
|
60
74
|
}
|
|
61
75
|
}
|
|
62
76
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
77
|
+
* Stacks its children 2.5rem apart: totals such as a `StatStrip`, then the
|
|
78
|
+
* {@link Curriculum.Parts}, which read `layout` through context.
|
|
65
79
|
*
|
|
66
80
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
67
81
|
* @returns The render function producing the curriculum's markup.
|
|
68
82
|
* @example
|
|
69
|
-
* <Curriculum
|
|
70
|
-
* <
|
|
71
|
-
*
|
|
72
|
-
*
|
|
83
|
+
* <Curriculum>
|
|
84
|
+
* <StatStrip>{totals}</StatStrip>
|
|
85
|
+
* <Curriculum.Parts>
|
|
86
|
+
* <Curriculum.Part>
|
|
87
|
+
* <Curriculum.PartHeader><Curriculum.PartTitle>{t("part.one")}</Curriculum.PartTitle></Curriculum.PartHeader>
|
|
88
|
+
* <Curriculum.Lessons>{lessons}</Curriculum.Lessons>
|
|
89
|
+
* </Curriculum.Part>
|
|
90
|
+
* </Curriculum.Parts>
|
|
73
91
|
* </Curriculum>
|
|
74
92
|
*/
|
|
75
|
-
export declare function Curriculum(handle: Handle<Curriculum.Props>): () => import("remix/component").RemixElement;
|
|
93
|
+
export declare function Curriculum(handle: Handle<Curriculum.Props, Curriculum.Context>): () => import("remix/component").RemixElement;
|
|
76
94
|
export declare namespace Curriculum {
|
|
95
|
+
var Parts: (handle: Handle<Curriculum.PartsProps>) => () => import("remix/component").RemixElement;
|
|
77
96
|
var Part: (handle: Handle<Curriculum.PartProps>) => () => import("remix/component").RemixElement;
|
|
78
|
-
var
|
|
97
|
+
var PartHeader: (handle: Handle<Curriculum.PartHeaderProps>) => () => import("remix/component").RemixElement;
|
|
98
|
+
var PartTitle: (handle: Handle<Curriculum.PartTitleProps>) => () => import("remix/component").RemixElement;
|
|
99
|
+
var PartMeta: (handle: Handle<Curriculum.PartMetaProps>) => () => import("remix/component").RemixElement;
|
|
100
|
+
var Lessons: (handle: Handle<Curriculum.LessonsProps>) => () => import("remix/component").RemixElement;
|
|
101
|
+
var Lesson: (handle: Handle<Curriculum.LessonProps, Curriculum.LessonContext>) => () => import("remix/component").RemixElement;
|
|
102
|
+
var Row: (handle: Handle<Curriculum.RowProps>) => () => import("remix/component").RemixElement;
|
|
103
|
+
var Number: (handle: Handle<Curriculum.CellProps>) => () => import("remix/component").RemixElement;
|
|
104
|
+
var Title: (handle: Handle<Curriculum.CellProps>) => () => import("remix/component").RemixElement;
|
|
105
|
+
var Badge: (handle: Handle<Curriculum.BadgeProps>) => () => import("remix/component").RemixElement;
|
|
106
|
+
var Meta: (handle: Handle<Curriculum.CellProps>) => () => import("remix/component").RemixElement;
|
|
107
|
+
var Body: (handle: Handle<Curriculum.BodyProps>) => () => import("remix/component").RemixElement;
|
|
79
108
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
2
|
import { ChevronRightIcon } from "@sdxc/icons";
|
|
3
3
|
import { combine, raw, mergeMix } from "@sdxc/u/general";
|
|
4
4
|
import { container, vstack } from "@sdxc/u/layout";
|
|
@@ -20,30 +20,50 @@ const NUMBER_TRACK = "2rem";
|
|
|
20
20
|
const TRACK_GAP = "0.75rem";
|
|
21
21
|
/** How far a lesson's body is indented, so it starts under the title. */
|
|
22
22
|
const BODY_INDENT = `calc(${CHEVRON_TRACK} + ${NUMBER_TRACK} + 2 * ${TRACK_GAP})`;
|
|
23
|
+
/** The marker attribute a lesson row's layout selects its parts by. */
|
|
24
|
+
const PART = "data-curriculum-part";
|
|
23
25
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
+
* Stacks its children 2.5rem apart: totals such as a `StatStrip`, then the
|
|
27
|
+
* {@link Curriculum.Parts}, which read `layout` through context.
|
|
26
28
|
*
|
|
27
29
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
28
30
|
* @returns The render function producing the curriculum's markup.
|
|
29
31
|
* @example
|
|
30
|
-
* <Curriculum
|
|
31
|
-
* <
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* <Curriculum>
|
|
33
|
+
* <StatStrip>{totals}</StatStrip>
|
|
34
|
+
* <Curriculum.Parts>
|
|
35
|
+
* <Curriculum.Part>
|
|
36
|
+
* <Curriculum.PartHeader><Curriculum.PartTitle>{t("part.one")}</Curriculum.PartTitle></Curriculum.PartHeader>
|
|
37
|
+
* <Curriculum.Lessons>{lessons}</Curriculum.Lessons>
|
|
38
|
+
* </Curriculum.Part>
|
|
39
|
+
* </Curriculum.Parts>
|
|
34
40
|
* </Curriculum>
|
|
35
41
|
*/
|
|
36
42
|
export function Curriculum(handle) {
|
|
37
43
|
return () => {
|
|
38
|
-
let {
|
|
44
|
+
let { layout, mix, ...rest } = handle.props;
|
|
39
45
|
let resolvedLayout = layout ?? DEFAULT_LAYOUT;
|
|
40
|
-
|
|
46
|
+
handle.context.set({ layout: resolvedLayout });
|
|
47
|
+
return (_jsx("div", { "data-slot": "curriculum", ...rest, "data-layout": resolvedLayout, mix: mergeMix([
|
|
41
48
|
container(CONTAINER),
|
|
42
49
|
vstack({ gap: 10, align: "stretch" }),
|
|
43
50
|
raw({ inlineSize: "100%" }),
|
|
44
|
-
], mix)
|
|
51
|
+
], mix) }));
|
|
45
52
|
};
|
|
46
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* The parts' grid, opening a heading scope so part titles sit one level under the band's title.
|
|
56
|
+
*
|
|
57
|
+
* @param handle Runtime handle carrying the grid's props.
|
|
58
|
+
* @returns The render function producing the grid.
|
|
59
|
+
*/
|
|
60
|
+
Curriculum.Parts = function CurriculumParts(handle) {
|
|
61
|
+
return () => {
|
|
62
|
+
let { mix, ...rest } = handle.props;
|
|
63
|
+
let context = handle.context.get(Curriculum);
|
|
64
|
+
return (_jsx(HeadingScope, { children: _jsx("div", { "data-slot": "curriculum-parts", ...rest, mix: mergeMix([parts(context?.layout ?? DEFAULT_LAYOUT)], mix) }) }));
|
|
65
|
+
};
|
|
66
|
+
};
|
|
47
67
|
/**
|
|
48
68
|
* The parts' grid in one rule: one column, then, for `columns`, every part in one row of
|
|
49
69
|
* equal tracks from the `lg` container whatever their count.
|
|
@@ -67,28 +87,74 @@ function parts(layout) {
|
|
|
67
87
|
]);
|
|
68
88
|
}
|
|
69
89
|
/**
|
|
70
|
-
* One part:
|
|
90
|
+
* One part: a {@link Curriculum.PartHeader} over its {@link Curriculum.Lessons}, 1rem apart.
|
|
71
91
|
*
|
|
72
92
|
* @param handle Runtime handle carrying the host `<section>`'s props.
|
|
73
93
|
* @returns The render function producing the part's markup.
|
|
74
|
-
* @example
|
|
75
|
-
* <Curriculum.Part title="Foundations" meta="4 chapters · 86 pages">{lessons}</Curriculum.Part>
|
|
76
94
|
*/
|
|
77
95
|
Curriculum.Part = function CurriculumPart(handle) {
|
|
78
96
|
return () => {
|
|
79
|
-
let {
|
|
97
|
+
let { mix, ...rest } = handle.props;
|
|
98
|
+
return (_jsx("section", { "data-slot": "curriculum-part", ...rest, mix: mergeMix([vstack({ gap: 4, align: "stretch" }), raw({ minInlineSize: "0" })], mix) }));
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* A part's {@link Curriculum.PartTitle} with its {@link Curriculum.PartMeta} close under it.
|
|
103
|
+
*
|
|
104
|
+
* @param handle Runtime handle carrying the header's props.
|
|
105
|
+
* @returns The render function producing the header.
|
|
106
|
+
*/
|
|
107
|
+
Curriculum.PartHeader = function CurriculumPartHeader(handle) {
|
|
108
|
+
return () => {
|
|
109
|
+
let { mix, ...rest } = handle.props;
|
|
110
|
+
return (_jsx("header", { "data-slot": "curriculum-part-header", ...rest, mix: mergeMix([vstack({ gap: 1, align: "start" })], mix) }));
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* The part's title, a heading at the ambient depth.
|
|
115
|
+
*
|
|
116
|
+
* @param handle Runtime handle carrying the heading's props.
|
|
117
|
+
* @returns The render function producing the title.
|
|
118
|
+
*/
|
|
119
|
+
Curriculum.PartTitle = function CurriculumPartTitle(handle) {
|
|
120
|
+
return () => {
|
|
121
|
+
let { mix, ...rest } = handle.props;
|
|
80
122
|
let Tag = TAG_BY_LEVEL[resolveHeadingLevel(handle)];
|
|
81
|
-
return (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
123
|
+
return (_jsx(Tag, { "data-slot": "curriculum-part-title", ...rest, mix: mergeMix([
|
|
124
|
+
raw({
|
|
125
|
+
margin: "0",
|
|
126
|
+
fontSize: "var(--ui-text-xl, 1.25rem)",
|
|
127
|
+
lineHeight: "1.75rem",
|
|
128
|
+
fontWeight: "600",
|
|
129
|
+
letterSpacing: "-0.01em",
|
|
130
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
131
|
+
textWrap: "balance",
|
|
132
|
+
}),
|
|
133
|
+
], mix) }));
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* The part's totals, such as "5 chapters · 112 pages", in muted mono.
|
|
138
|
+
*
|
|
139
|
+
* @param handle Runtime handle carrying the paragraph's props.
|
|
140
|
+
* @returns The render function producing the totals.
|
|
141
|
+
*/
|
|
142
|
+
Curriculum.PartMeta = function CurriculumPartMeta(handle) {
|
|
143
|
+
return () => {
|
|
144
|
+
let { mix, ...rest } = handle.props;
|
|
145
|
+
return (_jsx("p", { "data-slot": "curriculum-part-meta", ...rest, mix: mergeMix([monoMeta(), raw({ margin: "0" })], mix) }));
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* The part's lessons, ruled above every row and under the last.
|
|
150
|
+
*
|
|
151
|
+
* @param handle Runtime handle carrying the list's props.
|
|
152
|
+
* @returns The render function producing the list.
|
|
153
|
+
*/
|
|
154
|
+
Curriculum.Lessons = function CurriculumLessons(handle) {
|
|
155
|
+
return () => {
|
|
156
|
+
let { mix, ...rest } = handle.props;
|
|
157
|
+
return _jsx("ol", { "data-slot": "curriculum-lessons", ...rest, mix: mergeMix([lessonList()], mix) });
|
|
92
158
|
};
|
|
93
159
|
};
|
|
94
160
|
/** Mono, muted, tabular small print shared by part totals, lesson numbers and lesson meta. */
|
|
@@ -110,11 +176,12 @@ function lessonList() {
|
|
|
110
176
|
]);
|
|
111
177
|
}
|
|
112
178
|
/**
|
|
113
|
-
* The
|
|
114
|
-
*
|
|
115
|
-
*
|
|
179
|
+
* The row in one rule: chevron, number, title (with its badge) and meta tracks on a shared
|
|
180
|
+
* first baseline, at least 44px tall, so the meta stays at the inline end however far the
|
|
181
|
+
* title wraps, whatever order the cells are written in. Only an expandable row takes the
|
|
182
|
+
* pointer cursor and hover underline.
|
|
116
183
|
*/
|
|
117
|
-
function
|
|
184
|
+
function lessonRow(expandable) {
|
|
118
185
|
return combine([
|
|
119
186
|
raw({
|
|
120
187
|
display: "grid",
|
|
@@ -130,7 +197,12 @@ function lessonSummary(expandable) {
|
|
|
130
197
|
}),
|
|
131
198
|
when("&::-webkit-details-marker", raw({ display: "none" })),
|
|
132
199
|
when("&::marker", raw({ content: '""' })),
|
|
200
|
+
when(`& > [${PART}=number]`, raw({ gridRow: "1", gridColumn: "2" })),
|
|
201
|
+
when(`& > [${PART}=title]`, raw({ gridRow: "1", gridColumn: "3" })),
|
|
202
|
+
when(`& > [${PART}=meta]`, raw({ gridRow: "1", gridColumn: "4" })),
|
|
133
203
|
when('& > [data-slot="curriculum-lesson-chevron"]', raw({
|
|
204
|
+
gridRow: "1",
|
|
205
|
+
gridColumn: "1",
|
|
134
206
|
alignSelf: "start",
|
|
135
207
|
display: "grid",
|
|
136
208
|
placeItems: "center",
|
|
@@ -140,7 +212,7 @@ function lessonSummary(expandable) {
|
|
|
140
212
|
when('& > [data-slot="curriculum-lesson-chevron"] > svg', raw({ inlineSize: "1rem", blockSize: "1rem" })),
|
|
141
213
|
when('& > [data-slot="curriculum-lesson-chevron"] > svg', motionSafe(raw({ transition: "rotate 200ms" }))),
|
|
142
214
|
expandable
|
|
143
|
-
? when(
|
|
215
|
+
? when(`&:hover > [${PART}=title]`, raw({
|
|
144
216
|
textDecoration: "underline",
|
|
145
217
|
textUnderlineOffset: "0.2em",
|
|
146
218
|
textDecorationThickness: "1px",
|
|
@@ -149,46 +221,132 @@ function lessonSummary(expandable) {
|
|
|
149
221
|
]);
|
|
150
222
|
}
|
|
151
223
|
/**
|
|
152
|
-
* One lesson
|
|
153
|
-
*
|
|
224
|
+
* One lesson. An `expandable` lesson is a native disclosure whose {@link Curriculum.Row} is
|
|
225
|
+
* the summary and whose {@link Curriculum.Body} opens under the title, the chevron turning
|
|
226
|
+
* while open; any other lesson is a static row with no chevron.
|
|
154
227
|
*
|
|
155
228
|
* @param handle Runtime handle carrying the host `<li>`'s props.
|
|
156
229
|
* @returns The render function producing the lesson's list item.
|
|
157
230
|
* @example
|
|
158
|
-
* <Curriculum.Lesson
|
|
159
|
-
* <
|
|
231
|
+
* <Curriculum.Lesson expandable>
|
|
232
|
+
* <Curriculum.Row>
|
|
233
|
+
* <Curriculum.Number>03</Curriculum.Number>
|
|
234
|
+
* <Curriculum.Title>{t("ch.measure")}<Curriculum.Badge>Preview</Curriculum.Badge></Curriculum.Title>
|
|
235
|
+
* <Curriculum.Meta>22 pages</Curriculum.Meta>
|
|
236
|
+
* </Curriculum.Row>
|
|
237
|
+
* <Curriculum.Body><CheckList>{subtopics}</CheckList></Curriculum.Body>
|
|
160
238
|
* </Curriculum.Lesson>
|
|
161
239
|
*/
|
|
162
240
|
Curriculum.Lesson = function CurriculumLesson(handle) {
|
|
163
241
|
return () => {
|
|
164
|
-
let {
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
lineHeight: "1.5rem",
|
|
169
|
-
fontWeight: "500",
|
|
170
|
-
color: "var(--ui-neutral-fg-emphasis)",
|
|
171
|
-
textWrap: "pretty",
|
|
172
|
-
overflowWrap: "anywhere",
|
|
173
|
-
}),
|
|
174
|
-
], children: [title, badge ? (_jsx(Badge, { variant: "secondary", color: "brand", "data-slot": "curriculum-lesson-badge", mix: [raw({ marginInlineStart: "0.5rem", verticalAlign: "0.0625rem" })], children: badge })) : null] }), _jsx("span", { "data-slot": "curriculum-lesson-meta", mix: [monoMeta(), raw({ textAlign: "end", whiteSpace: "nowrap" })], children: meta })] }));
|
|
175
|
-
if (!children) {
|
|
176
|
-
return (_jsx("li", { ...rest, "data-slot": "curriculum-lesson", mix: mix, children: _jsx("div", { "data-slot": "curriculum-lesson-row", mix: [lessonSummary(false)], children: row }) }));
|
|
177
|
-
}
|
|
178
|
-
return (_jsx("li", { ...rest, "data-slot": "curriculum-lesson", mix: mix, children: _jsxs("details", { open: open, mix: [
|
|
242
|
+
let { children, expandable, open, ...rest } = handle.props;
|
|
243
|
+
let isExpandable = expandable === true;
|
|
244
|
+
handle.context.set({ expandable: isExpandable });
|
|
245
|
+
return (_jsx("li", { "data-slot": "curriculum-lesson", ...rest, children: isExpandable ? (_jsx("details", { open: open, mix: [
|
|
179
246
|
when('&[open] > summary > [data-slot="curriculum-lesson-chevron"] > svg', raw({ rotate: "90deg" })),
|
|
180
|
-
], children:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
247
|
+
], children: children })) : (children) }));
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* The lesson's row: the chevron track, then the {@link Curriculum.Number},
|
|
252
|
+
* {@link Curriculum.Title} and {@link Curriculum.Meta}. In an expandable lesson it is the
|
|
253
|
+
* disclosure's `<summary>` with a chevron.
|
|
254
|
+
*
|
|
255
|
+
* @param handle Runtime handle carrying the row's props.
|
|
256
|
+
* @returns The render function producing the row.
|
|
257
|
+
*/
|
|
258
|
+
Curriculum.Row = function CurriculumRow(handle) {
|
|
259
|
+
return () => {
|
|
260
|
+
let { children, mix, ...rest } = handle.props;
|
|
261
|
+
let context = handle.context.get(Curriculum.Lesson);
|
|
262
|
+
let expandable = context?.expandable === true;
|
|
263
|
+
let chevron = (_jsx("span", { "data-slot": "curriculum-lesson-chevron", "aria-hidden": "true", children: expandable ? _jsx(ChevronRightIcon, {}) : null }));
|
|
264
|
+
let rowMix = mergeMix([lessonRow(expandable)], mix);
|
|
265
|
+
if (expandable) {
|
|
266
|
+
return (_jsxs("summary", { "data-slot": "curriculum-lesson-row", ...rest, mix: rowMix, children: [chevron, children] }));
|
|
267
|
+
}
|
|
268
|
+
return (_jsxs("div", { "data-slot": "curriculum-lesson-row", ...rest, mix: rowMix, children: [chevron, children] }));
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* The lesson's number as shown, such as "01", in muted mono.
|
|
273
|
+
*
|
|
274
|
+
* @param handle Runtime handle carrying the span's props.
|
|
275
|
+
* @returns The render function producing the number.
|
|
276
|
+
*/
|
|
277
|
+
Curriculum.Number = function CurriculumNumber(handle) {
|
|
278
|
+
return () => {
|
|
279
|
+
let { mix, ...rest } = handle.props;
|
|
280
|
+
return (_jsx("span", { "data-slot": "curriculum-lesson-number", ...rest, "data-curriculum-part": "number", mix: mergeMix([monoMeta()], mix) }));
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* The lesson's title, wrapping anywhere before it pushes the meta out of the row.
|
|
285
|
+
*
|
|
286
|
+
* @param handle Runtime handle carrying the span's props.
|
|
287
|
+
* @returns The render function producing the title.
|
|
288
|
+
*/
|
|
289
|
+
Curriculum.Title = function CurriculumTitle(handle) {
|
|
290
|
+
return () => {
|
|
291
|
+
let { mix, ...rest } = handle.props;
|
|
292
|
+
return (_jsx("span", { "data-slot": "curriculum-lesson-title", ...rest, "data-curriculum-part": "title", mix: mergeMix([
|
|
293
|
+
raw({
|
|
294
|
+
fontSize: "var(--ui-text-base, 1rem)",
|
|
295
|
+
lineHeight: "1.5rem",
|
|
296
|
+
fontWeight: "500",
|
|
297
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
298
|
+
textWrap: "pretty",
|
|
299
|
+
overflowWrap: "anywhere",
|
|
300
|
+
}),
|
|
301
|
+
], mix) }));
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* A short flag after the title, such as "Free" or "Preview", as a brand {@link Badge}.
|
|
306
|
+
*
|
|
307
|
+
* @param handle Runtime handle carrying the badge's props.
|
|
308
|
+
* @returns The render function producing the badge.
|
|
309
|
+
*/
|
|
310
|
+
Curriculum.Badge = function CurriculumBadge(handle) {
|
|
311
|
+
return () => {
|
|
312
|
+
let { mix, ...rest } = handle.props;
|
|
313
|
+
return (_jsx(Badge, { variant: "secondary", color: "brand", "data-slot": "curriculum-lesson-badge", ...rest, mix: mergeMix([raw({ marginInlineStart: "0.5rem", verticalAlign: "0.0625rem" })], mix) }));
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* The lesson's length at the row's inline end, such as "18 pages" or "12 min".
|
|
318
|
+
*
|
|
319
|
+
* @param handle Runtime handle carrying the span's props.
|
|
320
|
+
* @returns The render function producing the meta.
|
|
321
|
+
*/
|
|
322
|
+
Curriculum.Meta = function CurriculumMeta(handle) {
|
|
323
|
+
return () => {
|
|
324
|
+
let { mix, ...rest } = handle.props;
|
|
325
|
+
return (_jsx("span", { "data-slot": "curriculum-lesson-meta", ...rest, "data-curriculum-part": "meta", mix: mergeMix([monoMeta(), raw({ textAlign: "end", whiteSpace: "nowrap" })], mix) }));
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* What opens under an expandable lesson's row, starting under the title: subtopics, usually
|
|
330
|
+
* a `CheckList`, and a preview link.
|
|
331
|
+
*
|
|
332
|
+
* @param handle Runtime handle carrying the block's props.
|
|
333
|
+
* @returns The render function producing the body.
|
|
334
|
+
*/
|
|
335
|
+
Curriculum.Body = function CurriculumBody(handle) {
|
|
336
|
+
return () => {
|
|
337
|
+
let { mix, ...rest } = handle.props;
|
|
338
|
+
return (_jsx("div", { "data-slot": "curriculum-lesson-body", ...rest, mix: mergeMix([
|
|
339
|
+
raw({
|
|
340
|
+
display: "flex",
|
|
341
|
+
flexDirection: "column",
|
|
342
|
+
alignItems: "stretch",
|
|
343
|
+
gap: "0.75rem",
|
|
344
|
+
paddingInlineStart: BODY_INDENT,
|
|
345
|
+
paddingBlockEnd: "1rem",
|
|
346
|
+
fontSize: "var(--ui-text-sm, 0.875rem)",
|
|
347
|
+
lineHeight: "1.5rem",
|
|
348
|
+
color: "var(--ui-neutral-fg)",
|
|
349
|
+
}),
|
|
350
|
+
], mix) }));
|
|
193
351
|
};
|
|
194
352
|
};
|
|
@@ -13,16 +13,14 @@ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
|
13
13
|
export declare namespace DrawnChart {
|
|
14
14
|
/** How the chart draws its series. */
|
|
15
15
|
type Variant = "bars" | "line";
|
|
16
|
-
/** The headline number
|
|
17
|
-
interface
|
|
16
|
+
/** The headline number a {@link DrawnChart.Metric} draws, and counts up to when it is an integer. */
|
|
17
|
+
interface MetricNumber {
|
|
18
18
|
/** The measured value; an integer counts up from zero, any other number shows as is. */
|
|
19
19
|
value: number;
|
|
20
20
|
/** Number formatting, such as `{ maximumFractionDigits: 1 }`; also applied to every counted frame. */
|
|
21
21
|
format?: Intl.NumberFormatOptions;
|
|
22
22
|
/** Locale the number formats in. Defaults to `"en-US"`. */
|
|
23
23
|
locale?: string;
|
|
24
|
-
/** What the number measures, set under it. */
|
|
25
|
-
label: RemixNode;
|
|
26
24
|
/** Text drawn before the number, such as `"$"`. */
|
|
27
25
|
prefix?: string;
|
|
28
26
|
/** Text drawn after the number, such as `"%"` or `" ms"`. */
|
|
@@ -39,12 +37,11 @@ export declare namespace DrawnChart {
|
|
|
39
37
|
/**
|
|
40
38
|
* Props accepted by {@link DrawnChart}.
|
|
41
39
|
*/
|
|
42
|
-
interface Props extends
|
|
40
|
+
interface Props extends TagProps<"div"> {
|
|
43
41
|
/** Accessible name of the chart: the bars' list, or the line's image. Required. */
|
|
44
42
|
"aria-label": string;
|
|
45
43
|
/** Accessible name of the pause toggle. */
|
|
46
44
|
pauseLabel?: string;
|
|
47
|
-
metric?: Metric;
|
|
48
45
|
/** Defaults to `"bars"`, drawn horizontally so labels read on a phone. */
|
|
49
46
|
variant?: Variant;
|
|
50
47
|
series: readonly Datum[];
|
|
@@ -52,8 +49,14 @@ export declare namespace DrawnChart {
|
|
|
52
49
|
max?: number;
|
|
53
50
|
/** Index of the one datum drawn in the brand colour. */
|
|
54
51
|
highlight?: number;
|
|
55
|
-
/**
|
|
56
|
-
|
|
52
|
+
/**
|
|
53
|
+
* {@link DrawnChart.Metric} and {@link DrawnChart.Footnote}; the metric always sits over
|
|
54
|
+
* the chart and the footnote under it, whatever order they are written in.
|
|
55
|
+
*/
|
|
56
|
+
children?: RemixNode;
|
|
57
|
+
}
|
|
58
|
+
/** Every native `<div>` attribute, plus the number it draws; its children say what it measures. */
|
|
59
|
+
interface MetricProps extends TagProps<"div">, MetricNumber {
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
/**
|
|
@@ -66,9 +69,14 @@ export declare namespace DrawnChart {
|
|
|
66
69
|
* @example
|
|
67
70
|
* <DrawnChart
|
|
68
71
|
* aria-label="Median time between checks, by how often a feed posts"
|
|
69
|
-
* metric={{ value: 15, suffix: " min", label: "Between checks of an hourly feed" }}
|
|
70
72
|
* series={[{ label: "Hourly", value: 15, display: "15 min" }, { label: "Daily", value: 240, display: "4 h" }]}
|
|
71
73
|
* highlight={0}
|
|
72
|
-
*
|
|
74
|
+
* >
|
|
75
|
+
* <DrawnChart.Metric value={15} suffix=" min">Between checks of an hourly feed</DrawnChart.Metric>
|
|
76
|
+
* </DrawnChart>
|
|
73
77
|
*/
|
|
74
78
|
export declare function DrawnChart(handle: Handle<DrawnChart.Props>): () => import("remix/component").RemixElement;
|
|
79
|
+
export declare namespace DrawnChart {
|
|
80
|
+
var Metric: (handle: Handle<DrawnChart.MetricProps>) => () => import("remix/component").RemixElement;
|
|
81
|
+
var Footnote: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
|
|
82
|
+
}
|