@optiaxiom/proteus 1.0.0 → 1.1.1

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