@optiaxiom/proteus 0.3.0 → 1.1.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 (64) hide show
  1. package/dist/esm/_virtual/_openai-shim-script.js +3 -2
  2. package/dist/esm/assets/src/proteus-chart/{ProteusChart.css.ts.vanilla-DNE5j3uT.css → ProteusChart.css.ts.vanilla-yGx8JdKz.css} +2 -2
  3. package/dist/esm/assets/src/proteus-chart/{ProteusChartTooltipContent.css.ts.vanilla-DM8u1icS.css → ProteusChartTooltipContent.css.ts.vanilla-HapBe2oo.css} +2 -2
  4. package/dist/esm/assets/src/proteus-document/{ProteusDocumentShell.css.ts.vanilla-DjZJuQ2A.css → ProteusDocumentShell.css.ts.vanilla-BPytQ9pT.css} +2 -2
  5. package/dist/esm/assets/src/proteus-image-carousel/{ProteusImageCarousel.css.ts.vanilla-CIwMJ4Cg.css → ProteusImageCarousel.css.ts.vanilla-DnlXoyv1.css} +2 -2
  6. package/dist/esm/assets/src/proteus-question/{ProteusQuestion.css.ts.vanilla-DiCe_bxf.css → ProteusQuestion.css.ts.vanilla-CpDgoW0l.css} +2 -2
  7. package/dist/esm/hooks/useEffectEvent.js +11 -10
  8. package/dist/esm/hooks/useObserveValue.js +24 -30
  9. package/dist/esm/icons/IconAngleLeft.js +13 -19
  10. package/dist/esm/icons/IconAngleRight.js +13 -19
  11. package/dist/esm/icons/IconX.js +10 -18
  12. package/dist/esm/icons/withIcon.js +17 -28
  13. package/dist/esm/index.js +22 -17
  14. package/dist/esm/proteus-action/ProteusAction.js +44 -39
  15. package/dist/esm/proteus-bridge/ProteusBridge.js +71 -85
  16. package/dist/esm/proteus-card-link/ProteusCardLink.js +24 -37
  17. package/dist/esm/proteus-chart/ProteusChart-css.js +14 -5
  18. package/dist/esm/proteus-chart/ProteusChart.js +86 -84
  19. package/dist/esm/proteus-chart/ProteusChartContext.js +3 -3
  20. package/dist/esm/proteus-chart/ProteusChartTooltipContent-css.js +23 -6
  21. package/dist/esm/proteus-chart/ProteusChartTooltipContent.js +52 -66
  22. package/dist/esm/proteus-data-table/ProteusDataTable.js +28 -29
  23. package/dist/esm/proteus-date-input/ProteusDateInput.js +23 -0
  24. package/dist/esm/proteus-document/ProteusDocumentContext.js +4 -3
  25. package/dist/esm/proteus-document/ProteusDocumentPathContext.js +6 -5
  26. package/dist/esm/proteus-document/ProteusDocumentRenderer.js +25 -33
  27. package/dist/esm/proteus-document/ProteusDocumentShell-css.js +32 -6
  28. package/dist/esm/proteus-document/ProteusDocumentShell.js +226 -219
  29. package/dist/esm/proteus-document/getProteusValue.js +28 -42
  30. package/dist/esm/proteus-document/resolveProteusProp.js +31 -49
  31. package/dist/esm/proteus-document/resolveProteusValue.js +73 -136
  32. package/dist/esm/proteus-document/schemas.js +42 -45
  33. package/dist/esm/proteus-document/useResolveProteusValues.js +10 -16
  34. package/dist/esm/proteus-element/ProteusElement.js +114 -180
  35. package/dist/esm/proteus-federated/ProteusFederated.js +51 -52
  36. package/dist/esm/proteus-file-icon/ProteusFileIcon.js +29 -38
  37. package/dist/esm/proteus-file-upload/ProteusFileUpload.js +107 -133
  38. package/dist/esm/proteus-image/ProteusImage.js +99 -106
  39. package/dist/esm/proteus-image/downloadFile.js +3 -2
  40. package/dist/esm/proteus-image-carousel/ProteusImageCarousel-css.js +49 -11
  41. package/dist/esm/proteus-image-carousel/ProteusImageCarousel.js +151 -163
  42. package/dist/esm/proteus-input/ProteusInput.js +19 -27
  43. package/dist/esm/proteus-length/ProteusLength.js +10 -0
  44. package/dist/esm/proteus-map/ProteusMap.js +18 -31
  45. package/dist/esm/proteus-map-index/ProteusMapIndex.js +11 -0
  46. package/dist/esm/proteus-pill-menu/ProteusPillMenu.js +65 -0
  47. package/dist/esm/proteus-pill-menu/useInputValueChangeInteraction.js +36 -0
  48. package/dist/esm/proteus-question/ProteusQuestion-css.js +40 -8
  49. package/dist/esm/proteus-question/ProteusQuestion.js +324 -400
  50. package/dist/esm/proteus-select/ProteusSelect.js +25 -40
  51. package/dist/esm/proteus-show/ProteusShow.js +10 -18
  52. package/dist/esm/proteus-switch/ProteusSwitch.js +33 -36
  53. package/dist/esm/proteus-textarea/ProteusTextarea.js +18 -27
  54. package/dist/esm/proteus-value/ProteusValue.js +4 -4
  55. package/dist/esm/schema/public-schema.js +4537 -0
  56. package/dist/esm/schema/runtime-schema.js +4460 -0
  57. package/dist/esm/spec.js +5 -1
  58. package/dist/esm/use-proteus-value/useProteusValue.js +8 -12
  59. package/dist/index.d.ts +516 -347
  60. package/dist/spec.d.ts +5 -9952
  61. package/package.json +5 -5
  62. package/dist/esm/icons/IconCalendar.js +0 -20
  63. package/dist/esm/schema/public-schema.json.js +0 -9041
  64. package/dist/esm/schema/runtime-schema.json.js +0 -8974
package/dist/index.d.ts CHANGED
@@ -1,448 +1,617 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BoxProps, SelectProps, Disclosure, ButtonProps, InputProps, TextareaProps } from '@optiaxiom/react';
3
- import { ReactNode, ComponentPropsWithoutRef } from 'react';
1
+ import { BoxProps, ButtonProps, DateInputProps, Disclosure, InputProps, SelectProps, TextareaProps } from "@optiaxiom/react";
2
+ import { ComponentPropsWithoutRef, ComponentType, ReactNode } from "react";
4
3
 
4
+ //#region src/proteus-bridge/ProteusBridge.d.ts
5
5
  type ProteusBridgeProps = {
6
- /**
7
- * Content rendered on platforms without iframe support
8
- */
9
- fallback?: ReactNode;
10
- /**
11
- * Height of the iframe in pixels
12
- */
13
- height?: number;
14
- /**
15
- * Resource URI identifying the MCP app to render
16
- */
17
- resource: string;
6
+ /**
7
+ * Content rendered on platforms without iframe support
8
+ */
9
+ fallback?: ReactNode;
10
+ /**
11
+ * Height of the iframe in pixels
12
+ */
13
+ height?: number;
14
+ /**
15
+ * Resource URI identifying the MCP app to render
16
+ */
17
+ resource: string;
18
18
  };
19
- declare function ProteusBridge({ height, resource }: ProteusBridgeProps): react_jsx_runtime.JSX.Element | null;
19
+ declare function ProteusBridge({
20
+ height,
21
+ resource
22
+ }: ProteusBridgeProps): import("react/jsx-runtime").JSX.Element | null;
20
23
  declare namespace ProteusBridge {
21
- var displayName: string;
24
+ var displayName: string;
22
25
  }
23
-
26
+ //#endregion
27
+ //#region src/proteus-chart/ProteusChart.d.ts
24
28
  type Series = {
25
- dataKey: string;
26
- name?: string;
29
+ dataKey: string;
30
+ name?: string;
27
31
  };
28
32
  type ProteusChartProps = {
29
- /**
30
- * Chart data records, either inline, a ProteusValue reference, or a
31
- * ProteusZip transformation
32
- */
33
- data: Record<string, unknown>[];
34
- /**
35
- * Chart layout direction
36
- */
37
- layout?: "horizontal" | "vertical";
38
- /**
39
- * Data series configuration
40
- */
41
- series?: Series[];
42
- /**
43
- * Chart type
44
- */
45
- type: "bar" | "line";
46
- /**
47
- * Key in data records for x-axis labels
48
- */
49
- xAxisKey?: string;
33
+ /**
34
+ * Chart data records, either inline, a ProteusValue reference, or a
35
+ * ProteusZip transformation
36
+ */
37
+ data: Record<string, unknown>[];
38
+ /**
39
+ * Chart layout direction
40
+ */
41
+ layout?: "horizontal" | "vertical";
42
+ /**
43
+ * Data series configuration
44
+ */
45
+ series?: Series[];
46
+ /**
47
+ * Chart type
48
+ */
49
+ type: "bar" | "line";
50
+ /**
51
+ * Key in data records for x-axis labels
52
+ */
53
+ xAxisKey?: string;
50
54
  };
51
- declare const ProteusChart: {
52
- ({ data, layout, series, type, xAxisKey, }: ProteusChartProps): react_jsx_runtime.JSX.Element;
53
- displayName: string;
54
- };
55
-
55
+ declare function ProteusChart({
56
+ data,
57
+ layout,
58
+ series,
59
+ type,
60
+ xAxisKey
61
+ }: ProteusChartProps): import("react/jsx-runtime").JSX.Element;
62
+ declare namespace ProteusChart {
63
+ var displayName: string;
64
+ }
65
+ //#endregion
66
+ //#region src/proteus-data-table/ProteusDataTable.d.ts
56
67
  type ProteusDataTableProps = {
57
- /**
58
- * Column definitions
59
- */
60
- columns?: ColumnDef[];
61
- /**
62
- * Column data
63
- */
64
- data?: Record<string, unknown>[];
68
+ /**
69
+ * Column definitions
70
+ */
71
+ columns?: ColumnDef[];
72
+ /**
73
+ * Column data
74
+ */
75
+ data?: Record<string, unknown>[];
65
76
  };
66
77
  type ColumnDef = {
67
- accessorKey: string;
68
- format?: string | {
69
- options?: Record<string, unknown>;
70
- type: string;
71
- };
72
- header: string;
73
- size?: number;
74
- };
75
- declare const ProteusDataTable: {
76
- ({ columns, data }: ProteusDataTableProps): react_jsx_runtime.JSX.Element;
77
- displayName: string;
78
+ accessorKey: string;
79
+ format?: string | {
80
+ options?: Record<string, unknown>;
81
+ type: string;
82
+ };
83
+ header: string;
84
+ size?: number;
78
85
  };
79
-
86
+ declare function ProteusDataTable({
87
+ columns,
88
+ data
89
+ }: ProteusDataTableProps): import("react/jsx-runtime").JSX.Element;
90
+ declare namespace ProteusDataTable {
91
+ var displayName: string;
92
+ }
93
+ //#endregion
94
+ //#region src/proteus-federated/ProteusFederated.d.ts
80
95
  type ProteusFederatedProps = {
81
- /**
82
- * URL to the remote's remoteEntry.js or mf-manifest.json
83
- */
84
- entry: string;
85
- /**
86
- * The key from the remote's ModuleFederationPlugin exposes config (e.g. './App'). Defaults to '.' (root export)
87
- */
88
- exposeKey?: string;
89
- /**
90
- * Content rendered when the federated component fails to load
91
- */
92
- fallback?: ReactNode;
96
+ /**
97
+ * URL to the remote's remoteEntry.js or mf-manifest.json
98
+ */
99
+ entry: string;
100
+ /**
101
+ * The key from the remote's ModuleFederationPlugin exposes config (e.g. './App'). Defaults to '.' (root export)
102
+ */
103
+ exposeKey?: string;
104
+ /**
105
+ * Content rendered when the federated component fails to load
106
+ */
107
+ fallback?: ReactNode;
93
108
  };
94
- declare function ProteusFederated({ entry, exposeKey, fallback, }: ProteusFederatedProps): react_jsx_runtime.JSX.Element | null;
109
+ declare function ProteusFederated({
110
+ entry,
111
+ exposeKey,
112
+ fallback
113
+ }: ProteusFederatedProps): import("react/jsx-runtime").JSX.Element | null;
95
114
  declare namespace ProteusFederated {
96
- var displayName: string;
115
+ var displayName: string;
97
116
  }
98
-
117
+ //#endregion
118
+ //#region src/proteus-file-upload/ProteusFileUpload.d.ts
99
119
  type ProteusFileUploadProps = {
100
- /**
101
- * File types to accept; array of MIME types or extensions.
102
- *
103
- * @example ["image/*", ".pdf"]
104
- */
105
- accept?: string[];
106
- /**
107
- * Maximum number of files allowed. When set to `1` the field is in
108
- * single-file mode; any other value (or omitted) allows multiple uploads.
109
- */
110
- maxFiles?: number;
111
- /**
112
- * Minimum number of files required.
113
- */
114
- minFiles?: number;
115
- /**
116
- * The name of the form control element. The resolved metadata array is
117
- * written at `parentPath/name` in form data once the host's `onUpload`
118
- * resolves.
119
- */
120
- name?: string;
120
+ /**
121
+ * File types to accept; array of MIME types or extensions.
122
+ *
123
+ * @example ["image/*", ".pdf"]
124
+ */
125
+ accept?: string[];
126
+ /**
127
+ * Maximum number of files allowed. When set to `1` the field is in
128
+ * single-file mode; any other value (or omitted) allows multiple uploads.
129
+ */
130
+ maxFiles?: number;
131
+ /**
132
+ * Minimum number of files required.
133
+ */
134
+ minFiles?: number;
135
+ /**
136
+ * The name of the form control element. The resolved metadata array is
137
+ * written at `parentPath/name` in form data once the host's `onUpload`
138
+ * resolves.
139
+ */
140
+ name?: string;
121
141
  };
122
- declare function ProteusFileUpload({ accept, maxFiles, minFiles, name, }: ProteusFileUploadProps): react_jsx_runtime.JSX.Element;
142
+ declare function ProteusFileUpload({
143
+ accept,
144
+ maxFiles,
145
+ minFiles,
146
+ name
147
+ }: ProteusFileUploadProps): import("react/jsx-runtime").JSX.Element;
123
148
  declare namespace ProteusFileUpload {
124
- var displayName: string;
149
+ var displayName: string;
125
150
  }
126
-
151
+ //#endregion
152
+ //#region src/proteus-image-carousel/ProteusImageCarousel.d.ts
127
153
  type ProteusImageCarouselProps = {
154
+ /**
155
+ * Array of image data to display in the carousel.
156
+ */
157
+ images: Array<{
158
+ /**
159
+ * Alternative text for the image.
160
+ */
161
+ alt?: string;
128
162
  /**
129
- * Array of image data to display in the carousel.
163
+ * The URL to the full image.
130
164
  */
131
- images: Array<{
132
- /**
133
- * Alternative text for the image.
134
- */
135
- alt?: string;
136
- /**
137
- * The URL to the full image.
138
- */
139
- src: string;
140
- /**
141
- * The URL to the image thumbnail.
142
- */
143
- thumb?: string;
144
- }>;
165
+ src: string;
145
166
  /**
146
- * Accessible label for the carousel region.
167
+ * The URL to the image thumbnail.
147
168
  */
148
- title?: string;
169
+ thumb?: string;
170
+ }>;
171
+ /**
172
+ * Accessible label for the carousel region.
173
+ */
174
+ title?: string;
149
175
  };
150
- declare function ProteusImageCarousel({ images, title, }: ProteusImageCarouselProps): react_jsx_runtime.JSX.Element | null;
176
+ declare function ProteusImageCarousel({
177
+ images,
178
+ title
179
+ }: ProteusImageCarouselProps): import("react/jsx-runtime").JSX.Element | null;
151
180
  declare namespace ProteusImageCarousel {
152
- var displayName: string;
181
+ var displayName: string;
153
182
  }
154
-
183
+ //#endregion
184
+ //#region src/proteus-image/ProteusImage.d.ts
155
185
  type ProteusImageProps = BoxProps<"img">;
156
- declare function ProteusImage(props: ProteusImageProps): react_jsx_runtime.JSX.Element;
186
+ declare function ProteusImage(props: ProteusImageProps): import("react/jsx-runtime").JSX.Element;
157
187
  declare namespace ProteusImage {
158
- var displayName: string;
188
+ var displayName: string;
159
189
  }
160
-
190
+ //#endregion
191
+ //#region src/proteus-length/ProteusLength.d.ts
192
+ type ProteusLengthProps = {
193
+ /**
194
+ * JSON pointer path to the array whose length should be returned (e.g.
195
+ * '/urls'). Resolves to 0 when the value is missing or not an array.
196
+ */
197
+ path: string;
198
+ };
199
+ declare function ProteusLength({
200
+ path
201
+ }: ProteusLengthProps): number;
202
+ declare namespace ProteusLength {
203
+ var displayName: string;
204
+ }
205
+ //#endregion
206
+ //#region src/proteus-map-index/ProteusMapIndex.d.ts
207
+ declare function ProteusMapIndex(): number | null;
208
+ declare namespace ProteusMapIndex {
209
+ var displayName: string;
210
+ }
211
+ //#endregion
212
+ //#region src/proteus-map/ProteusMap.d.ts
161
213
  type ProteusMapProps = {
162
- children?: ReactNode;
163
- /**
164
- * When true, flattens the result array by one level. Only used during
165
- * value resolution (e.g., onClick message); ignored during rendering.
166
- */
167
- flat?: boolean;
168
- /**
169
- * JSON pointer path to the source array in the data (e.g., '/results')
170
- */
171
- path: string;
172
- /**
173
- * Optional separator to render between items. Can be a string or a
174
- * ReactNode for more complex separators.
175
- */
176
- separator?: ReactNode;
214
+ children?: ReactNode;
215
+ /**
216
+ * When true, flattens the result array by one level. Only used during
217
+ * value resolution (e.g., onClick message); ignored during rendering.
218
+ */
219
+ flat?: boolean;
220
+ /**
221
+ * JSON pointer path to the source array in the data (e.g., '/results')
222
+ */
223
+ path: string;
224
+ /**
225
+ * Optional separator to render between items. Can be a string or a
226
+ * ReactNode for more complex separators.
227
+ */
228
+ separator?: ReactNode;
177
229
  };
178
- declare function ProteusMap({ children, path, separator }: ProteusMapProps): react_jsx_runtime.JSX.Element | null;
230
+ declare function ProteusMap({
231
+ children,
232
+ path,
233
+ separator
234
+ }: ProteusMapProps): import("react/jsx-runtime").JSX.Element | null;
179
235
  declare namespace ProteusMap {
180
- var displayName: string;
236
+ var displayName: string;
181
237
  }
182
-
238
+ //#endregion
239
+ //#region src/proteus-pill-menu/ProteusPillMenu.d.ts
240
+ type ProteusPillMenuProps = {
241
+ /**
242
+ * The data binding name for the search input value.
243
+ */
244
+ inputName?: string;
245
+ /**
246
+ * The data binding name for this pill menu's selected values.
247
+ */
248
+ name?: string;
249
+ /**
250
+ * Event handler triggered when the search input value changes.
251
+ */
252
+ onInputValueChange?: ProteusEventHandler;
253
+ /**
254
+ * The available options to select from.
255
+ */
256
+ options?: Array<{
257
+ /**
258
+ * Display label for the option
259
+ */
260
+ label: string;
261
+ /**
262
+ * Unique value for the option
263
+ */
264
+ value: string;
265
+ }>;
266
+ };
267
+ declare function ProteusPillMenu({
268
+ inputName,
269
+ name,
270
+ onInputValueChange,
271
+ options
272
+ }: ProteusPillMenuProps): import("react/jsx-runtime").JSX.Element;
273
+ declare namespace ProteusPillMenu {
274
+ var displayName: string;
275
+ }
276
+ //#endregion
277
+ //#region src/proteus-select/ProteusSelect.d.ts
183
278
  type ProteusSelectProps = Omit<SelectProps, "options"> & {
279
+ /**
280
+ * The select items/options we want to render.
281
+ */
282
+ options?: Array<{
184
283
  /**
185
- * The select items/options we want to render.
284
+ * String representation of items
186
285
  */
187
- options?: Array<{
188
- /**
189
- * String representation of items
190
- */
191
- label: string;
192
- /**
193
- * Return a unique key for each item
194
- */
195
- value: string;
196
- }>;
286
+ label: string;
287
+ /**
288
+ * Return a unique key for each item
289
+ */
290
+ value: string;
291
+ }>;
197
292
  };
198
- declare function ProteusSelect({ children, options, ...props }: ProteusSelectProps): react_jsx_runtime.JSX.Element;
293
+ declare function ProteusSelect({
294
+ children,
295
+ options,
296
+ ...props
297
+ }: ProteusSelectProps): import("react/jsx-runtime").JSX.Element;
199
298
  declare namespace ProteusSelect {
200
- var displayName: string;
299
+ var displayName: string;
201
300
  }
202
-
301
+ //#endregion
302
+ //#region src/proteus-document/resolveProteusValue.d.ts
203
303
  type ProteusCondition = {
204
- "!!": ComparisonValue;
304
+ "!!": ComparisonValue;
205
305
  } | {
206
- "!": ComparisonValue;
306
+ "!": ComparisonValue;
207
307
  } | {
208
- "!=": ComparisonValue[];
308
+ "!=": ComparisonValue[];
209
309
  } | {
210
- "<": ComparisonValue[];
310
+ "<": ComparisonValue[];
211
311
  } | {
212
- "<=": ComparisonValue[];
312
+ "<=": ComparisonValue[];
213
313
  } | {
214
- "==": ComparisonValue[];
314
+ "==": ComparisonValue[];
215
315
  } | {
216
- ">": ComparisonValue[];
316
+ ">": ComparisonValue[];
217
317
  } | {
218
- ">=": ComparisonValue[];
318
+ ">=": ComparisonValue[];
219
319
  } | {
220
- and: ProteusCondition[];
320
+ and: ProteusCondition[];
221
321
  } | {
222
- or: ProteusCondition[];
322
+ or: ProteusCondition[];
223
323
  };
224
324
  type ComparisonValue = boolean | null | number | string | {
225
- $type: "MapIndex";
325
+ $type: "Length";
326
+ path: string;
226
327
  } | {
227
- $type: "Value";
228
- path: string;
328
+ $type: "MapIndex";
329
+ } | {
330
+ $type: "Value";
331
+ path: string;
229
332
  };
230
-
333
+ //#endregion
334
+ //#region src/proteus-show/ProteusShow.d.ts
231
335
  type ProteusShowProps = {
232
- children?: ReactNode;
233
- /**
234
- * Single condition or array of conditions (AND logic). Each condition is an
235
- * object with one operator key.
236
- */
237
- when: ProteusCondition;
336
+ children?: ReactNode;
337
+ /**
338
+ * Single condition or array of conditions (AND logic). Each condition is an
339
+ * object with one operator key.
340
+ */
341
+ when: ProteusCondition;
238
342
  };
239
- declare function ProteusShow({ children, when }: ProteusShowProps): react_jsx_runtime.JSX.Element | null;
343
+ declare function ProteusShow({
344
+ children,
345
+ when
346
+ }: ProteusShowProps): import("react/jsx-runtime").JSX.Element | null;
240
347
  declare namespace ProteusShow {
241
- var displayName: string;
348
+ var displayName: string;
242
349
  }
243
-
350
+ //#endregion
351
+ //#region src/proteus-value/ProteusValue.d.ts
244
352
  type ProteusValueProps = {
245
- /**
246
- * Format to apply to cell values (e.g. 'Number', 'DateTime')
247
- */
248
- formatter?: "DateTime" | "Number" | {
249
- /**
250
- * Options passed to the Intl formatter constructor (e.g.,
251
- * Intl.DateTimeFormatOptions or Intl.NumberFormatOptions)
252
- */
253
- options?: Record<string, unknown>;
254
- /**
255
- * Formatter type
256
- */
257
- type: "DateTime" | "Number";
258
- };
259
- /**
260
- * Path to a value in the data. Absolute paths start with '/' and resolve from
261
- * the root (e.g., '/title', '/options/0/label'). Inside a Map template, paths
262
- * without a leading '/' are relative to the current item (e.g., 'title'
263
- * resolves to each item's 'title' field).
264
- */
265
- path: string;
353
+ /**
354
+ * Format to apply to cell values (e.g. 'Number', 'DateTime')
355
+ */
356
+ formatter?: "DateTime" | "Number" | {
357
+ /**
358
+ * Options passed to the Intl formatter constructor (e.g.,
359
+ * Intl.DateTimeFormatOptions or Intl.NumberFormatOptions)
360
+ */
361
+ options?: Record<string, unknown>;
362
+ /**
363
+ * Formatter type
364
+ */
365
+ type: "DateTime" | "Number";
366
+ };
367
+ /**
368
+ * Path to a value in the data. Absolute paths start with '/' and resolve from
369
+ * the root (e.g., '/title', '/options/0/label'). Inside a Map template, paths
370
+ * without a leading '/' are relative to the current item (e.g., 'title'
371
+ * resolves to each item's 'title' field).
372
+ */
373
+ path: string;
266
374
  };
267
-
375
+ //#endregion
376
+ //#region src/proteus-document/ProteusDocumentContext.d.ts
268
377
  type FileUploadMetadata = {
269
- link: string;
270
- name: string;
378
+ link: string;
379
+ name: string;
271
380
  };
381
+ type ProteusIconMap = Record<string, ComponentType<{
382
+ filled?: boolean;
383
+ }>>;
272
384
  type UploadFile<F extends FileUploadMetadata = FileUploadMetadata> = (file: File) => Promise<F>;
273
385
  type UseResource = (resource: string) => {
274
- data: undefined | {
275
- mimeType: string;
276
- text: string;
277
- };
278
- isError: boolean;
386
+ data: undefined | {
387
+ mimeType: string;
388
+ text: string;
389
+ };
390
+ isError: boolean;
279
391
  };
280
-
392
+ //#endregion
393
+ //#region src/proteus-document/ProteusDocumentShell.d.ts
281
394
  type ProteusDocumentShellProps = Pick<ComponentPropsWithoutRef<typeof Disclosure>, "defaultOpen" | "onOpenChange" | "open"> & {
282
- /**
283
- * Whether block is collapsible
284
- */
285
- collapsible?: boolean;
286
- /**
287
- * Current form data
288
- */
289
- data?: Record<string, unknown>;
290
- /**
291
- * The Proteus document to render
292
- */
293
- element: ProteusDocument$2;
294
- /**
295
- * Callback when form fields change
296
- */
297
- onDataChange?: (data: Record<string, unknown>) => void;
298
- /**
299
- * Callback when user triggers a download action; receives the resolved URL(s).
300
- * When provided, the host is responsible for the actual download/zip.
301
- * Falls back to built-in window.open behaviour when absent.
302
- */
303
- onDownload?: (urls: string[]) => Promise<void> | void;
304
- /**
305
- * Callback when user clicks a Action button with interaction handler
306
- */
307
- onInteraction?: (name: string, params?: Record<string, unknown>) => Promise<unknown> | unknown;
308
- /**
309
- * Callback when user sends a message action. The payload may be a plain
310
- * string or a structured object (parts + optional files), depending on
311
- * what the document declares for `Action.onClick.message`.
312
- */
313
- onMessage?: (message: string | StructuredMessage) => Promise<void> | void;
314
- /**
315
- * Callback when user triggers a preview action.
316
- * Receives the file object to preview.
317
- */
318
- onPreview?: (file: unknown) => Promise<void> | void;
319
- /**
320
- * Callback when an analytics event is fired
321
- */
322
- onTrack?: (event: string, properties: Record<string, string>) => void;
323
- /**
324
- * Async upload callback used by FileUpload elements. Receives a File and
325
- * resolves to a metadata object the document writes into form data.
326
- */
327
- onUpload?: UploadFile;
328
- /**
329
- * Whether form is readonly
330
- */
331
- readOnly?: boolean;
332
- /**
333
- * If true, the renderer will throw an error if the provided document is invalid. Otherwise, it will fail silently and render nothing.
334
- */
335
- strict?: boolean;
336
- /**
337
- * Hook to resolve a resource URI to HTML content for Bridge elements
338
- */
339
- useResource?: UseResource;
395
+ /**
396
+ * Whether block is collapsible
397
+ */
398
+ collapsible?: boolean;
399
+ /**
400
+ * Current form data
401
+ */
402
+ data?: Record<string, unknown>;
403
+ /**
404
+ * The Proteus document to render
405
+ */
406
+ element: ProteusDocument$2;
407
+ /**
408
+ * Map of icon name to React component. Referenced by `{ $type: "Icon", name }` elements.
409
+ */
410
+ icons?: ProteusIconMap;
411
+ /**
412
+ * Callback when form fields change. Receives a functional updater
413
+ * `(prev) => next` (the same shape React's `setState` accepts) so that
414
+ * rapid successive mutations compose without losing writes. Pass a
415
+ * `useState` setter directly, e.g. `onDataChange={setData}`.
416
+ */
417
+ onDataChange?: (updater: (prev: Record<string, unknown>) => Record<string, unknown>) => void;
418
+ /**
419
+ * Callback when user triggers a download action; receives the resolved URL(s).
420
+ * When provided, the host is responsible for the actual download/zip.
421
+ * Falls back to built-in window.open behaviour when absent.
422
+ */
423
+ onDownload?: (urls: string[]) => Promise<void> | void;
424
+ /**
425
+ * Callback when user clicks a Action button with interaction handler
426
+ */
427
+ onInteraction?: (name: string, params?: Record<string, unknown>) => Promise<unknown> | unknown;
428
+ /**
429
+ * Callback when user sends a message action. The payload may be a plain
430
+ * string or a structured object (parts + optional files), depending on
431
+ * what the document declares for `Action.onClick.message`.
432
+ */
433
+ onMessage?: (message: string | StructuredMessage) => Promise<void> | void;
434
+ /**
435
+ * Callback when user triggers a preview action.
436
+ * Receives the file object to preview.
437
+ */
438
+ onPreview?: (file: unknown) => Promise<void> | void;
439
+ /**
440
+ * Callback when an analytics event is fired
441
+ */
442
+ onTrack?: (event: string, properties: Record<string, string>) => void;
443
+ /**
444
+ * Async upload callback used by FileUpload elements. Receives a File and
445
+ * resolves to a metadata object the document writes into form data.
446
+ */
447
+ onUpload?: UploadFile;
448
+ /**
449
+ * Whether form is readonly
450
+ */
451
+ readOnly?: boolean;
452
+ /**
453
+ * If true, the renderer will throw an error if the provided document is invalid. Otherwise, it will fail silently and render nothing.
454
+ */
455
+ strict?: boolean;
456
+ /**
457
+ * Hook to resolve a resource URI to HTML content for Bridge elements
458
+ */
459
+ useResource?: UseResource;
340
460
  };
341
461
  type ProteusDocument$2 = {
342
- actions?: ReactNode;
343
- appearance?: "default" | "inline" | Record<string, unknown>;
344
- appIcon?: string;
345
- appName?: string;
346
- blocking?: boolean;
347
- body: ReactNode;
348
- compact?: boolean;
349
- subtitle?: ReactNode;
350
- title?: ReactNode;
351
- titleIcon?: string;
462
+ actions?: ReactNode;
463
+ appearance?: "default" | "inline" | Record<string, unknown>;
464
+ appIcon?: string;
465
+ appName?: string;
466
+ blocking?: boolean;
467
+ body: ReactNode;
468
+ compact?: boolean;
469
+ subtitle?: ReactNode;
470
+ title?: ReactNode;
471
+ titleIcon?: string;
352
472
  };
353
- declare function ProteusDocumentShell({ collapsible: collapsibleProp, data, defaultOpen, element, onDataChange, onDownload, onInteraction, onMessage, onOpenChange, onPreview, onTrack, onUpload, open: openProp, readOnly, strict, useResource, }: ProteusDocumentShellProps): react_jsx_runtime.JSX.Element;
473
+ declare function ProteusDocumentShell({
474
+ collapsible: collapsibleProp,
475
+ data,
476
+ defaultOpen,
477
+ element,
478
+ icons,
479
+ onDataChange,
480
+ onDownload,
481
+ onInteraction,
482
+ onMessage,
483
+ onOpenChange,
484
+ onPreview,
485
+ onTrack,
486
+ onUpload,
487
+ open: openProp,
488
+ readOnly,
489
+ strict,
490
+ useResource
491
+ }: ProteusDocumentShellProps): import("react/jsx-runtime").JSX.Element;
354
492
  declare namespace ProteusDocumentShell {
355
- var displayName: string;
493
+ var displayName: string;
356
494
  }
357
-
495
+ //#endregion
496
+ //#region src/proteus-document/schemas.d.ts
358
497
  type ProteusEventHandler = {
359
- action: "download";
360
- url: (ProteusValueProps & {
361
- $type: "Value";
362
- }) | string | string[];
498
+ action: "download";
499
+ url: (ProteusValueProps & {
500
+ $type: "Value";
501
+ }) | string | string[];
502
+ } | {
503
+ action: "openLink";
504
+ url: (ProteusValueProps & {
505
+ $type: "Value";
506
+ }) | string;
363
507
  } | {
364
- action: "openLink";
365
- url: (ProteusValueProps & {
366
- $type: "Value";
367
- }) | string;
508
+ action: "preview";
509
+ file: unknown;
368
510
  } | {
369
- action: "preview";
370
- file: unknown;
511
+ action: "pushValue";
512
+ path: string;
513
+ value?: unknown;
371
514
  } | {
372
- interaction: string;
373
- params?: Record<string, unknown>;
515
+ action: "removeValue";
516
+ path: string;
374
517
  } | {
375
- message: string | StructuredMessage;
518
+ interaction: string;
519
+ params?: Record<string, unknown>;
520
+ } | {
521
+ message: string | StructuredMessage;
376
522
  };
377
523
  type StructuredMessage<F extends FileUploadMetadata = FileUploadMetadata> = {
378
- files?: F[];
379
- parts: Array<{
380
- content: string;
381
- type: "text";
382
- }>;
524
+ files?: F[];
525
+ parts: Array<{
526
+ content: string;
527
+ type: "text";
528
+ }>;
383
529
  };
384
530
  type ProteusDocument$1 = ProteusDocumentShellProps["element"] & {
385
- $type: "Document";
531
+ $type: "Document";
386
532
  };
387
533
  type SafeParseResult<T> = {
388
- data: T;
389
- success: true;
534
+ data: T;
535
+ success: true;
390
536
  } | {
391
- error: string[];
392
- success: false;
537
+ error: string[];
538
+ success: false;
393
539
  };
394
- declare function safeParseDocument({ actions, body, ...data }: Record<string, unknown>): SafeParseResult<ProteusDocument$1>;
395
-
540
+ declare function safeParseDocument({
541
+ actions,
542
+ body,
543
+ ...data
544
+ }: Record<string, unknown>): SafeParseResult<ProteusDocument$1>;
545
+ //#endregion
546
+ //#region src/proteus-action/ProteusAction.d.ts
396
547
  type ProteusActionProps = Omit<ButtonProps, "onClick"> & {
397
- /**
398
- * Action triggered when button is clicked
399
- */
400
- onClick?: ProteusEventHandler;
548
+ /**
549
+ * Action triggered when button is clicked
550
+ */
551
+ onClick?: ProteusEventHandler;
401
552
  };
402
- declare function ProteusAction({ children, onClick, type, ...props }: ProteusActionProps): react_jsx_runtime.JSX.Element;
553
+ declare function ProteusAction({
554
+ children,
555
+ onClick,
556
+ type,
557
+ ...props
558
+ }: ProteusActionProps): import("react/jsx-runtime").JSX.Element;
403
559
  declare namespace ProteusAction {
404
- var displayName: string;
560
+ var displayName: string;
405
561
  }
406
-
562
+ //#endregion
563
+ //#region src/proteus-date-input/ProteusDateInput.d.ts
564
+ declare function ProteusDateInput(props: DateInputProps): import("react/jsx-runtime").JSX.Element;
565
+ declare namespace ProteusDateInput {
566
+ var displayName: string;
567
+ }
568
+ //#endregion
569
+ //#region src/proteus-document/ProteusDocumentRenderer.d.ts
407
570
  type ProteusDocumentRendererProps = Omit<ComponentPropsWithoutRef<typeof ProteusDocumentShell>, "element"> & {
408
- /**
409
- * The Proteus document to render
410
- */
411
- element: ProteusDocument;
412
- /**
413
- * If true, the renderer will throw an error if the provided document is invalid. Otherwise, it will fail silently and render nothing.
414
- */
415
- strict?: boolean;
571
+ /**
572
+ * The Proteus document to render
573
+ */
574
+ element: ProteusDocument;
575
+ /**
576
+ * If true, the renderer will throw an error if the provided document is invalid. Otherwise, it will fail silently and render nothing.
577
+ */
578
+ strict?: boolean;
416
579
  };
417
580
  type ProteusDocument = {
418
- $type: "Document";
419
- actions?: unknown;
420
- appearance?: "default" | "inline" | Record<string, unknown>;
421
- appIcon?: string;
422
- appName?: string;
423
- blocking?: boolean;
424
- body: unknown;
425
- compact?: boolean;
426
- subtitle?: unknown;
427
- title?: unknown;
428
- titleIcon?: string;
581
+ $type: "Document";
582
+ actions?: unknown;
583
+ appearance?: "default" | "inline" | Record<string, unknown>;
584
+ appIcon?: string;
585
+ appName?: string;
586
+ blocking?: boolean;
587
+ body: unknown;
588
+ compact?: boolean;
589
+ subtitle?: unknown;
590
+ title?: unknown;
591
+ titleIcon?: string;
429
592
  };
430
- declare function ProteusDocumentRenderer({ element: elementProp, strict, ...props }: ProteusDocumentRendererProps): react_jsx_runtime.JSX.Element | null;
593
+ declare function ProteusDocumentRenderer({
594
+ element: elementProp,
595
+ strict,
596
+ ...props
597
+ }: ProteusDocumentRendererProps): import("react/jsx-runtime").JSX.Element | null;
431
598
  declare namespace ProteusDocumentRenderer {
432
- var displayName: string;
599
+ var displayName: string;
433
600
  }
434
-
435
- declare function ProteusInput(props: InputProps): react_jsx_runtime.JSX.Element;
601
+ //#endregion
602
+ //#region src/proteus-input/ProteusInput.d.ts
603
+ declare function ProteusInput(props: InputProps): import("react/jsx-runtime").JSX.Element;
436
604
  declare namespace ProteusInput {
437
- var displayName: string;
605
+ var displayName: string;
438
606
  }
439
-
440
- declare function ProteusTextarea(props: TextareaProps): react_jsx_runtime.JSX.Element;
607
+ //#endregion
608
+ //#region src/proteus-textarea/ProteusTextarea.d.ts
609
+ declare function ProteusTextarea(props: TextareaProps): import("react/jsx-runtime").JSX.Element;
441
610
  declare namespace ProteusTextarea {
442
- var displayName: string;
611
+ var displayName: string;
443
612
  }
444
-
613
+ //#endregion
614
+ //#region src/use-proteus-value/useProteusValue.d.ts
445
615
  declare function useProteusValue(element: ProteusValueProps): any;
446
-
447
- export { ProteusAction, ProteusBridge, ProteusChart, ProteusDataTable, ProteusDocumentRenderer, ProteusDocumentShell, ProteusFederated, ProteusFileUpload, ProteusImage, ProteusImageCarousel, ProteusInput, ProteusMap, ProteusSelect, ProteusShow, ProteusTextarea, safeParseDocument, useProteusValue };
448
- export type { FileUploadMetadata, ProteusDocumentRendererProps, ProteusDocumentShellProps, ProteusFileUploadProps, StructuredMessage, UploadFile };
616
+ //#endregion
617
+ export { type FileUploadMetadata, ProteusAction, ProteusBridge, ProteusChart, ProteusDataTable, ProteusDateInput, ProteusDocumentRenderer, ProteusDocumentRendererProps, ProteusDocumentShell, ProteusDocumentShellProps, ProteusFederated, ProteusFileUpload, ProteusFileUploadProps, ProteusImage, ProteusImageCarousel, ProteusInput, ProteusLength, ProteusMap, ProteusMapIndex, ProteusPillMenu, ProteusPillMenuProps, ProteusSelect, ProteusShow, ProteusTextarea, type StructuredMessage, type UploadFile, safeParseDocument, useProteusValue };