@k2b/ui 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +1 -1
  2. package/dist/base.css +147 -2
  3. package/dist/browser/actions/ContextMenu.js +30 -4
  4. package/dist/browser/actions/ContextMenu.js.map +1 -1
  5. package/dist/browser/actions/Dropdown.js +184 -158
  6. package/dist/browser/actions/Dropdown.js.map +1 -1
  7. package/dist/browser/actions/GestureMenu.js +71 -138
  8. package/dist/browser/actions/GestureMenu.js.map +1 -1
  9. package/dist/browser/actions/Toolbar.js +379 -48
  10. package/dist/browser/actions/Toolbar.js.map +1 -1
  11. package/dist/browser/actions/index.js.map +1 -1
  12. package/dist/browser/actions/menu-rows.js +15 -0
  13. package/dist/browser/actions/menu-rows.js.map +1 -0
  14. package/dist/browser/actions/menu-sheet.js +154 -0
  15. package/dist/browser/actions/menu-sheet.js.map +1 -0
  16. package/dist/browser/actions/toolbar-messages.js +20 -0
  17. package/dist/browser/actions/toolbar-messages.js.map +1 -0
  18. package/dist/browser/chart-inspection.js +3 -0
  19. package/dist/browser/chart-inspection.js.map +1 -0
  20. package/dist/browser/chat/ChatComposer.js +581 -397
  21. package/dist/browser/chat/ChatComposer.js.map +1 -1
  22. package/dist/browser/chat/chat-messages.js +19 -1
  23. package/dist/browser/chat/chat-messages.js.map +1 -1
  24. package/dist/browser/chat/command-search.js +3 -0
  25. package/dist/browser/chat/command-search.js.map +1 -1
  26. package/dist/browser/chat/index.js +2 -0
  27. package/dist/browser/chat/index.js.map +1 -1
  28. package/dist/browser/chat/reaction-people.js +15 -0
  29. package/dist/browser/chat/reaction-people.js.map +1 -0
  30. package/dist/browser/content/Chart.js +6 -15
  31. package/dist/browser/content/Chart.js.map +1 -1
  32. package/dist/browser/content/ChartSnapshotView.js +7 -10
  33. package/dist/browser/content/ChartSnapshotView.js.map +1 -1
  34. package/dist/browser/content/MessageRow.js +330 -448
  35. package/dist/browser/content/MessageRow.js.map +1 -1
  36. package/dist/browser/content/ReactionBar.js +419 -0
  37. package/dist/browser/content/ReactionBar.js.map +1 -0
  38. package/dist/browser/content/chart-inspection-core.js +557 -0
  39. package/dist/browser/content/chart-inspection-core.js.map +1 -0
  40. package/dist/browser/content/chart-inspection.js +10 -445
  41. package/dist/browser/content/chart-inspection.js.map +1 -1
  42. package/dist/browser/content/chart-line-gaps.js +1 -1
  43. package/dist/browser/content/chart-line-gaps.js.map +1 -1
  44. package/dist/browser/content/chart-snapshot.js +1 -1
  45. package/dist/browser/content/chart-snapshot.js.map +1 -1
  46. package/dist/browser/content/index.js +1 -0
  47. package/dist/browser/content/index.js.map +1 -1
  48. package/dist/browser/feedback/dialog-core.js +135 -23
  49. package/dist/browser/feedback/dialog-core.js.map +1 -1
  50. package/dist/browser/index.js +1 -0
  51. package/dist/browser/index.js.map +1 -1
  52. package/dist/browser/input-mode.js +40 -0
  53. package/dist/browser/input-mode.js.map +1 -0
  54. package/dist/browser/inputs/FileDropTarget.js +24 -9
  55. package/dist/browser/inputs/FileDropTarget.js.map +1 -1
  56. package/dist/browser/inputs/FileInputs.js +2 -2
  57. package/dist/browser/inputs/FileInputs.js.map +1 -1
  58. package/dist/browser/inputs/SelectChip.js +9 -0
  59. package/dist/browser/inputs/SelectChip.js.map +1 -1
  60. package/dist/browser/inputs/emoji/EmojiPicker.js +13 -0
  61. package/dist/browser/inputs/emoji/EmojiPicker.js.map +1 -1
  62. package/dist/browser/inputs/file-drop.js.map +1 -1
  63. package/dist/browser/layout/DetailPanel.js +283 -197
  64. package/dist/browser/layout/DetailPanel.js.map +1 -1
  65. package/dist/browser/layout/Discussion.js +233 -185
  66. package/dist/browser/layout/Discussion.js.map +1 -1
  67. package/dist/browser/layout/TableOfContents.js +10 -2
  68. package/dist/browser/layout/TableOfContents.js.map +1 -1
  69. package/dist/browser/layout/detail-panel-messages.js +35 -0
  70. package/dist/browser/layout/detail-panel-messages.js.map +1 -0
  71. package/dist/browser/surfaces/Avatar.js +50 -20
  72. package/dist/browser/surfaces/Avatar.js.map +1 -1
  73. package/dist/browser/surfaces/AvatarStack.js +406 -0
  74. package/dist/browser/surfaces/AvatarStack.js.map +1 -0
  75. package/dist/browser/surfaces/avatar-messages.js +8 -2
  76. package/dist/browser/surfaces/avatar-messages.js.map +1 -1
  77. package/dist/browser/surfaces/index.js +1 -0
  78. package/dist/browser/surfaces/index.js.map +1 -1
  79. package/dist/ssr/actions/ContextMenu.js +21 -3
  80. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  81. package/dist/ssr/actions/Dropdown.js +140 -72
  82. package/dist/ssr/actions/Dropdown.js.map +1 -1
  83. package/dist/ssr/actions/GestureMenu.js +52 -106
  84. package/dist/ssr/actions/GestureMenu.js.map +1 -1
  85. package/dist/ssr/actions/Toolbar.js +294 -14
  86. package/dist/ssr/actions/Toolbar.js.map +1 -1
  87. package/dist/ssr/actions/index.js.map +1 -1
  88. package/dist/ssr/actions/menu-rows.js +15 -0
  89. package/dist/ssr/actions/menu-rows.js.map +1 -0
  90. package/dist/ssr/actions/menu-sheet.js +138 -0
  91. package/dist/ssr/actions/menu-sheet.js.map +1 -0
  92. package/dist/ssr/actions/toolbar-messages.js +20 -0
  93. package/dist/ssr/actions/toolbar-messages.js.map +1 -0
  94. package/dist/ssr/chart-inspection.js +3 -0
  95. package/dist/ssr/chart-inspection.js.map +1 -0
  96. package/dist/ssr/chat/ChatComposer.js +263 -89
  97. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  98. package/dist/ssr/chat/chat-messages.js +19 -1
  99. package/dist/ssr/chat/chat-messages.js.map +1 -1
  100. package/dist/ssr/chat/command-search.js +3 -0
  101. package/dist/ssr/chat/command-search.js.map +1 -1
  102. package/dist/ssr/chat/index.js +2 -0
  103. package/dist/ssr/chat/index.js.map +1 -1
  104. package/dist/ssr/chat/reaction-people.js +15 -0
  105. package/dist/ssr/chat/reaction-people.js.map +1 -0
  106. package/dist/ssr/content/Chart.js +6 -15
  107. package/dist/ssr/content/Chart.js.map +1 -1
  108. package/dist/ssr/content/ChartSnapshotView.js +7 -10
  109. package/dist/ssr/content/ChartSnapshotView.js.map +1 -1
  110. package/dist/ssr/content/MessageRow.js +98 -152
  111. package/dist/ssr/content/MessageRow.js.map +1 -1
  112. package/dist/ssr/content/ReactionBar.js +304 -0
  113. package/dist/ssr/content/ReactionBar.js.map +1 -0
  114. package/dist/ssr/content/chart-inspection-core.js +557 -0
  115. package/dist/ssr/content/chart-inspection-core.js.map +1 -0
  116. package/dist/ssr/content/chart-inspection.js +10 -445
  117. package/dist/ssr/content/chart-inspection.js.map +1 -1
  118. package/dist/ssr/content/chart-line-gaps.js +1 -1
  119. package/dist/ssr/content/chart-line-gaps.js.map +1 -1
  120. package/dist/ssr/content/chart-snapshot.js +1 -1
  121. package/dist/ssr/content/chart-snapshot.js.map +1 -1
  122. package/dist/ssr/content/index.js +1 -0
  123. package/dist/ssr/content/index.js.map +1 -1
  124. package/dist/ssr/feedback/dialog-core.js +135 -23
  125. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  126. package/dist/ssr/index.js +1 -0
  127. package/dist/ssr/index.js.map +1 -1
  128. package/dist/ssr/input-mode.js +40 -0
  129. package/dist/ssr/input-mode.js.map +1 -0
  130. package/dist/ssr/inputs/FileDropTarget.js +17 -5
  131. package/dist/ssr/inputs/FileDropTarget.js.map +1 -1
  132. package/dist/ssr/inputs/FileInputs.js +2 -2
  133. package/dist/ssr/inputs/FileInputs.js.map +1 -1
  134. package/dist/ssr/inputs/SelectChip.js +9 -0
  135. package/dist/ssr/inputs/SelectChip.js.map +1 -1
  136. package/dist/ssr/inputs/emoji/EmojiPicker.js +12 -0
  137. package/dist/ssr/inputs/emoji/EmojiPicker.js.map +1 -1
  138. package/dist/ssr/inputs/file-drop.js.map +1 -1
  139. package/dist/ssr/layout/DetailPanel.js +112 -58
  140. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  141. package/dist/ssr/layout/Discussion.js +63 -36
  142. package/dist/ssr/layout/Discussion.js.map +1 -1
  143. package/dist/ssr/layout/TableOfContents.js +10 -2
  144. package/dist/ssr/layout/TableOfContents.js.map +1 -1
  145. package/dist/ssr/layout/detail-panel-messages.js +35 -0
  146. package/dist/ssr/layout/detail-panel-messages.js.map +1 -0
  147. package/dist/ssr/surfaces/Avatar.js +20 -2
  148. package/dist/ssr/surfaces/Avatar.js.map +1 -1
  149. package/dist/ssr/surfaces/AvatarStack.js +286 -0
  150. package/dist/ssr/surfaces/AvatarStack.js.map +1 -0
  151. package/dist/ssr/surfaces/avatar-messages.js +8 -2
  152. package/dist/ssr/surfaces/avatar-messages.js.map +1 -1
  153. package/dist/ssr/surfaces/index.js +1 -0
  154. package/dist/ssr/surfaces/index.js.map +1 -1
  155. package/dist/styles.css +1 -1
  156. package/dist/types/actions/ContextMenu.d.ts +8 -0
  157. package/dist/types/actions/Dropdown.d.ts +12 -5
  158. package/dist/types/actions/GestureMenu.d.ts +6 -4
  159. package/dist/types/actions/Toolbar.d.ts +20 -0
  160. package/dist/types/actions/index.d.ts +1 -1
  161. package/dist/types/actions/menu-rows.d.ts +5 -0
  162. package/dist/types/actions/menu-sheet.d.ts +22 -0
  163. package/dist/types/actions/toolbar-messages.d.ts +8 -0
  164. package/dist/types/chart-inspection.d.ts +2 -0
  165. package/dist/types/chat/ChatComposer.d.ts +7 -0
  166. package/dist/types/chat/chat-messages.d.ts +10 -2
  167. package/dist/types/chat/command-search.d.ts +2 -0
  168. package/dist/types/chat/index.d.ts +2 -0
  169. package/dist/types/chat/reaction-people.d.ts +9 -0
  170. package/dist/types/content/Chart.d.ts +2 -2
  171. package/dist/types/content/MessageRow.d.ts +3 -10
  172. package/dist/types/content/ReactionBar.d.ts +32 -0
  173. package/dist/types/content/chart-inspection-core.d.ts +61 -0
  174. package/dist/types/content/chart-inspection.d.ts +4 -20
  175. package/dist/types/content/chart-snapshot.d.ts +1 -1
  176. package/dist/types/content/index.d.ts +2 -1
  177. package/dist/types/feedback/dialog-core.d.ts +16 -1
  178. package/dist/types/index.d.ts +1 -0
  179. package/dist/types/input-mode.d.ts +7 -0
  180. package/dist/types/inputs/FileDropTarget.d.ts +6 -3
  181. package/dist/types/inputs/SelectChip.d.ts +2 -0
  182. package/dist/types/inputs/file-drop.d.ts +2 -0
  183. package/dist/types/layout/DetailPanel.d.ts +11 -0
  184. package/dist/types/layout/Discussion.d.ts +8 -0
  185. package/dist/types/layout/TableOfContents.d.ts +2 -0
  186. package/dist/types/layout/detail-panel-messages.d.ts +15 -0
  187. package/dist/types/surfaces/Avatar.d.ts +12 -0
  188. package/dist/types/surfaces/AvatarStack.d.ts +41 -0
  189. package/dist/types/surfaces/avatar-messages.d.ts +3 -0
  190. package/dist/types/surfaces/index.d.ts +3 -1
  191. package/package.json +6 -1
@@ -14,4 +14,12 @@ export type ContextMenuProps = {
14
14
  };
15
15
  /** Right-click menu with keyboard invocation, one-open-at-a-time behavior, and viewport clamping. */
16
16
  export declare function ContextMenu(props: ContextMenuProps): JSX.Element;
17
+ /**
18
+ * Package-internal, not exported from the package index: `openAt` lets GestureMenu open the menu at a held finger, and
19
+ * `title` names what was pressed above the entries, since the finger covers it.
20
+ */
21
+ export declare function ContextMenuBase(props: ContextMenuProps & {
22
+ openAt?: (open: (x: number, y: number) => void) => void;
23
+ title?: string;
24
+ }): JSX.Element;
17
25
  export default ContextMenu;
@@ -23,6 +23,12 @@ export type DropdownAction = (DropdownActionBase & {
23
23
  * the focus stays on the row. Defaults to `true`.
24
24
  */
25
25
  closeOnSelect?: boolean;
26
+ /**
27
+ * In a phone sheet, run while the tap still counts as the person's gesture, before the sheet closes, as browsers
28
+ * require for clipboard writes. Other actions run after the sheet has left the history. Such an action must
29
+ * not navigate or open a dialog.
30
+ */
31
+ immediate?: boolean;
26
32
  href?: never;
27
33
  external?: never;
28
34
  }) | (DropdownActionBase & {
@@ -41,6 +47,7 @@ export type DropdownChoice = DropdownActionBase & {
41
47
  action: () => void;
42
48
  checked: boolean | (() => boolean);
43
49
  choice: "checkbox" | "radio";
50
+ href?: string;
44
51
  closeOnSelect?: boolean;
45
52
  color?: string;
46
53
  };
@@ -74,6 +81,11 @@ export type DropdownProps = {
74
81
  disabled?: boolean;
75
82
  label?: string;
76
83
  align?: "start" | "end";
84
+ /**
85
+ * `sheet` opens the same items as a bottom sheet on phones (below 48rem) instead of a menu beside the trigger.
86
+ * Defaults to `menu`. A controlled menu (`open`) always stays a menu.
87
+ */
88
+ phone?: "menu" | "sheet";
77
89
  };
78
90
  export type DropdownTriggerProps = Omit<ButtonProps, "aria-controls" | "aria-expanded" | "aria-haspopup" | "children" | "disabled" | "onClick" | "onKeyDown"> & {
79
91
  children: JSX.Element;
@@ -104,11 +116,6 @@ export type DropdownItemProps = {
104
116
  onSelect?: () => void;
105
117
  class?: string;
106
118
  };
107
- /**
108
- * Left and Right cycle through the segments of a row section; Up and Down leave it like any item. Returns whether
109
- * the key moved focus.
110
- */
111
- export declare const focusRowSegment: (items: HTMLElement[], key: string) => boolean;
112
119
  export declare const dropdownPosition: (trigger: DOMRect, menu: Pick<DOMRect, "width" | "height">, position: DropdownPosition, viewport: {
113
120
  width: number;
114
121
  height: number;
@@ -13,14 +13,15 @@ export type GestureMenuSection = Omit<DropdownSection, "items"> & {
13
13
  export type GestureMenuItem = GestureMenuAction | DropdownAction | DropdownChoice | GestureMenuSection;
14
14
  export type GestureMenuProps = {
15
15
  /**
16
- * The menu. A long press opens it as a bottom sheet, a right-click, the Context Menu key, or Shift+F10 as a menu.
16
+ * The menu. A long press opens a BottomSheet below 48rem and the same menu at the finger from 48rem.
17
+ * Right-click opens it at the pointer; the Context Menu key and Shift+F10 open it beside the focused element.
17
18
  * An item with `gesture` is also run by that gesture, so every gesture has its entry here.
18
19
  */
19
20
  items: readonly GestureMenuItem[];
20
21
  /** Names the element and its menu, for example "Message from Nora, 10:42". */
21
22
  label: string;
22
23
  children: JSX.Element;
23
- /** Shown above the menu in the long-press sheet, for example a row of quick reactions. `close` closes the sheet. */
24
+ /** Shown only above the menu in the phone sheet, for example a row of quick reactions. `close` closes the sheet. */
24
25
  sheetTop?: (close: () => void) => JSX.Element;
25
26
  /** Tab order of the element. A list that moves focus between its rows itself passes -1. */
26
27
  tabIndex?: number;
@@ -30,8 +31,9 @@ export type GestureMenuProps = {
30
31
  };
31
32
  /**
32
33
  * Touch gestures for an element, each the shortcut of an entry in its menu: a horizontal swipe, a double tap, and a
33
- * long press that opens the whole menu as a `BottomSheet`. A mouse double-click runs the double-tap action; a
34
- * right-click and the keyboard open the menu beside the element. Vertical scrolling never turns into a swipe.
34
+ * long press that opens a `BottomSheet` below 48rem and the same menu at the finger from 48rem. A mouse double-click
35
+ * runs the double-tap action; right-click opens the menu at the pointer, the keyboard beside the focused element.
36
+ * Vertical scrolling never turns into a swipe.
35
37
  */
36
38
  export declare function GestureMenu(props: GestureMenuProps): JSX.Element;
37
39
  export default GestureMenu;
@@ -4,6 +4,24 @@ export type ToolbarProps = {
4
4
  label: string;
5
5
  orientation?: "horizontal" | "vertical";
6
6
  wrap?: boolean;
7
+ /** `floating` floats the toolbar at the bottom of its column. Defaults to `inline`. */
8
+ variant?: "inline" | "floating";
9
+ class?: string;
10
+ };
11
+ export type ToolbarActionProps = {
12
+ /** Accessible name, tooltip text, and the row label in the More menu. */
13
+ label: string;
14
+ /** Icon class, such as "ti ti-archive". */
15
+ icon: string;
16
+ /** Shortcut hint, tooltip suffix, and aria-keyshortcuts; does not register a shortcut handler. */
17
+ keys?: string;
18
+ /** 1 is most important. Larger numbers move first; ties move later DOM actions first. Omit to keep fixed. */
19
+ priority?: number;
20
+ disabled?: boolean;
21
+ onClick?: () => void;
22
+ };
23
+ export type ToolbarLabelProps = {
24
+ children: JSX.Element;
7
25
  class?: string;
8
26
  };
9
27
  export type ToolbarGroupProps = {
@@ -15,6 +33,8 @@ export type ToolbarSeparatorProps = {
15
33
  class?: string;
16
34
  };
17
35
  type ToolbarComponent = ((props: ToolbarProps) => JSX.Element) & {
36
+ Action: (props: ToolbarActionProps) => JSX.Element;
37
+ Label: (props: ToolbarLabelProps) => JSX.Element;
18
38
  Group: (props: ToolbarGroupProps) => JSX.Element;
19
39
  Separator: (props: ToolbarSeparatorProps) => JSX.Element;
20
40
  Spacer: () => JSX.Element;
@@ -22,5 +22,5 @@ export type { SpotlightButtonProps, SpotlightButtonVariant, SpotlightSearchOptio
22
22
  export { openSpotlightSearch, SpotlightButton, } from "./SpotlightSearch";
23
23
  export type { TabOption, TabsItemProps, TabsProps } from "./Tabs";
24
24
  export { Tabs } from "./Tabs";
25
- export type { ToolbarGroupProps, ToolbarProps, ToolbarSeparatorProps } from "./Toolbar";
25
+ export type { ToolbarActionProps, ToolbarGroupProps, ToolbarLabelProps, ToolbarProps, ToolbarSeparatorProps } from "./Toolbar";
26
26
  export { Toolbar } from "./Toolbar";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Left and Right cycle through the segments of a row section; Up and Down leave it like any item. Returns whether
3
+ * the key moved focus.
4
+ */
5
+ export declare const focusRowSegment: (items: HTMLElement[], key: string) => boolean;
@@ -0,0 +1,22 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { DropdownItem } from "./Dropdown";
3
+ /** Phones, where a menu opens as a bottom sheet instead of beside its trigger. */
4
+ export declare const PHONE_SHEET_QUERY = "(max-width: 47.999rem)";
5
+ export declare const prefersMenuSheet: () => boolean;
6
+ export type MenuSheetOptions = {
7
+ /** Renders the rows: the dropdown's own `DropdownItems`, passed in so this module does not import it back. */
8
+ Items: (props: {
9
+ items: readonly DropdownItem[];
10
+ close: (restoreFocus?: boolean) => void;
11
+ }) => JSX.Element;
12
+ items: readonly DropdownItem[];
13
+ /** Names the sheet and its menu. */
14
+ label: string;
15
+ /** The render locale of the opener; the sheet renders outside its tree. */
16
+ locale: string;
17
+ /** Shown above the menu, for example a row of quick reactions. `close` closes the sheet. */
18
+ top?: (close: () => void) => JSX.Element;
19
+ signal?: AbortSignal;
20
+ };
21
+ /** Opens menu items as a bottom sheet; resolves after the sheet closed and the chosen action ran. */
22
+ export declare const openMenuSheet: (options: MenuSheetOptions) => Promise<void>;
@@ -0,0 +1,8 @@
1
+ declare const toolbarMessages: import("@k2b/stdlib").Catalog<{
2
+ moreActions: string;
3
+ }>;
4
+ export type ToolbarMessages = ReturnType<(typeof toolbarMessages)["resolve"]>["t"];
5
+ /** Resolved from the inherited render locale. */
6
+ export declare const useToolbarMessages: () => (() => ToolbarMessages);
7
+ export declare const checkToolbarMessages: () => import("@k2b/stdlib").CatalogIssue[];
8
+ export {};
@@ -0,0 +1,2 @@
1
+ export { type ChartCursor, createChartCursor } from "./content/chart-cursor";
2
+ export { type ChartDatumRef, type ChartInspection, type ChartKind, type ChartSelection, type ChartTooltip, type ChartTooltipFormatter, type InspectChartOptions, inspectChart, isChartDatum, sameChartDatum, } from "./content/chart-inspection-core";
@@ -4,6 +4,7 @@ export type ChatCommandContext = {
4
4
  setValue: (value: string) => void;
5
5
  submit: () => void;
6
6
  focus: () => void;
7
+ openModelSelection: () => Promise<string | null>;
7
8
  };
8
9
  /** An action can cancel and restore its token, or report a short completion message. */
9
10
  export type ChatCommandResult = void | "cancelled" | {
@@ -27,6 +28,8 @@ export type ChatCommandScope = {
27
28
  /** Passed as the third argument to `searchCommands`. */
28
29
  export type ChatCommandSearch = {
29
30
  scope?: string;
31
+ /** One list opening, unchanged across queries and narrowing; retries start another opening. */
32
+ opening: number;
30
33
  };
31
34
  export type ChatCommand = {
32
35
  /** Section id; unknown or missing ids render in a trailing part without a heading. */
@@ -35,6 +38,10 @@ export type ChatCommand = {
35
38
  scope?: string;
36
39
  /** Absent from the overview; appears when searched, including its unavailable reason. */
37
40
  hiddenUntilSearch?: boolean;
41
+ /** A chosen value, independent of the row marked by keyboard navigation. */
42
+ selected?: boolean;
43
+ /** Retry discovery in a new opening, retaining the token and currently displayed rows. */
44
+ searchAgain?: boolean;
38
45
  /** Application name, searchable but not displayed. */
39
46
  app?: string;
40
47
  /** Stable row key for option ids, marking and de-duplication. Defaults to `name`. */
@@ -1,5 +1,6 @@
1
- declare const chatMessages: import("@k2b/stdlib").Catalog<{
1
+ export declare const chatMessages: import("@k2b/stdlib").Catalog<{
2
2
  commandFailed: string;
3
+ commandSelected: string;
3
4
  attachments: string;
4
5
  assistant: string;
5
6
  addToChat: string;
@@ -38,6 +39,14 @@ declare const chatMessages: import("@k2b/stdlib").Catalog<{
38
39
  own?: boolean;
39
40
  }) => string;
40
41
  messageAddReaction: string;
42
+ moreReactions: ({ count }: {
43
+ count: number;
44
+ }) => string;
45
+ reactionYou: string;
46
+ reactionAnd: string;
47
+ reactionMorePeople: ({ count }: {
48
+ count: number;
49
+ }) => string;
41
50
  messageReplies: ({ count }: {
42
51
  count: number;
43
52
  }) => string;
@@ -120,4 +129,3 @@ export type ChatMessages = ReturnType<(typeof chatMessages)["resolve"]>["t"];
120
129
  /** Resolved from the inherited render locale. */
121
130
  export declare const useChatMessages: () => (() => ChatMessages);
122
131
  export declare const checkChatMessages: () => import("@k2b/stdlib").CatalogIssue[];
123
- export {};
@@ -36,4 +36,6 @@ export declare function chatCommandListModel(input: {
36
36
  rows: ChatCommandRow[];
37
37
  empty: boolean;
38
38
  };
39
+ /** Use the composer ranking rules to filter consumer-owned server rows. */
40
+ export declare const matchesChatCommand: (command: ChatCommand, query: string) => boolean;
39
41
  export {};
@@ -26,4 +26,6 @@ export declare const Chat: typeof ChatRoot & {
26
26
  ContextPopup: typeof ChatContextPopup;
27
27
  ContextPanel: typeof ChatContextPanel;
28
28
  };
29
+ export { matchesChatCommand } from "./command-search";
29
30
  export { reconcileChatMentions } from "./composer-document";
31
+ export { type ReactionPeopleInput, reactionPeople } from "./reaction-people";
@@ -0,0 +1,9 @@
1
+ export type ReactionPeopleInput = {
2
+ /** Display names of the others who reacted, in the order they reacted; without the reader. */
3
+ names: readonly string[];
4
+ /** The reader reacted too; they come first as "You". */
5
+ own?: boolean;
6
+ /** How many reacted in total, the reader included. May exceed the names given. */
7
+ count: number;
8
+ };
9
+ export declare const reactionPeople: (input: ReactionPeopleInput, locale?: string) => string;
@@ -2,7 +2,7 @@ import type { MapViewport } from "@k2b/stdlib";
2
2
  import { charts } from "@k2b/stdlib";
3
3
  import type { JSX } from "solid-js";
4
4
  import type { ChartCursor } from "./chart-cursor";
5
- import { type ChartDatumRef, type ChartSelection, type ChartTooltipFormatter } from "./chart-inspection";
5
+ import { type ChartDatumRef, type ChartKind, type ChartSelection, type ChartTooltipFormatter } from "./chart-inspection-core";
6
6
  import { type StateTimelineChartOptions, type StateTimelineDomain } from "./chart-state-timeline";
7
7
  /**
8
8
  * Chart — minimal Solid wrapper around `stdlib.charts`.
@@ -49,7 +49,7 @@ import { type StateTimelineChartOptions, type StateTimelineDomain } from "./char
49
49
  * ```
50
50
  */
51
51
  /** All chart kinds shipped by `stdlib.charts`. */
52
- export type ChartKind = keyof typeof charts;
52
+ export type { ChartKind } from "./chart-inspection-core";
53
53
  export type ChartLabels = Partial<{
54
54
  empty: string;
55
55
  series: string;
@@ -1,4 +1,5 @@
1
1
  import { type JSX } from "solid-js";
2
+ import { type ReactionBarItem } from "./ReactionBar";
2
3
  export type MessageRowAuthor = {
3
4
  /** Display name, shown at the start of a group and read before every message. */
4
5
  name: string;
@@ -25,16 +26,8 @@ export type MessageRowQuote = {
25
26
  /** Opens the quoted message, for example by scrolling to it. Without it, the quote is not a control. */
26
27
  onSelect?: () => void;
27
28
  };
28
- export type MessageRowReaction = {
29
- /** Stable identity of the reaction, passed to `onToggleReaction`. */
30
- key: string;
31
- emoji: string;
32
- count: number;
33
- /** The reader reacted this way; the chip shows pressed. */
34
- own?: boolean;
35
- /** Who reacted, for example "Nora, Tobias". Read by screen readers and shown as a tooltip. */
36
- label?: string;
37
- };
29
+ /** Reaction labels are read by screen readers and shown in the names hint. */
30
+ export type MessageRowReaction = ReactionBarItem;
38
31
  export type MessageRowThread = {
39
32
  /** Number of replies. */
40
33
  count: number;
@@ -0,0 +1,32 @@
1
+ import { type JSX } from "solid-js";
2
+ export type ReactionBarItem = {
3
+ /** Stable identity of the reaction, passed to `onToggle`. */
4
+ key: string;
5
+ emoji: string;
6
+ count: number;
7
+ /** The reader reacted this way; the chip shows pressed. */
8
+ own?: boolean;
9
+ /** Who reacted, for example from `reactionPeople`. Read by screen readers and shown in the names hint. */
10
+ label?: string;
11
+ /** A change of the reader's own reaction is still being saved; the chip carries `aria-busy`. */
12
+ busy?: boolean;
13
+ };
14
+ export type ReactionBarProps = {
15
+ reactions: readonly ReactionBarItem[];
16
+ /** Called with a reaction's key when the reader presses its chip. Without it, the chips are not controls. */
17
+ onToggle?: (key: string) => void;
18
+ /** Called by "Add reaction" with the button to anchor a picker to, such as `EmojiPicker.Popover`. Without it there is no button. */
19
+ onAdd?: (anchor: HTMLElement) => void;
20
+ /** "default": 26 px chips (chat, item detail). "compact": 24 px chips (cards). */
21
+ density?: "default" | "compact";
22
+ /** "scroll" (default): one line of fixed height that scrolls sideways. "wrap": every chip shows, lines wrap. */
23
+ overflow?: "scroll" | "wrap";
24
+ /** Shows at most this many chips and then "+n", n being the number of further emoji. The shown chips do not scroll. */
25
+ max?: number;
26
+ /** Screen-reader text of "+n"; defaults to "{n} more reactions". */
27
+ moreLabel?: (count: number) => string;
28
+ /** "always" (default) or "progressive": shown on hover and focus with a mouse or trackpad (k2b-progressive-action, inside the caller's k2b-progressive-row), kept while its picker is open, hidden on touch. Its place stays reserved. */
29
+ add?: "always" | "progressive";
30
+ class?: string;
31
+ };
32
+ export declare function ReactionBar(props: ReactionBarProps): JSX.Element;
@@ -0,0 +1,61 @@
1
+ import type { ChartDatum, charts } from "@k2b/stdlib";
2
+ import type { ChartCursor } from "./chart-cursor";
3
+ export type ChartKind = keyof typeof charts;
4
+ export type ChartDatumRef = Pick<ChartDatum, "role" | "index" | "seriesIndex">;
5
+ export declare const sameChartDatum: (a: ChartDatumRef, b: ChartDatumRef) => boolean;
6
+ export type ChartSelection = {
7
+ kind: ChartKind;
8
+ datum: ChartDatum;
9
+ };
10
+ export type ChartTooltip = {
11
+ title?: string;
12
+ rows: readonly {
13
+ label: string;
14
+ value: string;
15
+ }[];
16
+ };
17
+ export type ChartTooltipFormatter = (selection: ChartSelection) => ChartTooltip;
18
+ export declare function isChartDatum(value: unknown): value is ChartDatum;
19
+ /** Enhances existing SVG nodes. Pointer/focus changes never rebuild the chart. */
20
+ export declare function createChartInspector(options: {
21
+ container: () => HTMLElement | undefined;
22
+ cursor?: () => ChartCursor | undefined;
23
+ tooltip: () => HTMLSpanElement | undefined;
24
+ anchor: () => HTMLSpanElement | undefined;
25
+ kind: () => ChartKind;
26
+ enabled: () => boolean;
27
+ format: ChartTooltipFormatter;
28
+ select: (selection: ChartSelection) => void;
29
+ }): {
30
+ selectDatum: (selected: ChartDatumRef | null | undefined) => void;
31
+ selectData: (selected: readonly ChartDatumRef[]) => void;
32
+ linkCursor: (cursor: ChartCursor | undefined) => (() => void);
33
+ destroy: () => void;
34
+ move: (event: PointerEvent) => void;
35
+ down: (event: PointerEvent) => void;
36
+ click: (event: MouseEvent) => void;
37
+ focus: (event: FocusEvent) => void;
38
+ key: (event: KeyboardEvent) => boolean;
39
+ close: () => void;
40
+ invalidate: () => void;
41
+ leave: () => void;
42
+ };
43
+ /** Dismiss inspection on outside interaction, but allow the tooltip itself to scroll. */
44
+ export declare function closeChartInspectionOnOutside(options: {
45
+ container: () => HTMLElement | undefined;
46
+ tooltip: () => HTMLElement | undefined;
47
+ close: () => void;
48
+ }): () => void;
49
+ export type InspectChartOptions = {
50
+ kind: ChartKind;
51
+ format: ChartTooltipFormatter;
52
+ select?: (selection: ChartSelection) => void;
53
+ cursor?: ChartCursor;
54
+ };
55
+ export type ChartInspection = {
56
+ invalidate(): void;
57
+ close(): void;
58
+ destroy(): void;
59
+ };
60
+ /** Attach inspection to stdlib SVG rendered with inspect: true, without a framework. */
61
+ export declare function inspectChart(container: HTMLElement, options: InspectChartOptions): ChartInspection;
@@ -1,22 +1,6 @@
1
- import type { ChartDatum } from "@k2b/stdlib";
2
- import type { ChartKind } from "./Chart";
3
1
  import type { ChartCursor } from "./chart-cursor";
4
- export type ChartDatumRef = Pick<ChartDatum, "role" | "index" | "seriesIndex">;
5
- export declare const sameChartDatum: (a: ChartDatumRef, b: ChartDatumRef) => boolean;
6
- export type ChartSelection = {
7
- kind: ChartKind;
8
- datum: ChartDatum;
9
- };
10
- export type ChartTooltip = {
11
- title?: string;
12
- rows: readonly {
13
- label: string;
14
- value: string;
15
- }[];
16
- };
17
- export type ChartTooltipFormatter = (selection: ChartSelection) => ChartTooltip;
18
- export declare function isChartDatum(value: unknown): value is ChartDatum;
19
- /** Enhances existing SVG nodes. Pointer/focus changes never rebuild the chart. */
2
+ import { type ChartKind, type ChartSelection, type ChartTooltipFormatter } from "./chart-inspection-core";
3
+ export type { ChartSelection } from "./chart-inspection-core";
20
4
  export declare function createChartInspection(options: {
21
5
  container: () => HTMLDivElement | undefined;
22
6
  cursor?: () => ChartCursor | undefined;
@@ -27,8 +11,8 @@ export declare function createChartInspection(options: {
27
11
  format: ChartTooltipFormatter;
28
12
  select: (selection: ChartSelection) => void;
29
13
  }): {
30
- selectDatum: (selected: ChartDatumRef | null | undefined) => void;
31
- selectData: (selected: readonly ChartDatumRef[]) => void;
14
+ selectDatum: (selected: import("./chart-inspection-core").ChartDatumRef | null | undefined) => void;
15
+ selectData: (selected: readonly import("./chart-inspection-core").ChartDatumRef[]) => void;
32
16
  move: (event: PointerEvent) => void;
33
17
  down: (event: PointerEvent) => void;
34
18
  click: (event: MouseEvent) => void;
@@ -1,6 +1,6 @@
1
1
  import { type ChartDatum } from "@k2b/stdlib";
2
2
  import { type ChartKind, type ChartRenderOptions } from "./Chart";
3
- import { type ChartSelection, type ChartTooltip, type ChartTooltipFormatter } from "./chart-inspection";
3
+ import { type ChartSelection, type ChartTooltip, type ChartTooltipFormatter } from "./chart-inspection-core";
4
4
  /** Trusted output of prepareChartSnapshot; never accept arbitrary user SVG. */
5
5
  export type ChartSnapshot = {
6
6
  kind: ChartKind;
@@ -13,7 +13,7 @@ export { default as CodeDisplay } from "./CodeDisplay";
13
13
  export { type ChartCursor, createChartCursor } from "./chart-cursor";
14
14
  export type { ChartExplorerCharts, ChartExplorerController, ChartExplorerData, ChartExplorerOptions, ChartExplorerRequest, ChartExplorerRow, ChartExplorerSnapshot, } from "./chart-explorer";
15
15
  export { createChartExplorer } from "./chart-explorer";
16
- export type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter } from "./chart-inspection";
16
+ export type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter } from "./chart-inspection-core";
17
17
  export type { ChartSnapshot } from "./chart-snapshot";
18
18
  export { prepareChartSnapshot } from "./chart-snapshot";
19
19
  export type { StateTimelineChartOptions, StateTimelineDomain, StateTimelineInterval, StateTimelineRow, StateTimelineState, } from "./chart-state-timeline";
@@ -44,6 +44,7 @@ export type { PdfPreviewProps, PdfPreviewRequest } from "./PdfPreview";
44
44
  export { default as PdfPreview } from "./PdfPreview";
45
45
  export type { RangeOption, RangePickerProps } from "./RangePicker";
46
46
  export { default as RangePicker } from "./RangePicker";
47
+ export { ReactionBar, type ReactionBarItem, type ReactionBarProps } from "./ReactionBar";
47
48
  export type { StepsProps } from "./Steps";
48
49
  export { Steps } from "./Steps";
49
50
  export type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from "./StructuredDataPreview";
@@ -11,6 +11,8 @@ export type OpenDialogOptions = {
11
11
  /**
12
12
  * Add a same-URL history entry while the dialog is open, so the browser's or the phone's Back closes the dialog
13
13
  * instead of leaving the page. Closing the dialog removes the entry again; the returned promise settles after that.
14
+ * With the Navigation API, same-URL traversals between this core's entries and the page do not reach application popstate listeners.
15
+ * Without it, only the synthetic Back on close is suppressed.
14
16
  */
15
17
  history?: boolean;
16
18
  };
@@ -33,5 +35,18 @@ export type DialogCore = {
33
35
  close: (result?: unknown) => void;
34
36
  isOpen: () => boolean;
35
37
  };
36
- export declare const createDialogCore: () => DialogCore;
38
+ export declare const createDialogCore: () => {
39
+ open: <T>(view: DialogRender<T>, options?: OpenDialogOptions) => Promise<T | undefined>;
40
+ close: (result?: unknown) => void;
41
+ isOpen: () => boolean;
42
+ holdHistory: (onBack: () => void) => (() => void);
43
+ historySettled: () => Promise<void>;
44
+ };
37
45
  export declare const dialogCore: DialogCore;
46
+ /**
47
+ * Internal: transient UI shares dialogs' Back handling without exposing another public dialog capability.
48
+ * Same-URL traversals are suppressed with the Navigation API; without it, only the synthetic Back on release is suppressed.
49
+ */
50
+ export declare const holdDialogHistory: (onBack: () => void) => (() => void);
51
+ /** Internal: waits until entries released through `holdDialogHistory` have left the history. */
52
+ export declare const dialogHistorySettled: () => Promise<void>;
@@ -2,6 +2,7 @@ export * from "./actions";
2
2
  export * from "./chat";
3
3
  export * from "./content";
4
4
  export * from "./feedback";
5
+ export { installInputModeController } from "./input-mode";
5
6
  export * from "./inputs";
6
7
  export { suppressTextSelection } from "./internal/text-selection";
7
8
  export * from "./intl";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Records `data-k2b-input="touch" | "trackpad"` and the sticky
3
+ * `data-k2b-kbd="on"` on `<html>` of root after qualifying input events.
4
+ * Returns a function that removes listeners but keeps the attributes.
5
+ * No-op on the server; installing does not change the initial HTML.
6
+ */
7
+ export declare const installInputModeController: (root?: Document | undefined) => (() => void);
@@ -9,9 +9,10 @@ export type FileDropTargetProps = FileDropOptions & {
9
9
  for?: Element;
10
10
  };
11
11
  /**
12
- * Turns an area into a drop target while files from outside the page are dragged over the window. A calm overlay
13
- * covers the area without moving anything and says what dropping does; a more specific target inside it, such as a
14
- * folder row or a `FileDropzone`, takes the drop and its sentence while the pointer is over it. Text, links, and
12
+ * Turns an area into a drop target while files from outside the page are dragged over the window. A calm tint covers
13
+ * the area without moving anything, and while the pointer is over it a chip at its bottom says what dropping does; a
14
+ * more specific target inside it, such as a folder row or a `FileDropzone`, takes the drop and its sentence while the
15
+ * pointer is over it. Text, links, and
15
16
  * elements dragged within the page never show it. Keep a visible upload button for keyboard and touch users.
16
17
  */
17
18
  export declare function FileDropTarget(props: FileDropTargetProps): JSX.Element;
@@ -21,3 +22,5 @@ export declare function FileDropTarget(props: FileDropTargetProps): JSX.Element;
21
22
  * sentence. Calling the ref again with new options replaces them.
22
23
  */
23
24
  export declare function fileDropTarget(options: FileDropOptions): (element: Element) => void;
25
+ /** @internal A specific target that shows its drop sentence itself, as `FileDropzone` does; the area's chip then stays hidden. */
26
+ export declare function labelledFileDropTarget(options: FileDropOptions): (element: Element) => void;
@@ -25,6 +25,8 @@ export type SelectChipProps<T extends string | number = string> = ValueFieldProp
25
25
  * its size, cannot be opened, is marked busy, and shows a spinner where its
26
26
  * chevron (or, icon-only, its icon) is. */
27
27
  loading?: boolean;
28
+ open?: boolean;
29
+ onOpenChange?: (open: boolean) => void;
28
30
  };
29
31
  export declare function SelectChip<T extends string | number = string>(props: SelectChipProps<T>): JSX.Element;
30
32
  export default SelectChip;
@@ -37,6 +37,8 @@ export type FileDropTargetEntry = {
37
37
  region?: () => Element | undefined;
38
38
  /** Set for regions: where the target itself is rendered; a region whose host is hidden takes no drops. */
39
39
  host?: () => Element | undefined;
40
+ /** Set for specific targets that show the drop sentence themselves, so the area's overlay does not repeat it. */
41
+ labelled?: boolean;
40
42
  };
41
43
  export type FileDropHover = {
42
44
  entry: FileDropTargetEntry;
@@ -43,6 +43,9 @@ type DetailPanelSectionBaseProps = {
43
43
  icon?: string;
44
44
  tone?: DetailPanelTone;
45
45
  description?: JSX.Element;
46
+ /** How many things the section lists, as a chip after the title; `0` reads "None yet". */
47
+ count?: number;
48
+ /** Short state after the title, such as "2 of 4 done". */
46
49
  meta?: JSX.Element;
47
50
  class?: string;
48
51
  };
@@ -61,6 +64,10 @@ type DetailPanelActionBaseProps = {
61
64
  leading?: JSX.Element;
62
65
  trailing?: JSX.Element;
63
66
  secondaryAction?: DetailPanelActionSecondary;
67
+ /** Marks the row of the current place, such as the section in view, in the panel's accent. */
68
+ current?: boolean;
69
+ /** Lets the title wrap to two lines instead of ending with an ellipsis. */
70
+ wrap?: boolean;
64
71
  class?: string;
65
72
  };
66
73
  type DetailPanelActionMenuProps = {
@@ -102,5 +109,9 @@ type DetailPanelComponent = ((props: DetailPanelProps) => JSX.Element) & {
102
109
  Section: (props: DetailPanelSectionProps) => JSX.Element;
103
110
  Action: (props: DetailPanelActionProps) => JSX.Element;
104
111
  };
112
+ /** A count chip, or "None yet" for zero; shared by sections and discussions. */
113
+ export declare const DetailPanelCount: (props: {
114
+ count: number;
115
+ }) => JSX.Element;
105
116
  declare const DetailPanel: DetailPanelComponent;
106
117
  export default DetailPanel;
@@ -30,6 +30,14 @@ export type DiscussionListProps = {
30
30
  loadingMore?: boolean;
31
31
  loadMoreLabel?: string;
32
32
  onLoadMore?: () => boolean | void | Promise<boolean | void>;
33
+ /**
34
+ * Shows only the newest `fold` entries and a "Show n older" toggle above them. Expanded, the toggle reads "Show less"
35
+ * and earlier pages load as usual. Omit it to show every loaded entry.
36
+ */
37
+ fold?: number;
38
+ /** Controls the fold, for example to reveal an older entry; `onExpandedChange` requests a change. */
39
+ expanded?: boolean;
40
+ onExpandedChange?: (expanded: boolean) => void;
33
41
  class?: string;
34
42
  };
35
43
  export type DiscussionItemProps = Omit<JSX.LiHTMLAttributes<HTMLLIElement>, "children" | "class"> & {
@@ -10,6 +10,8 @@ export type TableOfContentsProps = {
10
10
  title?: string;
11
11
  /** Element whose scrolling decides the active section. Defaults to the window. */
12
12
  scrollRoot?: MaybeAccessor<HTMLElement | undefined>;
13
+ /** Element that contains the section headings. Defaults to the document. */
14
+ contentRoot?: MaybeAccessor<HTMLElement | undefined>;
13
15
  /** Stay in view inside the caller's layout. */
14
16
  sticky?: boolean;
15
17
  /** Called when another section becomes active. */
@@ -0,0 +1,15 @@
1
+ /** Counts and list folding shared by detail panel sections and discussions. */
2
+ declare const detailPanelMessages: import("@k2b/stdlib").Catalog<{
3
+ noneYet: string;
4
+ showOlder: ({ count }: {
5
+ count: number;
6
+ }) => string;
7
+ showMore: ({ count }: {
8
+ count: number;
9
+ }) => string;
10
+ showLess: string;
11
+ }>;
12
+ export type DetailPanelMessages = ReturnType<(typeof detailPanelMessages)["resolve"]>["t"];
13
+ export declare const useDetailPanelMessages: () => (() => DetailPanelMessages);
14
+ export declare const checkDetailPanelMessages: () => import("@k2b/stdlib").CatalogIssue[];
15
+ export {};