@sdxc/ui 2026.11.11 → 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 +89 -44
- 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/index.d.ts +7 -0
- package/dist/landing/index.js +7 -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-frame.d.ts +2 -1
- 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,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: re-pricing while a reader types or drags needs input events, a debounce and a frame
|
|
3
|
+
* reload, which a GET form cannot do on its own. No-JS baseline: the form submits by GET and
|
|
4
|
+
* the page renders the bill for the new query.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { MixinFactory } from "remix/component";
|
|
10
|
+
/** Types for {@link usageEstimateLive}. */
|
|
11
|
+
export declare namespace UsageEstimateLiveMixin {
|
|
12
|
+
/** Configuration for {@link usageEstimateLive}, read on every event. */
|
|
13
|
+
interface Options {
|
|
14
|
+
/**
|
|
15
|
+
* Loads the bill for `src`, the form's path with its current query. When the newest
|
|
16
|
+
* reload behind a submit rejects, the form submits natively and the page loads the bill.
|
|
17
|
+
*/
|
|
18
|
+
reload: (src: string) => Promise<unknown>;
|
|
19
|
+
/** Milliseconds of quiet after the last input before the bill is requested. */
|
|
20
|
+
delay: number;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Applied inside a calculator's GET form: once the fields go quiet for `delay`, and on a
|
|
25
|
+
* submit from Enter or an unnamed button, it reloads the bill for the form's query; a named
|
|
26
|
+
* button still loads the page. Only the newest request moves the address (`replaceState`).
|
|
27
|
+
*
|
|
28
|
+
* @example <span hidden mix={[usageEstimateLive({ reload: (src) => frame.reload({ src }), delay: 250 })]} />
|
|
29
|
+
*/
|
|
30
|
+
export declare const usageEstimateLive: MixinFactory<HTMLElement, [
|
|
31
|
+
options: UsageEstimateLiveMixin.Options
|
|
32
|
+
]>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: re-pricing while a reader types or drags needs input events, a debounce and a frame
|
|
3
|
+
* reload, which a GET form cannot do on its own. No-JS baseline: the form submits by GET and
|
|
4
|
+
* the page renders the bill for the new query.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import { createMixin } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Applied inside a calculator's GET form: once the fields go quiet for `delay`, and on a
|
|
12
|
+
* submit from Enter or an unnamed button, it reloads the bill for the form's query; a named
|
|
13
|
+
* button still loads the page. Only the newest request moves the address (`replaceState`).
|
|
14
|
+
*
|
|
15
|
+
* @example <span hidden mix={[usageEstimateLive({ reload: (src) => frame.reload({ src }), delay: 250 })]} />
|
|
16
|
+
*/
|
|
17
|
+
export const usageEstimateLive = createMixin((handle) => {
|
|
18
|
+
let options;
|
|
19
|
+
let controller;
|
|
20
|
+
handle.addEventListener("insert", (event) => {
|
|
21
|
+
controller?.abort();
|
|
22
|
+
controller = new AbortController();
|
|
23
|
+
let form = event.node.closest("form");
|
|
24
|
+
if (form !== null)
|
|
25
|
+
follow(form, () => options, controller.signal);
|
|
26
|
+
});
|
|
27
|
+
handle.addEventListener("remove", () => {
|
|
28
|
+
controller?.abort();
|
|
29
|
+
controller = undefined;
|
|
30
|
+
});
|
|
31
|
+
return (next) => {
|
|
32
|
+
options = next;
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Listens to `form` until `signal` aborts, reading the latest options on each event so a
|
|
37
|
+
* re-rendered island's new callback is the one used.
|
|
38
|
+
*
|
|
39
|
+
* @param form The calculator's GET form.
|
|
40
|
+
* @param current Returns the options in force.
|
|
41
|
+
* @param signal Ends the listeners and any pending timer.
|
|
42
|
+
*/
|
|
43
|
+
function follow(form, current, signal) {
|
|
44
|
+
let timer;
|
|
45
|
+
/** Counts requests, so only the newest one moves the address or falls back to a submit. */
|
|
46
|
+
let latest = 0;
|
|
47
|
+
signal.addEventListener("abort", () => clearTimeout(timer));
|
|
48
|
+
/**
|
|
49
|
+
* Reloads the bill for the form's query and moves the address to it once it has landed.
|
|
50
|
+
* A request a newer one overtook settles without touching the address, and its failure
|
|
51
|
+
* is swallowed, since the newer request owns the bill.
|
|
52
|
+
*/
|
|
53
|
+
let price = async () => {
|
|
54
|
+
let request = ++latest;
|
|
55
|
+
let options = current();
|
|
56
|
+
if (options === undefined)
|
|
57
|
+
throw new Error("usageEstimateLive has no options");
|
|
58
|
+
let target = addressOf(form);
|
|
59
|
+
try {
|
|
60
|
+
await options.reload(`${target.pathname}${target.search}`);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (request === latest)
|
|
64
|
+
throw error;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (signal.aborted || request !== latest)
|
|
68
|
+
return;
|
|
69
|
+
let { history, location } = form.ownerDocument.defaultView ?? window;
|
|
70
|
+
let next = `${target.pathname}${target.search}${location.hash}`;
|
|
71
|
+
if (next !== `${location.pathname}${location.search}${location.hash}`) {
|
|
72
|
+
history.replaceState(history.state, "", next);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
/** Waits for the reader to pause, then prices the form if its values are valid. */
|
|
76
|
+
let schedule = () => {
|
|
77
|
+
clearTimeout(timer);
|
|
78
|
+
timer = setTimeout(() => {
|
|
79
|
+
if (form.checkValidity())
|
|
80
|
+
price().catch(() => undefined);
|
|
81
|
+
}, current()?.delay ?? 0);
|
|
82
|
+
};
|
|
83
|
+
form.addEventListener("input", schedule, { signal });
|
|
84
|
+
form.addEventListener("change", schedule, { signal });
|
|
85
|
+
form.addEventListener("submit", (event) => {
|
|
86
|
+
if (event.defaultPrevented || carriesValue(event.submitter))
|
|
87
|
+
return;
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
clearTimeout(timer);
|
|
90
|
+
price().catch(() => form.submit());
|
|
91
|
+
}, { signal });
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The address a GET submission of `form` would load: its action with the fields as the query.
|
|
95
|
+
*
|
|
96
|
+
* @param form The calculator's GET form.
|
|
97
|
+
* @returns The action URL with its query replaced by the form's values.
|
|
98
|
+
*/
|
|
99
|
+
function addressOf(form) {
|
|
100
|
+
let url = new URL(form.action, form.ownerDocument.baseURI);
|
|
101
|
+
let query = new URLSearchParams();
|
|
102
|
+
for (let [name, value] of new FormData(form)) {
|
|
103
|
+
if (typeof value === "string")
|
|
104
|
+
query.append(name, value);
|
|
105
|
+
}
|
|
106
|
+
url.search = query.toString();
|
|
107
|
+
return url;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Whether a submit came from a button with its own `name`, such as "Add monitor". Its value is
|
|
111
|
+
* something the fields don't hold and may change which fields the form has, so the page has
|
|
112
|
+
* to render it; Enter, `requestSubmit()` and an unnamed button only re-price.
|
|
113
|
+
*
|
|
114
|
+
* @param submitter The element that submitted the form, if any.
|
|
115
|
+
* @returns `true` when the submit must reach the server as a page load.
|
|
116
|
+
*/
|
|
117
|
+
function carriesValue(submitter) {
|
|
118
|
+
return ((submitter instanceof HTMLButtonElement || submitter instanceof HTMLInputElement) &&
|
|
119
|
+
submitter.name !== "");
|
|
120
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
7
|
* @copyright Sergio Xalambrí 2026
|
|
8
8
|
*/
|
|
9
|
+
import type { UtilityMixin } from "@sdxc/u";
|
|
9
10
|
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
11
|
/**
|
|
11
12
|
* Prop types for {@link PhoneFrame}.
|
|
@@ -44,4 +45,4 @@ export declare function PhoneFrame(handle: Handle<PhoneFrame.Props>): () => impo
|
|
|
44
45
|
* @example
|
|
45
46
|
* <img src={shot} alt="" mix={[screenCorners()]} />
|
|
46
47
|
*/
|
|
47
|
-
export declare function screenCorners():
|
|
48
|
+
export declare function screenCorners(): UtilityMixin;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A menu or price list for a landing: named groups of items, each a name joined to its price
|
|
3
|
+
* by a dotted leader, with a line of description under it. Groups flow into as many columns
|
|
4
|
+
* as the band's width holds, so the same list reads as a board on a desk and a column on a phone.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Prop types for {@link PriceList}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace PriceList {
|
|
14
|
+
/**
|
|
15
|
+
* Props accepted by {@link PriceList}.
|
|
16
|
+
*/
|
|
17
|
+
interface Props extends TagProps<"div"> {
|
|
18
|
+
/**
|
|
19
|
+
* Narrowest a column gets, as a CSS length; the list fits as many columns as clear it.
|
|
20
|
+
*
|
|
21
|
+
* @default "18rem"
|
|
22
|
+
*/
|
|
23
|
+
columnWidth?: string;
|
|
24
|
+
/** One or more {@link PriceList.Group} elements. */
|
|
25
|
+
children: RemixNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Props accepted by {@link PriceList.Group}.
|
|
29
|
+
*/
|
|
30
|
+
interface GroupProps extends Omit<TagProps<"div">, "title"> {
|
|
31
|
+
/** The group's name, rendered as a heading at the ambient level. */
|
|
32
|
+
title: RemixNode;
|
|
33
|
+
/** A line under the title, such as when the group is served. */
|
|
34
|
+
description?: RemixNode;
|
|
35
|
+
/** One or more {@link PriceList.Item} elements. */
|
|
36
|
+
children: RemixNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Props accepted by {@link PriceList.Item}.
|
|
40
|
+
*/
|
|
41
|
+
interface ItemProps extends Omit<TagProps<"li">, "children"> {
|
|
42
|
+
/** What the item is called. */
|
|
43
|
+
name: RemixNode;
|
|
44
|
+
/** The price as the reader should see it, currency included. */
|
|
45
|
+
price: RemixNode;
|
|
46
|
+
/** A short line under the name: what is in it, or how it is sold. */
|
|
47
|
+
children?: RemixNode;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Lays its groups into columns that each stay at least `columnWidth` wide, starting every
|
|
52
|
+
* group at the top of its cell so a short group keeps its own height. Server markup and CSS
|
|
53
|
+
* alone; group titles rule off in `--ui-landing-hairline`, set in `--ui-landing-display-weight`.
|
|
54
|
+
*
|
|
55
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
56
|
+
* @returns The render function producing the list's markup.
|
|
57
|
+
* @example
|
|
58
|
+
* <PriceList>
|
|
59
|
+
* <PriceList.Group title="Bread">
|
|
60
|
+
* <PriceList.Item name="Country sourdough" price="$9">Two-day ferment, 900 g</PriceList.Item>
|
|
61
|
+
* </PriceList.Group>
|
|
62
|
+
* </PriceList>
|
|
63
|
+
*/
|
|
64
|
+
export declare function PriceList(handle: Handle<PriceList.Props>): () => import("remix/component").RemixElement;
|
|
65
|
+
export declare namespace PriceList {
|
|
66
|
+
var Group: (handle: Handle<PriceList.GroupProps>) => () => import("remix/component").RemixElement;
|
|
67
|
+
var Item: (handle: Handle<PriceList.ItemProps>) => () => import("remix/component").RemixElement;
|
|
68
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
3
|
+
import { Heading } from "../components/heading.js";
|
|
4
|
+
/** Narrowest a group's column gets before the list drops to fewer columns. */
|
|
5
|
+
const DEFAULT_COLUMN_WIDTH = "18rem";
|
|
6
|
+
/**
|
|
7
|
+
* Lays its groups into columns that each stay at least `columnWidth` wide, starting every
|
|
8
|
+
* group at the top of its cell so a short group keeps its own height. Server markup and CSS
|
|
9
|
+
* alone; group titles rule off in `--ui-landing-hairline`, set in `--ui-landing-display-weight`.
|
|
10
|
+
*
|
|
11
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
12
|
+
* @returns The render function producing the list's markup.
|
|
13
|
+
* @example
|
|
14
|
+
* <PriceList>
|
|
15
|
+
* <PriceList.Group title="Bread">
|
|
16
|
+
* <PriceList.Item name="Country sourdough" price="$9">Two-day ferment, 900 g</PriceList.Item>
|
|
17
|
+
* </PriceList.Group>
|
|
18
|
+
* </PriceList>
|
|
19
|
+
*/
|
|
20
|
+
export function PriceList(handle) {
|
|
21
|
+
return () => {
|
|
22
|
+
let { columnWidth, mix, ...rest } = handle.props;
|
|
23
|
+
let width = columnWidth ?? DEFAULT_COLUMN_WIDTH;
|
|
24
|
+
return (_jsx("div", { ...rest, "data-slot": "price-list", mix: mergeMix([
|
|
25
|
+
raw({
|
|
26
|
+
display: "grid",
|
|
27
|
+
gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${width}), 1fr))`,
|
|
28
|
+
alignItems: "start",
|
|
29
|
+
columnGap: "clamp(2rem, 5cqi, 4rem)",
|
|
30
|
+
rowGap: "2.5rem",
|
|
31
|
+
}),
|
|
32
|
+
], mix) }));
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* One named group: its heading, an optional line under it, then the items as a list.
|
|
37
|
+
*
|
|
38
|
+
* @param handle Runtime handle carrying the title, description and items.
|
|
39
|
+
* @returns The render function producing the group's markup.
|
|
40
|
+
* @example
|
|
41
|
+
* <PriceList.Group title="Pastry" description="From 7 am">
|
|
42
|
+
* <PriceList.Item name="Butter croissant" price="$4.25" />
|
|
43
|
+
* </PriceList.Group>
|
|
44
|
+
*/
|
|
45
|
+
PriceList.Group = function PriceListGroup(handle) {
|
|
46
|
+
return () => {
|
|
47
|
+
let { children, description, mix, title, ...rest } = handle.props;
|
|
48
|
+
return (_jsxs("div", { ...rest, "data-slot": "price-list-group", mix: mergeMix([raw({ display: "flex", flexDirection: "column", gap: "1rem" })], mix), children: [_jsxs("div", { mix: [
|
|
49
|
+
raw({
|
|
50
|
+
display: "flex",
|
|
51
|
+
flexDirection: "column",
|
|
52
|
+
gap: "0.25rem",
|
|
53
|
+
paddingBlockEnd: "0.625rem",
|
|
54
|
+
borderBlockEnd: "1px solid var(--ui-landing-hairline, var(--ui-neutral-border))",
|
|
55
|
+
}),
|
|
56
|
+
], children: [_jsx(Heading, { "data-slot": "price-list-title", mix: [
|
|
57
|
+
raw({
|
|
58
|
+
margin: "0",
|
|
59
|
+
fontFamily: "var(--ui-font-display)",
|
|
60
|
+
fontSize: "1.375rem",
|
|
61
|
+
lineHeight: "1.2",
|
|
62
|
+
fontWeight: "var(--ui-landing-display-weight, 700)",
|
|
63
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
64
|
+
}),
|
|
65
|
+
], children: title }), description ? (_jsx("p", { mix: [
|
|
66
|
+
raw({
|
|
67
|
+
margin: "0",
|
|
68
|
+
fontSize: "0.875rem",
|
|
69
|
+
lineHeight: "1.4",
|
|
70
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
71
|
+
}),
|
|
72
|
+
], children: description })) : null] }), _jsx("ul", { mix: [
|
|
73
|
+
raw({
|
|
74
|
+
listStyle: "none",
|
|
75
|
+
margin: "0",
|
|
76
|
+
padding: "0",
|
|
77
|
+
display: "flex",
|
|
78
|
+
flexDirection: "column",
|
|
79
|
+
gap: "1rem",
|
|
80
|
+
}),
|
|
81
|
+
], children: children })] }));
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* One item: the name and the price on a shared baseline with a dotted leader filling the gap,
|
|
86
|
+
* and the description under them. A long name wraps before it pushes the price off the row.
|
|
87
|
+
*
|
|
88
|
+
* @param handle Runtime handle carrying the name, price and description.
|
|
89
|
+
* @returns The render function producing the item's markup.
|
|
90
|
+
* @example <PriceList.Item name="Seeded rye" price="$10">Sunflower, flax and pumpkin seeds.</PriceList.Item>
|
|
91
|
+
*/
|
|
92
|
+
PriceList.Item = function PriceListItem(handle) {
|
|
93
|
+
return () => {
|
|
94
|
+
let { children, mix, name, price, ...rest } = handle.props;
|
|
95
|
+
return (_jsxs("li", { ...rest, "data-slot": "price-list-item", mix: mergeMix([raw({ display: "flex", flexDirection: "column", gap: "0.25rem" })], mix), children: [_jsxs("span", { mix: [
|
|
96
|
+
raw({
|
|
97
|
+
display: "flex",
|
|
98
|
+
alignItems: "baseline",
|
|
99
|
+
gap: "0.5rem",
|
|
100
|
+
fontWeight: "600",
|
|
101
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
102
|
+
}),
|
|
103
|
+
], children: [_jsx("span", { "data-slot": "price-list-name", mix: [raw({ minInlineSize: "0" })], children: name }), _jsx("span", { "aria-hidden": "true", "data-slot": "price-list-leader", mix: [
|
|
104
|
+
raw({
|
|
105
|
+
flex: "1 1 1.5rem",
|
|
106
|
+
minInlineSize: "1.5rem",
|
|
107
|
+
borderBlockEnd: "2px dotted var(--ui-neutral-border)",
|
|
108
|
+
transform: "translateY(-0.25em)",
|
|
109
|
+
}),
|
|
110
|
+
] }), _jsx("span", { "data-slot": "price-list-price", mix: [
|
|
111
|
+
raw({
|
|
112
|
+
flexShrink: "0",
|
|
113
|
+
fontVariantNumeric: "tabular-nums",
|
|
114
|
+
whiteSpace: "nowrap",
|
|
115
|
+
}),
|
|
116
|
+
], children: price })] }), children ? (_jsx("span", { "data-slot": "price-list-description", mix: [
|
|
117
|
+
raw({
|
|
118
|
+
fontSize: "0.9375rem",
|
|
119
|
+
lineHeight: "1.45",
|
|
120
|
+
color: "var(--ui-neutral-fg)",
|
|
121
|
+
textWrap: "pretty",
|
|
122
|
+
}),
|
|
123
|
+
], children: children })) : null] }));
|
|
124
|
+
};
|
|
125
|
+
};
|
|
@@ -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 {
|