@apliteni/apliteni-ui 0.199.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.
@@ -481,7 +481,7 @@ dropdown must have a search field: [Component choice](../guidelines/component-ch
481
481
 
482
482
  `items` is a list of rows. A row has `label`, and can have `value`, `description`, `icon`,
483
483
  `avatar`, `badge`, `muted`, `selected` and `disabled`. `'---'` is a separator. `sections` groups
484
- 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
485
485
  and the row. `open`, `defaultOpen` and `onOpenChange` control the panel. `disabled` turns the
486
486
  trigger off: no keyboard stop, no panel and the disabled paint.
487
487
 
@@ -509,8 +509,9 @@ trigger off: no keyboard stop, no panel and the disabled paint.
509
509
  the field while the user is still scrolled into the room that the panel needed.
510
510
  - The panel follows its trigger when the page moves the trigger: a new layout, a sideways scroll
511
511
  or a transition.
512
- - A row names its item in the body weight, as a native list does. A group caption is a compact
513
- 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.
514
515
  - Each row answers the pointer with a fill and draws no edge. A destructive row turns `--pink` on
515
516
  hover and focus. In forced colours a separator stays a visible line.
516
517
 
@@ -518,8 +519,9 @@ trigger off: no keyboard stop, no panel and the disabled paint.
518
519
  longer current, such as an archived unit for a late invoice. Give it the state word:
519
520
  `muted: 'Archived'`. The row keeps its name in body ink and shows the word in a state badge after
520
521
  it. The row stays in the keyboard order. After a pick, the trigger shows `Cedar Studio (Archived)`.
521
- Use `disabled` for a row that the user cannot pick now. A disabled row is faded, and the arrow
522
- 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.
523
525
 
524
526
  **Search.** `search` adds a text field above the rows. Typing filters the rows, and the focus stays
525
527
  in the field. The match is anywhere in the label, without case or accents. Descriptions are not
@@ -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
@@ -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. |
@@ -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.199.0",
3
+ "version": "0.200.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
@@ -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
 
@@ -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 */