@newtone-dev/ui-react-web 0.9.0 → 0.13.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 +9 -5
- package/dist/accordion/accordion.css +4 -4
- package/dist/avatar/avatar.css +7 -2
- package/dist/avatar/avatar.d.ts +7 -1
- package/dist/avatar/avatar.d.ts.map +1 -1
- package/dist/avatar/avatar.js +7 -2
- package/dist/avatar/avatar.js.map +1 -1
- package/dist/bar-list/bar-list.css +29 -4
- package/dist/card-box/card-box.css +5 -3
- package/dist/card-box/card-box.d.ts +11 -3
- package/dist/card-box/card-box.d.ts.map +1 -1
- package/dist/card-box/card-box.js +4 -2
- package/dist/card-box/card-box.js.map +1 -1
- package/dist/card-grid/card-grid.css +28 -1
- package/dist/card-grid/card-grid.d.ts +7 -1
- package/dist/card-grid/card-grid.d.ts.map +1 -1
- package/dist/card-grid/card-grid.js +14 -8
- package/dist/card-grid/card-grid.js.map +1 -1
- package/dist/chart-key/chart-key.css +4 -4
- package/dist/column-chart/column-chart.css +35 -6
- package/dist/control/control.css +21 -4
- package/dist/control/control.d.ts +15 -5
- package/dist/control/control.d.ts.map +1 -1
- package/dist/control/control.js +7 -6
- package/dist/control/control.js.map +1 -1
- package/dist/count-up/count-up.css +6 -2
- package/dist/count-up/count-up.d.ts +8 -4
- package/dist/count-up/count-up.d.ts.map +1 -1
- package/dist/count-up/count-up.js +2 -2
- package/dist/count-up/count-up.js.map +1 -1
- package/dist/data-list/data-list.css +7 -5
- package/dist/data-list/data-list.d.ts +7 -1
- package/dist/data-list/data-list.d.ts.map +1 -1
- package/dist/data-list/data-list.js +7 -2
- package/dist/data-list/data-list.js.map +1 -1
- package/dist/feature-card/feature-card.css +1 -1
- package/dist/figure/figure.css +1 -1
- package/dist/figure/figure.d.ts.map +1 -1
- package/dist/figure/figure.js +3 -1
- package/dist/figure/figure.js.map +1 -1
- package/dist/framed-icon/framed-icon.css +1 -1
- package/dist/gallery/gallery.css +27 -2
- package/dist/gallery/gallery.d.ts.map +1 -1
- package/dist/gallery/gallery.js +5 -2
- package/dist/gallery/gallery.js.map +1 -1
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.js +30 -3
- package/dist/icon/icon.js.map +1 -1
- package/dist/icon-link/icon-link.css +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/link/link.css +7 -7
- package/dist/logo-marquee/logo-marquee.d.ts.map +1 -1
- package/dist/logo-marquee/logo-marquee.js +6 -2
- package/dist/logo-marquee/logo-marquee.js.map +1 -1
- package/dist/media-window/index.d.ts +4 -0
- package/dist/media-window/index.d.ts.map +1 -0
- package/dist/media-window/index.js +3 -0
- package/dist/media-window/index.js.map +1 -0
- package/dist/media-window/media-window.css +5 -2
- package/dist/media-window/media-window.d.ts +28 -0
- package/dist/media-window/media-window.d.ts.map +1 -0
- package/dist/media-window/media-window.js +5 -0
- package/dist/media-window/media-window.js.map +1 -0
- package/dist/navbar/navbar.d.ts +16 -3
- package/dist/navbar/navbar.d.ts.map +1 -1
- package/dist/navbar/navbar.js +8 -5
- package/dist/navbar/navbar.js.map +1 -1
- package/dist/numbered-list/numbered-list.css +1 -1
- package/dist/on-media/on-media.css +146 -53
- package/dist/page/page.css +9 -9
- package/dist/page/page.d.ts +1 -1
- package/dist/segmented-control/segmented-control.css +28 -5
- package/dist/split-bar/split-bar.css +36 -4
- package/dist/stat-card/stat-card.css +3 -3
- package/dist/text/text.css +29 -2
- package/dist/tooltip/tooltip.css +6 -1
- package/dist/tooltip/tooltip.d.ts +9 -1
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +61 -4
- package/dist/tooltip/tooltip.js.map +1 -1
- package/dist/video-lightbox/video-lightbox.css +13 -7
- package/dist/video-lightbox/video-lightbox.d.ts.map +1 -1
- package/dist/video-lightbox/video-lightbox.js +5 -2
- package/dist/video-lightbox/video-lightbox.js.map +1 -1
- package/package.json +5 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.newtone-split-bar-label {
|
|
23
|
-
color: var(--newtone-chart-label);
|
|
23
|
+
color: var(--newtone-chart-label-text);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.newtone-split-bar-track {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
height: var(--newtone-space-8);
|
|
29
29
|
overflow: hidden;
|
|
30
30
|
border-radius: var(--newtone-chart-radius);
|
|
31
|
-
background: var(--newtone-chart-mark-muted);
|
|
31
|
+
background: var(--newtone-chart-mark-muted-fill);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.newtone-split-bar-part {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
justify-content: flex-end;
|
|
38
38
|
width: calc(var(--_split-bar-share) * 100%);
|
|
39
39
|
padding-inline: var(--newtone-space-6);
|
|
40
|
-
background: var(--newtone-chart-mark);
|
|
41
|
-
color: var(--newtone-chart-
|
|
40
|
+
background: var(--newtone-chart-mark-rest-fill);
|
|
41
|
+
color: var(--newtone-chart-mark-rest-text);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.newtone-split-bar[data-fill] {
|
|
@@ -63,7 +63,39 @@
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/* WHICH BOX A BREAKPOINT ASKS, 2026-09-29. Every width rule below is written twice with one body: under
|
|
67
|
+
`@media` it asks the screen, unless an ancestor carries `data-newtone-breakpoints="container"`; under
|
|
68
|
+
`@container newtone-breakpoints` it asks that ancestor. Declared at zero specificity in every sheet
|
|
69
|
+
that has such a rule, so a consumer's own `container-type` wins and it lists the name itself.
|
|
70
|
+
Repo blueprint section 4, *Breakpoints*. */
|
|
71
|
+
:where([data-newtone-breakpoints='container']) {
|
|
72
|
+
container: newtone-breakpoints / inline-size;
|
|
73
|
+
}
|
|
74
|
+
|
|
66
75
|
@media (max-width: 40rem) {
|
|
76
|
+
.newtone-split-bar:where(:not([data-newtone-breakpoints='container'] *)) {
|
|
77
|
+
grid-template-columns: minmax(0, 1fr);
|
|
78
|
+
row-gap: var(--newtone-space-1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.newtone-split-bar[data-fill]:where(:not([data-newtone-breakpoints='container'] *)) {
|
|
82
|
+
grid-auto-rows: auto;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Tall enough for the share's own phone size (display-xl steps down to 48), so the figure is
|
|
86
|
+
never shrunk off the scale to fit the bar. */
|
|
87
|
+
.newtone-split-bar-track:where(:not([data-newtone-breakpoints='container'] *)),
|
|
88
|
+
.newtone-split-bar[data-fill]
|
|
89
|
+
.newtone-split-bar-track:where(:not([data-newtone-breakpoints='container'] *)) {
|
|
90
|
+
height: var(--newtone-space-16);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.newtone-split-bar-part:where(:not([data-newtone-breakpoints='container'] *)) {
|
|
94
|
+
padding-inline: var(--newtone-space-3);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@container newtone-breakpoints (max-width: 40rem) {
|
|
67
99
|
.newtone-split-bar {
|
|
68
100
|
grid-template-columns: minmax(0, 1fr);
|
|
69
101
|
row-gap: var(--newtone-space-1);
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.newtone-stat-card-head {
|
|
47
|
-
color: var(--newtone-stat-card-head);
|
|
47
|
+
color: var(--newtone-stat-card-head-text);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.newtone-stat-card-figure {
|
|
51
|
-
color: var(--newtone-stat-card-figure);
|
|
51
|
+
color: var(--newtone-stat-card-figure-text);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.newtone-stat-card-caption {
|
|
55
|
-
color: var(--newtone-stat-card-caption);
|
|
55
|
+
color: var(--newtone-stat-card-caption-text);
|
|
56
56
|
}
|
package/dist/text/text.css
CHANGED
|
@@ -185,11 +185,34 @@
|
|
|
185
185
|
--_weight: var(--_weight-regular);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
/* WHICH BOX A BREAKPOINT ASKS, 2026-09-29. Every width rule below is written twice with one body: under
|
|
189
|
+
`@media` it asks the screen, unless an ancestor carries `data-newtone-breakpoints="container"`; under
|
|
190
|
+
`@container newtone-breakpoints` it asks that ancestor. Declared at zero specificity in every sheet
|
|
191
|
+
that has such a rule, so a consumer's own `container-type` wins and it lists the name itself.
|
|
192
|
+
Repo blueprint section 4, *Breakpoints*. */
|
|
193
|
+
:where([data-newtone-breakpoints='container']) {
|
|
194
|
+
container: newtone-breakpoints / inline-size;
|
|
195
|
+
}
|
|
196
|
+
|
|
188
197
|
/* THE PHONE STEP-DOWN, 2026-09-25. Below `stack` (40rem, written as the library's other media
|
|
189
198
|
queries are, because a custom property cannot be read inside one) the three largest scales take a
|
|
190
199
|
smaller step's size, never a curve: 128 -> 64, 96 -> 48, 64 -> 48. Their leading stays `none`.
|
|
191
200
|
contracts/typography.md section 7.1, *No clamp()*. Still 0,1,0, after the blocks it narrows. */
|
|
192
201
|
@media (max-width: 40rem) {
|
|
202
|
+
.newtone-text:where([data-scale='display-3xl']):where(
|
|
203
|
+
:not([data-newtone-breakpoints='container'] *)
|
|
204
|
+
) {
|
|
205
|
+
font-size: var(--newtone-text-scale-display-xl-size);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.newtone-text:where([data-scale='display-2xl'], [data-scale='display-xl']):where(
|
|
209
|
+
:not([data-newtone-breakpoints='container'] *)
|
|
210
|
+
) {
|
|
211
|
+
font-size: var(--newtone-text-scale-display-lg-size);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@container newtone-breakpoints (max-width: 40rem) {
|
|
193
216
|
.newtone-text:where([data-scale='display-3xl']) {
|
|
194
217
|
font-size: var(--newtone-text-scale-display-xl-size);
|
|
195
218
|
}
|
|
@@ -204,7 +227,10 @@
|
|
|
204
227
|
font-variation-settings: var(--newtone-text-scale-body-variation);
|
|
205
228
|
font-feature-settings: var(--newtone-text-scale-body-feature);
|
|
206
229
|
font-size: var(--newtone-text-scale-body-size);
|
|
207
|
-
line-height
|
|
230
|
+
/* `leading`, not `line-height`: this scale takes a typography.step, whose leading is a length,
|
|
231
|
+
and the token layer names the leaf for the unit it holds so the four targets that carry no
|
|
232
|
+
unit can tell. contracts/typography.md 7.1 and 7.2.2. */
|
|
233
|
+
line-height: var(--newtone-text-scale-body-leading);
|
|
208
234
|
letter-spacing: var(--newtone-text-scale-body-tracking);
|
|
209
235
|
--_weight: var(--_weight-regular);
|
|
210
236
|
}
|
|
@@ -214,7 +240,8 @@
|
|
|
214
240
|
font-variation-settings: var(--newtone-text-scale-body-sm-variation);
|
|
215
241
|
font-feature-settings: var(--newtone-text-scale-body-sm-feature);
|
|
216
242
|
font-size: var(--newtone-text-scale-body-sm-size);
|
|
217
|
-
|
|
243
|
+
/* A step's leading, as above. */
|
|
244
|
+
line-height: var(--newtone-text-scale-body-sm-leading);
|
|
218
245
|
letter-spacing: var(--newtone-text-scale-body-sm-tracking);
|
|
219
246
|
--_weight: var(--_weight-regular);
|
|
220
247
|
}
|
package/dist/tooltip/tooltip.css
CHANGED
|
@@ -54,7 +54,12 @@
|
|
|
54
54
|
block-size: var(--newtone-space-3);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
.
|
|
57
|
+
/* SHOWN ON `data-open` OR A VISIBLE FOCUS, FROM 0.13.0 -- ~~`:is(:hover, :focus-within)`~~. The pointer's
|
|
58
|
+
rule is time and lives in tooltip.tsx: shown on entry, lingering after the trigger for as long as it
|
|
59
|
+
was hovered, held while on the bubble. `:focus-within` went because a mouse click focuses the
|
|
60
|
+
trigger and pinned the bubble by accident; `:focus-visible` is the keyboard's alone.
|
|
61
|
+
components/tooltip.md. */
|
|
62
|
+
.newtone-tooltip:is([data-open], :has(:focus-visible)):not([data-dismissed]) .newtone-tooltip-bubble {
|
|
58
63
|
visibility: visible;
|
|
59
64
|
pointer-events: auto;
|
|
60
65
|
}
|
|
@@ -9,6 +9,14 @@ import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
|
|
|
9
9
|
* it keeps it open. One placement, from 0.9.0 a chat bubble on the trigger's top-right corner with no
|
|
10
10
|
* gap and a square tail; the one caller is a footer's first column. The bubble is a `strong`
|
|
11
11
|
* Surface, so it inverts against the page in both modes, and casts shadow.raised in the page's ink.
|
|
12
|
+
*
|
|
13
|
+
* WHEN IT SHOWS, FROM 0.13.0 (2026-09-29): the pointer's time decides, and a click decides nothing.
|
|
14
|
+
* Joshua: "if you hover for like one second, it stays one second and then dissapears ... if I am
|
|
15
|
+
* hovering the tooltip box, it should stay there, until the pointer leaves." Leaving the trigger, it
|
|
16
|
+
* lingers for as long as it was hovered -- none under BRIEF, at most LINGER_MAX. Leaving the bubble,
|
|
17
|
+
* it hides at once. Keyboard shows it through `:has(:focus-visible)` in the sheet, which a mouse click
|
|
18
|
+
* does not match, so a click no longer pins it the way `:focus-within` did. Touch: a tap opens it, a
|
|
19
|
+
* tap elsewhere closes it.
|
|
12
20
|
*/
|
|
13
21
|
export interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'content'> {
|
|
14
22
|
/** What the bubble says. */
|
|
@@ -18,5 +26,5 @@ export interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'con
|
|
|
18
26
|
'aria-describedby'?: string;
|
|
19
27
|
}>;
|
|
20
28
|
}
|
|
21
|
-
export declare function Tooltip({ content, children, className, onKeyDown, onPointerLeave, onBlur, ...rest }: TooltipProps): import("react").JSX.Element;
|
|
29
|
+
export declare function Tooltip({ content, children, className, onKeyDown, onPointerEnter, onPointerLeave, onPointerOver, onBlur, ...rest }: TooltipProps): import("react").JSX.Element;
|
|
22
30
|
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAMH,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAA;AAId;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC;IAClF,4BAA4B;IAC5B,OAAO,EAAE,SAAS,CAAA;IAClB,gEAAgE;IAChE,QAAQ,EAAE,YAAY,CAAC;QAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC1D;AAOD,wBAAgB,OAAO,CAAC,EACpB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,EACT,cAAc,EACd,cAAc,EACd,aAAa,EACb,MAAM,EACN,GAAG,IAAI,EACV,EAAE,YAAY,+BA4Fd"}
|
package/dist/tooltip/tooltip.js
CHANGED
|
@@ -1,17 +1,74 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cloneElement, useId, useState, } from 'react';
|
|
3
|
+
import { cloneElement, useEffect, useId, useRef, useState, } from 'react';
|
|
4
4
|
import { Surface } from '../surface/index.js';
|
|
5
5
|
import { Text } from '../text/index.js';
|
|
6
|
-
|
|
6
|
+
/** PLACEHOLDER -- "I am making up the timing". A hover shorter than this leaves nothing behind. */
|
|
7
|
+
const BRIEF = 500;
|
|
8
|
+
/** PLACEHOLDER -- the longest a bubble lingers after the pointer leaves the trigger. */
|
|
9
|
+
const LINGER_MAX = 3000;
|
|
10
|
+
export function Tooltip({ content, children, className, onKeyDown, onPointerEnter, onPointerLeave, onPointerOver, onBlur, ...rest }) {
|
|
7
11
|
const id = useId();
|
|
8
12
|
const [dismissed, setDismissed] = useState(false);
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
const [open, setOpen] = useState(false);
|
|
14
|
+
// Opened by a tap: closed by a tap elsewhere, never by a timer.
|
|
15
|
+
const [touched, setTouched] = useState(false);
|
|
16
|
+
const wrapper = useRef(null);
|
|
17
|
+
const enteredAt = useRef(0);
|
|
18
|
+
// Whether the pointer was last over the bubble, read when it leaves the wrapper. Kept from
|
|
19
|
+
// `pointerover`, which bubbles, because a leave on the bubble runs before the wrapper's.
|
|
20
|
+
const onBubble = useRef(false);
|
|
21
|
+
const timer = useRef(undefined);
|
|
22
|
+
const cancel = () => {
|
|
23
|
+
if (timer.current !== undefined)
|
|
24
|
+
clearTimeout(timer.current);
|
|
25
|
+
timer.current = undefined;
|
|
26
|
+
};
|
|
27
|
+
useEffect(() => cancel, []);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!touched)
|
|
30
|
+
return;
|
|
31
|
+
const away = (event) => {
|
|
32
|
+
if (!wrapper.current?.contains(event.target)) {
|
|
33
|
+
setOpen(false);
|
|
34
|
+
setTouched(false);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
document.addEventListener('pointerdown', away);
|
|
38
|
+
return () => document.removeEventListener('pointerdown', away);
|
|
39
|
+
}, [touched]);
|
|
40
|
+
return (_jsxs("span", { ref: wrapper, className: ['newtone-tooltip', className].filter(Boolean).join(' '), "data-open": open ? '' : undefined, "data-dismissed": dismissed ? '' : undefined, onKeyDown: (event) => {
|
|
41
|
+
if (event.key === 'Escape') {
|
|
42
|
+
cancel();
|
|
43
|
+
setOpen(false);
|
|
11
44
|
setDismissed(true);
|
|
45
|
+
}
|
|
12
46
|
onKeyDown?.(event);
|
|
47
|
+
}, onPointerEnter: (event) => {
|
|
48
|
+
cancel();
|
|
49
|
+
// A linger that is re-entered keeps counting from the first entry.
|
|
50
|
+
if (!open)
|
|
51
|
+
enteredAt.current = event.timeStamp;
|
|
52
|
+
setOpen(true);
|
|
53
|
+
if (event.pointerType === 'touch')
|
|
54
|
+
setTouched(true);
|
|
55
|
+
onPointerEnter?.(event);
|
|
56
|
+
}, onPointerOver: (event) => {
|
|
57
|
+
onBubble.current =
|
|
58
|
+
event.target.closest?.('.newtone-tooltip-bubble') != null;
|
|
59
|
+
onPointerOver?.(event);
|
|
13
60
|
}, onPointerLeave: (event) => {
|
|
14
61
|
setDismissed(false);
|
|
62
|
+
if (event.pointerType !== 'touch') {
|
|
63
|
+
cancel();
|
|
64
|
+
const hovered = event.timeStamp - enteredAt.current;
|
|
65
|
+
const linger = onBubble.current || hovered < BRIEF ? 0 : Math.min(hovered, LINGER_MAX);
|
|
66
|
+
onBubble.current = false;
|
|
67
|
+
if (linger === 0)
|
|
68
|
+
setOpen(false);
|
|
69
|
+
else
|
|
70
|
+
timer.current = setTimeout(() => setOpen(false), linger);
|
|
71
|
+
}
|
|
15
72
|
onPointerLeave?.(event);
|
|
16
73
|
}, onBlur: (event) => {
|
|
17
74
|
if (!event.currentTarget.contains(event.relatedTarget))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACH,YAAY,EACZ,KAAK,EACL,QAAQ,GAIX,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACH,YAAY,EACZ,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,GAIX,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA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AM,EACT,KAAK,EAAC,QAAQ,EACd,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,SAAS,EACd,SAAS,EAAC,wBAAwB,YAElC,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,KAAK,EAAC,SAAS,YAC1B,OAAO,GACL,GACD,IACP,CACV,CAAA;AACL,CAAC"}
|
|
@@ -39,8 +39,14 @@
|
|
|
39
39
|
* **The disc's hover is painted from the TILE's hover and not its own**, because the pointer is over
|
|
40
40
|
* the button and only incidentally over the disc. That rule has to live here, and it is the reason
|
|
41
41
|
* on-media.css publishes channels rather than only classes: this sheet writes
|
|
42
|
-
* `var(--newtone-on-media-control-
|
|
43
|
-
*
|
|
42
|
+
* `var(--newtone-on-media-control-hover-fill)` and no literal.
|
|
43
|
+
*
|
|
44
|
+
* **It used to win a race and now there is no race**, which is worth recording because the race was
|
|
45
|
+
* invisible. The disc wore `.newtone-on-media-control`, whose `:hover` rule was at the same
|
|
46
|
+
* specificity as the two below, so the only reason these won was that site.css loads on-media.css
|
|
47
|
+
* first. On 2026-09-26 the disc took its own class -- `.newtone-on-media-disc`, which has no states
|
|
48
|
+
* at all, because a decoration has none -- and these two became the only rules that paint it.
|
|
49
|
+
* issues/done/155.
|
|
44
50
|
*
|
|
45
51
|
* **The disc does not scale on hover where the reference's does.** Section 8 defers a motion
|
|
46
52
|
* vocabulary and this band has already spent its two moving things; a transform with a hand-written
|
|
@@ -79,7 +85,7 @@
|
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
.newtone-video-lightbox:focus-visible {
|
|
82
|
-
outline: 2px solid var(--newtone-on-media-ring);
|
|
88
|
+
outline: 2px solid var(--newtone-on-media-focus-ring);
|
|
83
89
|
outline-offset: -4px;
|
|
84
90
|
}
|
|
85
91
|
|
|
@@ -96,7 +102,7 @@
|
|
|
96
102
|
.newtone-video-lightbox-shade {
|
|
97
103
|
position: absolute;
|
|
98
104
|
inset: 0;
|
|
99
|
-
background: var(--newtone-on-media-scrim-soft);
|
|
105
|
+
background: var(--newtone-on-media-scrim-soft-fill);
|
|
100
106
|
}
|
|
101
107
|
|
|
102
108
|
.newtone-video-lightbox-disc {
|
|
@@ -107,11 +113,11 @@
|
|
|
107
113
|
}
|
|
108
114
|
|
|
109
115
|
.newtone-video-lightbox:hover .newtone-video-lightbox-disc {
|
|
110
|
-
background-color: var(--newtone-on-media-control-
|
|
116
|
+
background-color: var(--newtone-on-media-control-hover-fill);
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
.newtone-video-lightbox:active .newtone-video-lightbox-disc {
|
|
114
|
-
background-color: var(--newtone-on-media-control-
|
|
120
|
+
background-color: var(--newtone-on-media-control-pressed-fill);
|
|
115
121
|
}
|
|
116
122
|
|
|
117
123
|
/* Under the disc: half the disc plus the gap, measured from the tile's middle. Written as a sum so
|
|
@@ -137,7 +143,7 @@
|
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
.newtone-video-lightbox-panel::backdrop {
|
|
140
|
-
background: var(--newtone-on-media-scrim-strong);
|
|
146
|
+
background: var(--newtone-on-media-scrim-strong-fill);
|
|
141
147
|
}
|
|
142
148
|
|
|
143
149
|
.newtone-video-lightbox-frame {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-lightbox.d.ts","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"video-lightbox.d.ts","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAM7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACnE;gBACY;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,+BAqF3F"}
|
|
@@ -6,6 +6,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
6
6
|
import { Text } from '../text/index.js';
|
|
7
7
|
import { useRef, useState } from 'react';
|
|
8
8
|
import { Icon } from '../icon/index.js';
|
|
9
|
+
// `Icon` stays because the play disc is not a control and keeps its own glyph; the close button
|
|
10
|
+
// stopped being a hand-written `<button>` on 2026-09-26. Subpath, not the barrel.
|
|
11
|
+
import { Control } from '../control/index.js';
|
|
9
12
|
export function VideoLightbox({ poster, label, src, className, ...rest }) {
|
|
10
13
|
const panel = useRef(null);
|
|
11
14
|
const [playing, setPlaying] = useState(false);
|
|
@@ -15,7 +18,7 @@ export function VideoLightbox({ poster, label, src, className, ...rest }) {
|
|
|
15
18
|
panel.current?.showModal();
|
|
16
19
|
setPlaying(true);
|
|
17
20
|
}
|
|
18
|
-
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: ['newtone-video-lightbox', className].filter(Boolean).join(' '), "aria-haspopup": "dialog", onClick: open, ...rest, children: [_jsx("img", { className: "newtone-video-lightbox-poster", src: poster, alt: "", loading: "lazy", draggable: false }), _jsx("span", { className: "newtone-video-lightbox-shade", "aria-hidden": true }), _jsx("span", { className: "newtone-on-media-
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: ['newtone-video-lightbox', className].filter(Boolean).join(' '), "aria-haspopup": "dialog", onClick: open, ...rest, children: [_jsx("img", { className: "newtone-video-lightbox-poster", src: poster, alt: "", loading: "lazy", draggable: false }), _jsx("span", { className: "newtone-video-lightbox-shade", "aria-hidden": true }), _jsx("span", { className: "newtone-on-media-disc newtone-video-lightbox-disc", "aria-hidden": true, children: _jsx(Icon, { name: "play_arrow", size: "lg", fill: true }) }), _jsx("span", { className: "newtone-on-media-text newtone-video-lightbox-label", children: _jsx(Text, { scale: "body", children: label }) })] }), _jsx("dialog", { ref: panel, className: "newtone-video-lightbox-panel", "aria-label": label,
|
|
19
22
|
// A `<dialog>`'s own box is the panel and its backdrop is a pseudo-element, so a
|
|
20
23
|
// click that lands ON the dialog element and not on anything inside it is a click
|
|
21
24
|
// on the backdrop. That is the whole test; there is no overlay to add.
|
|
@@ -26,6 +29,6 @@ export function VideoLightbox({ poster, label, src, className, ...rest }) {
|
|
|
26
29
|
// `Escape` closes a modal dialog without anything here listening for it, and this
|
|
27
30
|
// is what makes that path stop the film as well -- one handler for both ways out
|
|
28
31
|
// rather than a key listener that has to agree with the close button.
|
|
29
|
-
onClose: () => setPlaying(false), children: _jsxs("div", { className: "newtone-video-lightbox-frame", children: [_jsx("div", { className: "newtone-video-lightbox-close-row", children: _jsx(
|
|
32
|
+
onClose: () => setPlaying(false), children: _jsxs("div", { className: "newtone-video-lightbox-frame", children: [_jsx("div", { className: "newtone-video-lightbox-close-row", children: _jsx(Control, { className: "newtone-on-media-control", icon: "close", size: "xl", ariaLabel: "Close video", onClick: () => panel.current?.close() }) }), playing && (_jsx("iframe", { className: "newtone-video-lightbox-player", src: src, title: label, allow: "autoplay; fullscreen; picture-in-picture", allowFullScreen: true }))] }) })] }));
|
|
30
33
|
}
|
|
31
34
|
//# sourceMappingURL=video-lightbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-lightbox.js","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,wGAAwG;AACxG,oGAAoG;AACpG,kFAAkF;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE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4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -81,6 +81,10 @@
|
|
|
81
81
|
"types": "./dist/media-plate/index.d.ts",
|
|
82
82
|
"default": "./dist/media-plate/index.js"
|
|
83
83
|
},
|
|
84
|
+
"./media-window": {
|
|
85
|
+
"types": "./dist/media-window/index.d.ts",
|
|
86
|
+
"default": "./dist/media-window/index.js"
|
|
87
|
+
},
|
|
84
88
|
"./navbar": {
|
|
85
89
|
"types": "./dist/navbar/index.d.ts",
|
|
86
90
|
"default": "./dist/navbar/index.js"
|