@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
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { ArrowLeftIcon, ArrowRightIcon } from "@sdxc/icons";
|
|
3
|
+
import { outline } from "@sdxc/u/color";
|
|
4
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
5
|
+
import { hstack, vstack } from "@sdxc/u/layout";
|
|
6
|
+
import { hover, when } from "@sdxc/u/state";
|
|
7
|
+
import { overflowWrap, text, textAlign, textDecoration } from "@sdxc/u/typography";
|
|
8
|
+
import { interactiveTransition } from "../styles/interactive-transition.js";
|
|
9
|
+
/** The landmark name {@link Pager} announces when `aria-label` is omitted. */
|
|
10
|
+
const DEFAULT_LABEL = "Pagination";
|
|
11
|
+
/** How {@link Pager} lays out its links when `layout` is omitted. */
|
|
12
|
+
const DEFAULT_LAYOUT = "auto";
|
|
13
|
+
/** The container an `"auto"` pager names on its root, so it answers its own width. */
|
|
14
|
+
const CONTAINER = "ui-pager";
|
|
15
|
+
/** The pager's own width below which an `"auto"` pager stacks its links. */
|
|
16
|
+
const STACK_BELOW = "30rem";
|
|
17
|
+
/** A link's width while the links share one row. */
|
|
18
|
+
const ROW_LINK = { inlineSize: "var(--ui-pager-link-inline-size, auto)" };
|
|
19
|
+
/** A link's place in a stacked pager: its own full-width line, previous above next. */
|
|
20
|
+
const STACKED_LINK = { gridColumn: "1 / -1", justifySelf: "stretch", inlineSize: "100%" };
|
|
21
|
+
/**
|
|
22
|
+
* Renders a `<nav>` laid out as three columns, so {@link Pager.Previous} and {@link Pager.Next}
|
|
23
|
+
* each stay at their own end whether or not the other exists, with a {@link Pager.Status} centred
|
|
24
|
+
* between them; under 30rem wide the links stack. Restyle through {@link Pager.CustomProperties}.
|
|
25
|
+
*
|
|
26
|
+
* @param handle Runtime handle carrying the host `<nav>`'s props.
|
|
27
|
+
* @returns The render function producing the pager's markup.
|
|
28
|
+
* @example
|
|
29
|
+
* <Pager>
|
|
30
|
+
* <Pager.Previous href="/?page=1">Newer</Pager.Previous>
|
|
31
|
+
* <Pager.Status>Page 2 of 5</Pager.Status>
|
|
32
|
+
* <Pager.Next href="/?page=3">Older</Pager.Next>
|
|
33
|
+
* </Pager>
|
|
34
|
+
* @example
|
|
35
|
+
* <Pager layout="stack">
|
|
36
|
+
* <Pager.Previous href="/posts/one"><Pager.Caption>Previous</Pager.Caption><Pager.Label>The first post</Pager.Label></Pager.Previous>
|
|
37
|
+
* </Pager>
|
|
38
|
+
*/
|
|
39
|
+
export function Pager(handle) {
|
|
40
|
+
return () => {
|
|
41
|
+
let { layout = DEFAULT_LAYOUT, children, mix, ...rest } = handle.props;
|
|
42
|
+
handle.context.set({ layout });
|
|
43
|
+
return (_jsx("nav", { "data-slot": "pager", "aria-label": DEFAULT_LABEL, ...rest, "data-pager-layout": layout, mix: mergeMix(layout === "auto"
|
|
44
|
+
? [raw({ containerType: "inline-size", containerName: CONTAINER })]
|
|
45
|
+
: [], mix), children: _jsx("div", { "data-slot": "pager-row", mix: [
|
|
46
|
+
raw({ display: "grid", alignItems: "center" }),
|
|
47
|
+
...placed(layout, { gridTemplateColumns: "minmax(0, 1fr) auto minmax(0, 1fr)", gap: "1rem" }, { gridTemplateColumns: "minmax(0, 1fr)", gap: "0.5rem" }),
|
|
48
|
+
], children: children }) }));
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The link at the row's start, with an arrow pointing back; its words stack at its start.
|
|
53
|
+
*
|
|
54
|
+
* @param handle Runtime handle carrying the link's props.
|
|
55
|
+
* @returns The render function producing the link.
|
|
56
|
+
*/
|
|
57
|
+
Pager.Previous = function PagerPrevious(handle) {
|
|
58
|
+
return () => {
|
|
59
|
+
let { children, mix, ...rest } = handle.props;
|
|
60
|
+
let layout = handle.context.get(Pager)?.layout ?? DEFAULT_LAYOUT;
|
|
61
|
+
return (_jsxs("a", { rel: "prev", "data-slot": "pager-previous", ...rest, mix: mergeMix([
|
|
62
|
+
...pagerLink(),
|
|
63
|
+
...placed(layout, { ...ROW_LINK, gridColumn: "1", justifySelf: "start" }, STACKED_LINK),
|
|
64
|
+
], mix), children: [_jsx(ArrowLeftIcon, { size: 16, mix: mirrored() }), _jsx("span", { "data-slot": "pager-text", mix: [vstack({ align: "start" }), raw({ minInlineSize: "0" })], children: children })] }));
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The link at the row's end, with an arrow pointing forward; its words stack at its end.
|
|
69
|
+
*
|
|
70
|
+
* @param handle Runtime handle carrying the link's props.
|
|
71
|
+
* @returns The render function producing the link.
|
|
72
|
+
*/
|
|
73
|
+
Pager.Next = function PagerNext(handle) {
|
|
74
|
+
return () => {
|
|
75
|
+
let { children, mix, ...rest } = handle.props;
|
|
76
|
+
let layout = handle.context.get(Pager)?.layout ?? DEFAULT_LAYOUT;
|
|
77
|
+
return (_jsxs("a", { rel: "next", "data-slot": "pager-next", ...rest, mix: mergeMix([
|
|
78
|
+
...pagerLink(),
|
|
79
|
+
raw({ justifyContent: "flex-end" }),
|
|
80
|
+
textAlign("end"),
|
|
81
|
+
...placed(layout, { ...ROW_LINK, gridColumn: "3", justifySelf: "end" }, STACKED_LINK),
|
|
82
|
+
], mix), children: [_jsx("span", { "data-slot": "pager-text", mix: [vstack({ align: "end" }), raw({ minInlineSize: "0" })], children: children }), _jsx(ArrowRightIcon, { size: 16, mix: mirrored() })] }));
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* A small line over a link's label naming the direction, such as "Previous" over a post title.
|
|
87
|
+
*
|
|
88
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
89
|
+
* @returns The render function producing the caption.
|
|
90
|
+
*/
|
|
91
|
+
Pager.Caption = function PagerCaption(handle) {
|
|
92
|
+
return () => {
|
|
93
|
+
let { mix, ...rest } = handle.props;
|
|
94
|
+
return (_jsx("span", { "data-slot": "pager-caption", ...rest, mix: mergeMix([
|
|
95
|
+
raw({
|
|
96
|
+
color: "var(--ui-pager-caption-fg, var(--ui-neutral-fg-muted))",
|
|
97
|
+
fontSize: "var(--ui-pager-caption-font-size, var(--ui-text-xs, 0.75rem))",
|
|
98
|
+
lineHeight: "var(--ui-leading-xs, calc(1 / 0.75))",
|
|
99
|
+
fontWeight: "400",
|
|
100
|
+
}),
|
|
101
|
+
], mix) }));
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* What a link says under its caption, such as "Older" or the title of the post it leads to.
|
|
106
|
+
*
|
|
107
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
108
|
+
* @returns The render function producing the label.
|
|
109
|
+
*/
|
|
110
|
+
Pager.Label = function PagerLabel(handle) {
|
|
111
|
+
return () => _jsx("span", { "data-slot": "pager-label", ...handle.props });
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Where the reader is, centred between the links, such as "Page 2 of 5".
|
|
115
|
+
*
|
|
116
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
117
|
+
* @returns The render function producing the status line.
|
|
118
|
+
*/
|
|
119
|
+
Pager.Status = function PagerStatus(handle) {
|
|
120
|
+
return () => {
|
|
121
|
+
let { mix, ...rest } = handle.props;
|
|
122
|
+
let layout = handle.context.get(Pager)?.layout ?? DEFAULT_LAYOUT;
|
|
123
|
+
return (_jsx("span", { "data-slot": "pager-status", ...rest, mix: mergeMix([
|
|
124
|
+
raw({ color: "var(--ui-pager-status-fg, var(--ui-neutral-fg-muted))" }),
|
|
125
|
+
text("sm"),
|
|
126
|
+
textAlign("center"),
|
|
127
|
+
...placed(layout, { gridColumn: "2" }, { gridColumn: "1 / -1" }),
|
|
128
|
+
], mix) }));
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* An element's place in the row or in the stack, picked by `layout`; `"auto"` holds both
|
|
133
|
+
* under mutually exclusive queries on the pager's own width, so neither overrides the other.
|
|
134
|
+
*
|
|
135
|
+
* @param layout The pager's layout.
|
|
136
|
+
* @param row The styles while the links share one row.
|
|
137
|
+
* @param stack The styles while the links stack.
|
|
138
|
+
*/
|
|
139
|
+
function placed(layout, row, stack) {
|
|
140
|
+
if (layout === "row")
|
|
141
|
+
return [raw(row)];
|
|
142
|
+
if (layout === "stack")
|
|
143
|
+
return [raw(stack)];
|
|
144
|
+
return [
|
|
145
|
+
raw({
|
|
146
|
+
[`@container ${CONTAINER} (width >= ${STACK_BELOW})`]: row,
|
|
147
|
+
[`@container ${CONTAINER} (width < ${STACK_BELOW})`]: stack,
|
|
148
|
+
}),
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* A pager link: a bordered target holding its label and arrow, tinted on hover. Every visible
|
|
153
|
+
* choice reads a `--ui-pager-*` property with the default as its fallback.
|
|
154
|
+
*/
|
|
155
|
+
function pagerLink() {
|
|
156
|
+
return [
|
|
157
|
+
interactiveTransition(),
|
|
158
|
+
hstack({ gap: 2, align: "center" }),
|
|
159
|
+
textDecoration("none"),
|
|
160
|
+
overflowWrap("anywhere"),
|
|
161
|
+
raw({
|
|
162
|
+
boxSizing: "border-box",
|
|
163
|
+
maxInlineSize: "100%",
|
|
164
|
+
padding: "var(--ui-pager-link-padding, 0.5rem 0.875rem)",
|
|
165
|
+
borderRadius: "var(--ui-pager-link-radius, var(--ui-radius-md, 0.375rem))",
|
|
166
|
+
borderWidth: "1px",
|
|
167
|
+
borderStyle: "solid",
|
|
168
|
+
borderColor: "var(--ui-pager-link-border-color, var(--ui-neutral-border))",
|
|
169
|
+
backgroundColor: "var(--ui-pager-link-bg, transparent)",
|
|
170
|
+
color: "var(--ui-pager-link-fg, var(--ui-neutral-fg-emphasis))",
|
|
171
|
+
fontWeight: "var(--ui-pager-link-font-weight, 500)",
|
|
172
|
+
}),
|
|
173
|
+
hover(raw({
|
|
174
|
+
backgroundColor: "var(--ui-pager-link-hover-bg, var(--ui-neutral-bg-tint))",
|
|
175
|
+
color: "var(--ui-pager-link-hover-fg, var(--ui-pager-link-fg, var(--ui-neutral-fg-emphasis)))",
|
|
176
|
+
borderColor: "var(--ui-pager-link-hover-border-color, var(--ui-pager-link-border-color, var(--ui-neutral-border)))",
|
|
177
|
+
})),
|
|
178
|
+
when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Keeps an arrow at full size beside a long label, and flips it in a right-to-left page, so
|
|
183
|
+
* "back" always points toward the row's start.
|
|
184
|
+
*/
|
|
185
|
+
function mirrored() {
|
|
186
|
+
return [raw({ flexShrink: "0" }), when("&:dir(rtl)", raw({ transform: "scaleX(-1)" }))];
|
|
187
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Label/value rows for one record's properties, as a `<dl
|
|
3
|
-
* each value that stacks once its container narrows, empty values named in words, and
|
|
4
|
-
* editable
|
|
2
|
+
* Label/value rows for one record's properties, as a `<dl>` of parts: a fixed label column
|
|
3
|
+
* beside each value that stacks once its container narrows, empty values named in words, and
|
|
4
|
+
* an editable value that opens an anchored native popover holding the app's own form.
|
|
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 { Popover } from "./popover.js";
|
|
10
11
|
/**
|
|
11
12
|
* Prop types for {@link PropertyList} and its compound parts.
|
|
12
13
|
*/
|
|
@@ -25,39 +26,30 @@ export declare namespace PropertyList {
|
|
|
25
26
|
/** @default {@link DEFAULT_VARIANT} */
|
|
26
27
|
variant?: Variant;
|
|
27
28
|
}
|
|
29
|
+
/** Every native `<div>` attribute; a {@link PropertyList.Label} and a {@link PropertyList.Value} go inside. */
|
|
30
|
+
interface ItemProps extends TagProps<"div"> {
|
|
31
|
+
}
|
|
32
|
+
/** Every native `<dt>` attribute. */
|
|
33
|
+
interface LabelProps extends TagProps<"dt"> {
|
|
34
|
+
}
|
|
35
|
+
/** Every native `<dd>` attribute. */
|
|
36
|
+
interface ValueProps extends TagProps<"dd"> {
|
|
37
|
+
}
|
|
38
|
+
/** Every native `<span>` attribute. */
|
|
39
|
+
interface EmptyProps extends TagProps<"span"> {
|
|
40
|
+
}
|
|
28
41
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* own popover given as `popover`.
|
|
42
|
+
* Every native `<button>` attribute, with the `popovertarget` naming the popover it opens,
|
|
43
|
+
* plus what the button does, read before the current value.
|
|
32
44
|
*/
|
|
33
|
-
interface
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/** What the button does, read before the current value, such as "Edit assignee". */
|
|
45
|
+
interface EditProps extends Omit<TagProps<"button">, "type"> {
|
|
46
|
+
popovertarget: string;
|
|
47
|
+
/** What the button does, such as "Edit assignee", read before the value it holds. */
|
|
37
48
|
label: string;
|
|
38
|
-
/** The popover's content: the app's form, its described options and its submit. */
|
|
39
|
-
content?: RemixNode;
|
|
40
|
-
/**
|
|
41
|
-
* A whole popover whose `id` is `id`, drawn in place of the row's own and its `content`,
|
|
42
|
-
* such as a `FilterMenu.Popover` picker for a multi-value property; the value button
|
|
43
|
-
* still opens it and anchors it under the row.
|
|
44
|
-
*/
|
|
45
|
-
popover?: RemixNode;
|
|
46
49
|
}
|
|
47
|
-
/** Every
|
|
48
|
-
interface
|
|
49
|
-
|
|
50
|
-
label: RemixNode;
|
|
51
|
-
/**
|
|
52
|
-
* What the row says when `children` is empty, such as "None" or "No reviews".
|
|
53
|
-
*
|
|
54
|
-
* @default "—"
|
|
55
|
-
*/
|
|
56
|
-
empty?: RemixNode;
|
|
57
|
-
/** Turns the value into a button opening an anchored edit popover. */
|
|
58
|
-
edit?: Edit;
|
|
59
|
-
/** The value: text, a link, a badge, an avatar with a name. */
|
|
60
|
-
children?: RemixNode;
|
|
50
|
+
/** Every {@link Popover} prop but its placement and role, with the `id` an edit button opens. */
|
|
51
|
+
interface PopoverProps extends Omit<Popover.Props, "placement" | "role"> {
|
|
52
|
+
id: string;
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
/**
|
|
@@ -69,15 +61,22 @@ export declare namespace PropertyList {
|
|
|
69
61
|
* @returns The render function producing the list's markup.
|
|
70
62
|
* @example
|
|
71
63
|
* <PropertyList>
|
|
72
|
-
* <PropertyList.Item
|
|
73
|
-
*
|
|
74
|
-
* </PropertyList>
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
64
|
+
* <PropertyList.Item>
|
|
65
|
+
* <PropertyList.Label>Status</PropertyList.Label>
|
|
66
|
+
* <PropertyList.Value><Badge color="success">Up</Badge></PropertyList.Value>
|
|
67
|
+
* </PropertyList.Item>
|
|
68
|
+
* <PropertyList.Item>
|
|
69
|
+
* <PropertyList.Label>Reviewers</PropertyList.Label>
|
|
70
|
+
* <PropertyList.Value><PropertyList.Empty>No reviews</PropertyList.Empty></PropertyList.Value>
|
|
71
|
+
* </PropertyList.Item>
|
|
78
72
|
* </PropertyList>
|
|
79
73
|
*/
|
|
80
74
|
export declare function PropertyList(handle: Handle<PropertyList.Props, PropertyList.Context>): () => import("remix/component").RemixElement;
|
|
81
75
|
export declare namespace PropertyList {
|
|
82
76
|
var Item: (handle: Handle<PropertyList.ItemProps>) => () => import("remix/component").RemixElement;
|
|
77
|
+
var Label: (handle: Handle<PropertyList.LabelProps>) => () => import("remix/component").RemixElement;
|
|
78
|
+
var Value: (handle: Handle<PropertyList.ValueProps>) => () => import("remix/component").RemixElement;
|
|
79
|
+
var Empty: (handle: Handle<PropertyList.EmptyProps>) => () => import("remix/component").RemixElement;
|
|
80
|
+
var Edit: (handle: Handle<PropertyList.EditProps>) => () => import("remix/component").RemixElement;
|
|
81
|
+
var Popover: (handle: Handle<PropertyList.PopoverProps>) => () => import("remix/component").RemixElement;
|
|
83
82
|
}
|
|
@@ -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 { ChevronDownIcon } from "@sdxc/icons";
|
|
3
3
|
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
4
4
|
import { bg, border, fg, outline } from "@sdxc/u/color";
|
|
@@ -38,12 +38,14 @@ function isEmptyValue(node) {
|
|
|
38
38
|
* @returns The render function producing the list's markup.
|
|
39
39
|
* @example
|
|
40
40
|
* <PropertyList>
|
|
41
|
-
* <PropertyList.Item
|
|
42
|
-
*
|
|
43
|
-
* </PropertyList>
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
41
|
+
* <PropertyList.Item>
|
|
42
|
+
* <PropertyList.Label>Status</PropertyList.Label>
|
|
43
|
+
* <PropertyList.Value><Badge color="success">Up</Badge></PropertyList.Value>
|
|
44
|
+
* </PropertyList.Item>
|
|
45
|
+
* <PropertyList.Item>
|
|
46
|
+
* <PropertyList.Label>Reviewers</PropertyList.Label>
|
|
47
|
+
* <PropertyList.Value><PropertyList.Empty>No reviews</PropertyList.Empty></PropertyList.Value>
|
|
48
|
+
* </PropertyList.Item>
|
|
47
49
|
* </PropertyList>
|
|
48
50
|
*/
|
|
49
51
|
export function PropertyList(handle) {
|
|
@@ -73,36 +75,18 @@ export function PropertyList(handle) {
|
|
|
73
75
|
};
|
|
74
76
|
}
|
|
75
77
|
/**
|
|
76
|
-
*
|
|
77
|
-
* (9rem) from a 22rem container up and stacks over the value below that;
|
|
78
|
-
*
|
|
78
|
+
* One property. In the rows variant the label column holds `--ui-property-list-label-width`
|
|
79
|
+
* (9rem) from a 22rem container up and stacks over the value below that; in tiles each property
|
|
80
|
+
* is its own bordered tile.
|
|
79
81
|
*
|
|
80
82
|
* @param handle Runtime handle carrying the group `<div>`'s props.
|
|
81
|
-
* @returns The render function producing the row
|
|
82
|
-
* @example
|
|
83
|
-
* <PropertyList.Item label="Owner"><a href="/people/ana">Ana Souza</a></PropertyList.Item>
|
|
84
|
-
* @example
|
|
85
|
-
* <PropertyList.Item
|
|
86
|
-
* label="Assignee"
|
|
87
|
-
* empty="No one"
|
|
88
|
-
* edit={{ id: "edit-assignee", label: "Edit assignee", content: <AssigneeForm /> }}
|
|
89
|
-
* >
|
|
90
|
-
* {assignee?.name}
|
|
91
|
-
* </PropertyList.Item>
|
|
92
|
-
* @example
|
|
93
|
-
* <PropertyList.Item label="Labels" empty="None yet"
|
|
94
|
-
* edit={{ id: "edit-labels", label: "Edit labels", popover: <FilterMenu.Popover id="edit-labels" {...picker} /> }}>
|
|
95
|
-
* {chips}
|
|
96
|
-
* </PropertyList.Item>
|
|
83
|
+
* @returns The render function producing the row.
|
|
97
84
|
*/
|
|
98
85
|
PropertyList.Item = function PropertyListItem(handle) {
|
|
99
86
|
return () => {
|
|
100
|
-
let {
|
|
101
|
-
let
|
|
102
|
-
|
|
103
|
-
let isEmpty = isEmptyValue(children);
|
|
104
|
-
let value = isEmpty ? (_jsx("span", { "data-slot": "property-empty", mix: [fg("neutral.muted")], children: empty ?? DEFAULT_EMPTY })) : (children);
|
|
105
|
-
return (_jsxs("div", { "data-slot": "property", ...rest, mix: mergeMix(tiles
|
|
87
|
+
let { mix, ...rest } = handle.props;
|
|
88
|
+
let tiles = variantOf(handle) === "tiles";
|
|
89
|
+
return (_jsx("div", { "data-slot": "property", ...rest, mix: mergeMix(tiles
|
|
106
90
|
? [
|
|
107
91
|
vstack({ gap: 1 }),
|
|
108
92
|
p(3),
|
|
@@ -126,77 +110,146 @@ PropertyList.Item = function PropertyListItem(handle) {
|
|
|
126
110
|
columnGap: "1rem",
|
|
127
111
|
},
|
|
128
112
|
}),
|
|
129
|
-
], mix)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
113
|
+
], mix) }));
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The property's name, muted, and smaller in a tile.
|
|
118
|
+
*
|
|
119
|
+
* @param handle Runtime handle carrying the host `<dt>`'s props.
|
|
120
|
+
* @returns The render function producing the label.
|
|
121
|
+
*/
|
|
122
|
+
PropertyList.Label = function PropertyListLabel(handle) {
|
|
123
|
+
return () => {
|
|
124
|
+
let { mix, ...rest } = handle.props;
|
|
125
|
+
let tiles = variantOf(handle) === "tiles";
|
|
126
|
+
return (_jsx("dt", { "data-slot": "property-label", ...rest, mix: mergeMix([
|
|
127
|
+
m(0),
|
|
128
|
+
minIs(0),
|
|
129
|
+
fg("neutral.muted"),
|
|
130
|
+
tiles ? text("xs") : text("sm"),
|
|
131
|
+
leading("1.25rem"),
|
|
132
|
+
pb(tiles ? 0 : 1.5),
|
|
133
|
+
], mix) }));
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* The value: text, a link, a badge, an avatar with a name, or a {@link PropertyList.Edit}. A
|
|
138
|
+
* value left empty reads as an em dash; write a {@link PropertyList.Empty} to name it in words.
|
|
139
|
+
*
|
|
140
|
+
* @param handle Runtime handle carrying the host `<dd>`'s props.
|
|
141
|
+
* @returns The render function producing the value.
|
|
142
|
+
*/
|
|
143
|
+
PropertyList.Value = function PropertyListValue(handle) {
|
|
144
|
+
return () => {
|
|
145
|
+
let { children, mix, ...rest } = handle.props;
|
|
146
|
+
let tiles = variantOf(handle) === "tiles";
|
|
147
|
+
return (_jsx("dd", { "data-slot": "property-value", ...rest, mix: mergeMix([
|
|
148
|
+
m(0),
|
|
149
|
+
minIs(0),
|
|
150
|
+
flex(),
|
|
151
|
+
items("center"),
|
|
152
|
+
gap(1.5),
|
|
153
|
+
raw({ flexWrap: "wrap" }),
|
|
154
|
+
minBs("2rem"),
|
|
155
|
+
tabularNums(),
|
|
156
|
+
tiles ? [text("lg"), weight("semibold")] : null,
|
|
157
|
+
], mix), children: isEmptyValue(children) ? (_jsx(PropertyList.Empty, { children: DEFAULT_EMPTY })) : (children) }));
|
|
147
158
|
};
|
|
148
159
|
};
|
|
149
160
|
/**
|
|
150
|
-
*
|
|
151
|
-
* chevron on the label's row, and the popover it opens, the row's own or the app's. As the
|
|
152
|
-
* popover's invoker the button is its implicit anchor, so it opens under its row.
|
|
161
|
+
* What an empty value says, in muted words such as "None" or "No reviews".
|
|
153
162
|
*
|
|
154
|
-
* @param handle Runtime handle carrying the
|
|
155
|
-
* @returns The render function producing the
|
|
163
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
164
|
+
* @returns The render function producing the words.
|
|
156
165
|
*/
|
|
157
|
-
function
|
|
166
|
+
PropertyList.Empty = function PropertyListEmpty(handle) {
|
|
158
167
|
return () => {
|
|
159
|
-
let {
|
|
160
|
-
return (
|
|
168
|
+
let { mix, ...rest } = handle.props;
|
|
169
|
+
return _jsx("span", { "data-slot": "property-empty", ...rest, mix: mergeMix([fg("neutral.muted")], mix) });
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Makes a value editable in place: a full-width button naming its action before the current
|
|
174
|
+
* value, its chevron on the label's row while the label stacks, opening the popover its
|
|
175
|
+
* `popovertarget` names, which it anchors under the row as that popover's invoker.
|
|
176
|
+
*
|
|
177
|
+
* @param handle Runtime handle carrying the button's props.
|
|
178
|
+
* @returns The render function producing the button.
|
|
179
|
+
* @example
|
|
180
|
+
* <PropertyList.Value>
|
|
181
|
+
* <PropertyList.Edit popovertarget="edit-assignee" label="Edit assignee">{assignee.name}</PropertyList.Edit>
|
|
182
|
+
* <PropertyList.Popover id="edit-assignee" aria-label="Edit assignee"><AssigneeForm /></PropertyList.Popover>
|
|
183
|
+
* </PropertyList.Value>
|
|
184
|
+
*/
|
|
185
|
+
PropertyList.Edit = function PropertyListEdit(handle) {
|
|
186
|
+
return () => {
|
|
187
|
+
let { label, children, mix, ...rest } = handle.props;
|
|
188
|
+
let labelRow = variantOf(handle) !== "tiles";
|
|
189
|
+
return (_jsxs("button", { type: "button", "data-slot": "property-edit", "aria-haspopup": "dialog", ...rest, mix: mergeMix([
|
|
190
|
+
flex(),
|
|
191
|
+
items("center"),
|
|
192
|
+
justify("between"),
|
|
193
|
+
gap(1.5),
|
|
194
|
+
is("full"),
|
|
195
|
+
minBs("2rem"),
|
|
196
|
+
pi(2),
|
|
197
|
+
raw({
|
|
198
|
+
marginInline: "-0.5rem",
|
|
199
|
+
inlineSize: "calc(100% + 1rem)",
|
|
200
|
+
paddingBlock: "0.25rem",
|
|
201
|
+
}),
|
|
202
|
+
rounded("md"),
|
|
203
|
+
border({ color: "transparent", width: 0 }),
|
|
204
|
+
bg("transparent"),
|
|
205
|
+
fg(),
|
|
206
|
+
text("sm"),
|
|
207
|
+
textAlign("start"),
|
|
208
|
+
cursor("pointer"),
|
|
209
|
+
transition("background-color"),
|
|
210
|
+
hover(bg("neutral.tint")),
|
|
211
|
+
focusVisible(outline({ color: "brand.ring", width: 2, offset: -2 })),
|
|
212
|
+
], mix), children: [_jsxs("span", { mix: [flex(), items("center"), gap(1.5), raw({ flexWrap: "wrap" }), minIs(0)], children: [_jsx("span", { mix: [visuallyHidden()], children: `${label}: ` }), children] }), _jsx("span", { "aria-hidden": "true", mix: [
|
|
161
213
|
flex(),
|
|
162
214
|
items("center"),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
textAlign("start"),
|
|
179
|
-
cursor("pointer"),
|
|
180
|
-
transition("background-color"),
|
|
181
|
-
hover(bg("neutral.tint")),
|
|
182
|
-
focusVisible(outline({ color: "brand.ring", width: 2, offset: -2 })),
|
|
183
|
-
], children: [_jsxs("span", { mix: [flex(), items("center"), gap(1.5), raw({ flexWrap: "wrap" }), minIs(0)], children: [_jsx("span", { mix: [visuallyHidden()], children: `${edit.label}: ` }), children] }), _jsx("span", { "aria-hidden": "true", mix: [
|
|
184
|
-
flex(),
|
|
185
|
-
items("center"),
|
|
186
|
-
shrink(0),
|
|
187
|
-
raw({ alignSelf: "flex-start", blockSize: "1.5rem" }),
|
|
188
|
-
labelRow
|
|
189
|
-
? raw({
|
|
190
|
-
position: "absolute",
|
|
191
|
-
insetBlockStart: "0.625rem",
|
|
192
|
-
insetInlineEnd: 0,
|
|
193
|
-
blockSize: "1.25rem",
|
|
194
|
-
[`@container ${PROPERTY_LIST_CONTAINER} (min-width: 22rem)`]: {
|
|
195
|
-
position: "static",
|
|
196
|
-
blockSize: "1.5rem",
|
|
197
|
-
},
|
|
198
|
-
})
|
|
199
|
-
: null,
|
|
200
|
-
], children: _jsx(ChevronDownIcon, { size: 14, mix: [fg("neutral.muted")] }) })] }), edit.popover ?? (_jsx(Popover, { id: edit.id, placement: "bottom-start", role: "dialog", "aria-label": edit.label, "data-slot": "property-popover", mix: [p(3), is("min(20rem, calc(100vw - 2rem))"), text("sm")], children: edit.content }))] }));
|
|
215
|
+
shrink(0),
|
|
216
|
+
raw({ alignSelf: "flex-start", blockSize: "1.5rem" }),
|
|
217
|
+
labelRow
|
|
218
|
+
? raw({
|
|
219
|
+
position: "absolute",
|
|
220
|
+
insetBlockStart: "0.625rem",
|
|
221
|
+
insetInlineEnd: 0,
|
|
222
|
+
blockSize: "1.25rem",
|
|
223
|
+
[`@container ${PROPERTY_LIST_CONTAINER} (min-width: 22rem)`]: {
|
|
224
|
+
position: "static",
|
|
225
|
+
blockSize: "1.5rem",
|
|
226
|
+
},
|
|
227
|
+
})
|
|
228
|
+
: null,
|
|
229
|
+
], children: _jsx(ChevronDownIcon, { size: 14, mix: [fg("neutral.muted")] }) })] }));
|
|
201
230
|
};
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* The popover a {@link PropertyList.Edit} opens, under its row, holding the app's form, its
|
|
234
|
+
* described options and its submit. Any other popover with the same `id`, such as a
|
|
235
|
+
* `FilterMenu.Popover` picker, works in its place.
|
|
236
|
+
*
|
|
237
|
+
* @param handle Runtime handle carrying the popover's props.
|
|
238
|
+
* @returns The render function producing the popover.
|
|
239
|
+
*/
|
|
240
|
+
PropertyList.Popover = function PropertyListPopover(handle) {
|
|
241
|
+
return () => {
|
|
242
|
+
let { mix, ...rest } = handle.props;
|
|
243
|
+
return (_jsx(Popover, { placement: "bottom-start", role: "dialog", "data-slot": "property-popover", ...rest, mix: [p(3), is("min(20rem, calc(100vw - 2rem))"), text("sm"), mix] }));
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* The list's variant as a part reads it, the default for a part rendered alone.
|
|
248
|
+
*
|
|
249
|
+
* @param handle The part's runtime handle.
|
|
250
|
+
* @returns The nearest list's variant.
|
|
251
|
+
*/
|
|
252
|
+
function variantOf(handle) {
|
|
253
|
+
let context = handle.context.get(PropertyList);
|
|
254
|
+
return context?.variant ?? DEFAULT_VARIANT;
|
|
202
255
|
}
|
|
@@ -64,17 +64,6 @@ export declare namespace RadioGroup {
|
|
|
64
64
|
required?: boolean;
|
|
65
65
|
/** The option's visible label text, associated with the input by native nesting. */
|
|
66
66
|
children?: RemixNode;
|
|
67
|
-
/**
|
|
68
|
-
* Per-part styling for the option's hidden `input` and visible
|
|
69
|
-
* `indicator` elements, layered after each part's own built-in styling.
|
|
70
|
-
* Use the `mix` prop instead to style the option's outer `<label>` host.
|
|
71
|
-
*/
|
|
72
|
-
parts?: {
|
|
73
|
-
/** Additional mixin(s) applied to the hidden native `<input type="radio">`. */
|
|
74
|
-
input?: TagProps<"input">["mix"];
|
|
75
|
-
/** Additional mixin(s) applied to the visible indicator `<span>`. */
|
|
76
|
-
indicator?: TagProps<"span">["mix"];
|
|
77
|
-
};
|
|
78
67
|
}
|
|
79
68
|
}
|
|
80
69
|
/**
|
|
@@ -56,9 +56,9 @@ export function RadioGroup(handle) {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Renders a single option: a `<label>` pairing a hidden native `<input
|
|
60
|
-
*
|
|
61
|
-
*
|
|
59
|
+
* Renders a single option: a `<label>` pairing a hidden native `<input type="radio">` with
|
|
60
|
+
* an indicator driven by its checked, focus and disabled state. `--ui-radio-size` and
|
|
61
|
+
* `--ui-radio-mark-size` size the indicator; `mix` styles the label.
|
|
62
62
|
*
|
|
63
63
|
* @param handle Runtime handle carrying the host `<label>`'s props.
|
|
64
64
|
* @returns The render function producing the option's markup.
|
|
@@ -71,7 +71,7 @@ export function RadioGroup(handle) {
|
|
|
71
71
|
*/
|
|
72
72
|
RadioGroup.Radio = function RadioGroupRadio(handle) {
|
|
73
73
|
return () => {
|
|
74
|
-
let { value, name, checked, defaultChecked, disabled, required, children,
|
|
74
|
+
let { value, name, checked, defaultChecked, disabled, required, children, mix, ...rest } = handle.props;
|
|
75
75
|
let context = handle.context.get(RadioGroup);
|
|
76
76
|
let resolvedName = name ?? context.name;
|
|
77
77
|
return (_jsxs("label", { ...rest, mix: mergeMix([
|
|
@@ -82,7 +82,7 @@ RadioGroup.Radio = function RadioGroupRadio(handle) {
|
|
|
82
82
|
when("&:has(input:disabled)", [cursor("not-allowed"), opacity(50)]),
|
|
83
83
|
gap("0.5rem"),
|
|
84
84
|
fg("neutral.emphasis"),
|
|
85
|
-
], mix), children: [_jsx("input", { type: "radio", id: handle.id, value: value, name: resolvedName, checked: checked, defaultChecked: defaultChecked, disabled: disabled, required: required, mix: [visuallyHidden()
|
|
85
|
+
], mix), children: [_jsx("input", { type: "radio", id: handle.id, value: value, name: resolvedName, checked: checked, defaultChecked: defaultChecked, disabled: disabled, required: required, mix: [visuallyHidden()] }), _jsx("span", { "data-slot": "indicator", mix: [
|
|
86
86
|
relative(),
|
|
87
87
|
flex(),
|
|
88
88
|
shrink(),
|
|
@@ -106,7 +106,6 @@ RadioGroup.Radio = function RadioGroupRadio(handle) {
|
|
|
106
106
|
precededBy("input:checked", after(scale(1))),
|
|
107
107
|
precededBy("input:checked", [border("brand.solid"), bg("brand.solid")]),
|
|
108
108
|
precededBy("input:focus-visible", outline({ color: "brand.ring", offset: 2 })),
|
|
109
|
-
parts?.indicator,
|
|
110
109
|
] }), children] }));
|
|
111
110
|
};
|
|
112
111
|
};
|