@apliteni/apliteni-ui 0.198.0 → 0.200.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.
@@ -302,7 +302,8 @@ put it in an `AppShell` page, because a page has one band.
302
302
  ```
303
303
 
304
304
  Each slot is optional. A bar with no account is the signed-out bar. On a phone the bar has two rows.
305
- The current view in `ViewSwitch` has the accent fill. The version button shows only the chosen
305
+ The current view in `ViewSwitch` has the neutral selected fill: the strong ink on the surface,
306
+ never the accent. The version button shows only the chosen
306
307
  name, and its menu shows each name with its badge and a tick on the chosen one. They follow
307
308
  `value` until you change it. `AccountMenu` marks the page named by `current` in accent ink.
308
309
 
@@ -480,7 +481,7 @@ dropdown must have a search field: [Component choice](../guidelines/component-ch
480
481
 
481
482
  `items` is a list of rows. A row has `label`, and can have `value`, `description`, `icon`,
482
483
  `avatar`, `badge`, `muted`, `selected` and `disabled`. `'---'` is a separator. `sections` groups
483
- rows under captions, with space before each next group. `header` and `footer` add content above and below the rows. `onSelect` gets the value
484
+ rows under group labels, with space before each next group. `header` and `footer` add content above and below the rows. `onSelect` gets the value
484
485
  and the row. `open`, `defaultOpen` and `onOpenChange` control the panel. `disabled` turns the
485
486
  trigger off: no keyboard stop, no panel and the disabled paint.
486
487
 
@@ -508,8 +509,9 @@ trigger off: no keyboard stop, no panel and the disabled paint.
508
509
  the field while the user is still scrolled into the room that the panel needed.
509
510
  - The panel follows its trigger when the page moves the trigger: a new layout, a sideways scroll
510
511
  or a transition.
511
- - A row names its item in the body weight, as a native list does. A group caption is a compact
512
- label in body ink.
512
+ - A row names its item in the body weight, as a native list does. A group label is 13px, bold
513
+ and in muted ink, at 5.60:1 on the panel in dark and 6.11:1 in light under every accent. The
514
+ options under it are not indented.
513
515
  - Each row answers the pointer with a fill and draws no edge. A destructive row turns `--pink` on
514
516
  hover and focus. In forced colours a separator stays a visible line.
515
517
 
@@ -517,8 +519,9 @@ trigger off: no keyboard stop, no panel and the disabled paint.
517
519
  longer current, such as an archived unit for a late invoice. Give it the state word:
518
520
  `muted: 'Archived'`. The row keeps its name in body ink and shows the word in a state badge after
519
521
  it. The row stays in the keyboard order. After a pick, the trigger shows `Cedar Studio (Archived)`.
520
- Use `disabled` for a row that the user cannot pick now. A disabled row is faded, and the arrow
521
- keys skip it.
522
+ Use `disabled` for a row that the user cannot pick now. A disabled row keeps the body weight and
523
+ takes an ink paler than the group label: 3.88:1 on the panel in light and 4.14:1 in dark, under
524
+ every accent. The arrow keys skip it.
522
525
 
523
526
  **Search.** `search` adds a text field above the rows. Typing filters the rows, and the focus stays
524
527
  in the field. The match is anywhere in the label, without case or accents. Descriptions are not
@@ -731,13 +734,20 @@ fit on one row. Use [`Tabs`](#tabs) when each choice shows a different panel. Se
731
734
  options={[{ value: 'm', label: 'Month' }, { value: 'q', label: 'Quarter' }, { value: 'y', label: 'Year' }]} />
732
735
  ```
733
736
 
734
- `appearance` is `pill`, the default, or `underline`. `size="sm"` makes the pill smaller, and in
735
- the underline appearance it changes only the type size. `block` fills the row. An option's `icon`
737
+ `appearance` is `pill`, the default, or `underline`. `size="sm"` makes the pill smaller. The
738
+ underline keeps one 13px type size in both sizes, so `size` does not change it. `block` fills the
739
+ row. Every control draws the neutral form by default: the chosen option is the strong ink on the
740
+ surface. `accent` asks for the accent fill when a product needs it; in vanilla CSS the class is `.ui-seg--accent`. `neutral` is a deprecated
741
+ no-op kept for compatibility, and goes away at the next major. An option's `icon`
736
742
  draws a glyph before its label. With `iconOnly`, the glyph is the whole button and the label is
737
- its name and its hover title.
738
-
739
- **What the user sees.** The chosen pill has the accent fill of a primary button. The chosen
740
- underline tab is its label with a 2px accent bar under it, and no box. Hover changes only the
743
+ its name and its hover title; the wordless choice draws a 32px pill around the 20px view icon — larger
744
+ than a labelled option's 16px lead — and below the phone step keeps a 44px tap zone outside the
745
+ pill, the way the back link and theme switch do.
746
+
747
+ **What the user sees.** The chosen pill has the strong ink on the surface, with no accent. With
748
+ `accent`, the chosen pill has the accent fill of a primary button. The chosen
749
+ underline tab is its label with a 2px strong bar under it, and no box; with `accent` the bar is
750
+ the accent. Hover changes only the
741
751
  ink. When the options do not fit, they wrap onto more rows, so the strip never makes the column
742
752
  wider. A long label wraps inside its own option.
743
753
 
@@ -1409,7 +1419,7 @@ chart has the title. `format` prints exact values in the readout, the live regio
1409
1419
 
1410
1420
  | `variant` | Data | `look` values | Default look |
1411
1421
  | --- | --- | --- | --- |
1412
- | `months` | `periods`, `series` | none: columns per period with a line across them, fitted to the card | |
1422
+ | `months` | `periods`, `series` | none: columns per period with a line across them | |
1413
1423
  | `bridge` | `steps` | none: one period from a start total to a result | |
1414
1424
  | `spark` | `periods`, `series` | none: one series at text size, for a stat band `trend` | |
1415
1425
  | `line` | `periods`, `series` | `thin`; `points`, a point on each value; `labels`, the last value at the line's end | `thin` |
@@ -1432,10 +1442,17 @@ values and hangs them under the line.
1432
1442
  `good`, `bad` and `neutral`. The product accent does not change them. Each full tone is at least
1433
1443
  3:1 on the card and the page in both themes.
1434
1444
 
1435
- **What the user sees.** In `months`, every period shares the card's width, so the plot never
1436
- scrolls. A bar is one flat fill of its tone. It takes two thirds of its column, and at most 48px.
1437
- Where the period labels do not fit, the chart prints every second, third or later label, counted
1438
- from the first period that is not final, or from the latest period. Set `values` to print each
1445
+ **What the user sees.** In `months`, when the card is too narrow for every bar's name, the plot
1446
+ scrolls sideways so every bar keeps its name. A bar is one flat tone — the full tone of its series
1447
+ — with a small corner at its measured end: --radius-xs or a quarter of the bar's width, whichever is
1448
+ smaller. Its foot stays square on the zero line. It takes two thirds of its column, and at most 48px.
1449
+ In `months` and `bridge`, the
1450
+ chart prints every bar's `short` name under its bar, and a short name that does not fit its column
1451
+ wraps at a word break. Give each bar a distinct `short` name, never one cut to a fixed length. Where
1452
+ one word alone is wider than the column, the plot scrolls so that word still fits, and every bar
1453
+ keeps its name. In the other variants, where the period labels do not fit, the chart prints every
1454
+ second, third or later label, counted from the first period that is not final, or from the latest
1455
+ period. The readout and the table keep the full name. Set `values` to print each
1439
1456
  bar's value past its end, in `formatAxis`: over a bar that grows up from zero, and under a bar
1440
1457
  that grows down. A value takes at most half the space to the next value,
1441
1458
  at the 12px text size, and stays inside the plot. A value that does not fit there is left out.
@@ -1451,7 +1468,7 @@ the period before it. Set `compare: false` on a period to show its value with no
1451
1468
  A switch at the top right
1452
1469
  shows the same numbers as a chart or as a table. In a titled `Card`, the switch stands in the
1453
1470
  card's title row. `table={false}` removes the switch and the table. `selectable` with `selected`
1454
- and `onSelect` lets the user pick a column, which gets a band behind it. In the other variants, at
1471
+ and `onSelect` lets the user pick a column, which gets a band behind it. At
1455
1472
  phone widths the plot scrolls and the value axis stays. A chart of periods that is wider than its
1456
1473
  card opens at its latest period. A bridge opens at its opening total.
1457
1474
 
@@ -140,13 +140,14 @@ sentence case and renders as written. A word that is capitalised in itself stays
140
140
  | `page-title` | `--text-2xl` | `--weight-bold` | `1.1` | the page's `h1` inside `AppShell` |
141
141
  | `card-title` | `--text-lg` | `--weight-semibold` | `--leading-snug` | a card's title |
142
142
  | `body` | `--text-base` | `--weight-normal` | `--leading-normal` | running text |
143
- | `label` | `--text-sm` | `--weight-medium` | inherited | an eyebrow, a table head, a nav or menu caption, a footer column title |
143
+ | `label` | `--text-sm` | `--weight-medium` | inherited | an eyebrow, a table head, a nav caption, a footer column title |
144
144
  | `caption` | `--text-sm` | `--weight-normal` | inherited | a sentence under a specimen, figure or screenshot; a code block's title |
145
145
  | `chip` | `--text-xs` | `--weight-semibold` | inherited | a badge, a pill, a menu row's badge, a version badge |
146
146
 
147
147
  On the kit's scale, these are 30, 18, 14.5, 13, 13 and 12px. When two ranks share a size,
148
148
  their weight separates them. `label` and `caption` are both 13px. Words use body ink, including
149
- labels and captions. See [Text ink](#text-ink).
149
+ labels and captions. See [Text ink](#text-ink). A dropdown's group label is outside the ranks: it
150
+ is 13px, bold and in muted ink, so it stands apart from the options under it.
150
151
 
151
152
  **A card title is a heading, one level under the page's.** `<Card>` draws an `h2`. `level`
152
153
  moves it to `h3`–`h6`. An eyebrow above a card title is a label, not a heading.
@@ -207,10 +208,11 @@ Muted and dim ink have exactly four uses:
207
208
  - **chrome** — the furniture around a drawing: a chart's value axis, its period row
208
209
  and its legend. Exact data values must remain reachable at full strength through
209
210
  pointer readouts and keyboard announcements. The values table is optional and opens
210
- on request. A field's label, a caption and a timestamp keep body ink. The one other use
211
+ on request. A field's label, a caption and a timestamp keep body ink. Another use
211
212
  is the title of a supporting card, such as a document beside the data read from it:
212
213
  add `ui-card__title--muted` so it ranks below its neighbour. Its size and weight stay
213
- the card title's.
214
+ the card title's. A dropdown's group label is chrome too. It names the options under it,
215
+ and its group keeps the name as the group's accessible name.
214
216
 
215
217
  An empty-state explanation is not an empty slot. A keyboard shortcut is language. A count is
216
218
  not a status. Generic badges use body ink. Archive and disabled variants keep their state
@@ -248,10 +250,14 @@ These fill ratios describe separation, not text contrast.
248
250
  changing one without the other is only a partial change.
249
251
  - **A disabled control is painted, never faded.** Every disabled rule with a label under it
250
252
  uses `--disabled-ink` on `--disabled-surface` at full opacity. A ghost button paints no box
251
- and uses `--disabled-ink-bare`. One rule still fades: the switch track, which has no label
252
- inside it.
253
+ and uses `--disabled-ink-bare`. A disabled option in a dropdown panel uses
254
+ `--disabled-ink-option`, which is paler than the panel's muted group label and keeps 3.5:1.
255
+ One rule still fades: the switch track, which has no label inside it.
253
256
  - **The floor is 3:1, and a disabled control never shows the pair it shows enabled.** Contrast
254
- provides legibility. The paint provides the state.
257
+ provides legibility. The paint provides the state. The kit keeps every disabled label at
258
+ 4.89:1 or more on the surface it sits on. A disabled dropdown option is the one exception: it
259
+ keeps 3.5:1 or more, so it stays paler than the group label above it. If you repaint a
260
+ disabled label, keep it at these figures.
255
261
  - **A field has no fill step, so the ground you put it on decides whether its box is seen.**
256
262
  `--field-bg` and `--disabled-surface` are both `--surface` in both themes. A field is
257
263
  therefore drawn by its edge. On the page ground, a disabled field measures 1.12:1, because
@@ -322,8 +328,11 @@ fill, because a reader never writes in one. Its ink clears 4.5:1 on that fill, w
322
328
  lowest value 5.22:1.
323
329
 
324
330
  **A selected item is the one exception.** Selection is marked by a background highlight. An
325
- enabled chosen segmented pill takes the primary button's pair, `--accent-strong` with
326
- `--accent-contrast` ink, and a 1px `--accent` edge. Where the fill is under 3:1 on the track, as
331
+ enabled chosen segmented pill marks its choice with the strong ink on the surface, `--strong`
332
+ with `--surface` text — the neutral form is the default, so a view switch, a filter and a setting
333
+ all stay off the page's accent button. Only a product that asks for the accent form takes the
334
+ primary button's pair, `--accent-strong` with `--accent-contrast` ink, and a 1px `--accent` edge.
335
+ Where the fill is under 3:1 on the track, as
327
336
  under the default accent in dark, the edge is the mark. A disabled chosen pill and an underline tab
328
337
  take no edge. A disabled chosen pill keeps `--surface-3` and the disabled
329
338
  ink.
@@ -34,4 +34,5 @@ Each row names one guideline page, the screen parts it covers, and when to read
34
34
  | [Session expired](session-expired.md) | A session-ended dialog, its page state and its lasting sign-in notice. | Read it before you handle an ended session. |
35
35
  | [Three-column page](three-column-page.md) | Three columns chained from parent to child: the selected parent, its children and the open child, with the widths, the collapse order and the column header. | Read it before you put a list, its children and the open item side by side. |
36
36
  | [Wizard](wizard.md) | Ordered steps, their states, the open step and the final action. | Read it before you build ordered steps. |
37
+ | [Dropdown](dropdown.md) | Group labels in a dropdown panel. | Read it before you group the options of a dropdown. |
37
38
  | [Guidelines](overview.md) | No screen parts. The file holds only the collection heading. | Read it only for the heading. The six-card overview is in Storybook, not in the package. |
@@ -38,7 +38,7 @@
38
38
 
39
39
  **Don't:** Use `--accent` as ground.
40
40
 
41
- **Except:** Only Nebula gives the two tokens different values. A dark selected Segmented pill adds an `--accent` edge to its `--accent-strong` ground (#832).
41
+ **Except:** Only Nebula gives the two tokens different values. A dark accent-form Segmented pill adds an `--accent` edge to its `--accent-strong` ground (#832).
42
42
 
43
43
  <!-- rule: accent-strong -->
44
44
 
@@ -46,16 +46,28 @@
46
46
 
47
47
  <!-- rule: selection-accent -->
48
48
 
49
- **Rule:** Limit selected navigation to one accent signal: a Segmented pill's fill or an underline tab's bar.
49
+ **Rule:** Limit selected navigation to one accent signal: a Segmented pill's fill in the accent form, or an underline tab's bar.
50
50
 
51
51
  **Why:** Two accent marks on one item imply two states.
52
52
 
53
- **Do:** Use contrasting ink on Segmented pills and strong ink above underline bars. See Keep text off grey fills for SidebarNav.
53
+ **Do:** Use contrasting ink on Segmented pills and strong ink above underline bars. See Keep text off grey fills.
54
54
 
55
55
  **Don't:** Add a second accent mark, such as an accent counter, to a selected tab.
56
56
 
57
57
  **Except:** NavTabs pills keep accent ink on soft fill, as fill alone is too faint (#429). A Segmented pill's edge belongs to its fill.
58
58
 
59
+ ## Draw Segmented controls in the neutral form
60
+
61
+ <!-- rule: neutral-selection -->
62
+
63
+ **Rule:** Draw every Segmented control in the neutral form; ask for the accent form only when needed.
64
+
65
+ **Why:** An accent fill competes with the page's main button wherever it sits.
66
+
67
+ **Do:** Switch between chart and table, and filter a ledger, with the neutral form.
68
+
69
+ **Don't:** Give a view switch, a filter or a setting the accent fill.
70
+
59
71
  ## Theme checks
60
72
 
61
73
  **Rule:** Check both themes and two accents before a PR.
@@ -135,3 +135,17 @@
135
135
  **Do:** Spend against Estimated, then revenue against expenses on a second chart.
136
136
 
137
137
  **Don't:** All four lines on one chart.
138
+
139
+ ## Keep every bar labelled
140
+
141
+ <!-- rule: bar-labels-distinct -->
142
+
143
+ **Rule:** Give each bar a distinct short name, never cut to a fixed length.
144
+
145
+ **Why:** A bar without a name loses meaning.
146
+
147
+ **Do:** Short names under every bar, full names in readout and table.
148
+
149
+ **Don't:** Names that repeat North and South, so the bars read alike.
150
+
151
+ **Except:** Where one word is wider than its column, the plot scrolls sideways so every bar keeps its name.
@@ -0,0 +1,13 @@
1
+ # Dropdown
2
+
3
+ ## Set group labels apart
4
+
5
+ <!-- rule: group-labels -->
6
+
7
+ **Rule:** Show a group label in bold muted ink at the size of its options, and do not indent the options.
8
+
9
+ **Why:** In the dark theme, a label like an option reads as one more option.
10
+
11
+ **Do:** Show HR in bold grey above Staff training and Job adverts.
12
+
13
+ **Don't:** Show HR in the ink and weight of its options.
@@ -24,7 +24,7 @@
24
24
 
25
25
  **Don't:** Fade timestamps, counts or enabled actions.
26
26
 
27
- **Except:** Only: (1) non-word glyphs — arrows, chevrons, dismiss marks; (2) colour reporting off, unset, disabled or archived; (3) a valueless slot, such as an empty field or cell; (4) a drawing’s furniture — a chart’s axis, period row and legend — whose values remain reachable in full. Unselected options, counts, timestamps, shortcuts, enabled actions and empty-state text are information, not exceptions.
27
+ **Except:** Only: (1) non-word glyphs — arrows, chevrons, dismiss marks; (2) colour reporting off, unset, disabled or archived; (3) a valueless slot, such as an empty field or cell; (4) a drawing’s furniture — a chart’s axis, period row and legend — whose values remain reachable in full, and a dropdown’s group label. Unselected options, counts, timestamps, shortcuts, enabled actions and empty-state text are information, not exceptions.
28
28
 
29
29
  ## Use sentence case
30
30
 
@@ -94,7 +94,7 @@
94
94
 
95
95
  <!-- rule: category-compact -->
96
96
 
97
- **Rule:** Give each category a compact, nonselectable label in body ink, with space before the next category.
97
+ **Rule:** Give each category a compact, nonselectable label, with space before the next category.
98
98
 
99
99
  **Why:** A compact label leaves the items prominent in a short list.
100
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.198.0",
3
+ "version": "0.200.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
@@ -56,9 +56,22 @@
56
56
  }
57
57
  .ui-seg {
58
58
  row-gap: var(--tap-gap) !important;
59
- --tap-clear-x: var(--space-1, 4px);
60
59
  --tap-clear-y: var(--tap-gap);
61
60
  }
61
+ .ui-seg:not(:has(button.ui-seg--icon)) {
62
+ --tap-clear-x: var(--space-1, 4px);
63
+ }
64
+ .ui-seg button.ui-seg--icon:first-child::after {
65
+ left: calc(-1 * (var(--space-1) / 2 + min(calc(var(--tap-min) - 100% - var(--space-1)), var(--tap-clear-x))));
66
+ width: min(var(--tap-min), calc(100% + var(--space-1) + min(calc(var(--tap-min) - 100% - var(--space-1)), var(--tap-clear-x))));
67
+ transform: translateY(-50%);
68
+ }
69
+ .ui-seg button.ui-seg--icon:last-child::after {
70
+ right: calc(-1 * (var(--space-1) / 2 + min(calc(var(--tap-min) - 100% - var(--space-1)), var(--tap-clear-x))));
71
+ left: auto;
72
+ width: min(var(--tap-min), calc(100% + var(--space-1) + min(calc(var(--tap-min) - 100% - var(--space-1)), var(--tap-clear-x))));
73
+ transform: translateY(-50%);
74
+ }
62
75
  .ui-seg--underline {
63
76
  row-gap: var(--space-1, 4px) !important;
64
77
  --tap-clear-y: var(--space-1, 4px);
@@ -157,6 +170,9 @@
157
170
  .ui-datepicker__panel {
158
171
  --ui-dropdown-max: 100dvh;
159
172
  }
173
+ .ui-drawer:has(.ui-datepicker__body.is-sheet) {
174
+ --drawer-h: 72vh;
175
+ }
160
176
  .ui-datepicker__head {
161
177
  --tap-clear-x: var(--tap-gap-bordered);
162
178
  --tap-clear-y: var(--tap-gap-bordered);
@@ -721,8 +721,11 @@ type SegmentedProps = {
721
721
  size?: 'sm';
722
722
  block?: boolean;
723
723
  disabled?: boolean;
724
+ accent?: boolean; /** @deprecated The neutral form is the default now. Ask for the accent with `accent`. */
725
+ neutral?: boolean;
724
726
  };
725
- declare function Segmented({ options, value, onChange, label, appearance, size, block, disabled }: SegmentedProps): react.JSX.Element;
727
+ /** Every control draws the neutral form by default; `accent` asks for the accent fill. */
728
+ declare function Segmented({ options, value, onChange, label, appearance, size, block, disabled, accent }: SegmentedProps): react.JSX.Element;
726
729
 
727
730
  type Filter = {
728
731
  id: string;
@@ -1325,7 +1328,8 @@ type ChartPeriod = {
1325
1328
  /**
1326
1329
  * The period is not final. `incomplete` is the period still running,
1327
1330
  * `projected` a future one, and `true` any other estimate. The readout and
1328
- * the table name the state; the chart at rest prints none.
1331
+ * the table name the state; the chart at rest prints only the group's
1332
+ * `Not final` label above the unfinished group, not a word per period.
1329
1333
  */
1330
1334
  estimated?: ChartEstimate;
1331
1335
  /** Why it is not final. Printed in the readout and in the table. */
@@ -3828,16 +3828,16 @@ function RowIdentity({ symbol, name, logo, href }) {
3828
3828
  // src/Segmented.tsx
3829
3829
  import { segmentedNextIndex } from "@apliteni/apliteni-ui";
3830
3830
  import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
3831
- function Segmented({ options, value, onChange, label, appearance = "pill", size, block = false, disabled = false }) {
3831
+ function Segmented({ options, value, onChange, label, appearance = "pill", size, block = false, disabled = false, accent = false }) {
3832
3832
  const enabled = options.filter((o) => !o.disabled);
3833
3833
  const tabValue = enabled.some((o) => o.value === value) ? value : enabled[0]?.value;
3834
- return /* @__PURE__ */ jsx29("div", { className: `ui-seg${size === "sm" ? " ui-seg--sm" : ""}${block ? " ui-seg--block" : ""}${appearance === "underline" ? " ui-seg--underline" : ""}`, role: "toolbar", "aria-label": label, children: options.map((option) => /* @__PURE__ */ jsxs25(
3834
+ return /* @__PURE__ */ jsx29("div", { className: `ui-seg${size === "sm" ? " ui-seg--sm" : ""}${block ? " ui-seg--block" : ""}${appearance === "underline" ? " ui-seg--underline" : ""}${accent ? " ui-seg--accent" : ""}`, role: "toolbar", "aria-label": label, children: options.map((option) => /* @__PURE__ */ jsxs25(
3835
3835
  "button",
3836
3836
  {
3837
3837
  type: "button",
3838
3838
  "data-value": option.value,
3839
3839
  disabled: disabled || option.disabled,
3840
- className: value === option.value ? "is-active" : void 0,
3840
+ className: [value === option.value ? "is-active" : null, option.icon && option.iconOnly ? "ui-seg--icon" : null].filter(Boolean).join(" ") || void 0,
3841
3841
  "aria-label": option.ariaLabel ?? (option.icon && option.iconOnly ? option.label : void 0),
3842
3842
  title: option.icon && option.iconOnly ? option.label : void 0,
3843
3843
  "aria-pressed": value === option.value,
@@ -5865,6 +5865,8 @@ var RING = {
5865
5865
  };
5866
5866
  var END_LABEL = { rise: 10, ascent: 10, drop: 20, gap: 4 };
5867
5867
  var STACK_BAR = { columns: 12, share: 20 };
5868
+ var BAR_CORNER = 6;
5869
+ var barCorner = (w) => Math.min(BAR_CORNER, w / 4);
5868
5870
  function arc(x, y, r0, r1, a0, a1) {
5869
5871
  const p = (r, a) => `${px(x + r * Math.cos(a))} ${px(y + r * Math.sin(a))}`;
5870
5872
  if (a1 - a0 >= Math.PI * 2 - 1e-9) {
@@ -6209,7 +6211,7 @@ function columnsDrawing(g) {
6209
6211
  const y0 = y(layer.from[i]);
6210
6212
  const y1 = y(layer.to[i]);
6211
6213
  const x = centre(i) - w / 2;
6212
- const d = layer === filled[filled.length - 1] ? topRounded(x, y1, w, y0 - y1, 4) : square(x, y1, w, y0 - y1);
6214
+ const d = layer === filled[filled.length - 1] ? topRounded(x, y1, w, y0 - y1, barCorner(w)) : square(x, y1, w, y0 - y1);
6213
6215
  return /* @__PURE__ */ jsx48(
6214
6216
  "path",
6215
6217
  {
@@ -6268,7 +6270,7 @@ function rowsDrawing(g, pick) {
6268
6270
  filled.map((layer) => {
6269
6271
  const x0 = rows.x(layer.from[i]);
6270
6272
  const x1 = rows.x(layer.to[i]);
6271
- const d = layer === filled[filled.length - 1] ? rightRounded(x0, top, x1 - x0, ROW_BAR, 4) : square(x0, top, x1 - x0, ROW_BAR);
6273
+ const d = layer === filled[filled.length - 1] ? rightRounded(x0, top, x1 - x0, ROW_BAR, barCorner(ROW_BAR)) : square(x0, top, x1 - x0, ROW_BAR);
6272
6274
  return /* @__PURE__ */ jsx48(
6273
6275
  "path",
6274
6276
  {
@@ -6341,20 +6343,47 @@ function Shares({ look, format, swatch }) {
6341
6343
 
6342
6344
  // src/Chart.tsx
6343
6345
  import { Fragment as Fragment22, jsx as jsx49, jsxs as jsxs45 } from "react/jsx-runtime";
6346
+ function anchorScreenBox(mark) {
6347
+ const x = Number(mark.getAttribute("x")) || 0;
6348
+ const y = Number(mark.getAttribute("y")) || 0;
6349
+ const w = Number(mark.getAttribute("width")) || 0;
6350
+ const svg = mark.closest("svg");
6351
+ const [vbX = 0, vbY = 0, vbW = 0, vbH = 0] = (svg?.getAttribute("viewBox")?.split(/\s+/) ?? []).map(Number);
6352
+ const rect = svg?.getBoundingClientRect();
6353
+ if (rect && vbW > 0 && vbH > 0 && rect.width > 0 && rect.height > 0) {
6354
+ return {
6355
+ left: rect.left + (x - vbX) * (rect.width / vbW),
6356
+ top: rect.top + (y - vbY) * (rect.height / vbH),
6357
+ width: w * (rect.width / vbW)
6358
+ };
6359
+ }
6360
+ const fallback = mark.getBoundingClientRect();
6361
+ return { left: fallback.left, top: fallback.top, width: fallback.width };
6362
+ }
6344
6363
  function placeChartTip(mark, tip) {
6345
- const rect = mark.getBoundingClientRect();
6364
+ const rect = anchorScreenBox(mark);
6346
6365
  const view = tip.ownerDocument.documentElement;
6347
6366
  const gap = parseFloat(getComputedStyle(tip).getPropertyValue("--ui-tip-gap")) || 8;
6348
6367
  const above = rect.top;
6349
- const below = view.clientHeight - rect.bottom;
6368
+ const below = view.clientHeight - rect.top;
6369
+ const card = mark.closest(".ui-card");
6370
+ const box = card ? cardContentBox(card, view) : { left: 0, right: view.clientWidth };
6371
+ tip.style.maxWidth = `min(var(--prose-caption), ${box.right - box.left}px)`;
6350
6372
  const isBelow = above < tip.offsetHeight + gap && below > above;
6351
6373
  tip.classList.toggle("is-below", isBelow);
6352
6374
  const ideal = rect.left + rect.width / 2 - tip.offsetWidth / 2;
6353
- const left = Math.max(0, Math.min(ideal, view.clientWidth - tip.offsetWidth));
6375
+ const left = Math.max(box.left, Math.min(ideal, box.right - tip.offsetWidth));
6354
6376
  tip.style.setProperty("--ui-tip-x", `${rect.left + rect.width / 2}px`);
6355
- tip.style.setProperty("--ui-tip-y", `${isBelow ? rect.bottom : rect.top}px`);
6377
+ tip.style.setProperty("--ui-tip-y", `${rect.top}px`);
6356
6378
  tip.style.setProperty("--ui-tip-shift", `${left - ideal}px`);
6357
6379
  }
6380
+ function cardContentBox(card, view) {
6381
+ const rect = card.getBoundingClientRect();
6382
+ const style = getComputedStyle(card);
6383
+ const left = rect.left + (parseFloat(style.borderLeftWidth) || 0) + (parseFloat(style.paddingLeft) || 0);
6384
+ const right = rect.right - (parseFloat(style.borderRightWidth) || 0) - (parseFloat(style.paddingRight) || 0);
6385
+ return { left: Math.max(0, left), right: Math.min(view.clientWidth, right) };
6386
+ }
6358
6387
  var HEIGHT = { months: 216, bridge: 216, spark: 32, line: 216, area: 216, stacked: 216, donut: 216 };
6359
6388
  var PAD = 2;
6360
6389
  var ZERO_INSET = 1.5;
@@ -6365,6 +6394,7 @@ var FALLBACK_COL = 48;
6365
6394
  var BAR_SHARE = 0.5;
6366
6395
  var BAR_MAX = 12;
6367
6396
  var BAR_MAX_BRIDGE = 22;
6397
+ var BRIDGE_COL = 88;
6368
6398
  var FIT_SHARE = 2 / 3;
6369
6399
  var FIT_MAX = 48;
6370
6400
  var FIT_CORNER = 6;
@@ -6378,11 +6408,6 @@ var BOUNDARY_TOP = 24;
6378
6408
  var GROUP_WORDS = "Not final";
6379
6409
  var LANE_GAP = 2;
6380
6410
  var MISSING2 = "\u2014";
6381
- function fadeOf(uid, m, bridge) {
6382
- if (!bridge && !m.foot) return null;
6383
- const up = bridge ? m.value >= 0 : m.foot === "bottom";
6384
- return { id: `${uid}-fade-${m.tone}-${up ? "up" : "down"}`, tone: m.tone, up };
6385
- }
6386
6411
  var cx9 = (...parts) => parts.filter(Boolean).join(" ");
6387
6412
  var px2 = (n) => Math.round(n * 10) / 10;
6388
6413
  var STATE_WORD = { incomplete: "Incomplete", projected: "Projected" };
@@ -6399,8 +6424,8 @@ function onPrevious(value, previous, when) {
6399
6424
  const pct2 = (value - previous) / Math.abs(previous) * 100;
6400
6425
  return `${pct2 < 0 ? "\u2212" : "+"}${Math.abs(pct2).toFixed(1)}% on ${when}`;
6401
6426
  }
6402
- function barPath(m, corner = m.w / 2) {
6403
- const r = Math.min(corner, m.w / 2, m.h / (m.foot ? 1 : 4));
6427
+ function barPath(m, corner = Math.min(FIT_CORNER, m.w / 4)) {
6428
+ const r = px2(Math.min(corner, m.w / 2, m.h / (m.foot ? 1 : 4)));
6404
6429
  const { x, y: top, w, h } = m;
6405
6430
  const bottom = top + h;
6406
6431
  const arc2 = (dx, dy, sweep) => `a${px2(r)} ${px2(r)} 0 0 ${sweep} ${px2(dx)} ${px2(dy)}`;
@@ -6703,6 +6728,7 @@ function Chart(props) {
6703
6728
  const [width, setWidth] = useState23(0);
6704
6729
  const [boxWidth, setBoxWidth] = useState23(0);
6705
6730
  const [overflows, setOverflows] = useState23(false);
6731
+ const [scrolled, setScrolled] = useState23(0);
6706
6732
  const [openId, setOpenId] = useState23(null);
6707
6733
  const [rawCursor, setCursor] = useState23(0);
6708
6734
  const [said, setSaid] = useState23("");
@@ -6850,8 +6876,6 @@ function Chart(props) {
6850
6876
  return [...out, ...dots];
6851
6877
  }, [geometry, frame, lines, keys, columns, centre, barX, barWidth, groupWidth, y, floor, colWidth, plotWidth, boxTop, boxHeight]);
6852
6878
  const byId = useMemo6(() => new Map(marks.map((m) => [m.id, m])), [marks]);
6853
- const fadeFor = useCallback8((m) => fit ? null : fadeOf(uid, m, variant === "bridge"), [fit, uid, variant]);
6854
- const fades = useMemo6(() => new Map(marks.filter((m) => m.kind === "bar").map(fadeFor).filter((f) => f !== null).map((f) => [f.id, f])), [marks, fadeFor]);
6855
6879
  const lead = useCallback8((column) => marks.find((m) => m.column === column), [marks]);
6856
6880
  const open = openId ? byId.get(openId) : void 0;
6857
6881
  useEffect23(() => {
@@ -6873,7 +6897,10 @@ function Chart(props) {
6873
6897
  const opensAtEnd = Boolean(periods);
6874
6898
  useLayoutEffect6(() => {
6875
6899
  const el = scroller.current;
6876
- if (opensAtEnd && el) el.scrollLeft = el.scrollWidth - el.clientWidth;
6900
+ if (opensAtEnd && el) {
6901
+ el.scrollLeft = el.scrollWidth - el.clientWidth;
6902
+ setScrolled(el.scrollLeft);
6903
+ }
6877
6904
  }, [opensAtEnd, plotWidth, boxWidth, count]);
6878
6905
  useLayoutEffect6(() => {
6879
6906
  const tip = tipEl.current;
@@ -6895,7 +6922,10 @@ function Chart(props) {
6895
6922
  const doc = frameEl.current?.ownerDocument;
6896
6923
  const view2 = doc?.defaultView;
6897
6924
  if (!doc || !view2) return;
6898
- const hide = () => setOpenId(null);
6925
+ const hide = (event) => {
6926
+ if (event?.target === scroller.current) return;
6927
+ setOpenId(null);
6928
+ };
6899
6929
  const escape = (event) => {
6900
6930
  if (event.key !== "Escape") return;
6901
6931
  dismissed.current = openId;
@@ -6995,14 +7025,23 @@ function Chart(props) {
6995
7025
  }
6996
7026
  );
6997
7027
  const noun = look?.layout === "ring" ? "slices" : look?.layout === "rows" ? "rows" : "columns";
7028
+ const wrapAtWords = variant === "months" || variant === "bridge";
6998
7029
  const labelRoom = Math.max(0, ...columns.map((c) => textWidth(c.short))) + LABEL_GAP;
6999
- const every = labelRoom > colWidth ? Math.ceil(labelRoom / colWidth) : 1;
7030
+ const widestWord = wrapAtWords ? Math.max(0, ...columns.flatMap((c) => c.short.split(/\s+/).map((word) => textWidth(word)))) + LABEL_GAP : labelRoom;
7031
+ const every = widestWord <= colWidth ? 1 : Math.ceil(labelRoom / colWidth);
7032
+ const floorCol = fit ? Math.ceil(widestWord) : variant === "bridge" ? Math.max(BRIDGE_COL, Math.ceil(widestWord)) : null;
7000
7033
  const anchor = groupFrom >= 0 ? groupFrom : count - 1;
7001
7034
  const labelled = (i) => ((anchor - i) % every + every) % every === 0;
7002
7035
  const edgeOf = (i) => {
7003
7036
  const half = textWidth(columns[i].short) / 2;
7004
7037
  return centre(i) - half < 0 ? "is-start" : centre(i) + half > plotWidth ? "is-end" : null;
7005
7038
  };
7039
+ const whole = (i) => {
7040
+ if (!overflows) return true;
7041
+ const left = i * colWidth;
7042
+ const right = left + colWidth;
7043
+ return left >= scrolled - 0.5 && right <= scrolled + boxWidth + 0.5;
7044
+ };
7006
7045
  const groupX = groupFrom >= 0 ? Math.min(Math.max(groupFrom * colWidth, 1), plotWidth - 1) : 0;
7007
7046
  return /* @__PURE__ */ jsxs45(
7008
7047
  "div",
@@ -7018,6 +7057,7 @@ function Chart(props) {
7018
7057
  "--ui-chart-h": `${plotHeight}px`,
7019
7058
  "--ui-chart-box": `${px2(boxHeight)}px`,
7020
7059
  "--ui-chart-cols": count,
7060
+ "--ui-chart-col": floorCol === null ? void 0 : `${floorCol}px`,
7021
7061
  "--ui-chart-pad": `${PAD}px`,
7022
7062
  "--ui-chart-top": `${PAD + roomTop}px`,
7023
7063
  "--ui-chart-bottom": `${PAD + roomBottom}px`
@@ -7066,11 +7106,13 @@ function Chart(props) {
7066
7106
  role: overflows ? "region" : void 0,
7067
7107
  "aria-label": overflows ? `${title}. Scroll for more ${noun}.` : void 0,
7068
7108
  onScroll: () => {
7109
+ setScrolled(scroller.current?.scrollLeft ?? 0);
7069
7110
  const anchor2 = [...svgEl.current?.querySelectorAll("[data-anchor]") ?? []].find((el) => el.getAttribute("data-anchor") === openId);
7070
7111
  if (!anchor2 || !scroller.current || !frameEl.current || !tipEl.current) return;
7071
- const mark = anchor2.getBoundingClientRect();
7112
+ const mark = anchorScreenBox(anchor2);
7072
7113
  const view2 = scroller.current.getBoundingClientRect();
7073
- if (mark.right <= view2.left || mark.left >= view2.right) setOpenId(null);
7114
+ if (mark.left + mark.width <= view2.left || mark.left >= view2.right) setOpenId(null);
7115
+ else if (topLayer) placeChartTip(anchor2, tipEl.current);
7074
7116
  else placeTip(frameEl.current, anchor2, tipEl.current);
7075
7117
  },
7076
7118
  children: /* @__PURE__ */ jsxs45("div", { ref: plot, className: "ui-chart__plot", children: [
@@ -7203,38 +7245,18 @@ function Chart(props) {
7203
7245
  }
7204
7246
  )
7205
7247
  ] }),
7206
- fades.size > 0 && /* @__PURE__ */ jsx49("defs", { children: [...fades.values()].map((fade) => /* @__PURE__ */ jsxs45(
7207
- "linearGradient",
7248
+ marks.filter((m) => m.kind === "bar").map((mark) => /* @__PURE__ */ jsx49(
7249
+ "path",
7208
7250
  {
7209
- id: fade.id,
7210
- className: `ui-chart__tone--${fade.tone}`,
7211
- x1: "0",
7212
- x2: "0",
7213
- y1: fade.up ? "1" : "0",
7214
- y2: fade.up ? "0" : "1",
7215
- children: [
7216
- /* @__PURE__ */ jsx49("stop", { className: "ui-chart__fade-base", offset: "0" }),
7217
- /* @__PURE__ */ jsx49("stop", { className: "ui-chart__fade-end", offset: "1" })
7218
- ]
7251
+ className: cx9(
7252
+ "ui-chart__bar",
7253
+ `ui-chart__tone--${mark.tone}`,
7254
+ mark.estimated && "is-estimated"
7255
+ ),
7256
+ d: barPath(mark)
7219
7257
  },
7220
- fade.id
7221
- )) }),
7222
- marks.filter((m) => m.kind === "bar").map((mark) => {
7223
- const fade = fadeFor(mark);
7224
- return /* @__PURE__ */ jsx49(
7225
- "path",
7226
- {
7227
- className: cx9(
7228
- "ui-chart__bar",
7229
- `ui-chart__tone--${mark.tone}`,
7230
- mark.estimated && "is-estimated"
7231
- ),
7232
- style: fade ? { "--ui-chart-paint": `url(#${fade.id})` } : void 0,
7233
- d: fit ? barPath(mark, px2(Math.min(FIT_CORNER, mark.w / 4))) : barPath(mark)
7234
- },
7235
- `bar-${mark.id}`
7236
- );
7237
- }),
7258
+ `bar-${mark.id}`
7259
+ )),
7238
7260
  marks.filter((m) => m.kind === "bar" && printed.has(m.id)).map((mark) => {
7239
7261
  const text2 = formatAxis(mark.value);
7240
7262
  const below = under.has(mark.id);
@@ -7317,7 +7339,7 @@ function Chart(props) {
7317
7339
  "span",
7318
7340
  {
7319
7341
  className: cx9("ui-chart__period", pick === i && "is-selected", every > 1 && edgeOf(i)),
7320
- children: labelled(i) ? column.short : null
7342
+ children: labelled(i) && (wrapAtWords ? whole(i) : true) ? column.short : null
7321
7343
  },
7322
7344
  `${column.label}-${i}`
7323
7345
  )) })
@@ -7325,7 +7347,7 @@ function Chart(props) {
7325
7347
  }
7326
7348
  ),
7327
7349
  /* @__PURE__ */ jsx49("span", { ref: tipEl, ...topLayer && { popover: "manual" }, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs45(Fragment22, { children: [
7328
- /* @__PURE__ */ jsx49("span", { className: "ui-tip__label", children: spark || look ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
7350
+ /* @__PURE__ */ jsx49("span", { className: "ui-tip__label", children: spark || look || variant === "bridge" ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
7329
7351
  open.rows ? /* @__PURE__ */ jsxs45(Fragment22, { children: [
7330
7352
  open.rows.map((row) => /* @__PURE__ */ jsxs45("span", { className: "ui-tip__value ui-chart__row", children: [
7331
7353
  /* @__PURE__ */ jsxs45("span", { className: cx9("ui-chart__key", `ui-chart__tone--${row.tone}`), children: [
@@ -108,8 +108,6 @@
108
108
  }
109
109
 
110
110
  .ui-chart__plot { min-width: calc(var(--ui-chart-col) * var(--ui-chart-cols, 1)); }
111
- /* The months chart's periods share the card's width, so it never scrolls. */
112
- .ui-chart--months .ui-chart__plot { min-width: 0; }
113
111
  .ui-chart__svg { display: block; }
114
112
 
115
113
  .ui-chart__periods {
@@ -129,6 +127,13 @@
129
127
  line-height: 1.45;
130
128
  overflow-wrap: anywhere;
131
129
  }
130
+ /* The months and bridge charts print every bar's short name and wrap it at a
131
+ word break, so a word is never cut. Where one word alone is wider than its
132
+ column, the component steps the labels instead. */
133
+ .ui-chart--months .ui-chart__period,
134
+ .ui-chart--bridge .ui-chart__period {
135
+ overflow-wrap: normal;
136
+ }
132
137
  /* The picked column's label: the body ink the rest of the row gives up, at the
133
138
  weight a reader who separates no colours still reads. Selection is otherwise
134
139
  the band behind the column and the band alone — the outline the chart draws
@@ -172,15 +177,15 @@
172
177
  .ui-chart__band { fill: var(--surface-3); }
173
178
 
174
179
  .ui-chart__bar {
175
- /* A bar fades from a tint of its tone at the base to the full tone at the data
176
- end. The fade is allowed because it carries no value: the strong data end, the
177
- zero line and the base hold the bar's length, and the data end alone clears
178
- 3:1. The component names the ramp per bar as --ui-chart-paint. A bridge bar
179
- fades from the previous running total to the new one. */
180
- fill: var(--ui-chart-paint, var(--ui-chart-tone));
180
+ /* One flat tone: the full tone of the bar's own series, which clears 3:1 on the
181
+ card and the page. The measured end carries a small corner of --radius-xs or a
182
+ quarter of the bar, whichever is smaller, and the foot on the zero line stays
183
+ square, so the bar's length reads off the one rule the chart draws. */
184
+ fill: var(--ui-chart-tone);
181
185
  stroke: none;
182
186
  }
183
- /* The ramp's two stops. Each reads the tone of the gradient that holds it. */
187
+ /* The ramp's two stops, which an area uses to fade over its own values. Each
188
+ stop reads the tone of the gradient that holds it. */
184
189
  .ui-chart__fade-base { stop-color: var(--ui-chart-fade); }
185
190
  .ui-chart__fade-end { stop-color: var(--ui-chart-tone); }
186
191
 
@@ -230,8 +235,8 @@
230
235
  .ui-chart--pick [data-mark] { cursor: pointer; }
231
236
 
232
237
  /* The tones. A series names one, and each is the kit's own pair of tokens: the
233
- tone, which is the data end and every line, legend key and dot, and its fade,
234
- which is a bar's base. Both are fixed steps in each theme, so a chart does not
238
+ tone, which is every bar, line, legend key and dot, and its fade, which fills
239
+ an area's base. Both are fixed steps in each theme, so a chart does not
235
240
  follow the product accent and accent-soft is not a mix towards the ground. */
236
241
  .ui-chart__tone--accent { --ui-chart-tone: var(--chart-accent); --ui-chart-fade: var(--chart-accent-fade); }
237
242
  .ui-chart__tone--accent-soft { --ui-chart-tone: var(--chart-accent-soft); --ui-chart-fade: var(--chart-accent-soft-fade); }
@@ -417,7 +417,12 @@
417
417
  .ui-dropdown__item:has(> .ui-dropdown__main > .ui-dropdown__desc) > .ui-dropdown__badge { margin-top: calc((var(--ui-dropdown-line) - var(--text-xs) * var(--leading-normal)) / 2 - var(--ui-dropdown-badge-pad)); }
418
418
 
419
419
  /* Disabled + danger rows */
420
- .ui-dropdown__item.is-disabled { /* muted-ink: state — unavailable control */ color: var(--disabled-ink); cursor: not-allowed; pointer-events: none; }
420
+ .ui-dropdown__item.is-disabled {
421
+ /* muted-ink: state — unavailable option, paler than the group label's muted ink (#886) */
422
+ color: var(--disabled-ink-option);
423
+ cursor: not-allowed;
424
+ pointer-events: none;
425
+ }
421
426
  .ui-dropdown__item.is-disabled .ui-dropdown__label,
422
427
  .ui-dropdown__item.is-disabled .ui-dropdown__desc { color: inherit; }
423
428
  /* Body ink at rest, --pink on the way to being pressed. Both states, not hover alone:
@@ -431,10 +436,10 @@
431
436
  because `+` counts a group a search query has hidden and spaced the first one left showing. */
432
437
  .ui-dropdown__section:not([hidden]) ~ .ui-dropdown__section:not([hidden]) { margin-top: var(--space-4); }
433
438
  .ui-dropdown__group {
434
- /* rank: label */
435
439
  font-size: var(--text-sm);
436
- font-weight: var(--weight-medium);
437
- color: var(--text);
440
+ font-weight: var(--weight-bold);
441
+ /* muted-ink: chrome — names the rows under it; the group's aria-label keeps the name (#886) */
442
+ color: var(--muted);
438
443
  padding: 7px 12px 4px;
439
444
  }
440
445
 
@@ -40,19 +40,31 @@
40
40
  .ui-seg button:hover { color: var(--strong); }
41
41
  /* aria-pressed is what segmented() emits now; aria-selected is kept so markup
42
42
  copied from an older release keeps painting its active pill. */
43
- /* Selection uses the accent fill. The outline marks keyboard focus only.
43
+ /* Selection uses the strong ink on the surface — the neutral form is the default.
44
+ The outline marks keyboard focus only.
44
45
  why: docs/foundations.md#the-focus-ring */
45
46
  .ui-seg button.is-active,
46
47
  .ui-seg button[aria-pressed="true"],
47
48
  .ui-seg button[aria-selected="true"] {
48
- /* The primary button's pair, so a selection and the main action share one fill. The
49
- edge carries the 3:1 mark where that fill is faint on the track, as under the default accent in dark. #832 */
49
+ color: var(--surface);
50
+ background: var(--strong);
51
+ box-shadow: none;
52
+ }
53
+
54
+ /* The accent form, only when a product asks for it: the primary button's pair, so a
55
+ selection and the main action share one fill. The edge carries the 3:1 mark where
56
+ that fill is faint on the track, as under the default accent in dark. #832 */
57
+ .ui-seg--accent button.is-active,
58
+ .ui-seg--accent button[aria-pressed="true"],
59
+ .ui-seg--accent button[aria-selected="true"] {
50
60
  color: var(--accent-contrast);
51
61
  background: var(--accent-strong);
52
62
  box-shadow: inset 0 0 0 1px var(--accent);
53
63
  }
64
+ /* The accent underline bar. */
65
+ .ui-seg--accent.ui-seg--underline button::before { background: var(--accent); }
54
66
 
55
- /* A disabled selection stays readable without the active accent fill. */
67
+ /* A disabled selection stays readable without the selected fill. */
56
68
  .ui-seg button.is-active:where(:disabled),
57
69
  .ui-seg button[aria-pressed="true"]:where(:disabled),
58
70
  .ui-seg button[aria-selected="true"]:where(:disabled) {
@@ -60,15 +72,26 @@
60
72
  box-shadow: none; /* No edge: on a control that takes no focus it reads as a ring. #832 */
61
73
  }
62
74
 
63
- /* Standard pills tighten on phones so six short month names fit one row. */
75
+ /* Standard pills tighten on phones so six short month names fit one row. The
76
+ wordless option is excluded: it has no label to fit, and its 32px pill is the
77
+ owner's decision (d54). */
64
78
  @media (max-width: 560px) {
65
- .ui-seg:not(.ui-seg--sm):not(.ui-seg--underline) button { padding: var(--space-2) var(--space-3); }
79
+ .ui-seg:not(.ui-seg--sm):not(.ui-seg--underline) button:not(.ui-seg--icon) { padding: var(--space-2) var(--space-3); }
66
80
  }
67
81
 
68
82
  /* A segment with a glyph centres it on the word, or stands alone when the glyph is
69
83
  the whole label. The glyph keeps the button glyph's size and line. */
70
84
  .ui-seg button:has(> span > svg) { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
71
85
  .ui-seg button svg { display: block; width: 16px; height: 16px; flex: none; stroke-width: 2.4; }
86
+ /* A wordless option is all glyph: the 20px view icon the owner chose (d54),
87
+ larger than a labelled option's 16px lead.
88
+ The button is a 24px square — 20px icon plus 2px inside — so the track's 4px
89
+ padding makes a 32px pill, and below the phone step
90
+ its 44px tap zone reaches past the pill, the way the 32px back link and the
91
+ 34px theme switch do. The 1.8 stroke keeps the 1.5 CSS px line at 20px in
92
+ the 24-unit box. */
93
+ .ui-seg button.ui-seg--icon { padding: 2px; }
94
+ .ui-seg button.ui-seg--icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
72
95
 
73
96
  .ui-seg--sm button { min-height: var(--space-6); padding: var(--space-1) var(--space-3); font-size: var(--text-sm); line-height: var(--leading-tight); }
74
97
  .ui-seg--block { display: flex; align-self: stretch; justify-self: stretch; }
@@ -153,7 +176,7 @@
153
176
  left: var(--space-3); right: var(--space-3); bottom: 3px;
154
177
  height: 2px;
155
178
  border-radius: 2px;
156
- background: var(--accent);
179
+ background: var(--strong);
157
180
  opacity: 0;
158
181
  transform: scaleX(0.4);
159
182
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
@@ -176,7 +199,7 @@
176
199
  color: HighlightText;
177
200
  --ring: var(--ring-width) solid CanvasText;
178
201
  }
179
- /* The fill is the one mark, so the underline bar, which would paint the accent inside it, is gone. */
202
+ /* The fill is the one mark, so the underline bar, which would paint a second mark inside it, is gone. */
180
203
  .ui-seg--underline button.is-active::before,
181
204
  .ui-seg--underline button[aria-pressed="true"]::before,
182
205
  .ui-seg--underline button[aria-selected="true"]::before { display: none; /* motion: still — the bar is not drawn while the fill marks the choice */ }
@@ -110,12 +110,34 @@
110
110
  * ships this sheet without those sheets, where order is the consumer's. */
111
111
 
112
112
  /* A strip keeps its pills packed across — that tight track IS the control —
113
- and opens down, where the room is free until it wraps. */
113
+ and opens down, where the room is free until it wraps. The 4px gap between
114
+ options is the horizontal clearance while every option is labelled; a
115
+ wordless strip reads its OUTER container's clearance instead, so its
116
+ options stop where the outer room stops. */
114
117
  .ui-seg {
115
118
  row-gap: var(--tap-gap) !important;
116
- --tap-clear-x: var(--space-1, 4px);
117
119
  --tap-clear-y: var(--tap-gap);
118
120
  }
121
+ .ui-seg:not(:has(button.ui-seg--icon)) { --tap-clear-x: var(--space-1, 4px); }
122
+
123
+ /* A wordless switch keeps its 32px pill, and each option still owns a 44px
124
+ target without crossing the shared middle: the left option reaches left
125
+ past the pill's edge, the right option reaches right, the way the 32px
126
+ back link does. Each takes 2px toward the middle (half the gap) and,
127
+ outward, half the track's 4px padding plus what the outer container clears
128
+ — 16px where it clears --tap-gap, 0 where it clears nothing, so a packed
129
+ toolbar's switch stays 28px instead of stealing a neighbour's pixel. */
130
+ .ui-seg button.ui-seg--icon:first-child::after {
131
+ left: calc(-1 * (var(--space-1) / 2 + min(calc(var(--tap-min) - 100% - var(--space-1)), var(--tap-clear-x))));
132
+ width: min(var(--tap-min), calc(100% + var(--space-1) + min(calc(var(--tap-min) - 100% - var(--space-1)), var(--tap-clear-x))));
133
+ transform: translateY(-50%);
134
+ }
135
+ .ui-seg button.ui-seg--icon:last-child::after {
136
+ right: calc(-1 * (var(--space-1) / 2 + min(calc(var(--tap-min) - 100% - var(--space-1)), var(--tap-clear-x))));
137
+ left: auto;
138
+ width: min(var(--tap-min), calc(100% + var(--space-1) + min(calc(var(--tap-min) - 100% - var(--space-1)), var(--tap-clear-x))));
139
+ transform: translateY(-50%);
140
+ }
119
141
 
120
142
  /* The underline appearance keeps the gap it draws, at every width and under
121
143
  both pointers, so a wrapped strip reads as one block. It can because the tab
@@ -180,7 +202,8 @@
180
202
  button: across, the room beside it is title text, and down, the row opens
181
203
  to 12px, because the layer reaches 10px under it and the title gap is 8.
182
204
  Between two tools the gap opens to --tap-gap, so neither layer reaches the
183
- other. A chart's switch there keeps the clearance .ui-seg declares. */
205
+ other. A chart's wordless switch reads this clearance for its outer edge,
206
+ so it reaches 44px past the pill. */
184
207
  .ui-card__head { margin-bottom: var(--space-3, 12px) !important; }
185
208
  .ui-card__tools { column-gap: var(--tap-gap) !important; --tap-clear-x: var(--tap-gap); --tap-clear-y: var(--tap-gap); }
186
209
  /* The page's title row holds small tools the same way: the room beside them is title
@@ -236,6 +259,10 @@
236
259
  /* The opened rows outgrow the menu's 300px cap, whose scroll edge cut the last
237
260
  week's tap layers in a phone popover. The panel keeps the viewport and edge limits. */
238
261
  .ui-datepicker__panel { --ui-dropdown-max: 100dvh; }
262
+ /* The same cut in the sheet: the opened grid outgrows the md drawer (45vh), so
263
+ its body scrolls and the scroll edge clips the last week's layers. The lg
264
+ step (72vh) fits the six weeks and the shortcuts. */
265
+ .ui-drawer:has(.ui-datepicker__body.is-sheet) { --drawer-h: 72vh; }
239
266
 
240
267
  /* Neither axis is opened: the room is already there, a hundred pixels to the
241
268
  caption and twelve to the grid, which is how `.ui-tabs__list` declares its
@@ -69,8 +69,9 @@
69
69
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
70
70
  }
71
71
  .dtsw a:hover { color: var(--strong); }
72
- .dtsw a.cur { color: var(--accent-contrast); background: var(--accent); }
73
- :where(:root[data-theme="dark"]) .dtsw a.cur { color: var(--signal-contrast); }
72
+ /* The current view is a view switch, so it takes the neutral selected fill:
73
+ the strong ink on the surface, never the accent. */
74
+ .dtsw a.cur { color: var(--surface); background: var(--strong); }
74
75
  @media (forced-colors: active) {
75
76
  .dtsw a.cur { forced-color-adjust: none; background: Highlight; color: HighlightText; --ring: var(--ring-width) solid CanvasText; }
76
77
  }
@@ -217,6 +217,9 @@
217
217
  floor on the dullest ground there is (--surface-3). #273
218
218
  why: docs/foundations.md#colour-and-contrast */
219
219
  --disabled-ink-bare: #a39eb7;
220
+ /* A disabled option in a menu panel: paler than --muted, so it does not take the ink of the
221
+ bold muted group label above it. 4.14:1 on --bg-elevated, over the 3:1 floor. #886 */
222
+ --disabled-ink-option: color-mix(in srgb, var(--muted) 80%, var(--bg-elevated));
220
223
 
221
224
  /* Lifted from #9b5dff, which cleared the flat surfaces and failed on its own wash over
222
225
  a card; the value was already in the ramp. --ring-color is var(--accent) and follows by
@@ -461,6 +464,8 @@
461
464
  --border-strong, so the two states read 1.52:1 and 1.24:1. #564 */
462
465
  --disabled-border: var(--border);
463
466
  --disabled-ink-bare: #585e6c;
467
+ /* 3.88:1 on --bg-elevated. #886 */
468
+ --disabled-ink-option: color-mix(in srgb, var(--muted) 80%, var(--bg-elevated));
464
469
 
465
470
  --accent: #6a2dcc;
466
471
  --accent-strong: #6a2dcc; /* already dark enough for white text */