@crewlethq/ui 0.39.0 → 0.40.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.
Files changed (90) hide show
  1. package/README.md +47 -1
  2. package/dist/AppShell/AppShell.d.ts +13 -2
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/{AppShell-NDU4XMGF.css → AppShell-VE2MAV42.css} +71 -7
  5. package/dist/ArtifactBar/index.js +6 -5
  6. package/dist/AvatarPicker/index.js +10 -6
  7. package/dist/CatalogTile/index.js +1 -1
  8. package/dist/{CatalogTile-TGR2ZZVQ.css → CatalogTile-XL4XLFUH.css} +8 -4
  9. package/dist/CharacterPicker/index.js +2 -2
  10. package/dist/Charts/Histogram.d.ts +71 -0
  11. package/dist/Charts/index.d.ts +2 -0
  12. package/dist/Charts/index.js +1 -1
  13. package/dist/{Charts-MBJG72BS.css → Charts-TZ744HT6.css} +118 -0
  14. package/dist/DataGrid/DataGrid.d.ts +267 -0
  15. package/dist/DataGrid/index.d.ts +3 -0
  16. package/dist/DataGrid/index.js +7 -0
  17. package/dist/DataGrid-AQKPJD7W.css +482 -0
  18. package/dist/HuePicker/index.js +11 -4
  19. package/dist/LayersList/index.js +2 -2
  20. package/dist/LockedLabel/LockedLabel.d.ts +34 -0
  21. package/dist/LockedLabel/index.d.ts +3 -0
  22. package/dist/LockedLabel/index.js +3 -0
  23. package/dist/LockedLabel-VQEGEB7G.css +16 -0
  24. package/dist/MarkdownEditor/index.js +8 -5
  25. package/dist/MergeConflicts/index.js +11 -5
  26. package/dist/PageNote/PageNote.d.ts +14 -0
  27. package/dist/PageNote/index.d.ts +3 -0
  28. package/dist/PageNote/index.js +2 -0
  29. package/dist/PageNote-RHLXH3ML.css +12 -0
  30. package/dist/PropertyList/PropertyList.d.ts +88 -0
  31. package/dist/PropertyList/index.d.ts +3 -0
  32. package/dist/PropertyList/index.js +7 -0
  33. package/dist/PropertyList-SCYM66LL.css +96 -0
  34. package/dist/RelatedRow/RelatedRow.d.ts +27 -0
  35. package/dist/RelatedRow/index.d.ts +3 -0
  36. package/dist/RelatedRow/index.js +9 -0
  37. package/dist/RelatedRow-2FVS6QQA.css +6 -0
  38. package/dist/SectionFrame/SectionFrame.d.ts +76 -0
  39. package/dist/SectionFrame/index.d.ts +3 -0
  40. package/dist/SectionFrame/index.js +7 -0
  41. package/dist/SectionFrame-M62UUVFQ.css +164 -0
  42. package/dist/SegmentedControl/index.js +11 -4
  43. package/dist/SheetColumnEditor/index.js +6 -5
  44. package/dist/SheetGrid/index.js +2 -2
  45. package/dist/SidebarNav/SidebarNav.d.ts +35 -2
  46. package/dist/SidebarNav/index.js +2 -1
  47. package/dist/{SidebarNav-7SGUZYKK.css → SidebarNav-YI74SPDC.css} +10 -0
  48. package/dist/Tabs/Tabs.d.ts +55 -1
  49. package/dist/Tabs/fold.d.ts +54 -0
  50. package/dist/Tabs/index.d.ts +1 -1
  51. package/dist/Tabs/index.js +9 -2
  52. package/dist/Tabs/roving.d.ts +3 -3
  53. package/dist/{Tabs-WIF7457H.css → Tabs-S7F4RWAN.css} +77 -0
  54. package/dist/TagsInput/index.js +1 -1
  55. package/dist/ThemeGallery/index.js +2 -2
  56. package/dist/ThemeSwitcher/index.js +12 -5
  57. package/dist/VersionCompare/index.js +12 -5
  58. package/dist/{chunk-B5J23C73.js → chunk-2PEXZ7L4.js} +1 -1
  59. package/dist/{chunk-TZYFTC4M.js → chunk-2VOHUGUA.js} +1 -1
  60. package/dist/{chunk-2QZ2VPHR.js → chunk-4OK4DX3V.js} +2 -2
  61. package/dist/{chunk-ECGGQX2H.js → chunk-A44YHLCQ.js} +2 -2
  62. package/dist/{chunk-F4LPQA4E.js → chunk-BA32AVKS.js} +1 -1
  63. package/dist/chunk-CV4NES3P.js +9 -0
  64. package/dist/{chunk-PPHTIKZO.js → chunk-E4BOVKNJ.js} +1 -1
  65. package/dist/{chunk-W7PAIVAP.js → chunk-E7QLG3PG.js} +30 -9
  66. package/dist/{chunk-RKKO7QHH.js → chunk-EGMQURBR.js} +5 -4
  67. package/dist/{chunk-GMW4ZHST.js → chunk-EX22Q5SH.js} +2 -2
  68. package/dist/{chunk-F3WZ5AKM.js → chunk-GFYQKMQZ.js} +1 -1
  69. package/dist/{chunk-DYB66CNM.js → chunk-GR4YM7HT.js} +6 -3
  70. package/dist/{chunk-HG5VF3TZ.js → chunk-HMVQQEHW.js} +91 -2
  71. package/dist/chunk-INVSUFJK.js +71 -0
  72. package/dist/{chunk-4LRAJXHL.js → chunk-JSWOXRRE.js} +1 -1
  73. package/dist/{chunk-ZMDYQ2HH.js → chunk-KWWP3D7M.js} +1 -1
  74. package/dist/{chunk-46RL3E54.js → chunk-M6NQ4XGK.js} +1 -1
  75. package/dist/chunk-OHGH7O6T.js +19 -0
  76. package/dist/{chunk-4ISUIS6F.js → chunk-OOC7Q67K.js} +1 -1
  77. package/dist/{chunk-XNXK5MA4.js → chunk-PCT47E7O.js} +1 -1
  78. package/dist/{chunk-YEVG2X5R.js → chunk-SNQRGH4A.js} +1 -1
  79. package/dist/chunk-T6MXORP5.js +116 -0
  80. package/dist/chunk-X4IXXLWM.js +306 -0
  81. package/dist/chunk-XIDD7PJO.js +416 -0
  82. package/dist/chunk-ZUTUI27P.js +21 -0
  83. package/dist/generated/index.d.ts +6 -0
  84. package/dist/generated/index.js +62 -56
  85. package/dist/index.js +62 -56
  86. package/dist/styles.css +1087 -20
  87. package/package.json +3 -3
  88. package/dist/chunk-7SDUKCNW.js +0 -141
  89. package/dist/{chunk-JZPK4IXR.js → chunk-DKNBGL26.js} +1 -1
  90. /package/dist/{chunk-QRLIWCLX.js → chunk-S3QTFUJX.js} +0 -0
@@ -0,0 +1,267 @@
1
+ import { type MouseEvent as ReactMouseEvent, type KeyboardEvent as ReactKeyboardEvent, type ReactNode, type Ref } from 'react';
2
+ /**
3
+ * What activated a row: a click, a key on the row's overlay, or the
4
+ * application's own keymap driving the cursor (a native `KeyboardEvent`).
5
+ * Each carries the modifier keys a handler reads to open in a new tab.
6
+ */
7
+ export type DataGridActivationEvent = ReactMouseEvent | ReactKeyboardEvent | KeyboardEvent;
8
+ /** One column of a [DataGrid]. */
9
+ export interface DataGridColumn<T> {
10
+ key: string;
11
+ header: ReactNode;
12
+ cell: (row: T) => ReactNode;
13
+ /** The value sorted on. Omit to make the column unsortable. */
14
+ sortValue?: ((row: T) => string | number | null | undefined) | undefined;
15
+ align?: 'left' | 'right' | undefined;
16
+ /**
17
+ * The column's name where `header` cannot carry one: a glyph head, or none
18
+ * at all. Drawn by the card layout a grid takes on a phone, where every value
19
+ * names itself, and said to assistive technology over a glyph head.
20
+ */
21
+ label?: string | undefined;
22
+ /**
23
+ * A column of ROW ACTIONS: every cell is a control that names itself (a
24
+ * "Revoke" button, an icon button with its own label). On the phone's card
25
+ * such a cell draws no name beside it, since the control is its own name;
26
+ * its head stays empty, since a word over a column of buttons says nothing
27
+ * the buttons do not.
28
+ */
29
+ action?: boolean | undefined;
30
+ /** Shrink to content (up to a fifth of the grid) and never wrap. */
31
+ shrink?: boolean | undefined;
32
+ /**
33
+ * On a grid drawn with `phoneRows="compact"`, a cell of the row's FIRST line
34
+ * (what the row is: a key, a title), where every other cell is a fact about
35
+ * it on the line under.
36
+ */
37
+ phoneLead?: boolean | undefined;
38
+ /** Left off the compact phone row, whose contract is two lines. */
39
+ phoneOmit?: boolean | undefined;
40
+ /** An exact track, in place of the computed one. */
41
+ width?: string | undefined;
42
+ /** Hidden unless the column set (`cols`) names it. */
43
+ optional?: boolean | undefined;
44
+ /**
45
+ * The narrowest a FLEXIBLE column may be drawn: its track is
46
+ * `minmax(floor, 1fr)` rather than `minmax(0, 1fr)`. For the column that is
47
+ * the point of the list (a title, a name), which at zero gave way to every
48
+ * content-sized column beside it.
49
+ */
50
+ floor?: string | undefined;
51
+ /**
52
+ * The order this column GIVES WAY in when the grid cannot draw every column
53
+ * at its size: the lowest number goes first, and a column without one never
54
+ * goes. A grid that cannot fit drops columns rather than cutting them off at
55
+ * its clipped edge, and says which it dropped.
56
+ */
57
+ drop?: number | undefined;
58
+ }
59
+ /** One column a reader may turn on or off, as a [ColumnChooser] offers it. */
60
+ export interface ColumnChoice {
61
+ key: string;
62
+ label: string;
63
+ /** Off until the column set names it. */
64
+ optional?: boolean | undefined;
65
+ }
66
+ /**
67
+ * The choices a chooser offers, DERIVED from the columns a grid draws, so a
68
+ * column added to a grid appears in its menu with no second edit. The cell
69
+ * renderers are never called: a name and a flag are properties of the column.
70
+ */
71
+ export declare function columnChoicesOf<T>(columns: readonly DataGridColumn<T>[]): ColumnChoice[];
72
+ /** One box in a [ChooserList]. */
73
+ export interface ChooserItem<K extends string = string> {
74
+ key: K;
75
+ label: ReactNode;
76
+ checked: boolean;
77
+ }
78
+ export interface ChooserListProps<K extends string = string> {
79
+ /** The heading above the boxes, which also names the group. */
80
+ label: string;
81
+ items: readonly ChooserItem<K>[];
82
+ onToggle: (key: K) => void;
83
+ }
84
+ /**
85
+ * A short checklist of what a view shows, in two columns under a quiet
86
+ * heading: the columns a grid draws ([ColumnChooser]), the facts a card
87
+ * carries. Native checkboxes in a named group, each row its box's label, so
88
+ * the whole row takes the pointer.
89
+ */
90
+ export declare function ChooserList<K extends string = string>({ label, items, onToggle }: ChooserListProps<K>): import("react").JSX.Element | null;
91
+ export interface ColumnChooserProps {
92
+ choices: readonly ColumnChoice[];
93
+ /** The column set as it stands (`key,key`), empty for the default set. */
94
+ value: string;
95
+ onChange: (cols: string) => void;
96
+ /** The heading above the boxes. */
97
+ label?: string | undefined;
98
+ }
99
+ /**
100
+ * The checkbox list a reader chooses a grid's columns with.
101
+ *
102
+ * AN EMPTY VALUE IS THE DEFAULT SET, NOT AN EMPTY GRID, as [DataGrid] reads
103
+ * it, so the boxes show the default until somebody moves one. It writes the
104
+ * DECLARATION order, never the click order: the value carries an order as well
105
+ * as a selection, and a value built from the order boxes were ticked in would
106
+ * rearrange the grid with every tick.
107
+ */
108
+ export declare function ColumnChooser({ choices, value, onChange, label }: ColumnChooserProps): import("react").JSX.Element;
109
+ /** A group of rows, as a grouped answer sends it: its own count and a page of rows. */
110
+ export interface DataGridBand<T> {
111
+ key: string;
112
+ label: ReactNode;
113
+ /** The group value's own mark, drawn before the label (a sibling, so no ellipsis eats it). */
114
+ mark?: ReactNode;
115
+ /** The count over the WHOLE group, where the source gave one. */
116
+ total?: number | undefined;
117
+ rows: T[];
118
+ /**
119
+ * The bands INSIDE this one, where the answer was grouped twice: a band
120
+ * carries rows OR sub-bands, never both, as the answer arrives.
121
+ */
122
+ bands?: DataGridBand<T>[] | undefined;
123
+ /** A per-band aggregate line, or the way to what the band did not fit. */
124
+ footer?: ReactNode;
125
+ }
126
+ /** The words a grid says, for an application that says them otherwise. */
127
+ export interface DataGridLabels {
128
+ /** "Hidden to fit: Due and Updated". */
129
+ hiddenToFit: (names: string) => string;
130
+ loadMore: string;
131
+ showEveryColumn: string;
132
+ /** Joins the last two names of a list: "Due and Updated". */
133
+ and: string;
134
+ }
135
+ /**
136
+ * What an application drives a grid's cursor with. The grid binds no keys of
137
+ * its own: an application with a keymap decides which of several grids on a
138
+ * screen a keystroke is for, and moves that one.
139
+ */
140
+ export interface DataGridHandle {
141
+ /** Moves the cursor row by `by` rows, clamped, and scrolls it into view. */
142
+ step: (by: number) => void;
143
+ /** Activates the cursor row, as a click on it would. False when there is none. */
144
+ activate: (event: ReactKeyboardEvent | KeyboardEvent) => boolean;
145
+ /** How many rows the grid draws, its bands' rows included. */
146
+ rowCount: () => number;
147
+ }
148
+ export interface DataGridProps<T> {
149
+ rows?: T[] | undefined;
150
+ bands?: DataGridBand<T>[] | undefined;
151
+ columns: DataGridColumn<T>[];
152
+ rowKey: (row: T) => string;
153
+ /** A plain click, or Enter on the cursor row. The row is still a link when `rowHref` is given. */
154
+ onRowActivate?: ((row: T, event: DataGridActivationEvent) => void) | undefined;
155
+ /** The row's object's page: a real link stretched over the row, so a new tab and copying it work. */
156
+ rowHref?: ((row: T) => string) | undefined;
157
+ /** The row the reader is on (the object a page or a side panel shows): tinted and announced as current. */
158
+ isSelected?: ((row: T) => boolean) | undefined;
159
+ isFailed?: ((row: T) => boolean) | undefined;
160
+ /**
161
+ * The sort as `key` or `-key` (descending), empty for the rows' own order.
162
+ * Controlled, so an application keeps it where it keeps state (an address).
163
+ */
164
+ sort?: string | undefined;
165
+ /** A sortable head pressed: ascending, then descending, then unsorted. */
166
+ onSortChange?: ((sort: string) => void) | undefined;
167
+ /** The rows arrive ordered by their source (a paged answer ordered over the whole set). */
168
+ serverSorted?: boolean | undefined;
169
+ /** The column set as `key,key`, in the order to draw it; empty for every column not `optional`. */
170
+ cols?: string | undefined;
171
+ /** The way back from a column set: drawn as "Show every column" while one is set. */
172
+ onColsChange?: ((cols: string) => void) | undefined;
173
+ /** What an empty grid says, and the one control that is its next step. */
174
+ empty?: {
175
+ title: ReactNode;
176
+ hint?: ReactNode;
177
+ icon?: ReactNode;
178
+ action?: ReactNode;
179
+ } | undefined;
180
+ footer?: ReactNode;
181
+ onLoadMore?: (() => void) | undefined;
182
+ /** "40 of 312 loaded": what an export would actually contain. */
183
+ loadedNote?: string | undefined;
184
+ /**
185
+ * HOW A ROW IS DRAWN ON A PHONE, where there are no columns: `labelled` (a
186
+ * card of one named line per value, which every grid can take) or `compact`
187
+ * (two lines with no names: the lead cells, then every other value as a run
188
+ * of marks, for a list scanned by the dozen).
189
+ */
190
+ phoneRows?: 'labelled' | 'compact' | undefined;
191
+ /**
192
+ * The grid is a card's body: no edge, corner or ground of its own and one
193
+ * rule above its head. A grid straight in a `Card` is flush without this.
194
+ */
195
+ flush?: boolean | undefined;
196
+ /** For an application driving the cursor from its own keymap. */
197
+ handleRef?: Ref<DataGridHandle> | undefined;
198
+ /** The reader pressed inside the grid: which grid the keyboard means. */
199
+ onPointerDown?: (() => void) | undefined;
200
+ labels?: Partial<DataGridLabels> | undefined;
201
+ /** What the table is, for assistive technology: its card's title, by id or in words. */
202
+ 'aria-label'?: string | undefined;
203
+ 'aria-labelledby'?: string | undefined;
204
+ className?: string | undefined;
205
+ }
206
+ /** `-updated` as `{key: "updated", desc: true}`. */
207
+ export declare function parseGridSort(raw: string): {
208
+ key: string;
209
+ desc: boolean;
210
+ } | null;
211
+ /** What the fit has decided for one set of columns, at one width. */
212
+ export interface GridFit {
213
+ /** The column set it was decided for. */
214
+ readonly set: string;
215
+ /** The grid's width when it last decided. */
216
+ readonly width: number;
217
+ /** The keys it dropped, in the order it dropped them. */
218
+ readonly dropped: readonly string[];
219
+ }
220
+ /**
221
+ * The next fit, or null when this one stands. PURE, so the rules are held
222
+ * without a layout engine:
223
+ *
224
+ * - the grid GREW past the width columns were dropped at: start again from all
225
+ * of them (the next pass drops again only what still does not fit);
226
+ * - the tracks OVERRUN the grid: drop the visible column with the lowest
227
+ * `drop`, if there is one;
228
+ * - otherwise remember a narrower width, so growing back past it re-tries.
229
+ */
230
+ export declare function fitGridColumns({ fit, width, overflows, visible, }: {
231
+ fit: GridFit;
232
+ width: number;
233
+ overflows: boolean;
234
+ visible: readonly {
235
+ key: string;
236
+ drop?: number | undefined;
237
+ }[];
238
+ }): GridFit | null;
239
+ /**
240
+ * A list as columns: sortable heads, optional and give-way columns, bands for
241
+ * a grouped answer, a row link stretched over each row, and a card per row on
242
+ * a phone.
243
+ *
244
+ * ONE TRACK LIST, ON THE GRID. The head, the bands and every row are
245
+ * `subgrid` passthroughs, so a head cell and a cell twenty rows down size the
246
+ * same track; each row being its own grid sized its columns against its own
247
+ * cells alone, and no value sat under the head that named it.
248
+ *
249
+ * A SHRINK COLUMN IS CAPPED (`fit-content(20%)`): `max-content` grows without
250
+ * a ceiling and grid resolves it before any flexible column, so one long value
251
+ * starved the title to zero and still overflowed.
252
+ *
253
+ * COLUMNS THAT DO NOT FIT GIVE WAY IN ORDER (`drop`), measured after every
254
+ * commit in a layout effect so the intermediate shapes never paint, and the
255
+ * foot names what the width took. Not on a phone, where a row is a card.
256
+ *
257
+ * THE ROW'S LINK IS AN OVERLAY, NOT THE ROW: a row that was an anchor made
258
+ * every linking cell an anchor inside an anchor, and the parser closes the
259
+ * outer one at the inner, so the row stopped being clickable from that cell
260
+ * on. Stretched over the row it keeps a real href, and the cells' own links
261
+ * and buttons sit above it.
262
+ *
263
+ * The grid makes no scrollport of its own (`overflow: clip`), which is what
264
+ * lets its head stick against the page's scroller; an application whose
265
+ * scroller carries a sticky bar sets `--crewlet-data-grid-sticky-top`.
266
+ */
267
+ export declare function DataGrid<T>({ rows, bands, columns, rowKey, onRowActivate, rowHref, isSelected, isFailed, sort: sortRaw, onSortChange, serverSorted, cols: colsRaw, onColsChange, empty, footer, onLoadMore, loadedNote, phoneRows, flush, handleRef, onPointerDown, labels, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, className, }: DataGridProps<T>): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import './DataGrid.css';
2
+ export { ChooserList, ColumnChooser, DataGrid, columnChoicesOf, fitGridColumns, parseGridSort } from './DataGrid.js';
3
+ export type { ColumnChoice, ChooserItem, ChooserListProps, ColumnChooserProps, DataGridActivationEvent, DataGridBand, DataGridColumn, DataGridHandle, DataGridLabels, DataGridProps, GridFit, } from './DataGrid.js';
@@ -0,0 +1,7 @@
1
+ export { ChooserList, ColumnChooser, DataGrid, columnChoicesOf, fitGridColumns, parseGridSort } from '../chunk-XIDD7PJO.js';
2
+ import '../chunk-RA2ULG6H.js';
3
+ import '../chunk-PQADV6P6.js';
4
+ import '../chunk-RTPQDNW3.js';
5
+ import '../chunk-OG6CL3EB.js';
6
+ import '../chunk-BZFWDIV6.js';
7
+ import '../chunk-ODEQTPFM.js';