@newtone-dev/ui-react-web 0.44.0 → 0.46.1
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 +5 -3
- package/dist/app-frame/app-frame.css +77 -25
- package/dist/app-frame/app-frame.d.ts +2 -1
- package/dist/app-frame/app-frame.d.ts.map +1 -1
- package/dist/app-frame/app-frame.js +2 -1
- package/dist/app-frame/app-frame.js.map +1 -1
- package/dist/app-frame/index.d.ts +1 -1
- package/dist/app-frame/index.d.ts.map +1 -1
- package/dist/app-frame/launcher/launcher.d.ts.map +1 -1
- package/dist/app-frame/launcher/launcher.js +5 -3
- package/dist/app-frame/launcher/launcher.js.map +1 -1
- package/dist/app-frame/main-menu/main-menu.js +5 -1
- package/dist/app-frame/main-menu/main-menu.js.map +1 -1
- package/dist/app-frame/parts.d.ts +26 -1
- package/dist/app-frame/parts.d.ts.map +1 -1
- package/dist/app-frame/parts.js +17 -3
- package/dist/app-frame/parts.js.map +1 -1
- package/dist/ask-button/ask-button.css +7 -1
- package/dist/beside/beside.css +4 -0
- package/dist/button/button.css +14 -4
- package/dist/button/button.d.ts +12 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +49 -3
- package/dist/button/button.js.map +1 -1
- package/dist/canvas/canvas.css +20 -5
- package/dist/canvas/cells/cells.d.ts +12 -1
- package/dist/canvas/cells/cells.d.ts.map +1 -1
- package/dist/canvas/cells/cells.js +16 -2
- package/dist/canvas/cells/cells.js.map +1 -1
- package/dist/canvas/cells/grid.d.ts +8 -2
- package/dist/canvas/cells/grid.d.ts.map +1 -1
- package/dist/canvas/cells/grid.js +8 -5
- package/dist/canvas/cells/grid.js.map +1 -1
- package/dist/canvas/dock/dock.d.ts +2 -2
- package/dist/canvas/dock/dock.js +2 -2
- package/dist/canvas/dock/dock.js.map +1 -1
- package/dist/card-box/card-box.css +8 -2
- package/dist/card-box/card-box.d.ts.map +1 -1
- package/dist/card-box/card-box.js +1 -1
- package/dist/card-box/card-box.js.map +1 -1
- package/dist/color/index.d.ts +4 -4
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/index.js +17 -15
- package/dist/color/index.js.map +1 -1
- package/dist/color/oklch.d.ts +6 -27
- package/dist/color/oklch.d.ts.map +1 -1
- package/dist/color/oklch.js +23 -61
- package/dist/color/oklch.js.map +1 -1
- package/dist/color/scale.d.ts +3 -18
- package/dist/color/scale.d.ts.map +1 -1
- package/dist/color/scale.js +13 -70
- package/dist/color/scale.js.map +1 -1
- package/dist/color/seeds.d.ts +51 -11
- package/dist/color/seeds.d.ts.map +1 -1
- package/dist/color/seeds.js +127 -41
- package/dist/color/seeds.js.map +1 -1
- package/dist/curve-field/curve-field.css +280 -0
- package/dist/curve-field/curve-field.d.ts +105 -0
- package/dist/curve-field/curve-field.d.ts.map +1 -0
- package/dist/curve-field/curve-field.js +532 -0
- package/dist/curve-field/curve-field.js.map +1 -0
- package/dist/curve-field/index.d.ts +3 -0
- package/dist/curve-field/index.d.ts.map +1 -0
- package/dist/curve-field/index.js +2 -0
- package/dist/curve-field/index.js.map +1 -0
- package/dist/diagram/diagram.css +63 -0
- package/dist/diagram/diagram.d.ts +63 -0
- package/dist/diagram/diagram.d.ts.map +1 -0
- package/dist/diagram/diagram.js +73 -0
- package/dist/diagram/diagram.js.map +1 -0
- package/dist/diagram/geometry.d.ts +60 -0
- package/dist/diagram/geometry.d.ts.map +1 -0
- package/dist/diagram/geometry.js +93 -0
- package/dist/diagram/geometry.js.map +1 -0
- package/dist/diagram/index.d.ts +7 -0
- package/dist/diagram/index.d.ts.map +1 -0
- package/dist/diagram/index.js +4 -0
- package/dist/diagram/index.js.map +1 -0
- package/dist/diagram/layout.d.ts +41 -0
- package/dist/diagram/layout.d.ts.map +1 -0
- package/dist/diagram/layout.js +157 -0
- package/dist/diagram/layout.js.map +1 -0
- package/dist/document/document.d.ts +7 -2
- package/dist/document/document.d.ts.map +1 -1
- package/dist/document/document.js +22 -4
- package/dist/document/document.js.map +1 -1
- package/dist/dynamic-range/dynamic-range.css +100 -0
- package/dist/dynamic-range/dynamic-range.d.ts +27 -0
- package/dist/dynamic-range/dynamic-range.d.ts.map +1 -0
- package/dist/dynamic-range/dynamic-range.js +20 -0
- package/dist/dynamic-range/dynamic-range.js.map +1 -0
- package/dist/dynamic-range/index.d.ts +3 -0
- package/dist/dynamic-range/index.d.ts.map +1 -0
- package/dist/dynamic-range/index.js +2 -0
- package/dist/dynamic-range/index.js.map +1 -0
- package/dist/file-grid/file-grid.css +65 -0
- package/dist/file-grid/file-grid.d.ts +35 -2
- package/dist/file-grid/file-grid.d.ts.map +1 -1
- package/dist/file-grid/file-grid.js +64 -3
- package/dist/file-grid/file-grid.js.map +1 -1
- package/dist/file-grid/index.d.ts +2 -2
- package/dist/file-grid/index.d.ts.map +1 -1
- package/dist/file-grid/index.js +1 -1
- package/dist/file-grid/index.js.map +1 -1
- package/dist/floating-bar/floating-bar.css +122 -32
- package/dist/floating-bar/floating-bar.d.ts +21 -2
- package/dist/floating-bar/floating-bar.d.ts.map +1 -1
- package/dist/floating-bar/floating-bar.js +64 -20
- package/dist/floating-bar/floating-bar.js.map +1 -1
- package/dist/floating-bar/index.d.ts +1 -1
- package/dist/floating-bar/index.d.ts.map +1 -1
- package/dist/font-picker/font-picker.css +4 -2
- package/dist/font-picker/font-picker.d.ts +34 -4
- package/dist/font-picker/font-picker.d.ts.map +1 -1
- package/dist/font-picker/font-picker.js +45 -9
- package/dist/font-picker/font-picker.js.map +1 -1
- package/dist/font-picker/index.d.ts +2 -2
- package/dist/font-picker/index.d.ts.map +1 -1
- package/dist/font-picker/index.js +1 -1
- package/dist/font-picker/index.js.map +1 -1
- package/dist/hint/hint.css +2 -6
- package/dist/icon/glyphs.d.ts +18 -0
- package/dist/icon/glyphs.d.ts.map +1 -0
- package/dist/icon/glyphs.js +17 -0
- package/dist/icon/glyphs.js.map +1 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.d.ts.map +1 -1
- package/dist/icon/index.js +1 -0
- package/dist/icon/index.js.map +1 -1
- package/dist/identity/identity.d.ts +11 -3
- package/dist/identity/identity.d.ts.map +1 -1
- package/dist/identity/identity.js +8 -4
- package/dist/identity/identity.js.map +1 -1
- package/dist/index.d.ts +33 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/inspector/index.d.ts +1 -1
- package/dist/inspector/index.d.ts.map +1 -1
- package/dist/inspector/inspector.css +368 -7
- package/dist/inspector/inspector.d.ts +182 -5
- package/dist/inspector/inspector.d.ts.map +1 -1
- package/dist/inspector/inspector.js +85 -7
- package/dist/inspector/inspector.js.map +1 -1
- package/dist/look-picker/look-picker.css +62 -2
- package/dist/look-picker/look-picker.d.ts +34 -2
- package/dist/look-picker/look-picker.d.ts.map +1 -1
- package/dist/look-picker/look-picker.js +51 -42
- package/dist/look-picker/look-picker.js.map +1 -1
- package/dist/material/material.css +128 -57
- package/dist/number-field/number-field.css +34 -0
- package/dist/number-field/number-field.d.ts +29 -3
- package/dist/number-field/number-field.d.ts.map +1 -1
- package/dist/number-field/number-field.js +61 -10
- package/dist/number-field/number-field.js.map +1 -1
- package/dist/page-editor/page-editor.css +2 -6
- package/dist/picker/picker.css +42 -0
- package/dist/picker/picker.d.ts +10 -1
- package/dist/picker/picker.d.ts.map +1 -1
- package/dist/picker/picker.js +40 -5
- package/dist/picker/picker.js.map +1 -1
- package/dist/pop-menu/index.d.ts +7 -0
- package/dist/pop-menu/index.d.ts.map +1 -0
- package/dist/pop-menu/index.js +6 -0
- package/dist/pop-menu/index.js.map +1 -0
- package/dist/{floating-bar/menu.d.ts → pop-menu/pop-menu.d.ts} +10 -2
- package/dist/pop-menu/pop-menu.d.ts.map +1 -0
- package/dist/{floating-bar/menu.js → pop-menu/pop-menu.js} +35 -12
- package/dist/pop-menu/pop-menu.js.map +1 -0
- package/dist/prompt-field/prompt-field.css +3 -3
- package/dist/prompt-field/prompt-field.d.ts +3 -3
- package/dist/prompt-field/prompt-field.d.ts.map +1 -1
- package/dist/prompt-field/prompt-field.js +10 -4
- package/dist/prompt-field/prompt-field.js.map +1 -1
- package/dist/quick-action/quick-action.css +1 -1
- package/dist/seed-color-field/seed-color-field.css +8 -10
- package/dist/seed-color-field/seed-color-field.d.ts +9 -0
- package/dist/seed-color-field/seed-color-field.d.ts.map +1 -1
- package/dist/seed-color-field/seed-color-field.js +37 -10
- package/dist/seed-color-field/seed-color-field.js.map +1 -1
- package/dist/seed-contrast-field/index.d.ts +5 -0
- package/dist/seed-contrast-field/index.d.ts.map +1 -0
- package/dist/seed-contrast-field/index.js +3 -0
- package/dist/seed-contrast-field/index.js.map +1 -0
- package/dist/seed-contrast-field/seed-contrast-field.css +11 -0
- package/dist/seed-contrast-field/seed-contrast-field.d.ts +36 -0
- package/dist/seed-contrast-field/seed-contrast-field.d.ts.map +1 -0
- package/dist/seed-contrast-field/seed-contrast-field.js +18 -0
- package/dist/seed-contrast-field/seed-contrast-field.js.map +1 -0
- package/dist/seed-contrast-field/seed-contrast-slider.css +112 -0
- package/dist/seed-contrast-field/seed-contrast-slider.d.ts +22 -0
- package/dist/seed-contrast-field/seed-contrast-slider.d.ts.map +1 -0
- package/dist/seed-contrast-field/seed-contrast-slider.js +75 -0
- package/dist/seed-contrast-field/seed-contrast-slider.js.map +1 -0
- package/dist/seed-roundness-field/index.d.ts +3 -0
- package/dist/seed-roundness-field/index.d.ts.map +1 -0
- package/dist/seed-roundness-field/index.js +2 -0
- package/dist/seed-roundness-field/index.js.map +1 -0
- package/dist/seed-roundness-field/seed-roundness-field.css +23 -0
- package/dist/seed-roundness-field/seed-roundness-field.d.ts +39 -0
- package/dist/seed-roundness-field/seed-roundness-field.d.ts.map +1 -0
- package/dist/seed-roundness-field/seed-roundness-field.js +15 -0
- package/dist/seed-roundness-field/seed-roundness-field.js.map +1 -0
- package/dist/seed-steps/index.d.ts +8 -0
- package/dist/seed-steps/index.d.ts.map +1 -0
- package/dist/seed-steps/index.js +7 -0
- package/dist/seed-steps/index.js.map +1 -0
- package/dist/seed-steps/reset-focus.d.ts +16 -0
- package/dist/seed-steps/reset-focus.d.ts.map +1 -0
- package/dist/seed-steps/reset-focus.js +53 -0
- package/dist/seed-steps/reset-focus.js.map +1 -0
- package/dist/seed-steps/seed-steps.css +83 -0
- package/dist/seed-steps/seed-steps.d.ts +47 -0
- package/dist/seed-steps/seed-steps.d.ts.map +1 -0
- package/dist/seed-steps/seed-steps.js +95 -0
- package/dist/seed-steps/seed-steps.js.map +1 -0
- package/dist/shell/shell.css +31 -33
- package/dist/slide-list/slide-list.css +23 -2
- package/dist/slide-list/slide-list.d.ts +11 -2
- package/dist/slide-list/slide-list.d.ts.map +1 -1
- package/dist/slide-list/slide-list.js +6 -6
- package/dist/slide-list/slide-list.js.map +1 -1
- package/dist/split/split.css +11 -8
- package/dist/split/split.d.ts +2 -0
- package/dist/split/split.d.ts.map +1 -1
- package/dist/split/split.js +21 -3
- package/dist/split/split.js.map +1 -1
- package/dist/stage/stage.d.ts +11 -4
- package/dist/stage/stage.d.ts.map +1 -1
- package/dist/stage/stage.js +30 -9
- package/dist/stage/stage.js.map +1 -1
- package/dist/step-list/index.d.ts +3 -0
- package/dist/step-list/index.d.ts.map +1 -0
- package/dist/step-list/index.js +2 -0
- package/dist/step-list/index.js.map +1 -0
- package/dist/step-list/step-list.css +224 -0
- package/dist/step-list/step-list.d.ts +211 -0
- package/dist/step-list/step-list.d.ts.map +1 -0
- package/dist/step-list/step-list.js +242 -0
- package/dist/step-list/step-list.js.map +1 -0
- package/dist/step-strip/index.d.ts +3 -0
- package/dist/step-strip/index.d.ts.map +1 -0
- package/dist/step-strip/index.js +2 -0
- package/dist/step-strip/index.js.map +1 -0
- package/dist/step-strip/step-strip.css +118 -0
- package/dist/step-strip/step-strip.d.ts +52 -0
- package/dist/step-strip/step-strip.d.ts.map +1 -0
- package/dist/step-strip/step-strip.js +47 -0
- package/dist/step-strip/step-strip.js.map +1 -0
- package/dist/suggestion/index.d.ts +3 -0
- package/dist/suggestion/index.d.ts.map +1 -0
- package/dist/suggestion/index.js +2 -0
- package/dist/suggestion/index.js.map +1 -0
- package/dist/suggestion/suggestion.css +45 -0
- package/dist/suggestion/suggestion.d.ts +23 -0
- package/dist/suggestion/suggestion.d.ts.map +1 -0
- package/dist/suggestion/suggestion.js +45 -0
- package/dist/suggestion/suggestion.js.map +1 -0
- package/dist/surface/surface.css +112 -0
- package/dist/switch/switch.css +1 -6
- package/dist/text-field/text-field.css +11 -2
- package/dist/thread/thread.css +2 -10
- package/dist/thread/thread.js +1 -1
- package/dist/thread/thread.js.map +1 -1
- package/dist/tile-picker/index.d.ts +1 -1
- package/dist/tile-picker/index.d.ts.map +1 -1
- package/dist/tile-picker/tile-picker.css +56 -10
- package/dist/tile-picker/tile-picker.d.ts +64 -7
- package/dist/tile-picker/tile-picker.d.ts.map +1 -1
- package/dist/tile-picker/tile-picker.js +79 -47
- package/dist/tile-picker/tile-picker.js.map +1 -1
- package/dist/tile-search/index.d.ts +7 -0
- package/dist/tile-search/index.d.ts.map +1 -0
- package/dist/tile-search/index.js +7 -0
- package/dist/tile-search/index.js.map +1 -0
- package/dist/tile-search/narrow.d.ts +22 -0
- package/dist/tile-search/narrow.d.ts.map +1 -0
- package/dist/tile-search/narrow.js +62 -0
- package/dist/tile-search/narrow.js.map +1 -0
- package/dist/tile-search/search-box.d.ts +19 -0
- package/dist/tile-search/search-box.d.ts.map +1 -0
- package/dist/tile-search/search-box.js +47 -0
- package/dist/tile-search/search-box.js.map +1 -0
- package/dist/tooltip/tooltip.css +13 -20
- package/dist/tooltip/tooltip.d.ts +2 -2
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +15 -2
- package/dist/tooltip/tooltip.js.map +1 -1
- package/dist/workbench/workbench.css +128 -4
- package/dist/workbench/workbench.d.ts +28 -1
- package/dist/workbench/workbench.d.ts.map +1 -1
- package/dist/workbench/workbench.js +13 -4
- package/dist/workbench/workbench.js.map +1 -1
- package/package.json +43 -1
- package/dist/color/gamut.d.ts +0 -20
- package/dist/color/gamut.d.ts.map +0 -1
- package/dist/color/gamut.js +0 -72
- package/dist/color/gamut.js.map +0 -1
- package/dist/floating-bar/menu.d.ts.map +0 -1
- package/dist/floating-bar/menu.js.map +0 -1
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// A file's history, step by step, newest first (2026-11-13, the HuevOS rebuild's History: Slides, Vector, Style Book).
|
|
4
|
+
// Each row: the face of who took the step (or the faces of the people who changed it, `people`), what it did, and who
|
|
5
|
+
// and when under it; a step that undid another or put the file back to a moment says so with a glyph; a step taken back
|
|
6
|
+
// since is struck through, with the consumer's words for it. Each row's actions (Undo this change, Restore this
|
|
7
|
+
// version) are the consumer's, in a more menu at its end. Before an action goes ahead, the consumer may ask under the
|
|
8
|
+
// row: an inline warning naming whose later changes go back, with its own two presses (Undo anyway, Cancel); when it
|
|
9
|
+
// closes, the focus goes back to the row's more button. A step an operator took for the person (Claude, acting for
|
|
10
|
+
// Ana) wears the operator's glyph as its face, the person's small face on it, and the consumer's words for both.
|
|
11
|
+
// S8 (2026-11-13): a row may open (`openable`, `onOpen`): its words are one press, ending in a chevron. The opened
|
|
12
|
+
// step stands in a head over the rows (`opened`): a back press, the step, its actions and its own warning. A name is
|
|
13
|
+
// typed under a row or in the head (`naming`). Skeleton rows while the rows load (`loading`), and one line above the
|
|
14
|
+
// rows (`notice`). Every word is the consumer's. Blueprint components/step-list.md.
|
|
15
|
+
import { useEffect, useId, useLayoutEffect, useRef, } from 'react';
|
|
16
|
+
import { Avatar } from '../avatar/index.js';
|
|
17
|
+
import { Button } from '../button/index.js';
|
|
18
|
+
import { Faces } from '../faces/index.js';
|
|
19
|
+
import { Icon } from '../icon/index.js';
|
|
20
|
+
import { Skeleton } from '../skeleton/index.js';
|
|
21
|
+
import { Text } from '../text/index.js';
|
|
22
|
+
import { TextField } from '../text-field/index.js';
|
|
23
|
+
import { PopMenuRows, usePopMenu } from '../pop-menu/index.js';
|
|
24
|
+
import { useResetFocus } from '../seed-steps/index.js';
|
|
25
|
+
// Is the focus nowhere, on the page, or inside `box`: then a part that is going may move it.
|
|
26
|
+
const adrift = (box) => {
|
|
27
|
+
const at = document.activeElement;
|
|
28
|
+
return !at || at === document.body || !!box?.contains(at);
|
|
29
|
+
};
|
|
30
|
+
// Something under a row or in the head that asks (a warning) or takes words (a name). As it opens, `enter` puts the
|
|
31
|
+
// focus in it; as it closes, a focus it held (now dropped to the page) or one still inside `box` goes to `back`.
|
|
32
|
+
function useInline(open, box, enter, back) {
|
|
33
|
+
const was = useRef(false);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (open)
|
|
36
|
+
enter();
|
|
37
|
+
else if (was.current && adrift(box.current))
|
|
38
|
+
back();
|
|
39
|
+
was.current = open;
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
+
}, [open]);
|
|
42
|
+
}
|
|
43
|
+
/** A file's history, newest first: who did what, when, and what can be done with each step. Blueprint components/step-list.md. */
|
|
44
|
+
export function StepList({ label, steps, moreLabel, onAction, onConfirm, onCancel, empty, older, peopleLabel, peopleMore, onOpen, openLabel, opened, naming, loading = false, notice, className, ...rest }) {
|
|
45
|
+
const list = useRef(null);
|
|
46
|
+
// A row that goes while the focus is in it gives the focus to the list, never to the page.
|
|
47
|
+
const lost = () => setTimeout(() => {
|
|
48
|
+
const at = document.activeElement;
|
|
49
|
+
if (!at || at === document.body)
|
|
50
|
+
list.current?.focus({ preventScroll: true });
|
|
51
|
+
});
|
|
52
|
+
// Show older going while it holds the focus (the consumer drops `older` rather than disabling it): the list takes
|
|
53
|
+
// the focus, as it does from a row that goes.
|
|
54
|
+
const { press: olderPress } = useResetFocus(!!older, () => list.current);
|
|
55
|
+
// The opened step: as it appears, its back press takes the focus; as it goes, a focus left in the list or dropped
|
|
56
|
+
// to the page goes to the row that was opened (its open press, else its more button), else to the list.
|
|
57
|
+
const openedId = opened?.step.id;
|
|
58
|
+
const wasOpen = useRef(undefined);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const was = wasOpen.current;
|
|
61
|
+
wasOpen.current = openedId;
|
|
62
|
+
if (openedId !== undefined) {
|
|
63
|
+
// Opened straight into its name or its warning (the head's own effects ran first): the focus stays there.
|
|
64
|
+
const into = document.activeElement?.closest('.newtone-step-list-head :is(.newtone-step-list-naming, .newtone-step-list-confirm)');
|
|
65
|
+
if (openedId !== was && !into)
|
|
66
|
+
list.current
|
|
67
|
+
?.querySelector('.newtone-step-list-back')
|
|
68
|
+
?.focus({ preventScroll: true });
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (was === undefined || !adrift(list.current))
|
|
72
|
+
return;
|
|
73
|
+
const row = [...(list.current?.querySelectorAll('[data-step-id]') ?? [])].find((r) => r.dataset.stepId === was);
|
|
74
|
+
const to = row?.querySelector('.newtone-step-list-open') ??
|
|
75
|
+
row?.querySelector('.newtone-step-list-more');
|
|
76
|
+
(to ?? list.current)?.focus({ preventScroll: true });
|
|
77
|
+
}, [openedId]);
|
|
78
|
+
return (_jsxs("section", { ...rest, ref: list, tabIndex: -1, className: ['newtone-step-list', className].filter(Boolean).join(' '), "aria-label": label, "aria-busy": loading || undefined, children: [opened ? (_jsx(Head, { opened: opened, naming: naming?.stepId === 'opened' ? naming : undefined, peopleLabel: peopleLabel, peopleMore: peopleMore, onConfirm: onConfirm, onCancel: onCancel })) : null, _jsx("div", { className: "newtone-step-list-notice", role: "status", "data-tone": notice ? (notice.tone ?? 'neutral') : undefined, children: notice ? (_jsxs(_Fragment, { children: [notice.tone === 'warning' ? (_jsx(Icon, { name: "warning", size: "sm", tone: "warning" })) : null, _jsx(Text, { as: "span", scale: "body-sm", tone: "secondary", children: notice.text })] })) : null }), steps.length ? (_jsx("ol", { className: "newtone-step-list-steps", children: steps.map((s) => (_jsx(Step, { step: s, moreLabel: moreLabel, peopleLabel: peopleLabel, peopleMore: peopleMore, onOpen: onOpen, openLabel: openLabel, naming: naming?.stepId === s.id ? naming : undefined, onAction: onAction, onConfirm: onConfirm, onCancel: onCancel, onLost: lost, list: list }, s.id))) })) : empty && !loading ? (_jsx(Text, { as: "p", scale: "body-sm", tone: "secondary", className: "newtone-step-list-empty", children: empty })) : null, loading ? (_jsx("div", { className: "newtone-step-list-loading", "aria-hidden": "true", children: [70, 55, 62].map((w) => (_jsx("div", { className: "newtone-step-list-step newtone-step-list-ghost", children: _jsxs("div", { className: "newtone-step-list-row", children: [_jsx(Skeleton.Circle, { size: "1.75rem" }), _jsxs("span", { className: "newtone-step-list-text", children: [_jsx(Skeleton.Line, { size: "body-sm", width: `${w}%` }), _jsx(Skeleton.Line, { size: "body-sm", width: "35%" })] })] }) }, w))) })) : null, older ? (_jsxs("div", { className: "newtone-step-list-older", children: [_jsx(Button, { size: "sm", variant: "tertiary", className: "newtone-step-list-older-press", disabledFocusable: older.disabled, ...olderPress, onClick: () => older.onPress(), children: older.label }), older.note ? (_jsx(Text, { as: "p", scale: "caption", tone: "secondary", children: older.note })) : null] })) : null] }));
|
|
79
|
+
}
|
|
80
|
+
// The glyph a kind of step wears before its label. A literal per kind, so a consumer's icon subsetting finds every name.
|
|
81
|
+
const KIND = { undo: 'undo', restore: 'history' };
|
|
82
|
+
// A step's face: its people's faces, an operator's glyph with the person's small face on it, or the person's face.
|
|
83
|
+
// Without `peopleLabel`, the stack is no group (an unnamed group says nothing of use); each face still says its name.
|
|
84
|
+
function Face({ step: s, peopleLabel, peopleMore, }) {
|
|
85
|
+
if (s.people?.length)
|
|
86
|
+
return (_jsx(Faces, { className: "newtone-step-list-face newtone-step-list-people", people: s.people, label: peopleLabel ?? '', more: peopleMore, max: 3, size: "1.75rem", ...(peopleLabel ? {} : { role: undefined, 'aria-label': undefined }) }));
|
|
87
|
+
if (s.operator)
|
|
88
|
+
return (_jsxs("span", { className: "newtone-step-list-face newtone-step-list-operator", children: [_jsx(Icon, { name: s.operator.icon ?? 'auto_awesome', size: "sm", fill: true }), s.who ? (_jsx(Avatar, { className: "newtone-step-list-for", alt: "", src: s.who.src, initials: s.who.initials, extended: s.who.extended, size: "0.875rem" })) : null] }));
|
|
89
|
+
if (s.who)
|
|
90
|
+
return (_jsx(Avatar, { className: "newtone-step-list-face", alt: "", src: s.who.src, initials: s.who.initials, extended: s.who.extended, size: "1.75rem" }));
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
// What a step did, and who and when under it: the name and the time said apart (a dot seen, a comma said). With
|
|
94
|
+
// `people`, the faces say who, and the line says when alone.
|
|
95
|
+
function Words({ step: s, labelId, metaId, takenId, }) {
|
|
96
|
+
const who = s.people?.length ? undefined : (s.operator?.label ?? s.who?.name);
|
|
97
|
+
return (_jsxs("span", { className: "newtone-step-list-text", children: [_jsxs(Text, { as: "span", scale: "body-sm", weight: "medium", tone: s.takenBack ? 'secondary' : undefined, struck: !!s.takenBack, className: "newtone-step-list-label", id: labelId, children: [s.kind ? (_jsx(Icon, { name: KIND[s.kind], size: "sm", className: "newtone-step-list-kind" })) : null, s.label] }), _jsxs(Text, { as: "span", scale: "caption", tone: "secondary", className: "newtone-step-list-meta", id: metaId, children: [who ? (_jsxs(_Fragment, { children: [who, _jsx("span", { "aria-hidden": "true", children: " \u00B7 " }), _jsx("span", { className: "newtone-step-list-pause", children: ", " })] })) : null, s.at ? _jsx("time", { dateTime: s.at, children: s.when }) : s.when] }), s.takenBack ? (_jsx(Text, { as: "span", scale: "caption", tone: "secondary", className: "newtone-step-list-taken", id: takenId, children: s.takenBack })) : null] }));
|
|
98
|
+
}
|
|
99
|
+
// A warning under a row or the head: its message, a press that goes ahead and a safe one (the last, which takes the
|
|
100
|
+
// focus as it opens, so Enter does not go ahead by chance). Escape in it is cancel.
|
|
101
|
+
function Confirm({ confirm, label, presses, onConfirm, onCancel, }) {
|
|
102
|
+
return (_jsxs("div", { className: "newtone-step-list-confirm", role: "group", "aria-label": label, onKeyDown: (e) => {
|
|
103
|
+
if (e.key !== 'Escape')
|
|
104
|
+
return;
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
e.stopPropagation();
|
|
107
|
+
onCancel();
|
|
108
|
+
}, children: [_jsxs("div", { className: "newtone-step-list-warning", role: "alert", children: [_jsx(Icon, { name: "warning", size: "sm", tone: "warning" }), _jsx(Text, { as: "p", scale: "body-sm", children: confirm.message })] }), _jsxs("div", { ref: presses, className: "newtone-step-list-presses", children: [_jsx(Button, { size: "sm", variant: "secondary", onClick: onConfirm, children: confirm.confirm }), _jsx(Button, { size: "sm", variant: "tertiary", onClick: onCancel, children: confirm.cancel })] })] }));
|
|
109
|
+
}
|
|
110
|
+
// A name typed inline: a TextField, then Save and Cancel. The field holds no state of its own the consumer cannot see
|
|
111
|
+
// (TextField takes no `value`): it starts at the consumer's value, tells every change, and is set again when the
|
|
112
|
+
// consumer's value moves from outside.
|
|
113
|
+
function Naming({ naming: n, box, }) {
|
|
114
|
+
const id = useId();
|
|
115
|
+
const empty = !!n.required && !n.value.trim();
|
|
116
|
+
useLayoutEffect(() => {
|
|
117
|
+
const input = box.current?.querySelector('input');
|
|
118
|
+
if (input && input.value !== n.value)
|
|
119
|
+
input.value = n.value;
|
|
120
|
+
}, [n.value, box]);
|
|
121
|
+
const keys = (e) => {
|
|
122
|
+
if (e.key === 'Escape') {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
n.onCancel();
|
|
126
|
+
}
|
|
127
|
+
else if (e.key === 'Enter' && !e.nativeEvent.isComposing && e.keyCode !== 229) {
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
e.stopPropagation();
|
|
130
|
+
if (!empty)
|
|
131
|
+
n.onSubmit(n.value);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return (_jsxs("div", { ref: box, className: "newtone-step-list-naming", children: [_jsx(TextField, { label: n.label, name: "newtone-step-list-name", id: `newtone-step-list-name-${id}`, defaultValue: n.value, maxLength: n.maxLength, required: n.required, autoComplete: "off", onInput: (e) => n.onChange(e.currentTarget.value), onKeyDown: keys }), _jsxs("div", { className: "newtone-step-list-presses", onKeyDown: (e) => {
|
|
135
|
+
if (e.key !== 'Escape')
|
|
136
|
+
return;
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
e.stopPropagation();
|
|
139
|
+
n.onCancel();
|
|
140
|
+
}, children: [_jsx(Button, { size: "sm", variant: "primary", disabledFocusable: empty, onClick: () => n.onSubmit(n.value), children: n.save }), _jsx(Button, { size: "sm", variant: "tertiary", onClick: () => n.onCancel(), children: n.cancel })] })] }));
|
|
141
|
+
}
|
|
142
|
+
const intoField = (box) => {
|
|
143
|
+
const input = box.current?.querySelector('input');
|
|
144
|
+
input?.focus({ preventScroll: true });
|
|
145
|
+
input?.select();
|
|
146
|
+
};
|
|
147
|
+
// The opened step, over the rows: the press back, the step, its presses, and what it asks or is named.
|
|
148
|
+
function Head({ opened: o, naming, peopleLabel, peopleMore, onConfirm, onCancel, }) {
|
|
149
|
+
const id = useId();
|
|
150
|
+
const head = useRef(null);
|
|
151
|
+
const presses = useRef(null);
|
|
152
|
+
const field = useRef(null);
|
|
153
|
+
// The press that asked (Restore this version, Name this version): the focus goes back to it, else to the back press.
|
|
154
|
+
const asker = useRef(null);
|
|
155
|
+
const back = () => {
|
|
156
|
+
const to = asker.current?.isConnected
|
|
157
|
+
? asker.current
|
|
158
|
+
: head.current?.querySelector('.newtone-step-list-back');
|
|
159
|
+
to?.focus({ preventScroll: true });
|
|
160
|
+
};
|
|
161
|
+
useInline(!!o.confirm, head, () => presses.current?.querySelector('button:last-child')?.focus(), back);
|
|
162
|
+
useInline(!!naming, head, () => intoField(field), back);
|
|
163
|
+
// A press of the head going while it holds the focus (Restore this version, gone once the version is the current
|
|
164
|
+
// one): the focus goes to the press now in its place, else the last, else the back press; never to the page.
|
|
165
|
+
const lost = (at) => setTimeout(() => {
|
|
166
|
+
const now = document.activeElement;
|
|
167
|
+
if (!head.current?.isConnected || (now && now !== document.body))
|
|
168
|
+
return;
|
|
169
|
+
const actions = [
|
|
170
|
+
...head.current.querySelectorAll('.newtone-step-list-head-actions > button'),
|
|
171
|
+
];
|
|
172
|
+
const to = actions[at] ??
|
|
173
|
+
actions[actions.length - 1] ??
|
|
174
|
+
head.current.querySelector('.newtone-step-list-back');
|
|
175
|
+
to?.focus({ preventScroll: true });
|
|
176
|
+
});
|
|
177
|
+
// Named by the opened step's words, so the back press, which takes the focus, is heard inside it.
|
|
178
|
+
return (_jsxs("div", { ref: head, className: "newtone-step-list-head", role: "group", "aria-labelledby": `${id}-label ${id}-meta`, children: [_jsx(Button, { size: "sm", variant: "tertiary", iconStart: "arrow_back", className: "newtone-step-list-back", onClick: () => o.back.onPress(), children: o.back.label }), _jsxs("div", { className: "newtone-step-list-row newtone-step-list-opened", children: [_jsx(Face, { step: o.step, peopleLabel: peopleLabel, peopleMore: peopleMore }), _jsx(Words, { step: o.step, labelId: `${id}-label`, metaId: `${id}-meta` })] }), o.actions?.length ? (_jsx("div", { className: "newtone-step-list-presses newtone-step-list-head-actions", children: o.actions.map((a) => (_jsx(HeadAction, { action: a, onLost: lost, onPress: (press) => {
|
|
179
|
+
asker.current = press;
|
|
180
|
+
o.onAction?.(a.id);
|
|
181
|
+
} }, a.id))) })) : null, naming ? _jsx(Naming, { naming: naming, box: field }) : null, o.confirm ? (_jsx(Confirm, { confirm: o.confirm, label: o.step.label, presses: presses, onConfirm: () => onConfirm?.('opened'), onCancel: () => onCancel?.('opened') })) : null] }));
|
|
182
|
+
}
|
|
183
|
+
// One press of the head. Going while it holds the focus, it tells the head where it stood (`onLost`), before it leaves
|
|
184
|
+
// the page.
|
|
185
|
+
function HeadAction({ action: a, onPress, onLost, }) {
|
|
186
|
+
const el = useRef(null);
|
|
187
|
+
useLayoutEffect(() => () => {
|
|
188
|
+
const b = el.current;
|
|
189
|
+
if (b && b === document.activeElement)
|
|
190
|
+
onLost(b.parentElement ? [...b.parentElement.children].indexOf(b) : 0);
|
|
191
|
+
},
|
|
192
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
193
|
+
[]);
|
|
194
|
+
return (_jsx(Button, { size: "sm", variant: a.variant ?? 'secondary', onFocus: (e) => {
|
|
195
|
+
el.current = e.currentTarget;
|
|
196
|
+
}, onClick: (e) => onPress(e.currentTarget), children: a.label }));
|
|
197
|
+
}
|
|
198
|
+
function Step({ step: s, moreLabel, peopleLabel, peopleMore, onOpen, openLabel, naming, onAction, onConfirm, onCancel, onLost, list, }) {
|
|
199
|
+
const pop = usePopMenu('below', 'menu');
|
|
200
|
+
const row = useRef(null);
|
|
201
|
+
const presses = useRef(null);
|
|
202
|
+
const field = useRef(null);
|
|
203
|
+
const id = useId();
|
|
204
|
+
// As a warning or a name under the row closes (either press, Escape, Enter, or the consumer clearing it), a focus
|
|
205
|
+
// it held goes back to the row's more button, else its open press, else the list.
|
|
206
|
+
const back = () => {
|
|
207
|
+
const to = pop.button.ref.current ??
|
|
208
|
+
row.current?.querySelector('.newtone-step-list-open');
|
|
209
|
+
if (to)
|
|
210
|
+
to.focus();
|
|
211
|
+
else if (list.current)
|
|
212
|
+
onLost();
|
|
213
|
+
};
|
|
214
|
+
// The warning takes the focus as it opens, on its safe press (the last), so it is read and Enter does not go ahead
|
|
215
|
+
// by chance.
|
|
216
|
+
useInline(!!s.confirm, row, () => presses.current?.querySelector('button:last-child')?.focus(), back);
|
|
217
|
+
useInline(!!naming, row, () => intoField(field), back);
|
|
218
|
+
// The row itself going while the focus is in it (a step dropped from the list): the list takes it.
|
|
219
|
+
useLayoutEffect(() => {
|
|
220
|
+
const li = row.current;
|
|
221
|
+
return () => {
|
|
222
|
+
if (li?.contains(document.activeElement))
|
|
223
|
+
onLost();
|
|
224
|
+
};
|
|
225
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
226
|
+
}, []);
|
|
227
|
+
const more = `${moreLabel}: ${s.label}`;
|
|
228
|
+
const opens = !!s.openable && !!onOpen;
|
|
229
|
+
const acts = !!s.actions?.length;
|
|
230
|
+
// The open press or the more button going while it holds the focus (a step that stops opening after a failed open,
|
|
231
|
+
// its actions taken away): the focus goes to the row's other press, else the list; never to the page.
|
|
232
|
+
const { press: openPress } = useResetFocus(opens, () => pop.button.ref.current ?? list.current);
|
|
233
|
+
const { press: morePress } = useResetFocus(acts, () => row.current?.querySelector('.newtone-step-list-open') ?? list.current);
|
|
234
|
+
const metaId = `${id}-meta`;
|
|
235
|
+
const takenId = s.takenBack ? `${id}-taken` : undefined;
|
|
236
|
+
// Who changed it, said with an open press (the faces stand outside it): the list's people words, then their names.
|
|
237
|
+
const peopleId = opens && s.people?.length ? `${id}-people` : undefined;
|
|
238
|
+
return (_jsxs("li", { ref: row, className: "newtone-step-list-step", "data-step-id": s.id, "data-taken-back": s.takenBack ? '' : undefined, "data-current": s.current ? '' : undefined, "aria-current": s.current ? 'step' : undefined, children: [_jsxs("div", { className: "newtone-step-list-row", children: [_jsx(Face, { step: s, peopleLabel: peopleLabel, peopleMore: peopleMore }), peopleId ? (_jsx("span", { id: peopleId, hidden: true, children: [peopleLabel, s.people?.map((p) => p.name).join(', ')]
|
|
239
|
+
.filter(Boolean)
|
|
240
|
+
.join(' ') })) : null, opens ? (_jsxs("button", { type: "button", className: "newtone-step-list-open", "aria-label": openLabel ? `${openLabel}: ${s.label}` : s.label, "aria-describedby": [peopleId, metaId, takenId].filter(Boolean).join(' '), ...openPress, onClick: () => onOpen?.(s.id), children: [_jsx(Words, { step: s, metaId: metaId, takenId: takenId }), _jsx(Icon, { name: "chevron_right", size: "sm", className: "newtone-step-list-chevron" })] })) : (_jsx(Words, { step: s })), acts ? (_jsxs(_Fragment, { children: [_jsx("button", { ...pop.button, ...morePress, className: "newtone-step-list-more", "aria-label": more, title: moreLabel, children: _jsx(Icon, { name: "more_horiz", size: "sm" }) }), _jsx("div", { ...pop.menu, "aria-label": more, children: pop.open ? (_jsx(PopMenuRows, { items: s.actions ?? [], onPick: (a) => pop.done(() => onAction?.(s.id, a)) })) : null })] })) : null] }), naming ? _jsx(Naming, { naming: naming, box: field }) : null, s.confirm ? (_jsx(Confirm, { confirm: s.confirm, label: s.label, presses: presses, onConfirm: () => onConfirm?.(s.id), onCancel: () => onCancel?.(s.id) })) : null] }));
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=step-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-list.js","sourceRoot":"","sources":["../../src/step-list/step-list.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AACZ,uHAAuH;AACvH,sHAAsH;AACtH,wHAAwH;AACxH,gHAAgH;AAChH,sHAAsH;AACtH,qHAAqH;AACrH,mHAAmH;AACnH,iHAAiH;AACjH,mHAAmH;AACnH,qHAAqH;AACrH,qHAAqH;AACrH,oFAAoF;AAEpF,OAAO,EACH,SAAS,EACT,KAAK,EACL,eAAe,EACf,MAAM,GAKT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAoB,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAqNtD,6FAA6F;AAC7F,MAAM,MAAM,GAAG,CAAC,GAAmC,EAAE,EAAE;IACnD,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAA;IACjC,OA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,EAAE,MAAM,iBAAiB,CAAA;AAC3C,YAAY,EACR,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,gBAAgB,GACnB,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/step-strip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* StepStrip -- blueprint components/step-strip.md. A row of colours painted from data, one swatch per step: the numbers
|
|
2
|
+
* under it, the consumer's markers over it. The colours are data, not the interface's: each swatch's paint is written on
|
|
3
|
+
* it in step-strip.tsx (--_step-strip-color, private), never a role or a --newtone-color-… property. The steps run left
|
|
4
|
+
* to right in any writing direction, as a ladder does.
|
|
5
|
+
*
|
|
6
|
+
* LENGTHS IT DECIDES:
|
|
7
|
+
* 24px the strip; 1px its hairline (divider.secondary, Joshua 2026-11-14: quiet beside the panel's fields) and radius.sm corners
|
|
8
|
+
* 1px a marker's tick, 6px long, down to the middle of its step
|
|
9
|
+
* The rows of numbers and markers are one caption line high: each holds a zero-width line of its own, its words
|
|
10
|
+
* standing over it, so their height is the type's and no length is written for it. */
|
|
11
|
+
.newtone-step-strip {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: var(--newtone-space-1);
|
|
15
|
+
min-inline-size: 0;
|
|
16
|
+
color: var(--newtone-role-text-primary);
|
|
17
|
+
}
|
|
18
|
+
.newtone-step-strip-list {
|
|
19
|
+
display: flex;
|
|
20
|
+
direction: ltr;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
block-size: 24px;
|
|
23
|
+
min-inline-size: 0;
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
list-style: none;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
border: 1px solid var(--newtone-role-divider-secondary);
|
|
29
|
+
border-radius: var(--newtone-radius-sm);
|
|
30
|
+
}
|
|
31
|
+
.newtone-step-strip-step {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex: 1 1 0;
|
|
34
|
+
min-inline-size: 0;
|
|
35
|
+
}
|
|
36
|
+
.newtone-step-strip-swatch {
|
|
37
|
+
flex: 1;
|
|
38
|
+
background: var(--_step-strip-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* The numbers and the markers: each word at its step's middle, centred, or from the step near the strip's ends. */
|
|
42
|
+
.newtone-step-strip-numbers,
|
|
43
|
+
.newtone-step-strip-marks {
|
|
44
|
+
position: relative;
|
|
45
|
+
direction: ltr;
|
|
46
|
+
}
|
|
47
|
+
.newtone-step-strip-numbers::before,
|
|
48
|
+
.newtone-step-strip-marks::before {
|
|
49
|
+
content: '\200b';
|
|
50
|
+
}
|
|
51
|
+
.newtone-step-strip-marks {
|
|
52
|
+
padding-block-end: 6px;
|
|
53
|
+
}
|
|
54
|
+
.newtone-step-strip-number,
|
|
55
|
+
.newtone-step-strip-mark {
|
|
56
|
+
position: absolute;
|
|
57
|
+
left: calc(var(--_step-strip-at) * 100%);
|
|
58
|
+
transform: translateX(-50%);
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
.newtone-step-strip-number {
|
|
62
|
+
inset-block-start: 0;
|
|
63
|
+
}
|
|
64
|
+
.newtone-step-strip-mark {
|
|
65
|
+
inset-block-end: 0;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: center;
|
|
69
|
+
}
|
|
70
|
+
.newtone-step-strip-mark::after {
|
|
71
|
+
content: '';
|
|
72
|
+
inline-size: 1px;
|
|
73
|
+
block-size: 6px;
|
|
74
|
+
background: var(--newtone-role-text-primary);
|
|
75
|
+
}
|
|
76
|
+
.newtone-step-strip-number:where([data-edge='start']),
|
|
77
|
+
.newtone-step-strip-mark:where([data-edge='start']) {
|
|
78
|
+
align-items: flex-start;
|
|
79
|
+
transform: none;
|
|
80
|
+
}
|
|
81
|
+
.newtone-step-strip-number:where([data-edge='end']),
|
|
82
|
+
.newtone-step-strip-mark:where([data-edge='end']) {
|
|
83
|
+
align-items: flex-end;
|
|
84
|
+
transform: translateX(-100%);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* `card` (2026-11-14, Style Book): as Slides' slide on its screen. Taller, radius.md, no hairline: the low shadow
|
|
88
|
+
* (material.css's --_shadow-low) and the lit edge, light at the top to dark at the foot, a 1px ring drawn on its own layer
|
|
89
|
+
* over the swatches, edge it. Its swatches stay clipped to the corners; the shadow falls outside, unclipped. */
|
|
90
|
+
.newtone-step-strip[data-look='card'] > .newtone-step-strip-list {
|
|
91
|
+
position: relative;
|
|
92
|
+
block-size: 64px;
|
|
93
|
+
border: 0;
|
|
94
|
+
border-radius: var(--newtone-radius-md);
|
|
95
|
+
box-shadow: var(--_shadow-low);
|
|
96
|
+
transition: block-size 200ms ease;
|
|
97
|
+
}
|
|
98
|
+
/* In focus (2026-11-14, Style Book: the palette being edited): taller, as a focus mode. */
|
|
99
|
+
.newtone-step-strip[data-look='card'][data-focused] > .newtone-step-strip-list {
|
|
100
|
+
block-size: 160px;
|
|
101
|
+
}
|
|
102
|
+
@media (prefers-reduced-motion: reduce) {
|
|
103
|
+
.newtone-step-strip[data-look='card'] > .newtone-step-strip-list {
|
|
104
|
+
transition: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.newtone-step-strip[data-look='card'] > .newtone-step-strip-list::after {
|
|
108
|
+
content: '';
|
|
109
|
+
position: absolute;
|
|
110
|
+
inset: 0;
|
|
111
|
+
padding: 1px;
|
|
112
|
+
border-radius: inherit;
|
|
113
|
+
background: var(--_material-lit) border-box;
|
|
114
|
+
mask:
|
|
115
|
+
linear-gradient(#000 0 0) content-box exclude,
|
|
116
|
+
linear-gradient(#000 0 0);
|
|
117
|
+
pointer-events: none;
|
|
118
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
/** One step's colour, as an engine gives it (`deriveScale`'s steps): its OKLCH (`l` 0 to 1) and its sRGB hex. */
|
|
3
|
+
export interface StepStripStep {
|
|
4
|
+
oklch: {
|
|
5
|
+
l: number;
|
|
6
|
+
c: number;
|
|
7
|
+
h: number;
|
|
8
|
+
};
|
|
9
|
+
srgb: string;
|
|
10
|
+
}
|
|
11
|
+
/** A few words over a step, with a tick down to it: where a key lands. */
|
|
12
|
+
export interface StepStripMarker {
|
|
13
|
+
step: number;
|
|
14
|
+
label: string;
|
|
15
|
+
}
|
|
16
|
+
/** Which of each step's two colours is painted: `auto`, the OKLCH where the browser paints `oklch()`, else the hex. */
|
|
17
|
+
export type StepStripChannel = 'auto' | 'oklch' | 'srgb';
|
|
18
|
+
export interface StepStripLabels {
|
|
19
|
+
/** Each swatch's name, as assistive tech says it, given the step and its colour: "Step 25, #7a6ff0". */
|
|
20
|
+
stepLabel: (step: number, color: StepStripStep) => string;
|
|
21
|
+
/**
|
|
22
|
+
* The words a shown number says (2026-11-14, HuevOS's Style Book names steps by their lightness: "92"); left out,
|
|
23
|
+
* the step's index. Display only: it is aria-hidden, as the numbers are; `stepLabel` is what is said.
|
|
24
|
+
*/
|
|
25
|
+
number?: (step: number) => string;
|
|
26
|
+
}
|
|
27
|
+
export interface StepStripProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
28
|
+
/** The strip's name, as assistive tech says it (its list's name); not drawn. */
|
|
29
|
+
label: string;
|
|
30
|
+
/** The colours, step 0 first; any count. */
|
|
31
|
+
steps: StepStripStep[];
|
|
32
|
+
/** Which colour each swatch paints: `auto` (the default), `oklch` or `srgb`. */
|
|
33
|
+
channel?: StepStripChannel;
|
|
34
|
+
/** Every how many steps a number stands under the strip: 5. The first and the last always; 0 for none. */
|
|
35
|
+
numbers?: number;
|
|
36
|
+
/** Words over steps, each with a tick down to its step. */
|
|
37
|
+
markers?: StepStripMarker[];
|
|
38
|
+
/**
|
|
39
|
+
* `card` (2026-11-14, HuevOS's Style Book): the strip as Slides' slide stands on its screen, taller (64px), rounded at
|
|
40
|
+
* radius.md, raised by the low shadow and the lit edge (material.css), no hairline. For a palette shown for itself.
|
|
41
|
+
*/
|
|
42
|
+
look?: 'plain' | 'card';
|
|
43
|
+
/**
|
|
44
|
+
* A `card` in focus (2026-11-14, HuevOS's Style Book: the palette being edited): it grows taller, 64px to 160px, eased
|
|
45
|
+
* (none under reduced motion), as a focus mode. Ignored on a `plain` strip.
|
|
46
|
+
*/
|
|
47
|
+
focused?: boolean;
|
|
48
|
+
labels: StepStripLabels;
|
|
49
|
+
}
|
|
50
|
+
/** A row of colours painted from data. Blueprint components/step-strip.md. */
|
|
51
|
+
export declare function StepStrip({ label, steps, channel, numbers, markers, look, focused, labels, className, ...rest }: StepStripProps): import("react").JSX.Element;
|
|
52
|
+
//# sourceMappingURL=step-strip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-strip.d.ts","sourceRoot":"","sources":["../../src/step-strip/step-strip.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAmD,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAI5F,iHAAiH;AACjH,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,IAAI,EAAE,MAAM,CAAA;CACf;AAED,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,uHAAuH;AACvH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAExD,MAAM,WAAW,eAAe;IAC5B,wGAAwG;IACxG,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,MAAM,CAAA;IACzD;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CACpC;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACpF,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAA;IACb,4CAA4C;IAC5C,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,gFAAgF;IAChF,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,0GAA0G;IAC1G,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,eAAe,CAAA;CAC1B;AAsBD,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,KAAK,EACL,OAAgB,EAChB,OAAW,EACX,OAAO,EACP,IAAc,EACd,OAAe,EACf,MAAM,EACN,SAAS,EACT,GAAG,IAAI,EACV,EAAE,cAAc,+BAqEhB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// A row of colours painted from data, one swatch per step, step 0 at the left (2026-11-14): what an engine produced for
|
|
4
|
+
// a palette's steps, before it reaches a token. Each colour is the consumer's, as the engine gives it (its OKLCH and its
|
|
5
|
+
// hex), so the strip never takes a palette's name and never reads a `--newtone-color-…` property: it shows what a seed
|
|
6
|
+
// would paint, not what the page already wears. Heard as an ordered list of pictures, each named in the consumer's
|
|
7
|
+
// words. Blueprint components/step-strip.md; contract _blueprint/contracts/step-strip.md.
|
|
8
|
+
import { useId, useSyncExternalStore } from 'react';
|
|
9
|
+
import { cssNumber } from '../color/index.js';
|
|
10
|
+
import { Text } from '../text/index.js';
|
|
11
|
+
// Whether the browser paints `oklch()`, asked as seedProperties asks it (color/seeds.ts, prefersOklch). A server has
|
|
12
|
+
// no CSS to ask and paints the hex; hydrating, React renders the server's answer first and then the browser's.
|
|
13
|
+
const unchanging = () => () => { };
|
|
14
|
+
const oklchHere = () => typeof CSS !== 'undefined' && CSS.supports?.('color', 'oklch(0% 0 0)') === true;
|
|
15
|
+
const onServer = () => false;
|
|
16
|
+
/** A step's paint, OKLCH written as seedProperties writes it. */
|
|
17
|
+
const paint = (c, wide) => wide ? `oklch(${cssNumber(c.oklch.l * 100)}% ${cssNumber(c.oklch.c)} ${cssNumber(c.oklch.h)})` : c.srgb;
|
|
18
|
+
/** The steps numbered: every `every`th, the first and the last always, leaving out one that would crowd the last. */
|
|
19
|
+
function numbered(count, every) {
|
|
20
|
+
if (!(every > 0) || count < 1)
|
|
21
|
+
return [];
|
|
22
|
+
const last = count - 1;
|
|
23
|
+
const out = [];
|
|
24
|
+
for (let i = 0; i < last; i += every)
|
|
25
|
+
if (i === 0 || last - i >= every / 2)
|
|
26
|
+
out.push(i);
|
|
27
|
+
out.push(last);
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
/** A row of colours painted from data. Blueprint components/step-strip.md. */
|
|
31
|
+
export function StepStrip({ label, steps, channel = 'auto', numbers = 5, markers, look = 'plain', focused = false, labels, className, ...rest }) {
|
|
32
|
+
const id = useId();
|
|
33
|
+
const here = useSyncExternalStore(unchanging, oklchHere, onServer);
|
|
34
|
+
const wide = channel === 'oklch' || (channel === 'auto' && here);
|
|
35
|
+
const count = steps.length;
|
|
36
|
+
// Where a step's middle stands along the strip, 0 to 1; near an end, words start or end there rather than centre.
|
|
37
|
+
const at = (i) => (i + 0.5) / count;
|
|
38
|
+
const edge = (f) => (f < 0.1 ? 'start' : f > 0.9 ? 'end' : undefined);
|
|
39
|
+
const marks = (markers ?? []).filter((m) => Number.isInteger(m.step) && m.step >= 0 && m.step < count);
|
|
40
|
+
const markId = (k) => `${id}mark${k}`;
|
|
41
|
+
const shown = numbered(count, Math.round(numbers));
|
|
42
|
+
return (_jsxs("div", { ...rest, className: ['newtone-step-strip', className].filter(Boolean).join(' '), "data-look": look === 'card' ? 'card' : undefined, "data-focused": look === 'card' && focused ? '' : undefined, children: [marks.length ? (_jsx(Text, { as: "div", scale: "caption", measure: "none", className: "newtone-step-strip-marks", "aria-hidden": "true", children: marks.map((m, k) => (_jsx("span", { id: markId(k), className: "newtone-step-strip-mark", "data-edge": edge(at(m.step)), style: { '--_step-strip-at': at(m.step) }, children: m.label }, k))) })) : null, _jsx("ol", { className: "newtone-step-strip-list", "aria-label": label, children: steps.map((c, i) => {
|
|
43
|
+
const described = marks.flatMap((m, k) => (m.step === i ? [markId(k)] : []));
|
|
44
|
+
return (_jsx("li", { className: "newtone-step-strip-step", children: _jsx("span", { role: "img", className: "newtone-step-strip-swatch", "aria-label": labels.stepLabel(i, c), "aria-describedby": described.length ? described.join(' ') : undefined, style: { '--_step-strip-color': paint(c, wide) } }) }, i));
|
|
45
|
+
}) }), shown.length ? (_jsx(Text, { as: "div", scale: "caption", tone: "secondary", figures: "tabular", measure: "none", className: "newtone-step-strip-numbers", "aria-hidden": "true", children: shown.map((i) => (_jsx("span", { className: "newtone-step-strip-number", "data-edge": i === 0 ? 'start' : i === count - 1 ? 'end' : undefined, style: { '--_step-strip-at': at(i) }, children: labels.number ? labels.number(i) : i }, i))) })) : null] }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=step-strip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-strip.js","sourceRoot":"","sources":["../../src/step-strip/step-strip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AACZ,wHAAwH;AACxH,yHAAyH;AACzH,uHAAuH;AACvH,mHAAmH;AACnH,0FAA0F;AAE1F,OAAO,EAAE,KAAK,EAAE,oBAAoB,E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AA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/suggestion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* Suggestion -- blueprint components/suggestion.md. What the system proposes, inline: the assistant's glyph in the
|
|
2
|
+
* accent, the words, then Accept and Dismiss (Button: import button.css; busy, they wait as Button's own
|
|
3
|
+
* `disabledFocusable`, drawn by button.css), wrapping under the words when the line is
|
|
4
|
+
* too narrow for both. On the secondary surface, radius.md, as a quiet note beside what it is about. Solid always: it
|
|
5
|
+
* is content's companion, never a control over moving content (material.N2).
|
|
6
|
+
*
|
|
7
|
+
* LENGTHS IT DECIDES:
|
|
8
|
+
* 12rem the least the words keep before the presses wrap under them
|
|
9
|
+
* 1px the said-once region's box, hidden from sight and out of the row's flow (absolute), so it adds no gap */
|
|
10
|
+
.newtone-suggestion {
|
|
11
|
+
position: relative;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: var(--newtone-space-2);
|
|
16
|
+
min-inline-size: 0;
|
|
17
|
+
padding: var(--newtone-space-2) var(--newtone-space-3);
|
|
18
|
+
border-radius: var(--newtone-radius-md);
|
|
19
|
+
background: var(--newtone-role-surface-secondary);
|
|
20
|
+
color: var(--newtone-role-text-primary);
|
|
21
|
+
}
|
|
22
|
+
.newtone-suggestion-said {
|
|
23
|
+
position: absolute;
|
|
24
|
+
inline-size: 1px;
|
|
25
|
+
block-size: 1px;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
clip-path: inset(50%);
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
}
|
|
30
|
+
.newtone-suggestion-glyph {
|
|
31
|
+
flex: none;
|
|
32
|
+
}
|
|
33
|
+
.newtone-suggestion-words {
|
|
34
|
+
flex: 1 1 12rem;
|
|
35
|
+
min-inline-size: 0;
|
|
36
|
+
margin: 0;
|
|
37
|
+
overflow-wrap: anywhere;
|
|
38
|
+
}
|
|
39
|
+
.newtone-suggestion-presses {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex: none;
|
|
42
|
+
flex-wrap: wrap;
|
|
43
|
+
gap: var(--newtone-space-1);
|
|
44
|
+
margin-inline-start: auto;
|
|
45
|
+
}
|