@k2b/ui 0.60.0 → 0.61.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 (60) hide show
  1. package/dist/browser/chat/ChatPrimitives.js +435 -420
  2. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  3. package/dist/browser/chat/ChatTasks.js +78 -73
  4. package/dist/browser/chat/ChatTasks.js.map +1 -1
  5. package/dist/browser/chat/ChatTimeline.js +3 -0
  6. package/dist/browser/chat/ChatTimeline.js.map +1 -1
  7. package/dist/browser/content/Lightbox.js +31 -11
  8. package/dist/browser/content/Lightbox.js.map +1 -1
  9. package/dist/browser/content/PdfPages.js +26 -1
  10. package/dist/browser/content/PdfPages.js.map +1 -1
  11. package/dist/browser/content/RunLog.js +719 -0
  12. package/dist/browser/content/RunLog.js.map +1 -0
  13. package/dist/browser/content/index.js +1 -0
  14. package/dist/browser/content/index.js.map +1 -1
  15. package/dist/browser/content/run-log-messages.js +134 -0
  16. package/dist/browser/content/run-log-messages.js.map +1 -0
  17. package/dist/browser/feedback/toast.js +11 -1
  18. package/dist/browser/feedback/toast.js.map +1 -1
  19. package/dist/browser/internal/step-row.js +78 -0
  20. package/dist/browser/internal/step-row.js.map +1 -0
  21. package/dist/browser/layout/PullToRefresh.js +76 -23
  22. package/dist/browser/layout/PullToRefresh.js.map +1 -1
  23. package/dist/browser/layout/refresh-messages.js +4 -2
  24. package/dist/browser/layout/refresh-messages.js.map +1 -1
  25. package/dist/ssr/chat/ChatPrimitives.js +109 -71
  26. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  27. package/dist/ssr/chat/ChatTasks.js +31 -16
  28. package/dist/ssr/chat/ChatTasks.js.map +1 -1
  29. package/dist/ssr/chat/ChatTimeline.js +3 -0
  30. package/dist/ssr/chat/ChatTimeline.js.map +1 -1
  31. package/dist/ssr/content/Lightbox.js +31 -11
  32. package/dist/ssr/content/Lightbox.js.map +1 -1
  33. package/dist/ssr/content/PdfPages.js +26 -1
  34. package/dist/ssr/content/PdfPages.js.map +1 -1
  35. package/dist/ssr/content/RunLog.js +471 -0
  36. package/dist/ssr/content/RunLog.js.map +1 -0
  37. package/dist/ssr/content/index.js +1 -0
  38. package/dist/ssr/content/index.js.map +1 -1
  39. package/dist/ssr/content/run-log-messages.js +134 -0
  40. package/dist/ssr/content/run-log-messages.js.map +1 -0
  41. package/dist/ssr/feedback/toast.js +11 -1
  42. package/dist/ssr/feedback/toast.js.map +1 -1
  43. package/dist/ssr/internal/step-row.js +35 -0
  44. package/dist/ssr/internal/step-row.js.map +1 -0
  45. package/dist/ssr/layout/PullToRefresh.js +67 -16
  46. package/dist/ssr/layout/PullToRefresh.js.map +1 -1
  47. package/dist/ssr/layout/refresh-messages.js +4 -2
  48. package/dist/ssr/layout/refresh-messages.js.map +1 -1
  49. package/dist/styles.css +1 -1
  50. package/dist/types/chat/ChatPrimitives.d.ts +6 -0
  51. package/dist/types/chat/ChatTimeline.d.ts +2 -0
  52. package/dist/types/content/Lightbox.d.ts +7 -5
  53. package/dist/types/content/RunLog.d.ts +53 -0
  54. package/dist/types/content/index.d.ts +1 -0
  55. package/dist/types/content/run-log-messages.d.ts +61 -0
  56. package/dist/types/feedback/toast.d.ts +9 -1
  57. package/dist/types/internal/step-row.d.ts +19 -0
  58. package/dist/types/layout/PullToRefresh.d.ts +2 -2
  59. package/dist/types/layout/refresh-messages.d.ts +1 -0
  60. package/package.json +9 -7
@@ -4,6 +4,12 @@ export type ChatMessageProps = {
4
4
  role: ChatRole;
5
5
  children?: JSX.Element;
6
6
  label?: string;
7
+ /**
8
+ * Who wrote a message the person did not type here, such as an automation or another chat: a short line above the
9
+ * bubble, a link only where the viewer may open the source. The bubble then takes the machine-written surface
10
+ * (`--k2b-chat-machine-surface`).
11
+ */
12
+ source?: JSX.Element;
7
13
  createdAt?: string | Date;
8
14
  timeLabel?: string;
9
15
  status?: ChatMessageStatus;
@@ -7,6 +7,8 @@ export type ChatMessageItem = {
7
7
  role: ChatRole;
8
8
  content?: JSX.Element;
9
9
  label?: string;
10
+ /** Who wrote a message the person did not type here; see `ChatMessageProps.source`. */
11
+ source?: JSX.Element;
10
12
  createdAt?: string | Date;
11
13
  timeLabel?: string;
12
14
  status?: ChatMessageStatus;
@@ -57,10 +57,12 @@ export type LightboxProps = {
57
57
  * shown through its preview PDF, and for anything else its icon, facts and Download. It loads the file itself and
58
58
  * shows every state: a placeholder after a short wait, a failure with "Try again", and "Preview not possible".
59
59
  *
60
- * The name sits in a pill at the top left; Open (when the caller gives a target), the caller's commands, Download
61
- * and Close in a pill at the top right. Large round buttons at the screen edges step between files, as do ← and →
62
- * and the film strip from two files on; there is no "2 / 8" counter. The only pill at the bottom holds zoom and the
63
- * page. Escape, Close, a press beside the file or a swipe down close it, and focus returns to the opener. On a phone
64
- * it fills the screen and a swipe steps between files.
60
+ * The file has the whole screen: a PDF or document fills its width up to its natural size and scrolls under the
61
+ * controls, a picture shows whole on the full screen, and zoomed in either pans across the full screen. The controls
62
+ * float above it: the name in a pill at the top left; Open (when the caller gives a target), the caller's commands,
63
+ * Download and Close in a pill at the top right. Large round buttons at the screen edges step between files, as do
64
+ * ← and → and the film strip from two files on; there is no "2 / 8" counter. The only pill at the bottom holds zoom
65
+ * and the page. Escape, Close, a press beside the file or a swipe down from the top close it, and focus returns to
66
+ * the opener. On a phone a swipe steps between files.
65
67
  */
66
68
  export default function Lightbox(props: LightboxProps): JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { type JSX } from "solid-js";
2
+ export type RunLogState = "idle" | "starting" | "running" | "succeeded" | "failed";
3
+ export type RunLevel = "info" | "warn" | "error";
4
+ export type RunStepEntry = {
5
+ kind: "step";
6
+ id: string;
7
+ at: string;
8
+ label: string;
9
+ /** Complete Tabler class, e.g. `ti ti-file-text`. */
10
+ icon?: string;
11
+ description?: string;
12
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
13
+ startedAt?: string;
14
+ endedAt?: string;
15
+ message?: string;
16
+ };
17
+ export type RunLogEntry = {
18
+ kind: "log";
19
+ id: string;
20
+ at: string;
21
+ level: RunLevel;
22
+ text: string;
23
+ };
24
+ export type RunEntry = RunStepEntry | RunLogEntry;
25
+ export type RunLogAction = {
26
+ icon: string;
27
+ label: string;
28
+ onClick?: () => void;
29
+ href?: string;
30
+ primary?: boolean;
31
+ disabled?: boolean;
32
+ disabledReason?: string;
33
+ };
34
+ export type RunLogProps = {
35
+ state: RunLogState;
36
+ /** Unknown kinds are ignored. Later step records with the same id replace the row in its original position. */
37
+ entries: readonly (RunEntry | {
38
+ kind: string;
39
+ })[];
40
+ /** Milliseconds supplied by the host. No clock runs inside RunLog. */
41
+ duration?: number;
42
+ meta?: JSX.Element;
43
+ size?: "full" | "compact";
44
+ /** Initial disclosure state; a changed value also updates the disclosure. */
45
+ output?: "open" | "closed" | "hidden";
46
+ olderCount?: number;
47
+ onLoadOlder?: () => void;
48
+ actions?: readonly RunLogAction[];
49
+ label?: string;
50
+ class?: string;
51
+ };
52
+ /** A run's steps and output. Presentation and disclosures only; the host owns execution, time, connection, and history. */
53
+ export declare function RunLog(props: RunLogProps): JSX.Element;
@@ -74,6 +74,7 @@ export { default as RangePicker } from "./RangePicker";
74
74
  export { ReactionBar, type ReactionBarItem, type ReactionBarProps } from "./ReactionBar";
75
75
  export type { ReferenceChipObjectProps, ReferenceChipPersonProps, ReferenceChipProps, ReferenceChipTimeProps, } from "./ReferenceChip";
76
76
  export { REFERENCE_CHIP_MAX_CHARACTERS, ReferenceChip, truncateMiddle } from "./ReferenceChip";
77
+ export { type RunEntry, type RunLevel, RunLog, type RunLogAction, type RunLogEntry, type RunLogProps, type RunLogState, type RunStepEntry, } from "./RunLog";
77
78
  export type { StepsProps } from "./Steps";
78
79
  export { Steps } from "./Steps";
79
80
  export type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from "./StructuredDataPreview";
@@ -0,0 +1,61 @@
1
+ export declare function useRunLogMessages(): () => {
2
+ run: string;
3
+ idle: string;
4
+ starting: string;
5
+ running: string;
6
+ since: ({ duration }: {
7
+ duration: string;
8
+ }) => string;
9
+ succeeded: string;
10
+ doneAfter: ({ duration }: {
11
+ duration: string;
12
+ }) => string;
13
+ failed: string;
14
+ failedAfter: ({ duration }: {
15
+ duration: string;
16
+ }) => string;
17
+ pending: string;
18
+ active: string;
19
+ completed: string;
20
+ skipped: string;
21
+ stepFailed: string;
22
+ output: string;
23
+ noLines: string;
24
+ lines: ({ count }: {
25
+ count: number;
26
+ }) => string;
27
+ line: string;
28
+ warnings: ({ count }: {
29
+ count: number;
30
+ }) => string;
31
+ warning: string;
32
+ warningLevel: string;
33
+ errors: ({ count }: {
34
+ count: number;
35
+ }) => string;
36
+ error: string;
37
+ errorLevel: string;
38
+ older: ({ count }: {
39
+ count: number;
40
+ }) => string;
41
+ earlier: ({ count }: {
42
+ count: number;
43
+ }) => string;
44
+ later: ({ count }: {
45
+ count: number;
46
+ }) => string;
47
+ current: string;
48
+ details: ({ label }: {
49
+ label: string;
50
+ }) => string;
51
+ toggle: string;
52
+ actions: string;
53
+ progress: ({ current, count }: {
54
+ current: number;
55
+ count: number;
56
+ }) => string;
57
+ steps: ({ count }: {
58
+ count: number;
59
+ }) => string;
60
+ step: string;
61
+ };
@@ -20,13 +20,21 @@ export type ToastOptions = {
20
20
  variant?: ToastVariant;
21
21
  /** Milliseconds until the toast closes; `0` keeps it until it is closed. Omit it for the default by variant, length, and action. */
22
22
  duration?: number;
23
+ /**
24
+ * The icon comes from the variant. Pass a glyph only when it says more than the tone, such as `ti-send` for a queued
25
+ * message; it keeps the variant's colour. Never pass a tone glyph: an error is `variant: "error"`, not its icon.
26
+ */
23
27
  iconClass?: string;
24
28
  /**
25
29
  * A finished success, such as an issued document: the success toast draws its check once when it appears, in place of
26
30
  * its icon. Leave it off for routine saves. Other variants and running progress ignore it.
27
31
  */
28
32
  celebrate?: boolean;
29
- /** A short line of context above the message. There is no default title. */
33
+ /**
34
+ * The outcome in one to three words ("Sent", "Could not save"), at most 32 characters, so it stays one line beside the
35
+ * icon on a phone. The message then becomes the muted description under it. Leave it out only when the whole message is
36
+ * that short; a short message alone takes the title's type.
37
+ */
30
38
  title?: string;
31
39
  action?: ToastAction | null;
32
40
  /** A second action. With it, both actions sit in a row under the message: `action` first, as the primary button. */
@@ -0,0 +1,19 @@
1
+ import { type JSX } from "solid-js";
2
+ /** Internal cells shared by chat activities, composer tasks, and run steps. The owning surface supplies its grid. */
3
+ export declare function StepRowContent(props: {
4
+ classes: {
5
+ leading: string;
6
+ label: string;
7
+ meta?: string;
8
+ duration?: string;
9
+ };
10
+ leading: JSX.Element;
11
+ label: JSX.Element;
12
+ meta?: JSX.Element;
13
+ metaTone?: string;
14
+ duration?: string;
15
+ durationTitle?: string;
16
+ silentDuration?: boolean;
17
+ end?: JSX.Element;
18
+ statusLabel?: string;
19
+ }): JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { type JSX } from "solid-js";
2
- export type PullToRefreshState = "idle" | "pulling" | "ready" | "refreshing";
2
+ export type PullToRefreshState = "idle" | "pulling" | "ready" | "refreshing" | "error";
3
3
  export type PullToRefreshProps = {
4
- /** Reloads the wrapped content. The indicator stays busy until the promise settles. */
4
+ /** Reloads the wrapped content. The indicator stays busy until the promise settles; a rejection shows a short failure mark. */
5
5
  onRefresh: () => Promise<void>;
6
6
  disabled?: boolean;
7
7
  /** Status text announced while refreshing. Defaults to the shared "Refreshing" message. */
@@ -1,5 +1,6 @@
1
1
  declare const refreshMessages: import("@k2b/stdlib").Catalog<{
2
2
  refreshing: string;
3
+ refreshFailed: string;
3
4
  }>;
4
5
  export type RefreshMessages = ReturnType<(typeof refreshMessages)["resolve"]>["t"];
5
6
  /** Resolved from the inherited render locale. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k2b/ui",
3
- "version": "0.60.0",
3
+ "version": "0.61.0",
4
4
  "description": "Production-ready components for SolidJS applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -84,10 +84,10 @@
84
84
  "check:declarations": "bun run scripts/check-declarations.ts",
85
85
  "fixture:build": "bun run build && NODE_ENV=production bun run fixture/scripts/build.ts",
86
86
  "fixture:typecheck": "tsc -p fixture/tsconfig.json --noEmit --pretty false",
87
- "test": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' src scripts test/browser.browser.test.ts && bun run scripts/check-packed-consumer.ts",
88
- "test:part:layout-content": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' src/layout src/content",
89
- "test:part:rest": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' --path-ignore-patterns 'src/layout/**' --path-ignore-patterns 'src/content/**' --path-ignore-patterns 'src/styles/**' --path-ignore-patterns 'src/inputs/**' --path-ignore-patterns 'src/chat/**' src scripts test/browser.browser.test.ts && bun run scripts/check-packed-consumer.ts",
90
- "test:part:styles-inputs-chat": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' src/styles src/inputs src/chat",
87
+ "test": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' ./src ./scripts ./test/browser.browser.test.ts ./fixture/fixture.render.test.tsx && bun run scripts/check-packed-consumer.ts",
88
+ "test:part:layout-content": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' ./src/layout ./src/content",
89
+ "test:part:rest": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' --path-ignore-patterns 'src/layout/**' --path-ignore-patterns 'src/content/**' --path-ignore-patterns 'src/styles/**' --path-ignore-patterns 'src/inputs/**' --path-ignore-patterns 'src/chat/**' ./src ./scripts ./test/browser.browser.test.ts ./fixture/fixture.render.test.tsx && bun run scripts/check-packed-consumer.ts",
90
+ "test:part:styles-inputs-chat": "bun run build && bun test --path-ignore-patterns '**/*.behavior.test.*' ./src/styles ./src/inputs ./src/chat",
91
91
  "typecheck": "tsc --checkers 2 -p tsconfig.json --noEmit --pretty false && bun run check:declarations && bun run typecheck:dom",
92
92
  "typecheck:dom": "tsc -p test/tsconfig.json --noEmit --pretty false",
93
93
  "prepack": "bun run build"
@@ -99,7 +99,7 @@
99
99
  "@codemirror/view": "6.43.15",
100
100
  "@fontsource/ibm-plex-mono": "5.3.0",
101
101
  "@fontsource/ibm-plex-sans": "5.3.0",
102
- "@k2b/stdlib": "0.34.0",
102
+ "@k2b/stdlib": "0.34.1",
103
103
  "@lezer/highlight": "1.2.5",
104
104
  "@lezer/markdown": "1.8.1",
105
105
  "@tabler/icons-webfont": "3.48.0",
@@ -136,7 +136,9 @@
136
136
  "fontnik": "0.7.7",
137
137
  "yjs": "13.6.33",
138
138
  "y-codemirror.next": "0.3.6",
139
- "y-protocols": "1.0.7"
139
+ "y-protocols": "1.0.7",
140
+ "postcss": "8.5.32",
141
+ "postcss-selector-parser": "7.1.7"
140
142
  },
141
143
  "publishConfig": {
142
144
  "access": "public"