@sdxc/ui 2026.11.26 → 2026.11.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +265 -162
- package/dist/app/app-shell.d.ts +85 -50
- package/dist/app/app-shell.js +419 -222
- package/dist/app/auto-refresh.d.ts +68 -51
- package/dist/app/auto-refresh.js +193 -61
- package/dist/app/board.d.ts +40 -17
- package/dist/app/board.js +173 -88
- package/dist/app/chart.d.ts +10 -63
- package/dist/app/chart.js +22 -29
- package/dist/app/code-view.d.ts +12 -11
- package/dist/app/code-view.js +83 -19
- package/dist/app/command-palette.d.ts +61 -33
- package/dist/app/command-palette.js +178 -32
- package/dist/app/contribution-graph.d.ts +30 -14
- package/dist/app/contribution-graph.js +87 -26
- package/dist/app/danger-zone.d.ts +40 -35
- package/dist/app/danger-zone.js +177 -34
- package/dist/app/detail-sheet.d.ts +42 -51
- package/dist/app/detail-sheet.js +156 -37
- package/dist/app/diff.d.ts +6 -5
- package/dist/app/diff.js +9 -6
- package/dist/app/drop-zone.d.ts +3 -13
- package/dist/app/drop-zone.js +2 -2
- package/dist/app/editor-layout.d.ts +69 -47
- package/dist/app/editor-layout.js +256 -115
- package/dist/app/empty.d.ts +16 -12
- package/dist/app/empty.js +45 -19
- package/dist/app/file-trigger.d.ts +5 -13
- package/dist/app/file-trigger.js +3 -4
- package/dist/app/filter-bar.d.ts +182 -120
- package/dist/app/filter-bar.js +509 -161
- package/dist/app/filter-menu.d.ts +51 -33
- package/dist/app/filter-menu.js +105 -40
- package/dist/app/gantt.d.ts +67 -27
- package/dist/app/gantt.js +320 -163
- package/dist/app/grid-list.d.ts +2 -15
- package/dist/app/grid-list.js +3 -3
- package/dist/app/merge-box.d.ts +58 -52
- package/dist/app/merge-box.js +107 -46
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +2 -2
- package/dist/app/mixins/optimistic-toggle-sync.js +3 -2
- package/dist/app/mixins/range-picker-keys.d.ts +1 -1
- package/dist/app/mixins/range-picker-keys.js +1 -1
- package/dist/app/mixins/save-bar-sync.d.ts +1 -1
- package/dist/app/mixins/save-bar-sync.js +3 -2
- package/dist/app/mixins/split-view.d.ts +3 -1
- package/dist/app/mixins/split-view.js +16 -8
- package/dist/app/optimistic-toggle.d.ts +65 -37
- package/dist/app/optimistic-toggle.js +38 -15
- package/dist/app/page-header.d.ts +80 -58
- package/dist/app/page-header.js +329 -154
- package/dist/app/profile-picker.d.ts +31 -24
- package/dist/app/profile-picker.js +134 -58
- package/dist/app/range-picker.d.ts +62 -59
- package/dist/app/range-picker.js +124 -37
- package/dist/app/review-thread.d.ts +69 -66
- package/dist/app/review-thread.js +203 -53
- package/dist/app/save-bar.d.ts +56 -27
- package/dist/app/save-bar.js +66 -14
- package/dist/app/selection-bar.d.ts +64 -66
- package/dist/app/selection-bar.js +157 -56
- package/dist/app/settings-layout.d.ts +65 -52
- package/dist/app/settings-layout.js +198 -71
- package/dist/app/settings-section.d.ts +86 -93
- package/dist/app/settings-section.js +297 -120
- package/dist/app/shortcut-list.d.ts +19 -8
- package/dist/app/shortcut-list.js +50 -9
- package/dist/app/sparkline.d.ts +14 -16
- package/dist/app/sparkline.js +20 -7
- package/dist/app/split-view.d.ts +66 -42
- package/dist/app/split-view.js +235 -128
- package/dist/app/stat-card.d.ts +16 -4
- package/dist/app/stat-card.js +57 -21
- package/dist/app/status-strip.d.ts +24 -25
- package/dist/app/status-strip.js +82 -25
- package/dist/app/tab-bar.d.ts +15 -7
- package/dist/app/tab-bar.js +74 -37
- package/dist/app/table.d.ts +37 -38
- package/dist/app/table.js +101 -45
- package/dist/app/view-options.d.ts +100 -76
- package/dist/app/view-options.js +263 -129
- package/dist/audio/media-tile.d.ts +33 -21
- package/dist/audio/media-tile.js +139 -79
- package/dist/audio/player-bar.d.ts +24 -43
- package/dist/audio/player-bar.js +183 -118
- package/dist/audio/queue-list.d.ts +40 -36
- package/dist/audio/queue-list.js +172 -73
- package/dist/audio/track-list.d.ts +53 -54
- package/dist/audio/track-list.js +127 -35
- package/dist/blog/archive-list.d.ts +158 -0
- package/dist/blog/archive-list.js +353 -0
- package/dist/blog/article-layout.d.ts +81 -0
- package/dist/blog/article-layout.js +211 -0
- package/dist/blog/author-card.d.ts +99 -0
- package/dist/blog/author-card.js +184 -0
- package/dist/blog/blog-masthead.d.ts +55 -0
- package/dist/blog/blog-masthead.js +143 -0
- package/dist/blog/index.d.ts +21 -0
- package/dist/blog/index.js +21 -0
- package/dist/blog/link-host.d.ts +47 -0
- package/dist/blog/link-host.js +61 -0
- package/dist/blog/newsletter-form.d.ts +66 -0
- package/dist/blog/newsletter-form.js +100 -0
- package/dist/blog/post-byline.d.ts +96 -0
- package/dist/blog/post-byline.js +180 -0
- package/dist/blog/post-entry.d.ts +153 -0
- package/dist/blog/post-entry.js +402 -0
- package/dist/blog/post-stream.d.ts +92 -0
- package/dist/blog/post-stream.js +163 -0
- package/dist/blog/series-nav.d.ts +144 -0
- package/dist/blog/series-nav.js +275 -0
- package/dist/blog/tag-cloud.d.ts +103 -0
- package/dist/blog/tag-cloud.js +138 -0
- package/dist/blog/tag-list.d.ts +91 -0
- package/dist/blog/tag-list.js +92 -0
- package/dist/blog/widget.d.ts +68 -0
- package/dist/blog/widget.js +61 -0
- package/dist/chat/activity.d.ts +47 -15
- package/dist/chat/activity.js +124 -46
- package/dist/chat/mention-menu.d.ts +6 -7
- package/dist/chat/mention-menu.js +4 -4
- package/dist/chat/message-group.d.ts +17 -4
- package/dist/chat/message-group.js +29 -6
- package/dist/color/color-field.d.ts +41 -68
- package/dist/color/color-field.js +21 -38
- package/dist/color/color-picker.d.ts +10 -61
- package/dist/color/color-picker.js +7 -15
- package/dist/color/color-swatch-picker.d.ts +0 -11
- package/dist/color/color-swatch-picker.js +2 -3
- package/dist/color/color-wheel.d.ts +3 -13
- package/dist/color/color-wheel.js +1 -2
- package/dist/commerce/cart-drawer.d.ts +41 -24
- package/dist/commerce/cart-drawer.js +129 -58
- package/dist/commerce/cart-line.d.ts +34 -19
- package/dist/commerce/cart-line.js +94 -28
- package/dist/commerce/checkout-layout.d.ts +23 -19
- package/dist/commerce/checkout-layout.js +53 -24
- package/dist/commerce/facet-filters.d.ts +57 -59
- package/dist/commerce/facet-filters.js +219 -129
- package/dist/commerce/item-options-dialog.d.ts +69 -40
- package/dist/commerce/item-options-dialog.js +231 -104
- package/dist/commerce/menu-item-card.d.ts +36 -20
- package/dist/commerce/menu-item-card.js +114 -61
- package/dist/commerce/option-group.d.ts +46 -27
- package/dist/commerce/option-group.js +123 -52
- package/dist/commerce/order-summary.d.ts +41 -26
- package/dist/commerce/order-summary.js +103 -49
- package/dist/commerce/order-tracker.d.ts +32 -16
- package/dist/commerce/order-tracker.js +91 -66
- package/dist/commerce/price.d.ts +41 -25
- package/dist/commerce/price.js +131 -68
- package/dist/commerce/product-card.d.ts +66 -36
- package/dist/commerce/product-card.js +215 -100
- package/dist/commerce/product-gallery.d.ts +72 -38
- package/dist/commerce/product-gallery.js +187 -82
- package/dist/commerce/promo-code.d.ts +73 -37
- package/dist/commerce/promo-code.js +172 -77
- package/dist/commerce/question-list.d.ts +43 -35
- package/dist/commerce/question-list.js +146 -72
- package/dist/commerce/shipping-estimate.d.ts +68 -33
- package/dist/commerce/shipping-estimate.js +149 -25
- package/dist/commerce/sort-select.d.ts +33 -22
- package/dist/commerce/sort-select.js +55 -26
- package/dist/commerce/variant-picker.d.ts +25 -23
- package/dist/commerce/variant-picker.js +103 -29
- package/dist/{docs → components}/anchor-heading.d.ts +1 -1
- package/dist/{docs → components}/anchor-heading.js +1 -1
- package/dist/components/autocomplete.d.ts +19 -21
- package/dist/components/autocomplete.js +57 -21
- package/dist/components/banner.d.ts +48 -37
- package/dist/components/banner.js +69 -27
- package/dist/components/button.d.ts +2 -18
- package/dist/components/button.js +4 -3
- package/dist/components/callout.d.ts +52 -0
- package/dist/components/callout.js +77 -0
- package/dist/components/checkbox.d.ts +3 -12
- package/dist/components/checkbox.js +1 -2
- package/dist/components/code-block.d.ts +110 -0
- package/dist/{docs → components}/code-block.js +92 -23
- package/dist/components/confirm.d.ts +63 -130
- package/dist/components/confirm.js +133 -52
- package/dist/{docs → components}/copy-button.d.ts +1 -1
- package/dist/{docs → components}/copy-button.js +3 -3
- package/dist/components/date-field.d.ts +40 -60
- package/dist/components/date-field.js +23 -36
- package/dist/components/date-picker.d.ts +11 -67
- package/dist/components/date-picker.js +4 -15
- package/dist/components/date-range-picker.d.ts +20 -91
- package/dist/components/date-range-picker.js +13 -27
- package/dist/components/dialog-dismiss.d.ts +1 -1
- package/dist/components/dialog-dismiss.js +1 -1
- package/dist/components/field-parts.d.ts +158 -0
- package/dist/components/field-parts.js +237 -0
- package/dist/components/filter-links.d.ts +107 -0
- package/dist/components/filter-links.js +120 -0
- package/dist/components/form.d.ts +3 -1
- package/dist/components/form.js +3 -1
- package/dist/components/index.d.ts +14 -7
- package/dist/components/index.js +14 -7
- package/dist/components/lightbox.js +12 -6
- package/dist/components/listbox.d.ts +0 -9
- package/dist/components/listbox.js +2 -2
- package/dist/components/media-grid.d.ts +15 -16
- package/dist/components/media-grid.js +75 -34
- package/dist/components/pager.d.ts +103 -0
- package/dist/components/pager.js +187 -0
- package/dist/components/property-list.d.ts +38 -39
- package/dist/components/property-list.js +149 -96
- package/dist/components/radio-group.d.ts +0 -11
- package/dist/components/radio-group.js +5 -6
- package/dist/components/range-calendar.d.ts +2 -14
- package/dist/components/range-calendar.js +2 -2
- package/dist/components/range-months.d.ts +12 -2
- package/dist/components/range-months.js +32 -16
- package/dist/components/rating-input.d.ts +14 -6
- package/dist/components/rating-input.js +26 -12
- package/dist/components/rating.d.ts +13 -8
- package/dist/components/rating.js +19 -5
- package/dist/components/review-card.d.ts +51 -26
- package/dist/components/review-card.js +173 -40
- package/dist/components/search-field.js +18 -8
- package/dist/components/section-bar.d.ts +23 -15
- package/dist/components/section-bar.js +59 -37
- package/dist/components/sidebar.d.ts +27 -0
- package/dist/components/sidebar.js +49 -20
- package/dist/{docs → components}/table-of-contents.d.ts +1 -1
- package/dist/{docs → components}/table-of-contents.js +3 -3
- package/dist/components/text-field.d.ts +54 -81
- package/dist/components/text-field.js +30 -44
- package/dist/components/time-field.d.ts +45 -65
- package/dist/components/time-field.js +23 -35
- package/dist/components/timeline.d.ts +80 -86
- package/dist/components/timeline.js +383 -170
- package/dist/components/typeset.d.ts +5 -0
- package/dist/components/typeset.js +17 -2
- package/dist/docs/code-tabs.d.ts +50 -24
- package/dist/docs/code-tabs.js +91 -25
- package/dist/docs/docs-feedback.d.ts +70 -27
- package/dist/docs/docs-feedback.js +156 -27
- package/dist/docs/docs-footer.d.ts +36 -22
- package/dist/docs/docs-footer.js +76 -23
- package/dist/docs/docs-hub.d.ts +103 -73
- package/dist/docs/docs-hub.js +333 -83
- package/dist/docs/docs-layout.d.ts +111 -42
- package/dist/docs/docs-layout.js +371 -97
- package/dist/docs/docs-nav-tools.d.ts +11 -7
- package/dist/docs/docs-nav-tools.js +4 -3
- package/dist/docs/docs-nav.d.ts +53 -17
- package/dist/docs/docs-nav.js +125 -14
- package/dist/docs/docs-not-found.d.ts +61 -35
- package/dist/docs/docs-not-found.js +198 -52
- package/dist/docs/docs-page-header.d.ts +47 -30
- package/dist/docs/docs-page-header.js +114 -31
- package/dist/docs/docs-pager.d.ts +43 -27
- package/dist/docs/docs-pager.js +73 -23
- package/dist/docs/file-tree.d.ts +16 -6
- package/dist/docs/file-tree.js +19 -4
- package/dist/docs/index.d.ts +0 -7
- package/dist/docs/index.js +0 -7
- package/dist/docs/install-command.d.ts +7 -6
- package/dist/docs/install-command.js +8 -10
- package/dist/docs/mixins/docs-nav-tools.js +1 -1
- package/dist/docs/next-steps.d.ts +56 -23
- package/dist/docs/next-steps.js +121 -35
- package/dist/docs/page-actions.d.ts +68 -46
- package/dist/docs/page-actions.js +129 -21
- package/dist/docs/steps.d.ts +14 -11
- package/dist/docs/steps.js +36 -18
- package/dist/docs/ui-label.d.ts +7 -6
- package/dist/docs/ui-label.js +21 -8
- package/dist/finance/ledger.d.ts +33 -29
- package/dist/finance/ledger.js +190 -43
- package/dist/finance/payment-card.d.ts +43 -31
- package/dist/finance/payment-card.js +170 -67
- package/dist/landing/author-band.d.ts +57 -54
- package/dist/landing/author-band.js +218 -64
- package/dist/landing/case-study.d.ts +57 -57
- package/dist/landing/case-study.js +148 -17
- package/dist/landing/changelog-strip.d.ts +56 -36
- package/dist/landing/changelog-strip.js +176 -68
- package/dist/landing/closing-cta.d.ts +21 -41
- package/dist/landing/closing-cta.js +13 -19
- package/dist/landing/code-stage.d.ts +55 -47
- package/dist/landing/code-stage.js +198 -67
- package/dist/landing/contributor-wall.d.ts +4 -4
- package/dist/landing/contributor-wall.js +4 -4
- package/dist/landing/curriculum.d.ts +74 -45
- package/dist/landing/curriculum.js +220 -62
- package/dist/landing/drawn-chart.d.ts +18 -10
- package/dist/landing/drawn-chart.js +57 -26
- package/dist/landing/episode-player.d.ts +69 -43
- package/dist/landing/episode-player.js +213 -48
- package/dist/landing/event-ticker.d.ts +13 -7
- package/dist/landing/event-ticker.js +67 -32
- package/dist/landing/fan-out-diagram.d.ts +19 -8
- package/dist/landing/fan-out-diagram.js +60 -19
- package/dist/landing/faq-band.d.ts +30 -48
- package/dist/landing/faq-band.js +37 -30
- package/dist/landing/feature-band.d.ts +48 -76
- package/dist/landing/feature-band.js +71 -49
- package/dist/landing/flow-diagram.d.ts +16 -8
- package/dist/landing/flow-diagram.js +50 -18
- package/dist/landing/install-tabs.d.ts +16 -14
- package/dist/landing/install-tabs.js +87 -39
- package/dist/landing/landing-header.d.ts +75 -66
- package/dist/landing/landing-header.js +284 -57
- package/dist/landing/landing-hero.d.ts +59 -87
- package/dist/landing/landing-hero.js +157 -128
- package/dist/landing/landing-section.d.ts +0 -9
- package/dist/landing/landing-section.js +1 -2
- package/dist/landing/logo-cloud.d.ts +26 -9
- package/dist/landing/logo-cloud.js +62 -18
- package/dist/landing/phone-fan.d.ts +15 -7
- package/dist/landing/phone-fan.js +60 -17
- package/dist/landing/price-list.d.ts +29 -22
- package/dist/landing/price-list.js +175 -77
- package/dist/landing/pricing-band.d.ts +46 -53
- package/dist/landing/pricing-band.js +167 -51
- package/dist/landing/product-frame.d.ts +44 -42
- package/dist/landing/product-frame.js +182 -85
- package/dist/landing/proof-strip.d.ts +7 -2
- package/dist/landing/proof-strip.js +7 -2
- package/dist/landing/rails.d.ts +1 -1
- package/dist/landing/rails.js +1 -1
- package/dist/landing/segmented-stage.d.ts +19 -8
- package/dist/landing/segmented-stage.js +60 -16
- package/dist/landing/sequence-diagram.d.ts +18 -8
- package/dist/landing/sequence-diagram.js +49 -18
- package/dist/landing/site-footer.d.ts +89 -68
- package/dist/landing/site-footer.js +344 -111
- package/dist/landing/site-header.d.ts +118 -80
- package/dist/landing/site-header.js +482 -67
- package/dist/landing/sponsor-wall.d.ts +34 -15
- package/dist/landing/sponsor-wall.js +111 -34
- package/dist/landing/stat-strip.d.ts +7 -9
- package/dist/landing/stat-strip.js +57 -22
- package/dist/landing/step-list.d.ts +18 -21
- package/dist/landing/step-list.js +132 -38
- package/dist/landing/tabbed-stage.d.ts +23 -15
- package/dist/landing/tabbed-stage.js +103 -21
- package/dist/landing/testimonial-band.d.ts +58 -61
- package/dist/landing/testimonial-band.js +209 -71
- package/dist/landing/typed-terminal.d.ts +9 -6
- package/dist/landing/typed-terminal.js +16 -5
- package/dist/landing/usage-estimate.d.ts +83 -74
- package/dist/landing/usage-estimate.js +254 -113
- package/dist/landing/utils/has-parts.d.ts +17 -0
- package/dist/landing/utils/has-parts.js +24 -0
- package/dist/map/map-canvas.d.ts +15 -16
- package/dist/map/map-canvas.js +40 -24
- package/dist/map/map.d.ts +42 -33
- package/dist/map/map.js +149 -38
- package/dist/mixins/aria-checked.d.ts +1 -4
- package/dist/mixins/aria-checked.js +1 -4
- package/dist/mixins/clear-field.d.ts +2 -4
- package/dist/mixins/clear-field.js +2 -4
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.js +2 -0
- package/dist/schedule/agenda.d.ts +69 -41
- package/dist/schedule/agenda.js +273 -134
- package/dist/schedule/day-strip.d.ts +38 -26
- package/dist/schedule/day-strip.js +119 -88
- package/dist/test/map.d.ts +1 -1
- package/dist/test/map.js +1 -6
- package/dist/test/reels.js +1 -1
- package/dist/test/stories.js +2 -2
- package/dist/travel/boarding-pass.d.ts +94 -70
- package/dist/travel/boarding-pass.js +341 -144
- package/dist/travel/car-offer.d.ts +109 -49
- package/dist/travel/car-offer.js +424 -64
- package/dist/travel/fare-options.d.ts +58 -34
- package/dist/travel/fare-options.js +210 -69
- package/dist/travel/flight-itinerary.d.ts +62 -55
- package/dist/travel/flight-itinerary.js +230 -55
- package/dist/travel/flight-option.d.ts +65 -33
- package/dist/travel/flight-option.js +250 -69
- package/dist/travel/flight-segment.d.ts +121 -70
- package/dist/travel/flight-segment.js +358 -96
- package/dist/travel/package-savings.d.ts +79 -39
- package/dist/travel/package-savings.js +309 -65
- package/dist/travel/price-breakdown.d.ts +30 -22
- package/dist/travel/price-breakdown.js +72 -17
- package/dist/travel/rating-breakdown.d.ts +25 -18
- package/dist/travel/rating-breakdown.js +60 -23
- package/dist/travel/seat-map.d.ts +29 -22
- package/dist/travel/seat-map.js +140 -78
- package/dist/travel/trip-timeline.d.ts +77 -39
- package/dist/travel/trip-timeline.js +316 -107
- package/dist/utils/eyebrow.d.ts +2 -2
- package/dist/utils/eyebrow.js +3 -3
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/video/episode-list.d.ts +22 -14
- package/dist/video/episode-list.js +89 -53
- package/dist/video/reel-feed.d.ts +21 -15
- package/dist/video/reel-feed.js +59 -24
- package/dist/video/story-viewer.d.ts +6 -5
- package/dist/video/story-viewer.js +84 -53
- package/dist/video/title-hero.d.ts +8 -8
- package/dist/video/title-hero.js +48 -34
- package/dist/video/video-card.d.ts +34 -20
- package/dist/video/video-card.js +119 -76
- package/dist/video/video-player.d.ts +17 -14
- package/dist/video/video-player.js +68 -30
- package/dist/video/video-shelf.d.ts +26 -14
- package/dist/video/video-shelf.js +88 -50
- package/package.json +4 -2
- package/dist/docs/callout.d.ts +0 -46
- package/dist/docs/callout.js +0 -61
- package/dist/docs/code-block.d.ts +0 -74
- package/dist/utils/field-parts.d.ts +0 -26
- package/dist/utils/field-parts.js +0 -12
- /package/dist/{docs/mixins → mixins}/copy-feedback.d.ts +0 -0
- /package/dist/{docs/mixins → mixins}/copy-feedback.js +0 -0
- /package/dist/{docs/mixins → mixins}/toc-spy.d.ts +0 -0
- /package/dist/{docs/mixins → mixins}/toc-spy.js +0 -0
- /package/dist/{docs/utils → utils}/reveal-in-scroller.d.ts +0 -0
- /package/dist/{docs/utils → utils}/reveal-in-scroller.js +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A bundle's price beside what its parts cost apart: a line per part
|
|
3
|
-
* its separate price struck through, then the bundled price large with
|
|
4
|
-
* Prices arrive formatted; the
|
|
2
|
+
* A bundle's price beside what its parts cost apart, as composable parts: a line per part
|
|
3
|
+
* (flight, stay, car) with its separate price struck through, then the bundled price large with
|
|
4
|
+
* a "You save" badge. Prices arrive formatted; the bundle sits beside the parts once wide.
|
|
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
10
|
/**
|
|
11
11
|
* Prop types for {@link PackageSavings} and its compound parts.
|
|
12
12
|
*/
|
|
@@ -17,58 +17,98 @@ export declare namespace PackageSavings {
|
|
|
17
17
|
interface Context {
|
|
18
18
|
separateLabel?: string;
|
|
19
19
|
}
|
|
20
|
-
/** Every native `<section>` attribute, plus the
|
|
21
|
-
interface Props extends
|
|
22
|
-
/** What the bundle is, such as "Flight + Hotel + Car", over the parts. */
|
|
23
|
-
title?: RemixNode;
|
|
24
|
-
/** The saving as a badge, such as "You save $212". */
|
|
25
|
-
savings: RemixNode;
|
|
26
|
-
/** What the bundled price is, such as "Package price". */
|
|
27
|
-
bundleLabel: RemixNode;
|
|
28
|
-
/** The bundled price, formatted, such as "$1,486". */
|
|
29
|
-
bundlePrice: string;
|
|
30
|
-
/** What the price covers, such as "2 travellers · taxes included", under it. */
|
|
31
|
-
bundleDetail?: RemixNode;
|
|
32
|
-
/** The parts' prices added up, struck through above the bundled price, such as "$1,698". */
|
|
33
|
-
separateTotal?: string;
|
|
20
|
+
/** Every native `<section>` attribute, plus the words read before every struck price. */
|
|
21
|
+
interface Props extends TagProps<"section"> {
|
|
34
22
|
/**
|
|
35
23
|
* Read before every struck price, such as "Booked separately", since a strike-through
|
|
36
24
|
* is silent to most screen readers.
|
|
37
25
|
*/
|
|
38
26
|
separateLabel?: string;
|
|
39
|
-
/** A booking button or link under the bundled price. */
|
|
40
|
-
action?: RemixNode;
|
|
41
|
-
/** The {@link PackageSavings.Part} lines. */
|
|
42
|
-
children: RemixNode;
|
|
43
27
|
}
|
|
44
|
-
/** Every native `<
|
|
45
|
-
interface
|
|
28
|
+
/** Every native `<p>` attribute; what the bundle is, such as "Flight + Hotel + Car". */
|
|
29
|
+
interface TitleProps extends TagProps<"p"> {
|
|
30
|
+
}
|
|
31
|
+
/** Every native `<ul>` attribute; holds the {@link PackageSavings.Part} lines. */
|
|
32
|
+
interface PartsProps extends TagProps<"ul"> {
|
|
33
|
+
}
|
|
34
|
+
/** Every native `<li>` attribute, plus what the part is. */
|
|
35
|
+
interface PartProps extends TagProps<"li"> {
|
|
46
36
|
kind: Kind;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
37
|
+
}
|
|
38
|
+
/** Every native `<span>` attribute; a glyph in place of the kind's own. */
|
|
39
|
+
interface PartIconProps extends TagProps<"span"> {
|
|
40
|
+
}
|
|
41
|
+
/** Every native `<span>` attribute; what the part is, such as "Return flights MRW ⇄ VLS". */
|
|
42
|
+
interface PartLabelProps extends TagProps<"span"> {
|
|
43
|
+
}
|
|
44
|
+
/** Every native `<span>` attribute; a second line, such as "Larkwing Air · Economy". */
|
|
45
|
+
interface PartDetailProps extends TagProps<"span"> {
|
|
46
|
+
}
|
|
47
|
+
/** Every native `<s>` attribute; a price booked alone, formatted, such as "$684". */
|
|
48
|
+
interface SeparateProps extends TagProps<"s"> {
|
|
49
|
+
}
|
|
50
|
+
/** Every native `<div>` attribute; the tinted box holding the bundled price. */
|
|
51
|
+
interface BundleProps extends TagProps<"div"> {
|
|
52
|
+
}
|
|
53
|
+
/** Every native `<span>` attribute; what the bundled price is, such as "Package price". */
|
|
54
|
+
interface BundleLabelProps extends TagProps<"span"> {
|
|
55
|
+
}
|
|
56
|
+
/** Every native `<span>` attribute; the saving as a badge, such as "You save $212". */
|
|
57
|
+
interface SavingsProps extends TagProps<"span"> {
|
|
58
|
+
}
|
|
59
|
+
/** Every native `<p>` attribute; holds the struck total and the bundled amount. */
|
|
60
|
+
interface TotalProps extends TagProps<"p"> {
|
|
61
|
+
}
|
|
62
|
+
/** Every native `<output>` attribute; the bundled price, formatted, such as "$1,486". */
|
|
63
|
+
interface AmountProps extends TagProps<"output"> {
|
|
64
|
+
}
|
|
65
|
+
/** Every native `<span>` attribute; what the price covers, such as "2 travellers". */
|
|
66
|
+
interface BundleDetailProps extends TagProps<"span"> {
|
|
67
|
+
}
|
|
68
|
+
/** Every native `<div>` attribute; a booking button or link, stretched to the box's width. */
|
|
69
|
+
interface ActionProps extends TagProps<"div"> {
|
|
55
70
|
}
|
|
56
71
|
}
|
|
57
72
|
/**
|
|
58
|
-
* Renders the bundle
|
|
59
|
-
*
|
|
60
|
-
*
|
|
73
|
+
* Renders the bundle as a `<section>` laying out the parts it is given: a
|
|
74
|
+
* {@link PackageSavings.Title} and {@link PackageSavings.Parts} over the
|
|
75
|
+
* {@link PackageSavings.Bundle} under 32rem, and the bundle beside them from there.
|
|
61
76
|
*
|
|
62
77
|
* @param handle Runtime handle carrying the section's props and sharing the struck-price words.
|
|
63
78
|
* @returns The render function producing the bundle's markup.
|
|
64
79
|
* @example
|
|
65
|
-
* <PackageSavings
|
|
66
|
-
*
|
|
67
|
-
* <PackageSavings.
|
|
68
|
-
*
|
|
80
|
+
* <PackageSavings separateLabel="Booked separately">
|
|
81
|
+
* <PackageSavings.Title>Flight + Hotel</PackageSavings.Title>
|
|
82
|
+
* <PackageSavings.Parts>
|
|
83
|
+
* <PackageSavings.Part kind="flight">
|
|
84
|
+
* <PackageSavings.PartLabel>Return flights MRW ⇄ VLS</PackageSavings.PartLabel>
|
|
85
|
+
* <PackageSavings.Separate>$684</PackageSavings.Separate>
|
|
86
|
+
* </PackageSavings.Part>
|
|
87
|
+
* </PackageSavings.Parts>
|
|
88
|
+
* <PackageSavings.Bundle>
|
|
89
|
+
* <PackageSavings.BundleLabel>Package price</PackageSavings.BundleLabel>
|
|
90
|
+
* <PackageSavings.Savings>You save $212</PackageSavings.Savings>
|
|
91
|
+
* <PackageSavings.Total>
|
|
92
|
+
* <PackageSavings.Separate>$1,698</PackageSavings.Separate>
|
|
93
|
+
* <PackageSavings.Amount>$1,486</PackageSavings.Amount>
|
|
94
|
+
* </PackageSavings.Total>
|
|
95
|
+
* </PackageSavings.Bundle>
|
|
69
96
|
* </PackageSavings>
|
|
70
97
|
*/
|
|
71
98
|
export declare function PackageSavings(handle: Handle<PackageSavings.Props, PackageSavings.Context>): () => import("remix/component").RemixElement;
|
|
72
99
|
export declare namespace PackageSavings {
|
|
100
|
+
var Title: (handle: Handle<PackageSavings.TitleProps>) => () => import("remix/component").RemixElement;
|
|
101
|
+
var Parts: (handle: Handle<PackageSavings.PartsProps>) => () => import("remix/component").RemixElement;
|
|
73
102
|
var Part: (handle: Handle<PackageSavings.PartProps>) => () => import("remix/component").RemixElement;
|
|
103
|
+
var PartIcon: (handle: Handle<PackageSavings.PartIconProps>) => () => import("remix/component").RemixElement;
|
|
104
|
+
var PartLabel: (handle: Handle<PackageSavings.PartLabelProps>) => () => import("remix/component").RemixElement;
|
|
105
|
+
var PartDetail: (handle: Handle<PackageSavings.PartDetailProps>) => () => import("remix/component").RemixElement;
|
|
106
|
+
var Separate: (handle: Handle<PackageSavings.SeparateProps>) => () => import("remix/component").RemixElement;
|
|
107
|
+
var Bundle: (handle: Handle<PackageSavings.BundleProps>) => () => import("remix/component").RemixElement;
|
|
108
|
+
var BundleLabel: (handle: Handle<PackageSavings.BundleLabelProps>) => () => import("remix/component").RemixElement;
|
|
109
|
+
var Savings: (handle: Handle<PackageSavings.SavingsProps>) => () => import("remix/component").RemixElement;
|
|
110
|
+
var Total: (handle: Handle<PackageSavings.TotalProps>) => () => import("remix/component").RemixElement;
|
|
111
|
+
var Amount: (handle: Handle<PackageSavings.AmountProps>) => () => import("remix/component").RemixElement;
|
|
112
|
+
var BundleDetail: (handle: Handle<PackageSavings.BundleDetailProps>) => () => import("remix/component").RemixElement;
|
|
113
|
+
var Action: (handle: Handle<PackageSavings.ActionProps>) => () => import("remix/component").RemixElement;
|
|
74
114
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
2
|
import { BedDoubleIcon, CarIcon, PlaneIcon, TicketIcon } from "@sdxc/icons";
|
|
3
3
|
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
4
4
|
import { bg, border, fg } from "@sdxc/u/color";
|
|
5
5
|
import { rounded } from "@sdxc/u/effects";
|
|
6
6
|
import { listStyle, raw, mergeMix } from "@sdxc/u/general";
|
|
7
|
-
import { container, flex,
|
|
7
|
+
import { container, flex, grid, inlineFlex, items, justify, vstack } from "@sdxc/u/layout";
|
|
8
8
|
import { at } from "@sdxc/u/responsive";
|
|
9
9
|
import { bs, is, m, minIs, p } from "@sdxc/u/size";
|
|
10
10
|
import { when } from "@sdxc/u/state";
|
|
@@ -13,6 +13,32 @@ import { leading, tabularNums, text, weight } from "@sdxc/u/typography";
|
|
|
13
13
|
const CONTAINER_NAME = "ui-package-savings";
|
|
14
14
|
/** Summary width from which the bundled price sits beside the parts. */
|
|
15
15
|
const SIDE_BY_SIDE_WIDTH = "32rem";
|
|
16
|
+
/** Selects the summary's title among the body's children, by the marker the summary owns. */
|
|
17
|
+
const TITLE = "[data-package-savings-part='title']";
|
|
18
|
+
/** Selects the summary's bundle among the body's children. */
|
|
19
|
+
const BUNDLE = "[data-package-savings-part='bundle']";
|
|
20
|
+
/** Selects a part's icon, its own or the caller's, among the part's children. */
|
|
21
|
+
const ICON = "[data-package-savings-part='icon']";
|
|
22
|
+
/** Selects a part's detail among its children. */
|
|
23
|
+
const DETAIL = "[data-package-savings-part='detail']";
|
|
24
|
+
/** Selects a struck price among a part's children. */
|
|
25
|
+
const SEPARATE = "[data-package-savings-part='separate']";
|
|
26
|
+
/** Selects a caller's own {@link PackageSavings.PartIcon} among a part's children. */
|
|
27
|
+
const PART_ICON = "[data-package-savings-part-icon]";
|
|
28
|
+
/** Selects the bundle's label among its children. */
|
|
29
|
+
const BUNDLE_LABEL = "[data-package-savings-part='bundle-label']";
|
|
30
|
+
/** Selects the bundle's saving badge among its children. */
|
|
31
|
+
const SAVINGS = "[data-package-savings-part='savings']";
|
|
32
|
+
/** The tinted square a part's icon sits in, its display set by each icon. */
|
|
33
|
+
const ICON_TILE = [
|
|
34
|
+
items("center"),
|
|
35
|
+
justify("center"),
|
|
36
|
+
is("2rem"),
|
|
37
|
+
bs("2rem"),
|
|
38
|
+
rounded("md"),
|
|
39
|
+
bg("neutral.tint"),
|
|
40
|
+
fg("neutral.muted"),
|
|
41
|
+
];
|
|
16
42
|
/**
|
|
17
43
|
* The glyph for a part of each kind.
|
|
18
44
|
*
|
|
@@ -29,100 +55,318 @@ function kindIcon(kind) {
|
|
|
29
55
|
return _jsx(TicketIcon, { size: 16 });
|
|
30
56
|
}
|
|
31
57
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @
|
|
35
|
-
* @returns The render function producing the struck price.
|
|
36
|
-
*/
|
|
37
|
-
function StruckPrice(handle) {
|
|
38
|
-
return () => {
|
|
39
|
-
let { price, label } = handle.props;
|
|
40
|
-
return (_jsxs(_Fragment, { children: [label === undefined ? null : _jsx("span", { mix: [visuallyHidden()], children: `${label}: ` }), _jsx("s", { "data-slot": "package-savings-separate", mix: [fg("neutral.muted"), tabularNums()], children: price })] }));
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Renders the bundle: a `<section>` whose title and parts list sit over the bundled price under
|
|
45
|
-
* 32rem, and beside it from there. The parts total is struck through over the bundled price,
|
|
46
|
-
* and the saving is a success-toned badge beside it.
|
|
58
|
+
* Renders the bundle as a `<section>` laying out the parts it is given: a
|
|
59
|
+
* {@link PackageSavings.Title} and {@link PackageSavings.Parts} over the
|
|
60
|
+
* {@link PackageSavings.Bundle} under 32rem, and the bundle beside them from there.
|
|
47
61
|
*
|
|
48
62
|
* @param handle Runtime handle carrying the section's props and sharing the struck-price words.
|
|
49
63
|
* @returns The render function producing the bundle's markup.
|
|
50
64
|
* @example
|
|
51
|
-
* <PackageSavings
|
|
52
|
-
*
|
|
53
|
-
* <PackageSavings.
|
|
54
|
-
*
|
|
65
|
+
* <PackageSavings separateLabel="Booked separately">
|
|
66
|
+
* <PackageSavings.Title>Flight + Hotel</PackageSavings.Title>
|
|
67
|
+
* <PackageSavings.Parts>
|
|
68
|
+
* <PackageSavings.Part kind="flight">
|
|
69
|
+
* <PackageSavings.PartLabel>Return flights MRW ⇄ VLS</PackageSavings.PartLabel>
|
|
70
|
+
* <PackageSavings.Separate>$684</PackageSavings.Separate>
|
|
71
|
+
* </PackageSavings.Part>
|
|
72
|
+
* </PackageSavings.Parts>
|
|
73
|
+
* <PackageSavings.Bundle>
|
|
74
|
+
* <PackageSavings.BundleLabel>Package price</PackageSavings.BundleLabel>
|
|
75
|
+
* <PackageSavings.Savings>You save $212</PackageSavings.Savings>
|
|
76
|
+
* <PackageSavings.Total>
|
|
77
|
+
* <PackageSavings.Separate>$1,698</PackageSavings.Separate>
|
|
78
|
+
* <PackageSavings.Amount>$1,486</PackageSavings.Amount>
|
|
79
|
+
* </PackageSavings.Total>
|
|
80
|
+
* </PackageSavings.Bundle>
|
|
55
81
|
* </PackageSavings>
|
|
56
82
|
*/
|
|
57
83
|
export function PackageSavings(handle) {
|
|
58
84
|
return () => {
|
|
59
|
-
let {
|
|
85
|
+
let { separateLabel, children, mix, ...rest } = handle.props;
|
|
60
86
|
handle.context.set({ separateLabel });
|
|
61
|
-
return (_jsx("section", { "data-slot": "package-savings", ...rest, mix: mergeMix([container(CONTAINER_NAME, "inline-size"), minIs(0), text("sm")], mix), children:
|
|
87
|
+
return (_jsx("section", { "data-slot": "package-savings", ...rest, mix: mergeMix([container(CONTAINER_NAME, "inline-size"), minIs(0), text("sm")], mix), children: _jsx("div", { "data-slot": "package-savings-body", mix: [
|
|
62
88
|
grid(),
|
|
63
|
-
|
|
89
|
+
raw({
|
|
90
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
91
|
+
rowGap: "0.75rem",
|
|
92
|
+
[`& > ${BUNDLE}`]: { marginBlockStart: "0.25rem" },
|
|
93
|
+
}),
|
|
64
94
|
at(SIDE_BY_SIDE_WIDTH, CONTAINER_NAME, raw({
|
|
65
95
|
gridTemplateColumns: "minmax(0, 1fr) minmax(11rem, auto)",
|
|
66
96
|
columnGap: "1.5rem",
|
|
67
97
|
alignItems: "start",
|
|
98
|
+
"& > *": { gridColumn: "1" },
|
|
99
|
+
[`& > ${BUNDLE}`]: {
|
|
100
|
+
gridColumn: "2",
|
|
101
|
+
gridRow: "1 / span 2",
|
|
102
|
+
marginBlockStart: "0",
|
|
103
|
+
},
|
|
104
|
+
[`&:not(:has(> ${TITLE})) > ${BUNDLE}`]: { gridRow: "1" },
|
|
68
105
|
})),
|
|
69
|
-
], children:
|
|
70
|
-
vstack({ gap: 2 }),
|
|
71
|
-
p(4),
|
|
72
|
-
rounded("lg"),
|
|
73
|
-
bg("success.tint"),
|
|
74
|
-
border({ color: "success.border", width: 1 }),
|
|
75
|
-
], children: [_jsxs("div", { mix: [flex(), items("center"), justify("between"), raw({ flexWrap: "wrap" }), gap(2)], children: [_jsx("span", { "data-slot": "package-savings-bundle-label", mix: [text("xs"), weight("medium"), fg("neutral.emphasis")], children: bundleLabel }), _jsx("span", { "data-slot": "package-savings-badge", mix: [
|
|
76
|
-
inlineFlex(),
|
|
77
|
-
raw({ paddingInline: "0.5rem", paddingBlock: "0.125rem" }),
|
|
78
|
-
rounded("full"),
|
|
79
|
-
bg("success.solid"),
|
|
80
|
-
fg("success.onSolid"),
|
|
81
|
-
text("xs"),
|
|
82
|
-
weight("semibold"),
|
|
83
|
-
leading(1.4),
|
|
84
|
-
], children: savings })] }), _jsxs("p", { mix: [m(0), flex(), items("baseline"), raw({ flexWrap: "wrap" }), gap(2)], children: [separateTotal === undefined ? null : (_jsx("span", { mix: [text("sm")], children: _jsx(StruckPrice, { price: separateTotal, label: separateLabel }) })), _jsx("output", { "data-slot": "package-savings-price", mix: [
|
|
85
|
-
text("2xl"),
|
|
86
|
-
weight("semibold"),
|
|
87
|
-
leading(1.1),
|
|
88
|
-
tabularNums(),
|
|
89
|
-
fg("neutral.emphasis"),
|
|
90
|
-
], children: bundlePrice })] }), bundleDetail === undefined ? null : (_jsx("span", { "data-slot": "package-savings-bundle-detail", mix: [text("xs"), fg("neutral.muted")], children: bundleDetail })), action === undefined ? null : (_jsx("div", { "data-slot": "package-savings-action", mix: [
|
|
91
|
-
flex(),
|
|
92
|
-
raw({ marginBlockStart: "0.25rem" }),
|
|
93
|
-
when("& > *", raw({ flex: "1 1 auto" })),
|
|
94
|
-
], children: action }))] })] }) }));
|
|
106
|
+
], children: children }) }));
|
|
95
107
|
};
|
|
96
108
|
}
|
|
97
109
|
/**
|
|
98
|
-
* Renders
|
|
99
|
-
*
|
|
110
|
+
* Renders what the bundle is in bold over the parts.
|
|
111
|
+
*
|
|
112
|
+
* @param handle Runtime handle carrying the paragraph's props.
|
|
113
|
+
* @returns The render function producing the title's markup.
|
|
114
|
+
* @example
|
|
115
|
+
* <PackageSavings.Title>Your package</PackageSavings.Title>
|
|
116
|
+
*/
|
|
117
|
+
PackageSavings.Title = function PackageSavingsTitle(handle) {
|
|
118
|
+
return () => {
|
|
119
|
+
let { mix, ...rest } = handle.props;
|
|
120
|
+
return (_jsx("p", { "data-slot": "package-savings-title", ...rest, "data-package-savings-part": "title", mix: mergeMix([m(0), weight("semibold"), fg("neutral.emphasis")], mix) }));
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Renders the parts as a list, one {@link PackageSavings.Part} per line.
|
|
125
|
+
*
|
|
126
|
+
* @param handle Runtime handle carrying the list's props.
|
|
127
|
+
* @returns The render function producing the list's markup.
|
|
128
|
+
* @example
|
|
129
|
+
* <PackageSavings.Parts>
|
|
130
|
+
* <PackageSavings.Part kind="car">…</PackageSavings.Part>
|
|
131
|
+
* </PackageSavings.Parts>
|
|
132
|
+
*/
|
|
133
|
+
PackageSavings.Parts = function PackageSavingsParts(handle) {
|
|
134
|
+
return () => {
|
|
135
|
+
let { mix, ...rest } = handle.props;
|
|
136
|
+
return (_jsx("ul", { "data-slot": "package-savings-parts", ...rest, mix: mergeMix([m(0), p(0), listStyle("none"), vstack({ gap: 3 })], mix) }));
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Renders one part of the bundle: the kind's icon in a tinted square, the
|
|
141
|
+
* {@link PackageSavings.PartLabel} with any {@link PackageSavings.PartDetail} under it, and a
|
|
142
|
+
* {@link PackageSavings.Separate} price at the end. A {@link PackageSavings.PartIcon} replaces
|
|
143
|
+
* the kind's icon.
|
|
100
144
|
*
|
|
101
145
|
* @param handle Runtime handle carrying the part's props.
|
|
102
146
|
* @returns The render function producing the part's list item.
|
|
103
147
|
* @example
|
|
104
|
-
* <PackageSavings.Part kind="car"
|
|
148
|
+
* <PackageSavings.Part kind="car">
|
|
149
|
+
* <PackageSavings.PartLabel>Compact car, 5 days</PackageSavings.PartLabel>
|
|
150
|
+
* <PackageSavings.PartDetail>Tallow Rent</PackageSavings.PartDetail>
|
|
151
|
+
* <PackageSavings.Separate>$190</PackageSavings.Separate>
|
|
152
|
+
* </PackageSavings.Part>
|
|
105
153
|
*/
|
|
106
154
|
PackageSavings.Part = function PackageSavingsPart(handle) {
|
|
107
155
|
return () => {
|
|
108
|
-
let { kind,
|
|
109
|
-
let { separateLabel } = handle.context.get(PackageSavings);
|
|
156
|
+
let { kind, children, mix, ...rest } = handle.props;
|
|
110
157
|
return (_jsxs("li", { "data-slot": "package-savings-part", "data-kind": kind, ...rest, mix: mergeMix([
|
|
111
158
|
grid(),
|
|
112
159
|
raw({
|
|
113
160
|
gridTemplateColumns: "2rem minmax(0, 1fr) auto",
|
|
114
161
|
columnGap: "0.75rem",
|
|
162
|
+
rowGap: "0.125rem",
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
"& > *": { gridColumn: "2" },
|
|
165
|
+
[`& > ${ICON}`]: { gridColumn: "1", gridRow: "1 / span 2" },
|
|
166
|
+
[`& > ${SEPARATE}`]: {
|
|
167
|
+
gridColumn: "3",
|
|
168
|
+
gridRow: "1 / span 2",
|
|
169
|
+
whiteSpace: "nowrap",
|
|
170
|
+
textAlign: "end",
|
|
171
|
+
},
|
|
172
|
+
[`&:not(:has(> ${DETAIL})) > :is(${ICON}, ${SEPARATE})`]: { gridRow: "1" },
|
|
173
|
+
}),
|
|
174
|
+
], mix), children: [_jsx("span", { "aria-hidden": "true", "data-package-savings-part": "icon", mix: [
|
|
175
|
+
ICON_TILE,
|
|
176
|
+
raw({
|
|
177
|
+
display: "inline-flex",
|
|
178
|
+
[`[data-kind]:has(> ${PART_ICON}) > &`]: { display: "none" },
|
|
179
|
+
}),
|
|
180
|
+
], children: kindIcon(kind) }), children] }));
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Renders a glyph in place of the part kind's own, in the same tinted square.
|
|
185
|
+
*
|
|
186
|
+
* @param handle Runtime handle carrying the span's props.
|
|
187
|
+
* @returns The render function producing the glyph's markup.
|
|
188
|
+
* @example
|
|
189
|
+
* <PackageSavings.PartIcon><AirlineMark /></PackageSavings.PartIcon>
|
|
190
|
+
*/
|
|
191
|
+
PackageSavings.PartIcon = function PackageSavingsPartIcon(handle) {
|
|
192
|
+
return () => {
|
|
193
|
+
let { mix, ...rest } = handle.props;
|
|
194
|
+
return (_jsx("span", { "data-slot": "package-savings-part-icon", "aria-hidden": "true", ...rest, "data-package-savings-part": "icon", "data-package-savings-part-icon": "", mix: mergeMix([inlineFlex(), ...ICON_TILE], mix) }));
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Renders what the part is in medium weight, breaking long words to fit.
|
|
199
|
+
*
|
|
200
|
+
* @param handle Runtime handle carrying the span's props.
|
|
201
|
+
* @returns The render function producing the label's markup.
|
|
202
|
+
* @example
|
|
203
|
+
* <PackageSavings.PartLabel>5 nights at Hotel Saltmarsh</PackageSavings.PartLabel>
|
|
204
|
+
*/
|
|
205
|
+
PackageSavings.PartLabel = function PackageSavingsPartLabel(handle) {
|
|
206
|
+
return () => {
|
|
207
|
+
let { mix, ...rest } = handle.props;
|
|
208
|
+
return (_jsx("span", { "data-slot": "package-savings-part-label", ...rest, "data-package-savings-part": "label", mix: mergeMix([weight("medium"), fg("neutral.emphasis"), raw({ overflowWrap: "anywhere" })], mix) }));
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Renders a second line under the part's label in small muted type.
|
|
213
|
+
*
|
|
214
|
+
* @param handle Runtime handle carrying the span's props.
|
|
215
|
+
* @returns The render function producing the detail's markup.
|
|
216
|
+
* @example
|
|
217
|
+
* <PackageSavings.PartDetail>Double room · breakfast</PackageSavings.PartDetail>
|
|
218
|
+
*/
|
|
219
|
+
PackageSavings.PartDetail = function PackageSavingsPartDetail(handle) {
|
|
220
|
+
return () => {
|
|
221
|
+
let { mix, ...rest } = handle.props;
|
|
222
|
+
return (_jsx("span", { "data-slot": "package-savings-part-detail", ...rest, "data-package-savings-part": "detail", mix: mergeMix([text("xs"), fg("neutral.muted")], mix) }));
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Renders a price as it would cost apart: muted and struck through, led by the summary's
|
|
227
|
+
* `separateLabel` for a screen reader. It sits at a part's end, or before the bundled amount.
|
|
228
|
+
*
|
|
229
|
+
* @param handle Runtime handle carrying the strike's props.
|
|
230
|
+
* @returns The render function producing the struck price.
|
|
231
|
+
* @example
|
|
232
|
+
* <PackageSavings.Separate>$1,698</PackageSavings.Separate>
|
|
233
|
+
*/
|
|
234
|
+
PackageSavings.Separate = function PackageSavingsSeparate(handle) {
|
|
235
|
+
return () => {
|
|
236
|
+
let { children, mix, ...rest } = handle.props;
|
|
237
|
+
let summary = handle.context.get(PackageSavings);
|
|
238
|
+
let label = summary?.separateLabel;
|
|
239
|
+
return (_jsxs("s", { "data-slot": "package-savings-separate", ...rest, "data-package-savings-part": "separate", mix: mergeMix([fg("neutral.muted"), tabularNums(), weight("normal")], mix), children: [label === undefined ? null : _jsx("span", { mix: [visuallyHidden()], children: `${label}: ` }), children] }));
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* Renders the success-tinted box holding the bundled price: the {@link PackageSavings.BundleLabel}
|
|
244
|
+
* and {@link PackageSavings.Savings} share its first line, and every other part takes a line of
|
|
245
|
+
* its own under them.
|
|
246
|
+
*
|
|
247
|
+
* @param handle Runtime handle carrying the box's props.
|
|
248
|
+
* @returns The render function producing the bundle's markup.
|
|
249
|
+
* @example
|
|
250
|
+
* <PackageSavings.Bundle>
|
|
251
|
+
* <PackageSavings.Savings>You save $212</PackageSavings.Savings>
|
|
252
|
+
* <PackageSavings.Total><PackageSavings.Amount>$1,486</PackageSavings.Amount></PackageSavings.Total>
|
|
253
|
+
* </PackageSavings.Bundle>
|
|
254
|
+
*/
|
|
255
|
+
PackageSavings.Bundle = function PackageSavingsBundle(handle) {
|
|
256
|
+
return () => {
|
|
257
|
+
let { mix, ...rest } = handle.props;
|
|
258
|
+
return (_jsx("div", { "data-slot": "package-savings-bundle", ...rest, "data-package-savings-part": "bundle", mix: mergeMix([
|
|
259
|
+
grid(),
|
|
260
|
+
raw({
|
|
261
|
+
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
262
|
+
columnGap: "0.5rem",
|
|
263
|
+
rowGap: "0.5rem",
|
|
115
264
|
alignItems: "center",
|
|
265
|
+
"& > *": { gridColumn: "1 / -1" },
|
|
266
|
+
[`& > ${BUNDLE_LABEL}`]: { gridColumn: "1" },
|
|
267
|
+
[`& > ${SAVINGS}`]: { gridColumn: "2", justifySelf: "end" },
|
|
116
268
|
}),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
269
|
+
p(4),
|
|
270
|
+
rounded("lg"),
|
|
271
|
+
bg("success.tint"),
|
|
272
|
+
border({ color: "success.border", width: 1 }),
|
|
273
|
+
], mix) }));
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Renders what the bundled price is in small medium-weight type.
|
|
278
|
+
*
|
|
279
|
+
* @param handle Runtime handle carrying the span's props.
|
|
280
|
+
* @returns The render function producing the label's markup.
|
|
281
|
+
* @example
|
|
282
|
+
* <PackageSavings.BundleLabel>Package price</PackageSavings.BundleLabel>
|
|
283
|
+
*/
|
|
284
|
+
PackageSavings.BundleLabel = function PackageSavingsBundleLabel(handle) {
|
|
285
|
+
return () => {
|
|
286
|
+
let { mix, ...rest } = handle.props;
|
|
287
|
+
return (_jsx("span", { "data-slot": "package-savings-bundle-label", ...rest, "data-package-savings-part": "bundle-label", mix: mergeMix([text("xs"), weight("medium"), fg("neutral.emphasis")], mix) }));
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* Renders the saving as a success-toned pill.
|
|
292
|
+
*
|
|
293
|
+
* @param handle Runtime handle carrying the span's props.
|
|
294
|
+
* @returns The render function producing the badge's markup.
|
|
295
|
+
* @example
|
|
296
|
+
* <PackageSavings.Savings>You save $212</PackageSavings.Savings>
|
|
297
|
+
*/
|
|
298
|
+
PackageSavings.Savings = function PackageSavingsSavings(handle) {
|
|
299
|
+
return () => {
|
|
300
|
+
let { mix, ...rest } = handle.props;
|
|
301
|
+
return (_jsx("span", { "data-slot": "package-savings-badge", ...rest, "data-package-savings-part": "savings", mix: mergeMix([
|
|
302
|
+
inlineFlex(),
|
|
303
|
+
raw({ paddingInline: "0.5rem", paddingBlock: "0.125rem" }),
|
|
304
|
+
rounded("full"),
|
|
305
|
+
bg("success.solid"),
|
|
306
|
+
fg("success.onSolid"),
|
|
307
|
+
text("xs"),
|
|
308
|
+
weight("semibold"),
|
|
309
|
+
leading(1.4),
|
|
310
|
+
], mix) }));
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* Renders the bundle's price line: any {@link PackageSavings.Separate} total struck through
|
|
315
|
+
* before the {@link PackageSavings.Amount}, on one baseline.
|
|
316
|
+
*
|
|
317
|
+
* @param handle Runtime handle carrying the paragraph's props.
|
|
318
|
+
* @returns The render function producing the price line's markup.
|
|
319
|
+
* @example
|
|
320
|
+
* <PackageSavings.Total>
|
|
321
|
+
* <PackageSavings.Separate>$1,698</PackageSavings.Separate>
|
|
322
|
+
* <PackageSavings.Amount>$1,486</PackageSavings.Amount>
|
|
323
|
+
* </PackageSavings.Total>
|
|
324
|
+
*/
|
|
325
|
+
PackageSavings.Total = function PackageSavingsTotal(handle) {
|
|
326
|
+
return () => {
|
|
327
|
+
let { mix, ...rest } = handle.props;
|
|
328
|
+
return (_jsx("p", { "data-slot": "package-savings-total", ...rest, mix: mergeMix([m(0), flex(), items("baseline"), raw({ flexWrap: "wrap", gap: "0.5rem" })], mix) }));
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* Renders the bundled price large in an `<output>`, so a script can update it in place.
|
|
333
|
+
*
|
|
334
|
+
* @param handle Runtime handle carrying the output's props.
|
|
335
|
+
* @returns The render function producing the amount's markup.
|
|
336
|
+
* @example
|
|
337
|
+
* <PackageSavings.Amount name="package-price">$1,486</PackageSavings.Amount>
|
|
338
|
+
*/
|
|
339
|
+
PackageSavings.Amount = function PackageSavingsAmount(handle) {
|
|
340
|
+
return () => {
|
|
341
|
+
let { mix, ...rest } = handle.props;
|
|
342
|
+
return (_jsx("output", { "data-slot": "package-savings-price", ...rest, mix: mergeMix([text("2xl"), weight("semibold"), leading(1.1), tabularNums(), fg("neutral.emphasis")], mix) }));
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Renders what the bundled price covers in small muted type.
|
|
347
|
+
*
|
|
348
|
+
* @param handle Runtime handle carrying the span's props.
|
|
349
|
+
* @returns The render function producing the detail's markup.
|
|
350
|
+
* @example
|
|
351
|
+
* <PackageSavings.BundleDetail>2 travellers · taxes included</PackageSavings.BundleDetail>
|
|
352
|
+
*/
|
|
353
|
+
PackageSavings.BundleDetail = function PackageSavingsBundleDetail(handle) {
|
|
354
|
+
return () => {
|
|
355
|
+
let { mix, ...rest } = handle.props;
|
|
356
|
+
return (_jsx("span", { "data-slot": "package-savings-bundle-detail", ...rest, mix: mergeMix([text("xs"), fg("neutral.muted")], mix) }));
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* Renders a booking button or link under the bundled price, stretched to the box's width.
|
|
361
|
+
*
|
|
362
|
+
* @param handle Runtime handle carrying the wrapper's props.
|
|
363
|
+
* @returns The render function producing the action's markup.
|
|
364
|
+
* @example
|
|
365
|
+
* <PackageSavings.Action><Button>Book package</Button></PackageSavings.Action>
|
|
366
|
+
*/
|
|
367
|
+
PackageSavings.Action = function PackageSavingsAction(handle) {
|
|
368
|
+
return () => {
|
|
369
|
+
let { mix, ...rest } = handle.props;
|
|
370
|
+
return (_jsx("div", { "data-slot": "package-savings-action", ...rest, mix: mergeMix([flex(), raw({ marginBlockStart: "0.25rem" }), when("& > *", raw({ flex: "1 1 auto" }))], mix) }));
|
|
127
371
|
};
|
|
128
372
|
};
|