@servicetitan/json-render-react 0.1.1 → 0.2.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.
@@ -46,7 +46,7 @@ For lists where users can add/remove items (todos, carts, etc.), use pushState a
46
46
 
47
47
  IMPORTANT: State paths use RFC 6901 JSON Pointer syntax (e.g. "/todos/0/title"). Do NOT use JavaScript-style dot notation (e.g. "/todos.length" is WRONG). To generate unique IDs for new items, use "$id" instead of trying to read array length.
48
48
 
49
- AVAILABLE COMPONENTS (20):
49
+ AVAILABLE COMPONENTS (21):
50
50
 
51
51
  - Text: { content: string, variant?: "headline" | "body" | "eyebrow", size?: "small" | "medium" | "large" | "xlarge", subdued?: boolean, el?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" } - Display text. variant: headline=bold title, eyebrow=small label, body=default. size: small/medium/large/xlarge (headline and body only). subdued: deemphasized body text. el: heading element for variant=headline (default h3).
52
52
  - Card: { background?: "strong" | "stronger", padding?: "0" | "xsmall" | "small" | "medium" | "large" } - White surface with padding; groups related content. background: strong | stronger for elevated surfaces. padding: 0 | xsmall | small | medium (default) | large. [accepts children]
@@ -65,6 +65,7 @@ AVAILABLE COMPONENTS (20):
65
65
  - Button: { label: string, appearance?: "primary" | "secondary" | "ghost", size?: "xsmall" | "small" | "medium" | "large", loading?: boolean, disabled?: boolean } - Clickable button. Every button automatically submits form data when pressed — the element key is used as the actionId to identify which button was clicked. loading: true shows a spinner. disabled: true prevents interaction. size: xsmall | small | medium (default) | large.
66
66
  - Checkbox: { label: string, checked?: boolean, disabled?: boolean } - Checkbox input with label. Use $bindState on checked to track state.
67
67
  - Input: { label: string, placeholder?: string, type?: "text" | "password" | "email" | "tel" | "url" | "number", value?: string, disabled?: boolean } - Free-text input field for user-typed values (names, notes, numbers, etc). type: text (default), password (masked), email, tel (phone), url, number. Use $bindState on value to bind to state. Prefer this over Select when the value is not from a fixed list.
68
+ - Textarea: { label: string, placeholder?: string, description?: string, moreInfo?: string, value?: string, rows?: number, disabled?: boolean } - Multi-line free-text input for long values (notes, descriptions, email body). Use $bindState on value to bind to state. rows: visible row count (default 3).
68
69
  - Listbox: { label: string, options: Array<{ value: string, label: string }>, value?: string, disabled?: boolean } - Listbox for choosing from a fixed list of known options. Use only when options are predefined. For free-text user input use Input instead.
69
70
  - RadioGroup: { label: string, options: Array<{ value: string, label: string }>, value?: string, disabled?: boolean } - Group of radio buttons for single selection. Use $bindState on value to capture selection.
70
71
  - Switch: { label: string, checked?: boolean, disabled?: boolean } - Toggle switch for binary on/off settings. Prefer over Checkbox for enabling/disabling features. Use $bindState on checked to track state.
@@ -77,6 +78,7 @@ AVAILABLE ACTIONS:
77
78
  - validateForm: Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }. [built-in]
78
79
  - atlas.submitUserAction: Submit form data. actionId overrides default "form_submit" identifier.
79
80
  - atlas.navigate: Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app.
81
+ - atlas.toolCall: Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.
80
82
 
81
83
  EVENTS (the `on` field):
82
84
  Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props.
@@ -28,6 +28,7 @@
28
28
  "Button",
29
29
  "Checkbox",
30
30
  "Input",
31
+ "Textarea",
31
32
  "Listbox",
32
33
  "RadioGroup",
33
34
  "Switch"
@@ -46,7 +46,7 @@ For lists where users can add/remove items (todos, carts, etc.), use pushState a
46
46
 
47
47
  IMPORTANT: State paths use RFC 6901 JSON Pointer syntax (e.g. "/todos/0/title"). Do NOT use JavaScript-style dot notation (e.g. "/todos.length" is WRONG). To generate unique IDs for new items, use "$id" instead of trying to read array length.
48
48
 
49
- AVAILABLE COMPONENTS (21):
49
+ AVAILABLE COMPONENTS (22):
50
50
 
51
51
  - Text: { content: string, variant?: "headline" | "body" | "eyebrow", size?: "small" | "medium" | "large" | "xlarge", subdued?: boolean, el?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" } - Display text. variant: headline=bold title, eyebrow=small label, body=default. size: small/medium/large/xlarge (headline and body only). subdued: deemphasized body text. el: heading element for variant=headline (default h3).
52
52
  - Card: { background?: "strong" | "stronger", padding?: "0" | "xsmall" | "small" | "medium" | "large" } - White surface with padding; groups related content. background: strong | stronger for elevated surfaces. padding: 0 | xsmall | small | medium (default) | large. [accepts children]
@@ -65,6 +65,7 @@ AVAILABLE COMPONENTS (21):
65
65
  - Button: { label: string, appearance?: "primary" | "secondary" | "ghost", size?: "xsmall" | "small" | "medium" | "large", loading?: boolean, disabled?: boolean } - Clickable button. Every button automatically submits form data when pressed — the element key is used as the actionId to identify which button was clicked. loading: true shows a spinner. disabled: true prevents interaction. size: xsmall | small | medium (default) | large.
66
66
  - Checkbox: { label: string, checked?: boolean, disabled?: boolean } - Checkbox input with label. Use $bindState on checked to track state.
67
67
  - Input: { label: string, placeholder?: string, type?: "text" | "password" | "email" | "tel" | "url" | "number", value?: string, disabled?: boolean } - Free-text input field for user-typed values (names, notes, numbers, etc). type: text (default), password (masked), email, tel (phone), url, number. Use $bindState on value to bind to state. Prefer this over Select when the value is not from a fixed list.
68
+ - Textarea: { label: string, placeholder?: string, description?: string, moreInfo?: string, value?: string, rows?: number, disabled?: boolean } - Multi-line free-text input for long values (notes, descriptions, email body). Use $bindState on value to bind to state. rows: visible row count (default 3).
68
69
  - Listbox: { label: string, options: Array<{ value: string, label: string }>, value?: string, disabled?: boolean } - Listbox for choosing from a fixed list of known options. Use only when options are predefined. For free-text user input use Input instead.
69
70
  - RadioGroup: { label: string, options: Array<{ value: string, label: string }>, value?: string, disabled?: boolean } - Group of radio buttons for single selection. Use $bindState on value to capture selection.
70
71
  - Switch: { label: string, checked?: boolean, disabled?: boolean } - Toggle switch for binary on/off settings. Prefer over Checkbox for enabling/disabling features. Use $bindState on checked to track state.
@@ -78,6 +79,7 @@ AVAILABLE ACTIONS:
78
79
  - validateForm: Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }. [built-in]
79
80
  - atlas.submitUserAction: Submit form data. actionId overrides default "form_submit" identifier.
80
81
  - atlas.navigate: Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app.
82
+ - atlas.toolCall: Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.
81
83
 
82
84
  EVENTS (the `on` field):
83
85
  Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props.
@@ -28,6 +28,7 @@
28
28
  "Button",
29
29
  "Checkbox",
30
30
  "Input",
31
+ "Textarea",
31
32
  "Listbox",
32
33
  "RadioGroup",
33
34
  "Switch",
@@ -13,8 +13,16 @@ export declare const actionsCatalog: {
13
13
  }, z.core.$strip>;
14
14
  description: string;
15
15
  };
16
+ "atlas.toolCall": {
17
+ params: z.ZodObject<{
18
+ tool: z.ZodString;
19
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
20
+ }, z.core.$strip>;
21
+ description: string;
22
+ };
16
23
  };
17
24
  export declare const actionsHandlers: {
18
25
  "atlas.submitUserAction": (_params: unknown) => Promise<void>;
19
26
  "atlas.navigate": (_params: unknown) => Promise<void>;
27
+ "atlas.toolCall": (_params: unknown) => Promise<void>;
20
28
  };
@@ -0,0 +1 @@
1
+ export declare const badgeAnchor: string;
@@ -340,6 +340,19 @@ export declare const catalog: import('@json-render/core').Catalog<{
340
340
  slots: never[];
341
341
  description: string;
342
342
  };
343
+ Textarea: {
344
+ props: import('zod').ZodObject<{
345
+ label: import('zod').ZodString;
346
+ placeholder: import('zod').ZodOptional<import('zod').ZodString>;
347
+ description: import('zod').ZodOptional<import('zod').ZodString>;
348
+ moreInfo: import('zod').ZodOptional<import('zod').ZodString>;
349
+ value: import('zod').ZodOptional<import('zod').ZodString>;
350
+ rows: import('zod').ZodOptional<import('zod').ZodNumber>;
351
+ disabled: import('zod').ZodOptional<import('zod').ZodBoolean>;
352
+ }, import('zod/v4/core').$strip>;
353
+ slots: never[];
354
+ description: string;
355
+ };
343
356
  Listbox: {
344
357
  props: import('zod').ZodObject<{
345
358
  label: import('zod').ZodString;
@@ -390,5 +403,12 @@ export declare const catalog: import('@json-render/core').Catalog<{
390
403
  }, import('zod/v4/core').$strip>;
391
404
  description: string;
392
405
  };
406
+ "atlas.toolCall": {
407
+ params: import('zod').ZodObject<{
408
+ tool: import('zod').ZodString;
409
+ args: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>;
410
+ }, import('zod/v4/core').$strip>;
411
+ description: string;
412
+ };
393
413
  };
394
414
  }>;
@@ -0,0 +1 @@
1
+ export declare const chartContainer: string;
@@ -0,0 +1,4 @@
1
+ export declare const borderedGrid: string;
2
+ export declare const borderedGridCell: string;
3
+ /** Row separator — omit on the last row so it does not stack on the container bottom edge. */
4
+ export declare const borderedGridRowDivider: string;
@@ -0,0 +1,9 @@
1
+ export declare const listboxWrapper: import('@vanilla-extract/recipes').RuntimeFn<{
2
+ disabled: {
3
+ true: {
4
+ pointerEvents: "none";
5
+ opacity: `var(--${string})`;
6
+ };
7
+ false: {};
8
+ };
9
+ }>;
@@ -315,6 +315,19 @@ export declare const baseComponents: {
315
315
  slots: never[];
316
316
  description: string;
317
317
  };
318
+ Textarea: {
319
+ props: import('zod').ZodObject<{
320
+ label: import('zod').ZodString;
321
+ placeholder: import('zod').ZodOptional<import('zod').ZodString>;
322
+ description: import('zod').ZodOptional<import('zod').ZodString>;
323
+ moreInfo: import('zod').ZodOptional<import('zod').ZodString>;
324
+ value: import('zod').ZodOptional<import('zod').ZodString>;
325
+ rows: import('zod').ZodOptional<import('zod').ZodNumber>;
326
+ disabled: import('zod').ZodOptional<import('zod').ZodBoolean>;
327
+ }, import('zod/v4/core').$strip>;
328
+ slots: never[];
329
+ description: string;
330
+ };
318
331
  Listbox: {
319
332
  props: import('zod').ZodObject<{
320
333
  label: import('zod').ZodString;
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export declare const textareaCatalog: {
3
+ props: z.ZodObject<{
4
+ label: z.ZodString;
5
+ placeholder: z.ZodOptional<z.ZodString>;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ moreInfo: z.ZodOptional<z.ZodString>;
8
+ value: z.ZodOptional<z.ZodString>;
9
+ rows: z.ZodOptional<z.ZodNumber>;
10
+ disabled: z.ZodOptional<z.ZodBoolean>;
11
+ }, z.core.$strip>;
12
+ slots: never[];
13
+ description: string;
14
+ };
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { textareaCatalog } from './textarea.catalog';
3
+ export { textareaCatalog };
4
+ export declare const TextareaRenderer: ({ props, bindings, emit, }: {
5
+ props: z.infer<typeof textareaCatalog.props>;
6
+ bindings?: Record<string, string>;
7
+ emit: (event: string) => void;
8
+ }) => import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type { Catalog, Spec } from '@json-render/core';
2
2
  export { catalog, executeAction, getRegistry, handlers, registry } from './registry';
3
- export { SpecRenderer, type SpecRendererProps } from './renderers/spec-renderer';
3
+ export { type SpecActionHandler, type SpecActionHelpers, type SpecActionsFactory, SpecRenderer, type SpecRendererProps, } from './renderers/spec-renderer';
4
4
  export type { ActionCatalogDef, ComponentCatalogDef, MergedCatalog, TeamCatalogDef, } from './team-catalog';
5
5
  export { createTeamCatalog, mergeCatalogs } from './team-catalog';
6
6
  export type { RendererContext } from './types';