@crewlethq/ui 0.130.1 → 0.130.2

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 (44) hide show
  1. package/README.md +12 -0
  2. package/dist/ArtifactCard/ArtifactCard.d.ts +2 -2
  3. package/dist/ArtifactCard/index.js +1 -1
  4. package/dist/{ArtifactCard-B2QE5CVL.css → ArtifactCard-ZH6KCD5O.css} +16 -1
  5. package/dist/BrandSample/index.js +1 -1
  6. package/dist/{BrandSample-WCI3IS25.css → BrandSample-3OSKZAGG.css} +27 -6
  7. package/dist/Breadcrumb/Breadcrumb.d.ts +6 -5
  8. package/dist/Breadcrumb/index.js +1 -1
  9. package/dist/{Breadcrumb-SENMIAG2.css → Breadcrumb-MQJWJVN3.css} +24 -9
  10. package/dist/CodeBlock/index.js +2 -1
  11. package/dist/ColorSwatch/index.js +3 -2
  12. package/dist/ConfirmField/index.js +3 -2
  13. package/dist/Copyable/index.js +2 -1
  14. package/dist/{Copyable-P5AMRHFX.css → Copyable-XMLKKJDT.css} +13 -0
  15. package/dist/DataGrid/DataGrid.d.ts +26 -1
  16. package/dist/DataGrid/index.js +1 -1
  17. package/dist/InlineCode/InlineCode.d.ts +14 -4
  18. package/dist/InlineCode/index.js +2 -1
  19. package/dist/{InlineCode-KQ5V6D6C.css → InlineCode-BEYQFJQT.css} +18 -2
  20. package/dist/LinkInterstitial/index.js +3 -2
  21. package/dist/OrgTable/index.js +3 -3
  22. package/dist/RichEditor/index.js +1 -1
  23. package/dist/ShareDialog/index.js +2 -1
  24. package/dist/TreeGrid/index.js +2 -2
  25. package/dist/{chunk-CPWSBK3F.js → chunk-2TZNTPF5.js} +70 -3
  26. package/dist/{chunk-36XKE7MH.js → chunk-6POROC4M.js} +1 -1
  27. package/dist/{chunk-BODW4JH3.js → chunk-ECOWCJHQ.js} +1 -1
  28. package/dist/chunk-HZXS5CEL.js +17 -0
  29. package/dist/{chunk-SG2M6SBD.js → chunk-KMIS2R67.js} +1 -1
  30. package/dist/{chunk-Q6QKY7EZ.js → chunk-KQFOPY2P.js} +1 -1
  31. package/dist/{chunk-FO4OY4RV.js → chunk-MZV45HQB.js} +5 -2
  32. package/dist/{chunk-VCFV7FTE.js → chunk-NFA7CSCD.js} +1 -1
  33. package/dist/{chunk-XZB53C7U.js → chunk-OVFB63RZ.js} +2 -2
  34. package/dist/{chunk-IJCMOAM3.js → chunk-OWYIRWEX.js} +1 -1
  35. package/dist/{chunk-VIS6DKGQ.js → chunk-QFE6T6GW.js} +1 -1
  36. package/dist/{chunk-NKCLA6RG.js → chunk-QNDXLHBO.js} +30 -6
  37. package/dist/{chunk-PPGDH32L.js → chunk-XHNV272L.js} +5 -2
  38. package/dist/generated/index.js +25 -24
  39. package/dist/index.js +25 -24
  40. package/dist/styles.css +103 -23
  41. package/dist/utils/pathBreaks.d.ts +12 -0
  42. package/dist/utils/tableTrack.d.ts +12 -1
  43. package/package.json +3 -3
  44. package/dist/{Editor-2TWJE7OR.js → Editor-MEPTWBY5.js} +1 -1
package/README.md CHANGED
@@ -208,6 +208,18 @@ places:
208
208
  - A surface that pans or zooms dispatches `LAYER_REPOSITION_EVENT` on its host
209
209
  when the content beneath it moves, and every panel anchored inside follows.
210
210
 
211
+ ## Changes in 0.130.1
212
+
213
+ ### Columns, trails and identifiers that keep their words
214
+
215
+ - **A flexible grid column of short values takes what it holds.** `DataGrid` measures each flexible column's widest value after layout (its head and the rows on screen, off their words rather than off the cells that cut them), and a column no wider than `SHORT_COLUMN_PX` (192px: a handle, a kind, a date) is drawn at its content, never under its floor, with the shrink columns, while the long ones (a name, a login, an access list) share what is left at `1fr`. At an equal share a seat's handle sat in a third of a column of empty room beside a name cut short. The widest flexible column always keeps its share, so the grid still fills its box, and a grid that cannot be measured draws every flexible column at its share as before.
216
+ - **A breadcrumb's ancestors keep a readable minimum.** Each ancestor keeps its first twenty characters, or all of them where it has fewer (`--crewlet-breadcrumb-keep`, measured), and the trail's floor counts them, so a bar too busy to hold them breaks a line instead of cutting "Doclet" to "D..." or, where the crumb leads with a glyph, to nothing. The floor was measured off the trail as drawn, after a busy bar had already cut the ancestors, so it allowed whatever cut it saw. On a phone an ancestor still gives way to a 2ch stub.
217
+ - **A path breaks at its separators.** `InlineCode` and a wrapping `Copyable` offer a break after every `/`, so an address ends a line at "/v1/" rather than at "/v1/report" with an "s" carried over; breaking at any character is the last resort for one name no line can hold. A copy of the words is unchanged.
218
+ - **An opaque value in a copy panel fills its lines.** A `Copyable` block whose value is one run with no space and no `/` (a token, an id, a key) breaks at any character, rather than after a hyphen with a ragged first line that read as if the token ended there.
219
+ - **A chip hugs the punctuation handed to it.** `InlineCode` with `open` or `close` keeps a hair of its inset on that side, so "set." no longer reads as "set ." with a space before the full stop.
220
+ - **An artifact card prints who can open it.** `ArtifactCard` draws its access as the glyph and its word ("Private", "Shared", "Shared with the company") rather than a lone glyph with the word for assistive technology alone; on a narrow card the word gives way with an ellipsis.
221
+ - **A brand sample's small words can be read in a preview.** `BrandSample` draws its sentence, its quiet line, its wordmark and a slide's footer at their share of the width or at the product's small step, whichever is larger (the step capped at a share the frame can hold, `--crewlet-brand-sample-floor`), so a 285px preview reads at 12px and 11px rather than 8px and 6px, and a thumbnail still fits its frame. Its link is drawn in the accent taken toward the ink that clears more on its ground, only as far as 4.5:1 needs: the product's own accent read 4.38:1.
222
+
211
223
  ## Changes in 0.129.2
212
224
 
213
225
  ### The application rail
@@ -24,7 +24,7 @@ export interface ArtifactCardLabels {
24
24
  present: (count: number) => string;
25
25
  /** The change's time, opening the line: "Edited" before "4m ago". */
26
26
  updated: string;
27
- /** Who can open it, said to assistive technology beside its glyph. */
27
+ /** Who can open it, printed beside its glyph. */
28
28
  access: Record<ArtifactAccess, string>;
29
29
  /** Who made it, after the time: "by Maya". */
30
30
  by: (name: string) => string;
@@ -67,7 +67,7 @@ export interface ArtifactCardProps {
67
67
  version?: number | undefined;
68
68
  /** The project or task it belongs to, as its key ("OPS", "ENG-412"). */
69
69
  project?: string | undefined;
70
- /** Who can open it, drawn as a glyph opening the card's line. Left out, nothing is said about it. */
70
+ /** Who can open it, drawn as a glyph and its word opening the card's line. Left out, nothing is said about it. */
71
71
  access?: ArtifactAccess | undefined;
72
72
  /**
73
73
  * The card's own controls (a More menu), drawn OUTSIDE its link in the
@@ -1,4 +1,4 @@
1
- export { ArtifactCard, ArtifactCardSkeleton, ArtifactPreviewGlyph } from '../chunk-XZB53C7U.js';
1
+ export { ArtifactCard, ArtifactCardSkeleton, ArtifactPreviewGlyph } from '../chunk-OVFB63RZ.js';
2
2
  import '../chunk-WFAJYBLX.js';
3
3
  import '../chunk-HF5L56YQ.js';
4
4
  import '../chunk-GBKBME7Q.js';
@@ -271,10 +271,25 @@
271
271
  white-space: nowrap;
272
272
  }
273
273
 
274
+ /* WHO CAN OPEN IT: the glyph and its word. The word gives way before the
275
+ time does, cut with an ellipsis (its whole word on hover, the span's
276
+ title); the glyph never does. */
274
277
  .crewlet-artifact-card__access {
275
278
  display: inline-flex;
276
- flex: none;
279
+ flex: 0 1 auto;
277
280
  align-items: center;
281
+ gap: var(--spacing-1);
282
+ min-width: 0;
283
+ }
284
+
285
+ .crewlet-artifact-card__access > svg {
286
+ flex: none;
287
+ }
288
+
289
+ .crewlet-artifact-card__access-word {
290
+ min-width: 0;
291
+ overflow: hidden;
292
+ text-overflow: ellipsis;
278
293
  }
279
294
 
280
295
  .crewlet-artifact-card__meta > .crewlet-artifact-card__owner {
@@ -1,4 +1,4 @@
1
- export { BrandSample } from '../chunk-IJCMOAM3.js';
1
+ export { BrandSample } from '../chunk-OWYIRWEX.js';
2
2
  import '../chunk-X7WEE3EK.js';
3
3
  import '../chunk-5SGHW42B.js';
4
4
  import '../chunk-7W3LYIOC.js';
@@ -3,6 +3,17 @@
3
3
  * that sets every length against its own width, so one drawing reads at a
4
4
  * gallery cover's size and at a preview's.
5
5
  *
6
+ * ITS SMALL WORDS KEEP A LEGIBLE FLOOR (`--crewlet-brand-sample-floor`). Set
7
+ * in proportion alone, the doc's sentence and its quiet line measured 8px and
8
+ * 6px in a 285px preview (a setup wizard's aside), a texture where the reader
9
+ * was asked to judge the brand's text. Each small run is drawn at its share of
10
+ * the width or at the product's own small step, whichever is larger; and the
11
+ * step itself is capped at a share of the width the frame can still hold
12
+ * (4.3cqi: two lines of the sentence and the quiet line fit the 16:9 height
13
+ * under the heading at any width), so a thumbnail stays whole rather than
14
+ * clipping its last line. Past about 430px the share is the larger and the
15
+ * drawing is in proportion again.
16
+ *
6
17
  * It paints with the public tokens, which the sample's BrandScope (pinned to
7
18
  * the sample's mode) sets from the brand through the artifact kit's own
8
19
  * mapping: the ground, the text, the accent, the highlight and the two faces,
@@ -13,6 +24,9 @@
13
24
  that clips its own corners sets it to its own. */
14
25
  --crewlet-brand-sample-radius: var(--radius-lg);
15
26
 
27
+ /* The most of the width a small run's floor may take: see the head. */
28
+ --crewlet-brand-sample-floor: 4.3cqi;
29
+
16
30
  /* THE SAMPLE IS ITS OWN CONTAINER, so `cqi` inside it is its own width. */
17
31
  container-type: inline-size;
18
32
  position: relative;
@@ -71,7 +85,7 @@
71
85
  .crewlet-brand-sample__wordmark {
72
86
  overflow: hidden;
73
87
  font-family: var(--font-family-display);
74
- font-size: 3.4cqi;
88
+ font-size: max(3.4cqi, min(var(--font-size-xs), var(--crewlet-brand-sample-floor)));
75
89
  font-weight: var(--font-weight-semibold);
76
90
  text-overflow: ellipsis;
77
91
  white-space: nowrap;
@@ -100,13 +114,20 @@
100
114
 
101
115
  .crewlet-brand-sample__body {
102
116
  max-width: 82%;
103
- font-size: 2.8cqi;
117
+ font-size: max(2.8cqi, min(var(--font-size-xs), var(--crewlet-brand-sample-floor)));
104
118
  line-height: var(--font-line-height-normal);
105
119
  }
106
120
 
107
- /* A LINK, DRAWN: the accent ink and its underline, and nothing to follow. */
121
+ /*
122
+ * A LINK, DRAWN: the accent's ink and its underline, and nothing to follow.
123
+ * THE INK, NOT THE ACCENT: the accent is a fill colour, and drawn as words the
124
+ * product's own read 4.38:1 on the light ground, a light brand colour far
125
+ * less. The ink is the mapping's accent written as text, which clears 4.5:1
126
+ * on the mode's ground whatever the brand's colour (@crewlethq/tokens'
127
+ * `css/brand`).
128
+ */
108
129
  .crewlet-brand-sample__link {
109
- color: var(--color-brand-accent);
130
+ color: var(--color-brand-accent-ink);
110
131
  text-decoration: underline;
111
132
  text-decoration-thickness: 0.2cqi;
112
133
  text-underline-offset: 0.5cqi;
@@ -115,7 +136,7 @@
115
136
  .crewlet-brand-sample__byline {
116
137
  margin-top: auto;
117
138
  color: var(--color-text-tertiary);
118
- font-size: 2.2cqi;
139
+ font-size: max(2.2cqi, min(var(--font-size-2xs), var(--crewlet-brand-sample-floor)));
119
140
  }
120
141
 
121
142
  /* ---- the title slide ---- */
@@ -180,7 +201,7 @@
180
201
  margin-top: 3cqi;
181
202
  overflow: hidden;
182
203
  color: var(--color-text-tertiary);
183
- font-size: 2cqi;
204
+ font-size: max(2cqi, min(var(--font-size-2xs), var(--crewlet-brand-sample-floor)));
184
205
  letter-spacing: var(--font-letter-spacing-wide);
185
206
  text-overflow: ellipsis;
186
207
  text-transform: uppercase;
@@ -28,11 +28,12 @@
28
28
  * that fits has nowhere for the arrows to go, so the stop is there only while
29
29
  * `scrollWidth` exceeds `clientWidth`.
30
30
  *
31
- * ITS FLOOR IS THE WAY BACK OUT (`--crewlet-breadcrumb-floor`): the ancestors
32
- * at their width and the last crumb at its stub, measured. The bar around it
33
- * breaks a line when that floor cannot sit beside its controls, so a trail
34
- * that cannot show its ancestry takes a line of its own, and it scrolls only
35
- * when its ancestry alone is wider than the whole bar.
31
+ * ITS FLOOR IS THE WAY BACK OUT (`--crewlet-breadcrumb-floor`): every ancestor
32
+ * at a readable minimum of its words (its first twenty characters, all of
33
+ * them where it has fewer) and the last crumb at its stub, measured. The bar
34
+ * around it breaks a line when that floor cannot sit beside its controls, so
35
+ * a trail that cannot show its ancestry takes a line of its own, and it
36
+ * scrolls only when its ancestry alone is wider than the whole bar.
36
37
  *
37
38
  * Ported from the engine dashboard's `app/header/PageHeader.tsx`.
38
39
  */
@@ -1,4 +1,4 @@
1
- export { Breadcrumb } from '../chunk-NKCLA6RG.js';
1
+ export { Breadcrumb } from '../chunk-QNDXLHBO.js';
2
2
  import '../chunk-HBDA76EZ.js';
3
3
  import '../chunk-475DOAWF.js';
4
4
  import '../chunk-WSIJDWUG.js';
@@ -8,8 +8,8 @@
8
8
  * `flex-shrink: 100` puts it ahead of anything else on the bar that can give.
9
9
  *
10
10
  * ITS FLOOR IS THE WAY BACK OUT, measured by the component
11
- * (`--crewlet-breadcrumb-floor`): the ancestors at their width and the last
12
- * crumb's stub, at least 20ch, and never more than the whole bar. A fixed 20ch
11
+ * (`--crewlet-breadcrumb-floor`): each ancestor at what it keeps of its words
12
+ * and the last crumb's stub, at least 20ch, and never more than the whole bar. A fixed 20ch
13
13
  * alone let a seat's trail share a phone's line with its one button and cut
14
14
  * "Engineering · Co" mid-letter under it; measured, a trail that cannot show
15
15
  * its ancestry beside the controls makes the bar break a line instead.
@@ -63,16 +63,24 @@
63
63
  /*
64
64
  * THE OBJECT'S OWN NAME TAKES THE CUT, never the way back out. The reader
65
65
  * knows which object they are on, because the page below says so; what they
66
- * cannot reconstruct is the links out of it. So the ancestors keep their width
67
- * and the last part is the one that ellipsises.
66
+ * cannot reconstruct is the links out of it. So an ancestor keeps a readable
67
+ * minimum of its words while the page's own name gives way to its stub.
68
68
  */
69
69
  /* EVERY CRUMB GIVES WAY, in proportion to its length: the page down to a
70
- floor of 24ch and each ancestor to a 2ch stub, each cut with an ellipsis and
71
- titled on hover. Kept whole, one long parent cut the page itself to "Pri..."
72
- at 1440 and pushed it off a phone. */
70
+ floor of 24ch and each ancestor to what it keeps of its words, each cut with
71
+ an ellipsis and titled on hover. Kept whole, one long parent cut the page
72
+ itself to "Pri..." at 1440 and pushed it off a phone.
73
+
74
+ AN ANCESTOR KEEPS A READABLE MINIMUM (`--crewlet-breadcrumb-keep`): its
75
+ first twenty characters, or all of them where it has fewer, measured by the
76
+ component (Breadcrumb.tsx, `KEEP_CHARACTERS`), and counted in the trail's
77
+ floor, so a bar too busy to hold them breaks a line rather than cutting the
78
+ way back out. A stub of 2ch beside a busy page bar read "D..." and "Product
79
+ Man...", and nothing at all where the crumb leads with a glyph. Until it is
80
+ measured, and on a phone (below), the stub is 2ch. */
73
81
  .crewlet-breadcrumb__part:not(:last-child) {
74
82
  flex: 0 1 auto;
75
- min-width: 2ch;
83
+ min-width: var(--crewlet-breadcrumb-keep, 2ch);
76
84
  }
77
85
 
78
86
  .crewlet-breadcrumb__part:last-child {
@@ -179,7 +187,7 @@ a.crewlet-breadcrumb__crumb:focus-visible {
179
187
  /*
180
188
  * AND IT NEVER COLLAPSES TO NOTHING: a floor of a few characters keeps an
181
189
  * ellipsised stub, which is what tells a reader the trail has a last part at
182
- * all. The floor is the last part's alone; an ancestor never shrinks.
190
+ * all. This stub is the last part's; an ancestor keeps its own minimum.
183
191
  */
184
192
  .crewlet-breadcrumb__part:last-child > .crewlet-breadcrumb__here {
185
193
  min-width: 24ch;
@@ -208,6 +216,13 @@ a.crewlet-breadcrumb__crumb:focus-visible {
208
216
  * the crumb is still named.
209
217
  */
210
218
  @media (width < 640px) {
219
+ /* ON A PHONE AN ANCESTOR GIVES WAY TO ITS STUB: the trail shares its line
220
+ with the drawer toggle and nothing else, and an ancestry kept at twenty
221
+ characters a crumb would push the page itself off the screen. */
222
+ .crewlet-breadcrumb__part:not(:last-child) {
223
+ min-width: 2ch;
224
+ }
225
+
211
226
  .crewlet-breadcrumb__part:not(:last-child) > .crewlet-breadcrumb__crumb:has(> .crewlet-breadcrumb__icon) > .crewlet-breadcrumb__text {
212
227
  position: absolute;
213
228
  width: 1px;
@@ -1,8 +1,9 @@
1
1
  export { CodeBlock } from '../chunk-FPCTHIV6.js';
2
- import '../chunk-FO4OY4RV.js';
2
+ import '../chunk-MZV45HQB.js';
3
3
  import '../chunk-2MEBMWNO.js';
4
4
  import '../chunk-STJ7QBC3.js';
5
5
  import '../chunk-DTIW4CHZ.js';
6
+ import '../chunk-HZXS5CEL.js';
6
7
  import '../chunk-M2M6ZD7P.js';
7
8
  import '../chunk-XSPCITPN.js';
8
9
  import '../chunk-X5YI6E5X.js';
@@ -1,8 +1,9 @@
1
- export { ColorSwatch } from '../chunk-SG2M6SBD.js';
2
- import '../chunk-FO4OY4RV.js';
1
+ export { ColorSwatch } from '../chunk-KMIS2R67.js';
2
+ import '../chunk-MZV45HQB.js';
3
3
  import '../chunk-2MEBMWNO.js';
4
4
  import '../chunk-STJ7QBC3.js';
5
5
  import '../chunk-DTIW4CHZ.js';
6
+ import '../chunk-HZXS5CEL.js';
6
7
  import '../chunk-7W3LYIOC.js';
7
8
  import '../chunk-M2M6ZD7P.js';
8
9
  import '../chunk-XSPCITPN.js';
@@ -1,5 +1,6 @@
1
- export { ConfirmField, confirmMatches } from '../chunk-BODW4JH3.js';
2
- import '../chunk-PPGDH32L.js';
1
+ export { ConfirmField, confirmMatches } from '../chunk-ECOWCJHQ.js';
2
+ import '../chunk-XHNV272L.js';
3
+ import '../chunk-HZXS5CEL.js';
3
4
  import '../chunk-NN44J7BP.js';
4
5
  import '../chunk-NICEDVZM.js';
5
6
  import '../chunk-JLKO7PSK.js';
@@ -1,7 +1,8 @@
1
- export { Copyable } from '../chunk-FO4OY4RV.js';
1
+ export { Copyable } from '../chunk-MZV45HQB.js';
2
2
  export { CopyButton } from '../chunk-2MEBMWNO.js';
3
3
  import '../chunk-STJ7QBC3.js';
4
4
  import '../chunk-DTIW4CHZ.js';
5
+ import '../chunk-HZXS5CEL.js';
5
6
  import '../chunk-M2M6ZD7P.js';
6
7
  import '../chunk-XSPCITPN.js';
7
8
  import '../chunk-X5YI6E5X.js';
@@ -127,6 +127,19 @@
127
127
  flex: 1;
128
128
  }
129
129
 
130
+ /*
131
+ * A PATH OR AN ADDRESS BREAKS AT ITS SEPARATORS: the component offers a break
132
+ * after every `/`, and `overflow-wrap: anywhere` above is the last resort for
133
+ * a run between them no line can hold. AN OPAQUE VALUE (a token, an id, a key:
134
+ * one run with no space and no `/`) means nothing in its pieces, so it breaks
135
+ * at any character and fills each line; left to the line breaker it broke
136
+ * after a hyphen, and a token read "cwl_pat_01a1dc5f-3ec7-7cf4-a60d-" over a
137
+ * ragged first line, as if it ended there.
138
+ */
139
+ .crewlet-copyable--opaque .crewlet-copyable__value {
140
+ word-break: break-all;
141
+ }
142
+
130
143
  /* A panel's control is always drawn: there is nothing else in the panel. */
131
144
  .crewlet-copyable--block .crewlet-copyable__button {
132
145
  opacity: 1;
@@ -87,7 +87,8 @@ export interface DataGridColumn<T> {
87
87
  * The narrowest a FLEXIBLE column may be drawn: its track is
88
88
  * `minmax(floor, 1fr)` rather than `minmax(0, 1fr)`. For the column that is
89
89
  * the point of the list (a title, a name), which at zero gave way to every
90
- * content-sized column beside it.
90
+ * content-sized column beside it. A flexible column whose widest value is
91
+ * short takes what it holds instead, never under its floor ([DataGrid]).
91
92
  */
92
93
  floor?: string | undefined;
93
94
  /**
@@ -447,6 +448,19 @@ export declare function fitGridColumns({ fit, width, overflows, stack, visible,
447
448
  drop?: number | undefined;
448
449
  }[];
449
450
  }): GridFit | null;
451
+ /**
452
+ * The widest value of each flexible column the grid draws, its head
453
+ * included, read over the head and the first rows. A column nothing in could
454
+ * be measured is left out.
455
+ */
456
+ export declare function widestValues<T>(wrap: HTMLElement, visible: readonly DataGridColumn<T>[], leading?: number): Record<string, number>;
457
+ /**
458
+ * The flexible columns drawn at what they hold: those measured no wider than
459
+ * `SHORT_COLUMN_PX`, never the widest flexible column, which keeps its share
460
+ * so the grid fills its box. PURE, so the rule is held without a layout
461
+ * engine; nothing measured, nothing is short.
462
+ */
463
+ export declare function shortColumns<T>(visible: readonly Pick<DataGridColumn<T>, 'key' | 'width' | 'shrink' | 'icon' | 'action'>[], widest: Readonly<Record<string, number>>): Set<string>;
450
464
  /**
451
465
  * Whether a content-sized column has been squeezed: see [squeezedCells]. Read
452
466
  * off the grid's head and the first screen of its rows.
@@ -466,6 +480,17 @@ export declare function squeezed<T>(wrap: HTMLElement, visible: readonly DataGri
466
480
  * a ceiling and grid resolves it before any flexible column, so one long value
467
481
  * starved the title to zero and still overflowed.
468
482
  *
483
+ * A FLEXIBLE COLUMN OF SHORT VALUES TAKES WHAT IT HOLDS. Its widest value is
484
+ * measured after layout (the head and the rows on screen, off their words
485
+ * rather than off the cells that cut them), and one no wider than
486
+ * `SHORT_COLUMN_PX` is drawn at its content, with the shrink columns, while
487
+ * the long ones share what is left at `1fr`. At an equal share every flexible
488
+ * column took the same width whatever it held, so a seat's handle sat in a
489
+ * third of a column of empty room beside a name cut short. The widest
490
+ * flexible column always keeps its share, so the grid still fills its box,
491
+ * and a grid that cannot be measured (no layout) draws every flexible column
492
+ * at its share, as before.
493
+ *
469
494
  * COLUMNS THAT DO NOT FIT GIVE WAY IN ORDER (`drop`), measured after every
470
495
  * commit in a layout effect so the intermediate shapes never paint, and the
471
496
  * foot names what the width took. Not on a phone, where a row is a card.
@@ -1,4 +1,4 @@
1
- export { ChooserList, ColumnChooser, DATA_GRID_ICON_TRACK, DataGrid, columnChoicesOf, countDataGridRows, fitGridColumns, nextGridSort, parseGridSort, sortGridRows, useAnyDataGridDriving, useDataGridDriving } from '../chunk-CPWSBK3F.js';
1
+ export { ChooserList, ColumnChooser, DATA_GRID_ICON_TRACK, DataGrid, columnChoicesOf, countDataGridRows, fitGridColumns, nextGridSort, parseGridSort, sortGridRows, useAnyDataGridDriving, useDataGridDriving } from '../chunk-2TZNTPF5.js';
2
2
  import '../chunk-WFAJYBLX.js';
3
3
  import '../chunk-WSIJDWUG.js';
4
4
  import '../chunk-JMBPMSNI.js';
@@ -42,12 +42,22 @@ export interface InlineCodeProps extends HTMLAttributes<HTMLElement> {
42
42
  /**
43
43
  * One identifier inside a sentence.
44
44
  *
45
- * IT WRAPS ANYWHERE, and that is the whole reason it is a component rather
46
- * than a `code` element with a class. These chips carry public base URLs and
47
- * config paths, and a URL is ONE UNBREAKABLE WORD to a line breaker: without
48
- * an explicit break opportunity the chip is pushed whole onto its own line and
45
+ * IT WRAPS, and that is the whole reason it is a component rather than a
46
+ * `code` element with a class. These chips carry public base URLs and config
47
+ * paths, and a URL is ONE UNBREAKABLE WORD to a line breaker: without an
48
+ * explicit break opportunity the chip is pushed whole onto its own line and
49
49
  * the sentence around it is torn into fragments.
50
50
  *
51
+ * A PATH BREAKS AT ITS SEPARATORS (`pathBreaks`): a break opportunity follows
52
+ * every `/`, so a line ends at "…/v1/" rather than at "…/v1/report" with an
53
+ * "s" carried over. Breaking at any character is the last resort, for one
54
+ * run between separators that no line can hold.
55
+ *
56
+ * ITS GROUND HUGS THE PUNCTUATION AROUND IT. Where a caller hands over the
57
+ * marks that open and close around the chip (`open`, `close`), the ground
58
+ * gives up its inset on that side, so "set." does not read as "set ." with a
59
+ * space before the full stop.
60
+ *
51
61
  * For a block of code, several lines of it, use `CodeBlock`.
52
62
  */
53
63
  export declare function InlineCode({ variant, tone, truncate, whole, open, close, className, children, ...rest }: InlineCodeProps): import("react").JSX.Element;
@@ -1,2 +1,3 @@
1
- export { InlineCode } from '../chunk-PPGDH32L.js';
1
+ export { InlineCode } from '../chunk-XHNV272L.js';
2
+ import '../chunk-HZXS5CEL.js';
2
3
  import '../chunk-ODEQTPFM.js';
@@ -24,8 +24,10 @@
24
24
  border-radius: var(--radius-xs);
25
25
  padding: 1px var(--spacing-1);
26
26
  color: var(--color-text-secondary);
27
- /* A URL IS ONE UNBREAKABLE WORD to a line breaker. Without this the chip is
28
- pushed whole onto its own line and the sentence around it is torn up. */
27
+ /* A URL IS ONE UNBREAKABLE WORD to a line breaker. The component offers a
28
+ break after every `/` (`pathBreaks`); this is the last resort, for one run
29
+ between them that no line can hold, which would otherwise push the chip
30
+ past its box. */
29
31
  overflow-wrap: anywhere;
30
32
  /* SLICED where it breaks, not cloned: a browser leaves a cloned inset out of
31
33
  line breaking, so each broken line ran up to the inset past its box. */
@@ -61,6 +63,20 @@
61
63
  color: inherit;
62
64
  }
63
65
 
66
+ /*
67
+ * THE GROUND HUGS THE PUNCTUATION AROUND IT. The inset either side of the
68
+ * words is what reads as a space between "set" and its full stop: "crewlet
69
+ * secrets set ." Beside a mark the caller handed over (`open`, `close`) the
70
+ * ground keeps a hair of it, so the mark sits where it would after a word.
71
+ */
72
+ .crewlet-inline-code--opened {
73
+ padding-inline-start: 1px;
74
+ }
75
+
76
+ .crewlet-inline-code--closed {
77
+ padding-inline-end: 1px;
78
+ }
79
+
64
80
  /* A whole chip and the punctuation around it are one atomic box, so a line
65
81
  never breaks between "(" and the chip (peelPunctuation). */
66
82
  .crewlet-inline-code-bound {
@@ -1,6 +1,7 @@
1
- export { LinkInterstitial, openExternal } from '../chunk-36XKE7MH.js';
1
+ export { LinkInterstitial, openExternal } from '../chunk-6POROC4M.js';
2
2
  import '../chunk-VSD3536L.js';
3
- import '../chunk-PPGDH32L.js';
3
+ import '../chunk-XHNV272L.js';
4
+ import '../chunk-HZXS5CEL.js';
4
5
  import '../chunk-RCQLXOGS.js';
5
6
  import '../chunk-M2M6ZD7P.js';
6
7
  import '../chunk-XSPCITPN.js';
@@ -1,8 +1,8 @@
1
- export { OrgTable, OrgTableActions, OrgTableAdd, OrgTableName } from '../chunk-VCFV7FTE.js';
2
- import '../chunk-VIS6DKGQ.js';
1
+ export { OrgTable, OrgTableActions, OrgTableAdd, OrgTableName } from '../chunk-NFA7CSCD.js';
2
+ import '../chunk-QFE6T6GW.js';
3
3
  import '../chunk-SYMLWDV6.js';
4
4
  import '../chunk-MY374UUD.js';
5
- import '../chunk-CPWSBK3F.js';
5
+ import '../chunk-2TZNTPF5.js';
6
6
  import '../chunk-X4HBZSXA.js';
7
7
  import '../chunk-WFAJYBLX.js';
8
8
  import '../chunk-WSIJDWUG.js';
@@ -1,4 +1,4 @@
1
- export { RichEditor, preloadRichEditor } from '../chunk-Q6QKY7EZ.js';
1
+ export { RichEditor, preloadRichEditor } from '../chunk-KQFOPY2P.js';
2
2
  export { RICH_EDITOR_LABELS, richEditorLabels } from '../chunk-2DMTW2Y3.js';
3
3
  import '../chunk-KOJPDCGQ.js';
4
4
  import '../chunk-KBZO4B33.js';
@@ -2,10 +2,11 @@ export { ARTIFACT_ROLES, SHAREABLE_ROLES, ShareDialog, roleAtLeast } from '../ch
2
2
  import '../chunk-6ZFQ6TAM.js';
3
3
  import '../chunk-VSD3536L.js';
4
4
  import '../chunk-KW7T23RT.js';
5
- import '../chunk-FO4OY4RV.js';
5
+ import '../chunk-MZV45HQB.js';
6
6
  import '../chunk-2MEBMWNO.js';
7
7
  import '../chunk-STJ7QBC3.js';
8
8
  import '../chunk-DTIW4CHZ.js';
9
+ import '../chunk-HZXS5CEL.js';
9
10
  import '../chunk-RCQLXOGS.js';
10
11
  import '../chunk-HF5L56YQ.js';
11
12
  import '../chunk-ARZGEHWE.js';
@@ -1,6 +1,6 @@
1
- export { TreeGrid } from '../chunk-VIS6DKGQ.js';
1
+ export { TreeGrid } from '../chunk-QFE6T6GW.js';
2
2
  import '../chunk-MY374UUD.js';
3
- import '../chunk-CPWSBK3F.js';
3
+ import '../chunk-2TZNTPF5.js';
4
4
  import '../chunk-X4HBZSXA.js';
5
5
  import '../chunk-WFAJYBLX.js';
6
6
  import '../chunk-WSIJDWUG.js';
@@ -15,10 +15,13 @@ import { ArrowDownGlyph, ArrowUpGlyph, ArrowUpDownGlyph, GripVerticalGlyph, Chev
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
16
 
17
17
  // src/utils/tableTrack.ts
18
+ var SHORT_COLUMN_PX = 192;
18
19
  var SHRINK_SHARE = 0.2;
19
- function tableTrack({ width, shrink, floor }) {
20
+ function tableTrack({ width, shrink, floor, short }) {
20
21
  if (width) return width;
21
- return shrink ? `fit-content(${SHRINK_SHARE * 100}%)` : `minmax(${floor ?? 0}, 1fr)`;
22
+ if (shrink) return `fit-content(${SHRINK_SHARE * 100}%)`;
23
+ if (short) return floor === "max-content" || !floor ? "max-content" : `minmax(${floor}, max-content)`;
24
+ return `minmax(${floor ?? 0}, 1fr)`;
22
25
  }
23
26
  var GRID_ICON_TRACK = "calc(var(--size-target-min) + var(--spacing-3) * 2)";
24
27
  function alignOf(column) {
@@ -292,6 +295,60 @@ function fitGridColumns({
292
295
  }
293
296
  return null;
294
297
  }
298
+ var NO_WIDTHS = {};
299
+ var WIDEST_SAMPLE_ROWS = 40;
300
+ function flexible(column) {
301
+ return !column.width && !column.shrink && !column.icon && !column.action;
302
+ }
303
+ function contentWidth(cell) {
304
+ const lines = /* @__PURE__ */ new Map();
305
+ const take = (rect) => {
306
+ if (rect.width <= 0) return;
307
+ const top = Math.round(rect.top);
308
+ const line = lines.get(top);
309
+ lines.set(top, line ? [Math.min(line[0], rect.left), Math.max(line[1], rect.right)] : [rect.left, rect.right]);
310
+ };
311
+ if (typeof document.createRange !== "function") return 0;
312
+ const walk = document.createTreeWalker(cell, NodeFilter.SHOW_TEXT);
313
+ for (let node = walk.nextNode(); node; node = walk.nextNode()) {
314
+ if (!node.textContent?.trim() || node.parentElement?.closest(".crewlet-visually-hidden")) continue;
315
+ const range = document.createRange();
316
+ range.selectNodeContents(node);
317
+ if (typeof range.getClientRects !== "function") return 0;
318
+ for (const rect of range.getClientRects()) take(rect);
319
+ }
320
+ for (const mark of cell.querySelectorAll("svg, img")) take(mark.getBoundingClientRect());
321
+ if (lines.size === 0) return 0;
322
+ let words = 0;
323
+ for (const [left, right] of lines.values()) words += right - left;
324
+ const style = getComputedStyle(cell);
325
+ return Math.ceil(words + (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0));
326
+ }
327
+ function widestValues(wrap, visible, leading = 0) {
328
+ const head = wrap.querySelector(":scope > .crewlet-data-grid__head");
329
+ if (!head) return {};
330
+ const rows = [...wrap.querySelectorAll(":scope > .crewlet-data-grid__body .crewlet-data-grid__row")].slice(0, WIDEST_SAMPLE_ROWS);
331
+ const out = {};
332
+ visible.forEach((column, i) => {
333
+ if (!flexible(column)) return;
334
+ let most = 0;
335
+ const cells = [head.children[i + leading], ...rows.map((row) => row.querySelectorAll(":scope > .crewlet-data-grid__cell")[i + leading])];
336
+ for (const cell of cells) if (cell) most = Math.max(most, contentWidth(cell));
337
+ if (most > 0) out[column.key] = most;
338
+ });
339
+ return out;
340
+ }
341
+ function sameWidths(a, b) {
342
+ const keys = Object.keys(a);
343
+ return keys.length === Object.keys(b).length && keys.every((key) => Math.abs((a[key] ?? 0) - (b[key] ?? -1)) < 1);
344
+ }
345
+ function shortColumns(visible, widest) {
346
+ const all = visible.filter((c) => flexible(c));
347
+ const measured = all.filter((c) => (widest[c.key] ?? 0) > 0);
348
+ if (measured.length === 0) return /* @__PURE__ */ new Set();
349
+ const keeper = measured.length < all.length ? null : measured.reduce((a, b) => widest[b.key] > widest[a.key] ? b : a);
350
+ return new Set(measured.filter((c) => c !== keeper && widest[c.key] <= SHORT_COLUMN_PX).map((c) => c.key));
351
+ }
295
352
  function squeezed(wrap, visible, leading = 0) {
296
353
  const head = wrap.querySelector(":scope > .crewlet-data-grid__head");
297
354
  if (!head) return null;
@@ -542,6 +599,13 @@ function DataGrid({
542
599
  watch2.observe(wrap);
543
600
  return () => watch2.disconnect();
544
601
  }, [wrap]);
602
+ const [widest, setWidest] = useState(NO_WIDTHS);
603
+ useLayoutEffect(() => {
604
+ const el = wrap;
605
+ if (!el || phone) return;
606
+ const next = widestValues(el, visibleColumns, leading);
607
+ if (!sameWidths(next, widest)) setWidest(next);
608
+ }, [wrap, phone, visibleColumns, leading, flat, boxWidth, widest]);
545
609
  useLayoutEffect(() => {
546
610
  const el = wrap;
547
611
  if (!el || phone) return;
@@ -600,7 +664,10 @@ function DataGrid({
600
664
  if (!sortsBy(column) || !onSortChange) return;
601
665
  onSortChange(nextGridSort(column.key, sortRaw, defaultSort));
602
666
  }
603
- const template = drawnColumns.map((c) => tableTrack({ ...c, width: c.width ?? (c.icon ? DATA_GRID_ICON_TRACK : void 0) })).join(" ");
667
+ const short = shortColumns(visibleColumns, widest);
668
+ const template = drawnColumns.map(
669
+ (c) => tableTrack({ ...c, width: c.width ?? (c.icon ? DATA_GRID_ICON_TRACK : void 0), short: short.has(c.key) })
670
+ ).join(" ");
604
671
  const placeholders = loading && flat.length === 0 && !bands?.length;
605
672
  if (flat.length === 0 && !bands?.length && !summaryRows?.length && empty && !placeholders) {
606
673
  return /* @__PURE__ */ jsx("div", { className: cx("crewlet-data-grid", className), "data-flush": flush || void 0, children: /* @__PURE__ */ jsx(
@@ -1,5 +1,5 @@
1
1
  import { ConfirmModal } from './chunk-VSD3536L.js';
2
- import { InlineCode } from './chunk-PPGDH32L.js';
2
+ import { InlineCode } from './chunk-XHNV272L.js';
3
3
  import { Callout } from './chunk-RCQLXOGS.js';
4
4
  import './LinkInterstitial-ET4MSVSV.css';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -1,4 +1,4 @@
1
- import { InlineCode } from './chunk-PPGDH32L.js';
1
+ import { InlineCode } from './chunk-XHNV272L.js';
2
2
  import { FormField, Input } from './chunk-NN44J7BP.js';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
 
@@ -0,0 +1,17 @@
1
+ import { Children, Fragment } from 'react';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+
4
+ // src/utils/pathBreaks.tsx
5
+ function pathBreaks(children) {
6
+ const parts = Children.toArray(children);
7
+ if (!parts.every((part) => typeof part === "string" || typeof part === "number")) return children;
8
+ const text = parts.join("");
9
+ if (!text.includes("/")) return children;
10
+ const runs = text.split(/(?<=\/)/);
11
+ return runs.map((run, i) => /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ run,
13
+ i < runs.length - 1 ? /* @__PURE__ */ jsx("wbr", {}) : null
14
+ ] }, i));
15
+ }
16
+
17
+ export { pathBreaks };