@crewlethq/ui 0.187.0 → 0.188.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 +12 -0
- package/dist/ArrangeList/index.js +2 -2
- package/dist/DataGrid/index.js +2 -2
- package/dist/DeepWorkCard/index.js +2 -2
- package/dist/DocTabsEditor/index.js +2 -2
- package/dist/LimitMeters/LimitMeters.d.ts +11 -4
- package/dist/LimitMeters/index.js +3 -1
- package/dist/{LimitMeters-HDEBOATH.css → LimitMeters-MZKIPOJX.css} +11 -4
- package/dist/ListInput/index.js +2 -2
- package/dist/Meter/Meter.d.ts +15 -16
- package/dist/Meter/index.d.ts +2 -2
- package/dist/Meter/index.js +1 -1
- package/dist/OrgTable/index.js +4 -4
- package/dist/Reorder/ReorderHandle.d.ts +13 -0
- package/dist/Reorder/index.d.ts +3 -0
- package/dist/Reorder/index.js +9 -1
- package/dist/ReorderHandle-CT5OMUSR.css +9 -0
- package/dist/RichEditor/index.js +1 -1
- package/dist/SlideFilmstrip/index.js +2 -2
- package/dist/StatCard/StatCard.d.ts +1 -0
- package/dist/StatCard/index.js +1 -1
- package/dist/TreeGrid/index.js +3 -3
- package/dist/UtilizationDiagram/UtilizationDiagram.d.ts +33 -0
- package/dist/UtilizationDiagram/index.d.ts +3 -0
- package/dist/UtilizationDiagram/index.js +6 -0
- package/dist/UtilizationDiagram-IYB6TTZY.css +59 -0
- package/dist/{chunk-JMBPMSNI.js → chunk-4FO6WWYW.js} +21 -1
- package/dist/chunk-5DABULI2.js +118 -0
- package/dist/{chunk-26G3D2L6.js → chunk-E7GZKGDY.js} +1 -1
- package/dist/{chunk-DPDOQJWH.js → chunk-GQL2XQTS.js} +1 -1
- package/dist/{chunk-4ASS2GXQ.js → chunk-HJ63EXMY.js} +1 -1
- package/dist/{chunk-RYTE4I55.js → chunk-IKGEOJEA.js} +1 -1
- package/dist/{chunk-MXOT2CWL.js → chunk-JEFGH3AQ.js} +17 -9
- package/dist/{chunk-72AZMU55.js → chunk-MD5KDF7W.js} +1 -1
- package/dist/{chunk-KKEVX2PD.js → chunk-ROVOM5MS.js} +20 -12
- package/dist/{chunk-W3YTURNG.js → chunk-VGGEVVIT.js} +1 -1
- package/dist/{chunk-5MPQ657T.js → chunk-Z3FXGNT5.js} +1 -1
- package/dist/{chunk-O7KT5EIN.js → chunk-ZA2STYRY.js} +1 -1
- package/dist/{chunk-A4CTKERL.js → chunk-ZDHQ5ZDT.js} +1 -1
- package/dist/{chunk-7U3OHBGV.js → chunk-ZX6E6DSB.js} +1 -1
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +37 -36
- package/dist/index.js +37 -36
- package/dist/styles.css +86 -5
- package/package.json +3 -3
- package/dist/{Editor-WFP2MM6M.js → Editor-NFC7HEWU.js} +1 -1
- /package/dist/{chunk-7ZBJ7YTF.js → chunk-LE7SVMCB.js} +0 -0
package/README.md
CHANGED
|
@@ -252,6 +252,18 @@ Stories: Patterns / Confirmation dialogs (remove a model, remove an MCP server,
|
|
|
252
252
|
disconnect an integration, move a seat's model, review and save, long names,
|
|
253
253
|
many rows), `ConsequenceList`, `ChangeGroups` and `AssignmentList`.
|
|
254
254
|
|
|
255
|
+
## Changes in 0.188.1
|
|
256
|
+
|
|
257
|
+
### A limit stack fills a flex table cell
|
|
258
|
+
|
|
259
|
+
**`LimitMeters` takes the width its cell gives it.** With inline-size containment and only its 12rem stand-in, a stack placed straight in a flex cell (as a tree grid's cells are) stayed 12rem wide, so its bars were shorter than the same column's in a table that wrapped it in a block. It now fills the cell; a content-sized column still sizes it from the stand-in.
|
|
260
|
+
|
|
261
|
+
## Changes in 0.188.0
|
|
262
|
+
|
|
263
|
+
### Usage bars are green, yellow and red by one threshold, and a strategy loops as usage bars
|
|
264
|
+
|
|
265
|
+
**Every usage bar now takes one rule**: green below 80% of the limit (the engine's warning line, `USAGE_WARN_AT`), yellow from 80%, red at the limit. `Meter`'s spent ramp paints an ordinary reading green and turns at 0.8 (it turned at 0.75 in the data series' blue); `LimitMeters` paints an ordinary window green (it was grey), and a known `used` past 80% or the limit escalates a quieter state. `okTone` keeps the old look where a bar is not a usage (`quantity` on `Meter`, `neutral` on `LimitMeters`), and `usageTone(used)` gives the tone to any other drawing. **`UtilizationDiagram`** draws a utilization strategy as looping lanes: `sequential` numbers them and fills lane 1, then 2, then 3, holds 1.5 s and starts again; `balanced` fills them together to one level; each lane takes its level's usage tone, the loop pauses off screen or in a hidden tab, and reduced motion draws a still frame. **`ReorderHandle`** is the grip a `useReorder` item is dragged by (`pointerOnly` for a row whose keys move it), and **`StatCard subLines={0}`** draws no second line. Stories: Usage and strategy (Usage Thresholds, Utilization, Tiles Without A Note, Handle).
|
|
266
|
+
|
|
255
267
|
## Changes in 0.187.0
|
|
256
268
|
|
|
257
269
|
### Rows of groups and members: faces, adds, strips and pickers that fit a table
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ArrangeList, DEFAULT_ARRANGE_LABELS } from '../chunk-
|
|
1
|
+
export { ArrangeList, DEFAULT_ARRANGE_LABELS } from '../chunk-E7GZKGDY.js';
|
|
2
2
|
import '../chunk-6YYRFGXO.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-4FO6WWYW.js';
|
|
4
4
|
import '../chunk-SK4BIFTG.js';
|
|
5
5
|
import '../chunk-COS6LJ4K.js';
|
|
6
6
|
import '../chunk-ED24QJYL.js';
|
package/dist/DataGrid/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ChooserList, ColumnChooser, DATA_GRID_ICON_TRACK, DataGrid, columnChoicesOf, countDataGridRows, fitGridColumns, sortGridRows, useAnyDataGridDriving, useDataGridDriving } from '../chunk-
|
|
1
|
+
export { ChooserList, ColumnChooser, DATA_GRID_ICON_TRACK, DataGrid, columnChoicesOf, countDataGridRows, fitGridColumns, sortGridRows, useAnyDataGridDriving, useDataGridDriving } from '../chunk-GQL2XQTS.js';
|
|
2
2
|
export { nextGridSort, parseGridSort } from '../chunk-WU73BKXL.js';
|
|
3
3
|
import '../chunk-WFAJYBLX.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-4FO6WWYW.js';
|
|
5
5
|
import '../chunk-HG7J6I65.js';
|
|
6
6
|
import '../chunk-SK4BIFTG.js';
|
|
7
7
|
import '../chunk-COS6LJ4K.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { DEEP_WORK_CARD_LABELS, DEEP_WORK_STATES, DEEP_WORK_STATE_LABELS, DeepWorkCard } from '../chunk-
|
|
1
|
+
export { DEEP_WORK_CARD_LABELS, DEEP_WORK_STATES, DEEP_WORK_STATE_LABELS, DeepWorkCard } from '../chunk-Z3FXGNT5.js';
|
|
2
2
|
import '../chunk-LCJC3LTP.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-JEFGH3AQ.js';
|
|
4
4
|
import '../chunk-WLIODLUL.js';
|
|
5
5
|
import '../chunk-G732IWP4.js';
|
|
6
6
|
import '../chunk-AV2DXAEL.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { DOC_TABS_EDITOR_LABELS, DocTabsEditor } from '../chunk-
|
|
1
|
+
export { DOC_TABS_EDITOR_LABELS, DocTabsEditor } from '../chunk-VGGEVVIT.js';
|
|
2
2
|
import '../chunk-4IB7HVDN.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-4FO6WWYW.js';
|
|
4
4
|
import '../chunk-SK4BIFTG.js';
|
|
5
5
|
import '../chunk-COS6LJ4K.js';
|
|
6
6
|
import '../chunk-NMIXL2YH.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type MeterState } from '../Meter/index.js';
|
|
3
3
|
/** One window of a limit: a 5-hour window, a weekly one, a model's own. */
|
|
4
4
|
export interface LimitWindow {
|
|
5
5
|
/** Unique within the stack. */
|
|
@@ -32,11 +32,18 @@ export interface LimitMetersProps extends Omit<HTMLAttributes<HTMLDivElement>, '
|
|
|
32
32
|
empty?: ReactNode;
|
|
33
33
|
/** A muted line under the windows, such as how old the reading is: "as of 2h ago". */
|
|
34
34
|
caption?: ReactNode;
|
|
35
|
+
/** How an ordinary window is painted: `success` (green, the default) or `neutral`. */
|
|
36
|
+
okTone?: 'success' | 'neutral' | undefined;
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
type LimitTone = 'success' | 'neutral' | 'warning' | 'danger';
|
|
39
|
+
/**
|
|
40
|
+
* A window's tone: green inside the limit, yellow near it, red at it. A known `used`
|
|
41
|
+
* past 80% or the limit escalates a quieter state, so every bar turns at one place.
|
|
42
|
+
*/
|
|
43
|
+
export declare function limitWindowTone(state: MeterState, used?: number, okTone?: 'success' | 'neutral'): LimitTone;
|
|
38
44
|
/**
|
|
39
45
|
* A compact stack of a limit's windows for a table cell, one line each. A known
|
|
40
46
|
* fraction is a `meter`; a window known only by its state is a hatched `img`.
|
|
41
47
|
*/
|
|
42
|
-
export declare function LimitMeters({ windows, label, empty, caption, className, ...rest }: LimitMetersProps): import("react").JSX.Element;
|
|
48
|
+
export declare function LimitMeters({ windows, label, empty, caption, okTone, className, ...rest }: LimitMetersProps): import("react").JSX.Element;
|
|
49
|
+
export {};
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/* Inline-size containment gives no intrinsic width, so 12rem stands in for it in a content-sized
|
|
9
9
|
column; no minimum, so a narrower cell shrinks the stack instead of the figures overflowing it. */
|
|
10
10
|
contain-intrinsic-inline-size: 12rem;
|
|
11
|
+
/* The width it is given, in a flex cell too: there the stand-in alone made it 12rem in any cell. */
|
|
12
|
+
inline-size: 100%;
|
|
11
13
|
min-width: 0;
|
|
12
14
|
font-size: var(--font-size-xs);
|
|
13
15
|
line-height: var(--font-line-height-snug);
|
|
@@ -31,11 +33,16 @@
|
|
|
31
33
|
--crewlet-limit-meters-tone: var(--color-text-tertiary);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
/* Green inside the limit, yellow from the warning line, red at the limit (LimitMeters.tsx). */
|
|
37
|
+
.crewlet-limit-meters__window[data-tone='success'] {
|
|
38
|
+
--crewlet-limit-meters-tone: var(--color-feedback-success);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.crewlet-limit-meters__window[data-tone='warning'] {
|
|
35
42
|
--crewlet-limit-meters-tone: var(--color-feedback-warning);
|
|
36
43
|
}
|
|
37
44
|
|
|
38
|
-
.crewlet-limit-meters__window[data-
|
|
45
|
+
.crewlet-limit-meters__window[data-tone='danger'] {
|
|
39
46
|
--crewlet-limit-meters-tone: var(--color-feedback-danger);
|
|
40
47
|
}
|
|
41
48
|
|
|
@@ -86,11 +93,11 @@
|
|
|
86
93
|
color: var(--color-text-primary);
|
|
87
94
|
}
|
|
88
95
|
|
|
89
|
-
.crewlet-limit-meters__window[data-
|
|
96
|
+
.crewlet-limit-meters__window[data-tone='warning'] .crewlet-limit-meters__figure {
|
|
90
97
|
color: var(--color-feedback-warning-ink);
|
|
91
98
|
}
|
|
92
99
|
|
|
93
|
-
.crewlet-limit-meters__window[data-
|
|
100
|
+
.crewlet-limit-meters__window[data-tone='danger'] .crewlet-limit-meters__figure {
|
|
94
101
|
color: var(--color-feedback-danger-ink);
|
|
95
102
|
}
|
|
96
103
|
|
package/dist/ListInput/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ListInput, withDraft } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { ListInput, withDraft } from '../chunk-ZA2STYRY.js';
|
|
2
|
+
import '../chunk-4FO6WWYW.js';
|
|
3
3
|
import '../chunk-VBBLHS2Y.js';
|
|
4
4
|
import '../chunk-SK4BIFTG.js';
|
|
5
5
|
import '../chunk-COS6LJ4K.js';
|
package/dist/Meter/Meter.d.ts
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* What the bar is saying
|
|
4
|
-
*
|
|
5
|
-
* `quantity` is the ordinary reading, because a budget that is being spent is
|
|
6
|
-
* not in a state; it is just a number. It is the first data series,
|
|
7
|
-
* `--color-data-1`: a meter is a figure of one quantity, and the label that
|
|
8
|
-
* names it is what a data hue asks for, where the accent it used to take
|
|
9
|
-
* means "act here" and a bar is not an action. The three that ARE states are
|
|
10
|
-
* derived from the fill unless a caller overrides them, so a bar that is
|
|
11
|
-
* nearly full says so without every call site remembering to. A caller that
|
|
12
|
-
* owns the rule passes a `MeterState` instead, which names the state rather
|
|
13
|
-
* than the paint.
|
|
3
|
+
* What the bar is saying: on the `spent` ramp green inside the limit, `warning` near it,
|
|
4
|
+
* `danger` at it. `quantity` (the first data series) is for a figure that is not a usage.
|
|
14
5
|
*/
|
|
15
6
|
export type MeterTone = 'quantity' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
16
7
|
/**
|
|
@@ -59,11 +50,17 @@ export interface MeterThresholds {
|
|
|
59
50
|
*/
|
|
60
51
|
near: number;
|
|
61
52
|
}
|
|
53
|
+
/** Where a usage reading turns yellow: the engine's own warning line, 80% of the limit. */
|
|
54
|
+
export declare const USAGE_WARN_AT = 0.8;
|
|
62
55
|
/**
|
|
63
|
-
* The thresholds a meter uses when nobody says otherwise: `near` at
|
|
64
|
-
*
|
|
56
|
+
* The thresholds a meter uses when nobody says otherwise: `near` at the
|
|
57
|
+
* engine's warning line (`USAGE_WARN_AT`), so every usage bar turns at one place.
|
|
65
58
|
*/
|
|
66
59
|
export declare const DEFAULT_METER_THRESHOLDS: Readonly<MeterThresholds>;
|
|
60
|
+
/** What an ordinary (`ok`) reading is painted: green by default, or the quiet look it had. */
|
|
61
|
+
export type MeterOkTone = 'success' | 'quantity';
|
|
62
|
+
/** A usage fraction's tone: green below 80%, yellow from 80%, red at the limit. */
|
|
63
|
+
export declare function usageTone(used: number): 'success' | 'warning' | 'danger';
|
|
67
64
|
interface MeterBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
68
65
|
value: number;
|
|
69
66
|
/**
|
|
@@ -95,6 +92,8 @@ interface MeterBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
|
95
92
|
size?: 'default' | 'compact' | undefined;
|
|
96
93
|
/** Keep the label out of the picture. It stays in the accessibility tree. */
|
|
97
94
|
hideLabel?: boolean | undefined;
|
|
95
|
+
/** How an ordinary reading is painted on the `spent` ramp: `success` (green, the default) or `quantity`. */
|
|
96
|
+
okTone?: MeterOkTone | undefined;
|
|
98
97
|
}
|
|
99
98
|
/**
|
|
100
99
|
* THE VERDICT: a caller that owns the rule says which state the quantity is
|
|
@@ -136,8 +135,8 @@ export interface MeterThresholdProps {
|
|
|
136
135
|
thresholds?: MeterThresholds | undefined;
|
|
137
136
|
}
|
|
138
137
|
export type MeterProps = MeterBaseProps & (MeterVerdictProps | MeterRampProps | MeterThresholdProps);
|
|
139
|
-
/** The tone a `MeterState` is painted in. */
|
|
140
|
-
export declare function meterStateTone(state: MeterState): MeterTone;
|
|
138
|
+
/** The tone a `MeterState` is painted in; `okTone` paints an ordinary reading. */
|
|
139
|
+
export declare function meterStateTone(state: MeterState, okTone?: MeterOkTone): MeterTone;
|
|
141
140
|
/**
|
|
142
141
|
* The state a fraction of the limit is in: at or past the limit it is
|
|
143
142
|
* `refusing`, at or past `thresholds.near` it is `near`, below that `ok`.
|
|
@@ -209,5 +208,5 @@ export declare function progressTone(percent: number): MeterTone;
|
|
|
209
208
|
* figures, so nothing is lost: what a reader hears is "140 of 100", not a bar
|
|
210
209
|
* that quietly rounds itself down to exactly the limit it has overrun.
|
|
211
210
|
*/
|
|
212
|
-
export declare function Meter({ value, max, label, valueText, hint, state, tone, polarity, thresholds, size, hideLabel, className, ...rest }: MeterProps): import("react").JSX.Element;
|
|
211
|
+
export declare function Meter({ value, max, label, valueText, hint, state, tone, polarity, thresholds, okTone, size, hideLabel, className, ...rest }: MeterProps): import("react").JSX.Element;
|
|
213
212
|
export {};
|
package/dist/Meter/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './Meter.css';
|
|
2
|
-
export { DEFAULT_METER_THRESHOLDS, METER_STATES, Meter, meterState, meterStateTone, meterTone, progressTone, } from './Meter.js';
|
|
3
|
-
export type { MeterPolarity, MeterProps, MeterRampProps, MeterState, MeterThresholdProps, MeterThresholds, MeterTone, MeterVerdictProps, } from './Meter.js';
|
|
2
|
+
export { DEFAULT_METER_THRESHOLDS, METER_STATES, Meter, meterState, meterStateTone, meterTone, progressTone, usageTone, USAGE_WARN_AT, } from './Meter.js';
|
|
3
|
+
export type { MeterPolarity, MeterOkTone, MeterProps, MeterRampProps, MeterState, MeterThresholdProps, MeterThresholds, MeterTone, MeterVerdictProps, } from './Meter.js';
|
package/dist/Meter/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DEFAULT_METER_THRESHOLDS, METER_STATES, Meter, meterState, meterStateTone, meterTone, progressTone } from '../chunk-
|
|
1
|
+
export { DEFAULT_METER_THRESHOLDS, METER_STATES, Meter, USAGE_WARN_AT, meterState, meterStateTone, meterTone, progressTone, usageTone } from '../chunk-JEFGH3AQ.js';
|
|
2
2
|
import '../chunk-RRRK2KB6.js';
|
|
3
3
|
import '../chunk-ODEQTPFM.js';
|
package/dist/OrgTable/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { OrgTable, OrgTableActions, OrgTableAdd, OrgTableName } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { OrgTable, OrgTableActions, OrgTableAdd, OrgTableName } from '../chunk-IKGEOJEA.js';
|
|
2
|
+
import '../chunk-MD5KDF7W.js';
|
|
3
3
|
import '../chunk-BZLQHZKH.js';
|
|
4
4
|
import '../chunk-MY374UUD.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-GQL2XQTS.js';
|
|
6
6
|
import '../chunk-WU73BKXL.js';
|
|
7
7
|
import '../chunk-CUEPPDBC.js';
|
|
8
8
|
import '../chunk-WFAJYBLX.js';
|
|
9
|
-
import '../chunk-
|
|
9
|
+
import '../chunk-4FO6WWYW.js';
|
|
10
10
|
import '../chunk-HG7J6I65.js';
|
|
11
11
|
import '../chunk-X2CFDU5S.js';
|
|
12
12
|
import '../chunk-EX5XAEST.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReorderHandleProps as HandleBinding } from './useReorder.js';
|
|
2
|
+
export interface ReorderHandleComponentProps extends HandleBinding {
|
|
3
|
+
/**
|
|
4
|
+
* Out of the tab order, for a row whose own keys move it (a grid row with Alt and
|
|
5
|
+
* an arrow): the handle is then the pointer's only.
|
|
6
|
+
*/
|
|
7
|
+
pointerOnly?: boolean | undefined;
|
|
8
|
+
/** Held in place: drawn, not draggable. */
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** The grip a `useReorder` or `useReorderLists` item is dragged by: spread `handleProps(key)` on it. */
|
|
13
|
+
export declare function ReorderHandle({ pointerOnly, disabled, className, ...binding }: ReorderHandleComponentProps): import("react").JSX.Element;
|
package/dist/Reorder/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import './ReorderHandle.css';
|
|
1
2
|
export { useReorder, useReorderLists, moveKey, DEFAULT_REORDER_LABELS } from './useReorder.js';
|
|
3
|
+
export { ReorderHandle } from './ReorderHandle.js';
|
|
4
|
+
export type { ReorderHandleComponentProps } from './ReorderHandle.js';
|
|
2
5
|
export type { Reorder, ReorderAxis, ReorderContainerProps, ReorderHandleProps, ReorderItemProps, ReorderLabels, ReorderLists, ReorderListsState, UseReorderListsOptions, UseReorderOptions, } from './useReorder.js';
|
package/dist/Reorder/index.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
export { DEFAULT_REORDER_LABELS, moveKey, useReorder, useReorderLists } from '../chunk-
|
|
1
|
+
export { DEFAULT_REORDER_LABELS, ReorderHandle, moveKey, useReorder, useReorderLists } from '../chunk-4FO6WWYW.js';
|
|
2
2
|
import '../chunk-SK4BIFTG.js';
|
|
3
3
|
import '../chunk-COS6LJ4K.js';
|
|
4
4
|
import '../chunk-WGMKERCR.js';
|
|
5
|
+
import '../chunk-CMEZGORB.js';
|
|
6
|
+
import '../chunk-TDFLCUBE.js';
|
|
7
|
+
import '../chunk-KOBTCG2T.js';
|
|
8
|
+
import '../chunk-HTS5RJ7S.js';
|
|
9
|
+
import '../chunk-L72URIHR.js';
|
|
10
|
+
import '../chunk-AVJKMQXK.js';
|
|
11
|
+
import '../chunk-EDPMHSLZ.js';
|
|
12
|
+
import '../chunk-4ITETIGZ.js';
|
|
5
13
|
import '../chunk-RRRK2KB6.js';
|
|
6
14
|
import '../chunk-ODEQTPFM.js';
|
package/dist/RichEditor/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { RichEditor, preloadRichEditor } from '../chunk-
|
|
1
|
+
export { RichEditor, preloadRichEditor } from '../chunk-ZDHQ5ZDT.js';
|
|
2
2
|
export { RICH_EDITOR_LABELS, richEditorLabels } from '../chunk-DGXHQMNP.js';
|
|
3
3
|
import '../chunk-KOJPDCGQ.js';
|
|
4
4
|
import '../chunk-KMTOGF6T.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { SlideFilmstrip } from '../chunk-
|
|
1
|
+
export { SlideFilmstrip } from '../chunk-ZX6E6DSB.js';
|
|
2
2
|
import '../chunk-7O53SWKI.js';
|
|
3
3
|
import '../chunk-4IB7HVDN.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-4FO6WWYW.js';
|
|
5
5
|
import '../chunk-VBBLHS2Y.js';
|
|
6
6
|
import '../chunk-SK4BIFTG.js';
|
|
7
7
|
import '../chunk-COS6LJ4K.js';
|
|
@@ -85,6 +85,7 @@ export interface StatCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
85
85
|
/**
|
|
86
86
|
* How many lines the second line keeps room for, loading or not, so a row
|
|
87
87
|
* whose notes wrap differently, or have not arrived, stands at one height.
|
|
88
|
+
* `0` draws no second line at all, for a row of tiles that say a label and a value only.
|
|
88
89
|
*/
|
|
89
90
|
subLines?: number | undefined;
|
|
90
91
|
/** What a reader is told while it is loading. */
|
package/dist/StatCard/index.js
CHANGED
package/dist/TreeGrid/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { TreeGrid } from '../chunk-
|
|
1
|
+
export { TreeGrid } from '../chunk-MD5KDF7W.js';
|
|
2
2
|
import '../chunk-MY374UUD.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-GQL2XQTS.js';
|
|
4
4
|
import '../chunk-WU73BKXL.js';
|
|
5
5
|
import '../chunk-CUEPPDBC.js';
|
|
6
6
|
import '../chunk-WFAJYBLX.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-4FO6WWYW.js';
|
|
8
8
|
import '../chunk-HG7J6I65.js';
|
|
9
9
|
import '../chunk-SK4BIFTG.js';
|
|
10
10
|
import '../chunk-COS6LJ4K.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type UtilizationMode = 'balanced' | 'sequential';
|
|
3
|
+
export interface UtilizationDiagramProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
4
|
+
/** `sequential` fills lane 1, then 2, then 3; `balanced` fills them together to one level. */
|
|
5
|
+
mode: UtilizationMode;
|
|
6
|
+
/** How many lanes, 2 to 5; 3 by default. */
|
|
7
|
+
lanes?: number | undefined;
|
|
8
|
+
/** Names the picture for assistive technology; without it the diagram is decoration. */
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
/** The phases of one loop, in milliseconds. */
|
|
12
|
+
export declare const UTILIZATION_TIMING: {
|
|
13
|
+
readonly fill: 1200;
|
|
14
|
+
readonly balancedFill: 2400;
|
|
15
|
+
readonly hold: 1500;
|
|
16
|
+
readonly fade: 400;
|
|
17
|
+
};
|
|
18
|
+
/** Where a balanced loop rests: every lane level, below the warning line. */
|
|
19
|
+
export declare const BALANCED_LEVEL = 0.6;
|
|
20
|
+
/** One loop's length for a mode and a lane count. */
|
|
21
|
+
export declare function utilizationCycle(mode: UtilizationMode, lanes: number): number;
|
|
22
|
+
/** Each lane's level (0 to 1) and opacity at `ms` into the loop. */
|
|
23
|
+
export declare function utilizationFrame(mode: UtilizationMode, lanes: number, ms: number): {
|
|
24
|
+
level: number;
|
|
25
|
+
opacity: number;
|
|
26
|
+
}[];
|
|
27
|
+
/** The still frame under reduced motion: lane 1 at its limit and lane 2 part way, or every lane level. */
|
|
28
|
+
export declare function utilizationStill(mode: UtilizationMode, lanes: number): number[];
|
|
29
|
+
/**
|
|
30
|
+
* A utilization strategy as lanes of usage bars that loop while seen, each in its level's
|
|
31
|
+
* usage tone. Paused off screen or in a hidden tab; a still frame under reduced motion.
|
|
32
|
+
*/
|
|
33
|
+
export declare function UtilizationDiagram({ mode, lanes, label, className, ...rest }: UtilizationDiagramProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* A utilization strategy as looping usage bars (UtilizationDiagram.tsx). */
|
|
2
|
+
.crewlet-utilization-diagram {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
gap: var(--spacing-2);
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
inline-size: var(--crewlet-utilization-diagram-width, 6.75rem);
|
|
9
|
+
padding: var(--spacing-2) var(--spacing-3);
|
|
10
|
+
border-radius: var(--radius-md);
|
|
11
|
+
background: var(--color-surface-subtle);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.crewlet-utilization-diagram__lane {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: var(--spacing-1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.crewlet-utilization-diagram__n {
|
|
21
|
+
min-inline-size: 1ch;
|
|
22
|
+
font-size: var(--font-size-2xs);
|
|
23
|
+
font-weight: var(--font-weight-semibold);
|
|
24
|
+
font-variant-numeric: tabular-nums;
|
|
25
|
+
line-height: 1;
|
|
26
|
+
color: var(--color-text-tertiary);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.crewlet-utilization-diagram__track {
|
|
30
|
+
position: relative;
|
|
31
|
+
flex: 1;
|
|
32
|
+
block-size: 6px;
|
|
33
|
+
border-radius: var(--radius-pill);
|
|
34
|
+
background: var(--color-border-default);
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.crewlet-utilization-diagram__fill {
|
|
39
|
+
position: absolute;
|
|
40
|
+
inset: 0;
|
|
41
|
+
border-radius: var(--radius-pill);
|
|
42
|
+
transform: scaleX(0);
|
|
43
|
+
transform-origin: left center;
|
|
44
|
+
background: var(--color-feedback-success);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.crewlet-utilization-diagram__fill[data-tone='warning'] {
|
|
48
|
+
background: var(--color-feedback-warning);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.crewlet-utilization-diagram__fill[data-tone='danger'] {
|
|
52
|
+
background: var(--color-feedback-danger);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (forced-colors: active) {
|
|
56
|
+
.crewlet-utilization-diagram__fill {
|
|
57
|
+
background: CanvasText;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { prefersReducedMotion } from './chunk-COS6LJ4K.js';
|
|
2
2
|
import { announce } from './chunk-WGMKERCR.js';
|
|
3
|
+
import { IconButton } from './chunk-CMEZGORB.js';
|
|
4
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
|
+
import './ReorderHandle-CT5OMUSR.css';
|
|
3
6
|
import { useId, useState, useRef, useCallback, useLayoutEffect, useMemo } from 'react';
|
|
7
|
+
import { GripVerticalGlyph } from '@crewlethq/icons/glyphs';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
9
|
|
|
5
10
|
var DEFAULT_REORDER_LABELS = {
|
|
6
11
|
handle: (name) => `Move ${name}`,
|
|
@@ -274,5 +279,20 @@ function useReorder({
|
|
|
274
279
|
hint: r.hint
|
|
275
280
|
};
|
|
276
281
|
}
|
|
282
|
+
function ReorderHandle({ pointerOnly = false, disabled = false, className, ...binding }) {
|
|
283
|
+
const { "aria-label": label, ...handle } = binding;
|
|
284
|
+
return /* @__PURE__ */ jsx(
|
|
285
|
+
IconButton,
|
|
286
|
+
{
|
|
287
|
+
size: "sm",
|
|
288
|
+
variant: "ghost",
|
|
289
|
+
className: cx("crewlet-reorder-handle", className),
|
|
290
|
+
label,
|
|
291
|
+
icon: /* @__PURE__ */ jsx(GripVerticalGlyph, { size: "sm" }),
|
|
292
|
+
...pointerOnly ? { tabIndex: -1 } : {},
|
|
293
|
+
...disabled ? { disabled: true } : handle
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
}
|
|
277
297
|
|
|
278
|
-
export { DEFAULT_REORDER_LABELS, moveKey, useReorder, useReorderLists };
|
|
298
|
+
export { DEFAULT_REORDER_LABELS, ReorderHandle, moveKey, useReorder, useReorderLists };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { usageTone } from './chunk-JEFGH3AQ.js';
|
|
2
|
+
import { useMediaMatch, REDUCED_MOTION_QUERY } from './chunk-COS6LJ4K.js';
|
|
3
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
|
+
import './UtilizationDiagram-IYB6TTZY.css';
|
|
5
|
+
import { useRef, useEffect } from 'react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var UTILIZATION_TIMING = { fill: 1200, balancedFill: 2400, hold: 1500, fade: 400 };
|
|
9
|
+
var BALANCED_LEVEL = 0.6;
|
|
10
|
+
function utilizationCycle(mode, lanes) {
|
|
11
|
+
const fill = mode === "sequential" ? UTILIZATION_TIMING.fill * lanes : UTILIZATION_TIMING.balancedFill;
|
|
12
|
+
return fill + UTILIZATION_TIMING.hold + UTILIZATION_TIMING.fade;
|
|
13
|
+
}
|
|
14
|
+
function utilizationFrame(mode, lanes, ms) {
|
|
15
|
+
const cycle = utilizationCycle(mode, lanes);
|
|
16
|
+
const t = (ms % cycle + cycle) % cycle;
|
|
17
|
+
const fadeAt = cycle - UTILIZATION_TIMING.fade;
|
|
18
|
+
const opacity = t < fadeAt ? 1 : 1 - (t - fadeAt) / UTILIZATION_TIMING.fade;
|
|
19
|
+
return Array.from({ length: lanes }, (_, lane) => {
|
|
20
|
+
if (mode === "balanced") {
|
|
21
|
+
const p = Math.min(1, t / UTILIZATION_TIMING.balancedFill);
|
|
22
|
+
const eased = p < 0.5 ? 2 * p * p : 1 - (-2 * p + 2) ** 2 / 2;
|
|
23
|
+
return { level: BALANCED_LEVEL * eased, opacity };
|
|
24
|
+
}
|
|
25
|
+
const start = lane * UTILIZATION_TIMING.fill;
|
|
26
|
+
const level = Math.max(0, Math.min(1, (t - start) / UTILIZATION_TIMING.fill));
|
|
27
|
+
return { level, opacity };
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function utilizationStill(mode, lanes) {
|
|
31
|
+
return Array.from(
|
|
32
|
+
{ length: lanes },
|
|
33
|
+
(_, lane) => mode === "balanced" ? BALANCED_LEVEL : lane === 0 ? 1 : lane === 1 ? 0.55 : 0
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function UtilizationDiagram({ mode, lanes = 3, label, className, ...rest }) {
|
|
37
|
+
const root = useRef(null);
|
|
38
|
+
const fills = useRef([]);
|
|
39
|
+
const still = useMediaMatch(REDUCED_MOTION_QUERY);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const paint = (levels, opacity = 1) => {
|
|
42
|
+
levels.forEach((level, lane) => {
|
|
43
|
+
const fill = fills.current[lane];
|
|
44
|
+
if (!fill) return;
|
|
45
|
+
fill.style.transform = `scaleX(${level})`;
|
|
46
|
+
fill.style.opacity = String(opacity);
|
|
47
|
+
fill.dataset["tone"] = usageTone(level);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
if (still || typeof requestAnimationFrame !== "function") {
|
|
51
|
+
paint(utilizationStill(mode, lanes));
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
let seen = true;
|
|
55
|
+
let frame = 0;
|
|
56
|
+
let elapsed = 0;
|
|
57
|
+
let last = null;
|
|
58
|
+
const tick = (now) => {
|
|
59
|
+
if (last !== null) elapsed += now - last;
|
|
60
|
+
last = now;
|
|
61
|
+
const at = utilizationFrame(mode, lanes, elapsed);
|
|
62
|
+
paint(
|
|
63
|
+
at.map((one) => one.level),
|
|
64
|
+
at[0]?.opacity ?? 1
|
|
65
|
+
);
|
|
66
|
+
frame = requestAnimationFrame(tick);
|
|
67
|
+
};
|
|
68
|
+
const sync = () => {
|
|
69
|
+
const run = seen && !document.hidden;
|
|
70
|
+
cancelAnimationFrame(frame);
|
|
71
|
+
last = null;
|
|
72
|
+
if (run) frame = requestAnimationFrame(tick);
|
|
73
|
+
};
|
|
74
|
+
const io = typeof IntersectionObserver === "undefined" ? null : new IntersectionObserver((entries) => {
|
|
75
|
+
seen = entries.some((entry) => entry.isIntersecting);
|
|
76
|
+
sync();
|
|
77
|
+
});
|
|
78
|
+
if (root.current) io?.observe(root.current);
|
|
79
|
+
document.addEventListener("visibilitychange", sync);
|
|
80
|
+
paint(utilizationStill(mode, lanes).map(() => 0));
|
|
81
|
+
sync();
|
|
82
|
+
return () => {
|
|
83
|
+
cancelAnimationFrame(frame);
|
|
84
|
+
io?.disconnect();
|
|
85
|
+
document.removeEventListener("visibilitychange", sync);
|
|
86
|
+
};
|
|
87
|
+
}, [mode, lanes, still]);
|
|
88
|
+
if (!Number.isInteger(lanes) || lanes < 2 || lanes > 5) {
|
|
89
|
+
throw new RangeError(`UtilizationDiagram lanes must be a whole number from 2 to 5; it was ${lanes}`);
|
|
90
|
+
}
|
|
91
|
+
return /* @__PURE__ */ jsx(
|
|
92
|
+
"span",
|
|
93
|
+
{
|
|
94
|
+
...rest,
|
|
95
|
+
ref: root,
|
|
96
|
+
className: cx("crewlet-utilization-diagram", className),
|
|
97
|
+
"data-mode": mode,
|
|
98
|
+
role: label ? "img" : void 0,
|
|
99
|
+
"aria-label": label,
|
|
100
|
+
"aria-hidden": label ? void 0 : true,
|
|
101
|
+
children: Array.from({ length: lanes }, (_, lane) => /* @__PURE__ */ jsxs("span", { className: "crewlet-utilization-diagram__lane", children: [
|
|
102
|
+
mode === "sequential" ? /* @__PURE__ */ jsx("span", { className: "crewlet-utilization-diagram__n", children: lane + 1 }) : null,
|
|
103
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-utilization-diagram__track", children: /* @__PURE__ */ jsx(
|
|
104
|
+
"span",
|
|
105
|
+
{
|
|
106
|
+
className: "crewlet-utilization-diagram__fill",
|
|
107
|
+
"data-tone": "success",
|
|
108
|
+
ref: (node) => {
|
|
109
|
+
fills.current[lane] = node;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
) })
|
|
113
|
+
] }, lane))
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export { UtilizationDiagram };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Switch } from './chunk-6YYRFGXO.js';
|
|
2
|
-
import { useReorder } from './chunk-
|
|
2
|
+
import { useReorder } from './chunk-4FO6WWYW.js';
|
|
3
3
|
import { Checkbox } from './chunk-ED24QJYL.js';
|
|
4
4
|
import { IconButton } from './chunk-CMEZGORB.js';
|
|
5
5
|
import { VisuallyHidden } from './chunk-RRRK2KB6.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GRID_FOOT_LABELS, GRID_ICON_TRACK, headerWord, sortByValue, parseGridSort, overrunning, tableTrack, GridHeadCell, GridFoot, droppedNames, nextGridSort, rowLinkTitle, squeezedCells, SHORT_COLUMN_PX, alignOf } from './chunk-WU73BKXL.js';
|
|
2
2
|
import { Skeleton } from './chunk-WFAJYBLX.js';
|
|
3
|
-
import { useReorder } from './chunk-
|
|
3
|
+
import { useReorder } from './chunk-4FO6WWYW.js';
|
|
4
4
|
import { EmptyState } from './chunk-HG7J6I65.js';
|
|
5
5
|
import { useMediaMatch } from './chunk-COS6LJ4K.js';
|
|
6
6
|
import { Checkbox } from './chunk-ED24QJYL.js';
|
|
@@ -46,7 +46,7 @@ var StatCard = ({
|
|
|
46
46
|
] }, "value") }),
|
|
47
47
|
trend && !loading ? /* @__PURE__ */ jsx("div", { className: "crewlet-statcard__trend", children: trend }) : null
|
|
48
48
|
] }),
|
|
49
|
-
/* @__PURE__ */ jsxs(
|
|
49
|
+
subLines === 0 && !said && !change ? null : /* @__PURE__ */ jsxs(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
52
|
className: cx("crewlet-statcard__sub", subTone !== "neutral" && `crewlet-statcard__sub--${subTone}`),
|