@crewlethq/ui 0.98.0 → 0.100.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 (55) hide show
  1. package/dist/AddPill/index.js +1 -1
  2. package/dist/ArtifactBar/index.js +1 -1
  3. package/dist/ChatThread/ChatThread.d.ts +22 -8
  4. package/dist/ChatThread/index.js +1 -1
  5. package/dist/{ChatThread-HAECJMP6.css → ChatThread-XANOIJXN.css} +2 -1
  6. package/dist/DataGrid/index.js +2 -1
  7. package/dist/DeepWorkCard/index.js +2 -2
  8. package/dist/MarkdownEditor/index.js +1 -1
  9. package/dist/MergeConflicts/index.js +1 -1
  10. package/dist/OrgLabel/OrgLabel.d.ts +6 -0
  11. package/dist/OrgLabel/index.js +1 -1
  12. package/dist/{OrgLabel-6UGWHDQQ.css → OrgLabel-7UJKEDT3.css} +23 -0
  13. package/dist/OrgNode/index.js +2 -2
  14. package/dist/OrgTable/OrgTable.d.ts +2 -2
  15. package/dist/OrgTable/index.js +5 -4
  16. package/dist/{OrgTable-GBRYKTDH.css → OrgTable-3DXA23ZA.css} +28 -23
  17. package/dist/RailList/index.js +2 -2
  18. package/dist/RunChip/index.js +2 -2
  19. package/dist/SegmentedControl/index.js +1 -1
  20. package/dist/{SegmentedControl-PWTB7KEE.css → SegmentedControl-MHZMS2JJ.css} +4 -1
  21. package/dist/SelectionBar/SelectionBar.d.ts +6 -1
  22. package/dist/SelectionBar/index.js +1 -1
  23. package/dist/{SelectionBar-SCAU6EBY.css → SelectionBar-54W5IFF5.css} +9 -0
  24. package/dist/SetupWizard/index.js +2 -2
  25. package/dist/StatusLegend/index.js +1 -1
  26. package/dist/{StatusLegend-7MS2SBVC.css → StatusLegend-HVMKJQFY.css} +3 -1
  27. package/dist/Stepper/index.js +1 -1
  28. package/dist/{Stepper-YQBNYCIS.css → Stepper-S4RC4OZ3.css} +20 -2
  29. package/dist/ThemeSwitcher/index.js +1 -1
  30. package/dist/TimeRangePicker/index.js +1 -1
  31. package/dist/TreeGrid/TreeGrid.d.ts +15 -7
  32. package/dist/TreeGrid/index.js +2 -1
  33. package/dist/{TreeGrid-PZ3DFVRO.css → TreeGrid-H3GHMKZX.css} +74 -33
  34. package/dist/VersionCompare/index.js +1 -1
  35. package/dist/{chunk-JQCKRABK.js → chunk-2WQEHXXB.js} +1 -1
  36. package/dist/{chunk-RPCIU4S5.js → chunk-3NCIQO2P.js} +97 -19
  37. package/dist/{chunk-6FS6W3P5.js → chunk-3QKJV3KE.js} +1 -1
  38. package/dist/{chunk-4XYKBZJE.js → chunk-44GFQ4O3.js} +24 -14
  39. package/dist/chunk-CTQZK5J3.js +8 -0
  40. package/dist/{chunk-SSN7Y3UY.js → chunk-DVRECWCB.js} +1 -1
  41. package/dist/{chunk-ROFAWLFS.js → chunk-ERESJG6C.js} +4 -3
  42. package/dist/{chunk-4FNAPCCK.js → chunk-KN4YCWWO.js} +1 -1
  43. package/dist/{chunk-KUMHQY2B.js → chunk-LIDKF3LL.js} +1 -1
  44. package/dist/{chunk-IX6CHGM4.js → chunk-MFZBLJYF.js} +1 -1
  45. package/dist/{chunk-3QBQY2XK.js → chunk-QIVLL5HB.js} +27 -20
  46. package/dist/{chunk-MYFSVZKZ.js → chunk-SJP7WYIV.js} +1 -1
  47. package/dist/{chunk-WSR4OB4T.js → chunk-XOVSHJTZ.js} +1 -1
  48. package/dist/{chunk-AHPMAPVN.js → chunk-Z346ESBB.js} +2 -5
  49. package/dist/{chunk-Z6E3WOWS.js → chunk-ZPNFWORS.js} +4 -4
  50. package/dist/generated/index.js +42 -41
  51. package/dist/index.js +42 -41
  52. package/dist/styles.css +171 -69
  53. package/dist/utils/tableTrack.d.ts +21 -0
  54. package/package.json +3 -3
  55. package/dist/{chunk-NKNG6YER.js → chunk-G44KKOMB.js} +1 -1
@@ -1,14 +1,16 @@
1
1
  /*
2
- * A hierarchy as rows and columns (TreeGrid.tsx).
3
- *
4
- * Each row is a grid on ONE column template, so the cells of every row line up
5
- * without a table: a table row cannot be a focusable treegrid row with a
6
- * level. The grid keeps a minimum width and scrolls sideways in its own box
7
- * below that, so a phone width screen keeps every column readable and the page
8
- * itself never scrolls sideways.
2
+ * A hierarchy as rows and columns (TreeGrid.tsx), on `DataGrid`'s table rules: one
3
+ * track list on the grid, which the head, body and rows pass through as `subgrid`.
4
+ * Below its minimum width it scrolls sideways in its own box, never the page's.
9
5
  */
10
6
 
11
7
  .crewlet-tree-grid {
8
+ /* The inset between two columns, and the inset at the grid's two outer edges,
9
+ as `--crewlet-data-grid-edge`: the cells' own step standing alone, the card's
10
+ own in a flush card. */
11
+ --crewlet-tree-grid-inset: var(--spacing-3);
12
+ --crewlet-tree-grid-edge: var(--spacing-3);
13
+
12
14
  position: relative;
13
15
  }
14
16
 
@@ -43,15 +45,25 @@
43
45
  * menus open in, which must not be clipped.
44
46
  */
45
47
  background: var(--color-surface-subtle);
46
- border: 1px solid var(--color-border-default);
47
- border-radius: var(--radius-lg);
48
+ border: 1px solid var(--color-border-hover);
49
+ border-radius: var(--radius-md);
48
50
  }
49
51
 
50
52
  .crewlet-tree-grid__grid {
53
+ display: grid;
54
+ grid-template-columns: var(--crewlet-tree-grid-columns, minmax(0, 1fr));
51
55
  min-width: var(--crewlet-tree-grid-min-width, 45rem);
52
56
  font-size: var(--font-size-compact);
53
57
  }
54
58
 
59
+ .crewlet-tree-grid__head,
60
+ .crewlet-tree-grid__body,
61
+ .crewlet-tree-grid__row {
62
+ display: grid;
63
+ grid-template-columns: subgrid;
64
+ grid-column: 1 / -1;
65
+ }
66
+
55
67
  /* A CONTAINER-WIDTH GRID never scrolls sideways: it leaves out the columns its
56
68
  width cannot hold, so its header can hold at the top of the page's scroll. */
57
69
  .crewlet-tree-grid--container .crewlet-tree-grid__scroller {
@@ -66,17 +78,21 @@
66
78
  position: sticky;
67
79
  top: 0;
68
80
  z-index: var(--z-index-sticky);
69
- background: var(--color-surface-subtle);
70
- border-start-start-radius: calc(var(--radius-lg) - 1px);
71
- border-start-end-radius: calc(var(--radius-lg) - 1px);
81
+ border-start-start-radius: calc(var(--radius-md) - 1px);
82
+ border-start-end-radius: calc(var(--radius-md) - 1px);
72
83
  }
73
84
 
74
85
  /*
75
86
  * INSIDE A FLUSH CARD THE CARD IS THE FRAME. A flush card exists so that a
76
87
  * table's rows reach its edges (Card.css), and a grid that drew its own border
77
88
  * and corner there was a second rounded box one pixel inside the first, with
78
- * the card's footer hanging outside it. The rows keep their own hairlines.
89
+ * the card's footer hanging outside it. The rows keep their own hairlines, and
90
+ * the outer cells take the card's inset.
79
91
  */
92
+ .crewlet-card--flush .crewlet-tree-grid {
93
+ --crewlet-tree-grid-edge: var(--spacing-4);
94
+ }
95
+
80
96
  .crewlet-card--flush .crewlet-tree-grid__scroller {
81
97
  background: none;
82
98
  border: none;
@@ -84,22 +100,29 @@
84
100
  }
85
101
 
86
102
  .crewlet-tree-grid__row {
87
- display: grid;
88
- grid-template-columns: var(--crewlet-tree-grid-columns, minmax(0, 1fr));
89
103
  align-items: center;
90
104
  min-height: var(--size-row-md);
91
- border-top: 1px solid var(--color-border-default);
105
+ border-bottom: 1px solid var(--color-border-default);
106
+ }
107
+
108
+ .crewlet-tree-grid__body > .crewlet-tree-grid__row:last-child {
109
+ border-bottom: 0;
110
+ }
111
+
112
+ .crewlet-tree-grid__body > .crewlet-tree-grid__row:hover {
113
+ background: var(--color-surface-hover);
92
114
  }
93
115
 
94
116
  /*
95
- * THE HEAD IS THE TABLE'S HEADER REGISTER, in full. It spelled three of the
96
- * register's five declarations and left the tracking and the case off, so a
97
- * treegrid and a table standing on the same screen named their columns two
98
- * different ways. It is one micro-label step, declared once, wherever a column
99
- * is named.
117
+ * THE HEAD IS THE TABLE'S HEADER REGISTER, in full, on the raised ground under
118
+ * the stronger hairline `DataGrid` draws its head on. It is one micro-label
119
+ * step, declared once, wherever a column is named.
100
120
  */
101
121
  .crewlet-tree-grid__head .crewlet-tree-grid__row {
102
- border-top: 0;
122
+ background: var(--color-surface-elevated);
123
+ border-bottom: 1px solid var(--color-border-hover);
124
+ border-start-start-radius: inherit;
125
+ border-start-end-radius: inherit;
103
126
  font-size: var(--font-size-2xs);
104
127
  font-weight: var(--font-weight-medium);
105
128
  letter-spacing: var(--font-letter-spacing-wide);
@@ -107,13 +130,37 @@
107
130
  color: var(--color-text-tertiary);
108
131
  }
109
132
 
133
+ /*
134
+ * A heading and its cells share one inline inset, so they start on one line. A cell
135
+ * is the row's full height and centres what it holds, so a value that changes never
136
+ * moves its box, and a focused cell's ring is the row's.
137
+ */
110
138
  .crewlet-tree-grid__row > [role='columnheader'],
111
139
  .crewlet-tree-grid__cell {
140
+ --crewlet-tree-grid-cell-start: var(--crewlet-tree-grid-inset);
141
+ --crewlet-tree-grid-cell-end: var(--crewlet-tree-grid-inset);
142
+
112
143
  display: flex;
144
+ align-self: stretch;
113
145
  align-items: center;
114
146
  gap: var(--spacing-2);
115
147
  min-width: 0;
116
- padding: 0 var(--spacing-2);
148
+ padding-block: var(--spacing-1);
149
+ padding-inline: var(--crewlet-tree-grid-cell-start) var(--crewlet-tree-grid-cell-end);
150
+ }
151
+
152
+ .crewlet-tree-grid__row > [role='columnheader'] {
153
+ padding-block: var(--spacing-2);
154
+ }
155
+
156
+ .crewlet-tree-grid__row > [role='columnheader']:first-child,
157
+ .crewlet-tree-grid__cell:first-child {
158
+ --crewlet-tree-grid-cell-start: var(--crewlet-tree-grid-edge);
159
+ }
160
+
161
+ .crewlet-tree-grid__row > [role='columnheader']:last-child,
162
+ .crewlet-tree-grid__cell:last-child {
163
+ --crewlet-tree-grid-cell-end: var(--crewlet-tree-grid-edge);
117
164
  }
118
165
 
119
166
  /* A COLUMN OF VALUES READ AFTER THE NAME takes the caption's size, a step under the name's. */
@@ -124,11 +171,11 @@
124
171
  /*
125
172
  * The indent is the row's own level, set on the row, ON TOP OF the inset every
126
173
  * cell has. Replacing that inset left a top-level row's chevron flush against
127
- * the frame, its hover ground touching the edge, and the column starting 8px
128
- * further out than its own heading and every other column.
174
+ * the frame, its hover ground touching the edge, and the column starting further
175
+ * out than its own heading and every other column.
129
176
  */
130
177
  .crewlet-tree-grid__cell:first-child {
131
- padding-inline-start: calc(var(--spacing-2) + var(--spacing-5) * var(--crewlet-tree-grid-depth, 0));
178
+ padding-inline-start: calc(var(--crewlet-tree-grid-edge) + var(--spacing-5) * var(--crewlet-tree-grid-depth, 0));
132
179
  }
133
180
 
134
181
  /*
@@ -192,9 +239,7 @@
192
239
 
193
240
  /*
194
241
  * A HEADLESS GRID keeps its header row for a screen reader and draws no band:
195
- * the row is taken out of the layout the way VisuallyHidden takes text out,
196
- * and the first row of the body loses the hairline that would otherwise sit
197
- * under the frame's own edge as a second line.
242
+ * the row is taken out of the layout the way VisuallyHidden takes text out.
198
243
  */
199
244
  .crewlet-tree-grid--headless .crewlet-tree-grid__head {
200
245
  position: absolute;
@@ -205,10 +250,6 @@
205
250
  white-space: nowrap;
206
251
  }
207
252
 
208
- .crewlet-tree-grid--headless .crewlet-tree-grid__head + [role='rowgroup'] > .crewlet-tree-grid__row:first-child {
209
- border-top: 0;
210
- }
211
-
212
253
  /* The selection is where the reader is, so it takes the accent. */
213
254
  .crewlet-tree-grid__row[aria-selected='true'] {
214
255
  box-shadow: inset 2px 0 0 var(--color-brand-accent);
@@ -1,6 +1,6 @@
1
1
  export { VERSION_COMPARE_LABELS, VERSION_COMPARE_LENSES, VersionCompare } from '../chunk-QND44ROZ.js';
2
2
  import '../chunk-AOFVXE6V.js';
3
- import '../chunk-WSR4OB4T.js';
3
+ import '../chunk-XOVSHJTZ.js';
4
4
  import '../chunk-FP6OFRAU.js';
5
5
  import '../chunk-IYJCJOHW.js';
6
6
  import '../chunk-EGMQURBR.js';
@@ -1,4 +1,4 @@
1
- import { OrgLabel } from './chunk-4XYKBZJE.js';
1
+ import { OrgLabel } from './chunk-44GFQ4O3.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
3
  import './OrgNode-6OCBAIBK.css';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -2,7 +2,7 @@ import { useMediaMatch, REDUCED_MOTION_QUERY } from './chunk-YJQXESOJ.js';
2
2
  import { Button } from './chunk-6KUOHUY5.js';
3
3
  import { VisuallyHidden } from './chunk-UT6CW3C7.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
- import './ChatThread-HAECJMP6.css';
5
+ import './ChatThread-XANOIJXN.css';
6
6
  import { forwardRef, useRef, Children, useState, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
7
7
  import { ArrowDownGlyph } from '@crewlethq/icons/glyphs';
8
8
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -12,7 +12,18 @@ var CHAT_THREAD_LABELS = {
12
12
  jumpToLatest: "Jump to latest",
13
13
  newItems: (count) => count === 1 ? "1 new item" : `${count.toLocaleString()} new items`
14
14
  };
15
- var ChatThread = forwardRef(function ChatThread2({ label, busy = false, follow = true, jump = true, rest: restAt = "start", children, labels: overrides, className, ...rest }, ref) {
15
+ var ChatThread = forwardRef(function ChatThread2({
16
+ label,
17
+ busy = false,
18
+ follow = true,
19
+ onFollowChange,
20
+ jump = true,
21
+ rest: restAt = "start",
22
+ children,
23
+ labels: overrides,
24
+ className,
25
+ ...rest
26
+ }, ref) {
16
27
  const labels = overrides ? { ...CHAT_THREAD_LABELS, ...overrides } : CHAT_THREAD_LABELS;
17
28
  const scroller = useRef(null);
18
29
  const items = useRef(null);
@@ -20,12 +31,25 @@ var ChatThread = forwardRef(function ChatThread2({ label, busy = false, follow =
20
31
  const count = Children.toArray(children).length;
21
32
  const atEnd = useRef(true);
22
33
  const jumping = useRef(false);
34
+ const jumpedFor = useRef(0);
35
+ const last = useRef(0);
36
+ const anchor = useRef(null);
37
+ const followChange = useRef(onFollowChange);
38
+ followChange.current = onFollowChange;
23
39
  const [detachedAt, setDetachedAt] = useState(null);
24
40
  const countRef = useRef(count);
25
41
  countRef.current = count;
26
42
  const rowShown = useRef(false);
27
43
  rowShown.current = jump && detachedAt !== null;
28
44
  const revealing = useRef(null);
45
+ const settle = useCallback((el) => {
46
+ last.current = el.scrollTop;
47
+ }, []);
48
+ const setFollowing = useCallback((following) => {
49
+ if (atEnd.current === following) return;
50
+ atEnd.current = following;
51
+ followChange.current?.(following);
52
+ }, []);
29
53
  const toEnd = useCallback(
30
54
  (smooth) => {
31
55
  const el = scroller.current;
@@ -33,27 +57,53 @@ var ChatThread = forwardRef(function ChatThread2({ label, busy = false, follow =
33
57
  const top = el.scrollHeight - el.clientHeight;
34
58
  if (smooth && !reduced && typeof el.scrollTo === "function") {
35
59
  jumping.current = true;
60
+ jumpedFor.current = el.scrollHeight;
36
61
  el.scrollTo({ top, behavior: "smooth" });
37
62
  } else {
38
63
  jumping.current = false;
39
64
  el.scrollTop = top;
40
65
  }
41
- atEnd.current = true;
66
+ settle(el);
67
+ anchor.current = null;
68
+ setFollowing(true);
42
69
  setDetachedAt(null);
43
70
  },
44
- [reduced]
71
+ [reduced, settle, setFollowing]
45
72
  );
46
73
  const onScroll = useCallback(() => {
47
74
  const el = scroller.current;
48
75
  if (!el) return;
49
- const end = el.scrollHeight - el.scrollTop - el.clientHeight <= CHAT_THREAD_FOLLOW_WITHIN;
76
+ const was = last.current;
77
+ settle(el);
78
+ const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
50
79
  if (jumping.current) {
51
- if (end) jumping.current = false;
80
+ if (distance <= CHAT_THREAD_FOLLOW_WITHIN) jumping.current = false;
52
81
  return;
53
82
  }
54
- atEnd.current = end;
55
- setDetachedAt((prior) => end ? null : prior ?? countRef.current);
56
- }, []);
83
+ const moved = el.scrollTop - was;
84
+ let following = atEnd.current;
85
+ if (distance < 1) following = true;
86
+ else if (moved < 0) following = false;
87
+ else if (moved > 0) following = distance <= CHAT_THREAD_FOLLOW_WITHIN;
88
+ setFollowing(following);
89
+ anchor.current = following ? null : anchorIn(el, items.current);
90
+ setDetachedAt((prior) => following ? null : prior ?? countRef.current);
91
+ }, [settle, setFollowing]);
92
+ const hold = useCallback(() => {
93
+ const el = scroller.current;
94
+ const mark = anchor.current;
95
+ if (!el || !mark || atEnd.current || jumping.current) return;
96
+ if (!mark.element.isConnected) {
97
+ anchor.current = anchorIn(el, items.current);
98
+ return;
99
+ }
100
+ const at = depthIn(el, mark.element);
101
+ const delta = at - mark.at;
102
+ if (Math.abs(delta) < 0.5) return;
103
+ mark.at = at;
104
+ el.scrollTop += delta;
105
+ settle(el);
106
+ }, [settle]);
57
107
  useEffect(() => {
58
108
  const el = scroller.current;
59
109
  if (!el) return;
@@ -71,18 +121,22 @@ var ChatThread = forwardRef(function ChatThread2({ label, busy = false, follow =
71
121
  for (const intent of intents) el.removeEventListener(intent, interrupt);
72
122
  };
73
123
  }, [toEnd]);
74
- useLayoutEffect(() => {
75
- if (follow && atEnd.current) toEnd(false);
76
- }, [children, follow, toEnd]);
124
+ const keep = useCallback(() => {
125
+ const el = scroller.current;
126
+ if (!el) return;
127
+ if (!atEnd.current) hold();
128
+ else if (follow && !(jumping.current && el.scrollHeight === jumpedFor.current)) toEnd(false);
129
+ }, [follow, hold, toEnd]);
130
+ useLayoutEffect(keep);
77
131
  useEffect(() => {
78
- const el = items.current;
79
- if (!follow || !el || typeof ResizeObserver !== "function") return;
80
- const observer = new ResizeObserver(() => {
81
- if (atEnd.current) toEnd(false);
82
- });
83
- observer.observe(el);
132
+ const view = scroller.current;
133
+ const content = items.current;
134
+ if (!view || !content || typeof ResizeObserver !== "function") return;
135
+ const observer = new ResizeObserver(keep);
136
+ observer.observe(content);
137
+ observer.observe(view);
84
138
  return () => observer.disconnect();
85
- }, [follow, toEnd]);
139
+ }, [keep]);
86
140
  const place = useCallback(
87
141
  (element) => {
88
142
  const el = scroller.current;
@@ -144,5 +198,29 @@ var ChatThread = forwardRef(function ChatThread2({ label, busy = false, follow =
144
198
  ] }) })
145
199
  ] });
146
200
  });
201
+ function depthIn(view, element) {
202
+ return element.getBoundingClientRect().top - view.getBoundingClientRect().top + view.scrollTop;
203
+ }
204
+ function anchorIn(view, content) {
205
+ const top = view.getBoundingClientRect().top;
206
+ let found = null;
207
+ let parent = content;
208
+ for (let depth = 0; parent && depth < ANCHOR_DEPTH; depth++) {
209
+ let next = null;
210
+ for (const child of Array.from(parent.children)) {
211
+ const box = child.getBoundingClientRect();
212
+ if (box.height === 0 || box.bottom <= top) continue;
213
+ const position = getComputedStyle(child).position;
214
+ if (position === "sticky" || position === "fixed" || position === "absolute") continue;
215
+ next = child;
216
+ break;
217
+ }
218
+ if (!next) break;
219
+ found = next;
220
+ parent = next.getBoundingClientRect().top < top ? next : null;
221
+ }
222
+ return found ? { element: found, at: depthIn(view, found) } : null;
223
+ }
224
+ var ANCHOR_DEPTH = 4;
147
225
 
148
226
  export { CHAT_THREAD_FOLLOW_WITHIN, CHAT_THREAD_LABELS, ChatThread };
@@ -1,7 +1,7 @@
1
1
  import { StatusDot } from './chunk-QRE6JCHS.js';
2
2
  import { VisuallyHidden } from './chunk-UT6CW3C7.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
- import './StatusLegend-7MS2SBVC.css';
4
+ import './StatusLegend-HVMKJQFY.css';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
 
7
7
  function StatusLegend({ label, items, value = null, onValueChange, countLabel = String, className }) {
@@ -1,11 +1,11 @@
1
1
  import { Avatar } from './chunk-XZY6S3UC.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
- import './OrgLabel-6UGWHDQQ.css';
4
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import './OrgLabel-7UJKEDT3.css';
4
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
 
6
6
  function OrgLabel(props) {
7
7
  const { layout = "node", className } = props;
8
- const zone = props.avatar === void 0 ? /* @__PURE__ */ jsx(
8
+ const zone = props.avatar === void 0 ? /* @__PURE__ */ jsxs(
9
9
  "span",
10
10
  {
11
11
  className: cx(
@@ -14,18 +14,24 @@ function OrgLabel(props) {
14
14
  props.iconRing === true && "crewlet-org-label__icon--ring"
15
15
  ),
16
16
  "aria-hidden": "true",
17
- children: props.logo ? /* @__PURE__ */ jsx("img", { className: "crewlet-org-label__logo", src: props.logo.src, alt: props.logo.alt, draggable: false }) : props.icon
17
+ children: [
18
+ props.logo ? /* @__PURE__ */ jsx("img", { className: "crewlet-org-label__logo", src: props.logo.src, alt: props.logo.alt, draggable: false }) : props.icon,
19
+ /* @__PURE__ */ jsx(MarkStatus, { markStatus: props.markStatus })
20
+ ]
18
21
  }
19
- ) : /* @__PURE__ */ jsx("span", { className: "crewlet-org-label__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
20
- Avatar,
21
- {
22
- name: props.avatar.name,
23
- kind: props.avatar.kind,
24
- src: props.avatar.src,
25
- size: layout === "row" ? "xs" : "sm",
26
- decorative: true
27
- }
28
- ) });
22
+ ) : /* @__PURE__ */ jsxs("span", { className: "crewlet-org-label__icon", "aria-hidden": "true", children: [
23
+ /* @__PURE__ */ jsx(
24
+ Avatar,
25
+ {
26
+ name: props.avatar.name,
27
+ kind: props.avatar.kind,
28
+ src: props.avatar.src,
29
+ size: layout === "row" ? "xs" : "sm",
30
+ decorative: true
31
+ }
32
+ ),
33
+ /* @__PURE__ */ jsx(MarkStatus, { markStatus: props.markStatus })
34
+ ] });
29
35
  if (layout === "row") {
30
36
  return /* @__PURE__ */ jsxs("span", { className: cx("crewlet-org-label", "crewlet-org-label--row", className), "data-tone": props.tone, children: [
31
37
  zone,
@@ -58,6 +64,10 @@ function Words({
58
64
  ] })
59
65
  ] });
60
66
  }
67
+ function MarkStatus({ markStatus }) {
68
+ if (markStatus === void 0 || markStatus === null || markStatus === false) return null;
69
+ return /* @__PURE__ */ jsx("span", { className: "crewlet-org-label__status", children: markStatus });
70
+ }
61
71
  function Slot({ trailing }) {
62
72
  if (trailing === void 0) return null;
63
73
  return /* @__PURE__ */ jsx("span", { className: "crewlet-org-label__trailing", children: trailing });
@@ -0,0 +1,8 @@
1
+ // src/utils/tableTrack.ts
2
+ var SHRINK_SHARE = 0.2;
3
+ function tableTrack({ width, shrink, floor }) {
4
+ if (width) return width;
5
+ return shrink ? `fit-content(${SHRINK_SHARE * 100}%)` : `minmax(${floor ?? 0}, 1fr)`;
6
+ }
7
+
8
+ export { SHRINK_SHARE, tableTrack };
@@ -74,6 +74,7 @@ function AddPill({
74
74
  "data-layout": layout,
75
75
  ref: group,
76
76
  onBlur,
77
+ onMouseEnter: () => setPhase((was) => was === "locked" ? was : "preview"),
77
78
  onMouseLeave: () => {
78
79
  if (phase === "preview") close(false);
79
80
  },
@@ -89,7 +90,6 @@ function AddPill({
89
90
  tabIndex,
90
91
  ref: mark,
91
92
  onKeyDown,
92
- onMouseEnter: () => setPhase((was) => was === "locked" ? was : "preview"),
93
93
  onClick: press,
94
94
  children: [
95
95
  /* @__PURE__ */ jsx("span", { className: "crewlet-add-pill__disc", "aria-hidden": "true" }),
@@ -1,11 +1,12 @@
1
1
  import { useTreeState, treeExpandable, treeLevel, treePosInSet, treeSetSize, treeItemAction, treePrevious, treeNext, treeStep } from './chunk-MY374UUD.js';
2
+ import { tableTrack } from './chunk-CTQZK5J3.js';
2
3
  import { LayerNodeBridge } from './chunk-X4HBZSXA.js';
3
4
  import { IconButton } from './chunk-WDLAAZFZ.js';
4
5
  import { LayerHost, LAYER_REPOSITION_EVENT } from './chunk-FIX72ZEC.js';
5
6
  import { focusables } from './chunk-TUEM2XIW.js';
6
7
  import { VisuallyHidden } from './chunk-UT6CW3C7.js';
7
8
  import { cx } from './chunk-ODEQTPFM.js';
8
- import './TreeGrid-PZ3DFVRO.css';
9
+ import './TreeGrid-H3GHMKZX.css';
9
10
  import { useRef, useState, useLayoutEffect, useEffect, useMemo, useCallback, useImperativeHandle } from 'react';
10
11
  import { ChevronRightGlyph } from '@crewlethq/icons/glyphs';
11
12
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -237,7 +238,7 @@ function TreeGrid({
237
238
  columnKey: (col) => drawn[col - 1]?.key,
238
239
  shown: (key) => drawn.some((one) => one.key === key)
239
240
  };
240
- const template = drawn.map((one) => one.width ?? "minmax(0, 1fr)").join(" ");
241
+ const template = drawn.map(tableTrack).join(" ");
241
242
  return /* @__PURE__ */ jsx(
242
243
  "div",
243
244
  {
@@ -261,7 +262,7 @@ function TreeGrid({
261
262
  onKeyDownCapture,
262
263
  children: [
263
264
  /* @__PURE__ */ jsx("div", { role: "rowgroup", className: "crewlet-tree-grid__head", children: /* @__PURE__ */ jsx("div", { role: "row", className: "crewlet-tree-grid__row", children: drawn.map((one, index) => /* @__PURE__ */ jsx("div", { role: "columnheader", "aria-colindex": index + 1, children: one.headerHidden ? /* @__PURE__ */ jsx(VisuallyHidden, { children: one.header }) : one.header }, one.key)) }) }),
264
- /* @__PURE__ */ jsx("div", { role: "rowgroup", children: rows.map((id) => {
265
+ /* @__PURE__ */ jsx("div", { role: "rowgroup", className: "crewlet-tree-grid__body", children: rows.map((id) => {
265
266
  const add = isAddRow(id);
266
267
  const cells = add ? add.cells : drawn.length;
267
268
  const expandable = treeExpandable(model, id);
@@ -1,4 +1,4 @@
1
- import { StepList } from './chunk-KUMHQY2B.js';
1
+ import { StepList } from './chunk-LIDKF3LL.js';
2
2
  import { ReceiptStrip } from './chunk-YS4PWTNL.js';
3
3
  import { Meter } from './chunk-RQFRRPV6.js';
4
4
  import { StatusCard } from './chunk-4BEMS6Q7.js';
@@ -2,7 +2,7 @@ import { StatusDot } from './chunk-QRE6JCHS.js';
2
2
  import { Spinner } from './chunk-XSPCITPN.js';
3
3
  import { VisuallyHidden } from './chunk-UT6CW3C7.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
- import './Stepper-YQBNYCIS.css';
5
+ import './Stepper-S4RC4OZ3.css';
6
6
  import './StepList-OAJ45IBX.css';
7
7
  import { CircleCheckGlyph, CircleAlertGlyph, LockGlyph, CircleStopGlyph, CircleDashedGlyph, ClockGlyph, CheckGlyph, TriangleAlertGlyph } from '@crewlethq/icons/glyphs';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1,4 +1,4 @@
1
- import { Stepper } from './chunk-KUMHQY2B.js';
1
+ import { Stepper } from './chunk-LIDKF3LL.js';
2
2
  import { PageHeader } from './chunk-FPDIHEM4.js';
3
3
  import { useMediaMatch } from './chunk-YJQXESOJ.js';
4
4
  import { Disclosure } from './chunk-NAHA62WD.js';
@@ -3,7 +3,7 @@ import { Button } from './chunk-6KUOHUY5.js';
3
3
  import { returnFocus } from './chunk-4ITETIGZ.js';
4
4
  import { announce } from './chunk-2G355KDJ.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
- import './SelectionBar-SCAU6EBY.css';
6
+ import './SelectionBar-54W5IFF5.css';
7
7
  import { useRef, useEffect } from 'react';
8
8
  import { XGlyph } from '@crewlethq/icons/glyphs';
9
9
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -14,7 +14,7 @@ var LABELS = {
14
14
  clear: "Clear",
15
15
  label: "Selection"
16
16
  };
17
- function SelectionBar({ count, onClear, children, returnFocusRef, className, labels }) {
17
+ function SelectionBar({ count, onClear, children, returnFocusRef, size = "md", className, labels }) {
18
18
  const text = { ...LABELS, ...labels };
19
19
  const said = useRef(0);
20
20
  const countWords = text.count(count);
@@ -27,24 +27,31 @@ function SelectionBar({ count, onClear, children, returnFocusRef, className, lab
27
27
  else if (before > 0) announce(clearedWords);
28
28
  }, [count, countWords, clearedWords]);
29
29
  if (count <= 0) return null;
30
- return /* @__PURE__ */ jsxs(Toolbar, { label: text.label, className: cx("crewlet-selection-bar", className), children: [
31
- /* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__count", children: countWords }),
32
- children ? /* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__actions", children }) : null,
33
- /* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__spacer", "aria-hidden": "true" }),
34
- /* @__PURE__ */ jsx(
35
- Button,
36
- {
37
- variant: "ghost",
38
- size: "small",
39
- leadingIcon: /* @__PURE__ */ jsx(XGlyph, { size: "sm" }),
40
- onClick: () => {
41
- onClear();
42
- returnFocus(returnFocusRef?.current);
43
- },
44
- children: text.clear
45
- }
46
- )
47
- ] });
30
+ return /* @__PURE__ */ jsxs(
31
+ Toolbar,
32
+ {
33
+ label: text.label,
34
+ className: cx("crewlet-selection-bar", size === "compact" && "crewlet-selection-bar--compact", className),
35
+ children: [
36
+ /* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__count", children: countWords }),
37
+ children ? /* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__actions", children }) : null,
38
+ /* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__spacer", "aria-hidden": "true" }),
39
+ /* @__PURE__ */ jsx(
40
+ Button,
41
+ {
42
+ variant: "ghost",
43
+ size: "small",
44
+ leadingIcon: /* @__PURE__ */ jsx(XGlyph, { size: "sm" }),
45
+ onClick: () => {
46
+ onClear();
47
+ returnFocus(returnFocusRef?.current);
48
+ },
49
+ children: text.clear
50
+ }
51
+ )
52
+ ]
53
+ }
54
+ );
48
55
  }
49
56
 
50
57
  export { SelectionBar };
@@ -1,4 +1,4 @@
1
- import { StepStateMark } from './chunk-KUMHQY2B.js';
1
+ import { StepStateMark } from './chunk-LIDKF3LL.js';
2
2
  import { DisclosureAnatomy } from './chunk-ULYHDP7U.js';
3
3
  import { VisuallyHidden } from './chunk-UT6CW3C7.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,3 +1,3 @@
1
1
  import './HitArea-QUOS6ZDJ.css';
2
2
  import './Tabs-M2ELSU3V.css';
3
- import './SegmentedControl-PWTB7KEE.css';
3
+ import './SegmentedControl-MHZMS2JJ.css';
@@ -1,3 +1,4 @@
1
+ import { tableTrack, SHRINK_SHARE } from './chunk-CTQZK5J3.js';
1
2
  import { Checkbox } from './chunk-M6G7XLLP.js';
2
3
  import { useMediaMatch } from './chunk-YJQXESOJ.js';
3
4
  import { EmptyState } from './chunk-PPUR46MK.js';
@@ -86,8 +87,6 @@ function compare(a, b) {
86
87
  }
87
88
  return String(a).localeCompare(String(b), void 0, { numeric: true, sensitivity: "base" });
88
89
  }
89
- var SHRINK_CAP = "20%";
90
- var SHRINK_SHARE = 0.2;
91
90
  var SQUEEZE_SAMPLE_ROWS = 12;
92
91
  var NO_DROPS = [];
93
92
  var NO_FIT = { set: "", width: 0, dropped: NO_DROPS };
@@ -361,9 +360,7 @@ function DataGrid({
361
360
  if (!column.sortValue || !onSortChange) return;
362
361
  onSortChange(nextGridSort(column.key, sortRaw, defaultSort));
363
362
  }
364
- const template = drawnColumns.map(
365
- (c) => c.width ?? (c.icon ? DATA_GRID_ICON_TRACK : c.shrink ? `fit-content(${SHRINK_CAP})` : `minmax(${c.floor ?? 0}, 1fr)`)
366
- ).join(" ");
363
+ const template = drawnColumns.map((c) => tableTrack({ ...c, width: c.width ?? (c.icon ? DATA_GRID_ICON_TRACK : void 0) })).join(" ");
367
364
  if (flat.length === 0 && !bands?.length && empty) {
368
365
  return /* @__PURE__ */ jsx("div", { className: cx("crewlet-data-grid", className), "data-flush": flush || void 0, children: /* @__PURE__ */ jsx(
369
366
  EmptyState,