@hanzo/ui 8.29.21 → 8.29.22
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/dist/gallery.html +1 -1
- package/dist/marketing/heat.cjs +159 -0
- package/dist/marketing/heat.d.ts +73 -0
- package/dist/marketing/heat.d.ts.map +1 -0
- package/dist/marketing/heat.js +150 -0
- package/dist/marketing/heat.js.map +1 -0
- package/dist/marketing/index.cjs +15 -1
- package/dist/marketing/index.d.ts +2 -0
- package/dist/marketing/index.d.ts.map +1 -1
- package/dist/marketing/index.js +2 -0
- package/dist/marketing/index.js.map +1 -1
- package/dist/marketing/repo.cjs +72 -0
- package/dist/marketing/repo.d.ts +61 -0
- package/dist/marketing/repo.d.ts.map +1 -0
- package/dist/marketing/repo.js +65 -0
- package/dist/marketing/repo.js.map +1 -0
- package/package.json +1 -1
package/dist/gallery.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.29.
|
|
1
|
+
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.29.22</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
|
|
2
2
|
:root { --hanzo-ui-styles: 1; }
|
|
3
3
|
/* Hanzo Design System — the entry point. Import THIS one file.
|
|
4
4
|
*
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.shade = void 0;
|
|
5
|
+
exports.span = span;
|
|
6
|
+
exports.cuts = cuts;
|
|
7
|
+
exports.weeks = weeks;
|
|
8
|
+
exports.monthLabels = monthLabels;
|
|
9
|
+
exports.Heatmap = Heatmap;
|
|
10
|
+
exports.Sparkline = Sparkline;
|
|
11
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* A year of days as one grid, and a run of values as one line of bars.
|
|
14
|
+
*
|
|
15
|
+
* Heatmap a count a day over a window, a week a column, four shades; the
|
|
16
|
+
* day under the pointer is named in the line beneath
|
|
17
|
+
* Sparkline a run of values as bars, tallest to the height given
|
|
18
|
+
*
|
|
19
|
+
* Both take their data as props and fetch nothing: a figure the caller does not
|
|
20
|
+
* hold is not passed, and a grid with no count in it draws nothing. The shades
|
|
21
|
+
* are the ink at a share of its strength, so the grid retunes with the theme,
|
|
22
|
+
* and four of them are cut at the quartiles of the days that had any count, so
|
|
23
|
+
* it reads the same in a quiet year and a loud one. The grid is wiped into place
|
|
24
|
+
* once, the first time it is seen, and stands drawn for a reader who wants no
|
|
25
|
+
* motion (`reveal`).
|
|
26
|
+
*/
|
|
27
|
+
const react_1 = require("react");
|
|
28
|
+
const gui_1 = require("@hanzo/gui");
|
|
29
|
+
const slot_1 = require("../backends/gui/slot.cjs");
|
|
30
|
+
const DAY = 86_400_000;
|
|
31
|
+
const WEEK = 7;
|
|
32
|
+
/** The day, UTC, as `YYYY-MM-DD`. */
|
|
33
|
+
const key = (t) => new Date(t).toISOString().slice(0, 10);
|
|
34
|
+
/** The days of a window, oldest first, `from` and `to` included. */
|
|
35
|
+
function span(from, to) {
|
|
36
|
+
const out = [];
|
|
37
|
+
for (let t = Date.parse(`${from}T00:00:00Z`); t <= Date.parse(`${to}T00:00:00Z`); t += DAY)
|
|
38
|
+
out.push(key(t));
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The three cuts between four shades: the quartiles of the days that had any
|
|
43
|
+
* count. A year with none has nothing to cut.
|
|
44
|
+
*/
|
|
45
|
+
function cuts(days) {
|
|
46
|
+
const counts = Object.values(days)
|
|
47
|
+
.filter((n) => n > 0)
|
|
48
|
+
.sort((a, b) => a - b);
|
|
49
|
+
const at = (q) => counts[Math.min(counts.length - 1, Math.floor(q * counts.length))] ?? 0;
|
|
50
|
+
return [at(0.25), at(0.5), at(0.75)];
|
|
51
|
+
}
|
|
52
|
+
/** The shade a count earns: 0 for none, then 1 to 4 up the quartiles. */
|
|
53
|
+
const shade = (n, cut) => n <= 0 ? 0 : n <= cut[0] ? 1 : n <= cut[1] ? 2 : n <= cut[2] ? 3 : 4;
|
|
54
|
+
exports.shade = shade;
|
|
55
|
+
/** A fill the colour table does not name: a page's own CSS value, which gui emits as written. */
|
|
56
|
+
const fill = (c) => ({ backgroundColor: c });
|
|
57
|
+
/** The ink of each shade, from the page's own so the grid follows the theme. */
|
|
58
|
+
const INK = [
|
|
59
|
+
'var(--muted)',
|
|
60
|
+
'color-mix(in srgb, var(--foreground) 22%, transparent)',
|
|
61
|
+
'color-mix(in srgb, var(--foreground) 42%, transparent)',
|
|
62
|
+
'color-mix(in srgb, var(--foreground) 68%, transparent)',
|
|
63
|
+
'var(--foreground)',
|
|
64
|
+
];
|
|
65
|
+
/** The weeks of a window, Sunday first, with the days outside it kept as unseen cells so the columns stay whole. */
|
|
66
|
+
function weeks(days, from, to) {
|
|
67
|
+
const first = Date.parse(`${from}T00:00:00Z`);
|
|
68
|
+
const last = Date.parse(`${to}T00:00:00Z`);
|
|
69
|
+
const cut = cuts(days);
|
|
70
|
+
const start = first - new Date(first).getUTCDay() * DAY;
|
|
71
|
+
const out = [];
|
|
72
|
+
for (let t = start; t <= last; t += WEEK * DAY) {
|
|
73
|
+
out.push(Array.from({ length: WEEK }, (_, d) => {
|
|
74
|
+
const at = t + d * DAY;
|
|
75
|
+
const count = days[key(at)] ?? 0;
|
|
76
|
+
return {
|
|
77
|
+
day: key(at),
|
|
78
|
+
count,
|
|
79
|
+
level: (0, exports.shade)(count, cut),
|
|
80
|
+
shown: at >= first && at <= last,
|
|
81
|
+
};
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Each week's month label: a month is named over the first week that holds its
|
|
88
|
+
* first seven days, and the window's first column is named too, unless the next
|
|
89
|
+
* month is named within two columns of it and the two would run together.
|
|
90
|
+
*/
|
|
91
|
+
function monthLabels(grid, from, locale) {
|
|
92
|
+
const name = (day) => new Date(`${day}T00:00:00Z`).toLocaleDateString(locale, {
|
|
93
|
+
timeZone: 'UTC',
|
|
94
|
+
month: 'short',
|
|
95
|
+
});
|
|
96
|
+
const labels = grid.map((w, i) => {
|
|
97
|
+
const first = w.find((c) => c.shown)?.day ?? from;
|
|
98
|
+
return i === 0 || Number(first.slice(8, 10)) <= 7 ? name(first) : '';
|
|
99
|
+
});
|
|
100
|
+
const next = labels.findIndex((l, i) => i > 0 && l);
|
|
101
|
+
if (labels[0] && next > 0 && next < 3)
|
|
102
|
+
labels[0] = '';
|
|
103
|
+
return labels;
|
|
104
|
+
}
|
|
105
|
+
/** The least width a week's column may be drawn at: a cell is nine pixels and a gap three. */
|
|
106
|
+
const CELL = 12;
|
|
107
|
+
const still = () => typeof matchMedia === 'function' &&
|
|
108
|
+
matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
109
|
+
function Heatmap({ days, from, to, label, line, rest, legend, locale, reveal = true, }) {
|
|
110
|
+
const grid = (0, react_1.useMemo)(() => weeks(days, from, to), [days, from, to]);
|
|
111
|
+
const [at, setAt] = (0, react_1.useState)(null);
|
|
112
|
+
// The container is watched and the grid inside it is wiped: a grid clipped to nothing is never seen to intersect.
|
|
113
|
+
const box = (0, react_1.useRef)(null);
|
|
114
|
+
const wipe = (0, react_1.useRef)(null);
|
|
115
|
+
// A narrow screen scrolls the year sideways, and starts at its newest week.
|
|
116
|
+
(0, react_1.useEffect)(() => {
|
|
117
|
+
const el = wipe.current;
|
|
118
|
+
if (el)
|
|
119
|
+
el.scrollLeft = el.scrollWidth;
|
|
120
|
+
}, [days, from, to]);
|
|
121
|
+
// The grid waits fully clipped from its first frame, so it needs no style of its own to hide it,
|
|
122
|
+
// and plays when it is first seen. Where animation or observation is missing it stays drawn.
|
|
123
|
+
(0, react_1.useEffect)(() => {
|
|
124
|
+
const el = wipe.current;
|
|
125
|
+
const watched = box.current;
|
|
126
|
+
if (!reveal ||
|
|
127
|
+
!el ||
|
|
128
|
+
!watched ||
|
|
129
|
+
typeof el.animate !== 'function' ||
|
|
130
|
+
typeof IntersectionObserver === 'undefined' ||
|
|
131
|
+
still())
|
|
132
|
+
return;
|
|
133
|
+
const a = el.animate([{ clipPath: 'inset(0 100% 0 0)' }, { clipPath: 'inset(0 0 0 0)' }], { duration: 1100, easing: 'cubic-bezier(0.2, 0.7, 0.2, 1)', fill: 'both' });
|
|
134
|
+
a.pause();
|
|
135
|
+
const io = new IntersectionObserver(([e]) => {
|
|
136
|
+
if (!e?.isIntersecting)
|
|
137
|
+
return;
|
|
138
|
+
a.play();
|
|
139
|
+
io.disconnect();
|
|
140
|
+
}, { threshold: 0.3 });
|
|
141
|
+
io.observe(watched);
|
|
142
|
+
return () => {
|
|
143
|
+
io.disconnect();
|
|
144
|
+
a.cancel();
|
|
145
|
+
};
|
|
146
|
+
}, [reveal]);
|
|
147
|
+
if (!Object.values(days).some((n) => n > 0))
|
|
148
|
+
return null;
|
|
149
|
+
const columns = `repeat(${grid.length}, minmax(0, 1fr))`;
|
|
150
|
+
const named = at && at >= from && at <= to ? at : null;
|
|
151
|
+
const months = monthLabels(grid, from, locale);
|
|
152
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: 14, ...(0, slot_1.slot)('heatmap'), children: [(0, jsx_runtime_1.jsx)(gui_1.View, { ref: box, children: (0, jsx_runtime_1.jsx)(gui_1.View, { ref: wipe, overflowX: "auto", children: (0, jsx_runtime_1.jsxs)(gui_1.View, { minW: grid.length * CELL, children: [(0, jsx_runtime_1.jsx)(gui_1.View, { display: "grid", gridTemplateColumns: columns, gap: 3, pb: 6, "aria-hidden": true, children: months.map((m, i) => ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", lineHeight: "$1", color: "var(--muted-foreground)", whiteSpace: "nowrap", overflow: "visible", children: m }, i))) }), (0, jsx_runtime_1.jsx)(gui_1.View, { role: "img", "aria-label": label, display: "grid", gridTemplateColumns: columns, gridTemplateRows: "repeat(7, auto)", gap: 3, gridAutoFlow: "column", onPointerMove: (e) => setAt(e.target.dataset?.day ?? null), onPointerLeave: () => setAt(null), children: grid.flat().map((c) => ((0, jsx_runtime_1.jsx)(gui_1.View, { "data-day": c.shown ? c.day : undefined, aspectRatio: 1, rounded: 2, opacity: c.shown ? 1 : 0, ...fill(INK[c.level]) }, c.day))) })] }) }) }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { justify: "space-between", items: "center", flexWrap: "wrap", gap: 12, children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", lineHeight: "$1", color: "var(--muted-foreground)", "aria-live": "polite", ...(0, slot_1.slot)('heatmap-line'), children: named && line ? line(named, days[named] ?? 0) : rest }), legend ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: 6, "aria-hidden": true, children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", children: legend.less }), INK.map((s) => ((0, jsx_runtime_1.jsx)(gui_1.View, { width: 11, height: 11, rounded: 2, ...fill(s) }, s))), (0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", children: legend.more })] })) : null] })] }));
|
|
153
|
+
}
|
|
154
|
+
function Sparkline({ values, label, height = 40 }) {
|
|
155
|
+
const top = Math.max(0, ...values);
|
|
156
|
+
if (!values.length || top <= 0)
|
|
157
|
+
return null;
|
|
158
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { role: "img", "aria-label": label, items: "flex-end", gap: 2, height: height, ...(0, slot_1.slot)('sparkline'), children: values.map((v, i) => ((0, jsx_runtime_1.jsx)(gui_1.View, { flex: 1, minW: 1, height: (v > 0 ? `${Math.max(4, (100 * v) / top)}%` : 1), rounded: 1, ...fill(v > 0 ? 'var(--foreground)' : 'var(--muted)') }, i))) }));
|
|
159
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A year of days as one grid, and a run of values as one line of bars.
|
|
3
|
+
*
|
|
4
|
+
* Heatmap a count a day over a window, a week a column, four shades; the
|
|
5
|
+
* day under the pointer is named in the line beneath
|
|
6
|
+
* Sparkline a run of values as bars, tallest to the height given
|
|
7
|
+
*
|
|
8
|
+
* Both take their data as props and fetch nothing: a figure the caller does not
|
|
9
|
+
* hold is not passed, and a grid with no count in it draws nothing. The shades
|
|
10
|
+
* are the ink at a share of its strength, so the grid retunes with the theme,
|
|
11
|
+
* and four of them are cut at the quartiles of the days that had any count, so
|
|
12
|
+
* it reads the same in a quiet year and a loud one. The grid is wiped into place
|
|
13
|
+
* once, the first time it is seen, and stands drawn for a reader who wants no
|
|
14
|
+
* motion (`reveal`).
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactNode } from 'react';
|
|
17
|
+
/** The days of a window, oldest first, `from` and `to` included. */
|
|
18
|
+
export declare function span(from: string, to: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* The three cuts between four shades: the quartiles of the days that had any
|
|
21
|
+
* count. A year with none has nothing to cut.
|
|
22
|
+
*/
|
|
23
|
+
export declare function cuts(days: Record<string, number>): [number, number, number];
|
|
24
|
+
/** The shade a count earns: 0 for none, then 1 to 4 up the quartiles. */
|
|
25
|
+
export declare const shade: (n: number, cut: readonly [number, number, number]) => 0 | 1 | 2 | 3 | 4;
|
|
26
|
+
type Cell = {
|
|
27
|
+
day: string;
|
|
28
|
+
count: number;
|
|
29
|
+
level: number;
|
|
30
|
+
shown: boolean;
|
|
31
|
+
};
|
|
32
|
+
/** The weeks of a window, Sunday first, with the days outside it kept as unseen cells so the columns stay whole. */
|
|
33
|
+
export declare function weeks(days: Record<string, number>, from: string, to: string): Cell[][];
|
|
34
|
+
/**
|
|
35
|
+
* Each week's month label: a month is named over the first week that holds its
|
|
36
|
+
* first seven days, and the window's first column is named too, unless the next
|
|
37
|
+
* month is named within two columns of it and the two would run together.
|
|
38
|
+
*/
|
|
39
|
+
export declare function monthLabels(grid: Cell[][], from: string, locale?: string): string[];
|
|
40
|
+
export type HeatmapProps = {
|
|
41
|
+
/** The count of each day, keyed `YYYY-MM-DD`; a day not named had none. */
|
|
42
|
+
days: Record<string, number>;
|
|
43
|
+
/** The first and last day shown, inclusive. */
|
|
44
|
+
from: string;
|
|
45
|
+
to: string;
|
|
46
|
+
/** What the grid says to a reader who cannot see it. */
|
|
47
|
+
label: string;
|
|
48
|
+
/** The line for the day under the pointer. */
|
|
49
|
+
line?: (day: string, count: number) => ReactNode;
|
|
50
|
+
/** The line when no day is under the pointer. */
|
|
51
|
+
rest?: ReactNode;
|
|
52
|
+
/** The two ends of the legend; with none the legend is not drawn. */
|
|
53
|
+
legend?: {
|
|
54
|
+
less: ReactNode;
|
|
55
|
+
more: ReactNode;
|
|
56
|
+
};
|
|
57
|
+
/** The language month names are written in; the reader's by default. */
|
|
58
|
+
locale?: string;
|
|
59
|
+
/** Wipe the grid in the first time it is seen. */
|
|
60
|
+
reveal?: boolean;
|
|
61
|
+
};
|
|
62
|
+
export declare function Heatmap({ days, from, to, label, line, rest, legend, locale, reveal, }: HeatmapProps): import("react").JSX.Element | null;
|
|
63
|
+
export type SparklineProps = {
|
|
64
|
+
/** The values, oldest first. */
|
|
65
|
+
values: readonly number[];
|
|
66
|
+
/** What the bars say to a reader who cannot see them. */
|
|
67
|
+
label: string;
|
|
68
|
+
/** The height of the tallest bar, in px. */
|
|
69
|
+
height?: number;
|
|
70
|
+
};
|
|
71
|
+
export declare function Sparkline({ values, label, height }: SparklineProps): import("react").JSX.Element | null;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=heat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAA;IAChD,iDAAiD;IACjD,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,qEAAqE;IACrE,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE,CAAA;IAC7C,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AASD,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,IAAI,EACJ,EAAE,EACF,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,EACN,MAAa,GACd,EAAE,YAAY,sCA4Id;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,gCAAgC;IAChC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAW,EAAE,EAAE,cAAc,sCAwBvE"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* A year of days as one grid, and a run of values as one line of bars.
|
|
5
|
+
*
|
|
6
|
+
* Heatmap a count a day over a window, a week a column, four shades; the
|
|
7
|
+
* day under the pointer is named in the line beneath
|
|
8
|
+
* Sparkline a run of values as bars, tallest to the height given
|
|
9
|
+
*
|
|
10
|
+
* Both take their data as props and fetch nothing: a figure the caller does not
|
|
11
|
+
* hold is not passed, and a grid with no count in it draws nothing. The shades
|
|
12
|
+
* are the ink at a share of its strength, so the grid retunes with the theme,
|
|
13
|
+
* and four of them are cut at the quartiles of the days that had any count, so
|
|
14
|
+
* it reads the same in a quiet year and a loud one. The grid is wiped into place
|
|
15
|
+
* once, the first time it is seen, and stands drawn for a reader who wants no
|
|
16
|
+
* motion (`reveal`).
|
|
17
|
+
*/
|
|
18
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
+
import { Text, View, XStack, YStack } from '@hanzo/gui';
|
|
20
|
+
import { slot } from '../backends/gui/slot.js';
|
|
21
|
+
const DAY = 86_400_000;
|
|
22
|
+
const WEEK = 7;
|
|
23
|
+
/** The day, UTC, as `YYYY-MM-DD`. */
|
|
24
|
+
const key = (t) => new Date(t).toISOString().slice(0, 10);
|
|
25
|
+
/** The days of a window, oldest first, `from` and `to` included. */
|
|
26
|
+
export function span(from, to) {
|
|
27
|
+
const out = [];
|
|
28
|
+
for (let t = Date.parse(`${from}T00:00:00Z`); t <= Date.parse(`${to}T00:00:00Z`); t += DAY)
|
|
29
|
+
out.push(key(t));
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The three cuts between four shades: the quartiles of the days that had any
|
|
34
|
+
* count. A year with none has nothing to cut.
|
|
35
|
+
*/
|
|
36
|
+
export function cuts(days) {
|
|
37
|
+
const counts = Object.values(days)
|
|
38
|
+
.filter((n) => n > 0)
|
|
39
|
+
.sort((a, b) => a - b);
|
|
40
|
+
const at = (q) => counts[Math.min(counts.length - 1, Math.floor(q * counts.length))] ?? 0;
|
|
41
|
+
return [at(0.25), at(0.5), at(0.75)];
|
|
42
|
+
}
|
|
43
|
+
/** The shade a count earns: 0 for none, then 1 to 4 up the quartiles. */
|
|
44
|
+
export const shade = (n, cut) => n <= 0 ? 0 : n <= cut[0] ? 1 : n <= cut[1] ? 2 : n <= cut[2] ? 3 : 4;
|
|
45
|
+
/** A fill the colour table does not name: a page's own CSS value, which gui emits as written. */
|
|
46
|
+
const fill = (c) => ({ backgroundColor: c });
|
|
47
|
+
/** The ink of each shade, from the page's own so the grid follows the theme. */
|
|
48
|
+
const INK = [
|
|
49
|
+
'var(--muted)',
|
|
50
|
+
'color-mix(in srgb, var(--foreground) 22%, transparent)',
|
|
51
|
+
'color-mix(in srgb, var(--foreground) 42%, transparent)',
|
|
52
|
+
'color-mix(in srgb, var(--foreground) 68%, transparent)',
|
|
53
|
+
'var(--foreground)',
|
|
54
|
+
];
|
|
55
|
+
/** The weeks of a window, Sunday first, with the days outside it kept as unseen cells so the columns stay whole. */
|
|
56
|
+
export function weeks(days, from, to) {
|
|
57
|
+
const first = Date.parse(`${from}T00:00:00Z`);
|
|
58
|
+
const last = Date.parse(`${to}T00:00:00Z`);
|
|
59
|
+
const cut = cuts(days);
|
|
60
|
+
const start = first - new Date(first).getUTCDay() * DAY;
|
|
61
|
+
const out = [];
|
|
62
|
+
for (let t = start; t <= last; t += WEEK * DAY) {
|
|
63
|
+
out.push(Array.from({ length: WEEK }, (_, d) => {
|
|
64
|
+
const at = t + d * DAY;
|
|
65
|
+
const count = days[key(at)] ?? 0;
|
|
66
|
+
return {
|
|
67
|
+
day: key(at),
|
|
68
|
+
count,
|
|
69
|
+
level: shade(count, cut),
|
|
70
|
+
shown: at >= first && at <= last,
|
|
71
|
+
};
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Each week's month label: a month is named over the first week that holds its
|
|
78
|
+
* first seven days, and the window's first column is named too, unless the next
|
|
79
|
+
* month is named within two columns of it and the two would run together.
|
|
80
|
+
*/
|
|
81
|
+
export function monthLabels(grid, from, locale) {
|
|
82
|
+
const name = (day) => new Date(`${day}T00:00:00Z`).toLocaleDateString(locale, {
|
|
83
|
+
timeZone: 'UTC',
|
|
84
|
+
month: 'short',
|
|
85
|
+
});
|
|
86
|
+
const labels = grid.map((w, i) => {
|
|
87
|
+
const first = w.find((c) => c.shown)?.day ?? from;
|
|
88
|
+
return i === 0 || Number(first.slice(8, 10)) <= 7 ? name(first) : '';
|
|
89
|
+
});
|
|
90
|
+
const next = labels.findIndex((l, i) => i > 0 && l);
|
|
91
|
+
if (labels[0] && next > 0 && next < 3)
|
|
92
|
+
labels[0] = '';
|
|
93
|
+
return labels;
|
|
94
|
+
}
|
|
95
|
+
/** The least width a week's column may be drawn at: a cell is nine pixels and a gap three. */
|
|
96
|
+
const CELL = 12;
|
|
97
|
+
const still = () => typeof matchMedia === 'function' &&
|
|
98
|
+
matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
99
|
+
export function Heatmap({ days, from, to, label, line, rest, legend, locale, reveal = true, }) {
|
|
100
|
+
const grid = useMemo(() => weeks(days, from, to), [days, from, to]);
|
|
101
|
+
const [at, setAt] = useState(null);
|
|
102
|
+
// The container is watched and the grid inside it is wiped: a grid clipped to nothing is never seen to intersect.
|
|
103
|
+
const box = useRef(null);
|
|
104
|
+
const wipe = useRef(null);
|
|
105
|
+
// A narrow screen scrolls the year sideways, and starts at its newest week.
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
const el = wipe.current;
|
|
108
|
+
if (el)
|
|
109
|
+
el.scrollLeft = el.scrollWidth;
|
|
110
|
+
}, [days, from, to]);
|
|
111
|
+
// The grid waits fully clipped from its first frame, so it needs no style of its own to hide it,
|
|
112
|
+
// and plays when it is first seen. Where animation or observation is missing it stays drawn.
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
const el = wipe.current;
|
|
115
|
+
const watched = box.current;
|
|
116
|
+
if (!reveal ||
|
|
117
|
+
!el ||
|
|
118
|
+
!watched ||
|
|
119
|
+
typeof el.animate !== 'function' ||
|
|
120
|
+
typeof IntersectionObserver === 'undefined' ||
|
|
121
|
+
still())
|
|
122
|
+
return;
|
|
123
|
+
const a = el.animate([{ clipPath: 'inset(0 100% 0 0)' }, { clipPath: 'inset(0 0 0 0)' }], { duration: 1100, easing: 'cubic-bezier(0.2, 0.7, 0.2, 1)', fill: 'both' });
|
|
124
|
+
a.pause();
|
|
125
|
+
const io = new IntersectionObserver(([e]) => {
|
|
126
|
+
if (!e?.isIntersecting)
|
|
127
|
+
return;
|
|
128
|
+
a.play();
|
|
129
|
+
io.disconnect();
|
|
130
|
+
}, { threshold: 0.3 });
|
|
131
|
+
io.observe(watched);
|
|
132
|
+
return () => {
|
|
133
|
+
io.disconnect();
|
|
134
|
+
a.cancel();
|
|
135
|
+
};
|
|
136
|
+
}, [reveal]);
|
|
137
|
+
if (!Object.values(days).some((n) => n > 0))
|
|
138
|
+
return null;
|
|
139
|
+
const columns = `repeat(${grid.length}, minmax(0, 1fr))`;
|
|
140
|
+
const named = at && at >= from && at <= to ? at : null;
|
|
141
|
+
const months = monthLabels(grid, from, locale);
|
|
142
|
+
return (_jsxs(YStack, { gap: 14, ...slot('heatmap'), children: [_jsx(View, { ref: box, children: _jsx(View, { ref: wipe, overflowX: "auto", children: _jsxs(View, { minW: grid.length * CELL, children: [_jsx(View, { display: "grid", gridTemplateColumns: columns, gap: 3, pb: 6, "aria-hidden": true, children: months.map((m, i) => (_jsx(Text, { fontFamily: "$mono", fontSize: "$1", lineHeight: "$1", color: "var(--muted-foreground)", whiteSpace: "nowrap", overflow: "visible", children: m }, i))) }), _jsx(View, { role: "img", "aria-label": label, display: "grid", gridTemplateColumns: columns, gridTemplateRows: "repeat(7, auto)", gap: 3, gridAutoFlow: "column", onPointerMove: (e) => setAt(e.target.dataset?.day ?? null), onPointerLeave: () => setAt(null), children: grid.flat().map((c) => (_jsx(View, { "data-day": c.shown ? c.day : undefined, aspectRatio: 1, rounded: 2, opacity: c.shown ? 1 : 0, ...fill(INK[c.level]) }, c.day))) })] }) }) }), _jsxs(XStack, { justify: "space-between", items: "center", flexWrap: "wrap", gap: 12, children: [_jsx(Text, { fontFamily: "$mono", fontSize: "$1", lineHeight: "$1", color: "var(--muted-foreground)", "aria-live": "polite", ...slot('heatmap-line'), children: named && line ? line(named, days[named] ?? 0) : rest }), legend ? (_jsxs(XStack, { items: "center", gap: 6, "aria-hidden": true, children: [_jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", children: legend.less }), INK.map((s) => (_jsx(View, { width: 11, height: 11, rounded: 2, ...fill(s) }, s))), _jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", children: legend.more })] })) : null] })] }));
|
|
143
|
+
}
|
|
144
|
+
export function Sparkline({ values, label, height = 40 }) {
|
|
145
|
+
const top = Math.max(0, ...values);
|
|
146
|
+
if (!values.length || top <= 0)
|
|
147
|
+
return null;
|
|
148
|
+
return (_jsx(XStack, { role: "img", "aria-label": label, items: "flex-end", gap: 2, height: height, ...slot('sparkline'), children: values.map((v, i) => (_jsx(View, { flex: 1, minW: 1, height: (v > 0 ? `${Math.max(4, (100 * v) / top)}%` : 1), rounded: 1, ...fill(v > 0 ? 'var(--foreground)' : 'var(--muted)') }, i))) }));
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=heat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heat.js","sourceRoot":"","sources":["../../src/marketing/heat.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAC5E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,MAAM,GAAG,GAAG,UAAU,CAAA;AACtB,MAAM,IAAI,GAAG,CAAC,CAAA;AAEd,qCAAqC;AACrC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAEjE,oEAAoE;AACpE,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,EAAU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IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAA;IAClC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAC3C,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAC,KAAK,gBACE,KAAK,EACjB,KAAK,EAAC,UAAU,EAChB,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,MAAM,KACV,IAAI,CAAC,WAAW,CAAC,YAEpB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACpB,KAAC,IAAI,IAEH,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAU,EACjE,OAAO,EAAE,CAAC,KACN,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,cAAc,CAAC,IALjD,CAAC,CAMN,CACH,CAAC,GACK,CACV,CAAA;AACH,CAAC"}
|
package/dist/marketing/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FeatureGrid = exports.Feature = exports.Section = exports.PageHeader = exports.initials = exports.Repo = exports.Languages = exports.Faces = exports.Counts = exports.weeks = exports.span = exports.shade = exports.cuts = exports.Sparkline = exports.Heatmap = exports.Run = exports.Document = exports.Pager = exports.Pair = exports.Lattice = exports.Reveal = exports.Lift = exports.Cell = exports.Leaf = exports.More = exports.Chip = exports.Action = exports.Claim = exports.Lede = exports.Eyebrow = exports.Title = exports.Display = exports.Line = exports.TextLink = exports.Cta = exports.ClosingCta = exports.Faq = exports.Footer = exports.way = exports.termOf = exports.seats = exports.saving = exports.money = exports.merged = exports.charge = exports.audience = exports.Plans = exports.Media = exports.Hero = exports.PageLoading = void 0;
|
|
4
|
+
exports.LogoRow = exports.Quote = exports.Steps = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* The marketing surface every Hanzo, Lux and Zoo site shares: the first screen,
|
|
6
7
|
* the plans, the questions, the closing call and the blocks a feature page is
|
|
@@ -57,6 +58,19 @@ var document_1 = require("./document.cjs");
|
|
|
57
58
|
Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return document_1.Document; } });
|
|
58
59
|
var run_1 = require("./run.cjs");
|
|
59
60
|
Object.defineProperty(exports, "Run", { enumerable: true, get: function () { return run_1.Run; } });
|
|
61
|
+
var heat_1 = require("./heat.cjs");
|
|
62
|
+
Object.defineProperty(exports, "Heatmap", { enumerable: true, get: function () { return heat_1.Heatmap; } });
|
|
63
|
+
Object.defineProperty(exports, "Sparkline", { enumerable: true, get: function () { return heat_1.Sparkline; } });
|
|
64
|
+
Object.defineProperty(exports, "cuts", { enumerable: true, get: function () { return heat_1.cuts; } });
|
|
65
|
+
Object.defineProperty(exports, "shade", { enumerable: true, get: function () { return heat_1.shade; } });
|
|
66
|
+
Object.defineProperty(exports, "span", { enumerable: true, get: function () { return heat_1.span; } });
|
|
67
|
+
Object.defineProperty(exports, "weeks", { enumerable: true, get: function () { return heat_1.weeks; } });
|
|
68
|
+
var repo_1 = require("./repo.cjs");
|
|
69
|
+
Object.defineProperty(exports, "Counts", { enumerable: true, get: function () { return repo_1.Counts; } });
|
|
70
|
+
Object.defineProperty(exports, "Faces", { enumerable: true, get: function () { return repo_1.Faces; } });
|
|
71
|
+
Object.defineProperty(exports, "Languages", { enumerable: true, get: function () { return repo_1.Languages; } });
|
|
72
|
+
Object.defineProperty(exports, "Repo", { enumerable: true, get: function () { return repo_1.Repo; } });
|
|
73
|
+
Object.defineProperty(exports, "initials", { enumerable: true, get: function () { return repo_1.initials; } });
|
|
60
74
|
var blocks_1 = require("./blocks.cjs");
|
|
61
75
|
Object.defineProperty(exports, "PageHeader", { enumerable: true, get: function () { return blocks_1.PageHeader; } });
|
|
62
76
|
Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return blocks_1.Section; } });
|
|
@@ -19,5 +19,7 @@ export { Pair, type PairProps } from './pair.js';
|
|
|
19
19
|
export { Pager, type PagerProps } from './pager.js';
|
|
20
20
|
export { Document, type DocumentProps } from './document.js';
|
|
21
21
|
export { Run, type RunProps } from './run.js';
|
|
22
|
+
export { Heatmap, Sparkline, cuts, shade, span, weeks, type HeatmapProps, type SparklineProps } from './heat.js';
|
|
23
|
+
export { Counts, Faces, Languages, Repo, initials, type CountsProps, type FacesProps, type LanguagesProps, type RepoProps } from './repo.js';
|
|
22
24
|
export { PageHeader, Section, Feature, FeatureGrid, Steps, Quote, LogoRow, type Step, type Logo, type PageHeaderProps, type SectionProps, type FeatureProps, type QuoteProps, } from './blocks.js';
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/marketing/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,OAA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AE,IAAI,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AACnG,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAA;AAC7G,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AACzI,OAAO,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,WAAW,EACX,KAAK,EACL,KAAK,EACL,OAAO,EACP,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,GAChB,MAAM,UAAU,CAAA"}
|
package/dist/marketing/index.js
CHANGED
|
@@ -19,5 +19,7 @@ export { Pair } from './pair.js';
|
|
|
19
19
|
export { Pager } from './pager.js';
|
|
20
20
|
export { Document } from './document.js';
|
|
21
21
|
export { Run } from './run.js';
|
|
22
|
+
export { Heatmap, Sparkline, cuts, shade, span, weeks } from './heat.js';
|
|
23
|
+
export { Counts, Faces, Languages, Repo, initials } from './repo.js';
|
|
22
24
|
export { PageHeader, Section, Feature, FeatureGrid, Steps, Quote, LogoRow, } from './blocks.js';
|
|
23
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/marketing/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAmB,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,KAAK,EAAoC,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAwD,MAAM,QAAQ,CAAA;AAC1I,OAAO,EAAE,MAAM,EAAwD,MAAM,UAAU,CAAA;AACvF,OAAO,EAAE,GAAG,EAA+B,MAAM,OAAO,CAAA;AACxD,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAqC,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgE,MAAM,QAAQ,CAAA;AACjI,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAqB,MAAM,YAAY,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAwC,MAAM,WAAW,CAAA;AACnG,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAmB,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,GAAG,EAAiB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AiB,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAA0C,MAAM,QAAQ,CAAA;AAC7G,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAA0E,MAAM,QAAQ,CAAA;AACzI,OAAO,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,WAAW,EACX,KAAK,EACL,KAAK,EACL,OAAO,GAOR,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.initials = void 0;
|
|
5
|
+
exports.Counts = Counts;
|
|
6
|
+
exports.Repo = Repo;
|
|
7
|
+
exports.Languages = Languages;
|
|
8
|
+
exports.Faces = Faces;
|
|
9
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
|
+
const gui_1 = require("@hanzo/gui");
|
|
11
|
+
const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
12
|
+
const slot_1 = require("../backends/gui/slot.cjs");
|
|
13
|
+
/** A fill the colour table does not name: a page's own CSS value, which gui emits as written. */
|
|
14
|
+
const fill = (c) => ({ backgroundColor: c });
|
|
15
|
+
const group = (n) => n.toLocaleString('en-US');
|
|
16
|
+
const real = (n) => typeof n === 'number' && Number.isFinite(n) && n >= 0;
|
|
17
|
+
function Counts({ stars, forks, size = 'md' }) {
|
|
18
|
+
const icon = size === 'sm' ? 12 : 14;
|
|
19
|
+
const one = (n, mark, name) => ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: 4, ...(0, slot_1.slot)(`count-${name}`), children: [mark, (0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: size === 'sm' ? '$1' : '$2', color: "var(--muted-foreground)", fontVariant: ['tabular-nums'], "aria-label": `${group(n)} ${name}`, children: group(n) })] }, name));
|
|
20
|
+
const shown = [
|
|
21
|
+
real(stars)
|
|
22
|
+
? one(stars, (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Star, { size: icon, color: "var(--muted-foreground)", "aria-hidden": true }), 'stars')
|
|
23
|
+
: null,
|
|
24
|
+
real(forks)
|
|
25
|
+
? one(forks, (0, jsx_runtime_1.jsx)(lucide_icons_2_1.GitFork, { size: icon, color: "var(--muted-foreground)", "aria-hidden": true }), 'forks')
|
|
26
|
+
: null,
|
|
27
|
+
].filter(Boolean);
|
|
28
|
+
if (!shown.length)
|
|
29
|
+
return null;
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { items: "center", gap: 12, ...(0, slot_1.slot)('counts'), children: shown }));
|
|
31
|
+
}
|
|
32
|
+
function Repo({ name, description, href, target, rel, language, tag, stars, forks, actions, }) {
|
|
33
|
+
const linked = href != null;
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('repo'), gap: 10, p: 16, rounded: "var(--radius-xl)", borderWidth: 1, borderColor: "var(--border)", ...fill('var(--surface-card)'), ...(linked
|
|
35
|
+
? { hoverStyle: { borderColor: 'var(--border-strong)' } }
|
|
36
|
+
: null), minW: 0, children: [(0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: 6, grow: 1, shrink: 0, ...(linked
|
|
37
|
+
? {
|
|
38
|
+
render: (0, jsx_runtime_1.jsx)("a", { href: href, target: target, rel: rel }),
|
|
39
|
+
textDecorationLine: 'none',
|
|
40
|
+
}
|
|
41
|
+
: null), children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: "$2", fontWeight: "600", color: "var(--foreground)", numberOfLines: 1, "data-i18n-ltr": "", children: name }), description ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", lineHeight: "$3", color: "var(--muted-foreground)", numberOfLines: 2, minH: 38, children: description })) : null] }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", justify: "space-between", gap: 8, flexWrap: "wrap", children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: 12, children: [language ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", children: language })) : null, tag ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", px: 6, py: 1, rounded: 4, borderWidth: 1, borderColor: "var(--border)", children: tag })) : null, (0, jsx_runtime_1.jsx)(Counts, { stars: stars, forks: forks, size: "sm" })] }), actions] })] }));
|
|
42
|
+
}
|
|
43
|
+
/** Four inks cycle down the shares, so neighbours differ in the page's own monochrome. */
|
|
44
|
+
const SHARE = [
|
|
45
|
+
'var(--foreground)',
|
|
46
|
+
'color-mix(in srgb, var(--foreground) 62%, transparent)',
|
|
47
|
+
'color-mix(in srgb, var(--foreground) 36%, transparent)',
|
|
48
|
+
'color-mix(in srgb, var(--foreground) 18%, transparent)',
|
|
49
|
+
];
|
|
50
|
+
function Languages({ share, label }) {
|
|
51
|
+
const rows = share.filter((s) => s.share > 0);
|
|
52
|
+
const total = rows.reduce((n, s) => n + s.share, 0);
|
|
53
|
+
if (!total)
|
|
54
|
+
return null;
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: 8, ...(0, slot_1.slot)('languages'), children: [(0, jsx_runtime_1.jsx)(gui_1.XStack, { role: "img", "aria-label": label, height: 8, rounded: 9999, overflow: "hidden", gap: 2, children: rows.map((s, i) => ((0, jsx_runtime_1.jsx)(gui_1.View, { height: "100%", width: `${((100 * s.share) / total).toFixed(2)}%`, ...fill(SHARE[i % SHARE.length]) }, s.name))) }), (0, jsx_runtime_1.jsx)(gui_1.XStack, { gap: 14, flexWrap: "wrap", children: rows.map((s, i) => ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: 6, children: [(0, jsx_runtime_1.jsx)(gui_1.View, { width: 8, height: 8, rounded: 9999, ...fill(SHARE[i % SHARE.length]) }), (0, jsx_runtime_1.jsxs)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", children: [s.name, " ", ((100 * s.share) / total).toFixed(1), "%"] })] }, s.name))) })] }));
|
|
56
|
+
}
|
|
57
|
+
/** Up to two initials of a name. */
|
|
58
|
+
const initials = (name) => name
|
|
59
|
+
.trim()
|
|
60
|
+
.split(/\s+/)
|
|
61
|
+
.slice(0, 2)
|
|
62
|
+
.map((w) => Array.from(w)[0] ?? '')
|
|
63
|
+
.join('')
|
|
64
|
+
.toUpperCase();
|
|
65
|
+
exports.initials = initials;
|
|
66
|
+
function Faces({ people, max = 5 }) {
|
|
67
|
+
if (!people.length)
|
|
68
|
+
return null;
|
|
69
|
+
const shown = people.slice(0, max);
|
|
70
|
+
const more = people.length - shown.length;
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", ...(0, slot_1.slot)('faces'), children: [shown.map((p, i) => ((0, jsx_runtime_1.jsx)(gui_1.View, { width: 28, height: 28, rounded: 9999, items: "center", justify: "center", borderWidth: 2, borderColor: "var(--background)", ...fill('var(--secondary)'), marginInlineStart: i ? -8 : 0, title: p.name, children: (0, jsx_runtime_1.jsx)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", fontWeight: "600", color: "var(--foreground)", children: (0, exports.initials)(p.name) }) }, `${p.name}-${i}`))), more > 0 ? ((0, jsx_runtime_1.jsxs)(gui_1.Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", marginInlineStart: 8, children: ["+", group(more)] })) : null] }));
|
|
72
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A repository, and the small counts that describe it.
|
|
3
|
+
*
|
|
4
|
+
* Repo a card: its name, a line on it, its counts and language, and the
|
|
5
|
+
* actions the caller puts at its foot; the whole card is a link when
|
|
6
|
+
* it is given an `href`
|
|
7
|
+
* Counts stars and forks, each with its mark; a count the caller does not
|
|
8
|
+
* hold is not drawn
|
|
9
|
+
* Languages the share of each language as one bar and a legend
|
|
10
|
+
* Faces people as overlapping initials, with the rest counted
|
|
11
|
+
*
|
|
12
|
+
* Each takes its data as props and fetches nothing, draws from tokens, and is a
|
|
13
|
+
* gui element, so one import serves web, native and desktop.
|
|
14
|
+
*/
|
|
15
|
+
import type { ReactNode } from 'react';
|
|
16
|
+
export type CountsProps = {
|
|
17
|
+
stars?: number;
|
|
18
|
+
forks?: number;
|
|
19
|
+
/** The size of the marks and figures. */
|
|
20
|
+
size?: 'sm' | 'md';
|
|
21
|
+
};
|
|
22
|
+
export declare function Counts({ stars, forks, size }: CountsProps): import("react").JSX.Element | null;
|
|
23
|
+
export type RepoProps = {
|
|
24
|
+
/** `owner/name`. */
|
|
25
|
+
name: string;
|
|
26
|
+
description?: ReactNode;
|
|
27
|
+
/** Where the card goes; with none the card is not a link. */
|
|
28
|
+
href?: string;
|
|
29
|
+
target?: string;
|
|
30
|
+
rel?: string;
|
|
31
|
+
language?: ReactNode;
|
|
32
|
+
/** A word that files the repository, in an outline beside the counts. */
|
|
33
|
+
tag?: ReactNode;
|
|
34
|
+
stars?: number;
|
|
35
|
+
forks?: number;
|
|
36
|
+
/** What sits at the card's foot: a star button, a link. */
|
|
37
|
+
actions?: ReactNode;
|
|
38
|
+
};
|
|
39
|
+
export declare function Repo({ name, description, href, target, rel, language, tag, stars, forks, actions, }: RepoProps): import("react").JSX.Element;
|
|
40
|
+
export type LanguagesProps = {
|
|
41
|
+
/** Each language and its share, any scale: the bar is each over the sum. */
|
|
42
|
+
share: readonly {
|
|
43
|
+
name: string;
|
|
44
|
+
share: number;
|
|
45
|
+
}[];
|
|
46
|
+
/** What the bar says to a reader who cannot see it. */
|
|
47
|
+
label: string;
|
|
48
|
+
};
|
|
49
|
+
export declare function Languages({ share, label }: LanguagesProps): import("react").JSX.Element | null;
|
|
50
|
+
export type FacesProps = {
|
|
51
|
+
/** Each person by the name their initials are read from. */
|
|
52
|
+
people: readonly {
|
|
53
|
+
name: string;
|
|
54
|
+
}[];
|
|
55
|
+
/** How many are drawn; the rest are counted. */
|
|
56
|
+
max?: number;
|
|
57
|
+
};
|
|
58
|
+
/** Up to two initials of a name. */
|
|
59
|
+
export declare const initials: (name: string) => string;
|
|
60
|
+
export declare function Faces({ people, max }: FacesProps): import("react").JSX.Element | null;
|
|
61
|
+
//# sourceMappingURL=repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/marketing/repo.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAatC,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yCAAyC;IACzC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAW,EAAE,EAAE,WAAW,sCAsChE;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,yEAAyE;IACzE,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,MAAM,EACN,GAAG,EACH,QAAQ,EACR,GAAG,EACH,KAAK,EACL,KAAK,EACL,OAAO,GACR,EAAE,SAAS,+BAgFX;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,4EAA4E;IAC5E,KAAK,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACjD,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAUD,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,cAAc,sCA4CzD;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,MAAM,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnC,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,oCAAoC;AACpC,eAAO,MAAM,QAAQ,SAAU,MAAM,WAOnB,CAAA;AAElB,wBAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,GAAO,EAAE,EAAE,UAAU,sCA0CpD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Text, View, XStack, YStack } from '@hanzo/gui';
|
|
4
|
+
import { GitFork, Star } from '@hanzogui/lucide-icons-2';
|
|
5
|
+
import { slot } from '../backends/gui/slot.js';
|
|
6
|
+
/** A fill the colour table does not name: a page's own CSS value, which gui emits as written. */
|
|
7
|
+
const fill = (c) => ({ backgroundColor: c });
|
|
8
|
+
const group = (n) => n.toLocaleString('en-US');
|
|
9
|
+
const real = (n) => typeof n === 'number' && Number.isFinite(n) && n >= 0;
|
|
10
|
+
export function Counts({ stars, forks, size = 'md' }) {
|
|
11
|
+
const icon = size === 'sm' ? 12 : 14;
|
|
12
|
+
const one = (n, mark, name) => (_jsxs(XStack, { items: "center", gap: 4, ...slot(`count-${name}`), children: [mark, _jsx(Text, { fontFamily: "$mono", fontSize: size === 'sm' ? '$1' : '$2', color: "var(--muted-foreground)", fontVariant: ['tabular-nums'], "aria-label": `${group(n)} ${name}`, children: group(n) })] }, name));
|
|
13
|
+
const shown = [
|
|
14
|
+
real(stars)
|
|
15
|
+
? one(stars, _jsx(Star, { size: icon, color: "var(--muted-foreground)", "aria-hidden": true }), 'stars')
|
|
16
|
+
: null,
|
|
17
|
+
real(forks)
|
|
18
|
+
? one(forks, _jsx(GitFork, { size: icon, color: "var(--muted-foreground)", "aria-hidden": true }), 'forks')
|
|
19
|
+
: null,
|
|
20
|
+
].filter(Boolean);
|
|
21
|
+
if (!shown.length)
|
|
22
|
+
return null;
|
|
23
|
+
return (_jsx(XStack, { items: "center", gap: 12, ...slot('counts'), children: shown }));
|
|
24
|
+
}
|
|
25
|
+
export function Repo({ name, description, href, target, rel, language, tag, stars, forks, actions, }) {
|
|
26
|
+
const linked = href != null;
|
|
27
|
+
return (_jsxs(YStack, { ...slot('repo'), gap: 10, p: 16, rounded: "var(--radius-xl)", borderWidth: 1, borderColor: "var(--border)", ...fill('var(--surface-card)'), ...(linked
|
|
28
|
+
? { hoverStyle: { borderColor: 'var(--border-strong)' } }
|
|
29
|
+
: null), minW: 0, children: [_jsxs(YStack, { gap: 6, grow: 1, shrink: 0, ...(linked
|
|
30
|
+
? {
|
|
31
|
+
render: _jsx("a", { href: href, target: target, rel: rel }),
|
|
32
|
+
textDecorationLine: 'none',
|
|
33
|
+
}
|
|
34
|
+
: null), children: [_jsx(Text, { fontFamily: "$mono", fontSize: "$2", fontWeight: "600", color: "var(--foreground)", numberOfLines: 1, "data-i18n-ltr": "", children: name }), description ? (_jsx(Text, { fontSize: "$2", lineHeight: "$3", color: "var(--muted-foreground)", numberOfLines: 2, minH: 38, children: description })) : null] }), _jsxs(XStack, { items: "center", justify: "space-between", gap: 8, flexWrap: "wrap", children: [_jsxs(XStack, { items: "center", gap: 12, children: [language ? (_jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", children: language })) : null, tag ? (_jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", px: 6, py: 1, rounded: 4, borderWidth: 1, borderColor: "var(--border)", children: tag })) : null, _jsx(Counts, { stars: stars, forks: forks, size: "sm" })] }), actions] })] }));
|
|
35
|
+
}
|
|
36
|
+
/** Four inks cycle down the shares, so neighbours differ in the page's own monochrome. */
|
|
37
|
+
const SHARE = [
|
|
38
|
+
'var(--foreground)',
|
|
39
|
+
'color-mix(in srgb, var(--foreground) 62%, transparent)',
|
|
40
|
+
'color-mix(in srgb, var(--foreground) 36%, transparent)',
|
|
41
|
+
'color-mix(in srgb, var(--foreground) 18%, transparent)',
|
|
42
|
+
];
|
|
43
|
+
export function Languages({ share, label }) {
|
|
44
|
+
const rows = share.filter((s) => s.share > 0);
|
|
45
|
+
const total = rows.reduce((n, s) => n + s.share, 0);
|
|
46
|
+
if (!total)
|
|
47
|
+
return null;
|
|
48
|
+
return (_jsxs(YStack, { gap: 8, ...slot('languages'), children: [_jsx(XStack, { role: "img", "aria-label": label, height: 8, rounded: 9999, overflow: "hidden", gap: 2, children: rows.map((s, i) => (_jsx(View, { height: "100%", width: `${((100 * s.share) / total).toFixed(2)}%`, ...fill(SHARE[i % SHARE.length]) }, s.name))) }), _jsx(XStack, { gap: 14, flexWrap: "wrap", children: rows.map((s, i) => (_jsxs(XStack, { items: "center", gap: 6, children: [_jsx(View, { width: 8, height: 8, rounded: 9999, ...fill(SHARE[i % SHARE.length]) }), _jsxs(Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", children: [s.name, " ", ((100 * s.share) / total).toFixed(1), "%"] })] }, s.name))) })] }));
|
|
49
|
+
}
|
|
50
|
+
/** Up to two initials of a name. */
|
|
51
|
+
export const initials = (name) => name
|
|
52
|
+
.trim()
|
|
53
|
+
.split(/\s+/)
|
|
54
|
+
.slice(0, 2)
|
|
55
|
+
.map((w) => Array.from(w)[0] ?? '')
|
|
56
|
+
.join('')
|
|
57
|
+
.toUpperCase();
|
|
58
|
+
export function Faces({ people, max = 5 }) {
|
|
59
|
+
if (!people.length)
|
|
60
|
+
return null;
|
|
61
|
+
const shown = people.slice(0, max);
|
|
62
|
+
const more = people.length - shown.length;
|
|
63
|
+
return (_jsxs(XStack, { items: "center", ...slot('faces'), children: [shown.map((p, i) => (_jsx(View, { width: 28, height: 28, rounded: 9999, items: "center", justify: "center", borderWidth: 2, borderColor: "var(--background)", ...fill('var(--secondary)'), marginInlineStart: i ? -8 : 0, title: p.name, children: _jsx(Text, { fontFamily: "$mono", fontSize: "$1", fontWeight: "600", color: "var(--foreground)", children: initials(p.name) }) }, `${p.name}-${i}`))), more > 0 ? (_jsxs(Text, { fontFamily: "$mono", fontSize: "$1", color: "var(--muted-foreground)", marginInlineStart: 8, children: ["+", group(more)] })) : null] }));
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../src/marketing/repo.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAiBZ,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,iGAAiG;AACjG,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,CAAW,CAAA;AAE9D,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;AACtD,MAAM,IAAI,GAAG,CA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AmB,KAC3B,IAAI,CAAC,kBAAkB,CAAC,EAC5B,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACvB,KAAK,EAAE,CAAC,CAAC,IAAI,YAEnB,KAAC,IAAI,IACH,UAAU,EAAC,OAAO,EAClB,QAAQ,EAAC,IAAI,EACb,UAAU,EAAC,KAAK,EAChB,KAAK,EAAC,mBAAmB,YAExB,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GACZ,IAnBF,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,EAAE,CAoBhB,CACR,CAAC,EACD,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CACV,MAAC,IAAI,IACH,UAAU,EAAC,OAAO,EAClB,QAAQ,EAAC,IAAI,EACb,KAAK,EAAC,yBAAyB,EAC/B,iBAAiB,EAAE,CAAC,kBAElB,KAAK,CAAC,IAAI,CAAC,IACR,CACR,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "8.29.
|
|
3
|
+
"version": "8.29.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
|
|
6
6
|
"exports": {
|