@crewlethq/ui 0.189.0 → 0.190.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +18 -2
  2. package/dist/AgentHandoffPanel/index.js +1 -1
  3. package/dist/AgentIdentity/AgentIdentity.d.ts +19 -8
  4. package/dist/AgentIdentity/AgentIdentitySheet.d.ts +50 -0
  5. package/dist/AgentIdentity/index.d.ts +2 -2
  6. package/dist/AgentIdentity/index.js +7 -6
  7. package/dist/AgentIdentitySheet-WLJL3KT7.css +110 -0
  8. package/dist/AppShell/index.js +2 -2
  9. package/dist/AssignmentList/index.js +3 -3
  10. package/dist/CodeBlock/index.js +2 -2
  11. package/dist/ColorSwatch/index.js +3 -3
  12. package/dist/CommandPalette/index.js +5 -5
  13. package/dist/ConfirmField/index.js +3 -3
  14. package/dist/ConsequenceList/index.js +3 -3
  15. package/dist/Copyable/index.js +2 -2
  16. package/dist/{Copyable-CMT2N2JE.css → Copyable-HTJHIJ2D.css} +3 -2
  17. package/dist/DataTable/index.js +5 -5
  18. package/dist/DataView/index.js +6 -6
  19. package/dist/InlineCode/index.js +2 -2
  20. package/dist/LinkInterstitial/index.js +5 -5
  21. package/dist/Modal/index.js +4 -4
  22. package/dist/OrgTable/index.js +2 -2
  23. package/dist/ScopeList/ScopeList.d.ts +12 -3
  24. package/dist/ScopeList/index.js +2 -1
  25. package/dist/{ScopeList-564YHC7Z.css → ScopeList-4THHOZ46.css} +20 -0
  26. package/dist/ShareDialog/index.js +6 -6
  27. package/dist/Switcher/index.js +5 -5
  28. package/dist/TimeRangePicker/index.js +5 -5
  29. package/dist/ToolCallLog/index.js +2 -2
  30. package/dist/{chunk-N3VY4RNR.js → chunk-237WBIAN.js} +1 -1
  31. package/dist/{chunk-OVKHRNRD.js → chunk-2FWNVZSX.js} +129 -8
  32. package/dist/{chunk-ISM47T7P.js → chunk-33KDTRUV.js} +4 -4
  33. package/dist/{chunk-W4UJWFCZ.js → chunk-E3XKFND2.js} +1 -1
  34. package/dist/chunk-EK5NJV6K.js +110 -0
  35. package/dist/{chunk-TBHMGRN6.js → chunk-G5UBUODG.js} +1 -1
  36. package/dist/{chunk-RAPKKIMQ.js → chunk-HUZ27VZ7.js} +2 -2
  37. package/dist/{chunk-LUPO23ST.js → chunk-HWJVQFXQ.js} +1 -1
  38. package/dist/{chunk-Q3VKR72D.js → chunk-IAOROOL6.js} +1 -1
  39. package/dist/chunk-JADTOJUL.js +20 -0
  40. package/dist/{chunk-C2676ENR.js → chunk-KQTWO46B.js} +1 -1
  41. package/dist/{chunk-MMW5KBJE.js → chunk-NHQ3CXFN.js} +1 -1
  42. package/dist/{chunk-7KAWHHZW.js → chunk-R5UTN5QB.js} +1 -1
  43. package/dist/{chunk-NIPRTH7C.js → chunk-SW3JOJUV.js} +1 -1
  44. package/dist/{chunk-HZXS5CEL.js → chunk-T4JEGIUW.js} +5 -4
  45. package/dist/{chunk-VXJP2WI3.js → chunk-TIGEUFVV.js} +1 -1
  46. package/dist/{chunk-O2JB7YLM.js → chunk-U7AHXPYA.js} +1 -1
  47. package/dist/{chunk-S7MHUIJX.js → chunk-VNEUVMUR.js} +1 -1
  48. package/dist/generated/index.js +42 -41
  49. package/dist/index.js +42 -41
  50. package/dist/styles.css +108 -5
  51. package/dist/utils/groupInOrder.d.ts +13 -0
  52. package/dist/utils/pathBreaks.d.ts +5 -2
  53. package/package.json +3 -3
  54. package/dist/AgentIdentitySheet-QIOWB7XK.css +0 -28
  55. package/dist/chunk-MPVJW5M6.js +0 -92
  56. package/dist/{chunk-7V5SREXT.js → chunk-QVSG3XSW.js} +1 -1
  57. package/dist/{chunk-SETK4FN5.js → chunk-V5AZLXR4.js} +1 -1
package/dist/styles.css CHANGED
@@ -1016,7 +1016,7 @@
1016
1016
  }
1017
1017
 
1018
1018
 
1019
- /* AgentIdentitySheet-QIOWB7XK.css */
1019
+ /* AgentIdentitySheet-WLJL3KT7.css */
1020
1020
  /*
1021
1021
  * The set-up sheet's step: its parts stacked at one gap, each value to copy
1022
1022
  * after the words of its own step, and the vendor's page on a line of its own.
@@ -1046,6 +1046,88 @@
1046
1046
  margin-block-start: calc(-1 * var(--spacing-3));
1047
1047
  }
1048
1048
 
1049
+ /*
1050
+ * The checklist under the steps: a row per entry, its name and ID first and
1051
+ * its tag and link at the end, rows ruled apart. Where a row is too narrow
1052
+ * for both, the tag and link wrap under the name rather than squeeze it, and
1053
+ * on a phone every row puts them there, so the rows read alike.
1054
+ */
1055
+ .crewlet-agent-identity-sheet__entries {
1056
+ container: crewlet-agent-identity-entries / inline-size;
1057
+ display: flex;
1058
+ flex-direction: column;
1059
+ gap: var(--spacing-3);
1060
+ min-inline-size: 0;
1061
+ }
1062
+
1063
+ .crewlet-agent-identity-sheet__entry-group {
1064
+ display: flex;
1065
+ flex-direction: column;
1066
+ gap: var(--spacing-1);
1067
+ min-inline-size: 0;
1068
+ }
1069
+
1070
+ .crewlet-agent-identity-sheet__entry-group-name {
1071
+ margin: 0;
1072
+ overflow-wrap: anywhere;
1073
+ }
1074
+
1075
+ .crewlet-agent-identity-sheet__entry-rows {
1076
+ display: flex;
1077
+ flex-direction: column;
1078
+ min-inline-size: 0;
1079
+ margin: 0;
1080
+ padding: 0;
1081
+ list-style: none;
1082
+ }
1083
+
1084
+ .crewlet-agent-identity-sheet__entry {
1085
+ display: flex;
1086
+ flex-wrap: wrap;
1087
+ align-items: center;
1088
+ justify-content: space-between;
1089
+ gap: var(--spacing-2) var(--spacing-3);
1090
+ min-inline-size: 0;
1091
+ padding-block: var(--spacing-2);
1092
+ }
1093
+
1094
+ .crewlet-agent-identity-sheet__entry + .crewlet-agent-identity-sheet__entry {
1095
+ border-block-start: 1px solid var(--color-border-default);
1096
+ }
1097
+
1098
+ .crewlet-agent-identity-sheet__entry-words {
1099
+ display: flex;
1100
+ flex: 1 1 12rem;
1101
+ flex-direction: column;
1102
+ min-inline-size: 0;
1103
+ }
1104
+
1105
+ .crewlet-agent-identity-sheet__entry-name,
1106
+ .crewlet-agent-identity-sheet__entry-id {
1107
+ overflow-wrap: anywhere;
1108
+ }
1109
+
1110
+ .crewlet-agent-identity-sheet__entry-end {
1111
+ display: flex;
1112
+ flex-wrap: wrap;
1113
+ align-items: center;
1114
+ gap: var(--spacing-2);
1115
+ min-inline-size: 0;
1116
+ }
1117
+
1118
+ @container crewlet-agent-identity-entries (width < 26rem) {
1119
+ .crewlet-agent-identity-sheet__entry-words {
1120
+ flex-basis: 100%;
1121
+ }
1122
+ }
1123
+
1124
+ .crewlet-agent-identity-sheet__wider-links {
1125
+ display: flex;
1126
+ flex-wrap: wrap;
1127
+ gap: var(--spacing-2);
1128
+ margin-block-start: var(--spacing-2);
1129
+ }
1130
+
1049
1131
 
1050
1132
  /* AppShell-4BFYBNNQ.css */
1051
1133
  /*
@@ -16176,7 +16258,7 @@ button.crewlet-histogram__bar[data-empty]:focus-visible > .crewlet-histogram__fi
16176
16258
  }
16177
16259
 
16178
16260
 
16179
- /* Copyable-CMT2N2JE.css */
16261
+ /* Copyable-HTJHIJ2D.css */
16180
16262
  /*
16181
16263
  * Copyable: a value and the IconButton that copies it, as a `chip` (a pill for
16182
16264
  * a table cell), `inline` (in a detail row), `compact` (in a sentence) or
@@ -16333,8 +16415,9 @@ button.crewlet-histogram__bar[data-empty]:focus-visible > .crewlet-histogram__fi
16333
16415
  }
16334
16416
 
16335
16417
  /*
16336
- * A path breaks after each `/` (the component offers the breaks); an opaque
16337
- * value, one run with no space and no `/`, breaks at any character.
16418
+ * A path or an address breaks after each `/`, `@` and `.` (the component
16419
+ * offers the breaks); an opaque value, one run with no space and none of
16420
+ * those, breaks at any character.
16338
16421
  */
16339
16422
  .crewlet-copyable--opaque .crewlet-copyable__value {
16340
16423
  word-break: break-all;
@@ -38521,7 +38604,7 @@ button.crewlet-presence-stack__member:focus-visible {
38521
38604
  }
38522
38605
 
38523
38606
 
38524
- /* ScopeList-564YHC7Z.css */
38607
+ /* ScopeList-4THHOZ46.css */
38525
38608
  /*
38526
38609
  * The things an agent may reach, a row each: the box and the name first, a
38527
38610
  * detail quiet under the name, the ID quiet at the row's end. A chosen row
@@ -38557,6 +38640,26 @@ button.crewlet-presence-stack__member:focus-visible {
38557
38640
  list-style: none;
38558
38641
  }
38559
38642
 
38643
+ /* A group's rows under its name, the name on the rows' own inset. */
38644
+ .crewlet-scope-list__group {
38645
+ display: flex;
38646
+ flex-direction: column;
38647
+ gap: var(--spacing-1);
38648
+ min-inline-size: 0;
38649
+ }
38650
+
38651
+ /* A section between groups, so each name reads as the head of the rows under it. */
38652
+ .crewlet-scope-list__group + .crewlet-scope-list__group,
38653
+ .crewlet-scope-list__rows + .crewlet-scope-list__group {
38654
+ margin-block-start: var(--spacing-2);
38655
+ }
38656
+
38657
+ .crewlet-scope-list__group-name {
38658
+ margin: 0;
38659
+ padding-inline-start: var(--spacing-3);
38660
+ overflow-wrap: anywhere;
38661
+ }
38662
+
38560
38663
  .crewlet-scope-list__row {
38561
38664
  display: flex;
38562
38665
  align-items: flex-start;
@@ -0,0 +1,13 @@
1
+ /** One run of items under one group name; `name` is undefined for the items that name none. */
2
+ export interface GroupRun<T> {
3
+ name: string | undefined;
4
+ items: T[];
5
+ }
6
+ /**
7
+ * Items gathered by their `group`, one run per group in the order each group
8
+ * first appears, with the items that name no group first. Within a run the
9
+ * items keep their own order.
10
+ */
11
+ export declare function groupInOrder<T extends {
12
+ group?: string | undefined;
13
+ }>(items: readonly T[]): GroupRun<T>[];
@@ -1,7 +1,10 @@
1
1
  import { type ReactNode } from 'react';
2
2
  /**
3
- * A path's or address's words with a `<wbr>` after every `/`, so a long one
3
+ * A path's or address's words with a `<wbr>` after every `/` (and, with
4
+ * `addresses`, every `@` and `.` of an email or a host name), so a long one
4
5
  * breaks at a separator rather than mid-name. Only plain text is split, and a
5
6
  * copy of the words is unchanged.
6
7
  */
7
- export declare function pathBreaks(children: ReactNode): ReactNode;
8
+ export declare function pathBreaks(children: ReactNode, { addresses }?: {
9
+ addresses?: boolean;
10
+ }): ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewlethq/ui",
3
- "version": "0.189.0",
3
+ "version": "0.190.1",
4
4
  "description": "Crewlet shared React components built on @crewlethq/tokens and @crewlethq/icons.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,8 +43,8 @@
43
43
  "clean": "rm -rf dist src/generated"
44
44
  },
45
45
  "dependencies": {
46
- "@crewlethq/icons": "0.189.0",
47
- "@crewlethq/tokens": "0.189.0",
46
+ "@crewlethq/icons": "0.190.1",
47
+ "@crewlethq/tokens": "0.190.1",
48
48
  "prosemirror-commands": "1.7.2",
49
49
  "prosemirror-gapcursor": "1.4.1",
50
50
  "prosemirror-history": "1.5.1",
@@ -1,28 +0,0 @@
1
- /*
2
- * The set-up sheet's step: its parts stacked at one gap, each value to copy
3
- * after the words of its own step, and the vendor's page on a line of its own.
4
- */
5
- .crewlet-agent-identity-sheet__step {
6
- display: flex;
7
- flex-direction: column;
8
- gap: var(--spacing-3);
9
- min-inline-size: 0;
10
- }
11
-
12
- .crewlet-agent-identity-sheet__link {
13
- display: flex;
14
- }
15
-
16
- .crewlet-agent-identity-sheet__note {
17
- margin: 0;
18
- }
19
-
20
- /*
21
- * The step takes focus when it changes, and keeps the browser's own focus
22
- * treatment: after a press nothing is drawn, after a key the ring shows where
23
- * the reader now is. The verdict's live region stays in the tree while empty,
24
- * so a screen reader hears what fills it; empty, it takes back the gap before it.
25
- */
26
- .crewlet-agent-identity-sheet__verdict:empty {
27
- margin-block-start: calc(-1 * var(--spacing-3));
28
- }
@@ -1,92 +0,0 @@
1
- import { Text } from './chunk-475DOAWF.js';
2
- import { Checkbox } from './chunk-2DESFB7K.js';
3
- import { Button } from './chunk-YVMIT2OW.js';
4
- import { Input } from './chunk-ZR276S44.js';
5
- import { VisuallyHidden } from './chunk-RRRK2KB6.js';
6
- import { cx } from './chunk-ODEQTPFM.js';
7
- import './ScopeList-564YHC7Z.css';
8
- import { useId, useState } from 'react';
9
- import { SearchGlyph } from '@crewlethq/icons/glyphs';
10
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
11
-
12
- var SCOPE_LIST_LABELS = {
13
- chosen: (chosen, of) => `${chosen.toLocaleString()} of ${of.toLocaleString()} chosen`,
14
- chooseAll: "Choose all",
15
- clear: "Clear",
16
- find: "Find by name or ID",
17
- noMatch: (term) => `Nothing matches \u201C${term}\u201D.`,
18
- none: "Nothing to choose from."
19
- };
20
- function ScopeList({
21
- label,
22
- options,
23
- value,
24
- onChange,
25
- searchFrom = 8,
26
- bulk = true,
27
- labels: overrides,
28
- className
29
- }) {
30
- const labels = { ...SCOPE_LIST_LABELS, ...overrides };
31
- const base = useId();
32
- const [term, setTerm] = useState("");
33
- const chosen = new Set(value);
34
- const searchable = options.length >= searchFrom;
35
- const find = searchable ? term.trim().toLowerCase() : "";
36
- const shown = find ? options.filter((o) => `${o.label} ${o.detail ?? ""} ${o.id ?? ""} ${o.value}`.toLowerCase().includes(find)) : options;
37
- const open = shown.filter((o) => !o.disabled);
38
- const allShown = open.length > 0 && open.every((o) => chosen.has(o.value));
39
- const toggleShown = () => {
40
- if (allShown) {
41
- const off = new Set(open.map((o) => o.value));
42
- onChange(value.filter((v) => !off.has(v)));
43
- } else {
44
- onChange([...value, ...open.map((o) => o.value).filter((v) => !chosen.has(v))]);
45
- }
46
- };
47
- const count = options.filter((o) => chosen.has(o.value)).length;
48
- return /* @__PURE__ */ jsxs("fieldset", { className: cx("crewlet-scope-list", className), children: [
49
- /* @__PURE__ */ jsx(VisuallyHidden, { as: "legend", children: label }),
50
- bulk ? /* @__PURE__ */ jsxs("div", { className: "crewlet-scope-list__bar", children: [
51
- /* @__PURE__ */ jsx(Text, { variant: "caption", tone: "secondary", children: labels.chosen(count, options.length) }),
52
- /* @__PURE__ */ jsx(Button, { size: "small", variant: "ghost", disabled: open.length === 0, onClick: toggleShown, children: allShown ? labels.clear : labels.chooseAll })
53
- ] }) : null,
54
- searchable ? /* @__PURE__ */ jsx(
55
- Input,
56
- {
57
- type: "search",
58
- "aria-label": labels.find,
59
- placeholder: labels.find,
60
- inputSize: "sm",
61
- width: "full",
62
- leading: /* @__PURE__ */ jsx(SearchGlyph, { size: "sm" }),
63
- value: term,
64
- onChange: (e) => setTerm(e.target.value)
65
- }
66
- ) : null,
67
- shown.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "crewlet-scope-list__rows", children: shown.map((o, i) => {
68
- const on = chosen.has(o.value);
69
- const idId = o.id && o.id !== o.label ? `${base}-id-${i}` : void 0;
70
- return /* @__PURE__ */ jsxs("li", { className: "crewlet-scope-list__row", "data-chosen": on || void 0, children: [
71
- /* @__PURE__ */ jsx(
72
- Checkbox,
73
- {
74
- className: "crewlet-scope-list__check",
75
- label: o.label,
76
- description: o.detail || o.disabled && o.disabledReason ? /* @__PURE__ */ jsxs(Fragment, { children: [
77
- o.detail ? /* @__PURE__ */ jsx("span", { className: "crewlet-scope-list__detail", children: o.detail }) : null,
78
- o.disabled && o.disabledReason ? /* @__PURE__ */ jsx("span", { children: o.disabledReason }) : null
79
- ] }) : void 0,
80
- checked: on,
81
- disabled: o.disabled,
82
- "aria-describedby": idId,
83
- onCheckedChange: (next) => onChange(next ? [...value, o.value] : value.filter((v) => v !== o.value))
84
- }
85
- ),
86
- idId ? /* @__PURE__ */ jsx(Text, { id: idId, variant: "caption", tone: "tertiary", mono: true, className: "crewlet-scope-list__id", children: o.id }) : null
87
- ] }, o.value);
88
- }) }) : /* @__PURE__ */ jsx(Text, { as: "p", variant: "caption", tone: "secondary", className: "crewlet-scope-list__empty", children: find ? labels.noMatch(term.trim()) : labels.none })
89
- ] });
90
- }
91
-
92
- export { SCOPE_LIST_LABELS, ScopeList };
@@ -1,9 +1,9 @@
1
1
  import { releaseFocus, usePresence } from './chunk-SNKQNAJI.js';
2
2
  import { useRailShape, RailShapeContext, RailLeavingContext } from './chunk-JLOESTT2.js';
3
3
  import { Menu } from './chunk-43N4EHFR.js';
4
- import { isApplePlatform, ariaKeyshortcuts, Kbd } from './chunk-VBBLHS2Y.js';
5
4
  import { PeekContext, AsideContext } from './chunk-MBEZOURR.js';
6
5
  import { ResizeHandle, clampSize } from './chunk-FQ6J4DK7.js';
6
+ import { isApplePlatform, ariaKeyshortcuts, Kbd } from './chunk-VBBLHS2Y.js';
7
7
  import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
8
8
  import { useMediaMatch } from './chunk-COS6LJ4K.js';
9
9
  import { IconButton } from './chunk-66H4BC5Z.js';
@@ -1,8 +1,8 @@
1
1
  import { TreeGrid } from './chunk-2OYEVTF4.js';
2
2
  import { OrgLabel } from './chunk-BZLQHZKH.js';
3
3
  import { createTreeModel, treeParent } from './chunk-MY374UUD.js';
4
- import { AddPill } from './chunk-EHRNLV3D.js';
5
4
  import { IconButton } from './chunk-66H4BC5Z.js';
5
+ import { AddPill } from './chunk-EHRNLV3D.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
7
7
  import './OrgTable-73WNQCH3.css';
8
8
  import { useMemo, useRef, useImperativeHandle, useCallback } from 'react';