@newtone-dev/ui-react-web 0.2.0 → 0.6.0
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 +41 -15
- package/dist/accordion/accordion.css +5 -3
- package/dist/action/action.css +64 -5
- package/dist/action/action.d.ts +22 -1
- package/dist/action/action.d.ts.map +1 -1
- package/dist/action/action.js +16 -2
- package/dist/action/action.js.map +1 -1
- package/dist/bar-list/bar-list.css +95 -0
- package/dist/bar-list/bar-list.d.ts +28 -0
- package/dist/bar-list/bar-list.d.ts.map +1 -0
- package/dist/bar-list/bar-list.js +9 -0
- package/dist/bar-list/bar-list.js.map +1 -0
- package/dist/bar-list/index.d.ts +4 -0
- package/dist/bar-list/index.d.ts.map +1 -0
- package/dist/bar-list/index.js +3 -0
- package/dist/bar-list/index.js.map +1 -0
- package/dist/button/button.css +81 -5
- package/dist/button/button.d.ts +24 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +12 -2
- package/dist/button/button.js.map +1 -1
- package/dist/chart-key/chart-key.css +33 -0
- package/dist/chart-key/chart-key.d.ts +15 -0
- package/dist/chart-key/chart-key.d.ts.map +1 -0
- package/dist/chart-key/chart-key.js +6 -0
- package/dist/chart-key/chart-key.js.map +1 -0
- package/dist/chart-key/index.d.ts +4 -0
- package/dist/chart-key/index.d.ts.map +1 -0
- package/dist/chart-key/index.js +3 -0
- package/dist/chart-key/index.js.map +1 -0
- package/dist/color/seeds.d.ts +7 -0
- package/dist/color/seeds.d.ts.map +1 -1
- package/dist/color/seeds.js +21 -0
- package/dist/color/seeds.js.map +1 -1
- package/dist/column-chart/column-chart.css +89 -0
- package/dist/column-chart/column-chart.d.ts +30 -0
- package/dist/column-chart/column-chart.d.ts.map +1 -0
- package/dist/column-chart/column-chart.js +11 -0
- package/dist/column-chart/column-chart.js.map +1 -0
- package/dist/column-chart/index.d.ts +4 -0
- package/dist/column-chart/index.d.ts.map +1 -0
- package/dist/column-chart/index.js +3 -0
- package/dist/column-chart/index.js.map +1 -0
- package/dist/control/control.css +49 -23
- package/dist/control/control.d.ts +33 -9
- package/dist/control/control.d.ts.map +1 -1
- package/dist/control/control.js +31 -17
- package/dist/control/control.js.map +1 -1
- package/dist/count-up/count-up.css +8 -0
- package/dist/count-up/count-up.d.ts +30 -0
- package/dist/count-up/count-up.d.ts.map +1 -0
- package/dist/count-up/count-up.js +92 -0
- package/dist/count-up/count-up.js.map +1 -0
- package/dist/count-up/index.d.ts +4 -0
- package/dist/count-up/index.d.ts.map +1 -0
- package/dist/count-up/index.js +3 -0
- package/dist/count-up/index.js.map +1 -0
- package/dist/figure/figure.css +11 -0
- package/dist/figure/figure.d.ts +17 -0
- package/dist/figure/figure.d.ts.map +1 -0
- package/dist/figure/figure.js +7 -0
- package/dist/figure/figure.js.map +1 -0
- package/dist/figure/index.d.ts +4 -0
- package/dist/figure/index.d.ts.map +1 -0
- package/dist/figure/index.js +3 -0
- package/dist/figure/index.js.map +1 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/navbar/link/drawer/drawer.css +4 -3
- package/dist/navbar/link/link.css +15 -3
- package/dist/navbar/menu-button/menu-button.css +10 -3
- package/dist/navbar/navbar.css +186 -4
- package/dist/navbar/navbar.d.ts +33 -1
- package/dist/navbar/navbar.d.ts.map +1 -1
- package/dist/navbar/navbar.js +4 -2
- package/dist/navbar/navbar.js.map +1 -1
- package/dist/page/band.d.ts +52 -0
- package/dist/page/band.d.ts.map +1 -0
- package/dist/page/band.js +36 -0
- package/dist/page/band.js.map +1 -0
- package/dist/page/index.d.ts +4 -0
- package/dist/page/index.d.ts.map +1 -0
- package/dist/page/index.js +8 -0
- package/dist/page/index.js.map +1 -0
- package/dist/page/page.css +240 -0
- package/dist/page/page.d.ts +137 -0
- package/dist/page/page.d.ts.map +1 -0
- package/dist/page/page.js +29 -0
- package/dist/page/page.js.map +1 -0
- package/dist/quick-action/quick-action.css +36 -7
- package/dist/quick-action/quick-action.d.ts +26 -6
- package/dist/quick-action/quick-action.d.ts.map +1 -1
- package/dist/quick-action/quick-action.js +11 -7
- package/dist/quick-action/quick-action.js.map +1 -1
- package/dist/segmented-control/segmented-control.css +2 -2
- package/dist/split-bar/index.d.ts +4 -0
- package/dist/split-bar/index.d.ts.map +1 -0
- package/dist/split-bar/index.js +3 -0
- package/dist/split-bar/index.js.map +1 -0
- package/dist/split-bar/split-bar.css +86 -0
- package/dist/split-bar/split-bar.d.ts +27 -0
- package/dist/split-bar/split-bar.d.ts.map +1 -0
- package/dist/split-bar/split-bar.js +7 -0
- package/dist/split-bar/split-bar.js.map +1 -0
- package/dist/text/text.css +69 -0
- package/dist/text/text.d.ts +6 -4
- package/dist/text/text.d.ts.map +1 -1
- package/dist/text/text.js.map +1 -1
- package/dist/wrapper/wrapper.d.ts +11 -2
- package/dist/wrapper/wrapper.d.ts.map +1 -1
- package/dist/wrapper/wrapper.js +5 -1
- package/dist/wrapper/wrapper.js.map +1 -1
- package/package.json +36 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* CountUp -- blueprint components/count-up.md. The number is held at its final width while it
|
|
2
|
+
counts (the component sets min-width), and sits at that box's end, so a shorter in-between value
|
|
3
|
+
grows on the left and nothing moves when the count lands. */
|
|
4
|
+
|
|
5
|
+
.newtone-count-up-value {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
text-align: end;
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ElementType, type HTMLAttributes } from 'react';
|
|
2
|
+
import { type TextScale } from '../text/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A figure that counts up to itself when it comes into view. From 0.6.0, 2026-09-25.
|
|
5
|
+
* Blueprint components/count-up.md.
|
|
6
|
+
*
|
|
7
|
+
* **Every number in `value` counts from 0**, each keeping its own decimals and thousands commas, and
|
|
8
|
+
* the text at rest is `value` exactly -- what server rendering, a screen reader, print and reduced
|
|
9
|
+
* motion all get. **It restarts each time it becomes visible** (an IntersectionObserver), so a deck
|
|
10
|
+
* step shown by taking `hidden` off counts again. **Duration and curve are the motion tokens**,
|
|
11
|
+
* `--newtone-motion-duration-reveal` and `--newtone-motion-easing-reveal`, read at run time, so the
|
|
12
|
+
* count lands with a chart growing on the same clock.
|
|
13
|
+
*
|
|
14
|
+
* **It is held at its final width, right-aligned, while it counts**, with tabular figures, so a
|
|
15
|
+
* shorter in-between value grows on the left and nothing moves at the end. The deck this came from
|
|
16
|
+
* showed a bounce when the text sat at the box's left.
|
|
17
|
+
*
|
|
18
|
+
* React 18 does not pass a ref through a function component, so the number lives in its own span
|
|
19
|
+
* inside the `Text`.
|
|
20
|
+
*/
|
|
21
|
+
export interface CountUpProps extends HTMLAttributes<HTMLElement> {
|
|
22
|
+
/** The figure as it reads at rest: `6.4%`, `1,000,000`, `57%`. */
|
|
23
|
+
value: string;
|
|
24
|
+
/** Defaults to `display-lg`. */
|
|
25
|
+
scale?: TextScale;
|
|
26
|
+
/** Defaults to `span`. */
|
|
27
|
+
as?: ElementType;
|
|
28
|
+
}
|
|
29
|
+
export declare function CountUp({ value, scale, as, className, ...rest }: CountUpProps): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=count-up.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count-up.d.ts","sourceRoot":"","sources":["../../src/count-up/count-up.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC7D,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,0BAA0B;IAC1B,EAAE,CAAC,EAAE,WAAW,CAAA;CACnB;AAwCD,wBAAgB,OAAO,CAAC,EACpB,KAAK,EACL,KAAoB,EACpB,EAAW,EACX,SAAS,EACT,GAAG,IAAI,EACV,EAAE,YAAY,+BA+Dd"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { Text } from '../text/index.js';
|
|
5
|
+
/** A number as a figure writes it: `1,000,000`, `36.6`, `0.236`. */
|
|
6
|
+
const NUMBER = /\d{1,3}(?:,\d{3})+(?:\.\d+)?|\d+(?:\.\d+)?/g;
|
|
7
|
+
/** `value` written the way `like` is: its decimals, and its thousands commas if it has them. */
|
|
8
|
+
function writeLike(like, value) {
|
|
9
|
+
const decimals = like.split('.')[1]?.length ?? 0;
|
|
10
|
+
const text = value.toFixed(decimals);
|
|
11
|
+
if (!like.includes(','))
|
|
12
|
+
return text;
|
|
13
|
+
const [whole, part] = text.split('.');
|
|
14
|
+
const grouped = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
15
|
+
return part === undefined ? grouped : `${grouped}.${part}`;
|
|
16
|
+
}
|
|
17
|
+
/** A CSS `cubic-bezier(x1, y1, x2, y2)` as a function of time, solved for x by bisection. */
|
|
18
|
+
function curve(css) {
|
|
19
|
+
const m = /cubic-bezier\(([^)]+)\)/.exec(css);
|
|
20
|
+
const [x1, y1, x2, y2] = m ? m[1].split(',').map(Number) : [0, 0, 0.58, 1];
|
|
21
|
+
const at = (a, b, s) => 3 * a * s * (1 - s) ** 2 + 3 * b * s ** 2 * (1 - s) + s ** 3;
|
|
22
|
+
return (t) => {
|
|
23
|
+
let lo = 0;
|
|
24
|
+
let hi = 1;
|
|
25
|
+
for (let i = 0; i < 24; i++) {
|
|
26
|
+
const mid = (lo + hi) / 2;
|
|
27
|
+
if (at(x1, x2, mid) < t)
|
|
28
|
+
lo = mid;
|
|
29
|
+
else
|
|
30
|
+
hi = mid;
|
|
31
|
+
}
|
|
32
|
+
return at(y1, y2, (lo + hi) / 2);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** A duration token, `1200ms` or `1.2s`, in milliseconds. */
|
|
36
|
+
function millis(css) {
|
|
37
|
+
const n = parseFloat(css);
|
|
38
|
+
if (Number.isNaN(n))
|
|
39
|
+
return 1200;
|
|
40
|
+
return /ms\s*$/.test(css) ? n : n * 1000;
|
|
41
|
+
}
|
|
42
|
+
export function CountUp({ value, scale = 'display-lg', as = 'span', className, ...rest }) {
|
|
43
|
+
const ref = useRef(null);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const node = ref.current;
|
|
46
|
+
if (node === null)
|
|
47
|
+
return;
|
|
48
|
+
const still = matchMedia('(prefers-reduced-motion: reduce)');
|
|
49
|
+
let frame = 0;
|
|
50
|
+
const finish = () => {
|
|
51
|
+
cancelAnimationFrame(frame);
|
|
52
|
+
node.textContent = value;
|
|
53
|
+
node.style.minWidth = '';
|
|
54
|
+
};
|
|
55
|
+
const run = () => {
|
|
56
|
+
finish();
|
|
57
|
+
if (still.matches)
|
|
58
|
+
return;
|
|
59
|
+
node.style.minWidth = `${node.offsetWidth}px`;
|
|
60
|
+
const style = getComputedStyle(node);
|
|
61
|
+
const duration = millis(style.getPropertyValue('--newtone-motion-duration-reveal'));
|
|
62
|
+
const ease = curve(style.getPropertyValue('--newtone-motion-easing-reveal'));
|
|
63
|
+
const start = performance.now();
|
|
64
|
+
const tick = (now) => {
|
|
65
|
+
const t = Math.min(1, (now - start) / duration);
|
|
66
|
+
if (t === 1)
|
|
67
|
+
return finish();
|
|
68
|
+
const k = ease(t);
|
|
69
|
+
node.textContent = value.replace(NUMBER, (n) => writeLike(n, parseFloat(n.replace(/,/g, '')) * k));
|
|
70
|
+
frame = requestAnimationFrame(tick);
|
|
71
|
+
};
|
|
72
|
+
tick(start);
|
|
73
|
+
};
|
|
74
|
+
const seen = new IntersectionObserver((entries) => {
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
if (entry.isIntersecting)
|
|
77
|
+
run();
|
|
78
|
+
else
|
|
79
|
+
finish();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
seen.observe(node);
|
|
83
|
+
addEventListener('beforeprint', finish);
|
|
84
|
+
return () => {
|
|
85
|
+
seen.disconnect();
|
|
86
|
+
removeEventListener('beforeprint', finish);
|
|
87
|
+
finish();
|
|
88
|
+
};
|
|
89
|
+
}, [value]);
|
|
90
|
+
return (_jsx(Text, { as: as, scale: scale, figures: "tabular", className: className ? `newtone-count-up ${className}` : 'newtone-count-up', ...rest, children: _jsx("span", { ref: ref, className: "newtone-count-up-value", children: value }) }));
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=count-up.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count-up.js","sourceRoot":"","sources":["../../src/count-up/count-up.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,EAAyC,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,IAAI,EAAkB,MAAM,kBAAkB,CAAA;AA6BvD,oEAAoE;AACpE,MAAM,MAAM,GAAG,6CAA6C,CAAA;AAE5D,gGAAgG;AAChG,SAAS,SAAS,CAAC,IAAY,EAAE,KAAa;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAA;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACpC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACrC,MAAM,OAA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vC,OAAO,GAAG,EAAE;YACR,IAAI,CAAC,UAAU,EAAE,CAAA;YACjB,mBAAmB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;YAC1C,MAAM,EAAE,CAAA;QACZ,CAAC,CAAA;IACL,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,CACH,KAAC,IAAI,IACD,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,OAAO,EAAC,SAAS,EACjB,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAC,CAAC,kBAAkB,KACvE,IAAI,YAER,eAAM,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,wBAAwB,YAC7C,KAAK,GACH,GACJ,CACV,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/count-up/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/count-up/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* Figure -- blueprint components/figure.md. The figure is chart.figure ink; the label keeps the
|
|
2
|
+
surrounding ink. The two stack on their own leading, with nothing between. */
|
|
3
|
+
|
|
4
|
+
.newtone-figure {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.newtone-figure-value {
|
|
10
|
+
color: var(--newtone-chart-figure);
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { type TextScale } from '../text/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A stated number and the line under it: `6.4%` over `343k unemployed · Working age, 16-64`. From
|
|
5
|
+
* 0.6.0, 2026-09-25. Blueprint components/figure.md.
|
|
6
|
+
*
|
|
7
|
+
* The figure counts up (`CountUp`) in `chart.figure` ink; the label is `lead-lg` in the surrounding
|
|
8
|
+
* ink. Divs rather than paragraphs, so no prose rule of the page it sits in reaches either.
|
|
9
|
+
*/
|
|
10
|
+
export interface FigureProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
value: string;
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
/** Defaults to `display-2xl`. */
|
|
14
|
+
scale?: TextScale;
|
|
15
|
+
}
|
|
16
|
+
export declare function Figure({ value, label, scale, className, ...rest }: FigureProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=figure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figure.d.ts","sourceRoot":"","sources":["../../src/figure/figure.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAGvD;;;;;;GAMG;AACH,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,iCAAiC;IACjC,KAAK,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAqB,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAW9F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from '../text/index.js';
|
|
3
|
+
import { CountUp } from '../count-up/index.js';
|
|
4
|
+
export function Figure({ value, label, scale = 'display-2xl', className, ...rest }) {
|
|
5
|
+
return (_jsxs("div", { className: className ? `newtone-figure ${className}` : 'newtone-figure', ...rest, children: [_jsx(CountUp, { as: "div", value: value, scale: scale, className: "newtone-figure-value" }), label ? (_jsx(Text, { as: "div", scale: "lead-lg", className: "newtone-figure-label", children: label })) : null] }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=figure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figure.js","sourceRoot":"","sources":["../../src/figure/figure.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAkB,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAgB9C,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,aAAa,EAAE,SAAS,EAAE,GAAG,IAAI,EAAe;IAC3F,OAAO,CACH,eAAK,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC,CAAC,gBAAgB,KAAM,IAAI,aAClF,KAAC,OAAO,IAAC,EAAE,EAAC,KAAK,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,sBAAsB,GAAG,EAChF,KAAK,CAAC,CAAC,CAAC,CACL,KAAC,IAAI,IAAC,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,sBAAsB,YAC1D,KAAK,GACH,CACV,CAAC,CAAC,CAAC,IAAI,IACN,CACT,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/figure/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/figure/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { ButtonProps, ButtonVariant } from './button/index.js';
|
|
|
7
7
|
export { Link } from './link/index.js';
|
|
8
8
|
export type { LinkProps, LinkVariant } from './link/index.js';
|
|
9
9
|
export { Text } from './text/index.js';
|
|
10
|
-
export type { TextProps, TextScale, TextFont, TextWeight, TextCase, TextFigures } from './text/index.js';
|
|
10
|
+
export type { TextProps, TextScale, TextFont, TextWeight, TextCase, TextFigures, } from './text/index.js';
|
|
11
11
|
export { Navbar } from './navbar/index.js';
|
|
12
12
|
export type { NavbarProps, NavbarBrandProps, NavbarLinksProps, NavbarLinkProps, NavbarActionsProps, NavbarMenuButtonProps, } from './navbar/index.js';
|
|
13
13
|
export { Identity } from './identity/index.js';
|
|
@@ -24,6 +24,18 @@ export { Tag } from './tag/index.js';
|
|
|
24
24
|
export type { TagProps, TagTone } from './tag/index.js';
|
|
25
25
|
export { StatCard } from './stat-card/index.js';
|
|
26
26
|
export type { StatCardProps } from './stat-card/index.js';
|
|
27
|
+
export { CountUp } from './count-up/index.js';
|
|
28
|
+
export type { CountUpProps } from './count-up/index.js';
|
|
29
|
+
export { Figure } from './figure/index.js';
|
|
30
|
+
export type { FigureProps } from './figure/index.js';
|
|
31
|
+
export { BarList } from './bar-list/index.js';
|
|
32
|
+
export type { BarListProps, BarListItem } from './bar-list/index.js';
|
|
33
|
+
export { SplitBar } from './split-bar/index.js';
|
|
34
|
+
export type { SplitBarProps, SplitBarItem } from './split-bar/index.js';
|
|
35
|
+
export { ColumnChart } from './column-chart/index.js';
|
|
36
|
+
export type { ColumnChartProps, ColumnChartColumn, ColumnChartTick } from './column-chart/index.js';
|
|
37
|
+
export { ChartKey } from './chart-key/index.js';
|
|
38
|
+
export type { ChartKeyProps, ChartKeyItem } from './chart-key/index.js';
|
|
27
39
|
export { FeatureCard } from './feature-card/index.js';
|
|
28
40
|
export type { FeatureCardProps } from './feature-card/index.js';
|
|
29
41
|
export { LogoMarquee } from './logo-marquee/index.js';
|
|
@@ -52,6 +64,8 @@ export { Action } from './action/index.js';
|
|
|
52
64
|
export type { ActionProps } from './action/index.js';
|
|
53
65
|
export { QuickAction } from './quick-action/index.js';
|
|
54
66
|
export type { QuickActionProps } from './quick-action/index.js';
|
|
67
|
+
export { Page } from './page/index.js';
|
|
68
|
+
export type { PageProps } from './page/index.js';
|
|
55
69
|
export { maxChroma, deriveScale, seedProperties, validateSeeds, oklchToHex, oklchToLinearSrgb, hexToOklch, cssNumber, STEPS, } from './color/index.js';
|
|
56
70
|
export type { Oklch, Gamut, PaletteStep, Seed, SeedGroup, Seeds } from './color/index.js';
|
|
57
71
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,SAAS,GACZ,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,YAAY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M,oBAAoB,CAAA;AAC5C,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EACH,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,KAAK,GACR,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,12 @@ export { CardBox } from './card-box/index.js';
|
|
|
11
11
|
export { CardGrid } from './card-grid/index.js';
|
|
12
12
|
export { Tag } from './tag/index.js';
|
|
13
13
|
export { StatCard } from './stat-card/index.js';
|
|
14
|
+
export { CountUp } from './count-up/index.js';
|
|
15
|
+
export { Figure } from './figure/index.js';
|
|
16
|
+
export { BarList } from './bar-list/index.js';
|
|
17
|
+
export { SplitBar } from './split-bar/index.js';
|
|
18
|
+
export { ColumnChart } from './column-chart/index.js';
|
|
19
|
+
export { ChartKey } from './chart-key/index.js';
|
|
14
20
|
export { FeatureCard } from './feature-card/index.js';
|
|
15
21
|
export { LogoMarquee } from './logo-marquee/index.js';
|
|
16
22
|
export { Accordion } from './accordion/index.js';
|
|
@@ -25,5 +31,6 @@ export { DataList } from './data-list/index.js';
|
|
|
25
31
|
export { Control } from './control/index.js';
|
|
26
32
|
export { Action } from './action/index.js';
|
|
27
33
|
export { QuickAction } from './quick-action/index.js';
|
|
34
|
+
export { Page } from './page/index.js';
|
|
28
35
|
export { maxChroma, deriveScale, seedProperties, validateSeeds, oklchToHex, oklchToLinearSrgb, hexToOklch, cssNumber, STEPS, } from './color/index.js';
|
|
29
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAQ5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAQ5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAStC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAS1C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAA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,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,KAAK,GACR,MAAM,kBAAkB,CAAA"}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
font: inherit;
|
|
25
25
|
font-family: var(--newtone-navbar-link-label-family);
|
|
26
|
-
font-size: var(--newtone-navbar-link-
|
|
26
|
+
font-size: var(--newtone-navbar-link-text-size);
|
|
27
27
|
font-weight: var(--newtone-navbar-link-label-weight);
|
|
28
|
-
line-height: var(--newtone-navbar-link-
|
|
28
|
+
line-height: var(--newtone-navbar-link-text-leading);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.newtone-navbar-drawer {
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
top: calc(100% + var(--newtone-navbar-padding-y));
|
|
35
35
|
left: 0;
|
|
36
36
|
min-width: 14rem;
|
|
37
|
-
padding: var(--newtone-navbar-link-
|
|
37
|
+
padding: var(--newtone-navbar-link-pad-y)
|
|
38
|
+
calc(var(--newtone-navbar-link-pad-y) + var(--newtone-navbar-link-gap));
|
|
38
39
|
background: var(--newtone-navbar-bar-fill);
|
|
39
40
|
border: 1px solid var(--newtone-navbar-bar-border);
|
|
40
41
|
border-radius: var(--newtone-navbar-link-radius);
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
.newtone-navbar-link {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
|
|
4
|
+
/* THE RUNG IS DECLARED ON THE BAR AND RESOLVED HERE, and this component takes no size prop of
|
|
5
|
+
* its own. A bar whose link and whose call to action could be sized separately is the defect
|
|
6
|
+
* the ladder was written from: 12/14.4 at 30.4px beside a Button at 16/19.2 and 37.2, two
|
|
7
|
+
* sizes on one line at one semantic level.
|
|
8
|
+
* governance/code/one-row-of-chrome-states-its-height-once.md, and navbar.css for the rungs. */
|
|
9
|
+
/* DERIVED, NOT AUTHORED -- see button.css. A link has no border, so nothing is subtracted:
|
|
10
|
+
* `pad-y` on the block axis, `pad-y + gap` on the inline one. At `md` that is 12 and 20. */
|
|
11
|
+
padding: var(--newtone-navbar-link-pad-y)
|
|
12
|
+
calc(var(--newtone-navbar-link-pad-y) + var(--newtone-navbar-link-gap));
|
|
5
13
|
font-family: var(--newtone-navbar-link-label-family);
|
|
6
|
-
font-size: var(--newtone-navbar-link-
|
|
14
|
+
font-size: var(--newtone-navbar-link-text-size);
|
|
7
15
|
font-weight: var(--newtone-navbar-link-label-weight);
|
|
8
|
-
line-height: var(--newtone-navbar-link-
|
|
16
|
+
line-height: var(--newtone-navbar-link-text-leading);
|
|
17
|
+
|
|
18
|
+
/* PUBLISHED, NEVER DECLARED -- issues/open/156. A link has no border, so the box is the leading
|
|
19
|
+
* plus twice the padding. Read it; writing it changes no geometry. */
|
|
20
|
+
--newtone-navbar-link-height: calc(var(--newtone-navbar-link-text-leading) + 2 * var(--newtone-navbar-link-pad-y));
|
|
9
21
|
text-decoration: none;
|
|
10
22
|
border-radius: var(--newtone-navbar-link-radius);
|
|
11
23
|
}
|
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
.newtone-navbar-menu-button {
|
|
4
4
|
display: none;
|
|
5
5
|
align-items: center;
|
|
6
|
-
|
|
6
|
+
/* IT SPENDS THE LINK'S RUNG, which the bar declared -- so the disclosure, the links and a
|
|
7
|
+
* Button in `actions` are all one height and one type pair. It carries a border where a link
|
|
8
|
+
* does not, so its box is one pixel taller on each side and that is the border, not a rung. */
|
|
9
|
+
/* THE BORDER IS SUBTRACTED FROM THE BLOCK PADDING, as it is on Button and Action. A link has
|
|
10
|
+
* no border and this does, so without the subtraction the disclosure would render two pixels
|
|
11
|
+
* taller than the links it sits beside -- in a row whose whole point is one height. */
|
|
12
|
+
padding: calc(var(--newtone-navbar-link-pad-y) - 1px)
|
|
13
|
+
calc(var(--newtone-navbar-link-pad-y) + var(--newtone-navbar-link-gap) - 1px);
|
|
7
14
|
font-family: var(--newtone-navbar-link-label-family);
|
|
8
|
-
font-size: var(--newtone-navbar-link-
|
|
15
|
+
font-size: var(--newtone-navbar-link-text-size);
|
|
9
16
|
font-weight: var(--newtone-navbar-link-label-weight);
|
|
10
|
-
line-height: var(--newtone-navbar-link-
|
|
17
|
+
line-height: var(--newtone-navbar-link-text-leading);
|
|
11
18
|
background: var(--newtone-navbar-link-elsewhere-rest-fill);
|
|
12
19
|
color: var(--newtone-navbar-link-elsewhere-rest-text);
|
|
13
20
|
border: 1px solid var(--newtone-navbar-bar-border);
|
package/dist/navbar/navbar.css
CHANGED
|
@@ -75,15 +75,141 @@
|
|
|
75
75
|
box-sizing: border-box;
|
|
76
76
|
display: flex;
|
|
77
77
|
align-items: center;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
/* THE GAP MOVED TO THE TRACK on 2026-09-21. The header now holds one child. */
|
|
79
|
+
|
|
80
|
+
/* A FIXED HEIGHT FROM 2026-09-21 LATE, WHERE IT WAS A FLOOR. Joshua: *"navbars should always
|
|
81
|
+
* measure 64px + 1px border, 65 in total."* It was `min-block-size` from 2026-09-17, and the
|
|
82
|
+
* contract argued the floor deliberately -- content taller than the 48px budget GREW the bar
|
|
83
|
+
* rather than losing its tail, so the component owed neither an overflow check nor a clip.
|
|
84
|
+
*
|
|
85
|
+
* WHAT CHANGED IS THAT THE BUDGET BECAME ENFORCEABLE. A floor was the honest answer while a bar
|
|
86
|
+
* could hold anything of any height; the control ladder closed that set, and the tallest rung a
|
|
87
|
+
* bar spends is `lg` at 48 -- which is the budget exactly. `always` is now a promise the
|
|
88
|
+
* component can keep rather than a number it hopes for. contracts/button.md, *Sizes*.
|
|
89
|
+
*
|
|
90
|
+
* A SITE THAT NEEDS A DIFFERENT BAR STILL SETS ITS OWN `height`, at one class, loading later --
|
|
91
|
+
* `harbour-space_website`'s masthead is 80 at wide and 64 narrow and is unaffected. That is the
|
|
92
|
+
* hatch, and it is the same one it was already using. */
|
|
93
|
+
block-size: calc(var(--newtone-navbar-min-block-size) + var(--newtone-navbar-hairline));
|
|
94
|
+
|
|
95
|
+
/* THE INLINE HALF IS THE PAGE'S GUTTER WHEN THERE IS A PAGE, since 2026-09-21 late, and this
|
|
96
|
+
bar's own token when there is not. contracts/navbar.md, *Parts*.
|
|
97
|
+
*
|
|
98
|
+
* WHAT IT BUYS IS A VERTICAL LINE. The ground runs edge to edge and the contents do not, so the
|
|
99
|
+
* only thing that puts the first word of a page under the mark in this bar is the two of them
|
|
100
|
+
* spending ONE number -- and knowledge/shared/the-width-ladder.md records two sites writing that
|
|
101
|
+
* alignment by hand, independently, with the same arithmetic error in it both times.
|
|
102
|
+
*
|
|
103
|
+
* READING ANOTHER GROUP'S NAME IS PERMITTED HERE BECAUSE A LENGTH HAS NO AREA, which is the
|
|
104
|
+
* reasoning blueprints/newtone/repos/newtone_ui_react-web.md section 5 already carried for
|
|
105
|
+
* `Wrapper` spending core space steps. The two alternatives are both worse and both already
|
|
106
|
+
* named: a consumer writing this padding is the 2026-09-18 debt, and the page writing
|
|
107
|
+
* `--newtone-navbar-padding-x` onto this element is that same debt with the library holding the
|
|
108
|
+
* pen.
|
|
109
|
+
*
|
|
110
|
+
* THE FALLBACK IS WHAT KEEPS IT HONEST. A bar outside a page resolves its own token and nothing
|
|
111
|
+
* about it changed -- `atril_web`'s document bar is that case, and four sites that override this
|
|
112
|
+
* padding by hand are untouched, because their sheets load after this one. */
|
|
113
|
+
padding: var(--newtone-navbar-padding-y)
|
|
114
|
+
var(--newtone-page-gutter, var(--newtone-navbar-padding-x));
|
|
81
115
|
background: var(--newtone-navbar-bar-fill);
|
|
82
116
|
border-bottom: var(--newtone-navbar-hairline) solid var(--newtone-navbar-bar-border);
|
|
83
117
|
|
|
84
118
|
--newtone-navbar-hairline: 1px;
|
|
85
119
|
}
|
|
86
120
|
|
|
121
|
+
/* ---- the strip above the bar --------------------------------------------
|
|
122
|
+
*
|
|
123
|
+
* THE BAR'S FILL, CONTINUED UPWARD PAST ITS OWN TOP EDGE. Added 2026-09-21 --
|
|
124
|
+
* governance/code/a-band-that-meets-an-over-scroll-edge-paints-past-its-own-box.md, and
|
|
125
|
+
* blueprints/newtone/contracts/navbar.md, *Parts*.
|
|
126
|
+
*
|
|
127
|
+
* WHAT IT IS FOR. Pull a page past its own top edge on a trackpad and what shows above the bar is
|
|
128
|
+
* THE CANVAS -- `<html>`'s background, the one surface on a page no component owns, and one colour
|
|
129
|
+
* for a page that may have two grounds. So the bar answers for its own end rather than asking the
|
|
130
|
+
* page to be painted for it. It is also the bar's OWN colour, which is the second half of why it is
|
|
131
|
+
* here: a page shell painting this strip would be reading `navbar.bar.*.fill` from outside the group
|
|
132
|
+
* that owns it.
|
|
133
|
+
*
|
|
134
|
+
* IT COSTS NO SCROLL AND THAT IS NOT LUCK. Overflow above the origin is not scrollable, so this adds
|
|
135
|
+
* no scrollbar and no page height. The footer at the other end of the page CANNOT use this spelling
|
|
136
|
+
* for exactly that reason -- overflow below the bottom IS scrollable -- and uses a spread shadow
|
|
137
|
+
* instead. `node tools/check-page-paint.mjs <url>` is the measurement.
|
|
138
|
+
*
|
|
139
|
+
* WHEN THE BAR IS STUCK, THIS IS ABOVE THE VIEWPORT AND UNPAINTABLE. It resolves against the bar,
|
|
140
|
+
* which is `position: sticky` and therefore positioned; at any scroll position past the top the bar's
|
|
141
|
+
* own box is at the viewport's top edge, so everything above it is off screen. The only moment this
|
|
142
|
+
* shows is `scrollTop <= 0`, which is the moment it is for.
|
|
143
|
+
*
|
|
144
|
+
* WHAT WOULD BREAK IT: a bar that is not the first thing in the document. All six consumers render
|
|
145
|
+
* `<Navbar>` first -- checked, 2026-09-21 -- and a bar with content above it would have this paint
|
|
146
|
+
* lying over that content. The bar's own `top: 0` already assumes the same thing, so this does not
|
|
147
|
+
* add an assumption; it makes an existing one visible. */
|
|
148
|
+
.newtone-navbar::before {
|
|
149
|
+
content: '';
|
|
150
|
+
position: absolute;
|
|
151
|
+
inset-block-end: 100%;
|
|
152
|
+
inset-inline: 0;
|
|
153
|
+
block-size: 100vh;
|
|
154
|
+
background: var(--newtone-navbar-bar-fill);
|
|
155
|
+
pointer-events: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* ---- the track ----------------------------------------------------------
|
|
159
|
+
*
|
|
160
|
+
* THE ROW. Added 2026-09-21 so the bar can be full-bleed and its contents capped at once, which one
|
|
161
|
+
* box cannot be. contracts/navbar.md, *Parts*.
|
|
162
|
+
*
|
|
163
|
+
* `flex: 1` FILLS WHAT THE HEADER'S PADDING LEAVES, so with no cap this computes exactly the box the
|
|
164
|
+
* bar computed before the track existed and five consumers see no change. `max-inline-size` is set
|
|
165
|
+
* inline by the component only when a caller passed one; `margin-inline: auto` then centres the
|
|
166
|
+
* capped row in what is left.
|
|
167
|
+
*
|
|
168
|
+
* THE PADDING IS NOT HERE AND THAT IS LOAD-BEARING. Four consuming sites write `padding-inline`
|
|
169
|
+
* against `.newtone-navbar`. Moving it inward would have left all four insetting the GROUND
|
|
170
|
+
* instead of the row -- a colour, so the first visible symptom would have been the hairline
|
|
171
|
+
* stopping short of the screen edge, which nothing in this house measures.
|
|
172
|
+
*
|
|
173
|
+
* IT IS DELIBERATELY NOT POSITIONED. The collapsed panel below is `position: absolute; top: 100%;
|
|
174
|
+
* left: 0; right: 0`, and it must resolve against the STICKY HEADER: a panel that resolved against
|
|
175
|
+
* a capped track would stop at the cap instead of spanning the screen. Giving this rule a
|
|
176
|
+
* `position` is the one edit here that would break a phone and nothing else. */
|
|
177
|
+
.newtone-navbar-track {
|
|
178
|
+
flex: 1;
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
gap: var(--newtone-navbar-gap);
|
|
182
|
+
margin-inline: auto;
|
|
183
|
+
min-inline-size: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* ---- the rungs ----------------------------------------------------------
|
|
187
|
+
*
|
|
188
|
+
* 40, 44, 48 -- Button's three, spent by the link and the menu button. Declared on the BAR and
|
|
189
|
+
* resolved by both, which is governance/code/one-row-of-chrome-states-its-height-once.md: one
|
|
190
|
+
* number, above them, rather than two components computing their way to the same one.
|
|
191
|
+
*
|
|
192
|
+
* EACH RUNG NAMES BOTH LEAVES OF ONE STEP. The link read `typography.size.xs` on a ratio until
|
|
193
|
+
* 2026-09-21 -- 12/14.4, a number nobody chose -- beside a Button at 16/19.2. That is the defect
|
|
194
|
+
* this whole ladder was written from. */
|
|
195
|
+
.newtone-navbar--sm {
|
|
196
|
+
--newtone-navbar-link-pad-y: var(--newtone-navbar-link-size-sm-padding-y);
|
|
197
|
+
--newtone-navbar-link-text-size: var(--newtone-navbar-link-size-sm-label-size);
|
|
198
|
+
--newtone-navbar-link-text-leading: var(--newtone-navbar-link-size-sm-label-line-height);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.newtone-navbar--md {
|
|
202
|
+
--newtone-navbar-link-pad-y: var(--newtone-navbar-link-size-md-padding-y);
|
|
203
|
+
--newtone-navbar-link-text-size: var(--newtone-navbar-link-size-md-label-size);
|
|
204
|
+
--newtone-navbar-link-text-leading: var(--newtone-navbar-link-size-md-label-line-height);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.newtone-navbar--lg {
|
|
208
|
+
--newtone-navbar-link-pad-y: var(--newtone-navbar-link-size-lg-padding-y);
|
|
209
|
+
--newtone-navbar-link-text-size: var(--newtone-navbar-link-size-lg-label-size);
|
|
210
|
+
--newtone-navbar-link-text-leading: var(--newtone-navbar-link-size-lg-label-line-height);
|
|
211
|
+
}
|
|
212
|
+
|
|
87
213
|
/* What this margin does to the position of the links and the actions, why no prop exposes it, and
|
|
88
214
|
which of the two centres a site writes for itself: blueprints/newtone/contracts/navbar.md,
|
|
89
215
|
"Where the parts sit", and the `align` row in "Deliberately not in v1".
|
|
@@ -115,6 +241,59 @@
|
|
|
115
241
|
gap: var(--newtone-navbar-gap);
|
|
116
242
|
}
|
|
117
243
|
|
|
244
|
+
/* ---- the centre ---------------------------------------------------------
|
|
245
|
+
*
|
|
246
|
+
* EQUAL SIDE TRACKS, SO THE LINKS LAND ON THE PAGE'S CENTRE. Added 2026-09-21 --
|
|
247
|
+
* contracts/navbar.md, "Where the parts sit", which carries these three lines and the overrule
|
|
248
|
+
* that put them here.
|
|
249
|
+
*
|
|
250
|
+
* WHAT THIS REPLACES. The brand's `margin-right: auto` above pinned links and actions to the far
|
|
251
|
+
* edge, and the contract argued for five days that the bar should ship no centre at all. It
|
|
252
|
+
* stopped arguing that when somebody asked: Joshua, 2026-09-21, *"I don't know why the navLink
|
|
253
|
+
* are next to the main CTA but they shouldn't, they should be centered, and this is true for
|
|
254
|
+
* other websites."* The `align` PROP is still refused and its trigger is still unfired -- what
|
|
255
|
+
* moved is which arrangement the library ships, not how many it offers.
|
|
256
|
+
*
|
|
257
|
+
* WHY NOT ONE DECLARATION. Cancelling the brand's margin alone centres the links in the GAP
|
|
258
|
+
* between the brand and the actions, which is the page's centre only when those two happen to be
|
|
259
|
+
* the same width. `adenario_website` found that on 2026-09-13 and wrote these three instead;
|
|
260
|
+
* eight days later they moved here unchanged. Equal tracks are indifferent to what they contain,
|
|
261
|
+
* which is the property being bought.
|
|
262
|
+
*
|
|
263
|
+
* WHY NOT A GRID. `minmax(0, 1fr) auto minmax(0, 1fr)` reaches the same centre by construction and
|
|
264
|
+
* is what the reference bar does -- and it would change this component's layout model. The
|
|
265
|
+
* collapsed panel below is THIS FLEX ROW turned into a column, and five consumers copy those rules
|
|
266
|
+
* to move their own breakpoint. Equal flex tracks cost none of that.
|
|
267
|
+
*
|
|
268
|
+
* THE GATE IS NOT DECORATION. Below 48rem the links leave the row and become the panel, so there
|
|
269
|
+
* is nothing left in the bar to centre and the two remaining parts want opposite ends -- the
|
|
270
|
+
* brand keeps its `margin-right: auto` and nothing here applies. The literal is the same one the
|
|
271
|
+
* collapse uses and the same one five site stylesheets carry; `node tools/check-breakpoints.mjs`
|
|
272
|
+
* counts them.
|
|
273
|
+
*
|
|
274
|
+
* WHAT WOULD BREAK IT: a bar with `Links` and no `Actions`. With the right-hand track absent the
|
|
275
|
+
* links take the far edge while looking like they were centred. Checked across all six consumers
|
|
276
|
+
* before this shipped -- every bar that renders `Links` also renders `Actions`, and the one that
|
|
277
|
+
* renders neither (`atril_web`'s document bar, `Brand` alone) computes the identical box, because
|
|
278
|
+
* `flex: 1 1 0` on a lone free-space taker is `margin-right: auto` by another name. If that bar
|
|
279
|
+
* ever exists, it decides between a fourth declaration and a `:has()`, and it is not decided here
|
|
280
|
+
* in advance. */
|
|
281
|
+
@media (min-width: 48rem) {
|
|
282
|
+
.newtone-navbar-brand {
|
|
283
|
+
margin-right: 0;
|
|
284
|
+
flex: 1 1 0;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.newtone-navbar-links {
|
|
288
|
+
flex: 0 0 auto;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.newtone-navbar-actions {
|
|
292
|
+
flex: 1 1 0;
|
|
293
|
+
justify-content: flex-end;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
118
297
|
/* :focus-visible, not :focus, per contracts/button.md. A navbar is the first thing a keyboard
|
|
119
298
|
reaches on every page, so of everywhere focus could be missing, here is the worst. */
|
|
120
299
|
.newtone-navbar-link:focus-visible,
|
|
@@ -153,7 +332,10 @@
|
|
|
153
332
|
display: none;
|
|
154
333
|
flex-direction: column;
|
|
155
334
|
align-items: stretch;
|
|
156
|
-
|
|
335
|
+
/* The same expression as the bar's, for the same reason one level down: the panel hangs off
|
|
336
|
+
the bar and a reader sees the two edges at once. */
|
|
337
|
+
padding: var(--newtone-navbar-padding-y)
|
|
338
|
+
var(--newtone-page-gutter, var(--newtone-navbar-padding-x));
|
|
157
339
|
background: var(--newtone-navbar-bar-fill);
|
|
158
340
|
border-bottom: 1px solid var(--newtone-navbar-bar-border);
|
|
159
341
|
}
|