@graview/primitives 0.1.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 (207) hide show
  1. package/LICENSE +96 -0
  2. package/README.md +25 -0
  3. package/dist/arrange-bar.d.ts +49 -0
  4. package/dist/arrange-bar.d.ts.map +1 -0
  5. package/dist/arrange-bar.js +264 -0
  6. package/dist/arrange-bar.js.map +1 -0
  7. package/dist/chat.d.ts +46 -0
  8. package/dist/chat.d.ts.map +1 -0
  9. package/dist/chat.js +343 -0
  10. package/dist/chat.js.map +1 -0
  11. package/dist/companion.d.ts +58 -0
  12. package/dist/companion.d.ts.map +1 -0
  13. package/dist/companion.js +433 -0
  14. package/dist/companion.js.map +1 -0
  15. package/dist/connections.d.ts +23 -0
  16. package/dist/connections.d.ts.map +1 -0
  17. package/dist/connections.js +100 -0
  18. package/dist/connections.js.map +1 -0
  19. package/dist/default-views.d.ts +35 -0
  20. package/dist/default-views.d.ts.map +1 -0
  21. package/dist/default-views.js +605 -0
  22. package/dist/default-views.js.map +1 -0
  23. package/dist/editable.d.ts +71 -0
  24. package/dist/editable.d.ts.map +1 -0
  25. package/dist/editable.js +225 -0
  26. package/dist/editable.js.map +1 -0
  27. package/dist/figure.d.ts +30 -0
  28. package/dist/figure.d.ts.map +1 -0
  29. package/dist/figure.js +66 -0
  30. package/dist/figure.js.map +1 -0
  31. package/dist/find.d.ts +5 -0
  32. package/dist/find.d.ts.map +1 -0
  33. package/dist/find.js +252 -0
  34. package/dist/find.js.map +1 -0
  35. package/dist/index.d.ts +51 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +44 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/installation.d.ts +17 -0
  40. package/dist/installation.d.ts.map +1 -0
  41. package/dist/installation.js +37 -0
  42. package/dist/installation.js.map +1 -0
  43. package/dist/ladder.d.ts +2 -0
  44. package/dist/ladder.d.ts.map +1 -0
  45. package/dist/ladder.js +53 -0
  46. package/dist/ladder.js.map +1 -0
  47. package/dist/lens/arranging.d.ts +41 -0
  48. package/dist/lens/arranging.d.ts.map +1 -0
  49. package/dist/lens/arranging.js +38 -0
  50. package/dist/lens/arranging.js.map +1 -0
  51. package/dist/lens/board.d.ts +146 -0
  52. package/dist/lens/board.d.ts.map +1 -0
  53. package/dist/lens/board.js +658 -0
  54. package/dist/lens/board.js.map +1 -0
  55. package/dist/lens/calendar-dates.d.ts +19 -0
  56. package/dist/lens/calendar-dates.d.ts.map +1 -0
  57. package/dist/lens/calendar-dates.js +55 -0
  58. package/dist/lens/calendar-dates.js.map +1 -0
  59. package/dist/lens/calendar-drawing.d.ts +59 -0
  60. package/dist/lens/calendar-drawing.d.ts.map +1 -0
  61. package/dist/lens/calendar-drawing.js +229 -0
  62. package/dist/lens/calendar-drawing.js.map +1 -0
  63. package/dist/lens/calendar-options.d.ts +107 -0
  64. package/dist/lens/calendar-options.d.ts.map +1 -0
  65. package/dist/lens/calendar-options.js +19 -0
  66. package/dist/lens/calendar-options.js.map +1 -0
  67. package/dist/lens/calendar-placing.d.ts +35 -0
  68. package/dist/lens/calendar-placing.d.ts.map +1 -0
  69. package/dist/lens/calendar-placing.js +113 -0
  70. package/dist/lens/calendar-placing.js.map +1 -0
  71. package/dist/lens/calendar-spans.d.ts +48 -0
  72. package/dist/lens/calendar-spans.d.ts.map +1 -0
  73. package/dist/lens/calendar-spans.js +146 -0
  74. package/dist/lens/calendar-spans.js.map +1 -0
  75. package/dist/lens/calendar-view.d.ts +34 -0
  76. package/dist/lens/calendar-view.d.ts.map +1 -0
  77. package/dist/lens/calendar-view.js +228 -0
  78. package/dist/lens/calendar-view.js.map +1 -0
  79. package/dist/lens/calendar.d.ts +43 -0
  80. package/dist/lens/calendar.d.ts.map +1 -0
  81. package/dist/lens/calendar.js +43 -0
  82. package/dist/lens/calendar.js.map +1 -0
  83. package/dist/lens/coverage.d.ts +183 -0
  84. package/dist/lens/coverage.d.ts.map +1 -0
  85. package/dist/lens/coverage.js +732 -0
  86. package/dist/lens/coverage.js.map +1 -0
  87. package/dist/lens/horizon.d.ts +14 -0
  88. package/dist/lens/horizon.d.ts.map +1 -0
  89. package/dist/lens/horizon.js +20 -0
  90. package/dist/lens/horizon.js.map +1 -0
  91. package/dist/lens/more.d.ts +16 -0
  92. package/dist/lens/more.d.ts.map +1 -0
  93. package/dist/lens/more.js +17 -0
  94. package/dist/lens/more.js.map +1 -0
  95. package/dist/lens/plan-lens.d.ts +17 -0
  96. package/dist/lens/plan-lens.d.ts.map +1 -0
  97. package/dist/lens/plan-lens.js +24 -0
  98. package/dist/lens/plan-lens.js.map +1 -0
  99. package/dist/lens/plan-state.d.ts +122 -0
  100. package/dist/lens/plan-state.d.ts.map +1 -0
  101. package/dist/lens/plan-state.js +152 -0
  102. package/dist/lens/plan-state.js.map +1 -0
  103. package/dist/lens/plan-view.d.ts +10 -0
  104. package/dist/lens/plan-view.d.ts.map +1 -0
  105. package/dist/lens/plan-view.js +576 -0
  106. package/dist/lens/plan-view.js.map +1 -0
  107. package/dist/lens/plan.d.ts +25 -0
  108. package/dist/lens/plan.d.ts.map +1 -0
  109. package/dist/lens/plan.js +25 -0
  110. package/dist/lens/plan.js.map +1 -0
  111. package/dist/lens/reach.d.ts +47 -0
  112. package/dist/lens/reach.d.ts.map +1 -0
  113. package/dist/lens/reach.js +67 -0
  114. package/dist/lens/reach.js.map +1 -0
  115. package/dist/lens/timeline.d.ts +137 -0
  116. package/dist/lens/timeline.d.ts.map +1 -0
  117. package/dist/lens/timeline.js +426 -0
  118. package/dist/lens/timeline.js.map +1 -0
  119. package/dist/markup.d.ts +23 -0
  120. package/dist/markup.d.ts.map +1 -0
  121. package/dist/markup.js +24 -0
  122. package/dist/markup.js.map +1 -0
  123. package/dist/places.d.ts +24 -0
  124. package/dist/places.d.ts.map +1 -0
  125. package/dist/places.js +227 -0
  126. package/dist/places.js.map +1 -0
  127. package/dist/popover.d.ts +28 -0
  128. package/dist/popover.d.ts.map +1 -0
  129. package/dist/popover.js +59 -0
  130. package/dist/popover.js.map +1 -0
  131. package/dist/primitives/index.d.ts +214 -0
  132. package/dist/primitives/index.d.ts.map +1 -0
  133. package/dist/primitives/index.js +381 -0
  134. package/dist/primitives/index.js.map +1 -0
  135. package/dist/profile.d.ts +65 -0
  136. package/dist/profile.d.ts.map +1 -0
  137. package/dist/profile.js +233 -0
  138. package/dist/profile.js.map +1 -0
  139. package/dist/quick-relations.d.ts +16 -0
  140. package/dist/quick-relations.d.ts.map +1 -0
  141. package/dist/quick-relations.js +183 -0
  142. package/dist/quick-relations.js.map +1 -0
  143. package/dist/relation-key.d.ts +44 -0
  144. package/dist/relation-key.d.ts.map +1 -0
  145. package/dist/relation-key.js +196 -0
  146. package/dist/relation-key.js.map +1 -0
  147. package/dist/seat.d.ts +137 -0
  148. package/dist/seat.d.ts.map +1 -0
  149. package/dist/seat.js +162 -0
  150. package/dist/seat.js.map +1 -0
  151. package/dist/seats.d.ts +21 -0
  152. package/dist/seats.d.ts.map +1 -0
  153. package/dist/seats.js +62 -0
  154. package/dist/seats.js.map +1 -0
  155. package/dist/seeding.d.ts +150 -0
  156. package/dist/seeding.d.ts.map +1 -0
  157. package/dist/seeding.js +538 -0
  158. package/dist/seeding.js.map +1 -0
  159. package/dist/shell.d.ts +74 -0
  160. package/dist/shell.d.ts.map +1 -0
  161. package/dist/shell.js +86 -0
  162. package/dist/shell.js.map +1 -0
  163. package/dist/theme.d.ts +50 -0
  164. package/dist/theme.d.ts.map +1 -0
  165. package/dist/theme.js +1692 -0
  166. package/dist/theme.js.map +1 -0
  167. package/dist/wordmark.d.ts +15 -0
  168. package/dist/wordmark.d.ts.map +1 -0
  169. package/dist/wordmark.js +55 -0
  170. package/dist/wordmark.js.map +1 -0
  171. package/dist/workbench/activity.d.ts +75 -0
  172. package/dist/workbench/activity.d.ts.map +1 -0
  173. package/dist/workbench/activity.js +259 -0
  174. package/dist/workbench/activity.js.map +1 -0
  175. package/dist/workbench/agent-seat.d.ts +51 -0
  176. package/dist/workbench/agent-seat.d.ts.map +1 -0
  177. package/dist/workbench/agent-seat.js +112 -0
  178. package/dist/workbench/agent-seat.js.map +1 -0
  179. package/dist/workbench/answer-args.d.ts +31 -0
  180. package/dist/workbench/answer-args.d.ts.map +1 -0
  181. package/dist/workbench/answer-args.js +257 -0
  182. package/dist/workbench/answer-args.js.map +1 -0
  183. package/dist/workbench/back-out.d.ts +71 -0
  184. package/dist/workbench/back-out.d.ts.map +1 -0
  185. package/dist/workbench/back-out.js +238 -0
  186. package/dist/workbench/back-out.js.map +1 -0
  187. package/dist/workbench/following.d.ts +7 -0
  188. package/dist/workbench/following.d.ts.map +1 -0
  189. package/dist/workbench/following.js +26 -0
  190. package/dist/workbench/following.js.map +1 -0
  191. package/dist/workbench/index.d.ts +23 -0
  192. package/dist/workbench/index.d.ts.map +1 -0
  193. package/dist/workbench/index.js +23 -0
  194. package/dist/workbench/index.js.map +1 -0
  195. package/dist/workbench/inspector.d.ts +27 -0
  196. package/dist/workbench/inspector.d.ts.map +1 -0
  197. package/dist/workbench/inspector.js +745 -0
  198. package/dist/workbench/inspector.js.map +1 -0
  199. package/dist/workbench/standing.d.ts +16 -0
  200. package/dist/workbench/standing.d.ts.map +1 -0
  201. package/dist/workbench/standing.js +102 -0
  202. package/dist/workbench/standing.js.map +1 -0
  203. package/dist/workbench/trail.d.ts +35 -0
  204. package/dist/workbench/trail.d.ts.map +1 -0
  205. package/dist/workbench/trail.js +150 -0
  206. package/dist/workbench/trail.js.map +1 -0
  207. package/package.json +62 -0
package/dist/places.js ADDED
@@ -0,0 +1,227 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { aggregateId, withFocus, withOverview, withWithin } from "@graview/layout";
3
+ import { useGraview, useNavigation } from "@graview/react";
4
+ import { useLayoutEffect, useRef, useState } from "react";
5
+ /**
6
+ * THE NAMED PLACES, as pills.
7
+ *
8
+ * A group view registered with a title is somewhere to go: "Who tends what"
9
+ * over the gardeners, "What grows where" over the plots. Each pill is the
10
+ * stop that shows it — the group in focus, on the ground — and is pressed
11
+ * while you are there. Nothing renders for an app with no named places, so
12
+ * the bar of an app that never registered a lens is exactly as it was.
13
+ *
14
+ * This exists because a lens was only reachable by focusing the group it
15
+ * was registered on: click into one member and the picture was gone, with
16
+ * nothing on the screen to say it had ever been there.
17
+ */
18
+ /**
19
+ * The named pictures over the graph, as pills — or, `compact`, as one
20
+ * select. Eight pills wrapped to four rows on a phone-width embed and took
21
+ * half its height before the picture began; a select says the same eight
22
+ * places in one row and opens to the same stops.
23
+ */
24
+ export function Places({ compact = false } = {}) {
25
+ const { views, hiddenKinds } = useGraview();
26
+ const { view, go } = useNavigation();
27
+ /*
28
+ * A PLACE OVER A KIND THIS SEAT CANNOT SEE IS A DOOR TO AN EMPTY ROOM.
29
+ *
30
+ * The reach lens registered over the people is "Who may do what" — a
31
+ * picture of the installation, named on the bar. A member may not
32
+ * administer the installation, so its kinds are not drawn for them
33
+ * anywhere; the pill was drawn anyway, and pressing it focused a district
34
+ * that is not there. The kinds a seat is kept from are already worked out
35
+ * once, for the scene and the shelf; the bar reads the same answer.
36
+ */
37
+ const places = views.places().filter((place) => !hiddenKinds.has(place.kind));
38
+ /* Hooks first, before any early return: a bar whose places arrive a
39
+ render later must not change how many hooks it calls. */
40
+ const row = useRef(null);
41
+ // The pills, measured each time the row is fitted (their widths change when the font arrives).
42
+ const pills = useRef([]);
43
+ const more = useRef(null);
44
+ const [shown, setShown] = useState(places.length);
45
+ const MORE = 92;
46
+ /* Which place you are on, so the menu keeps room for its name when it holds it. */
47
+ const current = places.findIndex((place) => !view.overview &&
48
+ view.focusId === aggregateId(place.kind) &&
49
+ (view.within?.["view"] === undefined
50
+ ? places.filter((other) => other.kind === place.kind).at(-1)?.as === place.as
51
+ : view.within["view"] === place.as));
52
+ useLayoutEffect(() => {
53
+ const element = row.current;
54
+ if (!element || typeof ResizeObserver === "undefined")
55
+ return;
56
+ const measure = () => {
57
+ // The ROOM is the region the row stands in, not the row's own width:
58
+ // the row shrinks to what it shows, and measuring it could only ever
59
+ // agree with what was already shown.
60
+ const room = (element.parentElement ?? element).getBoundingClientRect().width - 8;
61
+ /*
62
+ * READ NOW, NOT WHEN THE PILL MOUNTED. The widths were taken in each
63
+ * pill's ref as it mounted — in the fallback face, before the brand's
64
+ * font arrived — and the font made every pill wider without making the
65
+ * row fit again: seedbed's places ran seven pixels past their edge on
66
+ * every screen measured early, and a fix to the reserve below did not
67
+ * touch it. The pills are measured on each fit, and watched.
68
+ */
69
+ const sizes = pills.current.map((pill) => pill?.getBoundingClientRect().width ?? 0);
70
+ /*
71
+ * AND THE MENU AS IT IS DRAWN. Standing on a place the menu holds, the
72
+ * menu shows that place's name in a select's padding and chevron —
73
+ * 144 pixels for "The rotation", whose pill is 106 — and the 14 kept
74
+ * for it was a guess that ran the row seven pixels past its edge. Where
75
+ * the menu is showing a held place, what it adds to that place's pill
76
+ * is measured; until then, forty.
77
+ */
78
+ const menu = more.current;
79
+ const showing = menu ? places.findIndex((place) => `${place.kind}:${place.as}` === menu.value) : -1;
80
+ const chrome = menu && showing >= 0 && sizes[showing] ? Math.max(14, menu.getBoundingClientRect().width - sizes[showing]) : 40;
81
+ if (pills.current.filter(Boolean).length < places.length)
82
+ return;
83
+ let used = 0;
84
+ let fit = 0;
85
+ for (let i = 0; i < places.length; i += 1) {
86
+ const next = used + (sizes[i] ?? 0) + (i > 0 ? 2 : 0);
87
+ /*
88
+ * THE MORE MENU IS AS WIDE AS WHAT IT SAYS. Standing on a place it
89
+ * holds, the select shows that place's name, not "+2 more" — and
90
+ * "The rotation" is wider than the 92 pixels kept for it, so the
91
+ * row ran seven pixels past its own edge. Keep room for the name of
92
+ * the place you are on when it would be in the menu; otherwise the
93
+ * menu says "+N more", and 92 holds that.
94
+ */
95
+ const reserve = i < places.length - 1 ? Math.max(MORE, current > i ? (sizes[current] ?? 0) + chrome : 0) : 0;
96
+ if (next + reserve > room)
97
+ break;
98
+ used = next;
99
+ fit = i + 1;
100
+ }
101
+ setShown((was) => (was === fit ? was : fit));
102
+ };
103
+ measure();
104
+ const watch = new ResizeObserver(measure);
105
+ watch.observe(element.parentElement ?? element);
106
+ for (const pill of pills.current)
107
+ if (pill)
108
+ watch.observe(pill);
109
+ if (more.current)
110
+ watch.observe(more.current);
111
+ return () => watch.disconnect();
112
+ }, [places.length, current]);
113
+ if (places.length === 0)
114
+ return null;
115
+ /*
116
+ * Which picture a group draws when the address names none: the LAST
117
+ * registration for the cell, because that is what the registry resolves
118
+ * to and a pill must agree with what is actually on screen.
119
+ */
120
+ const isDefault = (all, place) => all.filter((other) => other.kind === place.kind).at(-1)?.as === place.as;
121
+ const showing = view.within?.["view"];
122
+ const isHere = (place) => !view.overview &&
123
+ view.focusId === aggregateId(place.kind) &&
124
+ (showing === undefined ? isDefault(places, place) : showing === place.as);
125
+ const goTo = (place) => go(withWithin(withOverview(withFocus(view, aggregateId(place.kind)), false), "view", place.as));
126
+ if (compact) {
127
+ const here = places.find(isHere);
128
+ return (_jsxs("select", { "aria-label": "Places", "data-testid": "places", value: here ? `${here.kind}:${here.as}` : "", onChange: (event) => {
129
+ const place = places.find((candidate) => `${candidate.kind}:${candidate.as}` === event.target.value);
130
+ if (place)
131
+ goTo(place);
132
+ }, style: {
133
+ minHeight: 28,
134
+ maxWidth: "100%",
135
+ padding: "3px 8px",
136
+ borderRadius: 999,
137
+ fontSize: "0.875rem",
138
+ borderWidth: 1,
139
+ borderStyle: "solid",
140
+ borderColor: here ? "var(--graview-accent)" : "var(--graview-edge)",
141
+ color: here ? "var(--graview-accent)" : "var(--graview-ink-muted)",
142
+ backgroundColor: "var(--graview-panel)",
143
+ // WebKit ignores the floor on a native select (W-121): the look off, a chevron drawn.
144
+ paddingRight: 24,
145
+ appearance: "none",
146
+ WebkitAppearance: "none",
147
+ backgroundImage: "linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%)",
148
+ backgroundPosition: "calc(100% - 13px) 55%, calc(100% - 9px) 55%",
149
+ backgroundSize: "4px 4px, 4px 4px",
150
+ backgroundRepeat: "no-repeat",
151
+ }, children: [_jsx("option", { value: "", children: "Places\u2026" }), places.map((place) => (_jsx("option", { value: `${place.kind}:${place.as}`, "data-place-kind": place.kind, children: place.title }, `${place.kind}:${place.as}`)))] }));
152
+ }
153
+ /*
154
+ * ONE ROW, WHATEVER THE WIDTH. The places are the app's own navigation
155
+ * and read as one control — a segmented row with the current picture
156
+ * filled — rather than a run of loose pills. What the row cannot hold
157
+ * goes into a "More" menu at its end instead of wrapping the bar into a
158
+ * second line: the bar is one line, and the picture starts under it.
159
+ */
160
+ const rest = places.slice(shown);
161
+ const restHere = rest.find(isHere);
162
+ return (_jsxs("nav", { ref: row, "aria-label": "Places", "data-testid": "places", style: {
163
+ position: "relative",
164
+ display: "flex",
165
+ alignItems: "center",
166
+ gap: 2,
167
+ padding: 3,
168
+ minWidth: 0,
169
+ maxWidth: "100%",
170
+ borderRadius: 999,
171
+ border: "1px solid var(--graview-edge)",
172
+ background: "var(--graview-panel-muted)",
173
+ overflow: "hidden",
174
+ }, children: [places.map((place, index) => {
175
+ const here = isHere(place);
176
+ return (_jsx("button", { ref: (el) => {
177
+ pills.current[index] = el;
178
+ }, type: "button", "aria-pressed": here, "data-testid": `place-${place.as}`, "data-place-kind": place.kind, title: `${place.title} — a picture over the ${place.kind}s`, onClick: () => goTo(place), style: {
179
+ // A full fingertip whatever the brand's line height: Groundskeeper's
180
+ // pills measured 22px and its audit counted every one.
181
+ minHeight: 28,
182
+ padding: "3px 13px",
183
+ borderRadius: 999,
184
+ fontSize: "0.875rem",
185
+ fontWeight: here ? 600 : 500,
186
+ borderWidth: 1,
187
+ borderStyle: "solid",
188
+ boxShadow: "none",
189
+ whiteSpace: "nowrap",
190
+ flex: "0 0 auto",
191
+ color: here ? "var(--graview-ink)" : "var(--graview-ink-muted)",
192
+ background: here ? "var(--graview-panel)" : "transparent",
193
+ borderColor: here ? "var(--graview-edge)" : "transparent",
194
+ // Measured at full width, then parked off the row's left edge
195
+ // if the row cannot hold it: still measurable, never part of
196
+ // anything's scrollable overflow (which only extends rightward),
197
+ // so no box on the bar reads as cut.
198
+ ...(index >= shown ? { position: "absolute", left: -9999, top: 0, visibility: "hidden" } : {}),
199
+ }, children: place.title }, `${place.kind}:${place.as}`));
200
+ }), rest.length > 0 ? (_jsxs("select", { ref: more, "aria-label": "More places", "data-testid": "places-more", value: restHere ? `${restHere.kind}:${restHere.as}` : "", onChange: (event) => {
201
+ const place = rest.find((candidate) => `${candidate.kind}:${candidate.as}` === event.target.value);
202
+ if (place)
203
+ goTo(place);
204
+ }, style: {
205
+ minHeight: 28,
206
+ padding: "3px 22px 3px 12px",
207
+ borderRadius: 999,
208
+ fontSize: "0.875rem",
209
+ fontWeight: restHere ? 600 : 500,
210
+ borderWidth: 1,
211
+ borderStyle: "solid",
212
+ flex: "0 0 auto",
213
+ color: restHere ? "var(--graview-ink)" : "var(--graview-ink-muted)",
214
+ // backgroundColor, not background: the shorthand beside the chevron's
215
+ // backgroundImage and friends is overwritten by them on every change of place.
216
+ backgroundColor: restHere ? "var(--graview-panel)" : "transparent",
217
+ // The browser's own arrow is wide and grey; a small chevron of the text's colour instead.
218
+ appearance: "none",
219
+ WebkitAppearance: "none",
220
+ backgroundImage: "linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%)",
221
+ backgroundPosition: "calc(100% - 13px) 55%, calc(100% - 9px) 55%",
222
+ backgroundSize: "4px 4px, 4px 4px",
223
+ backgroundRepeat: "no-repeat",
224
+ borderColor: restHere ? "var(--graview-edge)" : "transparent",
225
+ }, children: [_jsx("option", { value: "", children: restHere ? restHere.title : `+${rest.length} more` }), rest.map((place) => (_jsx("option", { value: `${place.kind}:${place.as}`, children: place.title }, `${place.kind}:${place.as}`)))] })) : null] }));
226
+ }
227
+ //# sourceMappingURL=places.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,OAAO,GAAU,EAC7E,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACnB,iBAA0C,KAAK,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE,YACzE,KAAK,CAAC,KAAK,IADD,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE,CAE/B,CACV,CAAC,IACK,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * CLOSE A POPOVER AND GIVE THE KEYBOARD BACK TO WHAT OPENED IT.
3
+ *
4
+ * Every popover on the bar closes on Escape, and every one of them left the
5
+ * keyboard where it was — on a control inside the pane it had just taken
6
+ * away. A removed or hidden element takes focus to <body>, so pressing
7
+ * Escape after "undo" in the activity list put somebody working from the
8
+ * keyboard at the top of the document, and in WebKit the next Tab went
9
+ * nowhere at all. The button that opened the popover is where the keyboard
10
+ * came from, and it is still there.
11
+ *
12
+ * `anchor` holds the trigger (the element with `aria-expanded`) and the
13
+ * pane; the keyboard is moved only when it was inside the pane, so a press
14
+ * that opened the popover and closed it again stays exactly where it was.
15
+ */
16
+ export declare function closeToTrigger(anchor: HTMLElement | null, close: () => void): void;
17
+ /**
18
+ * A POPOVER STAYS IN THE BOX IT OPENED IN.
19
+ *
20
+ * On somebody else's page the app is one element with `overflow: hidden`,
21
+ * and a pane anchored to its button's right edge, 280 pixels wide, opened
22
+ * from a button near the element's left side ran off it: the profile's
23
+ * settings were cut in half at 1280 and began off the screen at 390. When
24
+ * the pane is inside an embed, it is slid back inside the embed's box and
25
+ * no taller than the room under its top — nudged, never re-laid out.
26
+ */
27
+ export declare function keepInside(pane: HTMLElement | null): void;
28
+ //# sourceMappingURL=popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../src/popover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAMlF;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAkBzD"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * CLOSE A POPOVER AND GIVE THE KEYBOARD BACK TO WHAT OPENED IT.
3
+ *
4
+ * Every popover on the bar closes on Escape, and every one of them left the
5
+ * keyboard where it was — on a control inside the pane it had just taken
6
+ * away. A removed or hidden element takes focus to <body>, so pressing
7
+ * Escape after "undo" in the activity list put somebody working from the
8
+ * keyboard at the top of the document, and in WebKit the next Tab went
9
+ * nowhere at all. The button that opened the popover is where the keyboard
10
+ * came from, and it is still there.
11
+ *
12
+ * `anchor` holds the trigger (the element with `aria-expanded`) and the
13
+ * pane; the keyboard is moved only when it was inside the pane, so a press
14
+ * that opened the popover and closed it again stays exactly where it was.
15
+ */
16
+ export function closeToTrigger(anchor, close) {
17
+ const at = typeof document === "undefined" ? null : document.activeElement;
18
+ const trigger = anchor?.querySelector("[aria-expanded]") ?? null;
19
+ const inside = at instanceof HTMLElement && anchor !== null && anchor.contains(at) && at !== trigger;
20
+ close();
21
+ if (inside)
22
+ trigger?.focus();
23
+ }
24
+ /**
25
+ * A POPOVER STAYS IN THE BOX IT OPENED IN.
26
+ *
27
+ * On somebody else's page the app is one element with `overflow: hidden`,
28
+ * and a pane anchored to its button's right edge, 280 pixels wide, opened
29
+ * from a button near the element's left side ran off it: the profile's
30
+ * settings were cut in half at 1280 and began off the screen at 390. When
31
+ * the pane is inside an embed, it is slid back inside the embed's box and
32
+ * no taller than the room under its top — nudged, never re-laid out.
33
+ */
34
+ export function keepInside(pane) {
35
+ if (!pane)
36
+ return;
37
+ pane.style.translate = "";
38
+ const box = pane.closest("[data-graview-embed]")?.getBoundingClientRect();
39
+ if (!box)
40
+ return;
41
+ const at = pane.getBoundingClientRect();
42
+ if (at.width === 0)
43
+ return;
44
+ const GAP = 8;
45
+ let dx = 0;
46
+ if (at.left < box.left + GAP)
47
+ dx = box.left + GAP - at.left;
48
+ else if (at.right > box.right - GAP)
49
+ dx = box.right - GAP - at.right;
50
+ if (dx !== 0)
51
+ pane.style.translate = `${Math.round(dx)}px 0`;
52
+ const room = box.bottom - GAP - at.top;
53
+ if (at.height > room) {
54
+ // `max-height` is the content box's: the pane's own padding and border come on top of it.
55
+ const frame = at.height - parseFloat(getComputedStyle(pane).height || "0");
56
+ pane.style.maxHeight = `${Math.max(120, Math.floor(room - (Number.isFinite(frame) ? frame : 0)))}px`;
57
+ }
58
+ }
59
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.js","sourceRoot":"","sources":["../src/popover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAAC,MAA0B,EAAE,KAAiB;IAC1E,MAAM,EAAE,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC3E,MAAM,OAAO,GAAG,MAAM,EAAE,aAAa,CAAc,iBAAiB,CAAC,IAAI,IAAI,CAAC;IAC9E,MAAM,MAAM,GAAG,EAAE,YAAY,WAAW,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,OAAO,CAAC;IACrG,KAAK,EAAE,CAAC;IACR,IAAI,MAAM;QAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC/B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,IAAwB;IACjD,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,IAAI,CAAC,KAAK,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CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACvG,CAAC;AACH,CAAC"}
@@ -0,0 +1,214 @@
1
+ import { type CSSProperties, type ReactNode } from "react";
2
+ /**
3
+ * A rich primitive set, not a visualization library.
4
+ *
5
+ * These cover the common cases so a new node kind renders sensibly before
6
+ * anyone writes a custom view. Everything is an ordinary component with
7
+ * ordinary props — the timeline lens is built from exactly these, which makes
8
+ * it the worked example of the authoring API rather than a privileged
9
+ * insider.
10
+ */
11
+ export interface PanelProps {
12
+ readonly title?: ReactNode;
13
+ readonly subtitle?: ReactNode;
14
+ /** Dimmed trailing text: counts, times, status. */
15
+ readonly meta?: ReactNode;
16
+ readonly selected?: boolean;
17
+ readonly tone?: "default" | "muted" | "warning";
18
+ readonly children?: ReactNode;
19
+ readonly style?: CSSProperties;
20
+ /**
21
+ * Size to the content rather than filling the box the scene gave it.
22
+ *
23
+ * A focused single node was drawn as a 500-pixel white rectangle with four
24
+ * lines of text in the top corner — an empty page with a debug dump in it.
25
+ * A week's calendar genuinely wants the whole box; one nap does not. The
26
+ * scene centres a fitted panel in its band, so a short one reads as
27
+ * deliberate rather than as a rendering that failed halfway.
28
+ */
29
+ readonly fit?: boolean;
30
+ /**
31
+ * The title as a HEADING of this level, where the panel is what a page is
32
+ * about. A panel's title is drawn as a heading and was never one to a
33
+ * screen reader: the routed face's first screen — the way in, alone on a
34
+ * page — had no level-one heading at all, and axe said so.
35
+ */
36
+ readonly heading?: 1 | 2 | 3 | 4;
37
+ /**
38
+ * A card in the scene; a DOCUMENT on a page.
39
+ *
40
+ * The same component renders in both places — that is the two-mode contract
41
+ * — but a card is a thing with edges sitting on a ground, and a full page is
42
+ * not. Lifting a short record out of the scene drew a bordered box 250
43
+ * pixels tall floating in six hundred pixels of nothing, which reads as a
44
+ * rendering that stopped rather than as a document that is short.
45
+ *
46
+ * `page` drops the border, the shadow, the fill and the fixed height, and
47
+ * lets the title be a heading rather than a card's label. Nothing else
48
+ * changes, so a view does not fork.
49
+ */
50
+ readonly variant?: "card" | "page";
51
+ }
52
+ /**
53
+ * Secondary text: a COLOUR, never an opacity.
54
+ *
55
+ * `opacity: 0.7` on small text reads as "quieter" and computes as whatever
56
+ * the background happens to be — which is how four elements here landed at
57
+ * 3.32:1 against a 4.5:1 requirement without anyone choosing an unreadable
58
+ * colour. A token composites against a known ground and can be checked.
59
+ * axe-core checks it on every run of `scripts/run-a11y.mjs`.
60
+ */
61
+ export declare const MUTED_TEXT: CSSProperties;
62
+ /** Even quieter, still above 4.5:1 on both panel grounds. */
63
+ export declare const FAINT_TEXT: CSSProperties;
64
+ /**
65
+ * THE ROOM A VIEW HAS, in pixels, or null before the first measurement.
66
+ *
67
+ * A lens is drawn into whatever box the layout gives it — the focus card
68
+ * in a 360px embed, a billboard, a page's column — and the ones that laid
69
+ * themselves out for a desk (a 316px label column, seven day columns) were
70
+ * unreadable in half of them. The width is the fact they need to choose a
71
+ * shape by; this is the one place it is read.
72
+ */
73
+ export declare function useWidth(ref: {
74
+ current: HTMLElement | null;
75
+ }): number | null;
76
+ export declare function Panel({ title, subtitle, meta, selected, tone, children, style, fit, variant, heading, }: PanelProps): import("react").JSX.Element;
77
+ /**
78
+ * A PARAGRAPH WHOSE LINKS ARE TARGETS TOO.
79
+ *
80
+ * An inline link in a sentence is a link however it reads, and a harness
81
+ * measuring every control found one at 194x17 in a product's own prose — the
82
+ * text is sized in rem, the fingertip floor is not, and a line of body copy
83
+ * is shorter than a fingertip. Every app that ran the audit found this, and
84
+ * each one fixed it in its own stylesheet.
85
+ *
86
+ * `inline-flex` with the floor, so a link in a paragraph is as pressable as
87
+ * a button without the sentence changing shape around it.
88
+ */
89
+ export declare function Prose({ children, style }: {
90
+ readonly children: ReactNode;
91
+ readonly style?: CSSProperties;
92
+ }): import("react").JSX.Element;
93
+ /**
94
+ * Present to a screen reader, absent to the eye — the one idiom, written
95
+ * once.
96
+ *
97
+ * Written out by hand in two places, which meant two shapes for the same
98
+ * decision and no way for a harness to tell either of them from a caption
99
+ * that had genuinely been cut off. `scripts/survey-ui.mjs` reported both as
100
+ * "overflowing" on every screen of every app, twenty lines of noise that a
101
+ * real clipped caption would have hidden behind.
102
+ */
103
+ export declare const VISUALLY_HIDDEN: {
104
+ readonly position: "absolute";
105
+ readonly width: 1;
106
+ readonly height: 1;
107
+ readonly overflow: "hidden";
108
+ readonly clip: "rect(0 0 0 0)";
109
+ readonly clipPath: "inset(50%)";
110
+ readonly whiteSpace: "nowrap";
111
+ };
112
+ export interface ChipProps {
113
+ readonly label: ReactNode;
114
+ /** Degrees around the colour wheel, as `hueFor` gives them. Kind-derived, so it is stable per kind. */
115
+ readonly hue?: number;
116
+ readonly selected?: boolean;
117
+ readonly title?: string;
118
+ /**
119
+ * The node this chip stands for. Set it and the chip becomes a target:
120
+ * clicking it travels to that node. Opt-in on purpose — a chip showing a
121
+ * field value stands for nothing you can navigate to.
122
+ */
123
+ readonly pickId?: string;
124
+ /**
125
+ * What this mark CLAIMS about the current selection, said rather than
126
+ * painted: "lit" when the selection reaches it, "dimmed" when it does not,
127
+ * "plain" when nothing is selected.
128
+ *
129
+ * Every lens the framework ships says this on its own marks, and the skill
130
+ * asks an app's lens to say it too — while the primitive an app would
131
+ * naturally reach for could not. A lens built out of `Roster` therefore had
132
+ * pick targets that were emphasised by opacity alone, which is a claim
133
+ * about a picture that nothing can check: not a test, not `audit-ui`'s
134
+ * `halfSaid`, and not a person reading the tree.
135
+ */
136
+ readonly emphasis?: "lit" | "dimmed" | "plain";
137
+ }
138
+ /** One small labelled thing. The glyph-fidelity workhorse. */
139
+ export declare function Chip({ label, hue, selected, title, pickId, emphasis }: ChipProps): import("react").JSX.Element;
140
+ export interface RosterProps {
141
+ readonly items: readonly {
142
+ id: string;
143
+ label: ReactNode;
144
+ hue?: number;
145
+ /** What this mark claims about the selection. See `ChipProps.emphasis`. */
146
+ emphasis?: "lit" | "dimmed" | "plain";
147
+ }[];
148
+ readonly max?: number;
149
+ readonly selectedIds?: readonly string[];
150
+ /** True when the item ids are real node ids, so each chip can be a target. */
151
+ readonly pick?: boolean;
152
+ }
153
+ /**
154
+ * A list of chips that degrades honestly: past `max` it says how many more
155
+ * rather than truncating silently, because "and 9 more" is information and a
156
+ * clipped list is a lie.
157
+ */
158
+ export declare function Roster({ items, max, selectedIds, pick }: RosterProps): import("react").JSX.Element;
159
+ export interface AggregateProps {
160
+ readonly label: ReactNode;
161
+ readonly count: number;
162
+ readonly items?: readonly {
163
+ id: string;
164
+ label: ReactNode;
165
+ hue?: number;
166
+ }[];
167
+ readonly onExpand?: () => void;
168
+ /** Something inside is implicated in a current problem. */
169
+ readonly flagged?: boolean;
170
+ }
171
+ /**
172
+ * A group standing in for a kind.
173
+ *
174
+ * First-class, not a scale fallback: "People" is a legitimate view of a kind,
175
+ * which is why expanding it is the same mechanism as collapsing back.
176
+ */
177
+ export declare function Aggregate({ label, count, items, onExpand, flagged }: AggregateProps): import("react").JSX.Element;
178
+ export interface AxisProps {
179
+ readonly ticks: readonly {
180
+ at: number;
181
+ label: ReactNode;
182
+ }[];
183
+ readonly orientation?: "horizontal" | "vertical";
184
+ /** Total extent in the same units as `at`. */
185
+ readonly extent: number;
186
+ }
187
+ /** Labelled ticks along one dimension. The timeline's hours and days. */
188
+ export declare function Axis({ ticks, orientation, extent }: AxisProps): import("react").JSX.Element;
189
+ export interface GridProps {
190
+ readonly columns: readonly {
191
+ id: string;
192
+ label: ReactNode;
193
+ }[];
194
+ /** Extent of the cross axis, in the caller's own units. */
195
+ readonly extent: number;
196
+ readonly gutter?: number;
197
+ /** Absolutely positioned children, placed by the caller inside a column. */
198
+ readonly children?: ReactNode;
199
+ }
200
+ /** Named columns over a continuous cross axis. A week over hours. */
201
+ export declare function Grid({ columns, extent, gutter, children }: GridProps): import("react").JSX.Element;
202
+ export interface ConnectorProps {
203
+ readonly x1: number;
204
+ readonly y1: number;
205
+ readonly x2: number;
206
+ readonly y2: number;
207
+ readonly kind?: string;
208
+ readonly pattern?: "solid" | "dashed" | "dotted";
209
+ readonly hue?: number;
210
+ readonly width?: number;
211
+ }
212
+ /** One drawn relationship. Stroke treatment carries the edge's meaning. */
213
+ export declare function Connector({ x1, y1, x2, y2, kind, pattern, hue, width, }: ConnectorProps): import("react").JSX.Element;
214
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExF;;;;;;;;GAQG;AAEH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACpC;AAQD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,EAAE,aAA8D,CAAC;AAExF,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,aAA8D,CAAC;AAuCxF;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE;I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