@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
|
@@ -18,22 +18,18 @@ export declare namespace ContributionGraph {
|
|
|
18
18
|
/** Picks the day's level against `levels`; repeated dates add up. */
|
|
19
19
|
count: number;
|
|
20
20
|
}
|
|
21
|
-
/** Every string the graph
|
|
21
|
+
/** Every string the graph announces, so an app translates each one. */
|
|
22
22
|
interface Labels {
|
|
23
|
-
/** The table's caption
|
|
23
|
+
/** The table's caption for assistive technology ("4,015 contributions in the last year"). */
|
|
24
24
|
caption: string;
|
|
25
25
|
/**
|
|
26
26
|
* A day's name, plural on its count, from the date the graph formats in `locale`:
|
|
27
27
|
* `(12, "Tuesday, Nov 3") => "12 contributions on Tuesday, Nov 3"`.
|
|
28
28
|
*/
|
|
29
29
|
day: (count: number, date: string) => string;
|
|
30
|
-
/** The legend's low end ("Less"). */
|
|
31
|
-
less: string;
|
|
32
|
-
/** The legend's high end ("More"). */
|
|
33
|
-
more: string;
|
|
34
30
|
}
|
|
35
31
|
/** Props accepted by {@link ContributionGraph}; the host is a `<div>`. */
|
|
36
|
-
interface Props extends
|
|
32
|
+
interface Props extends TagProps<"div"> {
|
|
37
33
|
/** The counts to plot, in any order; only days between `start` and `end` are drawn. */
|
|
38
34
|
days: readonly Day[];
|
|
39
35
|
/** The first day drawn, as `YYYY-MM-DD`. */
|
|
@@ -48,9 +44,18 @@ export declare namespace ContributionGraph {
|
|
|
48
44
|
locale?: string;
|
|
49
45
|
/** First day of the week, 0 = Sunday; defaults to the locale's. */
|
|
50
46
|
weekStart?: number;
|
|
51
|
-
/** Every string the graph
|
|
47
|
+
/** Every string the graph announces, so it reads in any language. */
|
|
52
48
|
labels: Labels;
|
|
53
49
|
}
|
|
50
|
+
/** Every native `<p>` attribute. */
|
|
51
|
+
interface SummaryProps extends TagProps<"p"> {
|
|
52
|
+
}
|
|
53
|
+
/** Every native `<div>` attribute. */
|
|
54
|
+
interface LegendProps extends TagProps<"div"> {
|
|
55
|
+
}
|
|
56
|
+
/** Every native `<span>` attribute. */
|
|
57
|
+
interface LegendPartProps extends TagProps<"span"> {
|
|
58
|
+
}
|
|
54
59
|
/** Props {@link ContributionGraphTooltip} serializes for hydration, which is why they are a `type`. */
|
|
55
60
|
type TooltipProps = {
|
|
56
61
|
/** The CSS anchor name the tooltip positions against, unique to its graph. */
|
|
@@ -75,9 +80,9 @@ export declare function weekStartFor(locale?: string): number;
|
|
|
75
80
|
*/
|
|
76
81
|
export declare function contributionLevel(count: number, levels?: readonly number[]): number;
|
|
77
82
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* it with `--ui-contribution-graph-cell` and `-gap
|
|
83
|
+
* Draws the year's grid with its `.Summary` above and `.Legend` below, wherever written; each day's
|
|
84
|
+
* `title` names its count, and {@link ContributionGraphTooltip} adds a shared tooltip and arrow keys.
|
|
85
|
+
* Size it with `--ui-contribution-graph-cell` and `-gap`; tint `--graph-level-0`–`4`.
|
|
81
86
|
*
|
|
82
87
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
83
88
|
* @returns The render function producing the graph's markup.
|
|
@@ -91,12 +96,23 @@ export declare function contributionLevel(count: number, levels?: readonly numbe
|
|
|
91
96
|
* labels={{
|
|
92
97
|
* caption: t("profile.contributions", { count: total }),
|
|
93
98
|
* day: (count, date) => t("profile.contributionsOn", { count, date }),
|
|
94
|
-
* less: t("graph.less"),
|
|
95
|
-
* more: t("graph.more"),
|
|
96
99
|
* }}
|
|
97
|
-
*
|
|
100
|
+
* >
|
|
101
|
+
* <ContributionGraph.Summary>{t("profile.contributions", { count: total })}</ContributionGraph.Summary>
|
|
102
|
+
* <ContributionGraph.Legend>
|
|
103
|
+
* <ContributionGraph.LegendLabel>{t("graph.less")}</ContributionGraph.LegendLabel>
|
|
104
|
+
* <ContributionGraph.LegendScale />
|
|
105
|
+
* <ContributionGraph.LegendLabel>{t("graph.more")}</ContributionGraph.LegendLabel>
|
|
106
|
+
* </ContributionGraph.Legend>
|
|
107
|
+
* </ContributionGraph>
|
|
98
108
|
*/
|
|
99
109
|
export declare function ContributionGraph(handle: Handle<ContributionGraph.Props>): () => import("remix/component").RemixElement;
|
|
110
|
+
export declare namespace ContributionGraph {
|
|
111
|
+
var Summary: (handle: Handle<ContributionGraph.SummaryProps>) => () => import("remix/component").RemixElement;
|
|
112
|
+
var Legend: (handle: Handle<ContributionGraph.LegendProps>) => () => import("remix/component").RemixElement;
|
|
113
|
+
var LegendLabel: (handle: Handle<ContributionGraph.LegendPartProps>) => () => import("remix/component").RemixElement;
|
|
114
|
+
var LegendScale: (handle: Handle<ContributionGraph.LegendPartProps>) => () => import("remix/component").RemixElement;
|
|
115
|
+
}
|
|
100
116
|
/**
|
|
101
117
|
* Client island behind {@link ContributionGraph}'s tooltip and keyboard: a manual popover that
|
|
102
118
|
* `contributionGraphKeys()` fills with the hovered or focused day's name and anchors to it, while
|
|
@@ -88,9 +88,9 @@ function anchorName(id) {
|
|
|
88
88
|
return `--ui-contribution-graph-${id.replace(/[^\w-]/g, "-")}`;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* it with `--ui-contribution-graph-cell` and `-gap
|
|
91
|
+
* Draws the year's grid with its `.Summary` above and `.Legend` below, wherever written; each day's
|
|
92
|
+
* `title` names its count, and {@link ContributionGraphTooltip} adds a shared tooltip and arrow keys.
|
|
93
|
+
* Size it with `--ui-contribution-graph-cell` and `-gap`; tint `--graph-level-0`–`4`.
|
|
94
94
|
*
|
|
95
95
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
96
96
|
* @returns The render function producing the graph's markup.
|
|
@@ -104,14 +104,19 @@ function anchorName(id) {
|
|
|
104
104
|
* labels={{
|
|
105
105
|
* caption: t("profile.contributions", { count: total }),
|
|
106
106
|
* day: (count, date) => t("profile.contributionsOn", { count, date }),
|
|
107
|
-
* less: t("graph.less"),
|
|
108
|
-
* more: t("graph.more"),
|
|
109
107
|
* }}
|
|
110
|
-
*
|
|
108
|
+
* >
|
|
109
|
+
* <ContributionGraph.Summary>{t("profile.contributions", { count: total })}</ContributionGraph.Summary>
|
|
110
|
+
* <ContributionGraph.Legend>
|
|
111
|
+
* <ContributionGraph.LegendLabel>{t("graph.less")}</ContributionGraph.LegendLabel>
|
|
112
|
+
* <ContributionGraph.LegendScale />
|
|
113
|
+
* <ContributionGraph.LegendLabel>{t("graph.more")}</ContributionGraph.LegendLabel>
|
|
114
|
+
* </ContributionGraph.Legend>
|
|
115
|
+
* </ContributionGraph>
|
|
111
116
|
*/
|
|
112
117
|
export function ContributionGraph(handle) {
|
|
113
118
|
return () => {
|
|
114
|
-
let { days, start, end, levels, href, locale, weekStart, labels, mix, ...rest } = handle.props;
|
|
119
|
+
let { days, start, end, levels, href, locale, weekStart, labels, children, mix, ...rest } = handle.props;
|
|
115
120
|
let first = dayNumber(start);
|
|
116
121
|
let last = Math.max(first, dayNumber(end));
|
|
117
122
|
let startsOn = weekStart ?? weekStartFor(locale);
|
|
@@ -143,7 +148,7 @@ export function ContributionGraph(handle) {
|
|
|
143
148
|
timeZone: "UTC",
|
|
144
149
|
});
|
|
145
150
|
let anchor = anchorName(handle.id);
|
|
146
|
-
return (_jsxs("div", { ...rest, "data-slot": "contribution-graph", mix: mergeMix([flex(), raw({ flexDirection: "column" }), gap(2), minIs(0)], mix), children: [
|
|
151
|
+
return (_jsxs("div", { ...rest, "data-slot": "contribution-graph", mix: mergeMix([flex(), raw({ flexDirection: "column" }), gap(2), minIs(0)], mix), children: [children, _jsx("div", { "data-slot": "contribution-graph-scroller", mix: [
|
|
147
152
|
minIs(0),
|
|
148
153
|
/**
|
|
149
154
|
* Laid out from the end, the scroller's resting position is its newest week, so a
|
|
@@ -213,26 +218,82 @@ export function ContributionGraph(handle) {
|
|
|
213
218
|
}
|
|
214
219
|
return (_jsx("td", { tabIndex: tabIndex, "aria-label": name, title: name, "data-slot": "contribution-graph-day", "data-level": level, "data-count": count, "data-date": date, "data-week": index, "data-row": row }));
|
|
215
220
|
})] }));
|
|
216
|
-
}) })] }) }),
|
|
217
|
-
flex(),
|
|
218
|
-
items("center"),
|
|
219
|
-
justify("end"),
|
|
220
|
-
gap(1),
|
|
221
|
-
text("xs"),
|
|
222
|
-
fg("neutral.muted"),
|
|
223
|
-
nowrap(),
|
|
224
|
-
tabularNums(),
|
|
225
|
-
raw({
|
|
226
|
-
"& > [data-level]": {
|
|
227
|
-
inlineSize: "var(--ui-contribution-graph-cell, 10px)",
|
|
228
|
-
blockSize: "var(--ui-contribution-graph-cell, 10px)",
|
|
229
|
-
borderRadius: "2px",
|
|
230
|
-
},
|
|
231
|
-
}),
|
|
232
|
-
raw(levelRules("& > span")),
|
|
233
|
-
], children: [_jsx("span", { mix: [raw({ marginInlineEnd: "0.25rem" })], children: labels.less }), LEVELS.map((level) => (_jsx("span", { "aria-hidden": "true", "data-level": level }))), _jsx("span", { mix: [raw({ marginInlineStart: "0.25rem" })], children: labels.more })] }), _jsx(ContributionGraphTooltip, { anchor: anchor })] }));
|
|
221
|
+
}) })] }) }), _jsx(ContributionGraphTooltip, { anchor: anchor })] }));
|
|
234
222
|
};
|
|
235
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* The graph's summary line above the grid, such as "4,015 contributions in the last year",
|
|
226
|
+
* hidden from assistive technology since the table's caption says the same.
|
|
227
|
+
*
|
|
228
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
229
|
+
* @returns The render function producing the summary.
|
|
230
|
+
*/
|
|
231
|
+
ContributionGraph.Summary = function ContributionGraphSummary(handle) {
|
|
232
|
+
return () => {
|
|
233
|
+
let { mix, ...rest } = handle.props;
|
|
234
|
+
return (_jsx("p", { "aria-hidden": "true", "data-slot": "contribution-graph-summary", ...rest, mix: mergeMix([raw({ margin: 0, order: "-1" }), text("sm"), weight("medium"), fg("neutral.emphasis")], mix) }));
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* The legend under the grid, end-aligned: a {@link ContributionGraph.LegendLabel} at each end of
|
|
239
|
+
* a {@link ContributionGraph.LegendScale}, in the order written.
|
|
240
|
+
*
|
|
241
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
242
|
+
* @returns The render function producing the legend.
|
|
243
|
+
*/
|
|
244
|
+
ContributionGraph.Legend = function ContributionGraphLegend(handle) {
|
|
245
|
+
return () => {
|
|
246
|
+
let { mix, ...rest } = handle.props;
|
|
247
|
+
return (_jsx("div", { "data-slot": "contribution-graph-legend", ...rest, mix: mergeMix([
|
|
248
|
+
flex(),
|
|
249
|
+
items("center"),
|
|
250
|
+
justify("end"),
|
|
251
|
+
gap(1),
|
|
252
|
+
text("xs"),
|
|
253
|
+
fg("neutral.muted"),
|
|
254
|
+
nowrap(),
|
|
255
|
+
tabularNums(),
|
|
256
|
+
raw({ order: "1" }),
|
|
257
|
+
], mix) }));
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* One end of the legend, such as "Less" or "More", spaced a little from the scale.
|
|
262
|
+
*
|
|
263
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
264
|
+
* @returns The render function producing the label.
|
|
265
|
+
*/
|
|
266
|
+
ContributionGraph.LegendLabel = function ContributionGraphLegendLabel(handle) {
|
|
267
|
+
return () => {
|
|
268
|
+
let { mix, ...rest } = handle.props;
|
|
269
|
+
return (_jsx("span", { "data-slot": "contribution-graph-legend-label", ...rest, mix: mergeMix([raw({ marginInline: "0.25rem" })], mix) }));
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* One swatch per level, lowest first, in the graph's own tints; decorative, since the labels
|
|
274
|
+
* around it say which end is which.
|
|
275
|
+
*
|
|
276
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
277
|
+
* @returns The render function producing the swatches.
|
|
278
|
+
*/
|
|
279
|
+
ContributionGraph.LegendScale = function ContributionGraphLegendScale(handle) {
|
|
280
|
+
return () => {
|
|
281
|
+
let { mix, ...rest } = handle.props;
|
|
282
|
+
return (_jsx("span", { "aria-hidden": "true", "data-slot": "contribution-graph-legend-scale", ...rest, mix: mergeMix([
|
|
283
|
+
flex(),
|
|
284
|
+
items("center"),
|
|
285
|
+
gap(1),
|
|
286
|
+
raw({
|
|
287
|
+
"& > [data-level]": {
|
|
288
|
+
inlineSize: "var(--ui-contribution-graph-cell, 10px)",
|
|
289
|
+
blockSize: "var(--ui-contribution-graph-cell, 10px)",
|
|
290
|
+
borderRadius: "2px",
|
|
291
|
+
},
|
|
292
|
+
}),
|
|
293
|
+
raw(levelRules("& > span")),
|
|
294
|
+
], mix), children: LEVELS.map((level) => (_jsx("span", { "data-level": level }))) }));
|
|
295
|
+
};
|
|
296
|
+
};
|
|
236
297
|
/**
|
|
237
298
|
* Tints each level from its `--graph-level-N` token, which an app's theme may set; unset, level 0 is
|
|
238
299
|
* the neutral tint and levels 1–4 mix the accent into it, so both light and dark themes are designed.
|
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The last section of a settings page, holding the actions that cannot be undone
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* The last section of a settings page, holding the actions that cannot be undone, as pieces a
|
|
3
|
+
* caller arranges: a heading and description over a danger-bordered card of action rows, each
|
|
4
|
+
* naming its consequences and opening a `Confirm`, so the decision is read twice.
|
|
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
|
|
10
|
-
import { Confirm } from "../components/confirm.js";
|
|
9
|
+
import type { Handle, Props as TagProps } from "remix/component";
|
|
11
10
|
import type { ActionPlacement as ActionPlacementType } from "./styles/action-row.js";
|
|
12
11
|
/**
|
|
13
|
-
* Prop types for {@link DangerZone} and
|
|
12
|
+
* Prop types for {@link DangerZone} and its parts.
|
|
14
13
|
*/
|
|
15
14
|
export declare namespace DangerZone {
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
/** Every native `<section>` attribute; name it with a {@link DangerZone.Title} or `aria-label`. */
|
|
16
|
+
type Props = TagProps<"section">;
|
|
17
|
+
/** What the section shares with its heading. */
|
|
18
|
+
interface Context {
|
|
19
|
+
/** The heading's id, which names the section. */
|
|
20
|
+
titleId: string;
|
|
21
21
|
}
|
|
22
22
|
/** Where an action's button sits: at the row's end on its title's line, or below its text. */
|
|
23
23
|
type ActionPlacement = ActionPlacementType;
|
|
24
|
-
/**
|
|
25
|
-
interface ActionProps extends
|
|
26
|
-
/** The confirm dialog's `id`, which the row's button opens. */
|
|
27
|
-
id: string;
|
|
28
|
-
/** What the action does, such as "Delete team". */
|
|
29
|
-
title: RemixNode;
|
|
30
|
-
description?: RemixNode;
|
|
31
|
-
/** What is lost, one item each: "14 monitors stop checking", "Invoices stay in Billing". */
|
|
32
|
-
consequences?: ReadonlyArray<RemixNode>;
|
|
24
|
+
/** Every native `<div>` attribute, plus where the row's button sits. */
|
|
25
|
+
interface ActionProps extends TagProps<"div"> {
|
|
33
26
|
/**
|
|
34
27
|
* Where the button sits on a wide card: under the text, for a row that lists its
|
|
35
28
|
* consequences, or at the row's end on the title's line, for a short one. A narrow
|
|
@@ -38,29 +31,41 @@ export declare namespace DangerZone {
|
|
|
38
31
|
* @default "below"
|
|
39
32
|
*/
|
|
40
33
|
actionPlacement?: ActionPlacement;
|
|
41
|
-
/** The row's button text; name the action, such as "Delete team". */
|
|
42
|
-
buttonLabel: RemixNode;
|
|
43
|
-
/**
|
|
44
|
-
* The confirmation the button opens. Name the item in the title and description and
|
|
45
|
-
* the action on the confirm button; add `typeToConfirm` for the biggest deletions.
|
|
46
|
-
*/
|
|
47
|
-
confirm: Omit<Confirm.Props, "id">;
|
|
48
34
|
}
|
|
35
|
+
/** What a row shares with its button. */
|
|
36
|
+
interface ActionContext {
|
|
37
|
+
actionPlacement: ActionPlacement;
|
|
38
|
+
}
|
|
39
|
+
/** Every native `<button>` attribute; `commandfor` names the row's `Confirm`. */
|
|
40
|
+
type TriggerProps = TagProps<"button">;
|
|
49
41
|
}
|
|
50
42
|
/**
|
|
51
|
-
* Renders the section
|
|
52
|
-
* {@link DangerZone.
|
|
43
|
+
* Renders the section, laying out its {@link DangerZone.Title}, {@link DangerZone.Description}
|
|
44
|
+
* and {@link DangerZone.Card} in the order given, each spaced from the one before it.
|
|
53
45
|
*
|
|
54
46
|
* @param handle Runtime handle carrying the section's props.
|
|
55
47
|
* @returns The render function producing the section's markup.
|
|
56
48
|
* @example
|
|
57
|
-
* <DangerZone
|
|
58
|
-
* <DangerZone.
|
|
59
|
-
*
|
|
60
|
-
*
|
|
49
|
+
* <DangerZone>
|
|
50
|
+
* <DangerZone.Title>Danger zone</DangerZone.Title>
|
|
51
|
+
* <DangerZone.Card>
|
|
52
|
+
* <DangerZone.Action>
|
|
53
|
+
* <DangerZone.ActionTitle>Delete team</DangerZone.ActionTitle>
|
|
54
|
+
* <DangerZone.Consequences><li>14 monitors stop checking</li></DangerZone.Consequences>
|
|
55
|
+
* <DangerZone.Trigger commandfor="delete-team">Delete team</DangerZone.Trigger>
|
|
56
|
+
* <Confirm id="delete-team" … />
|
|
57
|
+
* </DangerZone.Action>
|
|
58
|
+
* </DangerZone.Card>
|
|
61
59
|
* </DangerZone>
|
|
62
60
|
*/
|
|
63
|
-
export declare function DangerZone(handle: Handle<DangerZone.Props>): () => import("remix/component").RemixElement;
|
|
61
|
+
export declare function DangerZone(handle: Handle<DangerZone.Props, DangerZone.Context>): () => import("remix/component").RemixElement;
|
|
64
62
|
export declare namespace DangerZone {
|
|
65
|
-
var
|
|
63
|
+
var Title: (handle: Handle<TagProps<"h2">>) => () => import("remix/component").RemixElement;
|
|
64
|
+
var Description: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
|
|
65
|
+
var Card: (handle: Handle<TagProps<"div">>) => () => import("remix/component").RemixElement;
|
|
66
|
+
var Action: (handle: Handle<DangerZone.ActionProps, DangerZone.ActionContext>) => () => import("remix/component").RemixElement;
|
|
67
|
+
var ActionTitle: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
|
|
68
|
+
var ActionDescription: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
|
|
69
|
+
var Consequences: (handle: Handle<TagProps<"ul">>) => () => import("remix/component").RemixElement;
|
|
70
|
+
var Trigger: (handle: Handle<DangerZone.TriggerProps>) => () => import("remix/component").RemixElement;
|
|
66
71
|
}
|
package/dist/app/danger-zone.js
CHANGED
|
@@ -1,66 +1,209 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
2
2
|
import { bg, border, fg } from "@sdxc/u/color";
|
|
3
3
|
import { rounded } from "@sdxc/u/effects";
|
|
4
|
-
import { listStyle, mergeMix } from "@sdxc/u/general";
|
|
4
|
+
import { listStyle, mergeMix, raw } from "@sdxc/u/general";
|
|
5
5
|
import { container, vstack } from "@sdxc/u/layout";
|
|
6
6
|
import { divide, overflow } from "@sdxc/u/overflow";
|
|
7
7
|
import { m, minIs, p, pis } from "@sdxc/u/size";
|
|
8
|
+
import { when } from "@sdxc/u/state";
|
|
8
9
|
import { balance, pretty, text, weight } from "@sdxc/u/typography";
|
|
9
10
|
import { Button } from "../components/button.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
11
|
+
import { onTitleLine } from "./styles/action-row.js";
|
|
12
|
+
/** The marker attribute the section's and rows' layouts select their parts by. */
|
|
13
|
+
const PART = "data-danger-zone-part";
|
|
12
14
|
/** Container an action row measures, stacking its button under the text when narrow. */
|
|
13
15
|
const ROW_CONTAINER = "ui-danger-zone";
|
|
16
|
+
/** Container width from which an end-placed button leaves the stack for the row's end. */
|
|
17
|
+
const ROW_WIDE = `@container ${ROW_CONTAINER} (min-width: 32rem)`;
|
|
14
18
|
/** Where an action's button sits when `actionPlacement` is omitted. */
|
|
15
19
|
const DEFAULT_ACTION_PLACEMENT = "below";
|
|
16
20
|
/**
|
|
17
|
-
* Renders the section
|
|
18
|
-
* {@link DangerZone.
|
|
21
|
+
* Renders the section, laying out its {@link DangerZone.Title}, {@link DangerZone.Description}
|
|
22
|
+
* and {@link DangerZone.Card} in the order given, each spaced from the one before it.
|
|
19
23
|
*
|
|
20
24
|
* @param handle Runtime handle carrying the section's props.
|
|
21
25
|
* @returns The render function producing the section's markup.
|
|
22
26
|
* @example
|
|
23
|
-
* <DangerZone
|
|
24
|
-
* <DangerZone.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* <DangerZone>
|
|
28
|
+
* <DangerZone.Title>Danger zone</DangerZone.Title>
|
|
29
|
+
* <DangerZone.Card>
|
|
30
|
+
* <DangerZone.Action>
|
|
31
|
+
* <DangerZone.ActionTitle>Delete team</DangerZone.ActionTitle>
|
|
32
|
+
* <DangerZone.Consequences><li>14 monitors stop checking</li></DangerZone.Consequences>
|
|
33
|
+
* <DangerZone.Trigger commandfor="delete-team">Delete team</DangerZone.Trigger>
|
|
34
|
+
* <Confirm id="delete-team" … />
|
|
35
|
+
* </DangerZone.Action>
|
|
36
|
+
* </DangerZone.Card>
|
|
27
37
|
* </DangerZone>
|
|
28
38
|
*/
|
|
29
39
|
export function DangerZone(handle) {
|
|
30
40
|
return () => {
|
|
31
|
-
let {
|
|
41
|
+
let { children, mix, ...rest } = handle.props;
|
|
32
42
|
let titleId = `${handle.id}-title`;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
divide("block", "danger"),
|
|
40
|
-
], children: children })] }));
|
|
43
|
+
handle.context.set({ titleId });
|
|
44
|
+
return (_jsx("section", { "aria-labelledby": rest["aria-label"] === undefined ? titleId : undefined, "data-slot": "danger-zone", ...rest, mix: mergeMix([
|
|
45
|
+
vstack({ gap: 0, align: "stretch" }),
|
|
46
|
+
when(`& > [${PART}=description]:not(:first-child)`, raw({ marginBlockStart: "0.25rem" })),
|
|
47
|
+
when(`& > [${PART}=card]:not(:first-child)`, raw({ marginBlockStart: "0.75rem" })),
|
|
48
|
+
], mix), children: children }));
|
|
41
49
|
};
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
|
-
*
|
|
45
|
-
* danger button that opens its {@link Confirm}, under the text or at the row's end as
|
|
46
|
-
* `actionPlacement` says.
|
|
52
|
+
* The section's heading, which names it.
|
|
47
53
|
*
|
|
48
|
-
* @param handle Runtime handle carrying the
|
|
54
|
+
* @param handle Runtime handle carrying the heading's props.
|
|
55
|
+
* @returns The render function producing the heading.
|
|
56
|
+
* @example <DangerZone.Title>Danger zone</DangerZone.Title>
|
|
57
|
+
*/
|
|
58
|
+
DangerZone.Title = function DangerZoneTitle(handle) {
|
|
59
|
+
return () => {
|
|
60
|
+
let { children, mix, ...rest } = handle.props;
|
|
61
|
+
let context = handle.context.get(DangerZone);
|
|
62
|
+
return (_jsx("h2", { id: context?.titleId, "data-slot": "danger-zone-title", "data-danger-zone-part": "title", ...rest, mix: mergeMix([m(0), text("base"), weight("semibold"), fg("neutral.emphasis"), balance()], mix), children: children }));
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A muted line under the section's heading.
|
|
67
|
+
*
|
|
68
|
+
* @param handle Runtime handle carrying the paragraph's props.
|
|
69
|
+
* @returns The render function producing the paragraph.
|
|
70
|
+
* @example <DangerZone.Description>These actions cannot be undone.</DangerZone.Description>
|
|
71
|
+
*/
|
|
72
|
+
DangerZone.Description = function DangerZoneDescription(handle) {
|
|
73
|
+
return () => {
|
|
74
|
+
let { children, mix, ...rest } = handle.props;
|
|
75
|
+
return (_jsx("p", { "data-slot": "danger-zone-description", "data-danger-zone-part": "description", ...rest, mix: mergeMix([m(0), text("sm"), fg("neutral.muted"), pretty()], mix), children: children }));
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The danger-bordered card holding the section's {@link DangerZone.Action} rows, a rule
|
|
80
|
+
* between each.
|
|
81
|
+
*
|
|
82
|
+
* @param handle Runtime handle carrying the card's props.
|
|
83
|
+
* @returns The render function producing the card.
|
|
84
|
+
* @example <DangerZone.Card><DangerZone.Action>…</DangerZone.Action></DangerZone.Card>
|
|
85
|
+
*/
|
|
86
|
+
DangerZone.Card = function DangerZoneCard(handle) {
|
|
87
|
+
return () => {
|
|
88
|
+
let { children, mix, ...rest } = handle.props;
|
|
89
|
+
return (_jsx("div", { "data-slot": "danger-zone-card", "data-danger-zone-part": "card", ...rest, mix: mergeMix([
|
|
90
|
+
vstack({ gap: 0, align: "stretch" }),
|
|
91
|
+
rounded("lg"),
|
|
92
|
+
border({ color: "danger", width: 1 }),
|
|
93
|
+
bg(),
|
|
94
|
+
overflow("hidden"),
|
|
95
|
+
divide("block", "danger"),
|
|
96
|
+
], mix), children: children }));
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* One irreversible action as a row: its {@link DangerZone.ActionTitle},
|
|
101
|
+
* {@link DangerZone.ActionDescription} and {@link DangerZone.Consequences} stack in one column,
|
|
102
|
+
* and its {@link DangerZone.Trigger} sits under them or at the row's end as `actionPlacement`
|
|
103
|
+
* says. Put the `Confirm` the trigger opens inside the row too; it takes no room while closed.
|
|
104
|
+
*
|
|
105
|
+
* @param handle Runtime handle carrying the row's props.
|
|
49
106
|
* @returns The render function producing the row's markup.
|
|
50
107
|
* @example
|
|
51
|
-
* <DangerZone.Action
|
|
108
|
+
* <DangerZone.Action actionPlacement="end">
|
|
109
|
+
* <DangerZone.ActionTitle>Transfer ownership</DangerZone.ActionTitle>
|
|
110
|
+
* <DangerZone.Trigger commandfor="transfer">Transfer…</DangerZone.Trigger>
|
|
111
|
+
* <Confirm id="transfer" … />
|
|
112
|
+
* </DangerZone.Action>
|
|
52
113
|
*/
|
|
53
114
|
DangerZone.Action = function DangerZoneAction(handle) {
|
|
54
115
|
return () => {
|
|
55
|
-
let {
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
116
|
+
let { actionPlacement = DEFAULT_ACTION_PLACEMENT, children, mix, ...rest } = handle.props;
|
|
117
|
+
handle.context.set({ actionPlacement });
|
|
118
|
+
return (_jsx("div", { "data-slot": "danger-zone-action", "data-action-placement": actionPlacement, ...rest, mix: mergeMix([container(ROW_CONTAINER)], mix), children: _jsx("div", { "data-slot": "danger-zone-row", mix: [
|
|
119
|
+
p(4),
|
|
120
|
+
raw({
|
|
121
|
+
display: "grid",
|
|
122
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
123
|
+
alignItems: "start",
|
|
124
|
+
justifyItems: "stretch",
|
|
125
|
+
rowGap: "0.25rem",
|
|
126
|
+
columnGap: "1.5rem",
|
|
127
|
+
...(actionPlacement === "end"
|
|
128
|
+
? { [ROW_WIDE]: { gridTemplateColumns: "minmax(0, 1fr) auto" } }
|
|
129
|
+
: {}),
|
|
130
|
+
}),
|
|
131
|
+
when(`& > :not([${PART}=control])`, raw({ gridColumn: "1" })),
|
|
132
|
+
], children: children }) }));
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* What the action does, the row's first line.
|
|
137
|
+
*
|
|
138
|
+
* @param handle Runtime handle carrying the paragraph's props.
|
|
139
|
+
* @returns The render function producing the title.
|
|
140
|
+
* @example <DangerZone.ActionTitle>Delete team</DangerZone.ActionTitle>
|
|
141
|
+
*/
|
|
142
|
+
DangerZone.ActionTitle = function DangerZoneActionTitle(handle) {
|
|
143
|
+
return () => {
|
|
144
|
+
let { children, mix, ...rest } = handle.props;
|
|
145
|
+
return (_jsx("p", { "data-slot": "danger-zone-action-title", "data-danger-zone-part": "action-title", ...rest, mix: mergeMix([m(0), text("sm"), weight("medium"), fg("neutral.emphasis")], mix), children: children }));
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* A muted line explaining the action.
|
|
150
|
+
*
|
|
151
|
+
* @param handle Runtime handle carrying the paragraph's props.
|
|
152
|
+
* @returns The render function producing the description.
|
|
153
|
+
* @example <DangerZone.ActionDescription>Permanently delete Acme Ops.</DangerZone.ActionDescription>
|
|
154
|
+
*/
|
|
155
|
+
DangerZone.ActionDescription = function DangerZoneActionDescription(handle) {
|
|
156
|
+
return () => {
|
|
157
|
+
let { children, mix, ...rest } = handle.props;
|
|
158
|
+
return (_jsx("p", { "data-slot": "danger-zone-action-description", "data-danger-zone-part": "action-description", ...rest, mix: mergeMix([m(0), text("sm"), fg("neutral.muted"), pretty()], mix), children: children }));
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* What is lost, as a bulleted list of `<li>` children: "14 monitors stop checking", "Invoices
|
|
163
|
+
* stay in Billing".
|
|
164
|
+
*
|
|
165
|
+
* @param handle Runtime handle carrying the list's props.
|
|
166
|
+
* @returns The render function producing the list.
|
|
167
|
+
* @example <DangerZone.Consequences><li>Status pages go offline</li></DangerZone.Consequences>
|
|
168
|
+
*/
|
|
169
|
+
DangerZone.Consequences = function DangerZoneConsequences(handle) {
|
|
170
|
+
return () => {
|
|
171
|
+
let { children, mix, ...rest } = handle.props;
|
|
172
|
+
return (_jsx("ul", { "data-slot": "danger-zone-consequences", "data-danger-zone-part": "consequences", ...rest, mix: mergeMix([
|
|
173
|
+
vstack({ gap: 0.5, align: "stretch" }),
|
|
174
|
+
m(0),
|
|
175
|
+
pis(5),
|
|
176
|
+
listStyle("disc"),
|
|
177
|
+
text("sm"),
|
|
178
|
+
fg("neutral.muted"),
|
|
179
|
+
], mix), children: children }));
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The row's danger button, which opens the `Confirm` its `commandfor` names. Under the text it
|
|
184
|
+
* keeps a wider gap from the line above; placed at the end of a wide row it is centred on the
|
|
185
|
+
* title's first line.
|
|
186
|
+
*
|
|
187
|
+
* @param handle Runtime handle carrying the button's props.
|
|
188
|
+
* @returns The render function producing the button in its cell.
|
|
189
|
+
* @example <DangerZone.Trigger commandfor="delete-team">Delete team</DangerZone.Trigger>
|
|
190
|
+
*/
|
|
191
|
+
DangerZone.Trigger = function DangerZoneTrigger(handle) {
|
|
192
|
+
return () => {
|
|
193
|
+
let { children, mix, ...rest } = handle.props;
|
|
194
|
+
let context = handle.context.get(DangerZone.Action);
|
|
195
|
+
let end = (context?.actionPlacement ?? DEFAULT_ACTION_PLACEMENT) === "end";
|
|
196
|
+
return (_jsx("div", { "data-slot": "danger-zone-control", "data-danger-zone-part": "control", mix: [
|
|
197
|
+
minIs(0),
|
|
198
|
+
raw({
|
|
199
|
+
gridColumn: "1",
|
|
200
|
+
justifySelf: "start",
|
|
201
|
+
marginBlockStart: "0.5rem",
|
|
202
|
+
...(end
|
|
203
|
+
? { [ROW_WIDE]: { gridColumn: "2", gridRow: "1", marginBlockStart: "0" } }
|
|
204
|
+
: {}),
|
|
205
|
+
}),
|
|
206
|
+
end ? onTitleLine(ROW_CONTAINER) : undefined,
|
|
207
|
+
], children: _jsx(Button, { command: "show-modal", color: "danger", variant: "outline", size: "sm", "data-slot": "danger-zone-trigger", ...rest, mix: mix, children: children }) }));
|
|
65
208
|
};
|
|
66
209
|
};
|