@k2b/ui 0.36.0 → 0.38.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 (47) hide show
  1. package/dist/browser/actions/Dropdown.js +132 -116
  2. package/dist/browser/actions/Dropdown.js.map +1 -1
  3. package/dist/browser/actions/Tabs.js +18 -15
  4. package/dist/browser/actions/Tabs.js.map +1 -1
  5. package/dist/browser/chat/ChatComposer.js +58 -25
  6. package/dist/browser/chat/ChatComposer.js.map +1 -1
  7. package/dist/browser/content/MessageRow.js +164 -152
  8. package/dist/browser/content/MessageRow.js.map +1 -1
  9. package/dist/browser/feedback/prompts.js +23 -9
  10. package/dist/browser/feedback/prompts.js.map +1 -1
  11. package/dist/browser/inputs/Combobox.js +56 -51
  12. package/dist/browser/inputs/Combobox.js.map +1 -1
  13. package/dist/browser/inputs/RichSelect.js +86 -67
  14. package/dist/browser/inputs/RichSelect.js.map +1 -1
  15. package/dist/browser/internal/keyed-for.js +47 -0
  16. package/dist/browser/internal/keyed-for.js.map +1 -0
  17. package/dist/browser/layout/AppWorkspace.js +252 -238
  18. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  19. package/dist/browser/text-editor/engine.js +13 -10
  20. package/dist/browser/text-editor/engine.js.map +1 -1
  21. package/dist/ssr/actions/Dropdown.js +101 -85
  22. package/dist/ssr/actions/Dropdown.js.map +1 -1
  23. package/dist/ssr/actions/Tabs.js +12 -9
  24. package/dist/ssr/actions/Tabs.js.map +1 -1
  25. package/dist/ssr/chat/ChatComposer.js +41 -15
  26. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  27. package/dist/ssr/content/MessageRow.js +9 -2
  28. package/dist/ssr/content/MessageRow.js.map +1 -1
  29. package/dist/ssr/feedback/prompts.js +22 -8
  30. package/dist/ssr/feedback/prompts.js.map +1 -1
  31. package/dist/ssr/inputs/Combobox.js +18 -13
  32. package/dist/ssr/inputs/Combobox.js.map +1 -1
  33. package/dist/ssr/inputs/RichSelect.js +47 -28
  34. package/dist/ssr/inputs/RichSelect.js.map +1 -1
  35. package/dist/ssr/internal/keyed-for.js +47 -0
  36. package/dist/ssr/internal/keyed-for.js.map +1 -0
  37. package/dist/ssr/layout/AppWorkspace.js +58 -50
  38. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  39. package/dist/ssr/text-editor/engine.js +13 -10
  40. package/dist/ssr/text-editor/engine.js.map +1 -1
  41. package/dist/styles.css +1 -1
  42. package/dist/types/content/MessageRow.d.ts +1 -1
  43. package/dist/types/feedback/prompts.d.ts +5 -0
  44. package/dist/types/internal/keyed-for.d.ts +13 -0
  45. package/dist/types/layout/AppWorkspace.d.ts +6 -0
  46. package/dist/types/text-editor/engine.d.ts +1 -1
  47. package/package.json +3 -2
@@ -113,7 +113,7 @@ export type MessageRowProps = {
113
113
  * the author and time. Defaults to true; `startsMessageGroup` decides it from the previous message.
114
114
  */
115
115
  groupStart?: boolean;
116
- /** Shown next to the name at the start of a group, for example the kind of account. */
116
+ /** Shown next to the name (or own-message time) at the start of a group, for example the kind of account. */
117
117
  badge?: JSX.Element;
118
118
  /** Send state. Sets a line of fixed height below the message: a clock, a check, or "Not sent" with "Retry". */
119
119
  status?: MessageRowStatus;
@@ -21,6 +21,11 @@ export interface ConfirmOptions extends DialogOptions {
21
21
  }
22
22
  type PromptContent = string | HTMLElement | JSX.Element;
23
23
  export type PromptSearchItem<T = unknown> = {
24
+ /**
25
+ * Stable identity of the result, such as its record ID. With it, a newer answer that contains the same result keeps
26
+ * its row, so a click in progress still lands. Without it, each answer replaces the rows.
27
+ */
28
+ id?: string;
24
29
  label: string;
25
30
  desc?: string;
26
31
  icon?: string;
@@ -0,0 +1,13 @@
1
+ import { type JSX } from "solid-js";
2
+ /**
3
+ * `<For>` that keeps a row's element while its item stays the same: the same object, also when its getters change, or
4
+ * a new object with the same identity (`by`). Hosts rebuild equal items whenever their inputs change; `<For>` would
5
+ * then replace each row, and a row replaced between press and release swallows the click (#2140).
6
+ * Each row reads its current item.
7
+ */
8
+ export declare function KeyedFor<T>(props: {
9
+ each: readonly T[];
10
+ by: (item: T) => string;
11
+ fallback?: JSX.Element;
12
+ children: (item: () => T, index: () => number) => JSX.Element;
13
+ }): JSX.Element;
@@ -235,6 +235,12 @@ export type AppWorkspaceSidebarItemProps = {
235
235
  contextMeta?: JSX.Element;
236
236
  /** Passive second line; keep controls in actions or preview. */
237
237
  description?: JSX.Element;
238
+ /**
239
+ * A third line with the one fact about the row that needs attention, such as "3 deliveries failed". `noteTone`
240
+ * colours it; the words carry the meaning, the colour only repeats it.
241
+ */
242
+ note?: JSX.Element;
243
+ noteTone?: "neutral" | "warning" | "danger";
238
244
  /** Interactive details, also reachable through a dedicated button. */
239
245
  preview?: {
240
246
  label: string;
@@ -27,7 +27,7 @@ export declare function createTextEditor(options: TextEditorOptions): {
27
27
  view: EditorView;
28
28
  /** Also re-reads `presentation`, so a host can refresh it, e.g. after a theme change. */
29
29
  setMode: (mode: TextEditorMode) => void;
30
- setLabel: (label: string) => void;
30
+ setLabel: (next: string) => void;
31
31
  setReadOnly: (readOnly: boolean) => void;
32
32
  destroy: () => void;
33
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k2b/ui",
3
- "version": "0.36.0",
3
+ "version": "0.38.0",
4
4
  "description": "Production-ready components for SolidJS applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -73,6 +73,7 @@
73
73
  "@fontsource/ibm-plex-mono": "5.3.0",
74
74
  "@fontsource/ibm-plex-sans": "5.3.0",
75
75
  "@k2b/stdlib": "0.30.0",
76
+ "@lezer/highlight": "1.2.4",
76
77
  "@lezer/markdown": "1.7.2",
77
78
  "@tabler/icons-webfont": "3.48.0",
78
79
  "dompurify": "3.4.17",
@@ -88,7 +89,7 @@
88
89
  "devDependencies": {
89
90
  "@babel/core": "8.0.6",
90
91
  "@babel/preset-typescript": "8.0.1",
91
- "@k2b/ssr": "0.20.1",
92
+ "@k2b/ssr": "0.20.2",
92
93
  "@types/babel__core": "7.20.5",
93
94
  "@types/bun": "1.4.2",
94
95
  "axe-core": "4.11.0",