@bigpixelrocket/uiok 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/CHANGELOG.md +95 -1
  2. package/README.md +1 -1
  3. package/dist/activity/ActivityBar.d.ts +21 -8
  4. package/dist/activity/ActivityBar.js +15 -5
  5. package/dist/activity/activity.css +53 -6
  6. package/dist/button/Button.d.ts +10 -6
  7. package/dist/button/Button.js +6 -1
  8. package/dist/button/button.css +201 -33
  9. package/dist/charts/Line.logic.d.ts +6 -0
  10. package/dist/charts/Line.logic.js +9 -0
  11. package/dist/charts/LineChart.js +11 -4
  12. package/dist/charts/Pie.logic.d.ts +89 -1
  13. package/dist/charts/Pie.logic.js +272 -2
  14. package/dist/charts/PieChart.d.ts +2 -1
  15. package/dist/charts/PieChart.js +12 -5
  16. package/dist/charts/PieFill.d.ts +15 -0
  17. package/dist/charts/PieFill.js +33 -0
  18. package/dist/charts/ResultChart.d.ts +2 -2
  19. package/dist/charts/ResultChart.js +173 -47
  20. package/dist/charts/ResultChart.logic.d.ts +60 -4
  21. package/dist/charts/ResultChart.logic.js +105 -6
  22. package/dist/charts/Scatter.logic.d.ts +18 -4
  23. package/dist/charts/Scatter.logic.js +98 -22
  24. package/dist/charts/ScatterChart.js +19 -5
  25. package/dist/charts/charts.css +233 -116
  26. package/dist/charts/seriesColour.d.ts +2 -0
  27. package/dist/charts/seriesColour.js +1 -1
  28. package/dist/datetime/DateTimePicker.d.ts +12 -2
  29. package/dist/datetime/DateTimePicker.js +61 -16
  30. package/dist/datetime/DateTimePicker.logic.d.ts +29 -0
  31. package/dist/datetime/DateTimePicker.logic.js +25 -0
  32. package/dist/datetime/datetime.css +89 -49
  33. package/dist/dialog/ConfirmDialog.d.ts +69 -20
  34. package/dist/dialog/ConfirmDialog.js +39 -12
  35. package/dist/dialog/DialogLayer.d.ts +25 -0
  36. package/dist/dialog/DialogLayer.js +24 -0
  37. package/dist/dialog/DialogLegend.d.ts +2 -1
  38. package/dist/dialog/DialogLegend.js +10 -5
  39. package/dist/dialog/DialogLegend.logic.d.ts +15 -3
  40. package/dist/dialog/DialogLegend.logic.js +8 -4
  41. package/dist/dialog/DialogLists.d.ts +157 -0
  42. package/dist/dialog/DialogLists.js +137 -0
  43. package/dist/dialog/ModalDialog.d.ts +20 -15
  44. package/dist/dialog/ModalDialog.js +22 -7
  45. package/dist/dialog/dialog.css +570 -127
  46. package/dist/dialog/index.d.ts +7 -1
  47. package/dist/dialog/index.js +7 -1
  48. package/dist/field/Check.d.ts +15 -0
  49. package/dist/field/Check.js +23 -0
  50. package/dist/field/field.css +812 -0
  51. package/dist/field/index.d.ts +10 -0
  52. package/dist/field/index.js +10 -0
  53. package/dist/field/labelHelp.d.ts +33 -0
  54. package/dist/field/labelHelp.js +22 -0
  55. package/dist/filter/FilterIcon.js +2 -1
  56. package/dist/filter/filter.css +72 -20
  57. package/dist/grid/DataGrid.d.ts +8 -1
  58. package/dist/grid/DataGrid.js +115 -40
  59. package/dist/grid/DataGrid.logic.d.ts +15 -3
  60. package/dist/grid/DataGrid.logic.js +18 -5
  61. package/dist/grid/grid.css +481 -56
  62. package/dist/icon/Spinner.d.ts +16 -0
  63. package/dist/icon/Spinner.js +13 -0
  64. package/dist/icon/index.d.ts +5 -0
  65. package/dist/icon/index.js +5 -0
  66. package/dist/icon/sizes.d.ts +19 -0
  67. package/dist/icon/sizes.js +19 -0
  68. package/dist/index.d.ts +2 -0
  69. package/dist/index.js +2 -0
  70. package/dist/keychord/KeyChord.d.ts +12 -1
  71. package/dist/keychord/KeyChord.js +2 -2
  72. package/dist/keychord/index.d.ts +1 -1
  73. package/dist/keychord/keychord.css +87 -9
  74. package/dist/labels/dialog.d.ts +12 -1
  75. package/dist/labels/dialog.js +3 -1
  76. package/dist/labels/selectAll.d.ts +4 -4
  77. package/dist/labels/selectAll.js +1 -1
  78. package/dist/legend/KeyLegendStrip.js +1 -1
  79. package/dist/legend/legend.css +82 -57
  80. package/dist/listing/Listing.d.ts +17 -10
  81. package/dist/listing/Listing.js +33 -26
  82. package/dist/listing/listing.css +1665 -237
  83. package/dist/menu/menu.css +227 -67
  84. package/dist/menu/useBellBeat.js +2 -2
  85. package/dist/namecut/NameCut.d.ts +3 -1
  86. package/dist/namecut/NameCut.js +152 -5
  87. package/dist/namecut/NameCut.logic.d.ts +5 -3
  88. package/dist/namecut/NameCut.logic.js +20 -5
  89. package/dist/namecut/namecut.css +27 -7
  90. package/dist/pager/Pager.d.ts +12 -4
  91. package/dist/pager/Pager.js +21 -7
  92. package/dist/pager/pager.css +41 -30
  93. package/dist/palette/Palette.js +2 -1
  94. package/dist/palette/palette.css +121 -60
  95. package/dist/pane/PaneActions.d.ts +56 -14
  96. package/dist/pane/PaneActions.js +64 -16
  97. package/dist/pane/PaneFrame.d.ts +37 -5
  98. package/dist/pane/PaneFrame.js +246 -11
  99. package/dist/pane/index.d.ts +4 -2
  100. package/dist/pane/index.js +4 -2
  101. package/dist/pane/toolWords.d.ts +14 -0
  102. package/dist/pane/toolWords.js +26 -0
  103. package/dist/pane/useToolbarFit.d.ts +25 -0
  104. package/dist/pane/useToolbarFit.js +95 -0
  105. package/dist/run/RunHeader.d.ts +5 -3
  106. package/dist/run/RunHeader.js +11 -8
  107. package/dist/run/run.css +64 -79
  108. package/dist/segmented/SegmentedChoice.d.ts +18 -2
  109. package/dist/segmented/SegmentedChoice.js +18 -7
  110. package/dist/segmented/segmented.css +62 -22
  111. package/dist/selectall/SelectAllBar.d.ts +4 -3
  112. package/dist/selectall/SelectAllBar.js +4 -3
  113. package/dist/selectall/selectall.css +17 -12
  114. package/dist/shell/shell.css +1073 -0
  115. package/dist/styles.css +620 -22
  116. package/dist/surface/surface.css +154 -0
  117. package/dist/tabs/PageTabs.d.ts +10 -5
  118. package/dist/tabs/PageTabs.js +126 -37
  119. package/dist/tabs/tabs.css +131 -51
  120. package/dist/terminal/Terminal.js +3 -1
  121. package/dist/terminal/Terminal.logic.d.ts +5 -4
  122. package/dist/terminal/Terminal.logic.js +9 -4
  123. package/dist/terminal/TerminalMenu.d.ts +4 -1
  124. package/dist/terminal/TerminalMenu.js +12 -5
  125. package/dist/terminal/ghostty/contrast.logic.d.ts +45 -0
  126. package/dist/terminal/ghostty/contrast.logic.js +130 -0
  127. package/dist/terminal/ghostty/core.d.ts +6 -0
  128. package/dist/terminal/ghostty/renderer.d.ts +9 -2
  129. package/dist/terminal/ghostty/renderer.js +91 -14
  130. package/dist/terminal/ghostty/surface.d.ts +8 -0
  131. package/dist/terminal/ghostty/surface.js +27 -1
  132. package/dist/terminal/terminal.css +87 -61
  133. package/dist/text/text.css +16 -7
  134. package/dist/themes/catalog.js +4 -3
  135. package/dist/themes/themes.generated.css +1307 -264
  136. package/dist/themes/tokens.d.ts +69 -14
  137. package/dist/themes/tokens.js +920 -97
  138. package/dist/tokens.css +239 -0
  139. package/dist/tooltip/Tooltip.d.ts +6 -0
  140. package/dist/tooltip/Tooltip.js +48 -6
  141. package/dist/tooltip/Tooltip.logic.d.ts +89 -12
  142. package/dist/tooltip/Tooltip.logic.js +142 -20
  143. package/dist/tooltip/index.d.ts +1 -1
  144. package/dist/tooltip/index.js +1 -1
  145. package/dist/tooltip/tooltip.css +39 -9
  146. package/package.json +9 -3
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronDown, ChevronUp, Loader } from 'lucide-react';
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 { describedTooltip, tooltip } from '../tooltip/Tooltip.logic.js';
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: 12 })) : (_jsx(ChevronDown, { "aria-hidden": true, size: 12 }));
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", ...tooltip(label), children: label }), align !== 'right' && mark] }));
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. Every visible label carries its whole text as its
60
- * tooltip, since a narrow column cuts it with an ellipsis.
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", ...tooltip(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
+ 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", ...tooltip(entry.label), children: entry.label }) })) : (_jsx(SortLabel, { align: entry.align, label: entry.label, sort: entry.sort })))] }, entry.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 plain line
178
- * under the strip instead of a table, so no column headers stand over a row
179
- * that is not one.
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
- // Movement, not entry: a row scrolled under a still pointer as the
221
- // keys move the cursor must not take the cursor back.
222
- onPointerMove: () => {
223
- if (!current)
224
- cursor.point(rowKey);
225
- }, 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", children: name }), children] }) }));
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 dot in the state's tone and its word
235
- * ("running", "error"), or a spinner for a transition. Inside a row the word
236
- * takes the tone too, so a failure reads red and a stopped line dim.
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(Loader, { "aria-hidden": true, className: "pane-state-busy", size: 11 })) : (_jsx("span", { "aria-hidden": true, className: "pane-state-dot" })), word] }));
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, then each of its columns at its own width.
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': `20px minmax(0, 1fr) ${columns.map(() => 'auto').join(' ')}`
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
  }