@sdxc/ui 2026.11.10 → 2026.11.14
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 +92 -45
- package/dist/app/app-shell-toggle.d.ts +2 -0
- package/dist/app/app-shell-toggle.js +5 -2
- package/dist/app/app-shell.d.ts +25 -1
- package/dist/app/app-shell.js +73 -38
- package/dist/app/auto-refresh.d.ts +2 -0
- package/dist/app/auto-refresh.js +3 -3
- package/dist/app/behaviors/refresh-schedule.d.ts +8 -3
- package/dist/app/behaviors/refresh-schedule.js +4 -3
- package/dist/app/board.d.ts +123 -0
- package/dist/app/board.js +224 -0
- package/dist/app/chart.d.ts +2 -2
- package/dist/app/chart.js +7 -3
- package/dist/app/check-runs.d.ts +116 -0
- package/dist/app/check-runs.js +201 -0
- package/dist/app/code-view.d.ts +172 -0
- package/dist/app/code-view.js +414 -0
- package/dist/app/command-palette.d.ts +38 -3
- package/dist/app/command-palette.js +53 -5
- package/dist/app/contribution-graph.d.ts +106 -0
- package/dist/app/contribution-graph.js +289 -0
- package/dist/app/detail-sheet.d.ts +7 -0
- package/dist/app/detail-sheet.js +7 -7
- package/dist/app/diff.d.ts +200 -0
- package/dist/app/diff.js +702 -0
- package/dist/app/filter-bar.d.ts +20 -0
- package/dist/app/filter-bar.js +35 -15
- package/dist/app/filter-menu.d.ts +144 -0
- package/dist/app/filter-menu.js +480 -0
- package/dist/app/gantt.d.ts +108 -0
- package/dist/app/gantt.js +420 -0
- package/dist/app/index.d.ts +19 -0
- package/dist/app/index.js +19 -0
- package/dist/app/log-viewer.d.ts +120 -0
- package/dist/app/log-viewer.js +384 -0
- package/dist/app/merge-box.d.ts +97 -0
- package/dist/app/merge-box.js +227 -0
- package/dist/app/mixins/app-shell-controls.d.ts +4 -1
- package/dist/app/mixins/app-shell-controls.js +64 -4
- package/dist/app/mixins/auto-refresh.d.ts +5 -2
- package/dist/app/mixins/auto-refresh.js +9 -3
- package/dist/app/mixins/close-popover-on-submit.d.ts +16 -0
- package/dist/app/mixins/close-popover-on-submit.js +32 -0
- package/dist/app/mixins/code-view-selection.d.ts +60 -0
- package/dist/app/mixins/code-view-selection.js +276 -0
- package/dist/app/mixins/command-palette.d.ts +15 -4
- package/dist/app/mixins/command-palette.js +94 -6
- package/dist/app/mixins/contribution-graph-keys.d.ts +19 -0
- package/dist/app/mixins/contribution-graph-keys.js +155 -0
- package/dist/app/mixins/diff-interactions.d.ts +72 -0
- package/dist/app/mixins/diff-interactions.js +269 -0
- package/dist/app/mixins/filter-menu-keys.d.ts +41 -0
- package/dist/app/mixins/filter-menu-keys.js +91 -0
- package/dist/app/mixins/gantt-today.d.ts +17 -0
- package/dist/app/mixins/gantt-today.js +50 -0
- package/dist/app/mixins/log-viewer.d.ts +29 -0
- package/dist/app/mixins/log-viewer.js +333 -0
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +5 -0
- package/dist/app/mixins/optimistic-toggle-sync.js +25 -1
- package/dist/app/mixins/save-bar-sync.d.ts +7 -1
- package/dist/app/mixins/save-bar-sync.js +23 -4
- package/dist/app/mixins/save-status-sync.js +23 -1
- package/dist/app/mixins/split-view.js +1 -1
- package/dist/app/mixins/submit-on-close.d.ts +17 -0
- package/dist/app/mixins/submit-on-close.js +52 -0
- package/dist/app/mixins/tree-filter.d.ts +44 -0
- package/dist/app/mixins/tree-filter.js +111 -0
- package/dist/app/mixins/tree-navigation.d.ts +50 -0
- package/dist/app/mixins/tree-navigation.js +216 -0
- package/dist/app/optimistic-toggle.d.ts +8 -0
- package/dist/app/optimistic-toggle.js +3 -2
- package/dist/app/page-header.d.ts +18 -3
- package/dist/app/page-header.js +105 -50
- package/dist/app/review-thread.d.ts +115 -0
- package/dist/app/review-thread.js +116 -0
- package/dist/app/save-bar.d.ts +5 -0
- package/dist/app/save-bar.js +1 -1
- package/dist/app/settings-layout.d.ts +5 -0
- package/dist/app/settings-layout.js +5 -5
- package/dist/app/skeleton.d.ts +9 -0
- package/dist/app/skeleton.js +28 -0
- package/dist/app/split-view.d.ts +4 -0
- package/dist/app/split-view.js +3 -3
- package/dist/app/styles/code-tokens.d.ts +24 -0
- package/dist/app/styles/code-tokens.js +47 -0
- package/dist/app/tab-bar.d.ts +59 -0
- package/dist/app/tab-bar.js +111 -0
- package/dist/app/tree.d.ts +111 -14
- package/dist/app/tree.js +202 -15
- package/dist/app/utils/ansi.d.ts +55 -0
- package/dist/app/utils/ansi.js +157 -0
- package/dist/app/utils/diff-rows.d.ts +82 -0
- package/dist/app/utils/diff-rows.js +209 -0
- package/dist/app/utils/fuzzy-path.d.ts +58 -0
- package/dist/app/utils/fuzzy-path.js +202 -0
- package/dist/app/utils/line-range.d.ts +48 -0
- package/dist/app/utils/line-range.js +61 -0
- package/dist/app/utils/log-lines.d.ts +107 -0
- package/dist/app/utils/log-lines.js +170 -0
- package/dist/app/utils/tree-filter.d.ts +19 -0
- package/dist/app/utils/tree-filter.js +26 -0
- package/dist/app/view-options.d.ts +2 -0
- package/dist/app/view-options.js +2 -2
- package/dist/chat/activity.d.ts +72 -0
- package/dist/chat/activity.js +184 -0
- package/dist/chat/composer-submit.d.ts +38 -0
- package/dist/chat/composer-submit.js +44 -0
- package/dist/chat/composer.d.ts +47 -0
- package/dist/chat/composer.js +100 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +6 -0
- package/dist/chat/mixins/composer-send.d.ts +32 -0
- package/dist/chat/mixins/composer-send.js +121 -0
- package/dist/chat/mixins/reveal-stream.d.ts +68 -0
- package/dist/chat/mixins/reveal-stream.js +184 -0
- package/dist/chat/mixins/stream-target.d.ts +18 -0
- package/dist/chat/mixins/stream-target.js +38 -0
- package/dist/components/button.js +7 -1
- package/dist/components/character-count.d.ts +44 -0
- package/dist/components/character-count.js +68 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/label-chip.d.ts +42 -0
- package/dist/components/label-chip.js +86 -0
- package/dist/components/property-list.d.ts +9 -2
- package/dist/components/property-list.js +11 -6
- package/dist/components/textarea.js +6 -1
- package/dist/components/timeline.d.ts +62 -5
- package/dist/components/timeline.js +124 -5
- package/dist/docs/code-block.js +8 -31
- package/dist/docs/file-tree.js +3 -48
- package/dist/landing/case-study.d.ts +79 -0
- package/dist/landing/case-study.js +162 -0
- package/dist/landing/contributor-wall.d.ts +72 -0
- package/dist/landing/contributor-wall.js +129 -0
- package/dist/landing/countdown.d.ts +88 -0
- package/dist/landing/countdown.js +91 -0
- package/dist/landing/episode-player.d.ts +87 -0
- package/dist/landing/episode-player.js +113 -0
- package/dist/landing/faq-band.d.ts +3 -2
- package/dist/landing/faq-band.js +4 -3
- package/dist/landing/feature-band.d.ts +8 -0
- package/dist/landing/feature-band.js +9 -3
- package/dist/landing/index.d.ts +9 -0
- package/dist/landing/index.js +9 -0
- package/dist/landing/landing-header.js +15 -4
- package/dist/landing/mixins/countdown-tick.d.ts +29 -0
- package/dist/landing/mixins/countdown-tick.js +65 -0
- package/dist/landing/mixins/usage-estimate-live.d.ts +32 -0
- package/dist/landing/mixins/usage-estimate-live.js +120 -0
- package/dist/landing/phone-fan.d.ts +38 -0
- package/dist/landing/phone-fan.js +89 -0
- package/dist/landing/phone-frame.d.ts +48 -0
- package/dist/landing/phone-frame.js +41 -0
- package/dist/landing/price-list.d.ts +68 -0
- package/dist/landing/price-list.js +125 -0
- package/dist/landing/scroll-scene.d.ts +59 -0
- package/dist/landing/scroll-scene.js +70 -0
- package/dist/landing/sponsor-wall.d.ts +30 -6
- package/dist/landing/sponsor-wall.js +70 -14
- package/dist/landing/typed-terminal.d.ts +24 -6
- package/dist/landing/typed-terminal.js +22 -14
- package/dist/landing/usage-estimate.d.ts +127 -0
- package/dist/landing/usage-estimate.js +164 -0
- package/dist/landing/utils/countdown.d.ts +33 -0
- package/dist/landing/utils/countdown.js +42 -0
- package/dist/landing/utils/pause-toggle.d.ts +2 -1
- package/dist/mixins/character-count.d.ts +62 -0
- package/dist/mixins/character-count.js +139 -0
- package/dist/mixins/index.d.ts +6 -2
- package/dist/mixins/index.js +6 -2
- package/dist/mixins/invoker-fields.d.ts +18 -0
- package/dist/mixins/invoker-fields.js +60 -0
- package/dist/mixins/media-sync.d.ts +58 -0
- package/dist/mixins/media-sync.js +102 -0
- package/dist/mixins/menu-keys.d.ts +11 -0
- package/dist/mixins/menu-keys.js +79 -70
- package/dist/mixins/sortable.d.ts +96 -0
- package/dist/mixins/sortable.js +433 -0
- package/dist/utils/code-lines.d.ts +26 -0
- package/dist/utils/code-lines.js +29 -0
- package/dist/utils/file-icon.d.ts +31 -0
- package/dist/utils/file-icon.js +60 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/write-cookie.d.ts +15 -15
- package/dist/utils/write-cookie.js +10 -16
- package/dist/video/index.d.ts +11 -0
- package/dist/video/index.js +11 -0
- package/dist/video/mixins/video-player-sync.d.ts +27 -0
- package/dist/video/mixins/video-player-sync.js +413 -0
- package/dist/video/utils/timeline.d.ts +55 -0
- package/dist/video/utils/timeline.js +90 -0
- package/dist/video/video-player.d.ts +261 -0
- package/dist/video/video-player.js +927 -0
- package/package.json +6 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scroll-linked scene: a tall runway whose stage sticks under the header while the reader
|
|
3
|
+
* scrolls through it, publishing a named view timeline the stage's parts animate along with
|
|
4
|
+
* {@link sceneMotion}. Without scroll timelines, or under reduced motion, it is a static frame.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { UtilityMixin } from "@sdxc/u";
|
|
10
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
11
|
+
/**
|
|
12
|
+
* Prop types for {@link ScrollScene}.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace ScrollScene {
|
|
15
|
+
/**
|
|
16
|
+
* Props accepted by {@link ScrollScene}.
|
|
17
|
+
*/
|
|
18
|
+
interface Props extends TagProps<"div"> {
|
|
19
|
+
/** The view timeline's name without its leading dashes; {@link sceneMotion} takes the same. */
|
|
20
|
+
timeline: string;
|
|
21
|
+
/**
|
|
22
|
+
* Viewport heights of scroll the stage stays pinned for. A longer runway plays the
|
|
23
|
+
* scene more slowly against the reader's scroll.
|
|
24
|
+
*
|
|
25
|
+
* @default 2.5
|
|
26
|
+
*/
|
|
27
|
+
length?: number;
|
|
28
|
+
/** The stage: the drawing and whatever annotates it, sized to fit under the header. */
|
|
29
|
+
children: RemixNode;
|
|
30
|
+
}
|
|
31
|
+
/** The stops a part of the stage runs through, as `@keyframes` selectors to declarations. */
|
|
32
|
+
type Keyframes = Record<string, Record<string, string | number>>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Renders the runway and a sticky stage centred under `--ui-landing-header-height`, all in CSS
|
|
36
|
+
* with nothing to hydrate; inside a scroll panel, set `--ui-scroll-scene-viewport` to its height.
|
|
37
|
+
* Without view timelines, or under reduced motion, the stage sits in normal flow as a still frame.
|
|
38
|
+
*
|
|
39
|
+
* @param handle Runtime handle carrying the timeline name, length and stage.
|
|
40
|
+
* @returns The render function producing the scene.
|
|
41
|
+
* @example
|
|
42
|
+
* <ScrollScene timeline="explode" length={2.6}>
|
|
43
|
+
* <div mix={[sceneMotion("explode", { from: { translate: "0 0 0" } }, "contain 5% contain 70%")]} />
|
|
44
|
+
* </ScrollScene>
|
|
45
|
+
*/
|
|
46
|
+
export declare function ScrollScene(handle: Handle<ScrollScene.Props>): () => import("remix/component").RemixElement;
|
|
47
|
+
/**
|
|
48
|
+
* Runs a part of a {@link ScrollScene} through keyframes as the reader scrolls the scene.
|
|
49
|
+
* The part's own styles are the static frame a reader who prefers reduced motion, or a
|
|
50
|
+
* browser without scroll timelines, sees, so the last keyframe should match them.
|
|
51
|
+
*
|
|
52
|
+
* @param timeline The scene's timeline name, as given to {@link ScrollScene}.
|
|
53
|
+
* @param keyframes The stops the part runs through.
|
|
54
|
+
* @param range The stretch of the scene the stops span, as an `animation-range`.
|
|
55
|
+
* @param easing How the part moves between stops; `steps(n)` ticks, as typed text does.
|
|
56
|
+
* @returns One mixin for the part's `mix`.
|
|
57
|
+
* @example mix={[sceneMotion("explode", { from: { opacity: "0.3" }, to: { opacity: "1" } }, "contain 10% contain 30%")]}
|
|
58
|
+
*/
|
|
59
|
+
export declare function sceneMotion(timeline: string, keyframes: ScrollScene.Keyframes, range?: string, easing?: string): UtilityMixin;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
2
|
+
import { animation } from "@sdxc/u/animation";
|
|
3
|
+
import { raw } from "@sdxc/u/general";
|
|
4
|
+
import { media, supports } from "@sdxc/u/responsive";
|
|
5
|
+
/** The feature query every scroll-linked rule here is gated on. */
|
|
6
|
+
const TIMELINE_SUPPORT = "(animation-timeline: view())";
|
|
7
|
+
/** The motion preference every scroll-linked rule here is gated on. */
|
|
8
|
+
const MOTION_OK = "(prefers-reduced-motion: no-preference)";
|
|
9
|
+
/** The sticky header the stage sits under; the stage fills the viewport below it. */
|
|
10
|
+
const HEADER = "var(--ui-landing-header-height, 4rem)";
|
|
11
|
+
/**
|
|
12
|
+
* The height of the scroller the scene plays in: the viewport by default. A scene inside a
|
|
13
|
+
* fixed-height scroll panel sets `--ui-scroll-scene-viewport` to the panel's height.
|
|
14
|
+
*/
|
|
15
|
+
const VIEWPORT = "var(--ui-scroll-scene-viewport, 100svh)";
|
|
16
|
+
/** Viewport heights of scroll {@link ScrollScene} holds its stage for when `length` is omitted. */
|
|
17
|
+
const DEFAULT_LENGTH = 2.5;
|
|
18
|
+
/** The stretch of the scene {@link sceneMotion} spans when `range` is omitted: all of it. */
|
|
19
|
+
const DEFAULT_RANGE = "contain 0% contain 100%";
|
|
20
|
+
/**
|
|
21
|
+
* Renders the runway and a sticky stage centred under `--ui-landing-header-height`, all in CSS
|
|
22
|
+
* with nothing to hydrate; inside a scroll panel, set `--ui-scroll-scene-viewport` to its height.
|
|
23
|
+
* Without view timelines, or under reduced motion, the stage sits in normal flow as a still frame.
|
|
24
|
+
*
|
|
25
|
+
* @param handle Runtime handle carrying the timeline name, length and stage.
|
|
26
|
+
* @returns The render function producing the scene.
|
|
27
|
+
* @example
|
|
28
|
+
* <ScrollScene timeline="explode" length={2.6}>
|
|
29
|
+
* <div mix={[sceneMotion("explode", { from: { translate: "0 0 0" } }, "contain 5% contain 70%")]} />
|
|
30
|
+
* </ScrollScene>
|
|
31
|
+
*/
|
|
32
|
+
export function ScrollScene(handle) {
|
|
33
|
+
return () => {
|
|
34
|
+
let { timeline, length = DEFAULT_LENGTH, children, mix, ...rest } = handle.props;
|
|
35
|
+
return (_jsx("div", { ...rest, "data-slot": "scroll-scene", mix: [
|
|
36
|
+
raw({ position: "relative", viewTimelineName: `--${timeline}` }),
|
|
37
|
+
supports(TIMELINE_SUPPORT, media(MOTION_OK, raw({ blockSize: `calc(${length} * (${VIEWPORT} - ${HEADER}))` }))),
|
|
38
|
+
mix,
|
|
39
|
+
], children: _jsx("div", { "data-slot": "scroll-scene-stage", mix: [
|
|
40
|
+
raw({ display: "grid", alignContent: "center" }),
|
|
41
|
+
supports(TIMELINE_SUPPORT, media(MOTION_OK, raw({
|
|
42
|
+
position: "sticky",
|
|
43
|
+
insetBlockStart: HEADER,
|
|
44
|
+
blockSize: `calc(${VIEWPORT} - ${HEADER})`,
|
|
45
|
+
}))),
|
|
46
|
+
], children: children }) }));
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Runs a part of a {@link ScrollScene} through keyframes as the reader scrolls the scene.
|
|
51
|
+
* The part's own styles are the static frame a reader who prefers reduced motion, or a
|
|
52
|
+
* browser without scroll timelines, sees, so the last keyframe should match them.
|
|
53
|
+
*
|
|
54
|
+
* @param timeline The scene's timeline name, as given to {@link ScrollScene}.
|
|
55
|
+
* @param keyframes The stops the part runs through.
|
|
56
|
+
* @param range The stretch of the scene the stops span, as an `animation-range`.
|
|
57
|
+
* @param easing How the part moves between stops; `steps(n)` ticks, as typed text does.
|
|
58
|
+
* @returns One mixin for the part's `mix`.
|
|
59
|
+
* @example mix={[sceneMotion("explode", { from: { opacity: "0.3" }, to: { opacity: "1" } }, "contain 10% contain 30%")]}
|
|
60
|
+
*/
|
|
61
|
+
export function sceneMotion(timeline, keyframes, range = DEFAULT_RANGE, easing = "linear") {
|
|
62
|
+
return supports(TIMELINE_SUPPORT, media(MOTION_OK, animation({
|
|
63
|
+
keyframes,
|
|
64
|
+
duration: "auto",
|
|
65
|
+
easing,
|
|
66
|
+
fillMode: "both",
|
|
67
|
+
timeline: `--${timeline}`,
|
|
68
|
+
range,
|
|
69
|
+
})));
|
|
70
|
+
}
|
|
@@ -21,8 +21,14 @@ export declare namespace SponsorWall {
|
|
|
21
21
|
interface Props extends TagProps<"div"> {
|
|
22
22
|
/** {@link SponsorWall.Tier} groups, highest first, then an optional {@link SponsorWall.Individuals}. */
|
|
23
23
|
children: RemixNode;
|
|
24
|
-
/** Closing actions, such as "Become a sponsor", rendered inside a
|
|
24
|
+
/** Closing actions, such as "Become a sponsor", rendered inside a {@link CtaGroup}. */
|
|
25
25
|
actions?: RemixNode;
|
|
26
|
+
/**
|
|
27
|
+
* Where the backer cloud and the closing actions sit on their rows: centred under a
|
|
28
|
+
* centred title, or on the start edge under a title set flush with the column.
|
|
29
|
+
* @default "center"
|
|
30
|
+
*/
|
|
31
|
+
align?: "center" | "start";
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
28
34
|
* Props accepted by {@link SponsorWall.Tier}.
|
|
@@ -30,7 +36,10 @@ export declare namespace SponsorWall {
|
|
|
30
36
|
interface TierProps extends TagProps<"div"> {
|
|
31
37
|
/** The tier's name, such as "Gold partners"; it heads the tier at the ambient depth. */
|
|
32
38
|
label: RemixNode;
|
|
33
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Cell and logo scale, larger for a more prominent tier.
|
|
41
|
+
* @default "md"
|
|
42
|
+
*/
|
|
34
43
|
size?: TierSize;
|
|
35
44
|
/**
|
|
36
45
|
* The marks: inline SVGs drawn in `currentColor`, images, or links wrapping either.
|
|
@@ -55,15 +64,24 @@ export declare namespace SponsorWall {
|
|
|
55
64
|
href: string;
|
|
56
65
|
/** The backer's name, which is the link's accessible name and its tooltip. */
|
|
57
66
|
name: string;
|
|
58
|
-
/** Picture URL
|
|
67
|
+
/** Picture URL, drawn over the name's initials, which show while it loads or if it fails. */
|
|
59
68
|
src?: string;
|
|
60
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Circle diameter: 2rem, 2.75rem or 3.5rem.
|
|
71
|
+
* @default "md"
|
|
72
|
+
*/
|
|
61
73
|
size?: PersonSize;
|
|
74
|
+
/**
|
|
75
|
+
* Sets the name under the circle in two centred lines at most, every named backer 6rem
|
|
76
|
+
* wide. The caption links to `href` for a pointer; the circle stays the focusable, named link.
|
|
77
|
+
*/
|
|
78
|
+
showName?: boolean;
|
|
62
79
|
}
|
|
63
80
|
}
|
|
64
81
|
/**
|
|
65
|
-
* Stacks sponsor tiers, the backer cloud and the closing actions,
|
|
66
|
-
* scope so every tier label sits one level under the band's title.
|
|
82
|
+
* Stacks sponsor tiers, the backer cloud and the closing actions, all server-rendered with no
|
|
83
|
+
* script, and opens a heading scope so every tier label sits one level under the band's title.
|
|
84
|
+
* Tier grids rule their cells in `--ui-landing-hairline`.
|
|
67
85
|
*
|
|
68
86
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
69
87
|
* @returns The render function producing the wall's markup.
|
|
@@ -72,6 +90,12 @@ export declare namespace SponsorWall {
|
|
|
72
90
|
* <SponsorWall.Tier label={t("sponsor.gold")} size="xl">{goldMarks}</SponsorWall.Tier>
|
|
73
91
|
* <SponsorWall.Tier label={t("sponsor.silver")} size="lg">{silverMarks}</SponsorWall.Tier>
|
|
74
92
|
* </SponsorWall>
|
|
93
|
+
* @example
|
|
94
|
+
* <SponsorWall align="start" actions={<LinkButton href={profile}>Sponsor</LinkButton>}>
|
|
95
|
+
* <SponsorWall.Individuals label="Backers">
|
|
96
|
+
* <SponsorWall.Person href={ana.url} name="Ana Souza" src={ana.avatar} size="lg" showName />
|
|
97
|
+
* </SponsorWall.Individuals>
|
|
98
|
+
* </SponsorWall>
|
|
75
99
|
*/
|
|
76
100
|
export declare function SponsorWall(handle: Handle<SponsorWall.Props>): () => import("remix/component").RemixElement;
|
|
77
101
|
export declare namespace SponsorWall {
|
|
@@ -9,6 +9,8 @@ import { HeadingScope, resolveHeadingLevel, TAG_BY_LEVEL } from "../components/h
|
|
|
9
9
|
import { eyebrow } from "../styles/landing.js";
|
|
10
10
|
/** Container the tier grids and the backer cloud query for their column steps. */
|
|
11
11
|
const CONTAINER = "ui-landing-sponsor-wall";
|
|
12
|
+
/** The property the wall sets from `align`, read by the backer cloud and the actions row. */
|
|
13
|
+
const JUSTIFY = "--ui-sponsor-wall-justify";
|
|
12
14
|
/** Translucent line the tier grids rule their cells with. */
|
|
13
15
|
const HAIRLINE = "var(--ui-landing-hairline, color-mix(in oklch, CanvasText 8%, transparent))";
|
|
14
16
|
/** Tier size {@link SponsorWall.Tier} applies when `size` is omitted. */
|
|
@@ -29,8 +31,9 @@ const PERSON_SIZES = {
|
|
|
29
31
|
lg: "3.5rem",
|
|
30
32
|
};
|
|
31
33
|
/**
|
|
32
|
-
* Stacks sponsor tiers, the backer cloud and the closing actions,
|
|
33
|
-
* scope so every tier label sits one level under the band's title.
|
|
34
|
+
* Stacks sponsor tiers, the backer cloud and the closing actions, all server-rendered with no
|
|
35
|
+
* script, and opens a heading scope so every tier label sits one level under the band's title.
|
|
36
|
+
* Tier grids rule their cells in `--ui-landing-hairline`.
|
|
34
37
|
*
|
|
35
38
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
36
39
|
* @returns The render function producing the wall's markup.
|
|
@@ -39,15 +42,24 @@ const PERSON_SIZES = {
|
|
|
39
42
|
* <SponsorWall.Tier label={t("sponsor.gold")} size="xl">{goldMarks}</SponsorWall.Tier>
|
|
40
43
|
* <SponsorWall.Tier label={t("sponsor.silver")} size="lg">{silverMarks}</SponsorWall.Tier>
|
|
41
44
|
* </SponsorWall>
|
|
45
|
+
* @example
|
|
46
|
+
* <SponsorWall align="start" actions={<LinkButton href={profile}>Sponsor</LinkButton>}>
|
|
47
|
+
* <SponsorWall.Individuals label="Backers">
|
|
48
|
+
* <SponsorWall.Person href={ana.url} name="Ana Souza" src={ana.avatar} size="lg" showName />
|
|
49
|
+
* </SponsorWall.Individuals>
|
|
50
|
+
* </SponsorWall>
|
|
42
51
|
*/
|
|
43
52
|
export function SponsorWall(handle) {
|
|
44
53
|
return () => {
|
|
45
|
-
let { actions, children, mix, ...rest } = handle.props;
|
|
54
|
+
let { actions, align, children, mix, ...rest } = handle.props;
|
|
46
55
|
return (_jsxs("div", { ...rest, "data-slot": "sponsor-wall", mix: mergeMix([
|
|
47
56
|
container(CONTAINER),
|
|
48
57
|
vstack({ gap: 14, align: "stretch" }),
|
|
49
|
-
raw({
|
|
50
|
-
|
|
58
|
+
raw({
|
|
59
|
+
inlineSize: "100%",
|
|
60
|
+
[JUSTIFY]: align === "start" ? "flex-start" : "center",
|
|
61
|
+
}),
|
|
62
|
+
], mix), children: [_jsx(HeadingScope, { children: children }), actions ? (_jsx(CtaGroup, { "data-slot": "sponsor-wall-actions", mix: [raw({ justifyContent: `var(${JUSTIFY}, center)` })], children: actions })) : null] }));
|
|
51
63
|
};
|
|
52
64
|
}
|
|
53
65
|
/**
|
|
@@ -145,8 +157,8 @@ SponsorWall.Tier = function SponsorWallTier(handle) {
|
|
|
145
157
|
};
|
|
146
158
|
};
|
|
147
159
|
/**
|
|
148
|
-
* The individual backers: a
|
|
149
|
-
*
|
|
160
|
+
* The individual backers: a wrapping cloud of {@link SponsorWall.Person} circles under an
|
|
161
|
+
* optional label, centred or on the start edge by the wall's `align`.
|
|
150
162
|
*
|
|
151
163
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
152
164
|
* @returns The render function producing the cloud's markup.
|
|
@@ -167,7 +179,7 @@ SponsorWall.Individuals = function SponsorWallIndividuals(handle) {
|
|
|
167
179
|
display: "flex",
|
|
168
180
|
flexWrap: "wrap",
|
|
169
181
|
alignItems: "center",
|
|
170
|
-
justifyContent:
|
|
182
|
+
justifyContent: `var(${JUSTIFY}, center)`,
|
|
171
183
|
gap: "0.75rem",
|
|
172
184
|
}),
|
|
173
185
|
], children: children })] }));
|
|
@@ -183,9 +195,9 @@ function initials(name) {
|
|
|
183
195
|
.join("");
|
|
184
196
|
}
|
|
185
197
|
/**
|
|
186
|
-
* One backer's circle in one rule: grayscale until
|
|
187
|
-
*
|
|
188
|
-
*
|
|
198
|
+
* One backer's circle in one rule: grayscale until hovered or focused, so mixed photos read
|
|
199
|
+
* as one band, a 44px hit area around even the smallest circle, and the picture stacked over
|
|
200
|
+
* the initials, which show while it loads; a failed picture paints them over its broken icon.
|
|
189
201
|
*/
|
|
190
202
|
function personCircle(diameter) {
|
|
191
203
|
return combine([
|
|
@@ -212,30 +224,74 @@ function personCircle(diameter) {
|
|
|
212
224
|
inset: `min(0px, calc((${diameter} - 2.75rem) / 2))`,
|
|
213
225
|
borderRadius: "9999px",
|
|
214
226
|
})),
|
|
227
|
+
when("& > *", raw({ gridArea: "1 / 1" })),
|
|
215
228
|
when("& > img", raw({
|
|
216
229
|
inlineSize: "100%",
|
|
217
230
|
blockSize: "100%",
|
|
218
231
|
borderRadius: "9999px",
|
|
219
232
|
objectFit: "cover",
|
|
233
|
+
position: "relative",
|
|
220
234
|
outline: "1px solid var(--ui-image-outline, rgb(0 0 0 / 0.1))",
|
|
221
235
|
outlineOffset: "-1px",
|
|
222
236
|
})),
|
|
237
|
+
when("& > img::before", raw({
|
|
238
|
+
content: "attr(data-initials)",
|
|
239
|
+
position: "absolute",
|
|
240
|
+
inset: "0",
|
|
241
|
+
zIndex: "1",
|
|
242
|
+
display: "grid",
|
|
243
|
+
placeItems: "center",
|
|
244
|
+
borderRadius: "9999px",
|
|
245
|
+
backgroundColor: "color-mix(in oklch, var(--ui-neutral-fg-emphasis, CanvasText) 10%, Canvas)",
|
|
246
|
+
})),
|
|
223
247
|
motionSafe(raw({ transition: "filter 200ms" })),
|
|
224
248
|
]);
|
|
225
249
|
}
|
|
226
250
|
/**
|
|
227
|
-
*
|
|
251
|
+
* A named backer's caption: two centred lines at most in the heading ink, so names of any
|
|
252
|
+
* length keep every person in the cloud the same width.
|
|
253
|
+
*/
|
|
254
|
+
function personName() {
|
|
255
|
+
return raw({
|
|
256
|
+
maxInlineSize: "100%",
|
|
257
|
+
fontSize: "0.8125rem",
|
|
258
|
+
lineHeight: "1.25",
|
|
259
|
+
fontWeight: "500",
|
|
260
|
+
textAlign: "center",
|
|
261
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
262
|
+
textDecoration: "none",
|
|
263
|
+
overflowWrap: "anywhere",
|
|
264
|
+
display: "-webkit-box",
|
|
265
|
+
WebkitBoxOrient: "vertical",
|
|
266
|
+
WebkitLineClamp: "2",
|
|
267
|
+
overflow: "hidden",
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* One individual backer: a linked circle with their picture over their initials, named by
|
|
228
272
|
* `name` for assistive technology and as a tooltip.
|
|
229
273
|
*
|
|
230
274
|
* @param handle Runtime handle carrying the host `<a>`'s props.
|
|
231
275
|
* @returns The render function producing the backer's list item.
|
|
232
276
|
* @example
|
|
233
277
|
* <SponsorWall.Person href="https://github.com/ana" name="Ana Souza" src={ana} size="sm" />
|
|
278
|
+
* @example
|
|
279
|
+
* <SponsorWall.Person href="https://github.com/ana" name="Ana Souza" src={ana} size="lg" showName />
|
|
234
280
|
*/
|
|
235
281
|
SponsorWall.Person = function SponsorWallPerson(handle) {
|
|
236
282
|
return () => {
|
|
237
|
-
let { href, mix, name, size, src, ...rest } = handle.props;
|
|
283
|
+
let { href, mix, name, showName, size, src, ...rest } = handle.props;
|
|
238
284
|
let resolvedSize = size ?? DEFAULT_PERSON_SIZE;
|
|
239
|
-
return (
|
|
285
|
+
return (_jsxs("li", { "data-slot": "sponsor-wall-person", mix: [
|
|
286
|
+
showName
|
|
287
|
+
? raw({
|
|
288
|
+
display: "flex",
|
|
289
|
+
flexDirection: "column",
|
|
290
|
+
alignItems: "center",
|
|
291
|
+
gap: "0.5rem",
|
|
292
|
+
inlineSize: "6rem",
|
|
293
|
+
})
|
|
294
|
+
: raw({ display: "flex" }),
|
|
295
|
+
], children: [_jsxs("a", { ...rest, href: href, "aria-label": name, title: name, "data-size": resolvedSize, mix: mergeMix(personCircle(PERSON_SIZES[resolvedSize]), mix), children: [_jsx("span", { "aria-hidden": "true", children: initials(name) }), src ? _jsx("img", { src: src, alt: "", loading: "lazy", "data-initials": initials(name) }) : null] }), showName ? (_jsx("a", { href: href, rel: rest.rel, tabIndex: -1, "aria-hidden": "true", "data-slot": "sponsor-wall-name", mix: [personName()], children: name })) : null] }));
|
|
240
296
|
};
|
|
241
297
|
};
|
|
@@ -13,6 +13,8 @@ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
|
13
13
|
export declare namespace TypedTerminal {
|
|
14
14
|
/** Ink an output line prints in: a pass, a failure, or a quiet aside. */
|
|
15
15
|
type Status = "ok" | "fail" | "muted";
|
|
16
|
+
/** Panel the session plays on: the dark terminal, or the page's own raised code card. */
|
|
17
|
+
type Variant = "terminal" | "code";
|
|
16
18
|
/** One line of the session. */
|
|
17
19
|
interface Line {
|
|
18
20
|
/** An `input` line types itself out; an `output` line fades in once typed lines finish. */
|
|
@@ -29,23 +31,32 @@ export declare namespace TypedTerminal {
|
|
|
29
31
|
* Props accepted by {@link TypedTerminal}.
|
|
30
32
|
*/
|
|
31
33
|
interface Props extends Omit<TagProps<"div">, "children" | "title"> {
|
|
32
|
-
/** Accessible name of the session's figure
|
|
34
|
+
/** Accessible name of the session's figure, in the page's language. */
|
|
33
35
|
"aria-label": string;
|
|
34
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Accessible name of the pause toggle.
|
|
38
|
+
*
|
|
39
|
+
* @default "Pause the animation"
|
|
40
|
+
*/
|
|
35
41
|
pauseLabel?: string;
|
|
36
42
|
/** Window title, such as a file name or a shell. */
|
|
37
43
|
title?: RemixNode;
|
|
38
44
|
/** Glyph before every input line, such as `$`; omit it for editor-style lines. */
|
|
39
45
|
prompt?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Panel the session plays on. `code` sets it on the raised code card in the page's
|
|
48
|
+
* own scheme, for a session that reads as a document being written.
|
|
49
|
+
* @default "terminal"
|
|
50
|
+
*/
|
|
51
|
+
variant?: Variant;
|
|
40
52
|
/** The session, in the order it plays. */
|
|
41
53
|
lines: readonly Line[];
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
56
|
/**
|
|
45
|
-
* Renders the session as one `<pre>`
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* types, so screen readers and copy read the whole session and reduced motion shows it done.
|
|
57
|
+
* Renders the session as one `<pre>` on the `variant`'s panel, its pause toggle in the title bar.
|
|
58
|
+
* The typing is CSS alone with nothing to hydrate: every line's full text is in the markup,
|
|
59
|
+
* clipped while it types, so screen readers, copy and reduced motion get the finished session.
|
|
49
60
|
*
|
|
50
61
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
51
62
|
* @returns The render function producing the terminal's markup.
|
|
@@ -58,5 +69,12 @@ export declare namespace TypedTerminal {
|
|
|
58
69
|
* { kind: "output", text: "✓ 1 step · 0.4s", status: "ok" },
|
|
59
70
|
* ]}
|
|
60
71
|
* />
|
|
72
|
+
* @example
|
|
73
|
+
* <TypedTerminal
|
|
74
|
+
* variant="code"
|
|
75
|
+
* aria-label="A spec being written"
|
|
76
|
+
* title="checkout.spec"
|
|
77
|
+
* lines={[{ kind: "input", text: 'Scenario: "Pay with a saved card"' }]}
|
|
78
|
+
* />
|
|
61
79
|
*/
|
|
62
80
|
export declare function TypedTerminal(handle: Handle<TypedTerminal.Props>): () => import("remix/component").RemixElement;
|
|
@@ -27,10 +27,9 @@ const FADE = 1.5;
|
|
|
27
27
|
/** Name of the caret's blink, shared by every terminal since it never depends on content. */
|
|
28
28
|
const BLINK = "ui-typed-terminal-blink";
|
|
29
29
|
/**
|
|
30
|
-
* Renders the session as one `<pre>`
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* types, so screen readers and copy read the whole session and reduced motion shows it done.
|
|
30
|
+
* Renders the session as one `<pre>` on the `variant`'s panel, its pause toggle in the title bar.
|
|
31
|
+
* The typing is CSS alone with nothing to hydrate: every line's full text is in the markup,
|
|
32
|
+
* clipped while it types, so screen readers, copy and reduced motion get the finished session.
|
|
34
33
|
*
|
|
35
34
|
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
36
35
|
* @returns The render function producing the terminal's markup.
|
|
@@ -43,19 +42,26 @@ const BLINK = "ui-typed-terminal-blink";
|
|
|
43
42
|
* { kind: "output", text: "✓ 1 step · 0.4s", status: "ok" },
|
|
44
43
|
* ]}
|
|
45
44
|
* />
|
|
45
|
+
* @example
|
|
46
|
+
* <TypedTerminal
|
|
47
|
+
* variant="code"
|
|
48
|
+
* aria-label="A spec being written"
|
|
49
|
+
* title="checkout.spec"
|
|
50
|
+
* lines={[{ kind: "input", text: 'Scenario: "Pay with a saved card"' }]}
|
|
51
|
+
* />
|
|
46
52
|
*/
|
|
47
53
|
export function TypedTerminal(handle) {
|
|
48
54
|
return () => {
|
|
49
|
-
let { "aria-label": label, lines, mix, pauseLabel, prompt, title, ...rest } = handle.props;
|
|
55
|
+
let { "aria-label": label, lines, mix, pauseLabel, prompt, title, variant = "terminal", ...rest } = handle.props;
|
|
50
56
|
let schedule = scheduleFor(lines);
|
|
51
57
|
let nodes = [];
|
|
52
58
|
for (let [index, line] of lines.entries()) {
|
|
53
59
|
if (index > 0)
|
|
54
60
|
nodes.push("\n");
|
|
55
61
|
let slot = schedule.slots[index];
|
|
56
|
-
nodes.push(line.kind === "input" ? (_jsx(InputLine, { text: line.text, prompt: prompt, slot: slot, schedule: schedule })) : (_jsx(OutputLine, { text: line.text, status: line.status, slot: slot, schedule: schedule })));
|
|
62
|
+
nodes.push(line.kind === "input" ? (_jsx(InputLine, { text: line.text, prompt: prompt, slot: slot, schedule: schedule })) : (_jsx(OutputLine, { text: line.text, status: line.status, variant: variant, slot: slot, schedule: schedule })));
|
|
57
63
|
}
|
|
58
|
-
return (_jsx("div", { ...rest, "data-slot": "motion-loop", mix: mergeMix([pausedWhenChecked('[data-slot="typed-terminal"]')], mix), children: _jsx("figure", { "aria-label": label, "data-slot": "typed-terminal", mix: [raw({ margin: "0", minInlineSize: "0" })], children: _jsx(CodeStage, { variant:
|
|
64
|
+
return (_jsx("div", { ...rest, "data-slot": "motion-loop", mix: mergeMix([pausedWhenChecked('[data-slot="typed-terminal"]')], mix), children: _jsx("figure", { "aria-label": label, "data-slot": "typed-terminal", mix: [raw({ margin: "0", minInlineSize: "0" })], children: _jsx(CodeStage, { variant: variant, title: title, actions: _jsx(PauseToggle, { label: pauseLabel ?? "Pause the animation", mix: [headerToggle()] }), children: nodes }) }) }));
|
|
59
65
|
};
|
|
60
66
|
}
|
|
61
67
|
/**
|
|
@@ -184,7 +190,7 @@ function InputLine(handle) {
|
|
|
184
190
|
/** A line the session prints: it fades in at its slot in the status's ink. */
|
|
185
191
|
function OutputLine(handle) {
|
|
186
192
|
return () => {
|
|
187
|
-
let { schedule, slot, status, text } = handle.props;
|
|
193
|
+
let { schedule, slot, status, text, variant } = handle.props;
|
|
188
194
|
let name = frameName("output", schedule, slot);
|
|
189
195
|
return (_jsx("span", { "data-line": "", "data-kind": "output", "data-status": status, mix: [
|
|
190
196
|
keyframes(name, {
|
|
@@ -195,21 +201,23 @@ function OutputLine(handle) {
|
|
|
195
201
|
[`${RESET_AT + 2}%`]: { opacity: "0" },
|
|
196
202
|
"100%": { opacity: "0" },
|
|
197
203
|
}),
|
|
198
|
-
raw({ color: statusInk(status) }),
|
|
204
|
+
raw({ color: statusInk(status, variant) }),
|
|
199
205
|
motionSafe(raw(loop(name, schedule, "linear"))),
|
|
200
206
|
], children: text }));
|
|
201
207
|
};
|
|
202
208
|
}
|
|
203
209
|
/**
|
|
204
|
-
* The ink for an output status. The terminal panel inverts the page's scheme, so a
|
|
205
|
-
* or failure takes the palette step that reads on the panel
|
|
210
|
+
* The ink for an output status. The terminal panel inverts the page's scheme, so there a
|
|
211
|
+
* pass or failure takes the palette step that reads on the panel; the code card follows
|
|
212
|
+
* the page's scheme and takes the step that reads on the page.
|
|
206
213
|
*/
|
|
207
|
-
function statusInk(status) {
|
|
214
|
+
function statusInk(status, variant) {
|
|
215
|
+
let [light, dark] = variant === "terminal" ? ["400", "700"] : ["700", "400"];
|
|
208
216
|
if (status === "ok") {
|
|
209
|
-
return
|
|
217
|
+
return `light-dark(var(--ui-color-success-${light}), var(--ui-color-success-${dark}))`;
|
|
210
218
|
}
|
|
211
219
|
if (status === "fail") {
|
|
212
|
-
return
|
|
220
|
+
return `light-dark(var(--ui-color-danger-${light}), var(--ui-color-danger-${dark}))`;
|
|
213
221
|
}
|
|
214
222
|
if (status === "muted")
|
|
215
223
|
return "color-mix(in oklab, currentColor 65%, transparent)";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A usage-pricing calculator that needs no script: a GET form of the reader's numbers
|
|
3
|
+
* beside the bill the server printed for them. In live mode the bill is a named frame that an
|
|
4
|
+
* island re-requests as the reader types, and without script the form still submits by GET.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Prop types for {@link UsageEstimate}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace UsageEstimate {
|
|
14
|
+
/** One line of the bill. */
|
|
15
|
+
export interface Row {
|
|
16
|
+
/** What the line charges for, set as the row's header cell. */
|
|
17
|
+
label: RemixNode;
|
|
18
|
+
/** The arithmetic behind the amount, such as `35 h × $0.36`. */
|
|
19
|
+
detail?: RemixNode;
|
|
20
|
+
/** The formatted amount, such as `$12.60`. */
|
|
21
|
+
amount: RemixNode;
|
|
22
|
+
}
|
|
23
|
+
/** Where a live bill is loaded from. */
|
|
24
|
+
export interface Live {
|
|
25
|
+
/**
|
|
26
|
+
* The bill frame's name. The page's route answers a request carrying it in
|
|
27
|
+
* `X-Remix-Target` with a {@link UsageEstimate.Bill} alone.
|
|
28
|
+
*/
|
|
29
|
+
frame: string;
|
|
30
|
+
/** The address the bill first loads: the page's own, with the query the fields show. */
|
|
31
|
+
src: string;
|
|
32
|
+
/**
|
|
33
|
+
* Milliseconds of quiet after the last input before the bill is re-requested.
|
|
34
|
+
* @default 250
|
|
35
|
+
*/
|
|
36
|
+
delay?: number;
|
|
37
|
+
}
|
|
38
|
+
/** What every calculator takes: the form and where it submits. */
|
|
39
|
+
interface FormProps extends Omit<TagProps<"div">, "children"> {
|
|
40
|
+
/**
|
|
41
|
+
* Where the form submits, usually the page's own section anchor (`#pricing`), so the
|
|
42
|
+
* reloaded page opens on the new bill.
|
|
43
|
+
*/
|
|
44
|
+
action: string;
|
|
45
|
+
/** The form's controls, named as the page reads them from its query. */
|
|
46
|
+
fields: RemixNode;
|
|
47
|
+
/** Label of the submit button. */
|
|
48
|
+
submitLabel: RemixNode;
|
|
49
|
+
}
|
|
50
|
+
/** A calculator whose bill is printed into the page and changes on submit. */
|
|
51
|
+
export interface StaticProps extends FormProps {
|
|
52
|
+
/** The bill for the query the page rendered, a {@link UsageEstimate.Bill}. */
|
|
53
|
+
bill: RemixNode;
|
|
54
|
+
/** Left unset: a printed bill and a live frame are the two exclusive modes. */
|
|
55
|
+
live?: undefined;
|
|
56
|
+
}
|
|
57
|
+
/** A calculator whose bill is a frame re-requested while the reader types. */
|
|
58
|
+
export interface LiveProps extends FormProps {
|
|
59
|
+
/** The frame the sheet holds, and where and how often it reloads as the reader types. */
|
|
60
|
+
live: Live;
|
|
61
|
+
/** Left unset: the route prints the bill into the `live` frame. */
|
|
62
|
+
bill?: undefined;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Props accepted by {@link UsageEstimate}: a printed `bill`, or a `live` frame that loads one.
|
|
66
|
+
*/
|
|
67
|
+
export type Props = StaticProps | LiveProps;
|
|
68
|
+
/** Props accepted by {@link UsageEstimate.Bill}. */
|
|
69
|
+
export interface BillProps {
|
|
70
|
+
/** Accessible name of the bill's table, such as "Estimated monthly bill". */
|
|
71
|
+
label: string;
|
|
72
|
+
/** The bill's lines, in the order they add up. */
|
|
73
|
+
rows: readonly Row[];
|
|
74
|
+
/** The sum, set larger under a rule. */
|
|
75
|
+
total: Row;
|
|
76
|
+
/** A line under the total, such as what the price leaves out. */
|
|
77
|
+
footnote?: RemixNode;
|
|
78
|
+
/** The page's next step under the bill, such as its primary CTA. */
|
|
79
|
+
cta?: RemixNode;
|
|
80
|
+
}
|
|
81
|
+
/** Props accepted by {@link UsageEstimateLive}. */
|
|
82
|
+
export interface LiveIslandProps {
|
|
83
|
+
/** Name of the bill frame the island reloads, the calculator's `live.frame`. */
|
|
84
|
+
frame: string;
|
|
85
|
+
/** Milliseconds of quiet after the last input before the frame reloads. */
|
|
86
|
+
delay: number;
|
|
87
|
+
}
|
|
88
|
+
export {};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A GET form beside its bill on one card, side by side from 40rem, the sheet ruled in
|
|
92
|
+
* `--ui-landing-hairline`; with no script a submit reloads the page on the new bill. For `live`,
|
|
93
|
+
* map {@link UsageEstimateLive} (`@sdxc/ui/landing/usage-estimate`) to re-price while typing.
|
|
94
|
+
*
|
|
95
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
96
|
+
* @returns The render function producing the calculator's markup.
|
|
97
|
+
* @example
|
|
98
|
+
* <UsageEstimate
|
|
99
|
+
* action="#pricing"
|
|
100
|
+
* fields={<TextField label="Hours a month" type="number" name="hours" defaultValue="40" />}
|
|
101
|
+
* submitLabel="Estimate"
|
|
102
|
+
* bill={
|
|
103
|
+
* <UsageEstimate.Bill
|
|
104
|
+
* label="Estimated monthly bill"
|
|
105
|
+
* rows={[{ label: "Recorded hours", detail: "35 h × $0.36", amount: "$12.60" }]}
|
|
106
|
+
* total={{ label: "Per month", amount: "$12.60" }}
|
|
107
|
+
* />
|
|
108
|
+
* }
|
|
109
|
+
* />
|
|
110
|
+
* @example
|
|
111
|
+
* <UsageEstimate
|
|
112
|
+
* action="#pricing"
|
|
113
|
+
* fields={<TextField label="Hours a month" type="number" name="hours" defaultValue="40" />}
|
|
114
|
+
* submitLabel="Estimate"
|
|
115
|
+
* live={{ frame: "pricing-bill", src: "/?hours=40" }}
|
|
116
|
+
* />
|
|
117
|
+
*/
|
|
118
|
+
export declare function UsageEstimate(handle: Handle<UsageEstimate.Props>): () => import("remix/component").RemixElement;
|
|
119
|
+
export declare namespace UsageEstimate {
|
|
120
|
+
var Bill: (handle: Handle<UsageEstimate.BillProps>) => () => import("remix/component").RemixElement;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The island a live calculator places in its form: it reloads the named bill frame for the
|
|
124
|
+
* form's query as the reader types, and on submit, with the address following through
|
|
125
|
+
* `replaceState`. Load `@sdxc/ui/landing/usage-estimate` in the browser entry.
|
|
126
|
+
*/
|
|
127
|
+
export declare const UsageEstimateLive: EntryComponent<UsageEstimate.LiveIslandProps>;
|