prime-ui-kit 0.11.1 → 0.13.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 (171) hide show
  1. package/README.md +4 -1
  2. package/dist/chunks/{chunk-WDTSHOTD.js → chunk-E6SQBSDF.js} +140 -30
  3. package/dist/chunks/{chunk-CUH6DJ57.js → chunk-Z3WKKAS6.js} +6572 -5024
  4. package/dist/chunks/{chunk-GKX3QAUC.js → chunk-ZSJMNA46.js} +14 -5
  5. package/dist/color-picker.js +2 -2
  6. package/dist/components/chat/Chat.d.ts +11 -12
  7. package/dist/components/chat/chatContext.d.ts +2 -0
  8. package/dist/components/chat-list/ChatList.d.ts +191 -0
  9. package/dist/components/chat-list/formatChatTime.d.ts +6 -0
  10. package/dist/components/command-menu/CommandMenu.d.ts +10 -5
  11. package/dist/components/composer/Composer.d.ts +3 -10
  12. package/dist/components/data-table/DataTable.d.ts +16 -2
  13. package/dist/components/data-table/Row.d.ts +23 -7
  14. package/dist/components/data-table/StateRows.d.ts +5 -1
  15. package/dist/components/data-table/reorder.d.ts +3 -1
  16. package/dist/components/data-table/rows.d.ts +20 -4
  17. package/dist/components/file-upload/FileUpload.d.ts +7 -0
  18. package/dist/components/gantt/Gantt.d.ts +19 -1
  19. package/dist/components/gantt/GanttBar.d.ts +4 -1
  20. package/dist/components/gantt/GanttRow.d.ts +8 -1
  21. package/dist/components/index.d.ts +11 -7
  22. package/dist/components/kanban/Kanban.d.ts +17 -2
  23. package/dist/components/list/List.d.ts +120 -0
  24. package/dist/components/message/Message.d.ts +13 -0
  25. package/dist/components/message/MessageParts.d.ts +2 -0
  26. package/dist/components/modal/DialogParts.d.ts +5 -1
  27. package/dist/components/select/Select.d.ts +11 -5
  28. package/dist/components/select/SelectItem.d.ts +19 -0
  29. package/dist/components/select/selectContext.d.ts +4 -0
  30. package/dist/components/sparkline/Sparkline.d.ts +14 -3
  31. package/dist/components/textarea/Textarea.d.ts +11 -3
  32. package/dist/hooks/useUploadQueue.d.ts +5 -1
  33. package/dist/icons/registry.d.ts +2 -0
  34. package/dist/index.css +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +10 -2
  37. package/dist/internal/VisuallyHidden.d.ts +6 -1
  38. package/dist/internal/attachmentTile.d.ts +5 -1
  39. package/dist/internal/richText.d.ts +7 -2
  40. package/dist/internal/textFormatting.d.ts +52 -0
  41. package/dist/internal/textFormattingToolbar.d.ts +26 -0
  42. package/dist/skill/api-contract.md +1 -1
  43. package/dist/skill/cheatsheet.md +13 -1
  44. package/dist/skill/choosing.md +9 -4
  45. package/dist/skill/components.md +7 -5
  46. package/dist/skill/composition.md +9 -1
  47. package/dist/skill/layouts.md +4 -1
  48. package/dist/skill/patterns/app-shell.module.css +18 -0
  49. package/dist/skill/patterns/app-shell.tsx +301 -0
  50. package/dist/skill/patterns/chat.module.css +0 -25
  51. package/dist/skill/patterns/chat.tsx +72 -29
  52. package/dist/skill/patterns/kanban-board.module.css +28 -0
  53. package/dist/skill/patterns/kanban-board.tsx +612 -0
  54. package/dist/skill/patterns/media-library.module.css +66 -0
  55. package/dist/skill/patterns/media-library.tsx +638 -0
  56. package/dist/skill/patterns/schedule.module.css +22 -0
  57. package/dist/skill/patterns/schedule.tsx +722 -0
  58. package/dist/skill/reference/components/chat/COMPONENT.md +13 -4
  59. package/dist/skill/reference/components/chat/examples/states.tsx +100 -0
  60. package/dist/skill/reference/components/chat-list/COMPONENT.md +256 -0
  61. package/dist/skill/reference/components/chat-list/examples/controlled.tsx +103 -0
  62. package/dist/skill/reference/components/chat-list/examples/examples.module.css +66 -0
  63. package/dist/skill/reference/components/chat-list/examples/live.tsx +133 -0
  64. package/dist/skill/reference/components/chat-list/examples/long-list.tsx +87 -0
  65. package/dist/skill/reference/components/chat-list/examples/narrow.tsx +88 -0
  66. package/dist/skill/reference/components/chat-list/examples/overview.tsx +194 -0
  67. package/dist/skill/reference/components/chat-list/examples/search.tsx +71 -0
  68. package/dist/skill/reference/components/chat-list/examples/sizes.tsx +61 -0
  69. package/dist/skill/reference/components/chat-list/examples/states.tsx +107 -0
  70. package/dist/skill/reference/components/chat-list/examples/structure.tsx +135 -0
  71. package/dist/skill/reference/components/command-menu/COMPONENT.md +15 -11
  72. package/dist/skill/reference/components/command-menu/examples/server-search.tsx +11 -9
  73. package/dist/skill/reference/components/composer/COMPONENT.md +8 -7
  74. package/dist/skill/reference/components/composer/examples/formatting.tsx +1 -1
  75. package/dist/skill/reference/components/confirm-dialog/COMPONENT.md +1 -0
  76. package/dist/skill/reference/components/data-table/COMPONENT.md +21 -6
  77. package/dist/skill/reference/components/data-table/examples/groups.tsx +2 -1
  78. package/dist/skill/reference/components/data-table/examples/trend.tsx +85 -0
  79. package/dist/skill/reference/components/drawer/COMPONENT.md +7 -6
  80. package/dist/skill/reference/components/drawer/examples/client-card.tsx +50 -0
  81. package/dist/skill/reference/components/fieldset/COMPONENT.md +1 -0
  82. package/dist/skill/reference/components/file-upload/COMPONENT.md +12 -8
  83. package/dist/skill/reference/components/file-upload/examples/overview.tsx +14 -3
  84. package/dist/skill/reference/components/gantt/COMPONENT.md +15 -5
  85. package/dist/skill/reference/components/gantt/examples/row-link.tsx +96 -0
  86. package/dist/skill/reference/components/kanban/COMPONENT.md +12 -4
  87. package/dist/skill/reference/components/kanban/examples/item-link.tsx +92 -0
  88. package/dist/skill/reference/components/list/COMPONENT.md +195 -0
  89. package/dist/skill/reference/components/list/examples/as-link.tsx +37 -0
  90. package/dist/skill/reference/components/list/examples/examples.module.css +18 -0
  91. package/dist/skill/reference/components/list/examples/overflow.tsx +46 -0
  92. package/dist/skill/reference/components/list/examples/overview.tsx +63 -0
  93. package/dist/skill/reference/components/list/examples/reorder.tsx +48 -0
  94. package/dist/skill/reference/components/list/examples/sizes.tsx +35 -0
  95. package/dist/skill/reference/components/list/examples/states.tsx +27 -0
  96. package/dist/skill/reference/components/list/examples/with-icon.tsx +60 -0
  97. package/dist/skill/reference/components/message/COMPONENT.md +18 -2
  98. package/dist/skill/reference/components/message/examples/bot-actions.tsx +51 -0
  99. package/dist/skill/reference/components/modal/COMPONENT.md +6 -4
  100. package/dist/skill/reference/components/page-content/COMPONENT.md +2 -2
  101. package/dist/skill/reference/components/page-content/examples/examples.module.css +5 -12
  102. package/dist/skill/reference/components/page-content/examples/list-detail.tsx +13 -18
  103. package/dist/skill/reference/components/select/COMPONENT.md +38 -7
  104. package/dist/skill/reference/components/select/examples/create-action.tsx +107 -0
  105. package/dist/skill/reference/components/select/examples/saving.tsx +47 -0
  106. package/dist/skill/reference/components/sheet/COMPONENT.md +4 -4
  107. package/dist/skill/reference/components/sparkline/COMPONENT.md +16 -2
  108. package/dist/skill/reference/components/sparkline/examples/compact.tsx +41 -0
  109. package/dist/skill/reference/components/sparkline/examples/examples.module.css +12 -0
  110. package/dist/skill/reference/components/textarea/COMPONENT.md +22 -2
  111. package/dist/skill/reference/components/textarea/examples/formatting.tsx +20 -0
  112. package/dist/skill/reference/components/visually-hidden/COMPONENT.md +6 -3
  113. package/dist/skill/reference/components/visually-hidden/examples/overview.tsx +2 -2
  114. package/package.json +2 -2
  115. package/src/components/chat/COMPONENT.md +13 -4
  116. package/src/components/chat/examples/states.tsx +100 -0
  117. package/src/components/chat-list/COMPONENT.md +256 -0
  118. package/src/components/chat-list/examples/controlled.tsx +103 -0
  119. package/src/components/chat-list/examples/examples.module.css +66 -0
  120. package/src/components/chat-list/examples/live.tsx +133 -0
  121. package/src/components/chat-list/examples/long-list.tsx +87 -0
  122. package/src/components/chat-list/examples/narrow.tsx +88 -0
  123. package/src/components/chat-list/examples/overview.tsx +194 -0
  124. package/src/components/chat-list/examples/search.tsx +71 -0
  125. package/src/components/chat-list/examples/sizes.tsx +61 -0
  126. package/src/components/chat-list/examples/states.tsx +107 -0
  127. package/src/components/chat-list/examples/structure.tsx +135 -0
  128. package/src/components/command-menu/COMPONENT.md +15 -11
  129. package/src/components/command-menu/examples/server-search.tsx +11 -9
  130. package/src/components/composer/COMPONENT.md +8 -7
  131. package/src/components/composer/examples/formatting.tsx +1 -1
  132. package/src/components/confirm-dialog/COMPONENT.md +1 -0
  133. package/src/components/data-table/COMPONENT.md +21 -6
  134. package/src/components/data-table/examples/groups.tsx +2 -1
  135. package/src/components/data-table/examples/trend.tsx +85 -0
  136. package/src/components/drawer/COMPONENT.md +7 -6
  137. package/src/components/drawer/examples/client-card.tsx +50 -0
  138. package/src/components/fieldset/COMPONENT.md +1 -0
  139. package/src/components/file-upload/COMPONENT.md +12 -8
  140. package/src/components/file-upload/examples/overview.tsx +14 -3
  141. package/src/components/gantt/COMPONENT.md +15 -5
  142. package/src/components/gantt/examples/row-link.tsx +96 -0
  143. package/src/components/kanban/COMPONENT.md +12 -4
  144. package/src/components/kanban/examples/item-link.tsx +92 -0
  145. package/src/components/list/COMPONENT.md +195 -0
  146. package/src/components/list/examples/as-link.tsx +37 -0
  147. package/src/components/list/examples/examples.module.css +18 -0
  148. package/src/components/list/examples/overflow.tsx +46 -0
  149. package/src/components/list/examples/overview.tsx +63 -0
  150. package/src/components/list/examples/reorder.tsx +48 -0
  151. package/src/components/list/examples/sizes.tsx +35 -0
  152. package/src/components/list/examples/states.tsx +27 -0
  153. package/src/components/list/examples/with-icon.tsx +60 -0
  154. package/src/components/message/COMPONENT.md +18 -2
  155. package/src/components/message/examples/bot-actions.tsx +51 -0
  156. package/src/components/modal/COMPONENT.md +6 -4
  157. package/src/components/page-content/COMPONENT.md +2 -2
  158. package/src/components/page-content/examples/examples.module.css +5 -12
  159. package/src/components/page-content/examples/list-detail.tsx +13 -18
  160. package/src/components/select/COMPONENT.md +38 -7
  161. package/src/components/select/examples/create-action.tsx +107 -0
  162. package/src/components/select/examples/saving.tsx +47 -0
  163. package/src/components/sheet/COMPONENT.md +4 -4
  164. package/src/components/sparkline/COMPONENT.md +16 -2
  165. package/src/components/sparkline/examples/compact.tsx +41 -0
  166. package/src/components/sparkline/examples/examples.module.css +12 -0
  167. package/src/components/textarea/COMPONENT.md +22 -2
  168. package/src/components/textarea/examples/formatting.tsx +20 -0
  169. package/src/components/visually-hidden/COMPONENT.md +6 -3
  170. package/src/components/visually-hidden/examples/overview.tsx +2 -2
  171. package/dist/components/composer/format.d.ts +0 -39
@@ -17,7 +17,7 @@ import {
17
17
  useControllableState,
18
18
  useFieldFrame,
19
19
  useInheritedDisabled
20
- } from "./chunk-WDTSHOTD.js";
20
+ } from "./chunk-E6SQBSDF.js";
21
21
  import {
22
22
  cx
23
23
  } from "./chunk-Q3BFRQHZ.js";
@@ -121,10 +121,19 @@ var FORMAT_LABELS = { hsl: "HSL", rgb: "RGB", hex: "Hex" };
121
121
  var isFormat = (value) => value in FORMAT_LABELS;
122
122
  function FormatSelect({ className, ...rest }) {
123
123
  const { format, setFormat, labels } = useColorPickerContext();
124
- return /* @__PURE__ */ jsx("div", { ...rest, className: cx(ColorPicker_default.formatSelectWrap, className), children: /* @__PURE__ */ jsxs(Select.Root, { value: format, onValueChange: (value) => isFormat(value) && setFormat(value), children: [
125
- /* @__PURE__ */ jsx(Select.Trigger, { "aria-label": labels.format, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
126
- /* @__PURE__ */ jsx(Select.Content, { children: Object.entries(FORMAT_LABELS).map(([value, label]) => /* @__PURE__ */ jsx(Select.Item, { label, value, children: label }, value)) })
127
- ] }) });
124
+ return /* @__PURE__ */ jsx("div", { ...rest, className: cx(ColorPicker_default.formatSelectWrap, className), children: /* @__PURE__ */ jsxs(
125
+ Select.Root,
126
+ {
127
+ value: format,
128
+ onValueChange: (value) => {
129
+ if (isFormat(value)) setFormat(value);
130
+ },
131
+ children: [
132
+ /* @__PURE__ */ jsx(Select.Trigger, { "aria-label": labels.format, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
133
+ /* @__PURE__ */ jsx(Select.Content, { children: Object.entries(FORMAT_LABELS).map(([value, label]) => /* @__PURE__ */ jsx(Select.Item, { label, value, children: label }, value)) })
134
+ ]
135
+ }
136
+ ) });
128
137
  }
129
138
  function displayChannelValue(color, channel, space) {
130
139
  const raw = color.toFormat(space).getChannelValue(channel);
@@ -4,8 +4,8 @@ import {
4
4
  ColorField,
5
5
  ColorPicker,
6
6
  parseColor
7
- } from "./chunks/chunk-GKX3QAUC.js";
8
- import "./chunks/chunk-WDTSHOTD.js";
7
+ } from "./chunks/chunk-ZSJMNA46.js";
8
+ import "./chunks/chunk-E6SQBSDF.js";
9
9
  import "./chunks/chunk-Q3BFRQHZ.js";
10
10
  export {
11
11
  ColorField,
@@ -50,10 +50,12 @@ export type ChatHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
50
50
  ref?: React.Ref<HTMLDivElement>;
51
51
  };
52
52
  /**
53
- * The top of the chat: who it is with. A row of the leading element (an `Avatar`), the title over
54
- * the description, and the actions at the end.
53
+ * The top of the chat: who it is with. A row of the leading elements (a back button, an `Avatar`),
54
+ * the title over the description, and the actions at the end. Children are sorted by type:
55
+ * `Chat.Title`, `Chat.Description` and `Chat.Actions` take their places, everything else leads
56
+ * the row side by side, in the order written.
55
57
  */
56
- declare function ChatHeader({ className, ...rest }: ChatHeaderProps): import("react/jsx-runtime").JSX.Element;
58
+ declare function ChatHeader({ className, children, ...rest }: ChatHeaderProps): import("react/jsx-runtime").JSX.Element;
57
59
  declare namespace ChatHeader {
58
60
  var displayName: string;
59
61
  }
@@ -123,6 +125,11 @@ export type ChatMessagesProps<T = unknown> = Omit<MessageListProps, "group" | "s
123
125
  * incoming messages keep the avatar's gutter. Default `direct`.
124
126
  */
125
127
  type?: "direct" | "group";
128
+ /**
129
+ * The first load of the conversation: bubble-shaped placeholders stand in the list's place
130
+ * (`aria-busy`, `labels.loading` announced), then cross-fade into the messages.
131
+ */
132
+ loading?: boolean;
126
133
  /** Older history exists: a placeholder stands above the first message and `onLoadOlder` runs at the top. */
127
134
  hasOlder?: boolean;
128
135
  /** The reader reached the top while `hasOlder`: load older messages and prepend them. */
@@ -152,15 +159,7 @@ export type ChatMessagesProps<T = unknown> = Omit<MessageListProps, "group" | "s
152
159
  /** The label of a date. Default «Сегодня», «Вчера», «12 марта». */
153
160
  formatDate?: (date: Date, now: Date) => string;
154
161
  };
155
- /**
156
- * The conversation: the one message list of the kit, in its own scroller. A `role="log"` of rows
157
- * (new messages are announced politely) with one tab stop — arrows, Home and End move between
158
- * messages. Rows come from `items` (dates, runs and the unread band added for you) or from
159
- * children (`Message.Root`, `Chat.Separator`, `Chat.Service`, `Chat.Unread`; `Chat.SelectionBar`
160
- * and `Message.Typing` close the list). Only the rows around the view render; the list opens at
161
- * the end and keeps the reader's place.
162
- */
163
- declare function ChatMessages<T>({ type, hasOlder, onLoadOlder, items, getKey, getAuthor, getDate, isService, renderMessage, unread, groupWindow, now, formatDate, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: ChatMessagesProps<T>): import("react/jsx-runtime").JSX.Element;
162
+ declare function ChatMessages<T>({ type, loading, hasOlder, onLoadOlder, items, getKey, getAuthor, getDate, isService, renderMessage, unread, groupWindow, now, formatDate, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: ChatMessagesProps<T>): import("react/jsx-runtime").JSX.Element;
164
163
  declare namespace ChatMessages {
165
164
  var displayName: string;
166
165
  }
@@ -20,6 +20,8 @@ export type ChatLabels = MessageListLabels & {
20
20
  messages: string;
21
21
  /** The band above the first unread message of `items` (`Chat.Messages unread`). */
22
22
  unread: string;
23
+ /** Announced while the conversation loads for the first time (`Chat.Messages loading`). */
24
+ loading: string;
23
25
  };
24
26
  /** What the parts of a chat share; `Chat.Root` owns it. */
25
27
  export type ChatContextValue = {
@@ -0,0 +1,191 @@
1
+ import * as React from "react";
2
+ import { type DropdownContentProps } from "../dropdown/Dropdown";
3
+ import { type ListItemProps } from "../list/List";
4
+ import type { MessageStatus } from "../message/Message";
5
+ import { type ControlSize } from "../../internal/states";
6
+ export { formatChatTime } from "./formatChatTime";
7
+ /** What the last message of a dialog is when it is not text: the word the preview shows. */
8
+ export type ChatListMediaKind = "photo" | "video" | "voice" | "videoNote" | "file" | "location" | "contact";
9
+ export type ChatListLabels = {
10
+ /** `aria-label` of the list. */
11
+ list: string;
12
+ /** `aria-label` of the search field. */
13
+ search: string;
14
+ /** Placeholder of the search field. */
15
+ searchPlaceholder: string;
16
+ /** Announced while `loading`. */
17
+ loading: string;
18
+ /** The empty state without a search. */
19
+ empty: string;
20
+ /** The empty state of a search; announced. */
21
+ noResults: string;
22
+ /** Announced after a search changes the list; `{count}` — the dialogs found. */
23
+ results: string;
24
+ /** The preview while the other side types (`typing`). */
25
+ typing: string;
26
+ /** The preview while someone in a group types (`typing="Анна"`); `{name}` — who. */
27
+ typingName: string;
28
+ /** Before an unsent draft in the preview. */
29
+ draft: string;
30
+ /** Spoken for the unread count; `{count}` — the number. */
31
+ unread: string;
32
+ /** Spoken for the «@» mark (`mention`). */
33
+ mention: string;
34
+ /** Name of the muted glyph (`muted`). */
35
+ muted: string;
36
+ /** Name of the pin glyph (`pinned`). */
37
+ pinned: string;
38
+ /** Delivery of the reader's last message, as `Message` says it. */
39
+ sending: string;
40
+ sent: string;
41
+ read: string;
42
+ failed: string;
43
+ /** Media words of the preview (`ChatList.ItemDescription kind`). */
44
+ photo: string;
45
+ video: string;
46
+ voice: string;
47
+ videoNote: string;
48
+ file: string;
49
+ location: string;
50
+ contact: string;
51
+ /** `aria-label` of the point the row menu opens from. */
52
+ menu: string;
53
+ };
54
+ export type ChatListItemIconProps = Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> & {
55
+ /** Before the name: an `Avatar.Root` (sized by the row). After it: a small `Icon`. */
56
+ children: React.ReactNode;
57
+ ref?: React.Ref<HTMLSpanElement>;
58
+ };
59
+ /**
60
+ * The avatar of the dialog before `ChatList.ItemText`; after it, a glyph beside the name (a
61
+ * verified mark, a bot). Drawn by `ChatList.Item`.
62
+ */
63
+ declare function ChatListItemIcon(_props: ChatListItemIconProps): React.ReactNode;
64
+ declare namespace ChatListItemIcon {
65
+ var displayName: string;
66
+ }
67
+ export type ChatListItemTextProps = React.HTMLAttributes<HTMLSpanElement> & {
68
+ ref?: React.Ref<HTMLSpanElement>;
69
+ };
70
+ /** The name of the dialog: one line, truncated; the search query is marked in it. */
71
+ declare function ChatListItemText(_props: ChatListItemTextProps): React.ReactNode;
72
+ declare namespace ChatListItemText {
73
+ var displayName: string;
74
+ }
75
+ export type ChatListItemDescriptionProps = React.HTMLAttributes<HTMLSpanElement> & {
76
+ /** Who wrote the last message: «Вы», a member of a group. Shown as «{author}: » before it. */
77
+ author?: string;
78
+ /** The last message is not text: its word («Фото», «Голосовое сообщение») leads the preview. */
79
+ kind?: ChatListMediaKind;
80
+ /** Length of a voice or video message, seconds: «Голосовое сообщение 0:42». */
81
+ duration?: number;
82
+ ref?: React.Ref<HTMLSpanElement>;
83
+ };
84
+ /**
85
+ * The preview of the last message, one line: the author, the media word and the text (a caption,
86
+ * a file name). The search query is marked in the text. Drawn by `ChatList.Item`.
87
+ */
88
+ declare function ChatListItemDescription(_props: ChatListItemDescriptionProps): React.ReactNode;
89
+ declare namespace ChatListItemDescription {
90
+ var displayName: string;
91
+ }
92
+ export type ChatListItemMenuProps = Omit<DropdownContentProps, "side" | "align" | "matchTriggerWidth">;
93
+ /**
94
+ * The menu of a dialog: your `Dropdown.Item`s (Закрепить, Без звука, Отметить прочитанным,
95
+ * Удалить — the last one `tone="danger"`). Opens where the pointer is on right click, on a long
96
+ * press, and from the keyboard (Shift+F10, the menu key).
97
+ */
98
+ declare function ChatListItemMenu({ children, ...rest }: ChatListItemMenuProps): import("react/jsx-runtime").JSX.Element;
99
+ declare namespace ChatListItemMenu {
100
+ var displayName: string;
101
+ }
102
+ type ChatListItemOwnProps = {
103
+ /** When the last message was sent: a `Date` (shown with the root's `formatTime`) or the text to show. */
104
+ time?: Date | string;
105
+ /** Delivery of the reader's own last message: ✓ sent, ✓✓ read, the clock, or failed. */
106
+ status?: MessageStatus;
107
+ /** Unread messages: the count at the end of the row. Default 0. */
108
+ unread?: number;
109
+ /** The reader is mentioned among the unread: an «@» beside the count. */
110
+ mention?: boolean;
111
+ /** Notifications are off: a muted glyph beside the name and a gray count. */
112
+ muted?: boolean;
113
+ /** Pinned by the reader: a pin at the end of the row while nothing is unread. */
114
+ pinned?: boolean;
115
+ /**
116
+ * The other side types: the preview turns into «печатает…» in the accent, and back. A name
117
+ * («Анна») for a group: «Анна печатает…».
118
+ */
119
+ typing?: boolean | string;
120
+ /** The reader's unsent text: the preview shows «Черновик:» and the text. */
121
+ draft?: string;
122
+ /**
123
+ * `ChatList.ItemIcon` (the avatar; after the name — a glyph), `ChatList.ItemText`,
124
+ * `ChatList.ItemDescription`, `ChatList.ItemMenu`.
125
+ */
126
+ children?: React.ReactNode;
127
+ };
128
+ export type ChatListItemProps = ChatListItemOwnProps & Omit<ListItemProps, keyof ChatListItemOwnProps | "value" | "current" | "asChild" | "disabled">;
129
+ /**
130
+ * A dialog: a `List.Item` row (a button, or a link with `href`) with the avatar, the name and the
131
+ * time on the first line, the preview and the counts on the second. Its key and `current` come
132
+ * from `ChatList.Root`.
133
+ */
134
+ declare function ChatListItem({ time, status, unread, mention, muted, pinned, typing, draft, className, children, onClick, onKeyDown, onFocus, onContextMenu, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, ref, ...rest }: ChatListItemProps): import("react/jsx-runtime").JSX.Element;
135
+ declare namespace ChatListItem {
136
+ var displayName: string;
137
+ }
138
+ export type ChatListRootProps<T = unknown> = Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "children"> & {
139
+ /** Dialogs as application data, in the order to show (pinned first, then by the last message). */
140
+ items: readonly T[];
141
+ /** A stable key of a dialog: the `value` of its row. */
142
+ getKey: (item: T) => string;
143
+ /** Renders a dialog: a `ChatList.Item` with its parts. */
144
+ renderItem: (item: T) => React.ReactElement;
145
+ /** The open dialog (controlled); `null` — none. */
146
+ value?: string | null;
147
+ /** The dialog open at first (uncontrolled). Default `null`. */
148
+ defaultValue?: string | null;
149
+ /** The reader opened a dialog: a click, a tap, Enter or Space on its row. */
150
+ onValueChange?: (value: string) => void;
151
+ /** The search query (controlled). Any of the triad shows the search field. */
152
+ search?: string;
153
+ /** The initial query (uncontrolled). */
154
+ defaultSearch?: string;
155
+ /** The query changed: filter `items` by it (the list marks the matches). */
156
+ onSearchChange?: (search: string) => void;
157
+ /** The first load: placeholder rows in the rows' geometry, then a cross-fade into the dialogs. */
158
+ loading?: boolean;
159
+ /** More dialogs exist: a placeholder row ends the list and `onLoadMore` runs near the end. */
160
+ hasMore?: boolean;
161
+ /** The reader scrolled near the end while `hasMore`: load the next dialogs and append them. */
162
+ onLoadMore?: () => void | Promise<void>;
163
+ /** The empty state without a search. Default: «Нет диалогов». */
164
+ empty?: React.ReactNode;
165
+ /** Row tier: height, text, avatar, the search field. Default `m`. */
166
+ size?: ControlSize;
167
+ /** «Now» for the times. Default: the moment of the render. */
168
+ now?: Date;
169
+ /** Display of a `Date` time. Default `formatChatTime`: «14:32», «пн», «12 мар». */
170
+ formatTime?: (date: Date, now: Date) => string;
171
+ labels?: Partial<ChatListLabels>;
172
+ ref?: React.Ref<HTMLDivElement>;
173
+ };
174
+ /**
175
+ * The conversation list of a messenger: the dialogs as data, each drawn by `renderItem` as a
176
+ * `ChatList.Item`, the open one `value`. An optional search field on top, rows that glide to their
177
+ * new places when the order changes, a long list rendered only around the view, placeholder rows
178
+ * while loading and more dialogs loaded near the end. Draws no surface: put it in a pane.
179
+ */
180
+ declare function ChatListRoot<T>({ items, getKey, renderItem, value: valueProp, defaultValue, onValueChange, search: searchProp, defaultSearch, onSearchChange, loading, hasMore, onLoadMore, empty, size, now: nowProp, formatTime, labels: labelsProp, className, ref, ...rest }: ChatListRootProps<T>): import("react/jsx-runtime").JSX.Element;
181
+ declare namespace ChatListRoot {
182
+ var displayName: string;
183
+ }
184
+ export declare const ChatList: {
185
+ Root: typeof ChatListRoot;
186
+ Item: typeof ChatListItem;
187
+ ItemIcon: typeof ChatListItemIcon;
188
+ ItemText: typeof ChatListItemText;
189
+ ItemDescription: typeof ChatListItemDescription;
190
+ ItemMenu: typeof ChatListItemMenu;
191
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The time of a dialog's last message, as a messenger shows it: today «14:32», within the last
3
+ * six days the weekday «пн», earlier this year «12 мар», another year «12.03.2025». The default
4
+ * `ChatList.Root formatTime`.
5
+ */
6
+ export declare function formatChatTime(date: Date, now: Date): string;
@@ -119,11 +119,16 @@ export type CommandMenuItemProps = Omit<React.ButtonHTMLAttributes<HTMLButtonEle
119
119
  keywords?: string;
120
120
  /** Unavailable right now: shown muted with `aria-disabled`, skipped by the arrows, not runnable. */
121
121
  disabled?: boolean;
122
+ /**
123
+ * Shown whatever the query and never counted as a match (the match count, `CommandMenu.Empty`);
124
+ * the arrows reach it after the matches. For one «create from the query» item at the end.
125
+ */
126
+ persistent?: boolean;
122
127
  /** Runs the command: a click, or Enter while the item is active. */
123
128
  onSelect?: () => void;
124
129
  ref?: React.Ref<HTMLButtonElement>;
125
130
  };
126
- declare function CommandMenuItem({ className, value, keywords, disabled, onSelect, onClick, onPointerMove, ref, children, ...rest }: CommandMenuItemProps): import("react/jsx-runtime").JSX.Element;
131
+ declare function CommandMenuItem({ className, value, keywords, disabled, persistent, onSelect, onClick, onPointerMove, ref, children, ...rest }: CommandMenuItemProps): import("react/jsx-runtime").JSX.Element;
127
132
  declare namespace CommandMenuItem {
128
133
  var displayName: string;
129
134
  }
@@ -154,15 +159,15 @@ declare function CommandMenuItemShortcut({ className, ...rest }: CommandMenuItem
154
159
  declare namespace CommandMenuItemShortcut {
155
160
  var displayName: string;
156
161
  }
157
- export type CommandMenuEmptyProps = Omit<React.HTMLAttributes<HTMLDivElement>, "role"> & {
162
+ export type CommandMenuEmptyProps = Omit<React.HTMLAttributes<HTMLDivElement>, "role" | "children"> & {
158
163
  ref?: React.Ref<HTMLDivElement>;
159
164
  };
160
165
  /**
161
166
  * Shown only while nothing matches the query and nothing loads: `labels.empty` and
162
- * `labels.emptyHint`; `children` is an action under them — a button, or a `CommandMenu.Item`
163
- * («Создать «…»») that the arrows and Enter reach and that never counts as a match.
167
+ * `labels.emptyHint`, text only. An action for the query («Создать «…»») is a `persistent`
168
+ * `CommandMenu.Item` at the end of the list, never a child of `Empty`.
164
169
  */
165
- declare function CommandMenuEmpty({ children, ...rest }: CommandMenuEmptyProps): import("react/jsx-runtime").JSX.Element | null;
170
+ declare function CommandMenuEmpty(props: CommandMenuEmptyProps): import("react/jsx-runtime").JSX.Element | null;
166
171
  declare namespace CommandMenuEmpty {
167
172
  var displayName: string;
168
173
  }
@@ -2,10 +2,11 @@ import * as React from "react";
2
2
  import type { UploadItem, UploadQueue } from "../../hooks/useUploadQueue";
3
3
  import { type MediaKind } from "../../internal/mediaKind";
4
4
  import { type ControlSize } from "../../internal/states";
5
+ import { type TextFormattingLabels } from "../../internal/textFormatting";
5
6
  import { type ComposerRecording, type ComposerRecordMode } from "./useRecorder";
6
- export type { ComposerFormat } from "./format";
7
7
  export type { ComposerRecording, ComposerRecordMode } from "./useRecorder";
8
- export type ComposerLabels = {
8
+ /** Every built-in string; the formatting toolbar's names are shared with Textarea. */
9
+ export type ComposerLabels = TextFormattingLabels & {
9
10
  /** Accessible name of the composer `<form>`. */
10
11
  region: string;
11
12
  /** Placeholder and accessible name of the message field. */
@@ -60,14 +61,6 @@ export type ComposerLabels = {
60
61
  attachments: string;
61
62
  /** The option that sends the attached photos and videos as files, uncompressed. */
62
63
  sendAsFiles: string;
63
- /** Accessible name of the formatting toolbar. */
64
- formatting: string;
65
- bold: string;
66
- italic: string;
67
- strikethrough: string;
68
- code: string;
69
- link: string;
70
- quote: string;
71
64
  /** Name of the close button of a reply bar. */
72
65
  cancelReply: string;
73
66
  /** Name of the close button of an edit bar. */
@@ -4,7 +4,7 @@ import { DataTableColumnsMenu } from "./ColumnsMenu";
4
4
  import type { DataTableColumn, DataTableGroup, DataTableRowClickEvent, DataTableSortState } from "./types";
5
5
  export type { DataTableColumnsMenuProps } from "./ColumnsMenu";
6
6
  export type { DataTableColumn, DataTableGroup, DataTableOrder, DataTableRowClickEvent, DataTableSortState, } from "./types";
7
- /** System strings; `{from}`, `{to}`, `{total}`, `{label}`, `{count}` are replaced. */
7
+ /** System strings; `{from}`, `{to}`, `{total}`, `{label}`, `{count}`, `{group}` are replaced. */
8
8
  export type DataTableLabels = {
9
9
  /** Screen-reader announcement while skeleton rows are shown. */
10
10
  loading: string;
@@ -34,6 +34,10 @@ export type DataTableLabels = {
34
34
  reorderRow: string;
35
35
  /** Tooltip of the handles while the table is sorted by a column (reordering is off). */
36
36
  reorderSorted: string;
37
+ /** `aria-label` of the toggle of a collapsed group; `{group}` is the group key. */
38
+ expandGroup: string;
39
+ /** `aria-label` of the toggle of an expanded group; `{group}` is the group key. */
40
+ collapseGroup: string;
37
41
  };
38
42
  export type DataTableProps<Row> = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
39
43
  /** The outer card-fill `<div>`. */
@@ -166,8 +170,18 @@ export type DataTableProps<Row> = Omit<React.HTMLAttributes<HTMLDivElement>, "ch
166
170
  renderGroupHeader?: (group: DataTableGroup<Row>) => React.ReactNode;
167
171
  /** Group header rows stick under the head while their rows scroll. */
168
172
  stickyGroupHeaders?: boolean;
173
+ /**
174
+ * Keys of the collapsed groups, controlled. Passing any of `collapsedGroups`,
175
+ * `defaultCollapsedGroups`, `onCollapsedGroupsChange` makes groups fold: each group header gets
176
+ * a disclosure toggle and its rows fold away and back.
177
+ */
178
+ collapsedGroups?: (string | number)[];
179
+ /** Initially collapsed group keys, uncontrolled (`[]` — every group open, but foldable). */
180
+ defaultCollapsedGroups?: (string | number)[];
181
+ /** The collapsed group keys changed (a group header toggle). */
182
+ onCollapsedGroupsChange?: (collapsedGroups: (string | number)[]) => void;
169
183
  };
170
- export declare function DataTable<Row>({ columns: allColumns, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, rows, source, rowCount, size, className, showHeader, stickyHeader, stickyFirstColumn, getRowKey, getRowHref, onRowClick, isRowClickable, loading, empty, labels: labelsProp, rowDividers, columnDividers, sort, defaultSort, onSortChange, paging, page, defaultPage, onPageChange, pageSize, infiniteBatchSize, hasMore, loadingMore, onLoadMore, scrollHeight, fullWidth, highlightRowOnHover, highlightColumnOnHover, striped, getRowLabel, selectable, selected, defaultSelected, onSelectedChange, onReorder, getRowChildren, renderExpanded, isRowExpandable, expanded, defaultExpanded, onExpandedChange, error, loadingRows, toolbar, getRowGroup, renderGroupHeader, stickyGroupHeaders, ref, ...rest }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
184
+ export declare function DataTable<Row>({ columns: allColumns, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, rows, source, rowCount, size, className, showHeader, stickyHeader, stickyFirstColumn, getRowKey, getRowHref, onRowClick, isRowClickable, loading, empty, labels: labelsProp, rowDividers, columnDividers, sort, defaultSort, onSortChange, paging, page, defaultPage, onPageChange, pageSize, infiniteBatchSize, hasMore, loadingMore, onLoadMore, scrollHeight, fullWidth, highlightRowOnHover, highlightColumnOnHover, striped, getRowLabel, selectable, selected, defaultSelected, onSelectedChange, onReorder, getRowChildren, renderExpanded, isRowExpandable, expanded, defaultExpanded, onExpandedChange, error, loadingRows, toolbar, getRowGroup, renderGroupHeader, stickyGroupHeaders, collapsedGroups, defaultCollapsedGroups, onCollapsedGroupsChange, ref, ...rest }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
171
185
  export declare namespace DataTable {
172
186
  var ColumnsMenu: typeof DataTableColumnsMenu;
173
187
  }
@@ -47,8 +47,10 @@ type DataTableRowProps<Row> = {
47
47
  expandable: boolean;
48
48
  expanded: boolean;
49
49
  animate: boolean;
50
- /** A sub-row of a row that is collapsing: it folds away before it unmounts. */
50
+ /** A row of a collapsing parent or group: it folds away before it unmounts. */
51
51
  folding?: boolean;
52
+ /** The row folds open and shut: a sub-row, or a row of a collapsible group. */
53
+ foldable?: boolean;
52
54
  /** The detail panel opened by the latest expand: it drops in. */
53
55
  detailAnimate: boolean;
54
56
  selected: boolean;
@@ -59,28 +61,42 @@ type DataTableRowProps<Row> = {
59
61
  /** A virtualized body: the row's position among all rows of the table, head included. */
60
62
  ariaRowIndex?: number | undefined;
61
63
  };
62
- declare function DataTableRowImpl<Row>({ shared, row, rowKey, rowLabel, opens, href, index, depth, expandable, expanded, animate, folding, detailAnimate, selected, childControls, measureRef, ariaRowIndex, }: DataTableRowProps<Row>): import("react/jsx-runtime").JSX.Element;
64
+ declare function DataTableRowImpl<Row>({ shared, row, rowKey, rowLabel, opens, href, index, depth, expandable, expanded, animate, folding, foldable, detailAnimate, selected, childControls, measureRef, ariaRowIndex, }: DataTableRowProps<Row>): import("react/jsx-runtime").JSX.Element;
63
65
  /** A body row (plus its detail panel); re-renders only when its own props change. */
64
66
  export declare const DataTableRow: typeof DataTableRowImpl;
67
+ /** The disclosure toggle of a collapsible group (`collapsedGroups`). */
68
+ export type GroupToggle = {
69
+ collapsed: boolean;
70
+ /** `labels.expandGroup` / `labels.collapseGroup` with `{group}` filled in. */
71
+ label: string;
72
+ /** Ids of the group's rows on screen (while expanded). */
73
+ controls: string | undefined;
74
+ onToggle: () => void;
75
+ };
65
76
  type GroupRowProps = {
66
77
  totalColumns: number;
67
78
  sticky: boolean;
79
+ size: ControlSize;
80
+ toggle?: GroupToggle | undefined;
68
81
  children: React.ReactNode;
69
82
  };
70
83
  /**
71
84
  * The header row of a group (`getRowGroup`): a `<th scope="rowgroup">` across every column at the
72
- * head of its own `<tbody>`. Its content stays in the visible width while the table scrolls sideways.
85
+ * head of its own `<tbody>`, led by a disclosure toggle when groups fold. Its content stays in the
86
+ * visible width while the table scrolls sideways.
73
87
  */
74
- export declare function GroupRow({ totalColumns, sticky, children }: GroupRowProps): import("react/jsx-runtime").JSX.Element;
88
+ export declare function GroupRow({ totalColumns, sticky, size, toggle, children }: GroupRowProps): import("react/jsx-runtime").JSX.Element;
75
89
  type MeasureBodyProps<Row> = {
76
90
  rows: MeasureRow<Row>[];
77
91
  columns: DataTableColumn<Row>[];
78
92
  selectable: boolean;
79
93
  expandEnabled: boolean;
94
+ /** A leading column of row handles (`onReorder`). */
95
+ reorderable: boolean;
80
96
  };
81
97
  /**
82
- * Sub-rows of collapsed rows, laid out invisibly so the columns are already as wide as they will
83
- * be once a row opens; never shown or reachable.
98
+ * Sub-rows of collapsed rows and rows of collapsed groups, laid out invisibly so the columns are
99
+ * already as wide as they will be once a row or group opens; never shown or reachable.
84
100
  */
85
- export declare function MeasureBody<Row>({ rows, columns, selectable, expandEnabled, }: MeasureBodyProps<Row>): import("react/jsx-runtime").JSX.Element;
101
+ export declare function MeasureBody<Row>({ rows, columns, selectable, expandEnabled, reorderable, }: MeasureBodyProps<Row>): import("react/jsx-runtime").JSX.Element;
86
102
  export {};
@@ -15,6 +15,10 @@ type StateRowsProps<Row> = {
15
15
  emptyLabel: string;
16
16
  skeletonRows: number;
17
17
  };
18
- /** The body of the loading (skeleton rows), empty and error states. */
18
+ /**
19
+ * The body of the loading (skeleton rows), empty and error states. The empty and error content sits
20
+ * in a sticky box of the visible width, so a wide table centres it in the viewport, not across
21
+ * every column.
22
+ */
19
23
  export declare function StateRows<Row>({ state, columns, size, totalColumns, selectable, expandEnabled, reorderable, error, empty, emptyLabel, skeletonRows, }: StateRowsProps<Row>): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
20
24
  export {};
@@ -77,10 +77,12 @@ type HandleCellProps = {
77
77
  rowKey: React.Key;
78
78
  rowLabel: string | undefined;
79
79
  className?: string | undefined;
80
+ /** Wraps the content like the row's other cells (the fold of a collapsible group's row). */
81
+ wrap?: (node: React.ReactNode) => React.ReactNode;
80
82
  };
81
83
  /**
82
84
  * The leading cell of a reorderable row: the grip (Alt + ↑ / ↓ from the keyboard), a spinner while
83
85
  * the owner saves this row's move, and, while the table is sorted, a disabled grip that says why.
84
86
  */
85
- export declare function ReorderHandleCell({ reorder, rowKey, rowLabel, className }: HandleCellProps): import("react/jsx-runtime").JSX.Element;
87
+ export declare function ReorderHandleCell({ reorder, rowKey, rowLabel, className, wrap }: HandleCellProps): import("react/jsx-runtime").JSX.Element;
86
88
  export {};
@@ -28,16 +28,22 @@ export type FlatRow<Row> = {
28
28
  expanded: boolean;
29
29
  /** Mounted by the latest expand, or newly added to `rows`: plays the enter animation. */
30
30
  animate: boolean;
31
- /** A sub-row of a row that is collapsing: still drawn while it folds away. */
31
+ /** A row of a collapsing parent or group: still drawn while it folds away. */
32
32
  folding: boolean;
33
- /** Top-level row that opens a group on screen (`groupOf`): the group's key. */
34
- groupStart?: string | number;
33
+ /** The row folds open and shut: a sub-row, or a row of a collapsible group. */
34
+ foldable: boolean;
35
35
  };
36
36
  export type MeasureRow<Row> = {
37
37
  row: Row;
38
38
  key: React.Key;
39
39
  depth: number;
40
40
  };
41
+ /** A run of rows of one group on screen: its key and the range of its rows in `rows`. */
42
+ export type GroupRun = {
43
+ key: string | number;
44
+ start: number;
45
+ end: number;
46
+ };
41
47
  export type FlattenOptions<Row> = {
42
48
  /** Top-level rows in `[start, end)` are rendered; the rest only contribute keys. */
43
49
  start: number;
@@ -59,8 +65,16 @@ export type FlattenOptions<Row> = {
59
65
  lastExpandedKey: React.Key | null;
60
66
  /** Collect every key of the data (all pages, all depths) for «select all». */
61
67
  collectKeys: boolean;
62
- /** Group key of a top-level row: the first rendered row of each group run opens it. */
68
+ /** Group key of a top-level row: consecutive rows of one group on screen make a run. */
63
69
  groupOf?: (row: Row) => string | number;
70
+ /** Groups fold (`collapsedGroups`): their rows fold open and shut. */
71
+ foldGroups?: boolean;
72
+ /** Collapsed groups: their rows are not drawn (only measured for the column widths). */
73
+ collapsedGroups?: ReadonlySet<string | number>;
74
+ /** Groups collapsed a moment ago: their rows stay drawn (folding) until the fold ends. */
75
+ closingGroups?: ReadonlySet<string | number>;
76
+ /** Group whose latest expand mounted its rows: they fold open. */
77
+ openedGroup?: string | number | null;
64
78
  };
65
79
  export type Flattened<Row> = {
66
80
  /** Rendered rows in order: the page rows plus the sub-rows of expanded rows. */
@@ -72,6 +86,8 @@ export type Flattened<Row> = {
72
86
  measure: MeasureRow<Row>[];
73
87
  /** Every row id in the data: the scope of «select all» (empty without `collectKeys`). */
74
88
  keys: React.Key[];
89
+ /** Group runs on screen in order (`groupOf`); a collapsed group's run holds no rows. */
90
+ runs: GroupRun[];
75
91
  };
76
92
  /**
77
93
  * One walk over the sorted data. Sub-rows are sorted like the top level and keyed the same way in
@@ -29,6 +29,11 @@ export type FileUploadFile = {
29
29
  src?: string;
30
30
  /** What the picture shows: spoken in place of the name, never drawn. */
31
31
  alt?: string;
32
+ /**
33
+ * The file's address on the server: the row's name or the whole tile becomes a link that opens it
34
+ * in a new tab (the server's `Content-Disposition` decides open or download).
35
+ */
36
+ href?: string;
32
37
  };
33
38
  export type FileUploadLabels = {
34
39
  /** Title of the built-in drop zone body. */
@@ -67,6 +72,8 @@ export type FileUploadLabels = {
67
72
  retry: string;
68
73
  /** Name of the remove button of a file: `{name}`. */
69
74
  remove: string;
75
+ /** Name of a tile's link to the file (`href`): `{name}`. */
76
+ open: string;
70
77
  /** Live region: a file was removed: `{name}`. */
71
78
  removed: string;
72
79
  /** Live region: a reorder put another file first, the new cover: `{name}`. */
@@ -3,6 +3,8 @@ import * as React from "react";
3
3
  import type { ControlSize } from "../../internal/states";
4
4
  import { type GanttBar, type GanttDates, type GanttScale } from "./ganttModel";
5
5
  export type { GanttBar, GanttDates, GanttScale } from "./ganttModel";
6
+ /** What opened a row: a click on its header, or Enter / Space on the focused header. */
7
+ export type GanttRowClickEvent = React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
6
8
  /** System strings; `{label}`, `{start}`, `{end}`, `{date}`, `{progress}` are replaced. */
7
9
  export type GanttLabels = {
8
10
  /** Heading of the first column. */
@@ -55,6 +57,22 @@ export type GanttProps<Row, Bar extends GanttBar = GanttBar> = Omit<React.HTMLAt
55
57
  renderRow?: (row: Row) => React.ReactNode;
56
58
  /** A picture before the row content (an `Avatar`); on a narrow chart the column keeps only it. */
57
59
  renderRowAvatar?: (row: Row) => React.ReactNode;
60
+ /**
61
+ * The row header is a link: a real `<a>` fills the first column and is the row's stop in the
62
+ * grid, so a click, ⌘/Ctrl-click, a middle click and «open in new tab» work on it.
63
+ */
64
+ getRowHref?: (row: Row) => string;
65
+ /**
66
+ * Opens a row in place: a click on its header (never on a control inside it, never from a
67
+ * portal) or Enter / Space on the focused header. With `getRowHref` it gets the plain clicks
68
+ * only — call `event.preventDefault()` there to route in the app instead of loading the page.
69
+ */
70
+ onRowClick?: (row: Row, event: GanttRowClickEvent) => void;
71
+ /**
72
+ * Extra content of a bar's tooltip, under its title and the dates line (which always stay: the
73
+ * dates are what the bar means on the axis). A client, hours, an owner.
74
+ */
75
+ renderBarTooltip?: (bar: Bar, row: Row) => React.ReactNode;
58
76
  /** Zoom, controlled. */
59
77
  scale?: GanttScale;
60
78
  /** Initial zoom, uncontrolled. */
@@ -99,4 +117,4 @@ export type GanttProps<Row, Bar extends GanttBar = GanttBar> = Omit<React.HTMLAt
99
117
  * keyboard through an async `onBarChange`, and are drawn on empty space through `onBarCreate`.
100
118
  * Rows and the time axis are virtualized: thousands of rows over years stay fast.
101
119
  */
102
- export declare function Gantt<Row, Bar extends GanttBar = GanttBar>({ rows, getRowKey, getRowLabel, getRowBars, renderRow, renderRowAvatar, scale: scaleProp, defaultScale, onScaleChange, range: rangeProp, today: todayProp, locale, size, readOnly, loading, empty, toolbar, scrollHeight, onSelect, onBarChange, onBarCreate, labels: labelsProp, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: GanttProps<Row, Bar>): import("react/jsx-runtime").JSX.Element;
120
+ export declare function Gantt<Row, Bar extends GanttBar = GanttBar>({ rows, getRowKey, getRowLabel, getRowBars, renderRow, renderRowAvatar, getRowHref, onRowClick, renderBarTooltip, scale: scaleProp, defaultScale, onScaleChange, range: rangeProp, today: todayProp, locale, size, readOnly, loading, empty, toolbar, scrollHeight, onSelect, onBarChange, onBarCreate, labels: labelsProp, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: GanttProps<Row, Bar>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { Locale } from "date-fns";
2
+ import * as React from "react";
2
3
  import { type GanttBar, type GanttDates, type GanttScale } from "./ganttModel";
3
4
  export type GanttBarViewProps = {
4
5
  bar: GanttBar;
@@ -13,6 +14,8 @@ export type GanttBarViewProps = {
13
14
  nameFor: (dates: GanttDates) => string;
14
15
  /** «14 дн.» — the duration in the tooltip. */
15
16
  formatDuration: (days: number) => string;
17
+ /** `renderBarTooltip`: extra tooltip content under the dates line. */
18
+ renderTip?: () => React.ReactNode;
16
19
  editable: boolean;
17
20
  pending: boolean;
18
21
  /** The roving tab stop of the chart. */
@@ -48,4 +51,4 @@ export type GanttBarViewProps = {
48
51
  * edge at the week and month zoom, and the tooltip shows the new dates. Release commits through
49
52
  * `onCommit`; Escape or a cancelled pointer drops it. On touch a long press picks the bar up.
50
53
  */
51
- export declare function GanttBarView({ bar, dates, x, lane, scale, locale, nameFor, formatDuration, editable, pending, active, hintId, dayPx, direction, scrollLeft, autoScroll, onActivate, onFocusBar, onTipChange, canShowTip, onCommit, onDragChange, barRef, }: GanttBarViewProps): import("react/jsx-runtime").JSX.Element;
54
+ export declare function GanttBarView({ bar, dates, x, lane, scale, locale, nameFor, formatDuration, renderTip, editable, pending, active, hintId, dayPx, direction, scrollLeft, autoScroll, onActivate, onFocusBar, onTipChange, canShowTip, onCommit, onDragChange, barRef, }: GanttBarViewProps): import("react/jsx-runtime").JSX.Element;