@k2b/ui 0.60.0 → 0.62.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 (109) hide show
  1. package/dist/browser/actions/FilterChip.js +3 -0
  2. package/dist/browser/actions/FilterChip.js.map +1 -1
  3. package/dist/browser/chat/ChatPrimitives.js +435 -420
  4. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  5. package/dist/browser/chat/ChatTasks.js +78 -73
  6. package/dist/browser/chat/ChatTasks.js.map +1 -1
  7. package/dist/browser/chat/ChatTimeline.js +3 -0
  8. package/dist/browser/chat/ChatTimeline.js.map +1 -1
  9. package/dist/browser/content/ActivityList.js +379 -290
  10. package/dist/browser/content/ActivityList.js.map +1 -1
  11. package/dist/browser/content/FileView.js +0 -12
  12. package/dist/browser/content/FileView.js.map +1 -1
  13. package/dist/browser/content/Lightbox.js +31 -11
  14. package/dist/browser/content/Lightbox.js.map +1 -1
  15. package/dist/browser/content/PdfPages.js +26 -1
  16. package/dist/browser/content/PdfPages.js.map +1 -1
  17. package/dist/browser/content/RunLog.js +719 -0
  18. package/dist/browser/content/RunLog.js.map +1 -0
  19. package/dist/browser/content/activity-messages.js +2 -2
  20. package/dist/browser/content/activity-messages.js.map +1 -1
  21. package/dist/browser/content/file-view-preview.js +13 -0
  22. package/dist/browser/content/file-view-preview.js.map +1 -1
  23. package/dist/browser/content/index.js +5 -4
  24. package/dist/browser/content/index.js.map +1 -1
  25. package/dist/browser/content/run-log-messages.js +134 -0
  26. package/dist/browser/content/run-log-messages.js.map +1 -0
  27. package/dist/browser/feedback/dialog-core.js +24 -27
  28. package/dist/browser/feedback/dialog-core.js.map +1 -1
  29. package/dist/browser/feedback/dialog-frame-motion.js +506 -15
  30. package/dist/browser/feedback/dialog-frame-motion.js.map +1 -1
  31. package/dist/browser/feedback/prompt-sheet.js +1 -0
  32. package/dist/browser/feedback/prompt-sheet.js.map +1 -1
  33. package/dist/browser/feedback/prompts.js +5 -1
  34. package/dist/browser/feedback/prompts.js.map +1 -1
  35. package/dist/browser/feedback/toast.js +11 -1
  36. package/dist/browser/feedback/toast.js.map +1 -1
  37. package/dist/browser/internal/step-row.js +78 -0
  38. package/dist/browser/internal/step-row.js.map +1 -0
  39. package/dist/browser/layout/PullToRefresh.js +76 -23
  40. package/dist/browser/layout/PullToRefresh.js.map +1 -1
  41. package/dist/browser/layout/refresh-messages.js +4 -2
  42. package/dist/browser/layout/refresh-messages.js.map +1 -1
  43. package/dist/browser/layout/sheet-motion.js +3 -3
  44. package/dist/browser/layout/sheet-motion.js.map +1 -1
  45. package/dist/ssr/actions/FilterChip.js +3 -0
  46. package/dist/ssr/actions/FilterChip.js.map +1 -1
  47. package/dist/ssr/chat/ChatPrimitives.js +109 -71
  48. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  49. package/dist/ssr/chat/ChatTasks.js +31 -16
  50. package/dist/ssr/chat/ChatTasks.js.map +1 -1
  51. package/dist/ssr/chat/ChatTimeline.js +3 -0
  52. package/dist/ssr/chat/ChatTimeline.js.map +1 -1
  53. package/dist/ssr/content/ActivityList.js +199 -114
  54. package/dist/ssr/content/ActivityList.js.map +1 -1
  55. package/dist/ssr/content/FileView.js +0 -12
  56. package/dist/ssr/content/FileView.js.map +1 -1
  57. package/dist/ssr/content/Lightbox.js +31 -11
  58. package/dist/ssr/content/Lightbox.js.map +1 -1
  59. package/dist/ssr/content/PdfPages.js +26 -1
  60. package/dist/ssr/content/PdfPages.js.map +1 -1
  61. package/dist/ssr/content/RunLog.js +471 -0
  62. package/dist/ssr/content/RunLog.js.map +1 -0
  63. package/dist/ssr/content/activity-messages.js +2 -2
  64. package/dist/ssr/content/activity-messages.js.map +1 -1
  65. package/dist/ssr/content/file-view-preview.js +13 -0
  66. package/dist/ssr/content/file-view-preview.js.map +1 -1
  67. package/dist/ssr/content/index.js +5 -4
  68. package/dist/ssr/content/index.js.map +1 -1
  69. package/dist/ssr/content/run-log-messages.js +134 -0
  70. package/dist/ssr/content/run-log-messages.js.map +1 -0
  71. package/dist/ssr/feedback/dialog-core.js +24 -27
  72. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  73. package/dist/ssr/feedback/dialog-frame-motion.js +506 -15
  74. package/dist/ssr/feedback/dialog-frame-motion.js.map +1 -1
  75. package/dist/ssr/feedback/prompt-sheet.js +1 -0
  76. package/dist/ssr/feedback/prompt-sheet.js.map +1 -1
  77. package/dist/ssr/feedback/prompts.js +5 -1
  78. package/dist/ssr/feedback/prompts.js.map +1 -1
  79. package/dist/ssr/feedback/toast.js +11 -1
  80. package/dist/ssr/feedback/toast.js.map +1 -1
  81. package/dist/ssr/internal/step-row.js +35 -0
  82. package/dist/ssr/internal/step-row.js.map +1 -0
  83. package/dist/ssr/layout/PullToRefresh.js +67 -16
  84. package/dist/ssr/layout/PullToRefresh.js.map +1 -1
  85. package/dist/ssr/layout/refresh-messages.js +4 -2
  86. package/dist/ssr/layout/refresh-messages.js.map +1 -1
  87. package/dist/ssr/layout/sheet-motion.js +3 -3
  88. package/dist/ssr/layout/sheet-motion.js.map +1 -1
  89. package/dist/styles.css +1 -1
  90. package/dist/types/actions/FilterChip.d.ts +9 -0
  91. package/dist/types/chat/ChatPrimitives.d.ts +6 -0
  92. package/dist/types/chat/ChatTimeline.d.ts +2 -0
  93. package/dist/types/content/ActivityList.d.ts +24 -6
  94. package/dist/types/content/FileView.d.ts +0 -5
  95. package/dist/types/content/Lightbox.d.ts +7 -5
  96. package/dist/types/content/RunLog.d.ts +53 -0
  97. package/dist/types/content/file-view-preview.d.ts +5 -0
  98. package/dist/types/content/index.d.ts +4 -3
  99. package/dist/types/content/run-log-messages.d.ts +61 -0
  100. package/dist/types/feedback/dialog-core.d.ts +3 -1
  101. package/dist/types/feedback/dialog-frame-motion.d.ts +26 -1
  102. package/dist/types/feedback/prompt-sheet.d.ts +1 -0
  103. package/dist/types/feedback/prompts.d.ts +4 -0
  104. package/dist/types/feedback/toast.d.ts +9 -1
  105. package/dist/types/internal/step-row.d.ts +19 -0
  106. package/dist/types/layout/PullToRefresh.d.ts +2 -2
  107. package/dist/types/layout/refresh-messages.d.ts +1 -0
  108. package/dist/types/layout/sheet-motion.d.ts +2 -2
  109. package/package.json +9 -7
@@ -44,6 +44,15 @@ export type FilterChipProps = {
44
44
  only?: boolean;
45
45
  /** The trigger shows the colors of the first four chosen options before its label, as a quiet hint of what is in view. */
46
46
  swatches?: boolean;
47
+ /**
48
+ * Puts a search field above the options, for a list long enough that finding an option takes reading, such as
49
+ * people. `label` names the field and is its placeholder unless `placeholder` is set. "Only" and "All" stay out of a
50
+ * searchable menu, whose field keeps the focus.
51
+ */
52
+ search?: {
53
+ label: string;
54
+ placeholder?: string;
55
+ };
47
56
  disabled?: boolean;
48
57
  class?: string;
49
58
  };
@@ -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;
@@ -1,6 +1,6 @@
1
1
  import type { DateContext } from "@k2b/stdlib";
2
2
  import { type JSX } from "solid-js";
3
- /** Only the icon carries a tone: grey by default, green for a completion, amber for a notice, red only while an action is needed. */
3
+ /** Warning and danger appear as a small mark at the avatar; ordinary kind icons stay out of the sentence. */
4
4
  export type ActivityTone = "neutral" | "success" | "warning" | "danger";
5
5
  /** At most one action per entry, a link with an icon in the last line, only while the state needs it. */
6
6
  export type ActivityAction = {
@@ -14,6 +14,12 @@ export type ActivityAction = {
14
14
  /** For tests: rendered as `data-activity-action`. */
15
15
  data?: string;
16
16
  };
17
+ /** Identity for the avatar; the actor text stays application-owned. Deleted people use `deleted`; system events keep their own glyph. */
18
+ export type ActivityAvatar = {
19
+ name: string;
20
+ kind: "person" | "service" | "system" | "deleted";
21
+ src?: string | null;
22
+ };
17
23
  export type ActivityEntry = {
18
24
  /**
19
25
  * Stable key of the entry, such as its record id; unique within the list. With it a row keeps its node, folded-out
@@ -23,10 +29,10 @@ export type ActivityEntry = {
23
29
  id?: string;
24
30
  /** ISO instant. */
25
31
  at: string;
26
- /** Icon class of the kind, such as `ti ti-mail`; one fixed icon per kind. */
27
- icon: string;
32
+ /** Kind icon, shown as a status mark for warning, danger, or an explicit `iconLabel`. */
33
+ icon?: string;
28
34
  tone?: ActivityTone;
29
- /** Name of the icon for tooltip and screen readers, when the sentence does not say it already. */
35
+ /** Name of the icon for screen readers, when the sentence does not say it already. */
30
36
  iconLabel?: string;
31
37
  /** One sentence, such as "Invitation sent". */
32
38
  text: JSX.Element;
@@ -41,8 +47,9 @@ export type ActivityEntry = {
41
47
  } | null;
42
48
  /** Only a result, the reason of a failure, a quote, or "before → now" (`ActivityList.Change`). */
43
49
  detail?: JSX.Element;
44
- /** Who did it, a text of the application; without one the meta line reads "automatic". */
50
+ /** Who did it, shown before the sentence; without one the row reads "Automatic". */
45
51
  actor?: JSX.Element | null;
52
+ avatar?: ActivityAvatar;
46
53
  action?: ActivityAction | null;
47
54
  /** A click on the entry opens it, such as its dialog. */
48
55
  onOpen?: () => void;
@@ -59,7 +66,7 @@ export type ActivityEntry = {
59
66
  /** Attributes on the list item, such as `data-email` for focus after a reload. */
60
67
  attrs?: Record<`data-${string}`, string | number | undefined>;
61
68
  };
62
- /** `compact` for a card or side column (meta under the sentence); `wide` for a dialog or page (meta on the right). */
69
+ /** `compact` for a card or side column; `wide` for a dialog or page. Both keep time at the end of the row. */
63
70
  export type ActivityDensity = "compact" | "wide";
64
71
  type ActivityTimeProps = {
65
72
  /**
@@ -83,6 +90,16 @@ export type ActivityListProps = ActivityTimeProps & {
83
90
  label?: string;
84
91
  class?: string;
85
92
  };
93
+ /** A single row inside a feed. The caller owns ordering, grouping, pagination, and the clock. */
94
+ export type ActivityRowProps = ActivityTimeProps & {
95
+ entry: ActivityEntry;
96
+ /** Marks the currently open object, independently of expanded details. */
97
+ selected?: boolean;
98
+ /** Handles the sentence link, including keyboard activation. Leave modified clicks to the browser. */
99
+ onNavigate?: (event: MouseEvent) => void;
100
+ class?: string;
101
+ };
102
+ declare function ActivityStandaloneRow(props: ActivityRowProps): JSX.Element;
86
103
  /** "before → now" of a detail line, the old value quiet. With `term` in front ("Plan: Basic → Team"). */
87
104
  declare function ActivityChange(props: {
88
105
  before: JSX.Element;
@@ -103,6 +120,7 @@ declare function ActivityEmpty(props: {
103
120
  text?: JSX.Element;
104
121
  }): JSX.Element;
105
122
  type ActivityListComponent = ((props: ActivityListProps) => JSX.Element) & {
123
+ Row: typeof ActivityStandaloneRow;
106
124
  Loading: typeof ActivityLoading;
107
125
  Empty: typeof ActivityEmpty;
108
126
  Error: typeof ActivityError;
@@ -76,9 +76,4 @@ export type FileViewRenderer = {
76
76
  /** Text renderers that support the edit affordance when `save` is present. */
77
77
  editable?: boolean;
78
78
  };
79
- /**
80
- * A file size such as "4.2 MB". With `locale`, the number follows that language ("4,2 MB") and drops a trailing
81
- * zero ("64 KB"); without it, the output stays as before.
82
- */
83
- export declare const formatFileViewSize: (bytes: number, locale?: string) => string;
84
79
  export default function FileView(props: FileViewProps): JSX.Element;
@@ -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;
@@ -10,6 +10,11 @@ export declare const fileViewExtension: (path: string) => string;
10
10
  * its bounded client-side limits. Custom renderers remain registry-driven.
11
11
  */
12
12
  export declare const getFileViewPreviewKind: (file: FileViewFile) => FileViewPreviewKind | null;
13
+ /**
14
+ * A file size such as "4.2 MB". With `locale`, the number follows that language ("4,2 MB") and drops a trailing
15
+ * zero ("64 KB"); without it, the output stays as before.
16
+ */
17
+ export declare const formatFileViewSize: (bytes: number, locale?: string) => string;
13
18
  /** Use this to expose preview actions only for files FileView can render. */
14
19
  export declare const canPreviewFile: (file: FileViewFile) => boolean;
15
20
  export type DelimitedTextPreview = {
@@ -1,5 +1,5 @@
1
1
  export type { ChartDateFormat, ChartDatum, ChartDatumRole, ChartFormat, ChartNumberFormat } from "../charts/core";
2
- export { type ActivityAction, ActivityCard, type ActivityCardProps, type ActivityDensity, type ActivityDialogInput, type ActivityEntry, type ActivityKind, ActivityList, type ActivityListProps, type ActivityTone, openActivityDialog, } from "./ActivityList";
2
+ export { type ActivityAction, type ActivityAvatar, ActivityCard, type ActivityCardProps, type ActivityDensity, type ActivityDialogInput, type ActivityEntry, type ActivityKind, ActivityList, type ActivityListProps, type ActivityRowProps, type ActivityTone, openActivityDialog, } from "./ActivityList";
3
3
  export { BalanceSummary, type BalanceSummaryProps } from "./BalanceSummary";
4
4
  export type { CalendarAttendee, CalendarCommand, CalendarController, CalendarCustomView, CalendarDayBadge, CalendarEvent, CalendarEventColor, CalendarEventLink, CalendarEventRenderContext, CalendarEventTimeChange, CalendarExternalDrag, CalendarLabels, CalendarProps, CalendarQuickCreateControls, CalendarRange, CalendarRecurrence, CalendarResource, CalendarSelectionControls, CalendarView, } from "./Calendar";
5
5
  export { default as Calendar } from "./Calendar";
@@ -35,9 +35,9 @@ export { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFile
35
35
  export { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from "./FileGrid";
36
36
  export { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from "./FileTree";
37
37
  export { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from "./FileTypeIcon";
38
- export { default as FileView, type FileViewContent, type FileViewProps, type FileViewRenderer, type FileViewRendererProps, formatFileViewSize, } from "./FileView";
38
+ export { default as FileView, type FileViewContent, type FileViewProps, type FileViewRenderer, type FileViewRendererProps, } from "./FileView";
39
39
  export { FlowAmount, type FlowAmountDirection, type FlowAmountProps, flowDirection } from "./FlowAmount";
40
- export { canPreviewFile, type FileViewFile, type FileViewPreviewKind, getFileViewPreviewKind } from "./file-view-preview";
40
+ export { canPreviewFile, type FileViewFile, type FileViewPreviewKind, formatFileViewSize, getFileViewPreviewKind, } from "./file-view-preview";
41
41
  export type { KbdProps } from "./Kbd";
42
42
  export { Kbd } from "./Kbd";
43
43
  export type { LabelChipProps } from "./LabelChip";
@@ -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
+ };
@@ -5,6 +5,8 @@ export type OpenDialogOptions = {
5
5
  primary?: "blue" | "ai";
6
6
  /** Close only this dialog when its owning operation is cancelled. */
7
7
  signal?: AbortSignal;
8
+ /** Hold and animate content height changes after first rest. Defaults to false; level morphs are independent. */
9
+ followContent?: boolean;
8
10
  panelClassName?: string;
9
11
  contentClassName?: string;
10
12
  initialFocus?: "first-input" | "none" | ((dialog: HTMLDialogElement) => HTMLElement | null);
@@ -34,7 +36,7 @@ export type DialogRender<T> = (close: DialogClose<T>, context: {
34
36
  dialog: HTMLDialogElement;
35
37
  /** Switch this entry between a modal and a modeless window without remounting. */
36
38
  setModal: (modal: boolean) => void;
37
- /** Set viewport coordinates, or restore the panel stylesheet position with null. */
39
+ /** Set viewport coordinates, or restore stylesheet positioning with null. Repeating the current value preserves running motion. */
38
40
  setPosition: (position: {
39
41
  x: number;
40
42
  y: number;
@@ -5,10 +5,21 @@
5
5
  * first frame so it never rewraps; the frame clips meanwhile. Anything that interrupts a change turns around from the
6
6
  * values the eye sees; the endings of the interrupted change are dropped, not run. Reduced motion swaps in one frame.
7
7
  *
8
+ * An opted-in frame also follows its content's height while it is open: when a notice comes or goes, fields appear, or text
9
+ * grows, the frame goes from the height the eye sees to the new one over `--k2b-motion-fold` with `--k2b-ease-glide`,
10
+ * and new content fades in over `--k2b-motion-fast` from 40 % of that time. Its top edge stays where it is: it grows
11
+ * downwards and moves up together with growth only when the room below runs out; a sheet grows from the bottom edge. Frames with a size of
12
+ * their own (fixed, workspace, full, sheets with detents) never follow. Neither the first open, the close, a window
13
+ * resize, nor the on-screen keyboard starts an animation; a resize during a fold retargets it.
14
+ *
8
15
  * The frame's own size is animated, a named exception to "transform and opacity only" (see the motion guide): the
9
16
  * frame stands alone above the page, so nothing beside it moves.
10
17
  */
11
18
  export { afterExitTransitions } from "../internal/exit-motion";
19
+ type Position = {
20
+ x: number;
21
+ y: number;
22
+ } | null | undefined;
12
23
  export type FrameMotion = {
13
24
  /**
14
25
  * Before a level replaces the shown one: remembers the frame as the eye sees it and takes `leaving` out of the flow,
@@ -25,9 +36,13 @@ export type FrameMotion = {
25
36
  * After `arriving` is shown and its frame presentation applied: morphs the frame to its size and fades the contents.
26
37
  * `left` runs once `leaving` has faded out (hide a lower level, or dispose a closed one).
27
38
  */
28
- arrive: (arriving: HTMLElement, left: () => void) => void;
39
+ arrive: (arriving: HTMLElement, left: () => void, followContent?: boolean) => void;
40
+ /** Follows only opted-in levels; `arrive` passes the arriving level's choice. */
41
+ follow: (level: HTMLElement, enabled?: boolean) => void;
29
42
  /** Ends every motion now and runs the pending endings, for a frame that leaves the document. */
30
43
  stop: () => void;
44
+ /** A changed explicit position wins over a fold; returns false for an unchanged position. */
45
+ position: (previous: Position, next: Position) => boolean;
31
46
  /**
32
47
  * For a frame that closes and fades out: keeps the size, place and contents exactly as the eye sees them now, and
33
48
  * returns the pending endings to run once the frame has left.
@@ -35,3 +50,13 @@ export type FrameMotion = {
35
50
  freeze: () => () => void;
36
51
  };
37
52
  export declare const createFrameMotion: (dialog: HTMLDialogElement) => FrameMotion;
53
+ /** Every successful import, including retries, joins the current frame once and follows its current level. */
54
+ export declare const connectFrameMotion: (state: {
55
+ element?: HTMLDialogElement;
56
+ motion?: FrameMotion;
57
+ stack: readonly {
58
+ container: HTMLElement;
59
+ role: "dialog" | "alertdialog";
60
+ follow?: boolean;
61
+ }[];
62
+ }, announced?: (typeof state.stack)[number]) => void;
@@ -7,6 +7,7 @@ type PromptFrame = {
7
7
  signal?: AbortSignal;
8
8
  cancelBehavior?: OpenDialogOptions["cancelBehavior"];
9
9
  history?: boolean;
10
+ followContent?: boolean;
10
11
  ariaLabel?: string;
11
12
  title?: string;
12
13
  };
@@ -17,6 +17,8 @@ export interface DialogOptions {
17
17
  cancelBehavior?: OpenDialogOptions["cancelBehavior"];
18
18
  /** Back closes the prompt like Cancel, as in a phone app; see `OpenDialogOptions.history`. */
19
19
  history?: boolean;
20
+ /** Animate content height changes. Defaults to false, or true for form, prompt and promptNumber. */
21
+ followContent?: boolean;
20
22
  }
21
23
  export type SuccessDialogOptions = Omit<DialogOptions, "variant"> & {
22
24
  /** A finished success, such as an issued document: the header draws its check once when the dialog opens. */
@@ -149,6 +151,8 @@ type PromptFormOptions<T extends Record<string, FieldSchema>> = {
149
151
  title?: string;
150
152
  ariaLabel?: string;
151
153
  icon?: string;
154
+ /** Hold and animate content height changes. Defaults to true. */
155
+ followContent?: boolean;
152
156
  fields: T;
153
157
  confirmText?: string;
154
158
  cancelText?: string | false;
@@ -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. */
@@ -23,8 +23,8 @@ export type SheetMotion = {
23
23
  dispose: () => void;
24
24
  };
25
25
  /**
26
- * Moves a bottom sheet with transform and opacity only. Its layout height is fixed when it opens (the content's height,
27
- * or the full height with detents) and never animates; the sheet slides by `--k2b-sheet-y`, the footer stays on the
26
+ * Moves a bottom sheet with transform and opacity only. Its layout height is the content's height, which the dialog
27
+ * core folds on content changes when `followContent` is enabled, or the full height with detents, which never animates; the sheet slides by `--k2b-sheet-y`, the footer stays on the
28
28
  * screen's edge between half and full height by `--k2b-sheet-footer-y`, and the backdrop dims by `--k2b-sheet-dim`.
29
29
  * A glide is a Web Animation that ends on exactly those values, so it lands on its detent without a settle. A drag on
30
30
  * the handle or the header follows the pointer; a finger anywhere follows too, except where a list still scrolls.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k2b/ui",
3
- "version": "0.60.0",
3
+ "version": "0.62.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"