@bigpixelrocket/uiok 0.1.4 → 0.2.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/CHANGELOG.md +95 -1
- package/README.md +1 -1
- package/dist/activity/ActivityBar.d.ts +21 -8
- package/dist/activity/ActivityBar.js +15 -5
- package/dist/activity/activity.css +53 -6
- package/dist/button/Button.d.ts +10 -6
- package/dist/button/Button.js +6 -1
- package/dist/button/button.css +201 -33
- package/dist/charts/Line.logic.d.ts +6 -0
- package/dist/charts/Line.logic.js +9 -0
- package/dist/charts/LineChart.js +11 -4
- package/dist/charts/Pie.logic.d.ts +89 -1
- package/dist/charts/Pie.logic.js +272 -2
- package/dist/charts/PieChart.d.ts +2 -1
- package/dist/charts/PieChart.js +12 -5
- package/dist/charts/PieFill.d.ts +15 -0
- package/dist/charts/PieFill.js +33 -0
- package/dist/charts/ResultChart.d.ts +2 -2
- package/dist/charts/ResultChart.js +173 -47
- package/dist/charts/ResultChart.logic.d.ts +60 -4
- package/dist/charts/ResultChart.logic.js +105 -6
- package/dist/charts/Scatter.logic.d.ts +18 -4
- package/dist/charts/Scatter.logic.js +98 -22
- package/dist/charts/ScatterChart.js +19 -5
- package/dist/charts/charts.css +233 -116
- package/dist/charts/seriesColour.d.ts +2 -0
- package/dist/charts/seriesColour.js +1 -1
- package/dist/datetime/DateTimePicker.d.ts +12 -2
- package/dist/datetime/DateTimePicker.js +61 -16
- package/dist/datetime/DateTimePicker.logic.d.ts +29 -0
- package/dist/datetime/DateTimePicker.logic.js +25 -0
- package/dist/datetime/datetime.css +89 -49
- package/dist/dialog/ConfirmDialog.d.ts +69 -20
- package/dist/dialog/ConfirmDialog.js +39 -12
- package/dist/dialog/DialogLayer.d.ts +25 -0
- package/dist/dialog/DialogLayer.js +24 -0
- package/dist/dialog/DialogLegend.d.ts +2 -1
- package/dist/dialog/DialogLegend.js +10 -5
- package/dist/dialog/DialogLegend.logic.d.ts +15 -3
- package/dist/dialog/DialogLegend.logic.js +8 -4
- package/dist/dialog/DialogLists.d.ts +157 -0
- package/dist/dialog/DialogLists.js +137 -0
- package/dist/dialog/ModalDialog.d.ts +20 -15
- package/dist/dialog/ModalDialog.js +22 -7
- package/dist/dialog/dialog.css +570 -127
- package/dist/dialog/index.d.ts +7 -1
- package/dist/dialog/index.js +7 -1
- package/dist/field/Check.d.ts +15 -0
- package/dist/field/Check.js +23 -0
- package/dist/field/field.css +812 -0
- package/dist/field/index.d.ts +10 -0
- package/dist/field/index.js +10 -0
- package/dist/field/labelHelp.d.ts +33 -0
- package/dist/field/labelHelp.js +22 -0
- package/dist/filter/FilterIcon.js +2 -1
- package/dist/filter/filter.css +72 -20
- package/dist/grid/DataGrid.d.ts +19 -2
- package/dist/grid/DataGrid.js +122 -41
- package/dist/grid/DataGrid.logic.d.ts +15 -3
- package/dist/grid/DataGrid.logic.js +18 -5
- package/dist/grid/grid.css +481 -56
- package/dist/icon/Spinner.d.ts +16 -0
- package/dist/icon/Spinner.js +13 -0
- package/dist/icon/index.d.ts +5 -0
- package/dist/icon/index.js +5 -0
- package/dist/icon/sizes.d.ts +19 -0
- package/dist/icon/sizes.js +19 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/keychord/KeyChord.d.ts +12 -1
- package/dist/keychord/KeyChord.js +2 -2
- package/dist/keychord/index.d.ts +1 -1
- package/dist/keychord/keychord.css +87 -9
- package/dist/labels/dialog.d.ts +12 -1
- package/dist/labels/dialog.js +3 -1
- package/dist/labels/selectAll.d.ts +4 -4
- package/dist/labels/selectAll.js +1 -1
- package/dist/legend/KeyLegendStrip.js +1 -1
- package/dist/legend/legend.css +82 -57
- package/dist/listing/Listing.d.ts +17 -10
- package/dist/listing/Listing.js +33 -26
- package/dist/listing/listing.css +1665 -237
- package/dist/menu/menu.css +227 -67
- package/dist/menu/useBellBeat.js +2 -2
- package/dist/namecut/NameCut.d.ts +3 -1
- package/dist/namecut/NameCut.js +152 -5
- package/dist/namecut/NameCut.logic.d.ts +5 -3
- package/dist/namecut/NameCut.logic.js +20 -5
- package/dist/namecut/namecut.css +27 -7
- package/dist/pager/Pager.d.ts +12 -4
- package/dist/pager/Pager.js +21 -7
- package/dist/pager/pager.css +41 -30
- package/dist/palette/Palette.js +2 -1
- package/dist/palette/palette.css +121 -60
- package/dist/pane/PaneActions.d.ts +56 -14
- package/dist/pane/PaneActions.js +64 -16
- package/dist/pane/PaneFrame.d.ts +37 -5
- package/dist/pane/PaneFrame.js +246 -11
- package/dist/pane/index.d.ts +4 -2
- package/dist/pane/index.js +4 -2
- package/dist/pane/toolWords.d.ts +14 -0
- package/dist/pane/toolWords.js +26 -0
- package/dist/pane/useToolbarFit.d.ts +25 -0
- package/dist/pane/useToolbarFit.js +95 -0
- package/dist/run/RunHeader.d.ts +5 -3
- package/dist/run/RunHeader.js +11 -8
- package/dist/run/run.css +64 -79
- package/dist/segmented/SegmentedChoice.d.ts +18 -2
- package/dist/segmented/SegmentedChoice.js +18 -7
- package/dist/segmented/segmented.css +62 -22
- package/dist/selectall/SelectAllBar.d.ts +4 -3
- package/dist/selectall/SelectAllBar.js +4 -3
- package/dist/selectall/selectall.css +17 -12
- package/dist/shell/shell.css +1073 -0
- package/dist/styles.css +620 -22
- package/dist/surface/surface.css +154 -0
- package/dist/tabs/PageTabs.d.ts +10 -5
- package/dist/tabs/PageTabs.js +126 -37
- package/dist/tabs/tabs.css +131 -51
- package/dist/terminal/Terminal.js +3 -1
- package/dist/terminal/Terminal.logic.d.ts +5 -4
- package/dist/terminal/Terminal.logic.js +9 -4
- package/dist/terminal/TerminalMenu.d.ts +4 -1
- package/dist/terminal/TerminalMenu.js +12 -5
- package/dist/terminal/ghostty/contrast.logic.d.ts +45 -0
- package/dist/terminal/ghostty/contrast.logic.js +130 -0
- package/dist/terminal/ghostty/core.d.ts +6 -0
- package/dist/terminal/ghostty/renderer.d.ts +9 -2
- package/dist/terminal/ghostty/renderer.js +91 -14
- package/dist/terminal/ghostty/surface.d.ts +8 -0
- package/dist/terminal/ghostty/surface.js +27 -1
- package/dist/terminal/terminal.css +87 -61
- package/dist/text/text.css +16 -7
- package/dist/themes/catalog.js +4 -3
- package/dist/themes/themes.generated.css +1307 -264
- package/dist/themes/tokens.d.ts +69 -14
- package/dist/themes/tokens.js +920 -97
- package/dist/tokens.css +239 -0
- package/dist/tooltip/Tooltip.d.ts +6 -0
- package/dist/tooltip/Tooltip.js +48 -6
- package/dist/tooltip/Tooltip.logic.d.ts +89 -12
- package/dist/tooltip/Tooltip.logic.js +142 -20
- package/dist/tooltip/index.d.ts +1 -1
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip/tooltip.css +39 -9
- package/package.json +3 -3
|
@@ -47,10 +47,17 @@ export function middleCut(name) {
|
|
|
47
47
|
* the languages `labelParts` reads (” “ » «).
|
|
48
48
|
*/
|
|
49
49
|
const CLOSING_QUOTE = /^["”“»«]/u;
|
|
50
|
+
/**
|
|
51
|
+
* An opening quote that starts a quoted name: straight, or the opening mark
|
|
52
|
+
* of the languages `labelParts` reads (“ „ « » ”).
|
|
53
|
+
*/
|
|
54
|
+
const OPENING_QUOTE = /["“„«»”]$/u;
|
|
50
55
|
/**
|
|
51
56
|
* A line built from words and names, each `{ name }` cut in its middle:
|
|
52
57
|
* `nameParts(['"', { name }, '" already exists'])`. A cut name keeps its
|
|
53
|
-
*
|
|
58
|
+
* opening quote in its head and its closing quote in its tail, so the words
|
|
59
|
+
* before the name never take its opening quote away with their cut, and
|
|
60
|
+
* both quotes stay in view however far the line gives way. A short
|
|
54
61
|
* name, which is never cut in its middle, joins the words around it, so a
|
|
55
62
|
* line that names only short names is words that give way at their end:
|
|
56
63
|
* the words after the name go first, and the name itself only once they
|
|
@@ -81,10 +88,18 @@ export function nameParts(segments) {
|
|
|
81
88
|
const cut = middleCut(segment.name);
|
|
82
89
|
if (cut.head === '') {
|
|
83
90
|
addText(cut.tail);
|
|
91
|
+
continue;
|
|
84
92
|
}
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
const last = parts.at(-1);
|
|
94
|
+
const quote = last?.kind === 'text' ? (OPENING_QUOTE.exec(last.text)?.[0] ?? '') : '';
|
|
95
|
+
if (last?.kind === 'text' && quote !== '') {
|
|
96
|
+
const text = last.text.slice(0, last.text.length - quote.length);
|
|
97
|
+
if (text === '')
|
|
98
|
+
parts.pop();
|
|
99
|
+
else
|
|
100
|
+
parts[parts.length - 1] = { kind: 'text', text };
|
|
87
101
|
}
|
|
102
|
+
parts.push({ kind: 'name', head: quote + cut.head, tail: cut.tail });
|
|
88
103
|
}
|
|
89
104
|
return parts;
|
|
90
105
|
}
|
|
@@ -98,8 +113,8 @@ export function nameParts(segments) {
|
|
|
98
113
|
const QUOTED = /"([^"]+)"|“([^”]+)”|„([^“”]+)[“”]|«([^»]+)»|»([^«]+)«|”([^”]+)”/u;
|
|
99
114
|
/**
|
|
100
115
|
* A line that quotes a name (an operation's label, `"name" already
|
|
101
|
-
* exists`), its first quoted name cut in its middle, its
|
|
102
|
-
*
|
|
116
|
+
* exists`), its first quoted name cut in its middle, its opening quote
|
|
117
|
+
* kept with the name's head and its closing quote with its tail, and the rest of the line, later names
|
|
103
118
|
* included, after it as words that give way at their end:
|
|
104
119
|
* `Copying "Better.Call.Saul…CtrlHD.mkv" to "Seed…`. A
|
|
105
120
|
* line that quotes no name gives way at its end, as plain text does.
|
package/dist/namecut/namecut.css
CHANGED
|
@@ -22,10 +22,17 @@
|
|
|
22
22
|
white-space: pre;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/* A head that has to give way keeps room for a character and its ellipsis
|
|
25
|
+
/* A head that has to give way keeps room for a character and its ellipsis,
|
|
26
|
+
in whatever face the line is set: a character is about 1ch, and the
|
|
27
|
+
ellipsis about 1em in a proportional face. That floor is the widest the
|
|
28
|
+
two can be; NameCut narrows a cut box (this head, and the words around
|
|
29
|
+
the name) to what it shows, so no blank stands after its ellipsis. A
|
|
30
|
+
head shorter than that floor ("~/" of "~/n1000/.controller 85977") keeps
|
|
31
|
+
its own width, so a name that fits reads exactly as written, with no
|
|
32
|
+
blank between its head and its tail. */
|
|
26
33
|
.name-cut-head {
|
|
27
34
|
flex: 0 10000000000 auto;
|
|
28
|
-
min-width:
|
|
35
|
+
min-width: calc-size(max-content, min(size, 1ch + 1em));
|
|
29
36
|
overflow: hidden;
|
|
30
37
|
text-overflow: ellipsis;
|
|
31
38
|
}
|
|
@@ -56,12 +63,25 @@
|
|
|
56
63
|
text-overflow: ellipsis;
|
|
57
64
|
}
|
|
58
65
|
|
|
66
|
+
/* A right-to-left name is seen tail first. Its head runs right to left, so
|
|
67
|
+
its ellipsis falls on its left, at its logical end; its tail's box runs
|
|
68
|
+
left to right around the right-to-left name, so the tail's ellipsis falls
|
|
69
|
+
on its right, at its front, and its end stays in view. */
|
|
70
|
+
.name-cut-head.rtl {
|
|
71
|
+
direction: rtl;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.name-cut-tail.rtl {
|
|
75
|
+
direction: ltr;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* The quotes of a right-to-left name: its opening quote before its tail,
|
|
79
|
+
its closing quote after its head. */
|
|
80
|
+
.name-cut-quote {
|
|
81
|
+
flex: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
59
84
|
/* The spoken copy of the line is not selected twice with the drawn one. */
|
|
60
85
|
.name-cut > .visually-hidden {
|
|
61
86
|
user-select: none;
|
|
62
87
|
}
|
|
63
|
-
|
|
64
|
-
/* In a title strip's context, the line sits at the strip's right edge. */
|
|
65
|
-
.dialog-context > .name-cut {
|
|
66
|
-
justify-content: flex-end;
|
|
67
|
-
}
|
package/dist/pager/Pager.d.ts
CHANGED
|
@@ -20,6 +20,13 @@ export interface PagerProps {
|
|
|
20
20
|
readonly forward?: boolean;
|
|
21
21
|
/** How the steps draw: icons (the default), words, or both. */
|
|
22
22
|
readonly look?: LinkLook;
|
|
23
|
+
/**
|
|
24
|
+
* The pager's height, to match the row it sits in: `inline` (20px steps
|
|
25
|
+
* and menu) in a status line or row, the default; `small` (24px) in a
|
|
26
|
+
* toolbar of 24px fields and selects; `regular` (28px) in a dialog,
|
|
27
|
+
* beside its 28px fields.
|
|
28
|
+
*/
|
|
29
|
+
readonly size?: 'inline' | 'small' | 'regular';
|
|
23
30
|
}
|
|
24
31
|
/**
|
|
25
32
|
* The pager of a long list, in the listing look: Begin and Previous while
|
|
@@ -30,8 +37,9 @@ export interface PagerProps {
|
|
|
30
37
|
* list whose last page is not known yet (one counted only so far) offers
|
|
31
38
|
* no End, and a page that cannot be passed (`forward` false) offers neither
|
|
32
39
|
* Next nor End. `look` draws its steps as icons (named on hover), words,
|
|
33
|
-
* or both
|
|
34
|
-
*
|
|
35
|
-
*
|
|
40
|
+
* or both. A step that cannot act from the page shown stays in its place,
|
|
41
|
+
* disabled and faded as every disabled control is, so the menu and the
|
|
42
|
+
* other steps never move under the pointer between clicks. Words and names
|
|
43
|
+
* come from the `pager` labels.
|
|
36
44
|
*/
|
|
37
|
-
export declare function Pager({ kind, page, pages, onPage, endKnown, forward, look }: PagerProps): ReactElement | null;
|
|
45
|
+
export declare function Pager({ kind, page, pages, onPage, endKnown, forward, look, size }: PagerProps): ReactElement | null;
|
package/dist/pager/Pager.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from 'lucide-react';
|
|
3
|
+
import { ICON_SM } from '../icon/index.js';
|
|
3
4
|
import { useLabels } from '../labels/UiokProvider.js';
|
|
4
5
|
import { tooltip } from '../tooltip/Tooltip.logic.js';
|
|
5
6
|
import { selectorPages } from './Pager.logic.js';
|
|
7
|
+
/** The pager's class at each size. */
|
|
8
|
+
const PAGER_CLASS = {
|
|
9
|
+
inline: 'pager',
|
|
10
|
+
small: 'pager pager-small',
|
|
11
|
+
regular: 'pager pager-regular'
|
|
12
|
+
};
|
|
13
|
+
/** The page menu's class at each size: the shared field of that height. */
|
|
14
|
+
const MENU_CLASS = {
|
|
15
|
+
inline: 'field field-xs pager-page',
|
|
16
|
+
small: 'field field-sm pager-page',
|
|
17
|
+
regular: 'field pager-page'
|
|
18
|
+
};
|
|
6
19
|
/** Each step's icon. */
|
|
7
20
|
const STEP_ICONS = {
|
|
8
21
|
begin: ChevronsLeft,
|
|
@@ -19,11 +32,12 @@ const STEP_ICONS = {
|
|
|
19
32
|
* list whose last page is not known yet (one counted only so far) offers
|
|
20
33
|
* no End, and a page that cannot be passed (`forward` false) offers neither
|
|
21
34
|
* Next nor End. `look` draws its steps as icons (named on hover), words,
|
|
22
|
-
* or both
|
|
23
|
-
*
|
|
24
|
-
*
|
|
35
|
+
* or both. A step that cannot act from the page shown stays in its place,
|
|
36
|
+
* disabled and faded as every disabled control is, so the menu and the
|
|
37
|
+
* other steps never move under the pointer between clicks. Words and names
|
|
38
|
+
* come from the `pager` labels.
|
|
25
39
|
*/
|
|
26
|
-
export function Pager({ kind = 'items', page, pages, onPage, endKnown = true, forward = true, look = 'icons' }) {
|
|
40
|
+
export function Pager({ kind = 'items', page, pages, onPage, endKnown = true, forward = true, look = 'icons', size = 'inline' }) {
|
|
27
41
|
const labels = useLabels().pager;
|
|
28
42
|
if (pages <= 1)
|
|
29
43
|
return null;
|
|
@@ -32,7 +46,7 @@ export function Pager({ kind = 'items', page, pages, onPage, endKnown = true, fo
|
|
|
32
46
|
const step = (name, to, shown) => {
|
|
33
47
|
const Icon = STEP_ICONS[name];
|
|
34
48
|
const word = labels[name];
|
|
35
|
-
return
|
|
49
|
+
return (_jsxs("button", { "aria-label": labels.step(name, kind), className: look === 'icons' ? 'pager-step' : 'pager-step worded', disabled: !shown, onClick: () => onPage(to), type: "button", ...(look === 'icons' && shown ? tooltip(word) : {}), children: [look !== 'text' && _jsx(Icon, { "aria-hidden": true, size: ICON_SM }), look !== 'icons' && word] }));
|
|
36
50
|
};
|
|
37
|
-
return (_jsxs("nav", { "aria-label": labels.pages(kind), className:
|
|
51
|
+
return (_jsxs("nav", { "aria-label": labels.pages(kind), className: PAGER_CLASS[size], children: [step('begin', 0, !first), step('previous', page - 1, !first), _jsx("select", { "aria-label": labels.page(kind), className: MENU_CLASS[size], onChange: (event) => onPage(Number(event.currentTarget.value) - 1), value: page + 1, children: selectorPages(pages, page + 1).map((number) => (_jsx("option", { value: number, children: labels.pageOption(number, pages) }, number))) }), step('next', page + 1, !last), step('end', pages - 1, !last && endKnown)] }));
|
|
38
52
|
}
|
package/dist/pager/pager.css
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
/* ---- Pager (Pager) ----
|
|
2
2
|
|
|
3
3
|
Begin and Previous, the page menu, Next and End, each step a compact
|
|
4
|
-
control drawn as a path bar's
|
|
5
|
-
|
|
4
|
+
control drawn as a path bar's. A step that cannot act stays in its place,
|
|
5
|
+
disabled, so the menu never moves. Hover and pressed come from the base
|
|
6
|
+
stylesheet's quiet-control recipe; the menu is the shared field look. */
|
|
6
7
|
.pager {
|
|
8
|
+
/* The steps' height: an inline pager's (a status line or a row) unless the
|
|
9
|
+
toolbar size (Pager size="small") matches it to the 24px fields there,
|
|
10
|
+
or the dialog size (size="regular") to a dialog's 28px fields. */
|
|
11
|
+
--pager-height: var(--control-height-xs);
|
|
7
12
|
display: flex;
|
|
8
13
|
align-items: center;
|
|
9
|
-
gap:
|
|
14
|
+
gap: var(--space-2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pager.pager-small {
|
|
18
|
+
--pager-height: var(--control-height-sm);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pager.pager-regular {
|
|
22
|
+
--pager-height: var(--control-height);
|
|
10
23
|
}
|
|
11
24
|
|
|
12
25
|
.pager-step {
|
|
@@ -14,49 +27,47 @@
|
|
|
14
27
|
display: inline-flex;
|
|
15
28
|
align-items: center;
|
|
16
29
|
justify-content: center;
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
position: relative;
|
|
31
|
+
width: var(--pager-height);
|
|
32
|
+
height: var(--pager-height);
|
|
19
33
|
padding: 0;
|
|
20
34
|
border: none;
|
|
21
|
-
border-radius:
|
|
35
|
+
border-radius: var(--radius-sm);
|
|
22
36
|
background: transparent;
|
|
23
37
|
color: var(--text-dim);
|
|
24
|
-
cursor:
|
|
38
|
+
cursor: default;
|
|
25
39
|
}
|
|
26
40
|
|
|
27
41
|
/* A step drawn in words, alone or beside its icon. */
|
|
28
42
|
.pager-step.worded {
|
|
29
43
|
width: auto;
|
|
30
|
-
gap:
|
|
31
|
-
padding: 0
|
|
32
|
-
|
|
33
|
-
font-size
|
|
44
|
+
gap: var(--space-2);
|
|
45
|
+
padding: 0 var(--space-2);
|
|
46
|
+
/* A button label, so the interface face whatever the host's root sets. */
|
|
47
|
+
font: var(--font-weight-regular) var(--font-size-small) / var(--line-height-compact)
|
|
48
|
+
var(--font-ui);
|
|
34
49
|
white-space: nowrap;
|
|
35
50
|
}
|
|
36
51
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
/* A step's hit area grows to --hit-target each way it falls short. Steps
|
|
53
|
+
sit 4px apart, so a 20px step's 2px a side meets its neighbour's and
|
|
54
|
+
never overlaps it. */
|
|
55
|
+
button.pager-step::after {
|
|
56
|
+
position: absolute;
|
|
57
|
+
inset-block: min(0px, calc((100% - var(--hit-target)) / 2));
|
|
58
|
+
inset-inline: min(0px, calc((100% - var(--hit-target)) / 2));
|
|
59
|
+
content: '';
|
|
41
60
|
}
|
|
42
61
|
|
|
62
|
+
/* A step stands in a bar with room around it: the ring sits on its edge and
|
|
63
|
+
keeps its corners. */
|
|
43
64
|
button.pager-step:focus-visible {
|
|
44
|
-
outline:
|
|
45
|
-
outline-offset: -2px;
|
|
65
|
+
outline-offset: var(--focus-offset-flush);
|
|
46
66
|
}
|
|
47
67
|
|
|
68
|
+
/* The page menu: the shared field (.field-xs, .field-sm in the toolbar size,
|
|
69
|
+
or .field in the dialog size) draws its height, edge, chevron, text, and
|
|
70
|
+
focus; the pager only keeps it from shrinking. */
|
|
48
71
|
.pager-page {
|
|
49
|
-
|
|
50
|
-
padding: 0 4px;
|
|
51
|
-
border: 1px solid var(--border-strong);
|
|
52
|
-
border-radius: 4px;
|
|
53
|
-
background: var(--ground);
|
|
54
|
-
color: var(--text);
|
|
55
|
-
font: inherit;
|
|
56
|
-
font-size: 12px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.pager-page:focus-visible {
|
|
60
|
-
outline: none;
|
|
61
|
-
border-color: var(--accent);
|
|
72
|
+
flex: none;
|
|
62
73
|
}
|
package/dist/palette/Palette.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowLeft } from 'lucide-react';
|
|
3
3
|
import { FilterIcon } from '../filter/FilterIcon.js';
|
|
4
|
+
import { ICON_SM } from '../icon/index.js';
|
|
4
5
|
import { useLabels } from '../labels/UiokProvider.js';
|
|
5
6
|
import { useBellBeat } from '../menu/useBellBeat.js';
|
|
6
7
|
import { tooltip } from '../tooltip/Tooltip.logic.js';
|
|
@@ -56,5 +57,5 @@ export function Palette({ label, className, busy = false, onClose, children }) {
|
|
|
56
57
|
export function PaletteQuery({ inputRef, value, label, placeholder, listId, activeId, bell, level = null, count, refused, aside, onChange, onKeyDown }) {
|
|
57
58
|
const labels = useLabels().palette;
|
|
58
59
|
const beat = useBellBeat(bell);
|
|
59
|
-
return (_jsxs("div", { className: beat === null ? 'folder-menu-query' : `folder-menu-query bell-${beat}`, children: [_jsx(FilterIcon, {}), level !== null && (_jsxs("button", { "aria-label": labels.backFrom(level.title), className: "palette-level", disabled: level.disabled, onClick: level.onBack, tabIndex: -1, type: "button", ...tooltip(labels.back, '←'), children: [_jsx(ArrowLeft, { "aria-hidden": true, size:
|
|
60
|
+
return (_jsxs("div", { className: beat === null ? 'folder-menu-query' : `folder-menu-query bell-${beat}`, children: [_jsx(FilterIcon, {}), level !== null && (_jsxs("button", { "aria-label": labels.backFrom(level.title), className: "palette-level", disabled: level.disabled, onClick: level.onBack, tabIndex: -1, type: "button", ...tooltip(labels.back, '←'), children: [_jsx(ArrowLeft, { "aria-hidden": true, size: ICON_SM }), level.title] })), _jsx("input", { "aria-activedescendant": activeId, "aria-autocomplete": "list", "aria-controls": listId, "aria-expanded": true, "aria-label": label, onChange: onChange, onKeyDown: onKeyDown, placeholder: placeholder, ref: inputRef, role: "combobox", spellCheck: false, value: value }), refused !== null ? (_jsx("span", { className: "palette-refused", children: labels.nothingMatches(refused) })) : (count !== null && _jsx("span", { className: "folder-menu-count", children: count })), aside] }));
|
|
60
61
|
}
|
package/dist/palette/palette.css
CHANGED
|
@@ -1,59 +1,65 @@
|
|
|
1
1
|
/* ---- Palette look (Palette, PaletteQuery) ----
|
|
2
2
|
|
|
3
3
|
A palette: one list over the page. It is the menu surface (menu.css) over
|
|
4
|
-
a backdrop, closing on a dialog's key legend.
|
|
5
|
-
|
|
4
|
+
a backdrop, closing on a dialog's key legend. One class's weight and no
|
|
5
|
+
scope, like the menu look, so a palette reads the same wherever it is
|
|
6
|
+
drawn and an app adjusts a piece with one scoped selector. */
|
|
6
7
|
|
|
7
8
|
/* The backdrop takes the whole window, as a dialog's does, so nothing behind
|
|
8
|
-
it can take the keys while the palette is open.
|
|
9
|
-
|
|
9
|
+
it can take the keys while the palette is open. A palette replaces the
|
|
10
|
+
page for a moment, so it frosts what is behind it as a frosted dialog
|
|
11
|
+
does: the overlay scrim, blurred. */
|
|
12
|
+
.palette-backdrop {
|
|
10
13
|
position: fixed;
|
|
11
14
|
inset: 0;
|
|
12
15
|
z-index: var(--z-dialog);
|
|
13
16
|
display: flex;
|
|
14
17
|
align-items: flex-start;
|
|
15
18
|
justify-content: center;
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
/* 104px: the palette's drop from the window's top, below an app's title
|
|
20
|
+
bar and toolbar, so the page's own header stays in view. */
|
|
21
|
+
padding: 104px var(--space-8) var(--space-8);
|
|
22
|
+
background: var(--scrim);
|
|
23
|
+
backdrop-filter: var(--frost);
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
.folder-menu.palette {
|
|
21
27
|
position: static;
|
|
22
|
-
/* The listing's face, whatever face the app's root sets. */
|
|
23
|
-
font-family: var(--font-mono);
|
|
24
|
-
font-size: 13px;
|
|
25
28
|
/* Room for a row's name and its context, and for a legend's four slots. */
|
|
26
29
|
width: 600px;
|
|
27
30
|
max-width: 100%;
|
|
28
31
|
max-height: 100%;
|
|
29
|
-
box-shadow:
|
|
32
|
+
box-shadow:
|
|
33
|
+
inset 0 1px 0 var(--glass-edge),
|
|
34
|
+
var(--shadow-modal);
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
.palette .folder-menu-query {
|
|
33
38
|
flex: none;
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
/* A dialog's key legend footer at the palette's foot, its hairline run out
|
|
37
42
|
to the palette's edges. */
|
|
38
|
-
|
|
39
|
-
margin:
|
|
43
|
+
.palette > .dialog-legend {
|
|
44
|
+
margin: var(--space-2) calc(-1 * var(--space-2)) calc(-1 * var(--space-2));
|
|
40
45
|
}
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
/* Seventeen whole rows, so the list ends on a whole row; a shorter window
|
|
48
|
+
shrinks it, never below one row. */
|
|
49
|
+
.palette .folder-menu-options {
|
|
43
50
|
flex: 0 1 auto;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
max-height: 420px;
|
|
51
|
+
min-height: var(--row-height);
|
|
52
|
+
max-height: calc(17 * var(--row-height));
|
|
47
53
|
}
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
.palette-text {
|
|
50
56
|
display: flex;
|
|
51
57
|
align-items: baseline;
|
|
52
58
|
gap: 1.5ch;
|
|
53
59
|
min-width: 0;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
.palette-text .row-name {
|
|
57
63
|
flex: 0 1 auto;
|
|
58
64
|
min-width: 3ch;
|
|
59
65
|
overflow: hidden;
|
|
@@ -64,96 +70,151 @@
|
|
|
64
70
|
/* What a row says after its name: where an item is, or what a command does.
|
|
65
71
|
A long path gives way at its start, so the folder it ends in stays; the
|
|
66
72
|
text itself still reads left to right inside a <bdi>. */
|
|
67
|
-
|
|
73
|
+
.palette-context {
|
|
68
74
|
flex: 1 1 0;
|
|
69
75
|
min-width: 0;
|
|
70
76
|
overflow: hidden;
|
|
71
77
|
color: var(--row-meta-text);
|
|
72
|
-
font-size:
|
|
78
|
+
font-size: var(--font-size-small);
|
|
73
79
|
text-overflow: ellipsis;
|
|
74
80
|
white-space: nowrap;
|
|
75
81
|
direction: rtl;
|
|
76
82
|
text-align: left;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
|
-
|
|
85
|
+
.palette-context > bdi {
|
|
80
86
|
direction: ltr;
|
|
81
87
|
}
|
|
82
88
|
|
|
83
|
-
:
|
|
89
|
+
/* A row's trailing column: a chord (key caps), a version, a count. */
|
|
90
|
+
.palette-trail {
|
|
84
91
|
display: inline-flex;
|
|
85
92
|
align-items: center;
|
|
86
|
-
gap:
|
|
87
|
-
padding-left:
|
|
93
|
+
gap: var(--space-1);
|
|
94
|
+
padding-left: var(--space-4);
|
|
88
95
|
}
|
|
89
96
|
|
|
90
|
-
/* What a row says after its name when that is a sentence
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
/* What a row says after its name when that is a sentence rather than a
|
|
98
|
+
path: it reads and gives way at its end, in the interface face, as every
|
|
99
|
+
description does. */
|
|
100
|
+
.palette-context.palette-sentence {
|
|
101
|
+
direction: ltr;
|
|
102
|
+
font-family: var(--font-ui);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* What a row says after its name when that is a command line (what a
|
|
106
|
+
script runs): it stays in the monospace face, as anything typed does,
|
|
107
|
+
and gives way at its end, where a sentence does. */
|
|
108
|
+
.palette-context.palette-command {
|
|
93
109
|
direction: ltr;
|
|
94
110
|
}
|
|
95
111
|
|
|
96
|
-
/* A row's end in the listing's meta tone: versions, a count
|
|
97
|
-
|
|
112
|
+
/* A row's end in the listing's meta tone: versions, a count. */
|
|
113
|
+
.palette-meta {
|
|
98
114
|
display: inline-flex;
|
|
99
115
|
align-items: center;
|
|
100
116
|
color: var(--row-meta-text);
|
|
101
|
-
font-size:
|
|
117
|
+
font-size: var(--font-size-small);
|
|
102
118
|
white-space: pre;
|
|
103
119
|
}
|
|
104
120
|
|
|
121
|
+
/* On the cursor row the quiet words take the tone made for the cursor fill. */
|
|
122
|
+
.folder-menu-option.cursor:not([aria-disabled='true']) :is(.palette-context, .palette-meta) {
|
|
123
|
+
color: var(--text-on-surface);
|
|
124
|
+
}
|
|
125
|
+
|
|
105
126
|
/* The notes under a palette's list, ruled off from it, their text over
|
|
106
|
-
the rows' names
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
127
|
+
the rows' names. A failure among them is a status line: the danger
|
|
128
|
+
glyph (surface.css) in the icon column, then words in the text colour. */
|
|
129
|
+
.palette-notes {
|
|
130
|
+
margin: var(--space-2) calc(-1 * var(--space-2)) 0;
|
|
131
|
+
padding: var(--space-2) var(--space-2) 0;
|
|
132
|
+
border-top: var(--line) solid var(--border);
|
|
111
133
|
}
|
|
112
134
|
|
|
113
|
-
|
|
135
|
+
.palette-notes .folder-menu-note {
|
|
114
136
|
margin: 0;
|
|
115
|
-
|
|
137
|
+
/* The text starts over the rows' names: an option's inset plus its icon column. */
|
|
138
|
+
padding: var(--space-1) var(--space-4) var(--space-1) calc(var(--space-3) + var(--icon-column));
|
|
116
139
|
}
|
|
117
140
|
|
|
118
|
-
|
|
119
|
-
|
|
141
|
+
.palette-notes .palette-failure {
|
|
142
|
+
/* The glyph and its gap stand in the icon column, so the words still
|
|
143
|
+
start over the rows' names. */
|
|
144
|
+
padding-inline-start: calc(var(--space-3) + var(--icon-column) - var(--icon-md) - var(--space-3));
|
|
145
|
+
color: var(--text);
|
|
120
146
|
}
|
|
121
147
|
|
|
122
|
-
/* A
|
|
123
|
-
|
|
124
|
-
:
|
|
148
|
+
/* A note's or a failure's words are what a user pastes into a report, so
|
|
149
|
+
they can be swept and copied; the list's rows stay chrome. */
|
|
150
|
+
.palette-notes :is(.folder-menu-note, .palette-failure) {
|
|
151
|
+
-webkit-user-select: text;
|
|
152
|
+
user-select: text;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.palette-notes .palette-failure::before {
|
|
156
|
+
display: inline-block;
|
|
157
|
+
margin-inline-end: var(--space-3);
|
|
158
|
+
vertical-align: text-bottom;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* A refused keystroke, said where the count stands and in the count's own
|
|
162
|
+
dim tone: the bell beat already signals the refusal, so the words need
|
|
163
|
+
no colour of their own (a message is a mark and plain words); a long
|
|
164
|
+
refused paste gives way to the field rather than pushing
|
|
165
|
+
past the palette's edge. */
|
|
166
|
+
.palette-refused {
|
|
125
167
|
min-width: 0;
|
|
126
168
|
overflow: hidden;
|
|
127
169
|
margin-left: 1ch;
|
|
128
170
|
text-overflow: ellipsis;
|
|
129
|
-
color: var(--
|
|
171
|
+
color: var(--text-dim);
|
|
130
172
|
font-family: var(--font-ui);
|
|
131
|
-
font-size:
|
|
173
|
+
font-size: var(--font-size-caption);
|
|
132
174
|
white-space: nowrap;
|
|
133
175
|
}
|
|
134
176
|
|
|
135
177
|
/* The level the list shows, a chip before the query that steps back out
|
|
136
|
-
when pressed
|
|
137
|
-
:
|
|
178
|
+
when pressed: an accent wash, deeper under the pointer, edged in the
|
|
179
|
+
current item's opaque ring (3:1 on the surface and on both washes in
|
|
180
|
+
every theme, where the translucent accent line fell to 1.7:1), as a
|
|
181
|
+
control's edge must be; the base sheet's pressed recipe and control
|
|
182
|
+
transition draw the rest. It takes no keyboard focus (the
|
|
183
|
+
field keeps it; ← steps back), so it draws no ring of its own. */
|
|
184
|
+
.palette-level {
|
|
138
185
|
display: inline-flex;
|
|
139
186
|
flex: none;
|
|
140
187
|
align-items: center;
|
|
141
|
-
gap:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
border
|
|
146
|
-
|
|
188
|
+
gap: var(--space-2);
|
|
189
|
+
height: var(--control-height-xs);
|
|
190
|
+
margin-right: var(--space-4);
|
|
191
|
+
padding: 0 var(--space-3);
|
|
192
|
+
border: var(--line) solid var(--current-ring);
|
|
193
|
+
border-radius: var(--radius-sm);
|
|
147
194
|
color: var(--text);
|
|
148
195
|
font: inherit;
|
|
149
|
-
font-weight:
|
|
150
|
-
cursor:
|
|
196
|
+
font-weight: var(--font-weight-strong);
|
|
197
|
+
cursor: default;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* The wash weighs nothing, so the base sheet's pressed rule replaces it
|
|
201
|
+
while the chip is held; hover stands down then, so press outranks it. */
|
|
202
|
+
:where(.palette-level) {
|
|
203
|
+
background: var(--accent-wash);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.palette-level:hover:enabled:not(:active, [aria-pressed='true']) {
|
|
207
|
+
background: var(--accent-wash-strong);
|
|
151
208
|
}
|
|
152
209
|
|
|
153
|
-
|
|
154
|
-
|
|
210
|
+
/* Held, the chip keeps the base sheet's sunk face and hairline but its
|
|
211
|
+
fill is the accent's pressed face, one clear step (1.12:1) past its own
|
|
212
|
+
accent hover, which the neutral pressed wash is not. */
|
|
213
|
+
.palette-level:active:enabled:not([aria-pressed='true']) {
|
|
214
|
+
background: var(--accent-wash-pressed);
|
|
155
215
|
}
|
|
156
216
|
|
|
157
|
-
|
|
158
|
-
|
|
217
|
+
/* Should a host hand it the focus anyway, it says so with the ring. */
|
|
218
|
+
.palette-level:focus-visible {
|
|
219
|
+
outline-offset: var(--focus-offset-flush);
|
|
159
220
|
}
|