@crewlethq/ui 0.130.1 → 0.131.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 (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 +30 -29
  39. package/dist/index.js +30 -29
  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/dist/styles.css CHANGED
@@ -3802,7 +3802,7 @@ button.crewlet-account-row__who:focus-visible {
3802
3802
  }
3803
3803
 
3804
3804
 
3805
- /* ArtifactCard-B2QE5CVL.css */
3805
+ /* ArtifactCard-ZH6KCD5O.css */
3806
3806
  /*
3807
3807
  * A card in a gallery: the preview on top at a fixed ratio, so a grid of them
3808
3808
  * lines up whatever each preview is, the kind's badge over its foot, then the
@@ -4076,10 +4076,25 @@ button.crewlet-account-row__who:focus-visible {
4076
4076
  white-space: nowrap;
4077
4077
  }
4078
4078
 
4079
+ /* WHO CAN OPEN IT: the glyph and its word. The word gives way before the
4080
+ time does, cut with an ellipsis (its whole word on hover, the span's
4081
+ title); the glyph never does. */
4079
4082
  .crewlet-artifact-card__access {
4080
4083
  display: inline-flex;
4081
- flex: none;
4084
+ flex: 0 1 auto;
4082
4085
  align-items: center;
4086
+ gap: var(--spacing-1);
4087
+ min-width: 0;
4088
+ }
4089
+
4090
+ .crewlet-artifact-card__access > svg {
4091
+ flex: none;
4092
+ }
4093
+
4094
+ .crewlet-artifact-card__access-word {
4095
+ min-width: 0;
4096
+ overflow: hidden;
4097
+ text-overflow: ellipsis;
4083
4098
  }
4084
4099
 
4085
4100
  .crewlet-artifact-card__meta > .crewlet-artifact-card__owner {
@@ -6241,12 +6256,23 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6241
6256
  }
6242
6257
 
6243
6258
 
6244
- /* BrandSample-WCI3IS25.css */
6259
+ /* BrandSample-3OSKZAGG.css */
6245
6260
  /*
6246
6261
  * A company's brand, drawn: a doc's opening or a title slide, in a 16:9 frame
6247
6262
  * that sets every length against its own width, so one drawing reads at a
6248
6263
  * gallery cover's size and at a preview's.
6249
6264
  *
6265
+ * ITS SMALL WORDS KEEP A LEGIBLE FLOOR (`--crewlet-brand-sample-floor`). Set
6266
+ * in proportion alone, the doc's sentence and its quiet line measured 8px and
6267
+ * 6px in a 285px preview (a setup wizard's aside), a texture where the reader
6268
+ * was asked to judge the brand's text. Each small run is drawn at its share of
6269
+ * the width or at the product's own small step, whichever is larger; and the
6270
+ * step itself is capped at a share of the width the frame can still hold
6271
+ * (4.3cqi: two lines of the sentence and the quiet line fit the 16:9 height
6272
+ * under the heading at any width), so a thumbnail stays whole rather than
6273
+ * clipping its last line. Past about 430px the share is the larger and the
6274
+ * drawing is in proportion again.
6275
+ *
6250
6276
  * It paints with the public tokens, which the sample's BrandScope (pinned to
6251
6277
  * the sample's mode) sets from the brand through the artifact kit's own
6252
6278
  * mapping: the ground, the text, the accent, the highlight and the two faces,
@@ -6257,6 +6283,9 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6257
6283
  that clips its own corners sets it to its own. */
6258
6284
  --crewlet-brand-sample-radius: var(--radius-lg);
6259
6285
 
6286
+ /* The most of the width a small run's floor may take: see the head. */
6287
+ --crewlet-brand-sample-floor: 4.3cqi;
6288
+
6260
6289
  /* THE SAMPLE IS ITS OWN CONTAINER, so `cqi` inside it is its own width. */
6261
6290
  container-type: inline-size;
6262
6291
  position: relative;
@@ -6315,7 +6344,7 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6315
6344
  .crewlet-brand-sample__wordmark {
6316
6345
  overflow: hidden;
6317
6346
  font-family: var(--font-family-display);
6318
- font-size: 3.4cqi;
6347
+ font-size: max(3.4cqi, min(var(--font-size-xs), var(--crewlet-brand-sample-floor)));
6319
6348
  font-weight: var(--font-weight-semibold);
6320
6349
  text-overflow: ellipsis;
6321
6350
  white-space: nowrap;
@@ -6344,13 +6373,20 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6344
6373
 
6345
6374
  .crewlet-brand-sample__body {
6346
6375
  max-width: 82%;
6347
- font-size: 2.8cqi;
6376
+ font-size: max(2.8cqi, min(var(--font-size-xs), var(--crewlet-brand-sample-floor)));
6348
6377
  line-height: var(--font-line-height-normal);
6349
6378
  }
6350
6379
 
6351
- /* A LINK, DRAWN: the accent ink and its underline, and nothing to follow. */
6380
+ /*
6381
+ * A LINK, DRAWN: the accent's ink and its underline, and nothing to follow.
6382
+ * THE INK, NOT THE ACCENT: the accent is a fill colour, and drawn as words the
6383
+ * product's own read 4.38:1 on the light ground, a light brand colour far
6384
+ * less. The ink is the mapping's accent written as text, which clears 4.5:1
6385
+ * on the mode's ground whatever the brand's colour (@crewlethq/tokens'
6386
+ * `css/brand`).
6387
+ */
6352
6388
  .crewlet-brand-sample__link {
6353
- color: var(--color-brand-accent);
6389
+ color: var(--color-brand-accent-ink);
6354
6390
  text-decoration: underline;
6355
6391
  text-decoration-thickness: 0.2cqi;
6356
6392
  text-underline-offset: 0.5cqi;
@@ -6359,7 +6395,7 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6359
6395
  .crewlet-brand-sample__byline {
6360
6396
  margin-top: auto;
6361
6397
  color: var(--color-text-tertiary);
6362
- font-size: 2.2cqi;
6398
+ font-size: max(2.2cqi, min(var(--font-size-2xs), var(--crewlet-brand-sample-floor)));
6363
6399
  }
6364
6400
 
6365
6401
  /* ---- the title slide ---- */
@@ -6424,7 +6460,7 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6424
6460
  margin-top: 3cqi;
6425
6461
  overflow: hidden;
6426
6462
  color: var(--color-text-tertiary);
6427
- font-size: 2cqi;
6463
+ font-size: max(2cqi, min(var(--font-size-2xs), var(--crewlet-brand-sample-floor)));
6428
6464
  letter-spacing: var(--font-letter-spacing-wide);
6429
6465
  text-overflow: ellipsis;
6430
6466
  text-transform: uppercase;
@@ -6464,7 +6500,7 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6464
6500
  }
6465
6501
 
6466
6502
 
6467
- /* Breadcrumb-SENMIAG2.css */
6503
+ /* Breadcrumb-MQJWJVN3.css */
6468
6504
  /*
6469
6505
  * The trail in a top bar.
6470
6506
  *
@@ -6475,8 +6511,8 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6475
6511
  * `flex-shrink: 100` puts it ahead of anything else on the bar that can give.
6476
6512
  *
6477
6513
  * ITS FLOOR IS THE WAY BACK OUT, measured by the component
6478
- * (`--crewlet-breadcrumb-floor`): the ancestors at their width and the last
6479
- * crumb's stub, at least 20ch, and never more than the whole bar. A fixed 20ch
6514
+ * (`--crewlet-breadcrumb-floor`): each ancestor at what it keeps of its words
6515
+ * and the last crumb's stub, at least 20ch, and never more than the whole bar. A fixed 20ch
6480
6516
  * alone let a seat's trail share a phone's line with its one button and cut
6481
6517
  * "Engineering · Co" mid-letter under it; measured, a trail that cannot show
6482
6518
  * its ancestry beside the controls makes the bar break a line instead.
@@ -6530,16 +6566,24 @@ button.crewlet-avatar-picker:hover .crewlet-avatar-picker__pip {
6530
6566
  /*
6531
6567
  * THE OBJECT'S OWN NAME TAKES THE CUT, never the way back out. The reader
6532
6568
  * knows which object they are on, because the page below says so; what they
6533
- * cannot reconstruct is the links out of it. So the ancestors keep their width
6534
- * and the last part is the one that ellipsises.
6569
+ * cannot reconstruct is the links out of it. So an ancestor keeps a readable
6570
+ * minimum of its words while the page's own name gives way to its stub.
6535
6571
  */
6536
6572
  /* EVERY CRUMB GIVES WAY, in proportion to its length: the page down to a
6537
- floor of 24ch and each ancestor to a 2ch stub, each cut with an ellipsis and
6538
- titled on hover. Kept whole, one long parent cut the page itself to "Pri..."
6539
- at 1440 and pushed it off a phone. */
6573
+ floor of 24ch and each ancestor to what it keeps of its words, each cut with
6574
+ an ellipsis and titled on hover. Kept whole, one long parent cut the page
6575
+ itself to "Pri..." at 1440 and pushed it off a phone.
6576
+
6577
+ AN ANCESTOR KEEPS A READABLE MINIMUM (`--crewlet-breadcrumb-keep`): its
6578
+ first twenty characters, or all of them where it has fewer, measured by the
6579
+ component (Breadcrumb.tsx, `KEEP_CHARACTERS`), and counted in the trail's
6580
+ floor, so a bar too busy to hold them breaks a line rather than cutting the
6581
+ way back out. A stub of 2ch beside a busy page bar read "D..." and "Product
6582
+ Man...", and nothing at all where the crumb leads with a glyph. Until it is
6583
+ measured, and on a phone (below), the stub is 2ch. */
6540
6584
  .crewlet-breadcrumb__part:not(:last-child) {
6541
6585
  flex: 0 1 auto;
6542
- min-width: 2ch;
6586
+ min-width: var(--crewlet-breadcrumb-keep, 2ch);
6543
6587
  }
6544
6588
 
6545
6589
  .crewlet-breadcrumb__part:last-child {
@@ -6646,7 +6690,7 @@ a.crewlet-breadcrumb__crumb:focus-visible {
6646
6690
  /*
6647
6691
  * AND IT NEVER COLLAPSES TO NOTHING: a floor of a few characters keeps an
6648
6692
  * ellipsised stub, which is what tells a reader the trail has a last part at
6649
- * all. The floor is the last part's alone; an ancestor never shrinks.
6693
+ * all. This stub is the last part's; an ancestor keeps its own minimum.
6650
6694
  */
6651
6695
  .crewlet-breadcrumb__part:last-child > .crewlet-breadcrumb__here {
6652
6696
  min-width: 24ch;
@@ -6675,6 +6719,13 @@ a.crewlet-breadcrumb__crumb:focus-visible {
6675
6719
  * the crumb is still named.
6676
6720
  */
6677
6721
  @media (width < 640px) {
6722
+ /* ON A PHONE AN ANCESTOR GIVES WAY TO ITS STUB: the trail shares its line
6723
+ with the drawer toggle and nothing else, and an ancestry kept at twenty
6724
+ characters a crumb would push the page itself off the screen. */
6725
+ .crewlet-breadcrumb__part:not(:last-child) {
6726
+ min-width: 2ch;
6727
+ }
6728
+
6678
6729
  .crewlet-breadcrumb__part:not(:last-child) > .crewlet-breadcrumb__crumb:has(> .crewlet-breadcrumb__icon) > .crewlet-breadcrumb__text {
6679
6730
  position: absolute;
6680
6731
  width: 1px;
@@ -15444,7 +15495,7 @@ button.crewlet-histogram__bar[data-empty]:focus-visible > .crewlet-histogram__fi
15444
15495
  }
15445
15496
 
15446
15497
 
15447
- /* Copyable-P5AMRHFX.css */
15498
+ /* Copyable-XMLKKJDT.css */
15448
15499
  /*
15449
15500
  * Copyable: a value and the one control that copies it.
15450
15501
  *
@@ -15574,6 +15625,19 @@ button.crewlet-histogram__bar[data-empty]:focus-visible > .crewlet-histogram__fi
15574
15625
  flex: 1;
15575
15626
  }
15576
15627
 
15628
+ /*
15629
+ * A PATH OR AN ADDRESS BREAKS AT ITS SEPARATORS: the component offers a break
15630
+ * after every `/`, and `overflow-wrap: anywhere` above is the last resort for
15631
+ * a run between them no line can hold. AN OPAQUE VALUE (a token, an id, a key:
15632
+ * one run with no space and no `/`) means nothing in its pieces, so it breaks
15633
+ * at any character and fills each line; left to the line breaker it broke
15634
+ * after a hyphen, and a token read "cwl_pat_01a1dc5f-3ec7-7cf4-a60d-" over a
15635
+ * ragged first line, as if it ended there.
15636
+ */
15637
+ .crewlet-copyable--opaque .crewlet-copyable__value {
15638
+ word-break: break-all;
15639
+ }
15640
+
15577
15641
  /* A panel's control is always drawn: there is nothing else in the panel. */
15578
15642
  .crewlet-copyable--block .crewlet-copyable__button {
15579
15643
  opacity: 1;
@@ -25637,7 +25701,7 @@ a.crewlet-icon-btn {
25637
25701
  }
25638
25702
 
25639
25703
 
25640
- /* InlineCode-KQ5V6D6C.css */
25704
+ /* InlineCode-BEYQFJQT.css */
25641
25705
  /*
25642
25706
  * One identifier inside a sentence: a mono chip on the inset surface.
25643
25707
  *
@@ -25664,8 +25728,10 @@ a.crewlet-icon-btn {
25664
25728
  border-radius: var(--radius-xs);
25665
25729
  padding: 1px var(--spacing-1);
25666
25730
  color: var(--color-text-secondary);
25667
- /* A URL IS ONE UNBREAKABLE WORD to a line breaker. Without this the chip is
25668
- pushed whole onto its own line and the sentence around it is torn up. */
25731
+ /* A URL IS ONE UNBREAKABLE WORD to a line breaker. The component offers a
25732
+ break after every `/` (`pathBreaks`); this is the last resort, for one run
25733
+ between them that no line can hold, which would otherwise push the chip
25734
+ past its box. */
25669
25735
  overflow-wrap: anywhere;
25670
25736
  /* SLICED where it breaks, not cloned: a browser leaves a cloned inset out of
25671
25737
  line breaking, so each broken line ran up to the inset past its box. */
@@ -25701,6 +25767,20 @@ a.crewlet-icon-btn {
25701
25767
  color: inherit;
25702
25768
  }
25703
25769
 
25770
+ /*
25771
+ * THE GROUND HUGS THE PUNCTUATION AROUND IT. The inset either side of the
25772
+ * words is what reads as a space between "set" and its full stop: "crewlet
25773
+ * secrets set ." Beside a mark the caller handed over (`open`, `close`) the
25774
+ * ground keeps a hair of it, so the mark sits where it would after a word.
25775
+ */
25776
+ .crewlet-inline-code--opened {
25777
+ padding-inline-start: 1px;
25778
+ }
25779
+
25780
+ .crewlet-inline-code--closed {
25781
+ padding-inline-end: 1px;
25782
+ }
25783
+
25704
25784
  /* A whole chip and the punctuation around it are one atomic box, so a line
25705
25785
  never breaks between "(" and the chip (peelPunctuation). */
25706
25786
  .crewlet-inline-code-bound {
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * A path's or an address's words with a break opportunity after every `/`,
4
+ * so a line that cannot hold it ends at a separator ("…/v1/" then "reports")
5
+ * rather than wherever the pixels ran out ("…/v1/report" then "s"). A browser
6
+ * offers none inside `https://example.com/a/b`: to a line breaker the whole
7
+ * address is one word, so without these it breaks mid-name.
8
+ *
9
+ * Only plain text is split; anything else is handed back as given. A `<wbr>`
10
+ * adds no character, so a copy of the words is the words.
11
+ */
12
+ export declare function pathBreaks(children: ReactNode): ReactNode;
@@ -6,7 +6,18 @@ export interface TableTrack {
6
6
  shrink?: boolean | undefined;
7
7
  /** The narrowest a flexible column may be drawn. */
8
8
  floor?: string | undefined;
9
+ /**
10
+ * A flexible column measured to hold only SHORT values (`SHORT_COLUMN_PX`
11
+ * at most): it is drawn at what it holds rather than taking a share.
12
+ */
13
+ short?: boolean | undefined;
9
14
  }
15
+ /**
16
+ * The widest a flexible column's values may be and still count as short: a
17
+ * seat's handle, a kind, a date. Such a column takes what it holds; a longer
18
+ * one (a name, a login, an access list) shares the room left.
19
+ */
20
+ export declare const SHORT_COLUMN_PX = 192;
10
21
  /**
11
22
  * The most of a table one `shrink` column may take: a fraction, so it is the
12
23
  * same promise on a phone and a wide screen, and two at the cap still leave
@@ -18,4 +29,4 @@ export declare const SHRINK_SHARE = 0.2;
18
29
  * content-sized column is capped with `fit-content()`, since `max-content` would
19
30
  * starve the name, and a flexible one takes the rest above its floor.
20
31
  */
21
- export declare function tableTrack({ width, shrink, floor }: TableTrack): string;
32
+ export declare function tableTrack({ width, shrink, floor, short }: TableTrack): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewlethq/ui",
3
- "version": "0.130.1",
3
+ "version": "0.131.0",
4
4
  "description": "Crewlet shared React components built on @crewlethq/tokens and @crewlethq/icons.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -42,8 +42,8 @@
42
42
  "clean": "rm -rf dist src/generated"
43
43
  },
44
44
  "dependencies": {
45
- "@crewlethq/icons": "0.130.1",
46
- "@crewlethq/tokens": "0.130.1",
45
+ "@crewlethq/icons": "0.131.0",
46
+ "@crewlethq/tokens": "0.131.0",
47
47
  "prosemirror-commands": "1.7.2",
48
48
  "prosemirror-gapcursor": "1.4.1",
49
49
  "prosemirror-history": "1.5.1",
@@ -1,5 +1,5 @@
1
- import { schema, readMarkdown, writeMarkdown } from './chunk-7CSTEH5I.js';
2
1
  import { richEditorLabels } from './chunk-2DMTW2Y3.js';
2
+ import { schema, readMarkdown, writeMarkdown } from './chunk-7CSTEH5I.js';
3
3
  import './chunk-KOJPDCGQ.js';
4
4
  import { safeHref, MARKDOWN_CALLOUT_TONES } from './chunk-KBZO4B33.js';
5
5
  import { Toolbar } from './chunk-NPEI2QAN.js';