@keemakr/ui-sdk 1.3.0 → 1.4.0-dev-20261012081437

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.
package/dist/nodes.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ScreenRootNode } from './schema.js';
2
2
  /** Every node type the root union admits (KEE-574 item 3). */
3
- export declare const KNOWN_NODE_TYPES: readonly ["heading", "text", "markdown", "stat", "button", "form", "table", "timeline", "pending_request", "pending_requests", "choice_cards", "progress", "chart", "pagination", "select", "alert", "details", "timestamp", "section", "tabs"];
3
+ export declare const KNOWN_NODE_TYPES: readonly ["heading", "text", "markdown", "stat", "button", "form", "table", "timeline", "pending_request", "pending_requests", "choice_cards", "progress", "chart", "pagination", "select", "alert", "details", "timestamp", "divider", "section", "tabs"];
4
4
  export type KnownNodeType = (typeof KNOWN_NODE_TYPES)[number];
5
5
  /**
6
6
  * The node types that hold child nodes. `section` mounts its children
package/dist/nodes.js CHANGED
@@ -28,6 +28,7 @@ export const KNOWN_NODE_TYPES = [
28
28
  'alert',
29
29
  'details',
30
30
  'timestamp',
31
+ 'divider',
31
32
  'section',
32
33
  'tabs',
33
34
  ];
package/dist/schema.d.ts CHANGED
@@ -42,6 +42,8 @@ export declare const buttonSchema: z.ZodObject<{
42
42
  secondary: "secondary";
43
43
  }>>;
44
44
  disabled: z.ZodDefault<z.ZodBoolean>;
45
+ hint: z.ZodOptional<z.ZodString>;
46
+ disabledReason: z.ZodOptional<z.ZodString>;
45
47
  }, z.core.$strip>;
46
48
  /** A table cell. Dates are ISO 8601; core formats them tenant-locale-aware. */
47
49
  export declare const cellSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -94,6 +96,8 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
94
96
  secondary: "secondary";
95
97
  }>>;
96
98
  disabled: z.ZodDefault<z.ZodBoolean>;
99
+ hint: z.ZodOptional<z.ZodString>;
100
+ disabledReason: z.ZodOptional<z.ZodString>;
97
101
  }, z.core.$strip>, z.ZodObject<{
98
102
  type: z.ZodLiteral<"form">;
99
103
  key: z.ZodString;
@@ -185,6 +189,8 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
185
189
  secondary: "secondary";
186
190
  }>>;
187
191
  disabled: z.ZodDefault<z.ZodBoolean>;
192
+ hint: z.ZodOptional<z.ZodString>;
193
+ disabledReason: z.ZodOptional<z.ZodString>;
188
194
  }, z.core.$strip>], "type">>;
189
195
  }, z.core.$strip>>;
190
196
  }, z.core.$strip>>;
@@ -287,6 +293,12 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
287
293
  params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
288
294
  }, z.core.$strip>], "kind">;
289
295
  disabled: z.ZodDefault<z.ZodBoolean>;
296
+ labelPlacement: z.ZodDefault<z.ZodEnum<{
297
+ above: "above";
298
+ inline: "inline";
299
+ }>>;
300
+ hint: z.ZodOptional<z.ZodString>;
301
+ disabledReason: z.ZodOptional<z.ZodString>;
290
302
  }, z.core.$strip>, z.ZodObject<{
291
303
  type: z.ZodLiteral<"alert">;
292
304
  tone: z.ZodDefault<z.ZodEnum<{
@@ -316,6 +328,8 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
316
328
  secondary: "secondary";
317
329
  }>>;
318
330
  disabled: z.ZodDefault<z.ZodBoolean>;
331
+ hint: z.ZodOptional<z.ZodString>;
332
+ disabledReason: z.ZodOptional<z.ZodString>;
319
333
  }, z.core.$strip>>;
320
334
  }, z.core.$strip>, z.ZodObject<{
321
335
  type: z.ZodLiteral<"details">;
@@ -349,6 +363,8 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
349
363
  relative: "relative";
350
364
  }>>;
351
365
  label: z.ZodOptional<z.ZodString>;
366
+ }, z.core.$strip>, z.ZodObject<{
367
+ type: z.ZodLiteral<"divider">;
352
368
  }, z.core.$strip>], "type">;
353
369
  type LeafScreenNode = z.infer<typeof leafNodeSchema>;
354
370
  type LeafScreenNodeInput = z.input<typeof leafNodeSchema>;
@@ -356,16 +372,18 @@ export type ScreenNode = LeafScreenNode | {
356
372
  type: 'section';
357
373
  title?: string;
358
374
  description?: string;
359
- layout: 'stack' | 'grid';
375
+ layout: 'stack' | 'grid' | 'row';
360
376
  columns: number;
377
+ scroll: boolean;
361
378
  children: ScreenNode[];
362
379
  };
363
380
  type ScreenNodeInput = LeafScreenNodeInput | {
364
381
  type: 'section';
365
382
  title?: string;
366
383
  description?: string;
367
- layout: 'stack' | 'grid';
368
- columns: number;
384
+ layout: 'stack' | 'grid' | 'row';
385
+ columns?: number;
386
+ scroll?: boolean;
369
387
  children: ScreenNodeInput[];
370
388
  };
371
389
  /**
@@ -437,6 +455,8 @@ export declare const screenTreeSchema: z.ZodObject<{
437
455
  secondary: "secondary";
438
456
  }>>;
439
457
  disabled: z.ZodDefault<z.ZodBoolean>;
458
+ hint: z.ZodOptional<z.ZodString>;
459
+ disabledReason: z.ZodOptional<z.ZodString>;
440
460
  }, z.core.$strip>>>;
441
461
  children: z.ZodArray<z.ZodType<ScreenRootNode, ScreenRootNodeInput, z.core.$ZodTypeInternals<ScreenRootNode, ScreenRootNodeInput>>>;
442
462
  refreshSeconds: z.ZodOptional<z.ZodNumber>;
@@ -485,6 +505,8 @@ export declare const screenLoadResponseSchema: z.ZodObject<{
485
505
  secondary: "secondary";
486
506
  }>>;
487
507
  disabled: z.ZodDefault<z.ZodBoolean>;
508
+ hint: z.ZodOptional<z.ZodString>;
509
+ disabledReason: z.ZodOptional<z.ZodString>;
488
510
  }, z.core.$strip>>>;
489
511
  children: z.ZodArray<z.ZodType<ScreenRootNode, ScreenRootNodeInput, z.core.$ZodTypeInternals<ScreenRootNode, ScreenRootNodeInput>>>;
490
512
  refreshSeconds: z.ZodOptional<z.ZodNumber>;
package/dist/schema.js CHANGED
@@ -41,6 +41,15 @@ export const buttonSchema = z.object({
41
41
  variant: z.enum(['primary', 'secondary', 'destructive']).default('secondary'),
42
42
  /** Shown but not pressable — a Next button on the last page, an action not yet available. */
43
43
  disabled: z.boolean().default(false),
44
+ /** A short explanation shown next to the button on hover or keyboard focus. */
45
+ hint: z.string().min(1).max(200).optional(),
46
+ /**
47
+ * Why the button is disabled, shown under it while `disabled` is true:
48
+ * "Kee stopped because the patient asked for a person". Ignored when the
49
+ * button is enabled. A greyed control that does not say why leaves the
50
+ * reader guessing.
51
+ */
52
+ disabledReason: z.string().min(1).max(200).optional(),
44
53
  });
45
54
  /** A table cell. Dates are ISO 8601; core formats them tenant-locale-aware. */
46
55
  export const cellSchema = z.discriminatedUnion('kind', [
@@ -164,6 +173,16 @@ const selectSchema = z
164
173
  .max(100),
165
174
  onChange: pressSchema,
166
175
  disabled: z.boolean().default(false),
176
+ /**
177
+ * Where the label sits. `above` (the default) is a form field. `inline` puts
178
+ * the label inside the control on the same line, so a row of filters is one
179
+ * line tall: "Status: Open".
180
+ */
181
+ labelPlacement: z.enum(['above', 'inline']).default('above'),
182
+ /** A short explanation shown next to the select on hover or keyboard focus. */
183
+ hint: z.string().min(1).max(200).optional(),
184
+ /** Why the select is disabled, shown under it while `disabled` is true. */
185
+ disabledReason: z.string().min(1).max(200).optional(),
167
186
  })
168
187
  .superRefine((node, ctx) => {
169
188
  if (node.value !== undefined && !node.options.some((option) => option.value === node.value)) {
@@ -214,6 +233,11 @@ const timestampSchema = z.object({
214
233
  /** Shown before the time, muted: "Last contacted". */
215
234
  label: z.string().max(80).optional(),
216
235
  });
236
+ /**
237
+ * A horizontal line that says where one part of a screen ends and the next
238
+ * begins. It carries no content. Use a `section` when the parts need a title.
239
+ */
240
+ const dividerSchema = z.object({ type: z.literal('divider') });
217
241
  const headingSchema = z.object({ type: z.literal('heading'), text: z.string().max(120) });
218
242
  const textSchema = z.object({
219
243
  type: z.literal('text'),
@@ -337,6 +361,7 @@ const leafNodeSchema = z.discriminatedUnion('type', [
337
361
  alertSchema,
338
362
  detailsSchema,
339
363
  timestampSchema,
364
+ dividerSchema,
340
365
  ]);
341
366
  const MAX_SECTION_DEPTH = 8;
342
367
  const nodeSchemas = new Map();
@@ -345,8 +370,20 @@ const sectionBranch = (children) => z.object({
345
370
  type: z.literal('section'),
346
371
  title: z.string().max(120).optional(),
347
372
  description: z.string().max(300).optional(),
348
- layout: z.enum(['stack', 'grid']),
349
- columns: z.number().int().min(1).max(4),
373
+ /**
374
+ * `stack`: one child per line. `grid`: `columns` equal columns. `row`:
375
+ * children side by side at their own width, wrapping on a narrow screen,
376
+ * for a filter bar or a pair of buttons that belong together.
377
+ */
378
+ layout: z.enum(['stack', 'grid', 'row']),
379
+ /** Used by `grid` only. */
380
+ columns: z.number().int().min(1).max(4).default(1),
381
+ /**
382
+ * The section scrolls inside itself at a height the renderer chooses, so
383
+ * that what sits under it stays on screen: a conversation of any length
384
+ * above its reply box.
385
+ */
386
+ scroll: z.boolean().default(false),
350
387
  children: z.array(children).max(100),
351
388
  });
352
389
  const tabsBranch = (children) => z
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keemakr/ui-sdk",
3
- "version": "1.3.0",
3
+ "version": "1.4.0-dev-20261012081437",
4
4
  "description": "Product screens for keemakr marketplace modules: a versioned, server-driven UI tree schema plus defineScreen() handlers. Module code never ships to the browser — keemakr-core validates the tree and renders it with platform components.",
5
5
  "license": "MIT",
6
6
  "type": "module",