@checkstack/ui 0.0.3 → 0.0.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @checkstack/ui
2
2
 
3
+ ## 0.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - f5b1f49: Extended DynamicForm type definitions with additional JSON Schema metadata properties.
8
+ - Updated dependencies [f5b1f49]
9
+ - @checkstack/common@0.0.3
10
+ - @checkstack/frontend-api@0.0.3
11
+
3
12
  ## 0.0.3
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/ui",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "dependencies": {
@@ -1,24 +1,22 @@
1
1
  import type { TemplateProperty } from "../TemplateEditor";
2
+ import type {
3
+ JsonSchemaPropertyCore,
4
+ JsonSchemaBase,
5
+ } from "@checkstack/common";
2
6
 
3
- export interface JsonSchemaProperty {
4
- type?: string;
5
- description?: string;
6
- enum?: string[];
7
- const?: string | number | boolean; // For discriminator values
8
- properties?: Record<string, JsonSchemaProperty>;
9
- items?: JsonSchemaProperty;
10
- required?: string[];
11
- additionalProperties?: boolean | JsonSchemaProperty;
12
- format?: string;
13
- default?: unknown;
14
- oneOf?: JsonSchemaProperty[]; // Discriminated union variants
15
- anyOf?: JsonSchemaProperty[]; // Union variants
16
- "x-secret"?: boolean; // Custom metadata for secret fields
17
- "x-color"?: boolean; // Custom metadata for color fields
18
- "x-options-resolver"?: string; // Name of a resolver function for dynamic options
19
- "x-depends-on"?: string[]; // Field names this field depends on (triggers refetch when they change)
7
+ /**
8
+ * JSON Schema property with DynamicForm-specific x-* extensions for config rendering.
9
+ * Uses the generic core type for proper recursive typing.
10
+ */
11
+ export interface JsonSchemaProperty
12
+ extends JsonSchemaPropertyCore<JsonSchemaProperty> {
13
+ // Config-specific x-* extensions
14
+ "x-secret"?: boolean; // Field contains sensitive data
15
+ "x-color"?: boolean; // Field is a color picker
16
+ "x-options-resolver"?: string; // Name of resolver function for dynamic options
17
+ "x-depends-on"?: string[]; // Field names this field depends on (triggers refetch)
20
18
  "x-hidden"?: boolean; // Field should be hidden in form (auto-populated)
21
- "x-searchable"?: boolean; // Shows a search input for filtering dropdown options
19
+ "x-searchable"?: boolean; // Shows search input for filtering dropdown options
22
20
  }
23
21
 
24
22
  /** Option returned by an options resolver */
@@ -32,10 +30,10 @@ export type OptionsResolver = (
32
30
  formValues: Record<string, unknown>
33
31
  ) => Promise<ResolverOption[]>;
34
32
 
35
- export interface JsonSchema {
36
- properties?: Record<string, JsonSchemaProperty>;
37
- required?: string[];
38
- }
33
+ /**
34
+ * JSON Schema for config forms with DynamicForm-specific extensions.
35
+ */
36
+ export type JsonSchema = JsonSchemaBase<JsonSchemaProperty>;
39
37
 
40
38
  export interface DynamicFormProps {
41
39
  schema: JsonSchema;