@vokality/design-system 6.0.0 → 6.0.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to `@vokality/design-system`. The package follows [semantic versioning](https://semver.org); see CONTRIBUTING.md for what counts as breaking.
4
4
 
5
+ ## 6.0.1 — 2026-10-26
6
+
7
+ ### Fixed
8
+ - Compact Textarea respects native rows with a two-line minimum based on shared field text, padding and target tokens, including character counts. Default density retains its 8rem floor; touch retains readable 16px text and larger targets.
9
+ - Compact chat density now tightens header, thread and transcript spacing, reduces incoming-message framing and starts the composer at two short lines. Docked inbox titles leave more room for actions; the Back control uses an extra-small fine-pointer target and retains larger coarse-pointer targets. Default density and native editor behavior are unchanged.
10
+ - CommandPalette captures the current outside focus on every opening, including controlled application/native-menu actions, and restores that opening's context when it closes instead of retaining an earlier hotkey invoker.
11
+
5
12
  ## 6.0.0 — 2026-10-26
6
13
 
7
14
  - Clean native HTML and Radix component contracts: native callbacks, refs, array slider values and discriminated accordion state.
@@ -22,7 +22,7 @@ export function CommandPalette({ commands, open: openProp, onOpenChange, hotkey,
22
22
  onOpenChange?.(v);
23
23
  };
24
24
  const uid = useUid("vk-cmd");
25
- // A keyboard command has no Dialog.Trigger: its invoker is application context.
25
+ // A palette opened by an application menu or hotkey has no Dialog.Trigger.
26
26
  const invokerRef = useRef(null);
27
27
  // The hotkey listener toggles from the latest state without re-subscribing on every change.
28
28
  const toggleRef = useRef(() => { setOpen(!open); });
@@ -33,8 +33,6 @@ export function CommandPalette({ commands, open: openProp, onOpenChange, hotkey,
33
33
  const onKey = (e) => {
34
34
  if ((e.metaKey || e.ctrlKey) && (e.key === "k" || e.key === "K")) {
35
35
  e.preventDefault();
36
- if (e.target instanceof HTMLElement && !e.target.closest(".vk-cmd"))
37
- invokerRef.current = e.target;
38
36
  toggleRef.current();
39
37
  }
40
38
  };
@@ -43,6 +41,8 @@ export function CommandPalette({ commands, open: openProp, onOpenChange, hotkey,
43
41
  }, [hotkey]);
44
42
  return (_jsxs(Dialog, { open: open, onOpenChange: setOpen, title: title || messages.commandPalette, className: "vk-cmd", size: "md", contentProps: {
45
43
  onOpenAutoFocus(event) {
44
+ const active = document.activeElement;
45
+ invokerRef.current = active instanceof HTMLElement && active !== document.body && active !== document.documentElement && !active.closest(".vk-cmd") ? active : null;
46
46
  event.preventDefault();
47
47
  document.getElementById(uid + "-search")?.focus();
48
48
  },
@@ -51,6 +51,7 @@ export function CommandPalette({ commands, open: openProp, onOpenChange, hotkey,
51
51
  event.preventDefault();
52
52
  invokerRef.current.focus();
53
53
  }
54
+ invokerRef.current = null;
54
55
  }
55
56
  }, children: [_jsx(PaletteSearch, { uid: uid, commands: commands, placeholder: placeholder, emptyText: emptyText, close: () => { setOpen(false); } }), _jsxs("div", { className: "vk-cmd-footer", "aria-hidden": "true", children: [_jsx(Kbd, { children: "↑" }), _jsx(Kbd, { children: "↓" }), messages.commandMove, _jsx(Kbd, { children: "Enter" }), messages.commandRun, _jsx(Kbd, { children: "Esc" }), messages.commandClose] })] }));
56
57
  }
@@ -2141,6 +2141,20 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
2141
2141
  .vk-chat-composer .vk-rich-content { min-height: 4rem; max-height: 8rem; overflow-y: auto; padding: var(--space-sm); }
2142
2142
  .vk-chat-composer-actions { display: flex; justify-content: flex-end; }
2143
2143
  .vk-chat-composer-actions .vk-btn { width: auto; }
2144
+ /* Dense workspaces spend their width on the conversation rather than repeated message frames. */
2145
+ [data-density="compact"] .vk-chat-header,
2146
+ [data-density="compact"] .vk-chat-transcript,
2147
+ [data-density="compact"] .vk-chat-composer,
2148
+ [data-density="compact"] .vk-chat-read-only { padding: var(--space-sm); }
2149
+ [data-density="compact"] .vk-chat-title { flex: 1; font-size: var(--text-sm); }
2150
+ [data-density="compact"] .vk-chat-messages { gap: var(--space-md); }
2151
+ [data-density="compact"] .vk-chat-message { max-width: 100%; }
2152
+ [data-density="compact"] .vk-chat-message-body { padding: var(--space-xs) var(--space-sm); border-color: transparent; }
2153
+ [data-density="compact"] .vk-chat-message-incoming .vk-chat-message-body { padding-inline: 0; background: transparent; }
2154
+ [data-density="compact"] .vk-chat-activity-line,
2155
+ [data-density="compact"] .vk-chat-activity-body { padding-inline: var(--space-sm); }
2156
+ /* Start with two short lines; the editor still grows, then scrolls within the bounded composer. */
2157
+ [data-density="compact"] .vk-chat-composer .vk-rich-content { min-height: calc(var(--control-height) + var(--space-sm)); }
2144
2158
  @media (max-width: 40rem) {
2145
2159
  .vk-chat-header, .vk-chat-transcript, .vk-chat-composer, .vk-chat-read-only { padding: var(--space-sm); }
2146
2160
  .vk-chat-activity-line, .vk-chat-activity-body { padding-inline: var(--space-sm); }
@@ -2195,6 +2209,10 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
2195
2209
  .vk-chat-back { display: none; }
2196
2210
  .vk-chat-header-actions { display: flex; flex: none; align-items: center; gap: var(--space-xs); margin-inline-start: auto; }
2197
2211
  .vk-chat-header-actions .vk-btn { width: auto; }
2212
+ [data-density="compact"] .vk-chat-thread { padding: var(--space-sm); }
2213
+ @media (pointer: fine) and (not (any-pointer: coarse)) {
2214
+ [data-density="compact"] .vk-chat-back { --button-height: var(--control-height-xs); }
2215
+ }
2198
2216
  @container (max-width: 40rem) {
2199
2217
  .vk-chat-inbox-list { border-inline-end: 0; }
2200
2218
  .vk-chat-inbox:not(.vk-chat-inbox-selected) .vk-chat-inbox-detail, .vk-chat-inbox-selected .vk-chat-inbox-list { display: none; }
@@ -2207,6 +2225,11 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
2207
2225
  On fine pointers the control height is 32px; with any coarse pointer it stays 44px, and buttons follow it either way. */
2208
2226
  [data-density="compact"] { --button-height: var(--control-height); --button-height-sm: var(--control-height); }
2209
2227
  html[data-density="compact"] body { font-size: var(--text-sm); }
2228
+ /* Native rows sets multiline height; compact fields keep two readable lines rather than an 8rem floor. */
2229
+ [data-density="compact"] .vk-textarea {
2230
+ padding-block: var(--control-padding-block, var(--space-xs));
2231
+ min-height: max(var(--control-height), calc(2lh + 2 * var(--control-padding-block, var(--space-xs)) + 2px));
2232
+ }
2210
2233
  [data-density="compact"] .vk-page-header { container-type: inline-size; box-sizing: border-box; width: 100%; gap: var(--space-sm); padding-block: 0; }
2211
2234
  [data-density="compact"] .vk-page-header-divider { padding-bottom: var(--space-md); margin-bottom: 0; }
2212
2235
  [data-density="compact"] .vk-page-header-row { display: grid; grid-template-columns: minmax(min-content, 1fr) minmax(0, auto); align-items: center; gap: var(--space-xs) var(--space-md); }
@@ -2288,7 +2311,7 @@ html[data-density="compact"] body { font-size: var(--text-sm); }
2288
2311
  [data-vk-size="xs"] {
2289
2312
  --control-height: var(--control-height-xs);
2290
2313
  --control-font-size: var(--text-xs);
2291
- --control-padding-block: 0;
2314
+ --control-padding-block: 0px;
2292
2315
  --control-padding-inline: var(--space-sm);
2293
2316
  --control-icon-size: 14px;
2294
2317
  }
package/dist/vokality.css CHANGED
@@ -2487,6 +2487,20 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
2487
2487
  .vk-chat-composer .vk-rich-content { min-height: 4rem; max-height: 8rem; overflow-y: auto; padding: var(--space-sm); }
2488
2488
  .vk-chat-composer-actions { display: flex; justify-content: flex-end; }
2489
2489
  .vk-chat-composer-actions .vk-btn { width: auto; }
2490
+ /* Dense workspaces spend their width on the conversation rather than repeated message frames. */
2491
+ [data-density="compact"] .vk-chat-header,
2492
+ [data-density="compact"] .vk-chat-transcript,
2493
+ [data-density="compact"] .vk-chat-composer,
2494
+ [data-density="compact"] .vk-chat-read-only { padding: var(--space-sm); }
2495
+ [data-density="compact"] .vk-chat-title { flex: 1; font-size: var(--text-sm); }
2496
+ [data-density="compact"] .vk-chat-messages { gap: var(--space-md); }
2497
+ [data-density="compact"] .vk-chat-message { max-width: 100%; }
2498
+ [data-density="compact"] .vk-chat-message-body { padding: var(--space-xs) var(--space-sm); border-color: transparent; }
2499
+ [data-density="compact"] .vk-chat-message-incoming .vk-chat-message-body { padding-inline: 0; background: transparent; }
2500
+ [data-density="compact"] .vk-chat-activity-line,
2501
+ [data-density="compact"] .vk-chat-activity-body { padding-inline: var(--space-sm); }
2502
+ /* Start with two short lines; the editor still grows, then scrolls within the bounded composer. */
2503
+ [data-density="compact"] .vk-chat-composer .vk-rich-content { min-height: calc(var(--control-height) + var(--space-sm)); }
2490
2504
  @media (max-width: 40rem) {
2491
2505
  .vk-chat-header, .vk-chat-transcript, .vk-chat-composer, .vk-chat-read-only { padding: var(--space-sm); }
2492
2506
  .vk-chat-activity-line, .vk-chat-activity-body { padding-inline: var(--space-sm); }
@@ -2541,6 +2555,10 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
2541
2555
  .vk-chat-back { display: none; }
2542
2556
  .vk-chat-header-actions { display: flex; flex: none; align-items: center; gap: var(--space-xs); margin-inline-start: auto; }
2543
2557
  .vk-chat-header-actions .vk-btn { width: auto; }
2558
+ [data-density="compact"] .vk-chat-thread { padding: var(--space-sm); }
2559
+ @media (pointer: fine) and (not (any-pointer: coarse)) {
2560
+ [data-density="compact"] .vk-chat-back { --button-height: var(--control-height-xs); }
2561
+ }
2544
2562
  @container (max-width: 40rem) {
2545
2563
  .vk-chat-inbox-list { border-inline-end: 0; }
2546
2564
  .vk-chat-inbox:not(.vk-chat-inbox-selected) .vk-chat-inbox-detail, .vk-chat-inbox-selected .vk-chat-inbox-list { display: none; }
@@ -2553,6 +2571,11 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
2553
2571
  On fine pointers the control height is 32px; with any coarse pointer it stays 44px, and buttons follow it either way. */
2554
2572
  [data-density="compact"] { --button-height: var(--control-height); --button-height-sm: var(--control-height); }
2555
2573
  html[data-density="compact"] body { font-size: var(--text-sm); }
2574
+ /* Native rows sets multiline height; compact fields keep two readable lines rather than an 8rem floor. */
2575
+ [data-density="compact"] .vk-textarea {
2576
+ padding-block: var(--control-padding-block, var(--space-xs));
2577
+ min-height: max(var(--control-height), calc(2lh + 2 * var(--control-padding-block, var(--space-xs)) + 2px));
2578
+ }
2556
2579
  [data-density="compact"] .vk-page-header { container-type: inline-size; box-sizing: border-box; width: 100%; gap: var(--space-sm); padding-block: 0; }
2557
2580
  [data-density="compact"] .vk-page-header-divider { padding-bottom: var(--space-md); margin-bottom: 0; }
2558
2581
  [data-density="compact"] .vk-page-header-row { display: grid; grid-template-columns: minmax(min-content, 1fr) minmax(0, auto); align-items: center; gap: var(--space-xs) var(--space-md); }
@@ -2634,7 +2657,7 @@ html[data-density="compact"] body { font-size: var(--text-sm); }
2634
2657
  [data-vk-size="xs"] {
2635
2658
  --control-height: var(--control-height-xs);
2636
2659
  --control-font-size: var(--text-xs);
2637
- --control-padding-block: 0;
2660
+ --control-padding-block: 0px;
2638
2661
  --control-padding-inline: var(--space-sm);
2639
2662
  --control-icon-size: 14px;
2640
2663
  }
@@ -19798,8 +19798,6 @@ Defaulting to \`null\`.`;
19798
19798
  const onKey = (e) => {
19799
19799
  if ((e.metaKey || e.ctrlKey) && (e.key === "k" || e.key === "K")) {
19800
19800
  e.preventDefault();
19801
- if (e.target instanceof HTMLElement && !e.target.closest(".vk-cmd"))
19802
- invokerRef.current = e.target;
19803
19801
  toggleRef.current();
19804
19802
  }
19805
19803
  };
@@ -19816,6 +19814,8 @@ Defaulting to \`null\`.`;
19816
19814
  size: "md",
19817
19815
  contentProps: {
19818
19816
  onOpenAutoFocus(event) {
19817
+ const active = document.activeElement;
19818
+ invokerRef.current = active instanceof HTMLElement && active !== document.body && active !== document.documentElement && !active.closest(".vk-cmd") ? active : null;
19819
19819
  event.preventDefault();
19820
19820
  document.getElementById(uid + "-search")?.focus();
19821
19821
  },
@@ -19824,6 +19824,7 @@ Defaulting to \`null\`.`;
19824
19824
  event.preventDefault();
19825
19825
  invokerRef.current.focus();
19826
19826
  }
19827
+ invokerRef.current = null;
19827
19828
  }
19828
19829
  },
19829
19830
  children: [
@@ -30,6 +30,8 @@ function Inbox({ threads, items }: { threads: ChatThread[]; items: ChatItem[] })
30
30
 
31
31
  `headerActions` puts controls at the trailing end of the header that is showing: the conversation header (after Back and the title) while a thread is open, otherwise the thread-list header. Use `size="xs"` `IconButton`s and `Button`s, such as a docked pane's close action and an "Open task" link, so the header stays one row at 380px. The application decides what to show for the open thread.
32
32
 
33
+ With `ThemeProvider density="compact"`, headers and thread rows use smaller insets, the two-line title yields space to header actions, and Back uses the extra-small fine-pointer target while coarse pointers keep their larger target. The transcript has tighter message spacing and quiet incoming messages; outgoing messages retain their tinted surface. The composer begins with a shorter writing area and grows before scrolling. Use this shared density contract for docked application panes rather than overriding chat styles in the application.
34
+
33
35
  Selecting a thread focuses its heading after the application accepts the selection. Back returns focus to its thread button. The layout responds to container width, including inside a narrow desktop column. No viewport listener, custom list keyboard behavior or routing is added.
34
36
 
35
37
  ## Conversation and composer
@@ -75,6 +75,8 @@ The Send action is disabled for empty drafts, while `disabled` or `sending` is t
75
75
 
76
76
  The composer shows the writing field first. Its lower action row contains Aa, emoji, and an attachment action when uploads are configured. Aa reveals bold, italic, link and bullet-list tools; the full standalone editor toolbar is kept out of the initial chat view.
77
77
 
78
+ Compact density starts the writing area at two short lines while retaining growth, bounded scrolling and every formatting/upload action. Its transcript uses tighter message spacing and quieter incoming-message surfaces; outgoing messages retain their tint. Default density keeps its existing presentation.
79
+
78
80
  ## States and layout
79
81
 
80
82
  - `open`, `defaultOpen`, `onOpenChange` and `modal` pass directly to Radix. The default is non-modal. `align` chooses the start or end corner; end is the default.
@@ -8,6 +8,8 @@ A `Dialog` (Radix Dialog) near the top of the screen (12vh down) with a borderle
8
8
  ## Keyboard
9
9
  ⌘K / Ctrl+K toggles it from anywhere. Typing filters by label, keywords and group; ↓ ↑ move; Enter runs the command and closes; Esc or a backdrop click closes it and returns focus.
10
10
 
11
+ Controlled `open` changes work for application or native-menu actions too. Every opening captures the currently focused element outside the palette before focusing search, so closing returns to that opening's context rather than a previous hotkey invoker. Applications do not need a second focus-restoration wrapper.
12
+
11
13
  ## Accessibility
12
14
  A modal dialog containing a combobox (the search) that controls a listbox of options; the active command is announced through `aria-activedescendant`.
13
15
 
@@ -3,7 +3,7 @@
3
3
  A multi-line text control for notes, descriptions and messages.
4
4
 
5
5
  ## Anatomy
6
- Same box as `Input` (`card` fill, `input-border` edge, square, 0.6rem 0.75rem padding), 5 rows by default, at least 8rem tall, line height 1.6, resizable vertically only.
6
+ Same box as `Input` (`card` fill, `input-border` edge, square, 0.6rem 0.75rem padding), 5 rows by default, line height 1.6, resizable vertically only. Default density keeps an 8rem minimum. Compact density follows native `rows` with a minimum of two readable lines plus shared field padding and borders, never smaller than the control target.
7
7
 
8
8
  ## States
9
9
  Identical to `Input`: focus adds a `primary` border and the 2px `ring` outline; invalid gets a `primary` border; disabled is transparent with a dashed edge and `muted-subtle` text.
@@ -21,4 +21,4 @@ Identical to `Input`: focus adds a `primary` border and the 2px `ring` outline;
21
21
 
22
22
  ## Sizes
23
23
 
24
- `size="xs" | "sm" | "md"` controls text size and padding, using the same scale as other fields. `rows` and the 8rem minimum still determine the multiline height. On fine pointers, the text sizes are 12px, 14px and 16px. A coarse pointer keeps 16px field text. Omit `size` to follow the app's density.
24
+ `size="xs" | "sm" | "md"` controls text size and padding, using the same scale as other fields. `rows` controls the initial multiline height within the density's minimum, including with `showCount`. In compact density, `rows={2}` starts smaller than `rows={5}` without an application height override. On fine pointers, the text sizes are 12px, 14px and 16px. A coarse pointer keeps 16px field text and a target of at least 44px. Native vertical resizing and scrolling remain available. Omit `size` to follow the app's density.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vokality/design-system",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Vokality's design system: tokens, themes and React components for every Vokality project.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,