@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,420 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "remix/component/jsx-runtime";
|
|
2
|
+
import { iife } from "@sdxc/iife";
|
|
3
|
+
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
4
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
5
|
+
import { clientEntry } from "remix/component";
|
|
6
|
+
import { ganttToday } from "./mixins/gantt-today.js";
|
|
7
|
+
/** Milliseconds in a day, the axis's unit. */
|
|
8
|
+
const DAY_MS = 86_400_000;
|
|
9
|
+
/** Container the chart names, so the list column narrows on a phone-narrow chart. */
|
|
10
|
+
const GANTT_CONTAINER = "ui-gantt";
|
|
11
|
+
/** Below this width the list column narrows and drops its trailing details. */
|
|
12
|
+
const NARROW = `@container ${GANTT_CONTAINER} (width < 40rem)`;
|
|
13
|
+
/** The width of one day on the axis, which every offset and length multiplies. */
|
|
14
|
+
const DAY = "var(--ui-gantt-day-width, 6px)";
|
|
15
|
+
/** The list column's width. */
|
|
16
|
+
const LIST = "var(--ui-gantt-list-width, 20rem)";
|
|
17
|
+
/** The height of a project row, which its bar centres in. */
|
|
18
|
+
const ROW = "var(--ui-gantt-row-height, 2.75rem)";
|
|
19
|
+
/**
|
|
20
|
+
* Client island: an invisible marker that scrolls the chart to today once it is laid out,
|
|
21
|
+
* so a narrow screen opens on the present. Loads from `@sdxc/ui/app/gantt#GanttToday`.
|
|
22
|
+
*/
|
|
23
|
+
export const GanttToday = clientEntry("@sdxc/ui/app/gantt#GanttToday", function GanttToday() {
|
|
24
|
+
return () => _jsx("span", { hidden: true, "data-slot": "gantt-scroll", mix: [ganttToday()] });
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Days from the epoch to a `YYYY-MM-DD` date, read as UTC so a time zone never shifts a bar.
|
|
28
|
+
*
|
|
29
|
+
* @param date The date.
|
|
30
|
+
* @returns Whole days since 1970-01-01.
|
|
31
|
+
*/
|
|
32
|
+
export function ganttDay(date) {
|
|
33
|
+
return Math.round(Date.parse(`${date.slice(0, 10)}T00:00:00Z`) / DAY_MS);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Days from the epoch to a date, or `fallback` when the date cannot be read, so a chart
|
|
37
|
+
* whose range is missing or mistyped draws a one-day axis rather than failing to render.
|
|
38
|
+
*/
|
|
39
|
+
function readableDay(date, fallback) {
|
|
40
|
+
let day = typeof date === "string" ? ganttDay(date) : Number.NaN;
|
|
41
|
+
return Number.isFinite(day) ? day : fallback;
|
|
42
|
+
}
|
|
43
|
+
/** A calc() length `days` days along the axis. */
|
|
44
|
+
function along(days) {
|
|
45
|
+
return `calc(${days} * ${DAY})`;
|
|
46
|
+
}
|
|
47
|
+
/** Formats a day for a label, in UTC. */
|
|
48
|
+
function format(day, locale, options) {
|
|
49
|
+
return new Intl.DateTimeFormat(locale, { ...options, timeZone: "UTC" }).format(new Date(day * DAY_MS));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Renders the chart inside its own scrolling box: the list column stays put while the axis
|
|
53
|
+
* scrolls sideways, and the axis row stays put while the rows scroll. Size the box from
|
|
54
|
+
* outside (a block size, or a flex parent) for the rows to scroll inside it.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* <Gantt label="Gantt" start="2026-09-01" end="2027-03-31" today="2026-11-12" labels={labels}>
|
|
58
|
+
* <Gantt.Group title="Q4 2026">
|
|
59
|
+
* <Gantt.Item name="Checkout v2" href="/projects/checkout" start="2026-10-01" end="2026-12-15" progress={0.6} />
|
|
60
|
+
* </Gantt.Group>
|
|
61
|
+
* </Gantt>
|
|
62
|
+
*/
|
|
63
|
+
export function Gantt(handle) {
|
|
64
|
+
return () => {
|
|
65
|
+
let { label, start, end, today, locale = "en", header, labels, children, mix, ...rest } = handle.props;
|
|
66
|
+
let first = readableDay(start, 0);
|
|
67
|
+
let last = Math.max(first, readableDay(end, first));
|
|
68
|
+
let span = last - first + 1;
|
|
69
|
+
handle.context.set({ start: first, end: last, locale, labels });
|
|
70
|
+
let months = [];
|
|
71
|
+
let weeks = [];
|
|
72
|
+
for (let day = first; day <= last; day++) {
|
|
73
|
+
let date = new Date(day * DAY_MS);
|
|
74
|
+
if (date.getUTCDate() === 1 || day === first) {
|
|
75
|
+
months.push({ day, label: format(day, locale, { month: "long" }) });
|
|
76
|
+
}
|
|
77
|
+
if (date.getUTCDay() === 1)
|
|
78
|
+
weeks.push(day);
|
|
79
|
+
}
|
|
80
|
+
let firstMonday = weeks[0] ?? first;
|
|
81
|
+
let todayDay = today === undefined ? undefined : ganttDay(today);
|
|
82
|
+
let showsToday = todayDay !== undefined && todayDay >= first && todayDay <= last;
|
|
83
|
+
return (_jsx("div", { ...rest, role: "region", "aria-label": label, "data-slot": "gantt", mix: mergeMix([
|
|
84
|
+
raw({
|
|
85
|
+
container: `${GANTT_CONTAINER} / inline-size`,
|
|
86
|
+
position: "relative",
|
|
87
|
+
overflow: "auto",
|
|
88
|
+
overscrollBehavior: "contain",
|
|
89
|
+
minInlineSize: 0,
|
|
90
|
+
backgroundColor: "var(--ui-bg, Canvas)",
|
|
91
|
+
"--ui-gantt-track": along(span),
|
|
92
|
+
}),
|
|
93
|
+
], mix), children: _jsxs("div", { "data-slot": "gantt-grid", mix: [
|
|
94
|
+
raw({
|
|
95
|
+
position: "relative",
|
|
96
|
+
display: "grid",
|
|
97
|
+
gridTemplateColumns: `${LIST} var(--ui-gantt-track)`,
|
|
98
|
+
alignContent: "start",
|
|
99
|
+
minBlockSize: "100%",
|
|
100
|
+
[NARROW]: { "--ui-gantt-list-width": "10rem" },
|
|
101
|
+
inlineSize: "max-content",
|
|
102
|
+
minInlineSize: "100%",
|
|
103
|
+
}),
|
|
104
|
+
], children: [_jsx("div", { "data-slot": "gantt-corner", mix: [
|
|
105
|
+
raw({
|
|
106
|
+
position: "sticky",
|
|
107
|
+
insetBlockStart: "0",
|
|
108
|
+
insetInlineStart: "0",
|
|
109
|
+
zIndex: "6",
|
|
110
|
+
display: "flex",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
minBlockSize: "3.5rem",
|
|
113
|
+
paddingInline: "0.75rem",
|
|
114
|
+
boxSizing: "border-box",
|
|
115
|
+
backgroundColor: "var(--ui-bg, Canvas)",
|
|
116
|
+
borderBlockEnd: "1px solid var(--ui-neutral-border)",
|
|
117
|
+
borderInlineEnd: "1px solid var(--ui-neutral-border)",
|
|
118
|
+
}),
|
|
119
|
+
], children: header }), _jsxs("div", { "aria-hidden": "true", "data-slot": "gantt-axis", mix: [
|
|
120
|
+
raw({
|
|
121
|
+
position: "sticky",
|
|
122
|
+
insetBlockStart: "0",
|
|
123
|
+
zIndex: "5",
|
|
124
|
+
minBlockSize: "3.5rem",
|
|
125
|
+
backgroundColor: "var(--ui-bg, Canvas)",
|
|
126
|
+
borderBlockEnd: "1px solid var(--ui-neutral-border)",
|
|
127
|
+
fontSize: "0.75rem",
|
|
128
|
+
lineHeight: "1rem",
|
|
129
|
+
fontVariantNumeric: "tabular-nums",
|
|
130
|
+
whiteSpace: "nowrap",
|
|
131
|
+
}),
|
|
132
|
+
], children: [months.map((month) => (_jsx("span", { "data-slot": "gantt-month", mix: [
|
|
133
|
+
raw({
|
|
134
|
+
position: "absolute",
|
|
135
|
+
insetBlockStart: "0.625rem",
|
|
136
|
+
insetInlineStart: along(month.day - first),
|
|
137
|
+
paddingInlineStart: "0.375rem",
|
|
138
|
+
color: "var(--ui-neutral-fg)",
|
|
139
|
+
fontWeight: "500",
|
|
140
|
+
}),
|
|
141
|
+
], children: month.label }))), weeks.map((week) => (_jsx("span", { mix: [
|
|
142
|
+
raw({
|
|
143
|
+
position: "absolute",
|
|
144
|
+
insetBlockStart: "1.875rem",
|
|
145
|
+
insetInlineStart: along(week - first),
|
|
146
|
+
translate: "-50% 0",
|
|
147
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
148
|
+
opacity: todayDay !== undefined && Math.abs(week - todayDay) < 4 ? "0" : "1",
|
|
149
|
+
}),
|
|
150
|
+
], children: format(week, locale, { day: "numeric" }) }))), iife(() => {
|
|
151
|
+
if (!showsToday || todayDay === undefined)
|
|
152
|
+
return null;
|
|
153
|
+
return (_jsx("span", { "data-slot": "gantt-today-label", mix: [
|
|
154
|
+
raw({
|
|
155
|
+
position: "absolute",
|
|
156
|
+
insetBlockStart: "1.625rem",
|
|
157
|
+
insetInlineStart: along(todayDay - first + 0.5),
|
|
158
|
+
translate: "-50% 0",
|
|
159
|
+
minInlineSize: "1.5rem",
|
|
160
|
+
blockSize: "1.5rem",
|
|
161
|
+
paddingInline: "0.25rem",
|
|
162
|
+
boxSizing: "border-box",
|
|
163
|
+
borderRadius: "999px",
|
|
164
|
+
display: "grid",
|
|
165
|
+
placeItems: "center",
|
|
166
|
+
fontWeight: "700",
|
|
167
|
+
color: "var(--ui-brand-fg-on-solid, white)",
|
|
168
|
+
backgroundColor: "var(--ui-brand-bg-solid)",
|
|
169
|
+
}),
|
|
170
|
+
], children: format(todayDay, locale, { day: "numeric" }) }));
|
|
171
|
+
})] }), children, _jsx("div", { "aria-hidden": "true", "data-slot": "gantt-weeks", mix: [
|
|
172
|
+
raw({
|
|
173
|
+
position: "absolute",
|
|
174
|
+
insetBlock: "3.5rem 0",
|
|
175
|
+
insetInlineStart: LIST,
|
|
176
|
+
inlineSize: "var(--ui-gantt-track)",
|
|
177
|
+
zIndex: "0",
|
|
178
|
+
pointerEvents: "none",
|
|
179
|
+
backgroundImage: "linear-gradient(to right, var(--ui-neutral-border) 1px, transparent 1px)",
|
|
180
|
+
backgroundSize: `${along(7)} 100%`,
|
|
181
|
+
backgroundPositionX: along(firstMonday - first),
|
|
182
|
+
opacity: "0.45",
|
|
183
|
+
}),
|
|
184
|
+
] }), iife(() => {
|
|
185
|
+
if (!showsToday || todayDay === undefined)
|
|
186
|
+
return null;
|
|
187
|
+
return (_jsxs("div", { "data-slot": "gantt-today", mix: [
|
|
188
|
+
raw({
|
|
189
|
+
position: "absolute",
|
|
190
|
+
insetBlock: "0",
|
|
191
|
+
insetInlineStart: `calc(${LIST} + ${along(todayDay - first + 0.5)})`,
|
|
192
|
+
inlineSize: "2px",
|
|
193
|
+
translate: "-50% 0",
|
|
194
|
+
zIndex: "2",
|
|
195
|
+
pointerEvents: "none",
|
|
196
|
+
backgroundColor: "var(--ui-brand-bg-solid)",
|
|
197
|
+
}),
|
|
198
|
+
], children: [_jsx("span", { mix: [visuallyHidden()], children: `${labels.today}: ${format(todayDay, locale, { dateStyle: "long" })}` }), _jsx(GanttToday, {})] }));
|
|
199
|
+
})] }) }));
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* One group: a header row spanning list and axis, then its projects as a list, so a screen
|
|
204
|
+
* reader hears each group's name and count before its rows.
|
|
205
|
+
*/
|
|
206
|
+
Gantt.Group = function GanttGroup(handle) {
|
|
207
|
+
return () => {
|
|
208
|
+
let { title, actions, children, mix, id, ...rest } = handle.props;
|
|
209
|
+
return (_jsxs("section", { ...rest, id: id, "data-slot": "gantt-group", mix: mergeMix([raw({ display: "contents" })], mix), children: [_jsxs("div", { mix: [
|
|
210
|
+
raw({
|
|
211
|
+
position: "sticky",
|
|
212
|
+
insetInlineStart: "0",
|
|
213
|
+
zIndex: "3",
|
|
214
|
+
gridColumn: "1",
|
|
215
|
+
display: "flex",
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
gap: "0.5rem",
|
|
218
|
+
minBlockSize: "2.75rem",
|
|
219
|
+
paddingInline: "0.75rem",
|
|
220
|
+
boxSizing: "border-box",
|
|
221
|
+
backgroundColor: "var(--ui-neutral-bg-tint)",
|
|
222
|
+
borderInlineEnd: "1px solid var(--ui-neutral-border)",
|
|
223
|
+
}),
|
|
224
|
+
], children: [_jsx("h3", { mix: [
|
|
225
|
+
raw({
|
|
226
|
+
margin: "0",
|
|
227
|
+
flex: "1 1 auto",
|
|
228
|
+
minInlineSize: 0,
|
|
229
|
+
fontSize: "0.9375rem",
|
|
230
|
+
lineHeight: "1.25rem",
|
|
231
|
+
fontWeight: "600",
|
|
232
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
233
|
+
}),
|
|
234
|
+
], children: title }), actions] }), _jsx("div", { "aria-hidden": "true", mix: [
|
|
235
|
+
raw({ gridColumn: "2", backgroundColor: "var(--ui-neutral-bg-tint)", opacity: "0.6" }),
|
|
236
|
+
] }), _jsx("ul", { mix: [
|
|
237
|
+
raw({
|
|
238
|
+
display: "grid",
|
|
239
|
+
gridColumn: "1 / -1",
|
|
240
|
+
gridTemplateColumns: "subgrid",
|
|
241
|
+
margin: "0",
|
|
242
|
+
padding: "0",
|
|
243
|
+
listStyle: "none",
|
|
244
|
+
}),
|
|
245
|
+
], children: children })] }));
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* One project: its name, glyph and details in the list column, and its bar on the axis, with
|
|
250
|
+
* the dates, progress and projection written out for a screen reader. A bar shorter than its
|
|
251
|
+
* name lets the name run past its end.
|
|
252
|
+
*/
|
|
253
|
+
Gantt.Item = function GanttItem(handle) {
|
|
254
|
+
return () => {
|
|
255
|
+
let { name, href, icon, meta, start, end, progress, projectedEnd, trailing, mix, ...rest } = handle.props;
|
|
256
|
+
let gantt = handle.context.get(Gantt);
|
|
257
|
+
let { labels, locale } = gantt;
|
|
258
|
+
let from = start === undefined ? undefined : ganttDay(start);
|
|
259
|
+
let to = end === undefined ? undefined : ganttDay(end);
|
|
260
|
+
let scheduled = from !== undefined && to !== undefined && to >= from;
|
|
261
|
+
let projected = projectedEnd === undefined ? undefined : ganttDay(projectedEnd);
|
|
262
|
+
let late = scheduled && projected !== undefined && to !== undefined && projected > to;
|
|
263
|
+
let percent = Math.round(Math.min(Math.max(progress ?? 0, 0), 1) * 100);
|
|
264
|
+
let glyph = iife(() => {
|
|
265
|
+
if (!icon)
|
|
266
|
+
return null;
|
|
267
|
+
return (_jsx("span", { "aria-hidden": "true", mix: [
|
|
268
|
+
raw({
|
|
269
|
+
display: "inline-flex",
|
|
270
|
+
flexShrink: "0",
|
|
271
|
+
"& > svg": { inlineSize: "1rem", blockSize: "1rem" },
|
|
272
|
+
}),
|
|
273
|
+
], children: icon }));
|
|
274
|
+
});
|
|
275
|
+
let title = iife(() => {
|
|
276
|
+
if (!href)
|
|
277
|
+
return name;
|
|
278
|
+
return (_jsx("a", { href: href, mix: [
|
|
279
|
+
raw({
|
|
280
|
+
color: "inherit",
|
|
281
|
+
textDecoration: "none",
|
|
282
|
+
outline: "none",
|
|
283
|
+
"&:hover": { textDecoration: "underline" },
|
|
284
|
+
"&:focus-visible": {
|
|
285
|
+
borderRadius: "0.25rem",
|
|
286
|
+
boxShadow: "0 0 0 2px var(--ui-brand-ring)",
|
|
287
|
+
},
|
|
288
|
+
}),
|
|
289
|
+
], children: name }));
|
|
290
|
+
});
|
|
291
|
+
let description = iife(() => {
|
|
292
|
+
if (!scheduled)
|
|
293
|
+
return labels.unscheduled;
|
|
294
|
+
let parts = [
|
|
295
|
+
labels.schedule
|
|
296
|
+
.replace("{start}", format(from, locale, { dateStyle: "medium" }))
|
|
297
|
+
.replace("{end}", format(to, locale, { dateStyle: "medium" })),
|
|
298
|
+
];
|
|
299
|
+
if (progress !== undefined)
|
|
300
|
+
parts.push(labels.progress.replace("{percent}", `${percent}%`));
|
|
301
|
+
if (late) {
|
|
302
|
+
parts.push(labels.projected.replace("{date}", format(projected, locale, { dateStyle: "medium" })));
|
|
303
|
+
}
|
|
304
|
+
return parts.join(", ");
|
|
305
|
+
});
|
|
306
|
+
let left = scheduled ? from - gantt.start : 0;
|
|
307
|
+
let length = scheduled ? to - from + 1 : 0;
|
|
308
|
+
return (_jsxs("li", { ...rest, "data-slot": "gantt-item", mix: mergeMix([
|
|
309
|
+
raw({
|
|
310
|
+
display: "grid",
|
|
311
|
+
gridColumn: "1 / -1",
|
|
312
|
+
gridTemplateColumns: "subgrid",
|
|
313
|
+
blockSize: ROW,
|
|
314
|
+
"&:hover > *": {
|
|
315
|
+
backgroundColor: "color-mix(in oklch, var(--ui-neutral-bg-tint) 60%, transparent)",
|
|
316
|
+
},
|
|
317
|
+
}),
|
|
318
|
+
], mix), children: [_jsxs("div", { "data-slot": "gantt-item-name", mix: [
|
|
319
|
+
raw({
|
|
320
|
+
position: "sticky",
|
|
321
|
+
insetInlineStart: "0",
|
|
322
|
+
zIndex: "3",
|
|
323
|
+
display: "flex",
|
|
324
|
+
alignItems: "center",
|
|
325
|
+
gap: "0.625rem",
|
|
326
|
+
minInlineSize: 0,
|
|
327
|
+
paddingInline: "0.75rem 0.75rem",
|
|
328
|
+
boxSizing: "border-box",
|
|
329
|
+
fontSize: "0.875rem",
|
|
330
|
+
lineHeight: "1.25rem",
|
|
331
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
332
|
+
backgroundColor: "var(--ui-bg, Canvas)",
|
|
333
|
+
borderInlineEnd: "1px solid var(--ui-neutral-border)",
|
|
334
|
+
borderBlockEnd: "1px solid var(--ui-neutral-border-subtle, transparent)",
|
|
335
|
+
}),
|
|
336
|
+
], children: [glyph, _jsxs("span", { mix: [
|
|
337
|
+
raw({
|
|
338
|
+
flex: "1 1 auto",
|
|
339
|
+
minInlineSize: 0,
|
|
340
|
+
whiteSpace: "nowrap",
|
|
341
|
+
overflow: "hidden",
|
|
342
|
+
textOverflow: "ellipsis",
|
|
343
|
+
}),
|
|
344
|
+
], children: [title, _jsx("span", { mix: [visuallyHidden()], children: `, ${description}` })] }), iife(() => {
|
|
345
|
+
if (!meta)
|
|
346
|
+
return null;
|
|
347
|
+
return (_jsx("span", { mix: [
|
|
348
|
+
raw({
|
|
349
|
+
display: "inline-flex",
|
|
350
|
+
alignItems: "center",
|
|
351
|
+
gap: "0.5rem",
|
|
352
|
+
flexShrink: "0",
|
|
353
|
+
[NARROW]: { display: "none" },
|
|
354
|
+
}),
|
|
355
|
+
], children: meta }));
|
|
356
|
+
})] }), _jsx("div", { "aria-hidden": "true", "data-slot": "gantt-item-track", mix: [raw({ position: "relative", zIndex: "1", minInlineSize: 0 })], children: iife(() => {
|
|
357
|
+
if (!scheduled) {
|
|
358
|
+
return (_jsx("span", { mix: [
|
|
359
|
+
raw({
|
|
360
|
+
position: "absolute",
|
|
361
|
+
insetBlock: "0",
|
|
362
|
+
insetInlineStart: "0.75rem",
|
|
363
|
+
display: "flex",
|
|
364
|
+
alignItems: "center",
|
|
365
|
+
fontSize: "0.75rem",
|
|
366
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
367
|
+
whiteSpace: "nowrap",
|
|
368
|
+
}),
|
|
369
|
+
], children: labels.unscheduled }));
|
|
370
|
+
}
|
|
371
|
+
return (_jsxs(_Fragment, { children: [iife(() => {
|
|
372
|
+
if (!late)
|
|
373
|
+
return null;
|
|
374
|
+
return (_jsx("span", { "data-slot": "gantt-late", mix: [
|
|
375
|
+
raw({
|
|
376
|
+
position: "absolute",
|
|
377
|
+
insetBlock: "0.4375rem",
|
|
378
|
+
insetInlineStart: along(left + length - 0.5),
|
|
379
|
+
inlineSize: along(projected - to + 0.5),
|
|
380
|
+
borderRadius: "0 0.375rem 0.375rem 0",
|
|
381
|
+
border: "1px dashed color-mix(in oklch, var(--ui-danger-fg) 60%, transparent)",
|
|
382
|
+
borderInlineStart: "0",
|
|
383
|
+
backgroundImage: "repeating-linear-gradient(-45deg, color-mix(in oklch, var(--ui-danger-fg) 22%, transparent) 0 2px, transparent 2px 7px)",
|
|
384
|
+
}),
|
|
385
|
+
] }));
|
|
386
|
+
}), _jsx("span", { "data-slot": "gantt-bar", style: `--ui-gantt-progress:${percent}%`, mix: [
|
|
387
|
+
raw({
|
|
388
|
+
position: "absolute",
|
|
389
|
+
insetBlock: "0.4375rem",
|
|
390
|
+
insetInlineStart: along(left),
|
|
391
|
+
inlineSize: along(length),
|
|
392
|
+
boxSizing: "border-box",
|
|
393
|
+
borderRadius: "0.375rem",
|
|
394
|
+
border: "1px solid var(--ui-neutral-border)",
|
|
395
|
+
backgroundColor: "var(--ui-neutral-bg-tint)",
|
|
396
|
+
backgroundImage: "linear-gradient(to right, color-mix(in oklch, var(--ui-brand-bg-solid) 22%, var(--ui-neutral-bg-tint)) var(--ui-gantt-progress), transparent var(--ui-gantt-progress))",
|
|
397
|
+
}),
|
|
398
|
+
] }), _jsxs("span", { "data-slot": "gantt-bar-label", mix: [
|
|
399
|
+
raw({
|
|
400
|
+
position: "absolute",
|
|
401
|
+
insetBlock: "0",
|
|
402
|
+
insetInlineStart: `calc(${along(left)} + 0.625rem)`,
|
|
403
|
+
display: "flex",
|
|
404
|
+
alignItems: "center",
|
|
405
|
+
gap: "0.5rem",
|
|
406
|
+
fontSize: "0.8125rem",
|
|
407
|
+
lineHeight: "1.25rem",
|
|
408
|
+
fontWeight: "500",
|
|
409
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
410
|
+
whiteSpace: "nowrap",
|
|
411
|
+
pointerEvents: "none",
|
|
412
|
+
}),
|
|
413
|
+
], children: [glyph, name, iife(() => {
|
|
414
|
+
if (!trailing)
|
|
415
|
+
return null;
|
|
416
|
+
return (_jsx("span", { mix: [raw({ display: "inline-flex", color: "var(--ui-brand-fg)" })], children: trailing }));
|
|
417
|
+
})] })] }));
|
|
418
|
+
}) })] }));
|
|
419
|
+
};
|
|
420
|
+
};
|
package/dist/app/index.d.ts
CHANGED
|
@@ -15,36 +15,49 @@ export * from "./behaviors/resize-session.js";
|
|
|
15
15
|
export * from "./behaviors/selection-model.js";
|
|
16
16
|
export * from "./behaviors/shortcuts.js";
|
|
17
17
|
export * from "./behaviors/toaster.js";
|
|
18
|
+
export * from "./board.js";
|
|
18
19
|
export * from "./chart.js";
|
|
20
|
+
export * from "./check-runs.js";
|
|
21
|
+
export * from "./code-view.js";
|
|
19
22
|
export * from "./command-palette.js";
|
|
20
23
|
export * from "./context-menu.js";
|
|
24
|
+
export * from "./contribution-graph.js";
|
|
21
25
|
export * from "./danger-zone.js";
|
|
22
26
|
export * from "./detail-sheet.js";
|
|
27
|
+
export * from "./diff.js";
|
|
23
28
|
export * from "./drop-indicator.js";
|
|
24
29
|
export * from "./drop-zone.js";
|
|
25
30
|
export * from "./editor-layout.js";
|
|
26
31
|
export * from "./empty.js";
|
|
27
32
|
export * from "./file-trigger.js";
|
|
28
33
|
export * from "./filter-bar.js";
|
|
34
|
+
export * from "./filter-menu.js";
|
|
29
35
|
export * from "./grid-list.js";
|
|
30
36
|
export * from "./keyboard-help.js";
|
|
37
|
+
export * from "./log-viewer.js";
|
|
31
38
|
export * from "./menubar.js";
|
|
39
|
+
export * from "./merge-box.js";
|
|
32
40
|
export * from "./mixins/app-shell-controls.js";
|
|
33
41
|
export * from "./mixins/auto-refresh.js";
|
|
34
42
|
export * from "./mixins/chart-tooltip.js";
|
|
43
|
+
export { CODE_VIEW_LIVE_ATTRIBUTE, CODE_VIEW_MENU_ATTRIBUTE, CODE_VIEW_SELECTED_ATTRIBUTE, CODE_VIEW_SELECTOR, codeViewSelection, } from "./mixins/code-view-selection.js";
|
|
35
44
|
export * from "./mixins/command-palette.js";
|
|
36
45
|
export * from "./mixins/context-menu.js";
|
|
46
|
+
export * from "./mixins/contribution-graph-keys.js";
|
|
37
47
|
export * from "./mixins/copy-permalink.js";
|
|
38
48
|
export * from "./mixins/detail-sheet-keys.js";
|
|
39
49
|
export * from "./mixins/drag-reorder.js";
|
|
40
50
|
export * from "./mixins/drop-zone.js";
|
|
41
51
|
export * from "./mixins/escape-link.js";
|
|
52
|
+
export * from "./mixins/filter-menu-keys.js";
|
|
42
53
|
export * from "./mixins/grid-list-keys.js";
|
|
43
54
|
export * from "./mixins/keyboard-help.js";
|
|
55
|
+
export * from "./mixins/log-viewer.js";
|
|
44
56
|
export * from "./mixins/menubar-keys.js";
|
|
45
57
|
export * from "./mixins/optimistic-toggle-sync.js";
|
|
46
58
|
export * from "./mixins/range-picker-keys.js";
|
|
47
59
|
export * from "./mixins/resize-handle.js";
|
|
60
|
+
export * from "./mixins/gantt-today.js";
|
|
48
61
|
export * from "./mixins/row-navigation.js";
|
|
49
62
|
export * from "./mixins/save-bar-sync.js";
|
|
50
63
|
export * from "./mixins/save-shortcut.js";
|
|
@@ -53,14 +66,19 @@ export * from "./mixins/selection-bar-sync.js";
|
|
|
53
66
|
export * from "./mixins/split-view.js";
|
|
54
67
|
export * from "./mixins/status-strip-keys.js";
|
|
55
68
|
export * from "./mixins/submit-on-change.js";
|
|
69
|
+
export * from "./mixins/submit-on-close.js";
|
|
56
70
|
export * from "./mixins/table-selection.js";
|
|
57
71
|
export * from "./mixins/toast-queue.js";
|
|
58
72
|
export * from "./mixins/toast-stack.js";
|
|
59
73
|
export * from "./mixins/tree-keys.js";
|
|
74
|
+
export * from "./mixins/tree-filter.js";
|
|
75
|
+
export { TREE_NAVIGATION_ROW_SELECTOR, treeNavigation } from "./mixins/tree-navigation.js";
|
|
60
76
|
export * from "./optimistic-toggle.js";
|
|
61
77
|
export * from "./page-header.js";
|
|
62
78
|
export * from "./range-picker.js";
|
|
63
79
|
export * from "./resizable.js";
|
|
80
|
+
export * from "./gantt.js";
|
|
81
|
+
export * from "./review-thread.js";
|
|
64
82
|
export * from "./save-bar.js";
|
|
65
83
|
export * from "./save-status.js";
|
|
66
84
|
export * from "./selection-bar.js";
|
|
@@ -76,6 +94,7 @@ export * from "./styles/chart-palette.js";
|
|
|
76
94
|
export * from "./styles/graphic-host.js";
|
|
77
95
|
export * from "./styles/legend-toggle.js";
|
|
78
96
|
export * from "./styles/toast-stack.js";
|
|
97
|
+
export * from "./tab-bar.js";
|
|
79
98
|
export * from "./table.js";
|
|
80
99
|
export * from "./toast.js";
|
|
81
100
|
export * from "./toasts.js";
|
package/dist/app/index.js
CHANGED
|
@@ -15,36 +15,49 @@ export * from "./behaviors/resize-session.js";
|
|
|
15
15
|
export * from "./behaviors/selection-model.js";
|
|
16
16
|
export * from "./behaviors/shortcuts.js";
|
|
17
17
|
export * from "./behaviors/toaster.js";
|
|
18
|
+
export * from "./board.js";
|
|
18
19
|
export * from "./chart.js";
|
|
20
|
+
export * from "./check-runs.js";
|
|
21
|
+
export * from "./code-view.js";
|
|
19
22
|
export * from "./command-palette.js";
|
|
20
23
|
export * from "./context-menu.js";
|
|
24
|
+
export * from "./contribution-graph.js";
|
|
21
25
|
export * from "./danger-zone.js";
|
|
22
26
|
export * from "./detail-sheet.js";
|
|
27
|
+
export * from "./diff.js";
|
|
23
28
|
export * from "./drop-indicator.js";
|
|
24
29
|
export * from "./drop-zone.js";
|
|
25
30
|
export * from "./editor-layout.js";
|
|
26
31
|
export * from "./empty.js";
|
|
27
32
|
export * from "./file-trigger.js";
|
|
28
33
|
export * from "./filter-bar.js";
|
|
34
|
+
export * from "./filter-menu.js";
|
|
29
35
|
export * from "./grid-list.js";
|
|
30
36
|
export * from "./keyboard-help.js";
|
|
37
|
+
export * from "./log-viewer.js";
|
|
31
38
|
export * from "./menubar.js";
|
|
39
|
+
export * from "./merge-box.js";
|
|
32
40
|
export * from "./mixins/app-shell-controls.js";
|
|
33
41
|
export * from "./mixins/auto-refresh.js";
|
|
34
42
|
export * from "./mixins/chart-tooltip.js";
|
|
43
|
+
export { CODE_VIEW_LIVE_ATTRIBUTE, CODE_VIEW_MENU_ATTRIBUTE, CODE_VIEW_SELECTED_ATTRIBUTE, CODE_VIEW_SELECTOR, codeViewSelection, } from "./mixins/code-view-selection.js";
|
|
35
44
|
export * from "./mixins/command-palette.js";
|
|
36
45
|
export * from "./mixins/context-menu.js";
|
|
46
|
+
export * from "./mixins/contribution-graph-keys.js";
|
|
37
47
|
export * from "./mixins/copy-permalink.js";
|
|
38
48
|
export * from "./mixins/detail-sheet-keys.js";
|
|
39
49
|
export * from "./mixins/drag-reorder.js";
|
|
40
50
|
export * from "./mixins/drop-zone.js";
|
|
41
51
|
export * from "./mixins/escape-link.js";
|
|
52
|
+
export * from "./mixins/filter-menu-keys.js";
|
|
42
53
|
export * from "./mixins/grid-list-keys.js";
|
|
43
54
|
export * from "./mixins/keyboard-help.js";
|
|
55
|
+
export * from "./mixins/log-viewer.js";
|
|
44
56
|
export * from "./mixins/menubar-keys.js";
|
|
45
57
|
export * from "./mixins/optimistic-toggle-sync.js";
|
|
46
58
|
export * from "./mixins/range-picker-keys.js";
|
|
47
59
|
export * from "./mixins/resize-handle.js";
|
|
60
|
+
export * from "./mixins/gantt-today.js";
|
|
48
61
|
export * from "./mixins/row-navigation.js";
|
|
49
62
|
export * from "./mixins/save-bar-sync.js";
|
|
50
63
|
export * from "./mixins/save-shortcut.js";
|
|
@@ -53,14 +66,19 @@ export * from "./mixins/selection-bar-sync.js";
|
|
|
53
66
|
export * from "./mixins/split-view.js";
|
|
54
67
|
export * from "./mixins/status-strip-keys.js";
|
|
55
68
|
export * from "./mixins/submit-on-change.js";
|
|
69
|
+
export * from "./mixins/submit-on-close.js";
|
|
56
70
|
export * from "./mixins/table-selection.js";
|
|
57
71
|
export * from "./mixins/toast-queue.js";
|
|
58
72
|
export * from "./mixins/toast-stack.js";
|
|
59
73
|
export * from "./mixins/tree-keys.js";
|
|
74
|
+
export * from "./mixins/tree-filter.js";
|
|
75
|
+
export { TREE_NAVIGATION_ROW_SELECTOR, treeNavigation } from "./mixins/tree-navigation.js";
|
|
60
76
|
export * from "./optimistic-toggle.js";
|
|
61
77
|
export * from "./page-header.js";
|
|
62
78
|
export * from "./range-picker.js";
|
|
63
79
|
export * from "./resizable.js";
|
|
80
|
+
export * from "./gantt.js";
|
|
81
|
+
export * from "./review-thread.js";
|
|
64
82
|
export * from "./save-bar.js";
|
|
65
83
|
export * from "./save-status.js";
|
|
66
84
|
export * from "./selection-bar.js";
|
|
@@ -76,6 +94,7 @@ export * from "./styles/chart-palette.js";
|
|
|
76
94
|
export * from "./styles/graphic-host.js";
|
|
77
95
|
export * from "./styles/legend-toggle.js";
|
|
78
96
|
export * from "./styles/toast-stack.js";
|
|
97
|
+
export * from "./tab-bar.js";
|
|
79
98
|
export * from "./table.js";
|
|
80
99
|
export * from "./toast.js";
|
|
81
100
|
export * from "./toasts.js";
|