@crewlethq/ui 0.7.0 → 0.8.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.
@@ -1,4 +1,15 @@
1
1
  import type { ReactNode } from 'react';
2
+ /** One part of a row's value: see [BarDatum.parts]. */
3
+ export interface BarPart {
4
+ /** Keyed by id, so a push that re-ranks the parts moves no other part. */
5
+ id: string;
6
+ label: ReactNode;
7
+ value: number;
8
+ /** What the part's number reads as in the row's key. Defaults to the value. */
9
+ display?: ReactNode;
10
+ /** Defaults to the part's place in the row's `parts`, in the data ramp. */
11
+ color?: string;
12
+ }
2
13
  export interface BarDatum {
3
14
  /**
4
15
  * What this row is, as a stable identity. REQUIRED: a ranked list is
@@ -20,6 +31,18 @@ export interface BarDatum {
20
31
  href?: string;
21
32
  /** What pressing the row does, where it is not a destination. */
22
33
  onSelect?: () => void;
34
+ /**
35
+ * What the row's value is made of, such as a team's tokens by seat. The
36
+ * row's bar is split into these, in proportion to each part's value and
37
+ * 2px apart, and the row is keyed under its bar with each part's name and
38
+ * number: a split bar with no key is a picture of some numbers. A part's
39
+ * hue is its place in this list unless it names one, so every row is keyed
40
+ * under itself and two rows may use one hue for different parts. A part
41
+ * with nothing in it is neither drawn nor keyed, and keeps its hue's place.
42
+ * The parts are the caller's to sum to `value`: the bar's length is the
43
+ * row's value, and the parts only divide it.
44
+ */
45
+ parts?: BarPart[];
23
46
  }
24
47
  /**
25
48
  * Where a row's bar stands against its words.
@@ -3,7 +3,7 @@ export { DATA_COLORS, DATA_COLOR_OTHER, dataColor } from './dataColor.js';
3
3
  export { Legend } from './Legend.js';
4
4
  export type { LegendItem, LegendProps } from './Legend.js';
5
5
  export { BarList } from './BarList.js';
6
- export type { BarDatum, BarListProps } from './BarList.js';
6
+ export type { BarDatum, BarListLayout, BarListProps, BarPart } from './BarList.js';
7
7
  export { StackedBar } from './StackedBar.js';
8
8
  export type { StackedBarProps, StackedSegment } from './StackedBar.js';
9
9
  export { ActivityStrip } from './ActivityStrip.js';
@@ -1,3 +1,3 @@
1
- export { ActivityStrip, BarList, ChartTooltip, DATA_COLORS, DATA_COLOR_OTHER, Legend, Sparkline, StackedBar, StackedColumns, TimeSeries, dataColor, niceScale, useChartHover } from '../chunk-RJM4QCGG.js';
1
+ export { ActivityStrip, BarList, ChartTooltip, DATA_COLORS, DATA_COLOR_OTHER, Legend, Sparkline, StackedBar, StackedColumns, TimeSeries, dataColor, niceScale, useChartHover } from '../chunk-4WNNEDKO.js';
2
2
  import '../chunk-BZFWDIV6.js';
3
3
  import '../chunk-ODEQTPFM.js';
@@ -213,24 +213,67 @@
213
213
  gap: calc(var(--spacing-1) * 1.5);
214
214
  }
215
215
 
216
+ /*
217
+ * THE BAR STANDS ON THE NAME'S LINE, AND A SPLIT BAR'S KEY ON THE SUB'S. An
218
+ * item is a grid of two columns, the words' and the plot, and two lines. The
219
+ * row spans it and lends its parts to it (`subgrid`), and the words' wrapper
220
+ * lends its own two lines in turn (`display: contents`), so the name and the
221
+ * plot share the first line and are centred on each other, and the sub and a
222
+ * split bar's key share the second, the key starting where the bar starts.
223
+ * Centred on the words' whole column instead, a row with a sub drew its bar,
224
+ * and the value at its end, between the name and the sub, a few pixels below
225
+ * the name it belongs to; and the key stood on a third line of its own, under
226
+ * the sub, where it read as one more bar. A row with neither is one line,
227
+ * centred in the item's height.
228
+ *
229
+ * THE KEY LETS THE POINTER THROUGH. It is outside the row in the markup,
230
+ * because a row that leads somewhere is a link or a button and holds no list,
231
+ * so it is drawn over the row's second line rather than inside it, and a
232
+ * press on it is a press on the row.
233
+ */
234
+ .crewlet-bar-list--beside .crewlet-bar-list__item {
235
+ display: grid;
236
+ grid-template-columns: var(--crewlet-bar-list-label-width) minmax(0, 1fr);
237
+ grid-template-rows: auto auto;
238
+ align-content: center;
239
+ column-gap: var(--spacing-3);
240
+ min-height: var(--size-control-md);
241
+ }
242
+
243
+ /* `gap: normal` is what hands a subgrid its parent's gaps: the stacked
244
+ register's own gap on every row would otherwise move the plot off the
245
+ column the key stands in. */
216
246
  .crewlet-bar-list--beside .crewlet-bar-list__row {
217
- flex-direction: row;
247
+ display: grid;
248
+ grid-column: 1 / -1;
249
+ grid-row: 1 / -1;
250
+ grid-template-columns: subgrid;
251
+ grid-template-rows: subgrid;
218
252
  align-items: center;
219
- gap: var(--spacing-3);
220
- min-height: var(--size-control-md);
253
+ gap: normal;
221
254
  }
222
255
 
223
256
  .crewlet-bar-list__names {
224
- display: flex;
225
- flex: none;
226
- flex-direction: column;
227
- width: var(--crewlet-bar-list-label-width);
228
- min-width: 0;
257
+ display: contents;
229
258
  line-height: var(--font-line-height-tight);
230
259
  }
231
260
 
261
+ .crewlet-bar-list--beside .crewlet-bar-list__names > .crewlet-bar-list__label {
262
+ grid-row: 1;
263
+ grid-column: 1;
264
+ }
265
+
266
+ .crewlet-bar-list--beside .crewlet-bar-list__plot {
267
+ grid-row: 1;
268
+ grid-column: 2;
269
+ }
270
+
271
+ .crewlet-bar-list--beside .crewlet-bar-list__names > .crewlet-bar-list__sub {
272
+ grid-row: 2;
273
+ grid-column: 1;
274
+ }
275
+
232
276
  .crewlet-bar-list--beside .crewlet-bar-list__label {
233
- flex: none;
234
277
  color: var(--color-text-secondary);
235
278
  }
236
279
 
@@ -240,7 +283,6 @@
240
283
 
241
284
  .crewlet-bar-list__plot {
242
285
  display: block;
243
- flex: 1 1 auto;
244
286
  min-width: 0;
245
287
  }
246
288
 
@@ -271,6 +313,49 @@
271
313
  white-space: nowrap;
272
314
  }
273
315
 
316
+ /*
317
+ * A SPLIT BAR: one bar divided into its parts, as a stacked bar is. The parts
318
+ * stand 2px apart for the stacked bar's reason, the ground showing through is
319
+ * what makes each part a part, and each part GROWS by its value (a style
320
+ * property on the part) so the gaps come out of the parts and the bar keeps
321
+ * its length. The bar clips its parts, so the last part takes the bar's
322
+ * rounded value end and the first its square start.
323
+ */
324
+ .crewlet-bar-list__bar--parts {
325
+ display: flex;
326
+ gap: 2px;
327
+ overflow: hidden;
328
+ background: none;
329
+ }
330
+
331
+ .crewlet-bar-list__part {
332
+ flex-grow: 0;
333
+ flex-shrink: 1;
334
+ flex-basis: 0;
335
+ min-width: 0;
336
+ height: 100%;
337
+ background: var(--crewlet-bar-list-part-color, var(--color-data-other));
338
+ }
339
+
340
+ /*
341
+ * THE KEY UNDER A SPLIT BAR, at the caption step. In the BESIDE register it
342
+ * stands on the row's second line, under the bar it keys (see the item's
343
+ * grid above), so each name stands under its part rather than under the
344
+ * row's own name.
345
+ */
346
+ .crewlet-bar-list__key {
347
+ margin-top: var(--spacing-1);
348
+ font-size: var(--font-size-2xs);
349
+ }
350
+
351
+ .crewlet-bar-list--beside .crewlet-bar-list__key {
352
+ grid-row: 2;
353
+ grid-column: 2;
354
+ align-self: center;
355
+ margin-top: 0;
356
+ pointer-events: none;
357
+ }
358
+
274
359
  /* ─── Stacked bar ─────────────────────────────────────────────── */
275
360
 
276
361
  /*
@@ -1,10 +1,10 @@
1
- export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from '../chunk-CVB7O3SZ.js';
1
+ export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from '../chunk-KTIEJ5Q5.js';
2
2
  import '../chunk-LSB3EHBW.js';
3
3
  import '../chunk-EUCC37WY.js';
4
4
  import '../chunk-BTHX2FS3.js';
5
5
  import '../chunk-AV2DXAEL.js';
6
- import '../chunk-YCTMKKRA.js';
7
6
  import '../chunk-5VNUYO76.js';
7
+ import '../chunk-YCTMKKRA.js';
8
8
  import '../chunk-PQADV6P6.js';
9
9
  import '../chunk-7RPGY3JE.js';
10
10
  import '../chunk-R25RGPUB.js';
@@ -1,9 +1,9 @@
1
- export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-CLPDVL46.js';
1
+ export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-A3K56LY6.js';
2
2
  import '../chunk-PGRPNDWM.js';
3
3
  import '../chunk-HOXGBLEY.js';
4
4
  import '../chunk-3CZ7XAVY.js';
5
5
  import '../chunk-SMBKXWML.js';
6
- import '../chunk-CVB7O3SZ.js';
6
+ import '../chunk-KTIEJ5Q5.js';
7
7
  import '../chunk-LSB3EHBW.js';
8
8
  import '../chunk-EUCC37WY.js';
9
9
  import '../chunk-BTHX2FS3.js';
@@ -11,8 +11,8 @@ import '../chunk-5I56UXBJ.js';
11
11
  import '../chunk-PDUZO35I.js';
12
12
  import '../chunk-GXQ3B46I.js';
13
13
  import '../chunk-AV2DXAEL.js';
14
- import '../chunk-YCTMKKRA.js';
15
14
  import '../chunk-5VNUYO76.js';
15
+ import '../chunk-YCTMKKRA.js';
16
16
  import '../chunk-6MU7HNB4.js';
17
17
  import '../chunk-ZGX2DP7F.js';
18
18
  import '../chunk-BHHIIK3M.js';
@@ -1,10 +1,10 @@
1
- export { ListInput } from '../chunk-6HXH57BL.js';
1
+ export { ListInput } from '../chunk-4JHWMJZI.js';
2
2
  import '../chunk-SMBKXWML.js';
3
3
  import '../chunk-ZGX2DP7F.js';
4
4
  import '../chunk-PQADV6P6.js';
5
- import '../chunk-RSAQOKH3.js';
6
5
  import '../chunk-7RPGY3JE.js';
7
6
  import '../chunk-R25RGPUB.js';
8
7
  import '../chunk-4FQT6ZAY.js';
8
+ import '../chunk-RSAQOKH3.js';
9
9
  import '../chunk-BZFWDIV6.js';
10
10
  import '../chunk-ODEQTPFM.js';
@@ -1,10 +1,10 @@
1
- export { TagsInput } from '../chunk-MPXI6FM6.js';
1
+ export { TagsInput } from '../chunk-DBUGBINU.js';
2
2
  import '../chunk-LOECRMHA.js';
3
3
  import '../chunk-WIATRXEJ.js';
4
4
  import '../chunk-6MU7HNB4.js';
5
- import '../chunk-RSAQOKH3.js';
6
5
  import '../chunk-7RPGY3JE.js';
7
6
  import '../chunk-R25RGPUB.js';
8
7
  import '../chunk-4FQT6ZAY.js';
8
+ import '../chunk-RSAQOKH3.js';
9
9
  import '../chunk-BZFWDIV6.js';
10
10
  import '../chunk-ODEQTPFM.js';
@@ -1,6 +1,6 @@
1
1
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
- import './Charts-B3YEF7R4.css';
3
+ import './Charts-JUERFLAR.css';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { useState, useRef, useCallback, useId } from 'react';
6
6
 
@@ -61,15 +61,24 @@ function BarList({
61
61
  /* @__PURE__ */ jsxs("ul", { role: "list", className: cx("crewlet-bar-list", `crewlet-bar-list--${layout}`, className), children: [
62
62
  shown.map((datum, index) => {
63
63
  const width = top > 0 && datum.value > 0 ? Math.max(1, datum.value / top * 100) : 0;
64
+ const parts = (datum.parts ?? []).map((part, at) => ({ ...part, color: part.color ?? dataColor(at) })).filter((part) => part.value > 0);
64
65
  const bar = width > 0 ? /* @__PURE__ */ jsx(
65
66
  "span",
66
67
  {
67
- className: "crewlet-bar-list__bar",
68
+ className: cx("crewlet-bar-list__bar", parts.length > 0 && "crewlet-bar-list__bar--parts"),
68
69
  "aria-hidden": true,
69
- style: {
70
+ style: parts.length > 0 ? { width: `${width}%` } : {
70
71
  width: `${width}%`,
71
72
  "--crewlet-bar-list-bar-color": datum.color ?? dataColor(index)
72
- }
73
+ },
74
+ children: parts.map((part) => /* @__PURE__ */ jsx(
75
+ "span",
76
+ {
77
+ className: "crewlet-bar-list__part",
78
+ style: { flexGrow: part.value, "--crewlet-bar-list-part-color": part.color }
79
+ },
80
+ part.id
81
+ ))
73
82
  }
74
83
  ) : null;
75
84
  const value = /* @__PURE__ */ jsx("span", { className: "crewlet-bar-list__value", children: datum.display ?? datum.value.toLocaleString() });
@@ -98,15 +107,29 @@ function BarList({
98
107
  /* @__PURE__ */ jsx("span", { className: "crewlet-bar-list__sub", children: datum.sub })
99
108
  ] })
100
109
  ] });
101
- return /* @__PURE__ */ jsx("li", { className: "crewlet-bar-list__item", children: datum.href ? /* @__PURE__ */ jsx("a", { className: "crewlet-bar-list__row crewlet-bar-list__row--pressable", href: datum.href, children: body }) : datum.onSelect ? /* @__PURE__ */ jsx(
102
- "button",
103
- {
104
- type: "button",
105
- className: "crewlet-bar-list__row crewlet-bar-list__row--pressable",
106
- onClick: datum.onSelect,
107
- children: body
108
- }
109
- ) : /* @__PURE__ */ jsx("span", { className: "crewlet-bar-list__row", children: body }) }, datum.id);
110
+ return /* @__PURE__ */ jsxs("li", { className: "crewlet-bar-list__item", children: [
111
+ datum.href ? /* @__PURE__ */ jsx("a", { className: "crewlet-bar-list__row crewlet-bar-list__row--pressable", href: datum.href, children: body }) : datum.onSelect ? /* @__PURE__ */ jsx(
112
+ "button",
113
+ {
114
+ type: "button",
115
+ className: "crewlet-bar-list__row crewlet-bar-list__row--pressable",
116
+ onClick: datum.onSelect,
117
+ children: body
118
+ }
119
+ ) : /* @__PURE__ */ jsx("span", { className: "crewlet-bar-list__row", children: body }),
120
+ parts.length > 0 && /* @__PURE__ */ jsx(
121
+ Legend,
122
+ {
123
+ className: "crewlet-bar-list__key",
124
+ items: parts.map((part) => ({
125
+ id: part.id,
126
+ label: part.label,
127
+ color: part.color,
128
+ value: part.display ?? part.value.toLocaleString()
129
+ }))
130
+ }
131
+ )
132
+ ] }, datum.id);
110
133
  }),
111
134
  remaining > 0 && /* @__PURE__ */ jsx("li", { className: "crewlet-bar-list__more", children: moreLabel(remaining) })
112
135
  ] })
@@ -2,7 +2,7 @@ import { Toolbar } from './chunk-PGRPNDWM.js';
2
2
  import { PageHeader } from './chunk-HOXGBLEY.js';
3
3
  import { RelativeTime } from './chunk-3CZ7XAVY.js';
4
4
  import { Kbd } from './chunk-SMBKXWML.js';
5
- import { DataTable } from './chunk-CVB7O3SZ.js';
5
+ import { DataTable } from './chunk-KTIEJ5Q5.js';
6
6
  import { Menu } from './chunk-LSB3EHBW.js';
7
7
  import { DateTimePicker } from './chunk-5I56UXBJ.js';
8
8
  import { Popover } from './chunk-PDUZO35I.js';
@@ -3,7 +3,7 @@ export { Tooltip } from '../chunk-CQY5NTRS.js';
3
3
  export { TreeCanvas } from '../chunk-L7THQMFB.js';
4
4
  import '../chunk-IJ7QXNIJ.js';
5
5
  export { TagGroup } from '../chunk-E6UWRXNM.js';
6
- export { TagsInput } from '../chunk-MPXI6FM6.js';
6
+ export { TagsInput } from '../chunk-DBUGBINU.js';
7
7
  export { Text } from '../chunk-23DHIMJA.js';
8
8
  export { DensitySwitcher, ThemeSwitcher } from '../chunk-RHHGLTXJ.js';
9
9
  export { ThemeToggle } from '../chunk-ORNOOMVY.js';
@@ -36,7 +36,7 @@ export { StatusDot } from '../chunk-WIATRXEJ.js';
36
36
  export { Prose } from '../chunk-JCSA3XVH.js';
37
37
  export { Link } from '../chunk-ZPSOF6VL.js';
38
38
  export { List, ListItem } from '../chunk-DS2C73RJ.js';
39
- export { ListInput } from '../chunk-6HXH57BL.js';
39
+ export { ListInput } from '../chunk-4JHWMJZI.js';
40
40
  export { DEFAULT_METER_THRESHOLDS, METER_STATES, Meter, meterState, meterStateTone, meterTone, progressTone } from '../chunk-4PZ6FJKW.js';
41
41
  export { NewItemsNotice } from '../chunk-PXU6HOZB.js';
42
42
  export { useFullscreen } from '../chunk-XDTYBF2F.js';
@@ -52,12 +52,12 @@ export { Eyebrow } from '../chunk-RK4XPHVG.js';
52
52
  export { FILTER_CHIP_ATTRIBUTE, FilterChip, FilterChipGroup } from '../chunk-5YLON2PW.js';
53
53
  export { CommandPalette } from '../chunk-BXPLX7YU.js';
54
54
  export { Container } from '../chunk-QVE4GJAT.js';
55
- export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-CLPDVL46.js';
55
+ export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-A3K56LY6.js';
56
56
  export { Toolbar, ToolbarOverflow, ToolbarWide } from '../chunk-PGRPNDWM.js';
57
57
  export { PageHeader } from '../chunk-HOXGBLEY.js';
58
58
  export { RelativeTime, currentNow, formatElapsed, formatExact, formatRelative, formatUntil, toISO, toInstant, useNow } from '../chunk-3CZ7XAVY.js';
59
59
  export { Kbd, isApplePlatform, keyGlyph } from '../chunk-SMBKXWML.js';
60
- export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from '../chunk-CVB7O3SZ.js';
60
+ export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from '../chunk-KTIEJ5Q5.js';
61
61
  export { Menu } from '../chunk-LSB3EHBW.js';
62
62
  export { EMPTY_VALUE, EmptyValue } from '../chunk-EUCC37WY.js';
63
63
  export { ConfirmModal, Modal } from '../chunk-BTHX2FS3.js';
@@ -70,11 +70,11 @@ export { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, CANVAS_FIT_PADDING, CANVAS
70
70
  import '../chunk-53DVJCVW.js';
71
71
  export { Card } from '../chunk-CEOXFO3E.js';
72
72
  export { useCardHeaderSlot } from '../chunk-AV2DXAEL.js';
73
- export { ActivityStrip, BarList, ChartTooltip, DATA_COLORS, DATA_COLOR_OTHER, Legend, Sparkline, StackedBar, StackedColumns, TimeSeries, dataColor, niceScale, useChartHover } from '../chunk-RJM4QCGG.js';
74
- export { Checkbox } from '../chunk-YCTMKKRA.js';
73
+ export { ActivityStrip, BarList, ChartTooltip, DATA_COLORS, DATA_COLOR_OTHER, Legend, Sparkline, StackedBar, StackedColumns, TimeSeries, dataColor, niceScale, useChartHover } from '../chunk-4WNNEDKO.js';
75
74
  export { CodeBlock } from '../chunk-MORLKUGM.js';
76
75
  export { CopyButton, Copyable } from '../chunk-26SCUACK.js';
77
76
  export { useClipboard, writeClipboard } from '../chunk-5VNUYO76.js';
77
+ export { Checkbox } from '../chunk-YCTMKKRA.js';
78
78
  export { Combobox } from '../chunk-UYK72NOS.js';
79
79
  export { TYPE_AHEAD_WINDOW, useListbox, useOptionKeys } from '../chunk-6MU7HNB4.js';
80
80
  export { FormField, FormRow, FormSection, Input, InputAffix, Label, ReadOnlyField, Textarea } from '../chunk-ZGX2DP7F.js';
@@ -83,13 +83,13 @@ export { DisclosureAnatomy } from '../chunk-FZVJDJFN.js';
83
83
  export { Count } from '../chunk-BHHIIK3M.js';
84
84
  export { HeadingLevelProvider, headingTag, nextHeadingLevel, useHeadingLevel } from '../chunk-PQADV6P6.js';
85
85
  export { ADD_PILL_MS, AddPill } from '../chunk-74WGARJE.js';
86
- export { Announcer, announce, useAnnouncer } from '../chunk-RSAQOKH3.js';
87
86
  export { AppShell, AppShellRail, AppShellRailRow, AppShellToggle, AppShellTopbar, useAppShell } from '../chunk-OVLJEVQS.js';
88
87
  export { LAYER_GAP, LAYER_REPOSITION_EVENT, LayerHost, outsideBounds, placePopup, useLayerContainer, viewportBounds } from '../chunk-7RPGY3JE.js';
89
88
  export { focusables, isComposing, isModalLayerOpen, layerCount, useBodyScrollLock, useModalLayer, usePopupLayer } from '../chunk-R25RGPUB.js';
90
89
  export { IconButton } from '../chunk-4FQT6ZAY.js';
91
- export { AVATAR_CORNER_RATIO, AVATAR_SIZES, Avatar, AvatarStack, avatarCorner, avatarPixels, avatarStackLabel, avatarTint, getInitials } from '../chunk-IA232OTU.js';
90
+ export { Announcer, announce, useAnnouncer } from '../chunk-RSAQOKH3.js';
92
91
  export { BrandLockup } from '../chunk-7KBNFFM3.js';
92
+ export { AVATAR_CORNER_RATIO, AVATAR_SIZES, Avatar, AvatarStack, avatarCorner, avatarPixels, avatarStackLabel, avatarTint, getInitials } from '../chunk-IA232OTU.js';
93
93
  export { Button, ButtonLink } from '../chunk-OG6CL3EB.js';
94
94
  export { VisuallyHidden } from '../chunk-BZFWDIV6.js';
95
95
  export { cx } from '../chunk-ODEQTPFM.js';
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export { Tooltip } from './chunk-CQY5NTRS.js';
3
3
  export { TreeCanvas } from './chunk-L7THQMFB.js';
4
4
  import './chunk-IJ7QXNIJ.js';
5
5
  export { TagGroup } from './chunk-E6UWRXNM.js';
6
- export { TagsInput } from './chunk-MPXI6FM6.js';
6
+ export { TagsInput } from './chunk-DBUGBINU.js';
7
7
  export { Text } from './chunk-23DHIMJA.js';
8
8
  export { DensitySwitcher, ThemeSwitcher } from './chunk-RHHGLTXJ.js';
9
9
  export { ThemeToggle } from './chunk-ORNOOMVY.js';
@@ -36,7 +36,7 @@ export { StatusDot } from './chunk-WIATRXEJ.js';
36
36
  export { Prose } from './chunk-JCSA3XVH.js';
37
37
  export { Link } from './chunk-ZPSOF6VL.js';
38
38
  export { List, ListItem } from './chunk-DS2C73RJ.js';
39
- export { ListInput } from './chunk-6HXH57BL.js';
39
+ export { ListInput } from './chunk-4JHWMJZI.js';
40
40
  export { DEFAULT_METER_THRESHOLDS, METER_STATES, Meter, meterState, meterStateTone, meterTone, progressTone } from './chunk-4PZ6FJKW.js';
41
41
  export { NewItemsNotice } from './chunk-PXU6HOZB.js';
42
42
  export { useFullscreen } from './chunk-XDTYBF2F.js';
@@ -52,12 +52,12 @@ export { Eyebrow } from './chunk-RK4XPHVG.js';
52
52
  export { FILTER_CHIP_ATTRIBUTE, FilterChip, FilterChipGroup } from './chunk-5YLON2PW.js';
53
53
  export { CommandPalette } from './chunk-BXPLX7YU.js';
54
54
  export { Container } from './chunk-QVE4GJAT.js';
55
- export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from './chunk-CLPDVL46.js';
55
+ export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from './chunk-A3K56LY6.js';
56
56
  export { Toolbar, ToolbarOverflow, ToolbarWide } from './chunk-PGRPNDWM.js';
57
57
  export { PageHeader } from './chunk-HOXGBLEY.js';
58
58
  export { RelativeTime, currentNow, formatElapsed, formatExact, formatRelative, formatUntil, toISO, toInstant, useNow } from './chunk-3CZ7XAVY.js';
59
59
  export { Kbd, isApplePlatform, keyGlyph } from './chunk-SMBKXWML.js';
60
- export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from './chunk-CVB7O3SZ.js';
60
+ export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from './chunk-KTIEJ5Q5.js';
61
61
  export { Menu } from './chunk-LSB3EHBW.js';
62
62
  export { EMPTY_VALUE, EmptyValue } from './chunk-EUCC37WY.js';
63
63
  export { ConfirmModal, Modal } from './chunk-BTHX2FS3.js';
@@ -70,11 +70,11 @@ export { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, CANVAS_FIT_PADDING, CANVAS
70
70
  import './chunk-53DVJCVW.js';
71
71
  export { Card } from './chunk-CEOXFO3E.js';
72
72
  export { useCardHeaderSlot } from './chunk-AV2DXAEL.js';
73
- export { ActivityStrip, BarList, ChartTooltip, DATA_COLORS, DATA_COLOR_OTHER, Legend, Sparkline, StackedBar, StackedColumns, TimeSeries, dataColor, niceScale, useChartHover } from './chunk-RJM4QCGG.js';
74
- export { Checkbox } from './chunk-YCTMKKRA.js';
73
+ export { ActivityStrip, BarList, ChartTooltip, DATA_COLORS, DATA_COLOR_OTHER, Legend, Sparkline, StackedBar, StackedColumns, TimeSeries, dataColor, niceScale, useChartHover } from './chunk-4WNNEDKO.js';
75
74
  export { CodeBlock } from './chunk-MORLKUGM.js';
76
75
  export { CopyButton, Copyable } from './chunk-26SCUACK.js';
77
76
  export { useClipboard, writeClipboard } from './chunk-5VNUYO76.js';
77
+ export { Checkbox } from './chunk-YCTMKKRA.js';
78
78
  export { Combobox } from './chunk-UYK72NOS.js';
79
79
  export { TYPE_AHEAD_WINDOW, useListbox, useOptionKeys } from './chunk-6MU7HNB4.js';
80
80
  export { FormField, FormRow, FormSection, Input, InputAffix, Label, ReadOnlyField, Textarea } from './chunk-ZGX2DP7F.js';
@@ -83,13 +83,13 @@ export { DisclosureAnatomy } from './chunk-FZVJDJFN.js';
83
83
  export { Count } from './chunk-BHHIIK3M.js';
84
84
  export { HeadingLevelProvider, headingTag, nextHeadingLevel, useHeadingLevel } from './chunk-PQADV6P6.js';
85
85
  export { ADD_PILL_MS, AddPill } from './chunk-74WGARJE.js';
86
- export { Announcer, announce, useAnnouncer } from './chunk-RSAQOKH3.js';
87
86
  export { AppShell, AppShellRail, AppShellRailRow, AppShellToggle, AppShellTopbar, useAppShell } from './chunk-OVLJEVQS.js';
88
87
  export { LAYER_GAP, LAYER_REPOSITION_EVENT, LayerHost, outsideBounds, placePopup, useLayerContainer, viewportBounds } from './chunk-7RPGY3JE.js';
89
88
  export { focusables, isComposing, isModalLayerOpen, layerCount, useBodyScrollLock, useModalLayer, usePopupLayer } from './chunk-R25RGPUB.js';
90
89
  export { IconButton } from './chunk-4FQT6ZAY.js';
91
- export { AVATAR_CORNER_RATIO, AVATAR_SIZES, Avatar, AvatarStack, avatarCorner, avatarPixels, avatarStackLabel, avatarTint, getInitials } from './chunk-IA232OTU.js';
90
+ export { Announcer, announce, useAnnouncer } from './chunk-RSAQOKH3.js';
92
91
  export { BrandLockup } from './chunk-7KBNFFM3.js';
92
+ export { AVATAR_CORNER_RATIO, AVATAR_SIZES, Avatar, AvatarStack, avatarCorner, avatarPixels, avatarStackLabel, avatarTint, getInitials } from './chunk-IA232OTU.js';
93
93
  export { Button, ButtonLink } from './chunk-OG6CL3EB.js';
94
94
  export { VisuallyHidden } from './chunk-BZFWDIV6.js';
95
95
  export { cx } from './chunk-ODEQTPFM.js';
package/dist/styles.css CHANGED
@@ -2877,7 +2877,7 @@
2877
2877
  }
2878
2878
 
2879
2879
 
2880
- /* Charts-B3YEF7R4.css */
2880
+ /* Charts-JUERFLAR.css */
2881
2881
  /* The chart kit: a legend, a ranked bar list, a stacked bar, stacked
2882
2882
  columns, an activity strip, a time series and the reading layer they share. Hand-drawn rather than a charting library, for one reason that
2883
2883
  decides it: every mark here reads tokens, in two themes, at the contrast
@@ -3093,24 +3093,67 @@
3093
3093
  gap: calc(var(--spacing-1) * 1.5);
3094
3094
  }
3095
3095
 
3096
+ /*
3097
+ * THE BAR STANDS ON THE NAME'S LINE, AND A SPLIT BAR'S KEY ON THE SUB'S. An
3098
+ * item is a grid of two columns, the words' and the plot, and two lines. The
3099
+ * row spans it and lends its parts to it (`subgrid`), and the words' wrapper
3100
+ * lends its own two lines in turn (`display: contents`), so the name and the
3101
+ * plot share the first line and are centred on each other, and the sub and a
3102
+ * split bar's key share the second, the key starting where the bar starts.
3103
+ * Centred on the words' whole column instead, a row with a sub drew its bar,
3104
+ * and the value at its end, between the name and the sub, a few pixels below
3105
+ * the name it belongs to; and the key stood on a third line of its own, under
3106
+ * the sub, where it read as one more bar. A row with neither is one line,
3107
+ * centred in the item's height.
3108
+ *
3109
+ * THE KEY LETS THE POINTER THROUGH. It is outside the row in the markup,
3110
+ * because a row that leads somewhere is a link or a button and holds no list,
3111
+ * so it is drawn over the row's second line rather than inside it, and a
3112
+ * press on it is a press on the row.
3113
+ */
3114
+ .crewlet-bar-list--beside .crewlet-bar-list__item {
3115
+ display: grid;
3116
+ grid-template-columns: var(--crewlet-bar-list-label-width) minmax(0, 1fr);
3117
+ grid-template-rows: auto auto;
3118
+ align-content: center;
3119
+ column-gap: var(--spacing-3);
3120
+ min-height: var(--size-control-md);
3121
+ }
3122
+
3123
+ /* `gap: normal` is what hands a subgrid its parent's gaps: the stacked
3124
+ register's own gap on every row would otherwise move the plot off the
3125
+ column the key stands in. */
3096
3126
  .crewlet-bar-list--beside .crewlet-bar-list__row {
3097
- flex-direction: row;
3127
+ display: grid;
3128
+ grid-column: 1 / -1;
3129
+ grid-row: 1 / -1;
3130
+ grid-template-columns: subgrid;
3131
+ grid-template-rows: subgrid;
3098
3132
  align-items: center;
3099
- gap: var(--spacing-3);
3100
- min-height: var(--size-control-md);
3133
+ gap: normal;
3101
3134
  }
3102
3135
 
3103
3136
  .crewlet-bar-list__names {
3104
- display: flex;
3105
- flex: none;
3106
- flex-direction: column;
3107
- width: var(--crewlet-bar-list-label-width);
3108
- min-width: 0;
3137
+ display: contents;
3109
3138
  line-height: var(--font-line-height-tight);
3110
3139
  }
3111
3140
 
3141
+ .crewlet-bar-list--beside .crewlet-bar-list__names > .crewlet-bar-list__label {
3142
+ grid-row: 1;
3143
+ grid-column: 1;
3144
+ }
3145
+
3146
+ .crewlet-bar-list--beside .crewlet-bar-list__plot {
3147
+ grid-row: 1;
3148
+ grid-column: 2;
3149
+ }
3150
+
3151
+ .crewlet-bar-list--beside .crewlet-bar-list__names > .crewlet-bar-list__sub {
3152
+ grid-row: 2;
3153
+ grid-column: 1;
3154
+ }
3155
+
3112
3156
  .crewlet-bar-list--beside .crewlet-bar-list__label {
3113
- flex: none;
3114
3157
  color: var(--color-text-secondary);
3115
3158
  }
3116
3159
 
@@ -3120,7 +3163,6 @@
3120
3163
 
3121
3164
  .crewlet-bar-list__plot {
3122
3165
  display: block;
3123
- flex: 1 1 auto;
3124
3166
  min-width: 0;
3125
3167
  }
3126
3168
 
@@ -3151,6 +3193,49 @@
3151
3193
  white-space: nowrap;
3152
3194
  }
3153
3195
 
3196
+ /*
3197
+ * A SPLIT BAR: one bar divided into its parts, as a stacked bar is. The parts
3198
+ * stand 2px apart for the stacked bar's reason, the ground showing through is
3199
+ * what makes each part a part, and each part GROWS by its value (a style
3200
+ * property on the part) so the gaps come out of the parts and the bar keeps
3201
+ * its length. The bar clips its parts, so the last part takes the bar's
3202
+ * rounded value end and the first its square start.
3203
+ */
3204
+ .crewlet-bar-list__bar--parts {
3205
+ display: flex;
3206
+ gap: 2px;
3207
+ overflow: hidden;
3208
+ background: none;
3209
+ }
3210
+
3211
+ .crewlet-bar-list__part {
3212
+ flex-grow: 0;
3213
+ flex-shrink: 1;
3214
+ flex-basis: 0;
3215
+ min-width: 0;
3216
+ height: 100%;
3217
+ background: var(--crewlet-bar-list-part-color, var(--color-data-other));
3218
+ }
3219
+
3220
+ /*
3221
+ * THE KEY UNDER A SPLIT BAR, at the caption step. In the BESIDE register it
3222
+ * stands on the row's second line, under the bar it keys (see the item's
3223
+ * grid above), so each name stands under its part rather than under the
3224
+ * row's own name.
3225
+ */
3226
+ .crewlet-bar-list__key {
3227
+ margin-top: var(--spacing-1);
3228
+ font-size: var(--font-size-2xs);
3229
+ }
3230
+
3231
+ .crewlet-bar-list--beside .crewlet-bar-list__key {
3232
+ grid-row: 2;
3233
+ grid-column: 2;
3234
+ align-self: center;
3235
+ margin-top: 0;
3236
+ pointer-events: none;
3237
+ }
3238
+
3154
3239
  /* ─── Stacked bar ─────────────────────────────────────────────── */
3155
3240
 
3156
3241
  /*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewlethq/ui",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
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.7.0",
46
- "@crewlethq/tokens": "0.7.0"
45
+ "@crewlethq/icons": "0.8.1",
46
+ "@crewlethq/tokens": "0.8.1"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": ">=18",
@@ -1,8 +1,8 @@
1
1
  import { Kbd } from './chunk-SMBKXWML.js';
2
2
  import { FormField, Textarea, Input } from './chunk-ZGX2DP7F.js';
3
- import { announce } from './chunk-RSAQOKH3.js';
4
3
  import { isComposing } from './chunk-R25RGPUB.js';
5
4
  import { IconButton } from './chunk-4FQT6ZAY.js';
5
+ import { announce } from './chunk-RSAQOKH3.js';
6
6
  import './ListInput-O7LJKOIG.css';
7
7
  import { useState, useRef, useLayoutEffect } from 'react';
8
8
  import { ArrowUpGlyph, ArrowDownGlyph, XGlyph, PlusGlyph } from '@crewlethq/icons/glyphs';
@@ -1,8 +1,8 @@
1
1
  import { Tag } from './chunk-LOECRMHA.js';
2
2
  import { useListbox } from './chunk-6MU7HNB4.js';
3
- import { announce } from './chunk-RSAQOKH3.js';
4
3
  import { isComposing } from './chunk-R25RGPUB.js';
5
4
  import { IconButton } from './chunk-4FQT6ZAY.js';
5
+ import { announce } from './chunk-RSAQOKH3.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
7
7
  import './TagsInput-P2HS5QL4.css';
8
8
  import { forwardRef, useState, useRef, useId, useImperativeHandle, useEffect, useMemo, useLayoutEffect } from 'react';
@@ -2,8 +2,8 @@ import { Menu } from './chunk-LSB3EHBW.js';
2
2
  import { EmptyValue } from './chunk-EUCC37WY.js';
3
3
  import { Modal } from './chunk-BTHX2FS3.js';
4
4
  import { useCardHeaderSlot } from './chunk-AV2DXAEL.js';
5
- import { Checkbox } from './chunk-YCTMKKRA.js';
6
5
  import { useClipboard } from './chunk-5VNUYO76.js';
6
+ import { Checkbox } from './chunk-YCTMKKRA.js';
7
7
  import { IconButton } from './chunk-4FQT6ZAY.js';
8
8
  import { Button } from './chunk-OG6CL3EB.js';
9
9
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';