@sdxc/ui 2026.11.11 → 2026.11.17
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 +114 -61
- 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 +20 -0
- package/dist/app/index.js +20 -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 +347 -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/profile-picker.d.ts +47 -0
- package/dist/app/profile-picker.js +104 -0
- 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/save-status.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 +37 -10
- 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/episode-list.d.ts +48 -0
- package/dist/video/episode-list.js +161 -0
- package/dist/video/index.d.ts +15 -0
- package/dist/video/index.js +15 -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/mixins/video-shelf-steps.d.ts +20 -0
- package/dist/video/mixins/video-shelf-steps.js +79 -0
- package/dist/video/title-hero.d.ts +51 -0
- package/dist/video/title-hero.js +170 -0
- package/dist/video/utils/timeline.d.ts +55 -0
- package/dist/video/utils/timeline.js +90 -0
- package/dist/video/video-card.d.ts +51 -0
- package/dist/video/video-card.js +135 -0
- package/dist/video/video-player.d.ts +261 -0
- package/dist/video/video-player.js +927 -0
- package/dist/video/video-shelf.d.ts +58 -0
- package/dist/video/video-shelf.js +155 -0
- package/package.json +6 -3
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
3
|
+
import { raw } from "@sdxc/u/general";
|
|
4
|
+
import { motionReduce } from "@sdxc/u/responsive";
|
|
5
|
+
import { when } from "@sdxc/u/state";
|
|
6
|
+
import { clientEntry } from "remix/component";
|
|
7
|
+
import { characterCount, characterCountState, countCharacters, isRingHidden, } from "../mixins/character-count.js";
|
|
8
|
+
export { countCharacters } from "../mixins/character-count.js";
|
|
9
|
+
/** How many characters left show the number when `warn` is omitted. */
|
|
10
|
+
const DEFAULT_WARN = 20;
|
|
11
|
+
/**
|
|
12
|
+
* Renders the ring and its number. The ring sits in a fixed box and scales up for the
|
|
13
|
+
* warning, so the controls beside it never move; past ten over, only the number remains.
|
|
14
|
+
* The island loads from `@sdxc/ui/character-count`, which the browser entry maps.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Textarea id="draft" name="text" />
|
|
18
|
+
* <CharacterCount for="draft" max={280} holdSubmit
|
|
19
|
+
* labels={{ remaining: "{count} characters left", over: "{count} characters over" }} />
|
|
20
|
+
*/
|
|
21
|
+
export const CharacterCount = clientEntry("@sdxc/ui/character-count#CharacterCount", function CharacterCount(handle) {
|
|
22
|
+
return () => {
|
|
23
|
+
let { for: field, max, value = "", warn = DEFAULT_WARN, holdSubmit = false, labels, } = handle.props;
|
|
24
|
+
let length = countCharacters(value);
|
|
25
|
+
let state = characterCountState(length, max, warn);
|
|
26
|
+
let left = max - length;
|
|
27
|
+
let shown = state === "warn" || state === "over" ? String(left) : "";
|
|
28
|
+
return (_jsxs("span", { "data-slot": "character-count", "data-state": state, "data-ring-hidden": isRingHidden(left) ? "" : undefined, style: `--ui-character-count-progress: ${Math.min(1, length / max)}`, mix: [
|
|
29
|
+
characterCount({ for: field, max, warn, holdSubmit, labels }),
|
|
30
|
+
raw({
|
|
31
|
+
"--ui-character-count-tone": "var(--ui-brand-fg)",
|
|
32
|
+
position: "relative",
|
|
33
|
+
display: "inline-grid",
|
|
34
|
+
placeItems: "center",
|
|
35
|
+
flexShrink: 0,
|
|
36
|
+
inlineSize: "1.875rem",
|
|
37
|
+
blockSize: "1.875rem",
|
|
38
|
+
fontSize: "0.75rem",
|
|
39
|
+
fontVariantNumeric: "tabular-nums",
|
|
40
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
41
|
+
}),
|
|
42
|
+
when("&[data-state='warn']", raw({ "--ui-character-count-tone": "var(--ui-warning-fg)" })),
|
|
43
|
+
when("&[data-state='over']", raw({
|
|
44
|
+
"--ui-character-count-tone": "var(--ui-danger-fg)",
|
|
45
|
+
color: "var(--ui-danger-fg)",
|
|
46
|
+
})),
|
|
47
|
+
], children: [_jsxs("svg", { viewBox: "0 0 20 20", "aria-hidden": "true", "data-character-count-ring": "", mix: [
|
|
48
|
+
raw({
|
|
49
|
+
gridArea: "1 / 1",
|
|
50
|
+
inlineSize: "1.25rem",
|
|
51
|
+
blockSize: "1.25rem",
|
|
52
|
+
transform: "rotate(-90deg)",
|
|
53
|
+
transition: "scale 150ms ease-out, opacity 150ms ease-out",
|
|
54
|
+
}),
|
|
55
|
+
when("[data-state='warn'] > &, [data-state='over'] > &", raw({ scale: "1.4" })),
|
|
56
|
+
when("[data-ring-hidden] > &", raw({ opacity: "0" })),
|
|
57
|
+
motionReduce(raw({ transition: "none" })),
|
|
58
|
+
], children: [_jsx("circle", { cx: "10", cy: "10", r: "8", fill: "none", "stroke-width": "2", mix: [raw({ stroke: "var(--ui-neutral-border)" })] }), _jsx("circle", { cx: "10", cy: "10", r: "8", fill: "none", "stroke-width": "2", "stroke-linecap": "round", pathLength: "100", "stroke-dasharray": "100", mix: [
|
|
59
|
+
raw({
|
|
60
|
+
stroke: "var(--ui-character-count-tone)",
|
|
61
|
+
strokeDashoffset: "calc(100 - var(--ui-character-count-progress, 0) * 100)",
|
|
62
|
+
transition: "stroke-dashoffset 120ms linear, stroke 150ms",
|
|
63
|
+
}),
|
|
64
|
+
when("[data-state='empty'] > svg > &", raw({ opacity: "0" })),
|
|
65
|
+
motionReduce(raw({ transition: "none" })),
|
|
66
|
+
] })] }), _jsx("span", { "aria-hidden": "true", "data-character-count-number": "", mix: [raw({ gridArea: "1 / 1", lineHeight: "1" })], children: shown }), _jsx("span", { role: "status", "data-character-count-status": "", mix: [visuallyHidden()] })] }));
|
|
67
|
+
};
|
|
68
|
+
});
|
|
@@ -18,6 +18,7 @@ export * from "./button.js";
|
|
|
18
18
|
export * from "./calendar.js";
|
|
19
19
|
export * from "./card.js";
|
|
20
20
|
export * from "./carousel.js";
|
|
21
|
+
export * from "./character-count.js";
|
|
21
22
|
export * from "./checkbox-group.js";
|
|
22
23
|
export * from "./checkbox.js";
|
|
23
24
|
export * from "./combobox.js";
|
|
@@ -44,6 +45,7 @@ export * from "./image-placeholder.js";
|
|
|
44
45
|
export * from "./input.js";
|
|
45
46
|
export * from "./item.js";
|
|
46
47
|
export * from "./keyboard.js";
|
|
48
|
+
export * from "./label-chip.js";
|
|
47
49
|
export * from "./label.js";
|
|
48
50
|
export * from "./link-button.js";
|
|
49
51
|
export * from "./link.js";
|
package/dist/components/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./button.js";
|
|
|
18
18
|
export * from "./calendar.js";
|
|
19
19
|
export * from "./card.js";
|
|
20
20
|
export * from "./carousel.js";
|
|
21
|
+
export * from "./character-count.js";
|
|
21
22
|
export * from "./checkbox-group.js";
|
|
22
23
|
export * from "./checkbox.js";
|
|
23
24
|
export * from "./combobox.js";
|
|
@@ -44,6 +45,7 @@ export * from "./image-placeholder.js";
|
|
|
44
45
|
export * from "./input.js";
|
|
45
46
|
export * from "./item.js";
|
|
46
47
|
export * from "./keyboard.js";
|
|
48
|
+
export * from "./label-chip.js";
|
|
47
49
|
export * from "./label.js";
|
|
48
50
|
export * from "./link-button.js";
|
|
49
51
|
export * from "./link.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A label an issue, pull request or record carries, drawn as a small pill in the label's own
|
|
3
|
+
* colour. Any colour goes in and the text stays readable on its tint in light and dark, so
|
|
4
|
+
* labels whose colours people pick themselves never need a hand-tuned text colour.
|
|
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 LabelChip}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace LabelChip {
|
|
14
|
+
/**
|
|
15
|
+
* How the colour shows: `pill` tints the whole chip and its text, `dot` keeps a neutral
|
|
16
|
+
* outlined chip with the colour in a dot before the name, for dense rows.
|
|
17
|
+
*/
|
|
18
|
+
type Variant = "pill" | "dot";
|
|
19
|
+
/** Every native `<span>` attribute plus the label's colour and look. */
|
|
20
|
+
interface Props extends TagProps<"span"> {
|
|
21
|
+
/** Any CSS colour (`#d73a4a`, `oklch(0.63 0.19 25)`), as the label was defined. */
|
|
22
|
+
color?: string;
|
|
23
|
+
/** A hue in degrees, used when `color` is absent; it stands for a mid-tone colour. */
|
|
24
|
+
hue?: number;
|
|
25
|
+
/** @default "pill" */
|
|
26
|
+
variant?: Variant;
|
|
27
|
+
/** The label's name. */
|
|
28
|
+
children?: RemixNode;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Renders the chip as plain HTML and CSS. A pill derives tint, border and text from the colour at
|
|
33
|
+
* fixed OKLCH lightness through `light-dark()`, so text clears 4.5:1 for every hue in the page's
|
|
34
|
+
* `color-scheme`; the dot variant reads neutral roles. Rules read the colour from `--ui-label-chip-color`.
|
|
35
|
+
*
|
|
36
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
37
|
+
* @returns The render function producing the chip's markup.
|
|
38
|
+
* @example <LabelChip color="#d73a4a">bug</LabelChip>
|
|
39
|
+
* @example <LabelChip hue={150}>{t("labels.feature")}</LabelChip>
|
|
40
|
+
* @example <LabelChip variant="dot" color={label.color}>{label.name}</LabelChip>
|
|
41
|
+
*/
|
|
42
|
+
export declare function LabelChip(handle: Handle<LabelChip.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
3
|
+
import { inlineFlex, items, shrink } from "@sdxc/u/layout";
|
|
4
|
+
import { nowrap } from "@sdxc/u/typography";
|
|
5
|
+
import { mergeStyle } from "../utils/merge-style.js";
|
|
6
|
+
/** Custom property carrying the label's colour to every rule that derives from it. */
|
|
7
|
+
const COLOR_PROPERTY = "--ui-label-chip-color";
|
|
8
|
+
/** The label's colour as the rules read it. */
|
|
9
|
+
const COLOR = `var(${COLOR_PROPERTY})`;
|
|
10
|
+
/** Lightness of the colour a `hue` stands for: a mid-tone, which both themes derive from well. */
|
|
11
|
+
const HUE_LIGHTNESS = 0.62;
|
|
12
|
+
/** Chroma of the colour a `hue` stands for. */
|
|
13
|
+
const HUE_CHROMA = 0.15;
|
|
14
|
+
/** The colour a label without `color` or `hue` takes: a quiet grey. */
|
|
15
|
+
const DEFAULT_COLOR = "oklch(0.62 0 0)";
|
|
16
|
+
/**
|
|
17
|
+
* Renders the chip as plain HTML and CSS. A pill derives tint, border and text from the colour at
|
|
18
|
+
* fixed OKLCH lightness through `light-dark()`, so text clears 4.5:1 for every hue in the page's
|
|
19
|
+
* `color-scheme`; the dot variant reads neutral roles. Rules read the colour from `--ui-label-chip-color`.
|
|
20
|
+
*
|
|
21
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
22
|
+
* @returns The render function producing the chip's markup.
|
|
23
|
+
* @example <LabelChip color="#d73a4a">bug</LabelChip>
|
|
24
|
+
* @example <LabelChip hue={150}>{t("labels.feature")}</LabelChip>
|
|
25
|
+
* @example <LabelChip variant="dot" color={label.color}>{label.name}</LabelChip>
|
|
26
|
+
*/
|
|
27
|
+
export function LabelChip(handle) {
|
|
28
|
+
return () => {
|
|
29
|
+
let { children, color, hue, mix, style, variant = "pill", ...rest } = handle.props;
|
|
30
|
+
let resolved = color ?? (hue === undefined ? DEFAULT_COLOR : hueColor(hue));
|
|
31
|
+
let dot = variant === "dot";
|
|
32
|
+
return (_jsxs("span", { ...rest, "data-slot": "label-chip", "data-variant": variant, style: mergeStyle(style, { [COLOR_PROPERTY]: resolved }), mix: mergeMix([
|
|
33
|
+
inlineFlex(),
|
|
34
|
+
items("center"),
|
|
35
|
+
nowrap(),
|
|
36
|
+
raw({
|
|
37
|
+
gap: "0.3125rem",
|
|
38
|
+
blockSize: "1.25rem",
|
|
39
|
+
paddingInline: "0.4375rem",
|
|
40
|
+
boxSizing: "border-box",
|
|
41
|
+
borderWidth: "1px",
|
|
42
|
+
borderStyle: "solid",
|
|
43
|
+
borderRadius: "999px",
|
|
44
|
+
fontSize: "0.75rem",
|
|
45
|
+
lineHeight: "1rem",
|
|
46
|
+
}),
|
|
47
|
+
dot ? dotRules() : pillRules(),
|
|
48
|
+
], mix), children: [dot ? (_jsx("span", { "aria-hidden": "true", "data-slot": "label-chip-dot", mix: [
|
|
49
|
+
shrink(0),
|
|
50
|
+
raw({
|
|
51
|
+
inlineSize: "0.5rem",
|
|
52
|
+
blockSize: "0.5rem",
|
|
53
|
+
borderRadius: "999px",
|
|
54
|
+
backgroundColor: COLOR,
|
|
55
|
+
}),
|
|
56
|
+
] })) : null, children] }));
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** The colour a hue stands for. */
|
|
60
|
+
function hueColor(hue) {
|
|
61
|
+
return `oklch(${HUE_LIGHTNESS} ${HUE_CHROMA} ${hue})`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Re-derives the label's colour at one lightness and capped chroma. Fixing lightness is
|
|
65
|
+
* what holds contrast for any hue; capping chroma keeps the result inside sRGB, where
|
|
66
|
+
* clipping would shift its lightness.
|
|
67
|
+
*/
|
|
68
|
+
function derive(lightness, chroma) {
|
|
69
|
+
return `oklch(from ${COLOR} ${lightness} min(c, ${chroma}) h)`;
|
|
70
|
+
}
|
|
71
|
+
/** A pill's tint, border and text, one pair of lightnesses per theme. */
|
|
72
|
+
function pillRules() {
|
|
73
|
+
return raw({
|
|
74
|
+
fontWeight: 500,
|
|
75
|
+
backgroundColor: `light-dark(${derive(0.95, 0.05)}, ${derive(0.3, 0.07)})`,
|
|
76
|
+
borderColor: `light-dark(${derive(0.85, 0.09)}, ${derive(0.42, 0.1)})`,
|
|
77
|
+
color: `light-dark(${derive(0.42, 0.14)}, ${derive(0.86, 0.1)})`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/** The dot variant's neutral outline and text, which the page's theme already makes readable. */
|
|
81
|
+
function dotRules() {
|
|
82
|
+
return raw({
|
|
83
|
+
borderColor: "var(--ui-neutral-border)",
|
|
84
|
+
color: "var(--ui-neutral-fg)",
|
|
85
|
+
});
|
|
86
|
+
}
|
|
@@ -27,7 +27,8 @@ export declare namespace PropertyList {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Makes a row editable in place: its value becomes a button that opens a popover
|
|
30
|
-
* anchored under it, holding whatever form the app renders as `content
|
|
30
|
+
* anchored under it, holding whatever form the app renders as `content`, or the app's
|
|
31
|
+
* own popover given as `popover`.
|
|
31
32
|
*/
|
|
32
33
|
interface Edit {
|
|
33
34
|
/** Id of the popover, which the value button targets. */
|
|
@@ -35,7 +36,13 @@ export declare namespace PropertyList {
|
|
|
35
36
|
/** What the button does, read before the current value, such as "Edit assignee". */
|
|
36
37
|
label: string;
|
|
37
38
|
/** The popover's content: the app's form, its described options and its submit. */
|
|
38
|
-
content
|
|
39
|
+
content?: RemixNode;
|
|
40
|
+
/**
|
|
41
|
+
* A whole popover whose `id` is `id`, drawn in place of the row's own and its `content`,
|
|
42
|
+
* such as a `FilterMenu.Popover` picker for a multi-value property; the value button
|
|
43
|
+
* still opens it and anchors it under the row.
|
|
44
|
+
*/
|
|
45
|
+
popover?: RemixNode;
|
|
39
46
|
}
|
|
40
47
|
/** Every native `<div>` attribute the row's group accepts, plus its label and value. */
|
|
41
48
|
interface ItemProps extends Omit<TagProps<"div">, "children"> {
|
|
@@ -73,9 +73,9 @@ export function PropertyList(handle) {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
|
-
* Renders one property. In the rows variant the label column holds
|
|
77
|
-
*
|
|
78
|
-
* value
|
|
76
|
+
* Renders one property. In the rows variant the label column holds `--ui-property-list-label-width`
|
|
77
|
+
* (9rem) from a 22rem container up and stacks over the value below that; an empty row says so.
|
|
78
|
+
* With `edit`, the value opens a Popover API popover with no script: the row's own or `popover`.
|
|
79
79
|
*
|
|
80
80
|
* @param handle Runtime handle carrying the group `<div>`'s props.
|
|
81
81
|
* @returns The render function producing the row's markup.
|
|
@@ -89,6 +89,11 @@ export function PropertyList(handle) {
|
|
|
89
89
|
* >
|
|
90
90
|
* {assignee?.name}
|
|
91
91
|
* </PropertyList.Item>
|
|
92
|
+
* @example
|
|
93
|
+
* <PropertyList.Item label="Labels" empty="None yet"
|
|
94
|
+
* edit={{ id: "edit-labels", label: "Edit labels", popover: <FilterMenu.Popover id="edit-labels" {...picker} /> }}>
|
|
95
|
+
* {chips}
|
|
96
|
+
* </PropertyList.Item>
|
|
92
97
|
*/
|
|
93
98
|
PropertyList.Item = function PropertyListItem(handle) {
|
|
94
99
|
return () => {
|
|
@@ -108,6 +113,7 @@ PropertyList.Item = function PropertyListItem(handle) {
|
|
|
108
113
|
grid(),
|
|
109
114
|
pb(1),
|
|
110
115
|
items("baseline"),
|
|
116
|
+
raw({ position: "relative" }),
|
|
111
117
|
/**
|
|
112
118
|
* The stacked and side-by-side tracks live in one rule, so the label column
|
|
113
119
|
* holds at its width whatever order the stylesheet layers land in.
|
|
@@ -137,20 +143,20 @@ PropertyList.Item = function PropertyListItem(handle) {
|
|
|
137
143
|
minBs("2rem"),
|
|
138
144
|
tabularNums(),
|
|
139
145
|
tiles ? [text("lg"), weight("semibold")] : null,
|
|
140
|
-
], children: edit ? (_jsx(PropertyEdit, { edit: edit, empty: isEmpty, children: value })) : (value) })] }));
|
|
146
|
+
], children: edit ? (_jsx(PropertyEdit, { edit: edit, empty: isEmpty, labelRow: !tiles, children: value })) : (value) })] }));
|
|
141
147
|
};
|
|
142
148
|
};
|
|
143
149
|
/**
|
|
144
|
-
* The editable value: a full-width button naming its action before the current value,
|
|
145
|
-
* and the popover it opens
|
|
146
|
-
* popover's implicit anchor, so
|
|
150
|
+
* The editable value: a full-width button naming its action before the current value, its
|
|
151
|
+
* chevron on the label's row, and the popover it opens, the row's own or the app's. As the
|
|
152
|
+
* popover's invoker the button is its implicit anchor, so it opens under its row.
|
|
147
153
|
*
|
|
148
154
|
* @param handle Runtime handle carrying the edit description and the rendered value.
|
|
149
155
|
* @returns The render function producing the button and its popover.
|
|
150
156
|
*/
|
|
151
157
|
function PropertyEdit(handle) {
|
|
152
158
|
return () => {
|
|
153
|
-
let { edit, children } = handle.props;
|
|
159
|
+
let { edit, children, labelRow } = handle.props;
|
|
154
160
|
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", "data-slot": "property-edit", popovertarget: edit.id, "aria-haspopup": "dialog", mix: [
|
|
155
161
|
flex(),
|
|
156
162
|
items("center"),
|
|
@@ -159,7 +165,11 @@ function PropertyEdit(handle) {
|
|
|
159
165
|
is("full"),
|
|
160
166
|
minBs("2rem"),
|
|
161
167
|
pi(2),
|
|
162
|
-
raw({
|
|
168
|
+
raw({
|
|
169
|
+
marginInline: "-0.5rem",
|
|
170
|
+
inlineSize: "calc(100% + 1rem)",
|
|
171
|
+
paddingBlock: "0.25rem",
|
|
172
|
+
}),
|
|
163
173
|
rounded("md"),
|
|
164
174
|
border({ color: "transparent", width: 0 }),
|
|
165
175
|
bg("transparent"),
|
|
@@ -170,6 +180,23 @@ function PropertyEdit(handle) {
|
|
|
170
180
|
transition("background-color"),
|
|
171
181
|
hover(bg("neutral.tint")),
|
|
172
182
|
focusVisible(outline({ color: "brand.ring", width: 2, offset: -2 })),
|
|
173
|
-
], children: [_jsxs("span", { mix: [flex(), items("center"), gap(1.5), raw({ flexWrap: "wrap" }), minIs(0)], children: [_jsx("span", { mix: [visuallyHidden()], children: `${edit.label}: ` }), children] }), _jsx(
|
|
183
|
+
], children: [_jsxs("span", { mix: [flex(), items("center"), gap(1.5), raw({ flexWrap: "wrap" }), minIs(0)], children: [_jsx("span", { mix: [visuallyHidden()], children: `${edit.label}: ` }), children] }), _jsx("span", { "aria-hidden": "true", mix: [
|
|
184
|
+
flex(),
|
|
185
|
+
items("center"),
|
|
186
|
+
shrink(0),
|
|
187
|
+
raw({ alignSelf: "flex-start", blockSize: "1.5rem" }),
|
|
188
|
+
labelRow
|
|
189
|
+
? raw({
|
|
190
|
+
position: "absolute",
|
|
191
|
+
insetBlockStart: "0.625rem",
|
|
192
|
+
insetInlineEnd: 0,
|
|
193
|
+
blockSize: "1.25rem",
|
|
194
|
+
[`@container ${PROPERTY_LIST_CONTAINER} (min-width: 22rem)`]: {
|
|
195
|
+
position: "static",
|
|
196
|
+
blockSize: "1.5rem",
|
|
197
|
+
},
|
|
198
|
+
})
|
|
199
|
+
: null,
|
|
200
|
+
], children: _jsx(ChevronDownIcon, { size: 14, mix: [fg("neutral.muted")] }) })] }), edit.popover ?? (_jsx(Popover, { id: edit.id, placement: "bottom-start", role: "dialog", "aria-label": edit.label, "data-slot": "property-popover", mix: [p(3), is("min(20rem, calc(100vw - 2rem))"), text("sm")], children: edit.content }))] }));
|
|
174
201
|
};
|
|
175
202
|
}
|
|
@@ -75,7 +75,12 @@ export function TextArea(handle) {
|
|
|
75
75
|
resize: "block",
|
|
76
76
|
fieldSizing: "content",
|
|
77
77
|
}),
|
|
78
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Pointer focus drops the platform outline and keyboard focus keeps the ring above:
|
|
80
|
+
* `outline: none` is a shorthand, and from a later cascade layer it would reset the
|
|
81
|
+
* ring's color, width and style at once.
|
|
82
|
+
*/
|
|
83
|
+
when("&:focus:not(:focus-visible)", outline("none")),
|
|
79
84
|
], mix) }));
|
|
80
85
|
};
|
|
81
86
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A record's activity as an ordered list: a 2px rail threading 16px event icons toned by
|
|
3
|
-
* what happened, one line per event
|
|
4
|
-
*
|
|
3
|
+
* what happened, one line per event, comment cards with an author header and reactions,
|
|
4
|
+
* grouped commits, and a native `<details>` folding a run of quiet events into "N more".
|
|
5
5
|
*
|
|
6
6
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
7
|
* @copyright Sergio Xalambrí 2026
|
|
@@ -33,6 +33,51 @@ export declare namespace Timeline {
|
|
|
33
33
|
/** What happened, in muted text after the actor: "resolved the incident". */
|
|
34
34
|
children?: RemixNode;
|
|
35
35
|
}
|
|
36
|
+
/** Every native `<li>` attribute, plus the comment's parts. */
|
|
37
|
+
interface CommentProps extends Omit<TagProps<"li">, "children"> {
|
|
38
|
+
/** The author's avatar, set on the rail in place of an icon. */
|
|
39
|
+
avatar: RemixNode;
|
|
40
|
+
/** The author's name, set in bold at the start of the card's header. */
|
|
41
|
+
author: RemixNode;
|
|
42
|
+
/** The muted verb after the name: "commented", "reviewed". */
|
|
43
|
+
action?: RemixNode;
|
|
44
|
+
/** When it was written: a `RelativeTime` or plain text. */
|
|
45
|
+
time?: RemixNode;
|
|
46
|
+
/** A `⋯` menu trigger, drawn at the end of the header. */
|
|
47
|
+
menu?: RemixNode;
|
|
48
|
+
/** Reactions or other controls, drawn in a row under the body. */
|
|
49
|
+
reactions?: RemixNode;
|
|
50
|
+
/** The rendered Markdown body. */
|
|
51
|
+
children: RemixNode;
|
|
52
|
+
}
|
|
53
|
+
/** Every native `<li>` attribute, plus the summary line and its commits. */
|
|
54
|
+
interface CommitsProps extends Omit<TagProps<"li">, "children"> {
|
|
55
|
+
/** A 16px glyph for the group, such as a commit icon. */
|
|
56
|
+
icon: RemixNode;
|
|
57
|
+
/** A small avatar of the pusher, shown before the name. */
|
|
58
|
+
avatar?: RemixNode;
|
|
59
|
+
/** Who pushed, set in bold. */
|
|
60
|
+
actor?: RemixNode;
|
|
61
|
+
/** What happened, muted: "added 3 commits". */
|
|
62
|
+
summary?: RemixNode;
|
|
63
|
+
/** When the push happened. */
|
|
64
|
+
time?: RemixNode;
|
|
65
|
+
/** The {@link Timeline.Commit} rows. */
|
|
66
|
+
children: RemixNode;
|
|
67
|
+
}
|
|
68
|
+
/** Every native `<li>` attribute, plus the commit's parts. */
|
|
69
|
+
interface CommitProps extends Omit<TagProps<"li">, "children"> {
|
|
70
|
+
/** The commit's short sha, set in monospace at the end of the row. */
|
|
71
|
+
sha: string;
|
|
72
|
+
/** The commit's page; links the subject and the sha. */
|
|
73
|
+
href?: string;
|
|
74
|
+
/** A small avatar of the author. */
|
|
75
|
+
avatar?: RemixNode;
|
|
76
|
+
/** The commit's checks, such as a toned status icon with its accessible name. */
|
|
77
|
+
check?: RemixNode;
|
|
78
|
+
/** The commit's subject line. */
|
|
79
|
+
children: RemixNode;
|
|
80
|
+
}
|
|
36
81
|
/** Every native `<li>` attribute, plus the folded events. */
|
|
37
82
|
interface MoreProps extends Omit<TagProps<"li">, "children"> {
|
|
38
83
|
/** The disclosure's label, such as "4 more events". */
|
|
@@ -44,9 +89,9 @@ export declare namespace Timeline {
|
|
|
44
89
|
}
|
|
45
90
|
}
|
|
46
91
|
/**
|
|
47
|
-
* Renders the `<ol>` and its rail
|
|
48
|
-
*
|
|
49
|
-
*
|
|
92
|
+
* Renders the `<ol>` and its rail, drawn once behind every icon so an opened fold keeps the line
|
|
93
|
+
* whole; icons and {@link Timeline.Comment} cards sit on `--ui-timeline-surface`, masking the rail,
|
|
94
|
+
* in a `--ui-timeline-icon-box` square. {@link Timeline.Commits} groups a push; all of it is HTML.
|
|
50
95
|
*
|
|
51
96
|
* @param handle Runtime handle carrying the `<ol>`'s props.
|
|
52
97
|
* @returns The render function producing the list's markup.
|
|
@@ -59,9 +104,21 @@ export declare namespace Timeline {
|
|
|
59
104
|
* commented
|
|
60
105
|
* </Timeline.Event>
|
|
61
106
|
* </Timeline>
|
|
107
|
+
* @example
|
|
108
|
+
* <Timeline aria-label={t("pull.conversation")}>
|
|
109
|
+
* <Timeline.Comment id="comment-12" avatar={<Avatar size="xs" />} author="ana" action={t("pull.commented")} time={<RelativeTime date={at} />}>
|
|
110
|
+
* <Markdown source={body} />
|
|
111
|
+
* </Timeline.Comment>
|
|
112
|
+
* <Timeline.Commits icon={<GitCommitHorizontalIcon />} actor="ana" summary={t("pull.addedCommits", { count: 1 })}>
|
|
113
|
+
* <Timeline.Commit sha="a1b2c3d" href="/commit/a1b2c3d">Fix the parser</Timeline.Commit>
|
|
114
|
+
* </Timeline.Commits>
|
|
115
|
+
* </Timeline>
|
|
62
116
|
*/
|
|
63
117
|
export declare function Timeline(handle: Handle<Timeline.Props>): () => import("remix/component").RemixElement;
|
|
64
118
|
export declare namespace Timeline {
|
|
65
119
|
var Event: (handle: Handle<Timeline.EventProps>) => () => import("remix/component").RemixElement;
|
|
66
120
|
var More: (handle: Handle<Timeline.MoreProps>) => () => import("remix/component").RemixElement;
|
|
121
|
+
var Comment: (handle: Handle<Timeline.CommentProps>) => () => import("remix/component").RemixElement;
|
|
122
|
+
var Commits: (handle: Handle<Timeline.CommitsProps>) => () => import("remix/component").RemixElement;
|
|
123
|
+
var Commit: (handle: Handle<Timeline.CommitProps>) => () => import("remix/component").RemixElement;
|
|
67
124
|
}
|
|
@@ -4,9 +4,9 @@ import { bg, border, fg, outline } from "@sdxc/u/color";
|
|
|
4
4
|
import { rounded } from "@sdxc/u/effects";
|
|
5
5
|
import { cursor, listStyle, pseudoContent, raw, mergeMix } from "@sdxc/u/general";
|
|
6
6
|
import { flex, gap, grid, inlineFlex, items, justify, relative, vstack } from "@sdxc/u/layout";
|
|
7
|
-
import { bs, is, m, minIs, p } from "@sdxc/u/size";
|
|
7
|
+
import { bs, is, m, minIs, p, pi } from "@sdxc/u/size";
|
|
8
8
|
import { before, data, focusVisible, hover, when } from "@sdxc/u/state";
|
|
9
|
-
import { leading, text, weight } from "@sdxc/u/typography";
|
|
9
|
+
import { font, leading, text, truncate, weight } from "@sdxc/u/typography";
|
|
10
10
|
/** The side of the square each event's icon sits centred in; the rail runs through its middle. */
|
|
11
11
|
const ICON_BOX = "var(--ui-timeline-icon-box, 1.5rem)";
|
|
12
12
|
/** Tone an event's icon takes when `tone` is left unset. */
|
|
@@ -25,9 +25,9 @@ function rowTrack() {
|
|
|
25
25
|
];
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Renders the `<ol>` and its rail
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* Renders the `<ol>` and its rail, drawn once behind every icon so an opened fold keeps the line
|
|
29
|
+
* whole; icons and {@link Timeline.Comment} cards sit on `--ui-timeline-surface`, masking the rail,
|
|
30
|
+
* in a `--ui-timeline-icon-box` square. {@link Timeline.Commits} groups a push; all of it is HTML.
|
|
31
31
|
*
|
|
32
32
|
* @param handle Runtime handle carrying the `<ol>`'s props.
|
|
33
33
|
* @returns The render function producing the list's markup.
|
|
@@ -40,6 +40,15 @@ function rowTrack() {
|
|
|
40
40
|
* commented
|
|
41
41
|
* </Timeline.Event>
|
|
42
42
|
* </Timeline>
|
|
43
|
+
* @example
|
|
44
|
+
* <Timeline aria-label={t("pull.conversation")}>
|
|
45
|
+
* <Timeline.Comment id="comment-12" avatar={<Avatar size="xs" />} author="ana" action={t("pull.commented")} time={<RelativeTime date={at} />}>
|
|
46
|
+
* <Markdown source={body} />
|
|
47
|
+
* </Timeline.Comment>
|
|
48
|
+
* <Timeline.Commits icon={<GitCommitHorizontalIcon />} actor="ana" summary={t("pull.addedCommits", { count: 1 })}>
|
|
49
|
+
* <Timeline.Commit sha="a1b2c3d" href="/commit/a1b2c3d">Fix the parser</Timeline.Commit>
|
|
50
|
+
* </Timeline.Commits>
|
|
51
|
+
* </Timeline>
|
|
43
52
|
*/
|
|
44
53
|
export function Timeline(handle) {
|
|
45
54
|
return () => {
|
|
@@ -129,6 +138,116 @@ Timeline.More = function TimelineMore(handle) {
|
|
|
129
138
|
], children: summary })] }), _jsx("ol", { mix: [m(0), p(0), listStyle("none"), vstack({ gap: 3 })], children: children })] }) }));
|
|
130
139
|
};
|
|
131
140
|
};
|
|
141
|
+
/**
|
|
142
|
+
* Renders a comment as a card on the rail: the author's avatar sits where an event's icon
|
|
143
|
+
* would, the header reads "name action time" with a `⋯` slot at its end, and the body and
|
|
144
|
+
* reactions follow. A conversation reads as cards and housekeeping as single lines.
|
|
145
|
+
*
|
|
146
|
+
* @param handle Runtime handle carrying the `<li>`'s props.
|
|
147
|
+
* @returns The render function producing the comment's markup.
|
|
148
|
+
* @example
|
|
149
|
+
* <Timeline.Comment id="comment-12" avatar={<Avatar size="xs" />} author="ana" action="commented" time={<RelativeTime date={at} />} menu={<CommentMenu />} reactions={<Reactions />}>
|
|
150
|
+
* <Markdown source={body} />
|
|
151
|
+
* </Timeline.Comment>
|
|
152
|
+
*/
|
|
153
|
+
Timeline.Comment = function TimelineComment(handle) {
|
|
154
|
+
return () => {
|
|
155
|
+
let { avatar, author, action, time, menu, reactions, children, mix, ...rest } = handle.props;
|
|
156
|
+
return (_jsxs("li", { "data-slot": "timeline-comment", ...rest, mix: mergeMix(rowTrack(), mix), children: [_jsx("span", { "data-slot": "timeline-avatar", mix: [
|
|
157
|
+
relative(),
|
|
158
|
+
inlineFlex(),
|
|
159
|
+
items("center"),
|
|
160
|
+
justify("center"),
|
|
161
|
+
is(ICON_BOX),
|
|
162
|
+
bs(ICON_BOX),
|
|
163
|
+
rounded("full"),
|
|
164
|
+
bg("var(--ui-timeline-surface, var(--ui-bg, Canvas))"),
|
|
165
|
+
], children: avatar }), _jsxs("div", { "data-slot": "timeline-card", mix: [
|
|
166
|
+
minIs(0),
|
|
167
|
+
rounded("md"),
|
|
168
|
+
border({ color: "neutral.border", width: 1 }),
|
|
169
|
+
bg("var(--ui-timeline-surface, var(--ui-bg, Canvas))"),
|
|
170
|
+
raw({ overflow: "clip" }),
|
|
171
|
+
], children: [_jsxs("header", { "data-slot": "timeline-comment-header", mix: [
|
|
172
|
+
flex(),
|
|
173
|
+
items("center"),
|
|
174
|
+
gap(2),
|
|
175
|
+
pi(3),
|
|
176
|
+
raw({ minBlockSize: "2.5rem", paddingBlock: "0.375rem" }),
|
|
177
|
+
bg("neutral.tint"),
|
|
178
|
+
raw({ borderBlockEnd: "1px solid var(--ui-neutral-border)" }),
|
|
179
|
+
], children: [_jsxs("p", { mix: [
|
|
180
|
+
m(0),
|
|
181
|
+
flex(),
|
|
182
|
+
items("baseline"),
|
|
183
|
+
raw({ flexWrap: "wrap", columnGap: "0.375rem", flex: "1 1 auto" }),
|
|
184
|
+
minIs(0),
|
|
185
|
+
leading("1.25rem"),
|
|
186
|
+
], children: [_jsx("span", { "data-slot": "timeline-actor", mix: [weight("semibold")], children: author }), action ? (_jsx("span", { "data-slot": "timeline-description", mix: [fg("neutral.muted")], children: action })) : null, time ? (_jsx("span", { "data-slot": "timeline-time", mix: [fg("neutral.muted")], children: time })) : null] }), menu ? (_jsx("span", { "data-slot": "timeline-comment-menu", mix: [inlineFlex(), raw({ flexShrink: 0 })], children: menu })) : null] }), _jsx("div", { "data-slot": "timeline-comment-body", mix: [
|
|
187
|
+
p(3),
|
|
188
|
+
raw({
|
|
189
|
+
overflowWrap: "anywhere",
|
|
190
|
+
"& > :first-child": { marginBlockStart: 0 },
|
|
191
|
+
"& > :last-child": { marginBlockEnd: 0 },
|
|
192
|
+
}),
|
|
193
|
+
], children: children }), reactions ? (_jsx("div", { "data-slot": "timeline-reactions", mix: [
|
|
194
|
+
flex(),
|
|
195
|
+
items("center"),
|
|
196
|
+
raw({ flexWrap: "wrap" }),
|
|
197
|
+
gap(1.5),
|
|
198
|
+
pi(3),
|
|
199
|
+
raw({ paddingBlockEnd: "0.75rem" }),
|
|
200
|
+
], children: reactions })) : null] })] }));
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Renders a push as one event on the rail with its commits listed under the line: each row
|
|
205
|
+
* gives the subject, its checks and the short sha, so a run of commits costs one rail stop.
|
|
206
|
+
*
|
|
207
|
+
* @param handle Runtime handle carrying the `<li>`'s props.
|
|
208
|
+
* @returns The render function producing the group's markup.
|
|
209
|
+
* @example
|
|
210
|
+
* <Timeline.Commits icon={<GitCommitHorizontalIcon />} actor="ana" summary="added 2 commits" time="3h ago">
|
|
211
|
+
* <Timeline.Commit sha="a1b2c3d" href="/commit/a1b2c3d" check={<CheckIcon aria-label="Checks passed" />}>Fix the parser</Timeline.Commit>
|
|
212
|
+
* </Timeline.Commits>
|
|
213
|
+
*/
|
|
214
|
+
Timeline.Commits = function TimelineCommits(handle) {
|
|
215
|
+
return () => {
|
|
216
|
+
let { icon, avatar, actor, summary, time, children, mix, ...rest } = handle.props;
|
|
217
|
+
return (_jsxs("li", { "data-slot": "timeline-commits", "data-tone": "neutral", ...rest, mix: mergeMix(rowTrack(), mix), children: [_jsx(TimelineIcon, { tone: "neutral", children: icon }), _jsxs("div", { mix: [vstack({ gap: 1.5 }), minIs(0)], children: [_jsxs("p", { "data-slot": "timeline-line", mix: [
|
|
218
|
+
m(0),
|
|
219
|
+
flex(),
|
|
220
|
+
items("center"),
|
|
221
|
+
raw({ flexWrap: "wrap", minBlockSize: ICON_BOX }),
|
|
222
|
+
gap(1.5),
|
|
223
|
+
leading("1.25rem"),
|
|
224
|
+
], children: [avatar ? _jsx("span", { mix: [inlineFlex()], children: avatar }) : null, actor ? (_jsx("span", { "data-slot": "timeline-actor", mix: [weight("semibold")], children: actor })) : null, summary ? (_jsx("span", { "data-slot": "timeline-description", mix: [fg("neutral.muted")], children: summary })) : null, time ? (_jsx("span", { "data-slot": "timeline-time", mix: [fg("neutral.muted"), text("xs")], children: time })) : null] }), _jsx("ol", { "data-slot": "timeline-commit-list", mix: [m(0), p(0), listStyle("none"), vstack({ gap: 0.5 })], children: children })] })] }));
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Renders one commit of a {@link Timeline.Commits} group: avatar, the subject (truncated to
|
|
229
|
+
* one line), the check-state slot, then the short sha in monospace at the row's end.
|
|
230
|
+
*
|
|
231
|
+
* @param handle Runtime handle carrying the `<li>`'s props.
|
|
232
|
+
* @returns The render function producing the commit's row.
|
|
233
|
+
* @example <Timeline.Commit sha="a1b2c3d" href="/commit/a1b2c3d">Fix the parser</Timeline.Commit>
|
|
234
|
+
*/
|
|
235
|
+
Timeline.Commit = function TimelineCommit(handle) {
|
|
236
|
+
return () => {
|
|
237
|
+
let { sha, href, avatar, check, children, mix, ...rest } = handle.props;
|
|
238
|
+
let linkMix = [
|
|
239
|
+
fg("inherit"),
|
|
240
|
+
raw({ textDecoration: "none" }),
|
|
241
|
+
hover(raw({ textDecoration: "underline" })),
|
|
242
|
+
];
|
|
243
|
+
return (_jsxs("li", { "data-slot": "timeline-commit", ...rest, mix: mergeMix([flex(), items("center"), gap(2), minIs(0), raw({ minBlockSize: "1.75rem" })], mix), children: [avatar ? _jsx("span", { mix: [inlineFlex(), raw({ flexShrink: 0 })], children: avatar }) : null, _jsx("span", { "data-slot": "timeline-commit-subject", mix: [truncate(), raw({ flex: "0 1 auto" })], children: href ? (_jsx("a", { href: href, mix: linkMix, children: children })) : (children) }), check ? (_jsx("span", { "data-slot": "timeline-commit-check", mix: [inlineFlex(), raw({ flexShrink: 0 })], children: check })) : null, _jsx("code", { "data-slot": "timeline-commit-sha", mix: [
|
|
244
|
+
raw({ marginInlineStart: "auto", flexShrink: 0 }),
|
|
245
|
+
font("mono"),
|
|
246
|
+
text("xs"),
|
|
247
|
+
fg("neutral.muted"),
|
|
248
|
+
], children: href ? (_jsx("a", { href: href, mix: linkMix, children: sha })) : (sha) })] }));
|
|
249
|
+
};
|
|
250
|
+
};
|
|
132
251
|
/**
|
|
133
252
|
* The icon box on the rail: the glyph in its tone, on the surface colour so the rail
|
|
134
253
|
* reads as passing behind it.
|