@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
package/dist/listing/Listing.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronDown, ChevronUp
|
|
2
|
+
import { ChevronDown, ChevronUp } from 'lucide-react';
|
|
3
3
|
import { createContext, useContext, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
4
|
+
import { ICON_SM, Spinner } from '../icon/index.js';
|
|
4
5
|
import { useLabels } from '../labels/UiokProvider.js';
|
|
5
|
-
import { InRowContext, RowLinkLookContext } from '../pane/PaneActions.js';
|
|
6
|
-
import {
|
|
6
|
+
import { InListingRowContext, InRowContext, RowLinkLookContext } from '../pane/PaneActions.js';
|
|
7
|
+
import { cutTooltip, describedTooltip } from '../tooltip/Tooltip.logic.js';
|
|
7
8
|
import { pathParts } from './PathParts.logic.js';
|
|
8
9
|
/**
|
|
9
10
|
* A listing column as wide as `ch` characters and the gutter before it, for
|
|
@@ -45,8 +46,8 @@ export const linksColumn = (look, icons, words, extraPx = 0) => look === 'icons'
|
|
|
45
46
|
*/
|
|
46
47
|
function SortLabel({ label, sort, align }) {
|
|
47
48
|
const { sortBy } = useLabels().listing;
|
|
48
|
-
const mark = sort.direction === null ? null : sort.direction === 'asc' ? (_jsx(ChevronUp, { "aria-hidden": true, size:
|
|
49
|
-
return (_jsxs("button", { "aria-label": sortBy(label, sort.direction), className: sort.direction === null ? 'pane-sort sortable' : 'pane-sort sortable active', onClick: sort.onSort, type: "button", children: [align === 'right' && mark, _jsx("span", { className: "pane-sort-label", ...
|
|
49
|
+
const mark = sort.direction === null ? null : sort.direction === 'asc' ? (_jsx(ChevronUp, { "aria-hidden": true, size: ICON_SM })) : (_jsx(ChevronDown, { "aria-hidden": true, size: ICON_SM }));
|
|
50
|
+
return (_jsxs("button", { "aria-label": sortBy(label, sort.direction), className: sort.direction === null ? 'pane-sort sortable' : 'pane-sort sortable active', onClick: sort.onSort, type: "button", children: [align === 'right' && mark, _jsx("span", { className: "pane-sort-label", ...cutTooltip(label), children: label }), align !== 'right' && mark] }));
|
|
50
51
|
}
|
|
51
52
|
/** The `aria-sort` of a sorting column's header. */
|
|
52
53
|
const ariaSort = (sort) => sort?.direction === 'asc' ? 'ascending' : sort?.direction === 'desc' ? 'descending' : undefined;
|
|
@@ -56,12 +57,12 @@ const ariaSort = (sort) => sort?.direction === 'asc' ? 'ascending' : sort?.direc
|
|
|
56
57
|
* its listing (`sort`, and `titleSort` for the name's column), whose label is
|
|
57
58
|
* the control that sorts it, named by `listing.sortBy` from the labels. In a
|
|
58
59
|
* table (`table`) it is the header row; `heading` makes the name the
|
|
59
|
-
* section's heading.
|
|
60
|
-
*
|
|
60
|
+
* section's heading. A visible label that a narrow column cuts with an
|
|
61
|
+
* ellipsis carries its whole text as its tooltip.
|
|
61
62
|
*/
|
|
62
63
|
export function Strip({ title, columns = [], table = false, heading = false, className, titleSort, titleLabel }) {
|
|
63
64
|
const Title = heading ? 'h3' : 'span';
|
|
64
|
-
return (_jsxs("div", { className: className === undefined ? 'pane-columns pane-strip' : `pane-columns pane-strip ${className}`, role: table ? 'row' : undefined, children: [_jsx("span", { "aria-sort": table ? ariaSort(titleSort) : undefined, className: "row-name", role: table ? 'columnheader' : undefined, children: titleSort === undefined ? (_jsx("span", { className: "pane-sort", children: _jsx(Title, { className: "pane-sort-label", ...
|
|
65
|
+
return (_jsxs("div", { className: className === undefined ? 'pane-columns pane-strip' : `pane-columns pane-strip ${className}`, role: table ? 'row' : undefined, children: [_jsx("span", { "aria-sort": table ? ariaSort(titleSort) : undefined, className: "row-name", role: table ? 'columnheader' : undefined, children: titleSort === undefined ? (_jsx("span", { className: "pane-sort", children: _jsx(Title, { className: "pane-sort-label", ...cutTooltip(titleLabel ?? title), children: titleLabel ?? title }) })) : (_jsx(SortLabel, { label: titleLabel ?? title, sort: titleSort })) }), columns.map((entry) => (_jsxs("span", { "aria-hidden": !table && entry.hidden === true ? true : undefined, className: [
|
|
65
66
|
'row-meta',
|
|
66
67
|
entry.align === 'right' || entry.control !== undefined ? 'align-right' : '',
|
|
67
68
|
entry.hidden === true ? 'pane-col-blank' : '',
|
|
@@ -71,7 +72,7 @@ export function Strip({ title, columns = [], table = false, heading = false, cla
|
|
|
71
72
|
.join(' '), "aria-sort": table ? ariaSort(entry.sort) : undefined, role: table ? 'columnheader' : undefined, children: [entry.control, entry.hidden === true
|
|
72
73
|
? table && _jsx("span", { className: "visually-hidden", children: entry.label })
|
|
73
74
|
: entry.control === undefined &&
|
|
74
|
-
(entry.sort === undefined ? (_jsx("span", { className: "pane-sort", children: _jsx("span", { className: "pane-sort-label", ...
|
|
75
|
+
(entry.sort === undefined ? (_jsx("span", { className: "pane-sort", children: _jsx("span", { className: "pane-sort-label", ...cutTooltip(entry.label), children: entry.label }) })) : (_jsx(SortLabel, { align: entry.align, label: entry.label, sort: entry.sort })))] }, entry.label)))] }));
|
|
75
76
|
}
|
|
76
77
|
/** The plainer look a row link takes when the one it has makes its listing scroll sideways. */
|
|
77
78
|
const PLAINER_LOOK = {
|
|
@@ -174,9 +175,10 @@ function useFittedLook(chosen, richest, listing, fitting) {
|
|
|
174
175
|
* `--pane-grid`, shared by the strip and every row, so each label sits over
|
|
175
176
|
* its column; a listing whose row links take words gives it as the grid for
|
|
176
177
|
* a look (`linksColumn`), and its rows take the richest look that keeps it
|
|
177
|
-
* inside its pane. A listing with no rows says so in `empty`: a
|
|
178
|
-
* under the strip instead of a table
|
|
179
|
-
*
|
|
178
|
+
* inside its pane. A listing with no rows says so in `empty`: a quiet row
|
|
179
|
+
* under the strip instead of a table (`.pane-message.empty`, starting where
|
|
180
|
+
* a row's icon starts, in the rows' type, dim), its column labels left out, so no
|
|
181
|
+
* header stands over a row that is not one.
|
|
180
182
|
*/
|
|
181
183
|
export function Listing({ title, label = title, grid, columns, className, empty = null, titleSort, titleLabel, children }) {
|
|
182
184
|
const classes = className === undefined ? 'pane-listing' : `pane-listing ${className}`;
|
|
@@ -186,7 +188,7 @@ export function Listing({ title, label = title, grid, columns, className, empty
|
|
|
186
188
|
const look = useFittedLook(chosen, fitting ? grid(chosen) : grid, listing, fitting && empty === null);
|
|
187
189
|
const style = { '--pane-grid': fitting ? grid(look) : grid };
|
|
188
190
|
if (empty !== null) {
|
|
189
|
-
return (_jsxs("section", { "aria-label": label, className: classes, ref: listing, style: style, children: [_jsx(Strip, { columns: columns, title: title }), _jsx("p", { className: "pane-message", children: empty })] }));
|
|
191
|
+
return (_jsxs("section", { "aria-label": label, className: classes, ref: listing, style: style, children: [_jsx(Strip, { columns: columns.map((entry) => entry.control === undefined ? { ...entry, hidden: true } : entry), title: title }), _jsx("p", { className: "pane-message empty", children: empty })] }));
|
|
190
192
|
}
|
|
191
193
|
return (_jsxs("div", { "aria-label": label, className: classes, ref: listing, role: "table", style: style, children: [_jsx(Strip, { columns: columns, table: true, title: title, titleLabel: titleLabel, titleSort: titleSort }), _jsx(RowLinkLookContext.Provider, { value: look, children: children })] }));
|
|
192
194
|
}
|
|
@@ -216,13 +218,13 @@ export function Row({ rowKey, mark, name, nameClass, className, onOpen, tabbable
|
|
|
216
218
|
cursor.rowsChanged?.();
|
|
217
219
|
return () => cursor.rowsChanged?.();
|
|
218
220
|
}, [cursor, rowKey]);
|
|
219
|
-
return (_jsx(InRowContext.Provider, { value: !tabbable, children: _jsxs("div", { "aria-current": current ? 'true' : undefined, className: ['row', current ? 'cursor' : '', className ?? ''].filter(Boolean).join(' '), "data-row-key": rowKey, onClick: onOpen, onFocus: () => cursor.point(rowKey),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
221
|
+
return (_jsx(InListingRowContext.Provider, { value: true, children: _jsx(InRowContext.Provider, { value: !tabbable, children: _jsxs("div", { "aria-current": current ? 'true' : undefined, className: ['row', current ? 'cursor' : '', className ?? ''].filter(Boolean).join(' '), "data-row-key": rowKey, onClick: onOpen, onFocus: () => cursor.point(rowKey),
|
|
222
|
+
// Movement, not entry: a row scrolled under a still pointer as the
|
|
223
|
+
// keys move the cursor must not take the cursor back.
|
|
224
|
+
onPointerMove: () => {
|
|
225
|
+
if (!current)
|
|
226
|
+
cursor.point(rowKey);
|
|
227
|
+
}, role: "row", tabIndex: focusable ? (current || entry ? 0 : -1) : undefined, children: [_jsx("span", { "aria-hidden": true, className: "row-icon", children: mark }), _jsx("span", { className: nameClass === undefined ? 'row-name' : `row-name ${nameClass}`, role: "cell", ...(typeof name === 'string' ? cutTooltip(name) : {}), children: name }), children] }) }) }));
|
|
226
228
|
}
|
|
227
229
|
/** A cell of a row after its name, in the listing's metadata look (`.row-meta`). */
|
|
228
230
|
export function Cell({ align, className, tip, children }) {
|
|
@@ -231,12 +233,16 @@ export function Cell({ align, className, tip, children }) {
|
|
|
231
233
|
.join(' '), role: "cell", ...(tip === undefined || tip === null ? {} : describedTooltip(tip)), children: children }));
|
|
232
234
|
}
|
|
233
235
|
/**
|
|
234
|
-
* A state as a State column says it: a
|
|
235
|
-
* ("running", "error"), or a spinner for a transition
|
|
236
|
-
*
|
|
236
|
+
* A state as a State column says it: a mark in the state's tone and its word
|
|
237
|
+
* ("running", "error"), or a spinner for a transition (the shared
|
|
238
|
+
* `Spinner`, as `RunHeader` turns). Each tone's mark has its own shape too, so it reads
|
|
239
|
+
* without its hue. Inside a row the word takes the tone too, so a failure
|
|
240
|
+
* reads red and a stopped line dim. A word wider than its column ends in an
|
|
241
|
+
* ellipsis and carries itself whole as its tooltip, which a word shown
|
|
242
|
+
* whole does not open.
|
|
237
243
|
*/
|
|
238
244
|
export function StateMark({ tone, word, busy = false }) {
|
|
239
|
-
return (_jsxs("span", { className: `pane-state pane-tone-${tone}`, children: [busy ? (_jsx(
|
|
245
|
+
return (_jsxs("span", { className: `pane-state pane-tone-${tone}`, children: [busy ? (_jsx(Spinner, { className: "pane-state-busy" })) : (_jsx("span", { "aria-hidden": true, className: "pane-state-dot" })), _jsx("span", { className: "pane-state-word", ...cutTooltip(word), children: word })] }));
|
|
240
246
|
}
|
|
241
247
|
/**
|
|
242
248
|
* A path cell: its folders in the row-meta tone, the head giving way first
|
|
@@ -257,9 +263,10 @@ export function PathCell({ path, nameClassName }) {
|
|
|
257
263
|
export function WellColumn({ title, columns, label, className, children }) {
|
|
258
264
|
const classes = className === undefined ? 'pane-well-column' : `pane-well-column ${className}`;
|
|
259
265
|
const strip = _jsx(Strip, { columns: columns, title: title });
|
|
260
|
-
// The strip's name,
|
|
266
|
+
// The strip's name, down to the listing's name floor, then each of its
|
|
267
|
+
// columns at its own width.
|
|
261
268
|
const style = {
|
|
262
|
-
'--pane-grid': `
|
|
269
|
+
'--pane-grid': `var(--icon-column) minmax(min(var(--pane-name-floor), 100%), 1fr) ${columns.map(() => 'auto').join(' ')}`
|
|
263
270
|
};
|
|
264
271
|
return label === undefined ? (_jsxs("div", { className: classes, style: style, children: [strip, children] })) : (_jsxs("section", { "aria-label": label, className: classes, style: style, children: [strip, children] }));
|
|
265
272
|
}
|