@crewlethq/ui 0.186.1 → 0.188.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 (104) hide show
  1. package/README.md +12 -0
  2. package/dist/ActivityLine/index.js +3 -3
  3. package/dist/AddPill/AddPill.d.ts +26 -9
  4. package/dist/AddPill/index.d.ts +2 -2
  5. package/dist/AddPill/index.js +1 -1
  6. package/dist/ArrangeList/index.js +2 -2
  7. package/dist/ArtifactCard/index.js +2 -2
  8. package/dist/Avatar/AvatarStack.d.ts +9 -4
  9. package/dist/Avatar/index.js +1 -1
  10. package/dist/{AvatarStack-UNBXFHTZ.css → AvatarStack-6N6V7L7L.css} +11 -3
  11. package/dist/CommentThread/index.js +1 -1
  12. package/dist/DataGrid/index.js +3 -3
  13. package/dist/{DataGrid-K2L4ZOUH.css → DataGrid-UGOZXHJS.css} +5 -0
  14. package/dist/DeepWorkCard/index.js +2 -2
  15. package/dist/DocTabsEditor/index.js +2 -2
  16. package/dist/DurationField/index.js +2 -2
  17. package/dist/EntityChip/index.js +1 -1
  18. package/dist/ImageUpload/index.js +1 -1
  19. package/dist/LimitMeters/LimitMeters.d.ts +11 -4
  20. package/dist/LimitMeters/index.js +3 -1
  21. package/dist/{LimitMeters-HDEBOATH.css → LimitMeters-BCQEUJZ3.css} +9 -4
  22. package/dist/ListInput/index.js +2 -2
  23. package/dist/Meter/Meter.d.ts +15 -16
  24. package/dist/Meter/index.d.ts +2 -2
  25. package/dist/Meter/index.js +1 -1
  26. package/dist/OrgLabel/OrgLabel.d.ts +6 -0
  27. package/dist/OrgLabel/index.js +2 -2
  28. package/dist/{OrgLabel-WCI3OIFL.css → OrgLabel-4NDGABVY.css} +11 -6
  29. package/dist/OrgNode/index.js +3 -3
  30. package/dist/OrgTable/OrgTable.d.ts +6 -3
  31. package/dist/OrgTable/index.js +8 -8
  32. package/dist/{OrgTable-5NXRECVP.css → OrgTable-73WNQCH3.css} +5 -4
  33. package/dist/PeopleRail/index.js +1 -1
  34. package/dist/PresenceStack/index.js +1 -1
  35. package/dist/Principal/index.js +1 -1
  36. package/dist/PrincipalPicker/index.js +1 -1
  37. package/dist/ProposalCard/index.js +3 -3
  38. package/dist/RailList/index.js +2 -2
  39. package/dist/Reorder/ReorderHandle.d.ts +13 -0
  40. package/dist/Reorder/index.d.ts +3 -0
  41. package/dist/Reorder/index.js +9 -1
  42. package/dist/ReorderHandle-CT5OMUSR.css +9 -0
  43. package/dist/RichEditor/index.js +1 -1
  44. package/dist/Select/Select.d.ts +10 -0
  45. package/dist/Select/index.js +1 -1
  46. package/dist/{Select-2FAOIL73.css → Select-DRBDKBRO.css} +50 -1
  47. package/dist/SettingsTable/index.js +2 -2
  48. package/dist/ShareDialog/index.js +3 -3
  49. package/dist/SheetColumnEditor/index.js +2 -2
  50. package/dist/SheetGrid/index.js +1 -1
  51. package/dist/SlideFilmstrip/index.js +2 -2
  52. package/dist/StatCard/StatCard.d.ts +1 -0
  53. package/dist/StatCard/index.js +1 -1
  54. package/dist/TableCells/index.js +1 -1
  55. package/dist/ThreadSummary/index.js +2 -2
  56. package/dist/TimeWindowPicker/index.js +2 -2
  57. package/dist/TreeGrid/index.js +4 -4
  58. package/dist/{TreeGrid-XZCH5WCC.css → TreeGrid-QKEQXK26.css} +19 -2
  59. package/dist/UtilizationDiagram/UtilizationDiagram.d.ts +33 -0
  60. package/dist/UtilizationDiagram/index.d.ts +3 -0
  61. package/dist/UtilizationDiagram/index.js +6 -0
  62. package/dist/UtilizationDiagram-IYB6TTZY.css +59 -0
  63. package/dist/ValueField/index.js +2 -2
  64. package/dist/VersionTimeline/index.js +1 -1
  65. package/dist/WorkingLine/index.js +2 -2
  66. package/dist/{chunk-6SGMBLOE.js → chunk-3PBQNCPC.js} +1 -1
  67. package/dist/{chunk-JMBPMSNI.js → chunk-4FO6WWYW.js} +21 -1
  68. package/dist/chunk-5DABULI2.js +118 -0
  69. package/dist/{chunk-S3WUN7GH.js → chunk-A42UVBJQ.js} +2 -2
  70. package/dist/{chunk-NIM7LEEI.js → chunk-BZLQHZKH.js} +3 -2
  71. package/dist/{chunk-MB2C2GGW.js → chunk-CHBNLTVC.js} +1 -1
  72. package/dist/{chunk-ELYOAZCB.js → chunk-CPOTDACH.js} +1 -1
  73. package/dist/{chunk-26G3D2L6.js → chunk-E7GZKGDY.js} +1 -1
  74. package/dist/{chunk-5CCM3DDA.js → chunk-EHRNLV3D.js} +56 -7
  75. package/dist/{chunk-7LQRG3BP.js → chunk-EO4CV3P7.js} +1 -1
  76. package/dist/{chunk-DV7KWYC6.js → chunk-FTWZ2AQR.js} +1 -1
  77. package/dist/{chunk-UBXJBVYV.js → chunk-GQL2XQTS.js} +3 -3
  78. package/dist/{chunk-4ASS2GXQ.js → chunk-HJ63EXMY.js} +1 -1
  79. package/dist/{chunk-7U6JFHJY.js → chunk-IKGEOJEA.js} +12 -5
  80. package/dist/{chunk-MXOT2CWL.js → chunk-JEFGH3AQ.js} +17 -9
  81. package/dist/{chunk-KKEVX2PD.js → chunk-KITMVT74.js} +20 -12
  82. package/dist/{chunk-JH2IATUQ.js → chunk-KQWB2MDP.js} +1 -1
  83. package/dist/{chunk-D4ACFQCR.js → chunk-LG72TVII.js} +2 -2
  84. package/dist/{chunk-WDVENT6N.js → chunk-MD5KDF7W.js} +33 -12
  85. package/dist/{chunk-D5UVJL4I.js → chunk-QZNENGHA.js} +31 -16
  86. package/dist/{chunk-BYU7YSOM.js → chunk-S33O4PTO.js} +1 -1
  87. package/dist/{chunk-TCBV4K7V.js → chunk-T53EKFO2.js} +1 -1
  88. package/dist/{chunk-HNDQZWTX.js → chunk-V2ZUNC7X.js} +1 -1
  89. package/dist/{chunk-W3YTURNG.js → chunk-VGGEVVIT.js} +1 -1
  90. package/dist/{chunk-M34LSGMH.js → chunk-WU73BKXL.js} +17 -6
  91. package/dist/{chunk-T7Y5FM4B.js → chunk-X2CFDU5S.js} +7 -2
  92. package/dist/{chunk-UIA7FKDE.js → chunk-XG6PTSHE.js} +1 -1
  93. package/dist/{chunk-5MPQ657T.js → chunk-Z3FXGNT5.js} +1 -1
  94. package/dist/{chunk-O7KT5EIN.js → chunk-ZA2STYRY.js} +1 -1
  95. package/dist/{chunk-A4CTKERL.js → chunk-ZDHQ5ZDT.js} +1 -1
  96. package/dist/{chunk-7U3OHBGV.js → chunk-ZX6E6DSB.js} +1 -1
  97. package/dist/{chunk-KFX6FQKU.js → chunk-ZXX24HXF.js} +1 -1
  98. package/dist/generated/index.d.ts +1 -0
  99. package/dist/generated/index.js +57 -56
  100. package/dist/index.js +57 -56
  101. package/dist/styles.css +191 -27
  102. package/package.json +3 -3
  103. package/dist/{Editor-WFP2MM6M.js → Editor-NFC7HEWU.js} +1 -1
  104. /package/dist/{chunk-7ZBJ7YTF.js → chunk-LE7SVMCB.js} +0 -0
@@ -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,4 +1,4 @@
1
- import { Select } from './chunk-D5UVJL4I.js';
1
+ import { Select } from './chunk-QZNENGHA.js';
2
2
  import { Combobox } from './chunk-YXRC2NSO.js';
3
3
  import { Button } from './chunk-NMIXL2YH.js';
4
4
  import { FormField, Textarea, InputAffix } from './chunk-LSQ5BNLZ.js';
@@ -7,7 +7,7 @@ import './Input-YVCNNTYT.css';
7
7
  import './VisuallyHidden-OUYVMKEH.css';
8
8
  import './HitArea-QUOS6ZDJ.css';
9
9
  import './Combobox-GHT43K32.css';
10
- import './Select-2FAOIL73.css';
10
+ import './Select-DRBDKBRO.css';
11
11
  import './ValueField-JK7JPVR6.css';
12
12
  import { useId, useState, useRef } from 'react';
13
13
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -1,6 +1,6 @@
1
1
  import { Avatar } from './chunk-YMFFGPFE.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
- import './OrgLabel-WCI3OIFL.css';
3
+ import './OrgLabel-4NDGABVY.css';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
 
6
6
  function OrgLabel(props) {
@@ -11,7 +11,8 @@ function OrgLabel(props) {
11
11
  className: cx(
12
12
  "crewlet-org-label__icon",
13
13
  props.iconSize === "lg" && "crewlet-org-label__icon--lg",
14
- props.iconRing === true && "crewlet-org-label__icon--ring"
14
+ props.iconRing === true && "crewlet-org-label__icon--ring",
15
+ props.iconTone === "own" && "crewlet-org-label__icon--own"
15
16
  ),
16
17
  "aria-hidden": "true",
17
18
  children: [
@@ -1,4 +1,4 @@
1
- import { Select } from './chunk-D5UVJL4I.js';
1
+ import { Select } from './chunk-QZNENGHA.js';
2
2
  import { today, shiftMonth, CalendarGrid, compareDays } from './chunk-EE3DJMSQ.js';
3
3
  import { Popover } from './chunk-AJFA2XDQ.js';
4
4
  import { Button } from './chunk-NMIXL2YH.js';
@@ -5,7 +5,7 @@ import { Card } from './chunk-G732IWP4.js';
5
5
  import { ArtifactKindGround } from './chunk-W3A6NBUM.js';
6
6
  import { ArtifactKindGlyph } from './chunk-RSKW25Y5.js';
7
7
  import { ArtifactAccessGlyph } from './chunk-DOY3KC6I.js';
8
- import { AvatarStack } from './chunk-T7Y5FM4B.js';
8
+ import { AvatarStack } from './chunk-X2CFDU5S.js';
9
9
  import { Checkbox } from './chunk-ED24QJYL.js';
10
10
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
11
11
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,5 +1,5 @@
1
1
  import { Switch } from './chunk-6YYRFGXO.js';
2
- import { useReorder } from './chunk-JMBPMSNI.js';
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';
@@ -2,12 +2,61 @@ import { VisuallyHidden } from './chunk-RRRK2KB6.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
3
  import './AddPill-XLESL6BA.css';
4
4
  import { useState, useId, useRef, useCallback, useEffect, Fragment } from 'react';
5
+ import { cssLength } from '@crewlethq/icons/glyphs';
5
6
  import { jsxs, jsx } from 'react/jsx-runtime';
6
7
 
7
8
  var ADD_PILL_MS = 200;
8
- function AddPill({
9
+ function AddCircleGlyph({ size, className, ...rest }) {
10
+ const length = cssLength(size);
11
+ return /* @__PURE__ */ jsxs(
12
+ "svg",
13
+ {
14
+ width: length,
15
+ height: length,
16
+ fill: "none",
17
+ stroke: "currentColor",
18
+ strokeWidth: 1.5,
19
+ strokeLinecap: "round",
20
+ "aria-hidden": "true",
21
+ focusable: "false",
22
+ className: cx("crewlet-add-mark", className),
23
+ ...rest,
24
+ viewBox: "0 0 16 16",
25
+ children: [
26
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "7" }),
27
+ /* @__PURE__ */ jsx("path", { d: "M8 4.5v7M4.5 8h7" })
28
+ ]
29
+ }
30
+ );
31
+ }
32
+ function AddPill(props) {
33
+ return props.onAdd === void 0 ? /* @__PURE__ */ jsx(SplitAddPill, { ...props }) : /* @__PURE__ */ jsx(SingleAdd, { ...props });
34
+ }
35
+ function SingleAdd({ label, onAdd, size = "sm", tabIndex, onOpen, className }) {
36
+ return /* @__PURE__ */ jsx("div", { className: cx("crewlet-add-pill", className), "data-phase": "closed", "data-size": size, "data-face": "off", children: /* @__PURE__ */ jsxs(
37
+ "button",
38
+ {
39
+ type: "button",
40
+ className: "crewlet-add-pill__mark",
41
+ "aria-label": label,
42
+ title: label,
43
+ tabIndex,
44
+ onClick: (event) => {
45
+ event.stopPropagation();
46
+ onOpen?.();
47
+ onAdd();
48
+ },
49
+ children: [
50
+ /* @__PURE__ */ jsx("span", { className: "crewlet-add-pill__disc", "aria-hidden": "true" }),
51
+ /* @__PURE__ */ jsx(AddCircleGlyph, {})
52
+ ]
53
+ }
54
+ ) });
55
+ }
56
+ function SplitAddPill({
9
57
  label,
10
58
  sections,
59
+ face = true,
11
60
  size = "sm",
12
61
  layout = "split",
13
62
  tabIndex,
@@ -72,9 +121,12 @@ function AddPill({
72
121
  "data-phase": phase,
73
122
  "data-size": size,
74
123
  "data-layout": layout,
124
+ "data-face": face ? void 0 : "off",
75
125
  ref: group,
76
126
  onBlur,
77
- onMouseEnter: () => setPhase((was) => was === "locked" ? was : "preview"),
127
+ onMouseEnter: () => {
128
+ if (face) setPhase((was) => was === "locked" ? was : "preview");
129
+ },
78
130
  onMouseLeave: () => {
79
131
  if (phase === "preview") close(false);
80
132
  },
@@ -93,10 +145,7 @@ function AddPill({
93
145
  onClick: press,
94
146
  children: [
95
147
  /* @__PURE__ */ jsx("span", { className: "crewlet-add-pill__disc", "aria-hidden": "true" }),
96
- /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: [
97
- /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "7" }),
98
- /* @__PURE__ */ jsx("path", { d: "M8 4.5v7M4.5 8h7" })
99
- ] })
148
+ /* @__PURE__ */ jsx(AddCircleGlyph, {})
100
149
  ]
101
150
  }
102
151
  ),
@@ -137,4 +186,4 @@ function AddPill({
137
186
  );
138
187
  }
139
188
 
140
- export { ADD_PILL_MS, AddPill };
189
+ export { ADD_PILL_MS, AddCircleGlyph, AddPill };
@@ -1,4 +1,4 @@
1
- import { Select } from './chunk-D5UVJL4I.js';
1
+ import { Select } from './chunk-QZNENGHA.js';
2
2
  import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chunk-LFSIKGRQ.js';
3
3
  import { HueSwatch } from './chunk-NFLSK6T3.js';
4
4
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
@@ -1,4 +1,4 @@
1
- import { AvatarStack } from './chunk-T7Y5FM4B.js';
1
+ import { AvatarStack } from './chunk-X2CFDU5S.js';
2
2
  import { Tag } from './chunk-ASBBB5AJ.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './ChatScale-LGESYXCO.css';
@@ -1,6 +1,6 @@
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-M34LSGMH.js';
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-JMBPMSNI.js';
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';
@@ -8,7 +8,7 @@ import { titleWhenCut } from './chunk-WSIJDWUG.js';
8
8
  import { IconButton } from './chunk-CMEZGORB.js';
9
9
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
10
10
  import { cx } from './chunk-ODEQTPFM.js';
11
- import './DataGrid-K2L4ZOUH.css';
11
+ import './DataGrid-UGOZXHJS.css';
12
12
  import { useId, useRef, useState, useMemo, useCallback, useLayoutEffect, useImperativeHandle, useSyncExternalStore, useEffect, Fragment as Fragment$1 } from 'react';
13
13
  import { breakpoint } from '@crewlethq/tokens';
14
14
  import { GripVerticalGlyph, ChevronRightGlyph } from '@crewlethq/icons/glyphs';
@@ -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}`),
@@ -1,10 +1,10 @@
1
- import { TreeGrid } from './chunk-WDVENT6N.js';
2
- import { OrgLabel } from './chunk-NIM7LEEI.js';
1
+ import { TreeGrid } from './chunk-MD5KDF7W.js';
2
+ import { OrgLabel } from './chunk-BZLQHZKH.js';
3
3
  import { createTreeModel, treeParent } from './chunk-MY374UUD.js';
4
- import { AddPill } from './chunk-5CCM3DDA.js';
4
+ import { AddPill } from './chunk-EHRNLV3D.js';
5
5
  import { IconButton } from './chunk-CMEZGORB.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
7
- import './OrgTable-5NXRECVP.css';
7
+ import './OrgTable-73WNQCH3.css';
8
8
  import { useMemo, useRef, useImperativeHandle, useCallback } from 'react';
9
9
  import { ChevronDownGlyph, ChevronUpGlyph } from '@crewlethq/icons/glyphs';
10
10
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -138,9 +138,16 @@ function OrgTableName({ tone, ...content }) {
138
138
  function OrgTableActions({
139
139
  children,
140
140
  shown = false,
141
+ slots,
141
142
  className
142
143
  }) {
143
- return /* @__PURE__ */ jsx("span", { className: cx("crewlet-org-table__actions", className), "data-shown": shown ? "" : void 0, children });
144
+ if (slots !== void 0 && (!Number.isInteger(slots) || slots < 1)) {
145
+ throw new RangeError(`OrgTableActions slots must be a whole number of at least 1; it was ${slots}`);
146
+ }
147
+ const room = slots === void 0 ? void 0 : {
148
+ "--crewlet-org-table-strip": `calc(var(--size-control-sm) * ${slots} + var(--spacing-1) * ${slots - 1})`
149
+ };
150
+ return /* @__PURE__ */ jsx("span", { className: cx("crewlet-org-table__actions", className), "data-shown": shown ? "" : void 0, style: room, children });
144
151
  }
145
152
  function OrgTableAdd({ onOpen, placement = "end", className, ...pill }) {
146
153
  return /* @__PURE__ */ jsx(
@@ -5,17 +5,23 @@ import { useId } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
7
7
  var METER_STATES = Object.freeze(["ok", "near", "refusing"]);
8
- var DEFAULT_METER_THRESHOLDS = Object.freeze({ near: 0.75 });
8
+ var USAGE_WARN_AT = 0.8;
9
+ var DEFAULT_METER_THRESHOLDS = Object.freeze({ near: USAGE_WARN_AT });
10
+ function usageTone(used) {
11
+ if (used >= 1) return "danger";
12
+ if (used >= USAGE_WARN_AT) return "warning";
13
+ return "success";
14
+ }
9
15
  var STATE_TONES = {
10
- ok: "quantity",
16
+ ok: "success",
11
17
  near: "warning",
12
18
  refusing: "danger"
13
19
  };
14
- function meterStateTone(state) {
20
+ function meterStateTone(state, okTone = "success") {
15
21
  if (!Object.hasOwn(STATE_TONES, state)) {
16
22
  throw new RangeError(`Meter state must be one of ${METER_STATES.join(", ")}; it was ${String(state)}`);
17
23
  }
18
- return STATE_TONES[state];
24
+ return state === "ok" ? okTone : STATE_TONES[state];
19
25
  }
20
26
  function meterState(fraction, thresholds = DEFAULT_METER_THRESHOLDS) {
21
27
  const { near } = thresholds;
@@ -36,12 +42,13 @@ function drawnTone({
36
42
  state,
37
43
  tone,
38
44
  polarity = "spent",
39
- thresholds
45
+ thresholds,
46
+ okTone
40
47
  }, fraction, percent) {
41
- if (state !== void 0) return meterStateTone(state);
48
+ if (state !== void 0) return meterStateTone(state, okTone);
42
49
  if (tone !== void 0) return tone;
43
50
  if (polarity === "progress") return progressTone(percent);
44
- return meterStateTone(meterState(fraction, thresholds));
51
+ return meterStateTone(meterState(fraction, thresholds), okTone);
45
52
  }
46
53
  function Meter({
47
54
  value,
@@ -53,6 +60,7 @@ function Meter({
53
60
  tone,
54
61
  polarity,
55
62
  thresholds,
63
+ okTone,
56
64
  size = "default",
57
65
  hideLabel = false,
58
66
  className,
@@ -62,7 +70,7 @@ function Meter({
62
70
  const bounded = max > 0;
63
71
  const fraction = bounded ? value / max : 0;
64
72
  const percent = bounded ? Math.min(100, Math.max(0, fraction * 100)) : 0;
65
- const drawn = drawnTone({ state, tone, polarity, thresholds }, fraction, percent);
73
+ const drawn = drawnTone({ state, tone, polarity, thresholds, okTone }, fraction, percent);
66
74
  const trailing = hint ?? valueText;
67
75
  const reported = bounded ? Math.min(max, Math.max(0, value)) : value;
68
76
  const spoken = bounded ? valueText ?? (reported === value ? void 0 : `${value} of ${max}`) : void 0;
@@ -90,4 +98,4 @@ function Meter({
90
98
  ] });
91
99
  }
92
100
 
93
- export { DEFAULT_METER_THRESHOLDS, METER_STATES, Meter, meterState, meterStateTone, meterTone, progressTone };
101
+ export { DEFAULT_METER_THRESHOLDS, METER_STATES, Meter, USAGE_WARN_AT, meterState, meterStateTone, meterTone, progressTone, usageTone };
@@ -1,17 +1,16 @@
1
+ import { USAGE_WARN_AT } from './chunk-JEFGH3AQ.js';
1
2
  import { cx } from './chunk-ODEQTPFM.js';
2
- import './LimitMeters-HDEBOATH.css';
3
+ import './LimitMeters-BCQEUJZ3.css';
3
4
  import { jsxs, jsx } from 'react/jsx-runtime';
4
5
 
5
- var STATE_TONES = {
6
- ok: "neutral",
7
- near: "warning",
8
- refusing: "danger"
9
- };
10
- function limitWindowTone(state) {
11
- if (!Object.hasOwn(STATE_TONES, state)) {
6
+ var ESCALATION = { ok: 0, near: 1, refusing: 2 };
7
+ function limitWindowTone(state, used, okTone = "success") {
8
+ if (!Object.hasOwn(ESCALATION, state)) {
12
9
  throw new RangeError(`LimitMeters window state must be ok, near or refusing; it was ${String(state)}`);
13
10
  }
14
- return STATE_TONES[state];
11
+ const byUse = used === void 0 ? "ok" : used >= 1 ? "refusing" : used >= USAGE_WARN_AT ? "near" : "ok";
12
+ const worst = ESCALATION[byUse] > ESCALATION[state] ? byUse : state;
13
+ return worst === "refusing" ? "danger" : worst === "near" ? "warning" : okTone;
15
14
  }
16
15
  function checked(windows) {
17
16
  const seen = /* @__PURE__ */ new Set();
@@ -23,7 +22,15 @@ function checked(windows) {
23
22
  }
24
23
  }
25
24
  }
26
- function LimitMeters({ windows, label, empty = "None reported", caption, className, ...rest }) {
25
+ function LimitMeters({
26
+ windows,
27
+ label,
28
+ empty = "None reported",
29
+ caption,
30
+ okTone = "success",
31
+ className,
32
+ ...rest
33
+ }) {
27
34
  checked(windows);
28
35
  if (windows.length === 0) {
29
36
  return /* @__PURE__ */ jsxs("div", { ...rest, className: cx("crewlet-limit-meters", "crewlet-limit-meters--empty", className), children: [
@@ -43,7 +50,8 @@ function LimitMeters({ windows, label, empty = "None reported", caption, classNa
43
50
  const known = w.used !== void 0;
44
51
  const percent = known ? Math.min(100, Math.round(w.used * 100)) : 0;
45
52
  const figure = w.figure ?? (known ? `${Math.round(w.used * 100)}%` : void 0);
46
- return /* @__PURE__ */ jsxs("div", { className: "crewlet-limit-meters__window", "data-state": w.state, children: [
53
+ const tone = limitWindowTone(w.state, w.used, okTone);
54
+ return /* @__PURE__ */ jsxs("div", { className: "crewlet-limit-meters__window", "data-state": w.state, "data-tone": tone, children: [
47
55
  /* @__PURE__ */ jsx("span", { className: "crewlet-limit-meters__label", "aria-hidden": "true", children: w.label }),
48
56
  /* @__PURE__ */ jsx(
49
57
  "div",
@@ -61,7 +69,7 @@ function LimitMeters({ windows, label, empty = "None reported", caption, classNa
61
69
  "crewlet-limit-meters__fill",
62
70
  known ? percent > 0 && "crewlet-limit-meters__fill--some" : "crewlet-limit-meters__fill--state"
63
71
  ),
64
- "data-tone": limitWindowTone(w.state),
72
+ "data-tone": tone,
65
73
  style: { width: known ? `${percent}%` : "100%" }
66
74
  }
67
75
  )
@@ -1,4 +1,4 @@
1
- import { OrgLabel } from './chunk-NIM7LEEI.js';
1
+ import { OrgLabel } from './chunk-BZLQHZKH.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
3
  import './OrgNode-6OCBAIBK.css';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -1,4 +1,4 @@
1
- import { GridHeadCell } from './chunk-M34LSGMH.js';
1
+ import { GridHeadCell } from './chunk-WU73BKXL.js';
2
2
  import { copyGlyph, CopyStatus } from './chunk-5WJKJGL4.js';
3
3
  import { useClipboard } from './chunk-STJ7QBC3.js';
4
4
  import { StatusDot } from './chunk-QRE6JCHS.js';
@@ -6,7 +6,7 @@ import { Button } from './chunk-NMIXL2YH.js';
6
6
  import { IconButton } from './chunk-CMEZGORB.js';
7
7
  import { returnFocus } from './chunk-4ITETIGZ.js';
8
8
  import { cx } from './chunk-ODEQTPFM.js';
9
- import './DataGrid-K2L4ZOUH.css';
9
+ import './DataGrid-UGOZXHJS.css';
10
10
  import './SettingsTable-IMFNMIJI.css';
11
11
  import { useState, useRef, useLayoutEffect } from 'react';
12
12
  import { RotateCcwGlyph } from '@crewlethq/icons/glyphs';
@@ -1,6 +1,6 @@
1
1
  import { useTreeState, treeExpandable, treeLevel, treePosInSet, treeSetSize, treeItemAction, treePrevious, treeNext, treeStep } from './chunk-MY374UUD.js';
2
- import { fitGridColumns } from './chunk-UBXJBVYV.js';
3
- import { GRID_FOOT_LABELS, parseGridSort, overrunning, squeezedCells, tableTrack, GRID_ICON_TRACK, GridHeadCell, alignOf, rowLinkTitle, headerWord, GridFoot, droppedNames, nextGridSort, sortByValue } from './chunk-M34LSGMH.js';
2
+ import { fitGridColumns } from './chunk-GQL2XQTS.js';
3
+ import { GRID_FOOT_LABELS, parseGridSort, overrunning, squeezedCells, tableTrack, GRID_ICON_TRACK, GridHeadCell, alignOf, rowLinkTitle, headerWord, GridFoot, droppedNames, nextGridSort, sortByValue } from './chunk-WU73BKXL.js';
4
4
  import { LayerNodeBridge } from './chunk-CUEPPDBC.js';
5
5
  import { EmptyState } from './chunk-HG7J6I65.js';
6
6
  import { useMediaMatch } from './chunk-COS6LJ4K.js';
@@ -9,8 +9,8 @@ import { IconButton } from './chunk-CMEZGORB.js';
9
9
  import { LayerHost, LAYER_REPOSITION_EVENT } from './chunk-AVJKMQXK.js';
10
10
  import { focusables } from './chunk-EDPMHSLZ.js';
11
11
  import { cx } from './chunk-ODEQTPFM.js';
12
- import './TreeGrid-XZCH5WCC.css';
13
- import { useRef, useState, useLayoutEffect, useEffect, useMemo, useCallback, useImperativeHandle } from 'react';
12
+ import './TreeGrid-QKEQXK26.css';
13
+ import { useRef, useState, useEffect, useLayoutEffect, useMemo, useCallback, useImperativeHandle } from 'react';
14
14
  import { breakpoint } from '@crewlethq/tokens';
15
15
  import { ChevronRightGlyph } from '@crewlethq/icons/glyphs';
16
16
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -97,6 +97,14 @@ function TreeGrid({
97
97
  }) {
98
98
  const text = { ...LABELS, ...labels };
99
99
  const frame = useRef(null);
100
+ const [pointer, setPointer] = useState(false);
101
+ useEffect(() => {
102
+ if (!pointer) return void 0;
103
+ const key = () => setPointer(false);
104
+ document.addEventListener("keydown", key, true);
105
+ return () => document.removeEventListener("keydown", key, true);
106
+ }, [pointer]);
107
+ const onPointerDownCapture = () => setPointer(true);
100
108
  const gridEl = useRef(null);
101
109
  const [width, setWidth] = useState(0);
102
110
  const reportWidth = useRef(onWidthChange);
@@ -363,16 +371,26 @@ function TreeGrid({
363
371
  className
364
372
  );
365
373
  if (forest.length === 0 && empty) {
366
- return /* @__PURE__ */ jsx("div", { ref: frame, className: frameClass, "data-flush": flush || void 0, children: /* @__PURE__ */ jsx("div", { className: "crewlet-tree-grid__scroller", children: /* @__PURE__ */ jsx(
367
- EmptyState,
374
+ return /* @__PURE__ */ jsx(
375
+ "div",
368
376
  {
369
- size: "compact",
370
- icon: empty.icon,
371
- title: empty.title,
372
- description: empty.hint,
373
- action: empty.action
377
+ ref: frame,
378
+ className: frameClass,
379
+ "data-flush": flush || void 0,
380
+ "data-pointer": pointer || void 0,
381
+ onPointerDownCapture,
382
+ children: /* @__PURE__ */ jsx("div", { className: "crewlet-tree-grid__scroller", children: /* @__PURE__ */ jsx(
383
+ EmptyState,
384
+ {
385
+ size: "compact",
386
+ icon: empty.icon,
387
+ title: empty.title,
388
+ description: empty.hint,
389
+ action: empty.action
390
+ }
391
+ ) })
374
392
  }
375
- ) }) });
393
+ );
376
394
  }
377
395
  return /* @__PURE__ */ jsx(
378
396
  "div",
@@ -382,6 +400,8 @@ function TreeGrid({
382
400
  "data-flush": flush || void 0,
383
401
  "data-stacked": stacked || void 0,
384
402
  "data-phone-rows": stacked && phoneRows === "compact" ? "compact" : void 0,
403
+ "data-pointer": pointer || void 0,
404
+ onPointerDownCapture,
385
405
  children: /* @__PURE__ */ jsxs(LayerHost, { className: "crewlet-tree-grid__layer", children: [
386
406
  /* @__PURE__ */ jsxs("div", { className: "crewlet-tree-grid__scroller", onScroll, children: [
387
407
  /* @__PURE__ */ jsxs(
@@ -455,6 +475,7 @@ function TreeGrid({
455
475
  "aria-colindex": col,
456
476
  tabIndex: stop(id, col) && !hasControl(id, col, drawn[col - 1]?.key ?? "") ? 0 : -1,
457
477
  "data-size": one?.size === "sm" ? "sm" : void 0,
478
+ "data-align": one?.align,
458
479
  "data-label": one && !one.action && col > 1 ? headerWord(one) || one.label || void 0 : void 0,
459
480
  className: cx(
460
481
  "crewlet-tree-grid__cell",