@optimizely-opal/opal-tools-sdk 0.1.8-dev → 0.1.10-dev

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/src/proteus.ts CHANGED
@@ -7,8 +7,11 @@
7
7
  export type OpalProteusDocumentSpecification =
8
8
  | ProteusAction
9
9
  | ProteusAtomicCondition
10
+ | ProteusBadge
10
11
  | ProteusCancelAction
12
+ | ProteusChart
11
13
  | ProteusCondition
14
+ | ProteusDataTable
12
15
  | ProteusDocument
13
16
  | ProteusElement
14
17
  | ProteusEventHandler
@@ -28,6 +31,7 @@ export type OpalProteusDocumentSpecification =
28
31
  | ProteusShow
29
32
  | ProteusText
30
33
  | ProteusTextarea
34
+ | ProteusTime
31
35
  | ProteusValue;
32
36
  export interface ProteusAction {
33
37
  $type: "Action";
@@ -45,7 +49,8 @@ export interface ProteusAction {
45
49
  | "inverse"
46
50
  | "primary"
47
51
  | "primary-opal"
48
- | "subtle";
52
+ | "subtle"
53
+ | ProteusValue;
49
54
  backgroundImage?: SprinklePropBackgroundImage;
50
55
  bg?: SprinklePropBg;
51
56
  border?: SprinklePropBorder;
@@ -95,6 +100,16 @@ export interface ProteusAction {
95
100
  * Name of registered tool to call
96
101
  */
97
102
  tool: string;
103
+ }
104
+ | {
105
+ /**
106
+ * The action type
107
+ */
108
+ action: "download";
109
+ /**
110
+ * URL to download
111
+ */
112
+ url: string;
98
113
  };
99
114
  overflow?: SprinklePropOverflow;
100
115
  overflowX?: SprinklePropOverflowX;
@@ -199,6 +214,78 @@ export type ProteusAtomicCondition =
199
214
  */
200
215
  "!!": boolean | null | number | ProteusValue | string;
201
216
  };
217
+ export interface ProteusBadge {
218
+ $type: "Badge";
219
+ alignItems?: SprinklePropAlignItems;
220
+ alignSelf?: SprinklePropAlignSelf;
221
+ animation?: SprinklePropAnimation;
222
+ backgroundImage?: SprinklePropBackgroundImage;
223
+ bg?: SprinklePropBg;
224
+ border?: SprinklePropBorder;
225
+ borderB?: SprinklePropBorderB;
226
+ borderColor?: SprinklePropBorderColor;
227
+ borderL?: SprinklePropBorderL;
228
+ borderR?: SprinklePropBorderR;
229
+ borderT?: SprinklePropBorderT;
230
+ children?: ProteusNode;
231
+ color?: SprinklePropColor;
232
+ cursor?: SprinklePropCursor;
233
+ display?: SprinklePropDisplay;
234
+ flex?: SprinklePropFlex;
235
+ flexDirection?: SprinklePropFlexDirection;
236
+ flexWrap?: SprinklePropFlexWrap;
237
+ fontFamily?: SprinklePropFontFamily;
238
+ fontSize?: SprinklePropFontSize;
239
+ fontWeight?: SprinklePropFontWeight;
240
+ gap?: SprinklePropGap;
241
+ gridColumn?: SprinklePropGridColumn;
242
+ gridTemplateColumns?: SprinklePropGridTemplateColumns;
243
+ h?: SprinklePropH;
244
+ /**
245
+ * Control the appearance by selecting between the different badge types.
246
+ */
247
+ intent?:
248
+ | "danger"
249
+ | "information"
250
+ | "neutral"
251
+ | "primary"
252
+ | "success"
253
+ | "warning"
254
+ | ProteusValue;
255
+ justifyContent?: SprinklePropJustifyContent;
256
+ justifyItems?: SprinklePropJustifyItems;
257
+ m?: SprinklePropM;
258
+ maxH?: SprinklePropMaxH;
259
+ maxW?: SprinklePropMaxW;
260
+ mb?: SprinklePropMb;
261
+ ml?: SprinklePropMl;
262
+ mr?: SprinklePropMr;
263
+ mt?: SprinklePropMt;
264
+ mx?: SprinklePropMx;
265
+ my?: SprinklePropMy;
266
+ objectFit?: SprinklePropObjectFit;
267
+ overflow?: SprinklePropOverflow;
268
+ overflowX?: SprinklePropOverflowX;
269
+ overflowY?: SprinklePropOverflowY;
270
+ p?: SprinklePropP;
271
+ pb?: SprinklePropPb;
272
+ pl?: SprinklePropPl;
273
+ placeItems?: SprinklePropPlaceItems;
274
+ pointerEvents?: SprinklePropPointerEvents;
275
+ pr?: SprinklePropPr;
276
+ pt?: SprinklePropPt;
277
+ px?: SprinklePropPx;
278
+ py?: SprinklePropPy;
279
+ rounded?: SprinklePropRounded;
280
+ shadow?: SprinklePropShadow;
281
+ size?: SprinklePropSize;
282
+ textAlign?: SprinklePropTextAlign;
283
+ textTransform?: SprinklePropTextTransform;
284
+ transition?: SprinklePropTransition;
285
+ w?: SprinklePropW;
286
+ whiteSpace?: SprinklePropWhiteSpace;
287
+ z?: SprinklePropZ;
288
+ }
202
289
  export interface ProteusCancelAction {
203
290
  $type: "CancelAction";
204
291
  alignItems?: SprinklePropAlignItems;
@@ -263,6 +350,46 @@ export interface ProteusCancelAction {
263
350
  whiteSpace?: SprinklePropWhiteSpace;
264
351
  z?: SprinklePropZ;
265
352
  }
353
+ export interface ProteusChart {
354
+ $type: "Chart";
355
+ /**
356
+ * Chart data records, either inline or a ProteusValue reference
357
+ */
358
+ data?:
359
+ | ProteusValue
360
+ | {
361
+ [k: string]: undefined | unknown;
362
+ }[];
363
+ /**
364
+ * Data series configuration
365
+ */
366
+ series?: {
367
+ /**
368
+ * Series color
369
+ */
370
+ color?: string;
371
+ /**
372
+ * Key in data records for this series
373
+ */
374
+ dataKey: string;
375
+ /**
376
+ * Key in data records for pre-formatted labels displayed above bars
377
+ */
378
+ labelKey?: string;
379
+ /**
380
+ * Display name for legend
381
+ */
382
+ name?: string;
383
+ }[];
384
+ /**
385
+ * Chart type
386
+ */
387
+ type?: "bar";
388
+ /**
389
+ * Key in data records for x-axis labels
390
+ */
391
+ xAxisKey?: string;
392
+ }
266
393
  /**
267
394
  * Condition for Show component. Can be a comparison operator, logical AND, or logical OR. Supports nesting.
268
395
  */
@@ -299,40 +426,91 @@ export type ProteusCondition =
299
426
  )[],
300
427
  ];
301
428
  };
429
+ export interface ProteusDataTable {
430
+ $type: "DataTable";
431
+ /**
432
+ * Column definitions
433
+ */
434
+ columns?: {
435
+ /**
436
+ * Key in data objects
437
+ */
438
+ accessorKey: string;
439
+ /**
440
+ * Column header text
441
+ */
442
+ header: string;
443
+ }[];
444
+ data?:
445
+ | ProteusValue
446
+ | {
447
+ [k: string]: undefined | unknown;
448
+ }[];
449
+ }
302
450
  export interface ProteusDocument {
303
451
  $type: "Document";
304
452
  /**
305
453
  * Actions available for this document
306
454
  */
307
- actions?: ProteusNode;
455
+ actions?:
456
+ | (boolean | null | number | ProteusElement | string)[]
457
+ | boolean
458
+ | null
459
+ | number
460
+ | ProteusElement
461
+ | string;
308
462
  /**
309
- * A visual representation of the application
463
+ * URL or data URI for the application icon (e.g., 'https://example.com/icon.png' or 'data:image/svg+xml,...'). Rendered as an <img> element.
310
464
  */
311
465
  appIcon?: string;
312
466
  /**
313
467
  * The official name of the application
314
468
  */
315
- appName: string;
469
+ appName?: string;
316
470
  /**
317
471
  * If true, hides chat prompt and forces user interaction with document. User can press ESC or close to abandon.
318
472
  */
319
473
  blocking?: boolean;
320
- body: ProteusNode;
321
474
  /**
322
- * A brief description or tagline that provides additional context about the Proteus document's purpose.
475
+ * A Proteus node can be a string, number, boolean, null, a single element, or an array of these types (similar to ReactNode)
323
476
  */
324
- subtitle?: string;
477
+ body:
478
+ | (boolean | null | number | ProteusElement | string)[]
479
+ | boolean
480
+ | null
481
+ | number
482
+ | ProteusElement
483
+ | string;
325
484
  /**
326
- * A concise heading that encapsulates the essence of the Proteus document's content or intended action.
485
+ * A Proteus node can be a string, number, boolean, null, a single element, or an array of these types (similar to ReactNode)
327
486
  */
328
- title: string;
487
+ subtitle?:
488
+ | (boolean | null | number | ProteusElement | string)[]
489
+ | boolean
490
+ | null
491
+ | number
492
+ | ProteusElement
493
+ | string;
494
+ /**
495
+ * A Proteus node can be a string, number, boolean, null, a single element, or an array of these types (similar to ReactNode)
496
+ */
497
+ title:
498
+ | (boolean | null | number | ProteusElement | string)[]
499
+ | boolean
500
+ | null
501
+ | number
502
+ | ProteusElement
503
+ | string;
329
504
  }
330
505
  /**
331
506
  * A single Proteus UI component element identified by its $type discriminator
332
507
  */
333
508
  export type ProteusElement =
334
509
  | ProteusAction
510
+ | ProteusBadge
335
511
  | ProteusCancelAction
512
+ | ProteusChart
513
+ | ProteusDataTable
336
514
  | ProteusField
337
515
  | ProteusGroup
338
516
  | ProteusHeading
@@ -348,9 +526,10 @@ export type ProteusElement =
348
526
  | ProteusShow
349
527
  | ProteusText
350
528
  | ProteusTextarea
529
+ | ProteusTime
351
530
  | ProteusValue;
352
531
  /**
353
- * Handler for user interactions - either a server-side tool call or client-side message
532
+ * Handler for user interactions - a server-side tool call, client-side message, or client-side component action
354
533
  */
355
534
  export type ProteusEventHandler =
356
535
  | {
@@ -364,6 +543,16 @@ export type ProteusEventHandler =
364
543
  * Name of registered tool to call
365
544
  */
366
545
  tool: string;
546
+ }
547
+ | {
548
+ /**
549
+ * The action type
550
+ */
551
+ action: "download";
552
+ /**
553
+ * URL to download
554
+ */
555
+ url: string;
367
556
  };
368
557
  export interface ProteusField {
369
558
  $type: "Field";
@@ -449,7 +638,7 @@ export interface ProteusField {
449
638
  /**
450
639
  * Display an asterisk for required inputs.
451
640
  */
452
- required?: boolean;
641
+ required?: boolean | ProteusValue;
453
642
  rounded?: SprinklePropRounded;
454
643
  shadow?: SprinklePropShadow;
455
644
  size?: SprinklePropSize;
@@ -466,7 +655,7 @@ export interface ProteusGroup {
466
655
  * Set the element's `align-items` CSS property. Defaults to `center` when
467
656
  * `flexDirection='row'`, and `stretch` when `flexDirection='column'`.
468
657
  */
469
- alignItems?: "center" | "end" | "normal" | "start" | "stretch";
658
+ alignItems?: "center" | "end" | "normal" | "start" | "stretch" | ProteusValue;
470
659
  alignSelf?: SprinklePropAlignSelf;
471
660
  animation?: SprinklePropAnimation;
472
661
  backgroundImage?: SprinklePropBackgroundImage;
@@ -487,7 +676,12 @@ export interface ProteusGroup {
487
676
  *
488
677
  * Default: 'row' (CSS standard)
489
678
  */
490
- flexDirection?: "column" | "column-reverse" | "row" | "row-reverse";
679
+ flexDirection?:
680
+ | "column"
681
+ | "column-reverse"
682
+ | "row"
683
+ | "row-reverse"
684
+ | ProteusValue;
491
685
  flexWrap?: SprinklePropFlexWrap;
492
686
  fontFamily?: SprinklePropFontFamily;
493
687
  fontSize?: SprinklePropFontSize;
@@ -568,7 +762,7 @@ export interface ProteusHeading {
568
762
  *
569
763
  * Use `asChild` to decouple the semantic level from visual appearance.
570
764
  */
571
- level?: "1" | "2" | "3" | "4";
765
+ level?: "1" | "2" | "3" | "4" | ProteusValue;
572
766
  m?: SprinklePropM;
573
767
  maxH?: SprinklePropMaxH;
574
768
  maxW?: SprinklePropMaxW;
@@ -608,7 +802,7 @@ export interface ProteusImage {
608
802
  /**
609
803
  * Alternative text for the image
610
804
  */
611
- alt?: string;
805
+ alt?: ProteusValue | string;
612
806
  animation?: SprinklePropAnimation;
613
807
  backgroundImage?: SprinklePropBackgroundImage;
614
808
  bg?: SprinklePropBg;
@@ -661,7 +855,7 @@ export interface ProteusImage {
661
855
  /**
662
856
  * The image source URL
663
857
  */
664
- src?: string;
858
+ src?: ProteusValue | string;
665
859
  textAlign?: SprinklePropTextAlign;
666
860
  textTransform?: SprinklePropTextTransform;
667
861
  transition?: SprinklePropTransition;
@@ -697,7 +891,7 @@ export interface ProteusInput {
697
891
  /**
698
892
  * Control the appearance of the input.
699
893
  */
700
- appearance?: "default" | "number";
894
+ appearance?: "default" | "number" | ProteusValue;
701
895
  backgroundImage?: SprinklePropBackgroundImage;
702
896
  bg?: SprinklePropBg;
703
897
  border?: SprinklePropBorder;
@@ -733,7 +927,7 @@ export interface ProteusInput {
733
927
  /**
734
928
  * The name of the form control element.
735
929
  */
736
- name?: string;
930
+ name?: ProteusValue | string;
737
931
  objectFit?: SprinklePropObjectFit;
738
932
  overflow?: SprinklePropOverflow;
739
933
  overflowX?: SprinklePropOverflowX;
@@ -744,7 +938,7 @@ export interface ProteusInput {
744
938
  /**
745
939
  * The placeholder text to use when control has no value.
746
940
  */
747
- placeholder?: string;
941
+ placeholder?: ProteusValue | string;
748
942
  placeItems?: SprinklePropPlaceItems;
749
943
  pointerEvents?: SprinklePropPointerEvents;
750
944
  pr?: SprinklePropPr;
@@ -782,6 +976,7 @@ export interface ProteusInput {
782
976
  | "time"
783
977
  | "url"
784
978
  | "week"
979
+ | ProteusValue
785
980
  | string;
786
981
  w?: SprinklePropW;
787
982
  whiteSpace?: SprinklePropWhiteSpace;
@@ -817,7 +1012,7 @@ export interface ProteusLink {
817
1012
  /**
818
1013
  * The link href.
819
1014
  */
820
- href?: string;
1015
+ href?: ProteusValue | string;
821
1016
  justifyContent?: SprinklePropJustifyContent;
822
1017
  justifyItems?: SprinklePropJustifyItems;
823
1018
  m?: SprinklePropM;
@@ -855,13 +1050,17 @@ export interface ProteusLink {
855
1050
  export interface ProteusMap {
856
1051
  $type: "Map";
857
1052
  /**
858
- * Template object to render for each item in the array. Value paths are relative to current item.
1053
+ * A Proteus node can be a string, number, boolean, null, a single element, or an array of these types (similar to ReactNode)
859
1054
  */
860
- children?: {
861
- [k: string]: undefined | unknown;
862
- };
1055
+ children?:
1056
+ | (boolean | null | number | ProteusElement | string)[]
1057
+ | boolean
1058
+ | null
1059
+ | number
1060
+ | ProteusElement
1061
+ | string;
863
1062
  /**
864
- * JSON pointer path to array (e.g., '/questions')
1063
+ * JSON pointer path to the source array in the data (e.g., '/results')
865
1064
  */
866
1065
  path: string;
867
1066
  }
@@ -923,14 +1122,14 @@ export interface ProteusRange {
923
1122
  /**
924
1123
  * The maximum value for the range.
925
1124
  */
926
- max?: number;
1125
+ max?: number | ProteusValue;
927
1126
  maxH?: SprinklePropMaxH;
928
1127
  maxW?: SprinklePropMaxW;
929
1128
  mb?: SprinklePropMb;
930
1129
  /**
931
1130
  * The minimum value for the range.
932
1131
  */
933
- min?: number;
1132
+ min?: number | ProteusValue;
934
1133
  ml?: SprinklePropMl;
935
1134
  mr?: SprinklePropMr;
936
1135
  mt?: SprinklePropMt;
@@ -954,7 +1153,7 @@ export interface ProteusRange {
954
1153
  /**
955
1154
  * The stepping interval for the range.
956
1155
  */
957
- step?: number;
1156
+ step?: number | ProteusValue;
958
1157
  textAlign?: SprinklePropTextAlign;
959
1158
  textTransform?: SprinklePropTextTransform;
960
1159
  transition?: SprinklePropTransition;
@@ -968,7 +1167,7 @@ export interface ProteusSelect {
968
1167
  /**
969
1168
  * The name of the inner select element.
970
1169
  */
971
- name?: string;
1170
+ name?: ProteusValue | string;
972
1171
  /**
973
1172
  * The select items/options we want to render.
974
1173
  */
@@ -1208,6 +1407,10 @@ export interface ProteusText {
1208
1407
  h?: SprinklePropH;
1209
1408
  justifyContent?: SprinklePropJustifyContent;
1210
1409
  justifyItems?: SprinklePropJustifyItems;
1410
+ /**
1411
+ * Truncate the text at specific number of lines.
1412
+ */
1413
+ lineClamp?: "1" | "2" | "3" | "4" | ProteusValue;
1211
1414
  m?: SprinklePropM;
1212
1415
  maxH?: SprinklePropMaxH;
1213
1416
  maxW?: SprinklePropMaxW;
@@ -1236,6 +1439,10 @@ export interface ProteusText {
1236
1439
  textAlign?: SprinklePropTextAlign;
1237
1440
  textTransform?: SprinklePropTextTransform;
1238
1441
  transition?: SprinklePropTransition;
1442
+ /**
1443
+ * Whether to truncate the text and add an ellipsis at the end.
1444
+ */
1445
+ truncate?: boolean | ProteusValue;
1239
1446
  w?: SprinklePropW;
1240
1447
  whiteSpace?: SprinklePropWhiteSpace;
1241
1448
  z?: SprinklePropZ;
@@ -1273,7 +1480,7 @@ export interface ProteusTextarea {
1273
1480
  /**
1274
1481
  * Limits the height of the textarea when `resize=auto` is used.
1275
1482
  */
1276
- maxRows?: 1 | 2 | 3 | 4 | 5;
1483
+ maxRows?: 1 | 2 | 3 | 4 | 5 | ProteusValue;
1277
1484
  maxW?: SprinklePropMaxW;
1278
1485
  mb?: SprinklePropMb;
1279
1486
  ml?: SprinklePropMl;
@@ -1284,7 +1491,7 @@ export interface ProteusTextarea {
1284
1491
  /**
1285
1492
  * The name of the form control element.
1286
1493
  */
1287
- name?: string;
1494
+ name?: ProteusValue | string;
1288
1495
  objectFit?: SprinklePropObjectFit;
1289
1496
  overflow?: SprinklePropOverflow;
1290
1497
  overflowX?: SprinklePropOverflowX;
@@ -1295,7 +1502,7 @@ export interface ProteusTextarea {
1295
1502
  /**
1296
1503
  * The placeholder text to use when control has no value.
1297
1504
  */
1298
- placeholder?: string;
1505
+ placeholder?: ProteusValue | string;
1299
1506
  placeItems?: SprinklePropPlaceItems;
1300
1507
  pointerEvents?: SprinklePropPointerEvents;
1301
1508
  pr?: SprinklePropPr;
@@ -1305,12 +1512,12 @@ export interface ProteusTextarea {
1305
1512
  /**
1306
1513
  * Control whether resizing mode is manual, automatic, or disabled.
1307
1514
  */
1308
- resize?: "auto" | "none" | "vertical";
1515
+ resize?: "auto" | "none" | "vertical" | ProteusValue;
1309
1516
  rounded?: SprinklePropRounded;
1310
1517
  /**
1311
1518
  * The number of rows to display.
1312
1519
  */
1313
- rows?: number;
1520
+ rows?: number | ProteusValue;
1314
1521
  shadow?: SprinklePropShadow;
1315
1522
  textAlign?: SprinklePropTextAlign;
1316
1523
  textTransform?: SprinklePropTextTransform;
@@ -1319,10 +1526,82 @@ export interface ProteusTextarea {
1319
1526
  whiteSpace?: SprinklePropWhiteSpace;
1320
1527
  z?: SprinklePropZ;
1321
1528
  }
1529
+ export interface ProteusTime {
1530
+ $type: "Time";
1531
+ alignItems?: SprinklePropAlignItems;
1532
+ alignSelf?: SprinklePropAlignSelf;
1533
+ animation?: SprinklePropAnimation;
1534
+ backgroundImage?: SprinklePropBackgroundImage;
1535
+ bg?: SprinklePropBg;
1536
+ border?: SprinklePropBorder;
1537
+ borderB?: SprinklePropBorderB;
1538
+ borderColor?: SprinklePropBorderColor;
1539
+ borderL?: SprinklePropBorderL;
1540
+ borderR?: SprinklePropBorderR;
1541
+ borderT?: SprinklePropBorderT;
1542
+ color?: SprinklePropColor;
1543
+ cursor?: SprinklePropCursor;
1544
+ /**
1545
+ * The date to display. Can be a `Date` object or an ISO 8601 string.
1546
+ */
1547
+ date: ProteusValue | string;
1548
+ display?: SprinklePropDisplay;
1549
+ flex?: SprinklePropFlex;
1550
+ flexDirection?: SprinklePropFlexDirection;
1551
+ flexWrap?: SprinklePropFlexWrap;
1552
+ fontFamily?: SprinklePropFontFamily;
1553
+ fontSize?: SprinklePropFontSize;
1554
+ fontWeight?: SprinklePropFontWeight;
1555
+ gap?: SprinklePropGap;
1556
+ gridColumn?: SprinklePropGridColumn;
1557
+ gridTemplateColumns?: SprinklePropGridTemplateColumns;
1558
+ h?: SprinklePropH;
1559
+ justifyContent?: SprinklePropJustifyContent;
1560
+ justifyItems?: SprinklePropJustifyItems;
1561
+ m?: SprinklePropM;
1562
+ maxH?: SprinklePropMaxH;
1563
+ maxW?: SprinklePropMaxW;
1564
+ mb?: SprinklePropMb;
1565
+ ml?: SprinklePropMl;
1566
+ mr?: SprinklePropMr;
1567
+ mt?: SprinklePropMt;
1568
+ mx?: SprinklePropMx;
1569
+ my?: SprinklePropMy;
1570
+ objectFit?: SprinklePropObjectFit;
1571
+ overflow?: SprinklePropOverflow;
1572
+ overflowX?: SprinklePropOverflowX;
1573
+ overflowY?: SprinklePropOverflowY;
1574
+ p?: SprinklePropP;
1575
+ pb?: SprinklePropPb;
1576
+ pl?: SprinklePropPl;
1577
+ placeItems?: SprinklePropPlaceItems;
1578
+ pointerEvents?: SprinklePropPointerEvents;
1579
+ pr?: SprinklePropPr;
1580
+ pt?: SprinklePropPt;
1581
+ px?: SprinklePropPx;
1582
+ py?: SprinklePropPy;
1583
+ rounded?: SprinklePropRounded;
1584
+ shadow?: SprinklePropShadow;
1585
+ /**
1586
+ * Whether to show the date part of the value. Defaults to `true`.
1587
+ */
1588
+ showDate?: boolean | ProteusValue;
1589
+ /**
1590
+ * Whether to show the time part of the value. Defaults to `false`.
1591
+ */
1592
+ showTime?: boolean | ProteusValue;
1593
+ size?: SprinklePropSize;
1594
+ textAlign?: SprinklePropTextAlign;
1595
+ textTransform?: SprinklePropTextTransform;
1596
+ transition?: SprinklePropTransition;
1597
+ w?: SprinklePropW;
1598
+ whiteSpace?: SprinklePropWhiteSpace;
1599
+ z?: SprinklePropZ;
1600
+ }
1322
1601
  export interface ProteusValue {
1323
1602
  $type: "Value";
1324
1603
  /**
1325
- * JSON pointer path to value (e.g., '/question', '/options/0/label')
1604
+ * Path to a value in the data. Absolute paths start with '/' and resolve from the root (e.g., '/title', '/options/0/label'). Inside a Map template, paths without a leading '/' are relative to the current item (e.g., 'title' resolves to each item's 'title' field).
1326
1605
  */
1327
1606
  path: string;
1328
1607
  }
@@ -1334,7 +1613,8 @@ export type SprinklePropAlignItems =
1334
1613
  | "end"
1335
1614
  | "normal"
1336
1615
  | "start"
1337
- | "stretch";
1616
+ | "stretch"
1617
+ | ProteusValue;
1338
1618
  /**
1339
1619
  * Set the element's `align-self` CSS property
1340
1620
  */
@@ -1343,15 +1623,16 @@ export type SprinklePropAlignSelf =
1343
1623
  | "end"
1344
1624
  | "normal"
1345
1625
  | "start"
1346
- | "stretch";
1626
+ | "stretch"
1627
+ | ProteusValue;
1347
1628
  /**
1348
1629
  * Animate element with CSS animations
1349
1630
  */
1350
- export type SprinklePropAnimation = "ping" | "pulse" | "spin";
1631
+ export type SprinklePropAnimation = "ping" | "pulse" | "spin" | ProteusValue;
1351
1632
  /**
1352
1633
  * Set the element's `background-image` CSS property
1353
1634
  */
1354
- export type SprinklePropBackgroundImage = "gradient.opal";
1635
+ export type SprinklePropBackgroundImage = "gradient.opal" | ProteusValue;
1355
1636
  /**
1356
1637
  * Set the element's background color. Only accepts predefined color tokens starting with `bg.` (e.g., `bg.default`, `bg.accent`, `bg.error`), or the special values `current` and `transparent`.
1357
1638
  */
@@ -1395,15 +1676,16 @@ export type SprinklePropBg =
1395
1676
  | "bg.warning.light"
1396
1677
  | "bg.warning.subtle"
1397
1678
  | "current"
1398
- | "transparent";
1679
+ | "transparent"
1680
+ | ProteusValue;
1399
1681
  /**
1400
1682
  * Set the element's `border-width` CSS property
1401
1683
  */
1402
- export type SprinklePropBorder = "0" | "1" | "2";
1684
+ export type SprinklePropBorder = "0" | "1" | "2" | ProteusValue;
1403
1685
  /**
1404
1686
  * Set the element's `border-bottom-width` CSS property
1405
1687
  */
1406
- export type SprinklePropBorderB = "0" | "1" | "2";
1688
+ export type SprinklePropBorderB = "0" | "1" | "2" | ProteusValue;
1407
1689
  /**
1408
1690
  * Set the element's border color. Only accepts predefined color tokens starting with `border.` (e.g., `border.default`, `border.accent`, `border.error`), or the special values `current` and `transparent`.
1409
1691
  */
@@ -1421,19 +1703,20 @@ export type SprinklePropBorderColor =
1421
1703
  | "border.tertiary"
1422
1704
  | "border.warning"
1423
1705
  | "current"
1424
- | "transparent";
1706
+ | "transparent"
1707
+ | ProteusValue;
1425
1708
  /**
1426
1709
  * Set the element's `border-left-width` CSS property
1427
1710
  */
1428
- export type SprinklePropBorderL = "0" | "1" | "2";
1711
+ export type SprinklePropBorderL = "0" | "1" | "2" | ProteusValue;
1429
1712
  /**
1430
1713
  * Set the element's `border-right-width` CSS property
1431
1714
  */
1432
- export type SprinklePropBorderR = "0" | "1" | "2";
1715
+ export type SprinklePropBorderR = "0" | "1" | "2" | ProteusValue;
1433
1716
  /**
1434
1717
  * Set the element's `border-top-width` CSS property
1435
1718
  */
1436
- export type SprinklePropBorderT = "0" | "1" | "2";
1719
+ export type SprinklePropBorderT = "0" | "1" | "2" | ProteusValue;
1437
1720
  /**
1438
1721
  * Set the element's text color. Only accepts predefined color tokens starting with `fg.` (e.g., `fg.default`, `fg.accent`, `fg.error`), or the special values `current` and `transparent`.
1439
1722
  */
@@ -1473,11 +1756,12 @@ export type SprinklePropColor =
1473
1756
  | "fg.warning.light"
1474
1757
  | "fg.warning.strong"
1475
1758
  | "fg.white"
1476
- | "transparent";
1759
+ | "transparent"
1760
+ | ProteusValue;
1477
1761
  /**
1478
1762
  * Set the element's `cursor` CSS property
1479
1763
  */
1480
- export type SprinklePropCursor = "default" | "pointer" | "text";
1764
+ export type SprinklePropCursor = "default" | "pointer" | "text" | ProteusValue;
1481
1765
  /**
1482
1766
  * Set the element's `display` CSS property
1483
1767
  */
@@ -1491,11 +1775,12 @@ export type SprinklePropDisplay =
1491
1775
  | "none"
1492
1776
  | "table"
1493
1777
  | "table-cell"
1494
- | "table-row";
1778
+ | "table-row"
1779
+ | ProteusValue;
1495
1780
  /**
1496
1781
  * Set the element's `flex` CSS property
1497
1782
  */
1498
- export type SprinklePropFlex = "1" | "auto" | "initial" | "none";
1783
+ export type SprinklePropFlex = "1" | "auto" | "initial" | "none" | ProteusValue;
1499
1784
  /**
1500
1785
  * Set the element's `flex-direction` CSS property
1501
1786
  */
@@ -1503,15 +1788,16 @@ export type SprinklePropFlexDirection =
1503
1788
  | "column"
1504
1789
  | "column-reverse"
1505
1790
  | "row"
1506
- | "row-reverse";
1791
+ | "row-reverse"
1792
+ | ProteusValue;
1507
1793
  /**
1508
1794
  * Set the element's `flex-wrap` CSS property
1509
1795
  */
1510
- export type SprinklePropFlexWrap = "nowrap" | "wrap";
1796
+ export type SprinklePropFlexWrap = "nowrap" | "wrap" | ProteusValue;
1511
1797
  /**
1512
1798
  * Set the element's font family. Only accepts predefined fontFamily tokens.
1513
1799
  */
1514
- export type SprinklePropFontFamily = "mono" | "sans";
1800
+ export type SprinklePropFontFamily = "mono" | "sans" | ProteusValue;
1515
1801
  /**
1516
1802
  * Set the element's font size and line height (both properties are set together). Only accepts predefined fontSize tokens.
1517
1803
  */
@@ -1524,11 +1810,18 @@ export type SprinklePropFontSize =
1524
1810
  | "md"
1525
1811
  | "sm"
1526
1812
  | "xl"
1527
- | "xs";
1813
+ | "xs"
1814
+ | ProteusValue;
1528
1815
  /**
1529
1816
  * Set the element's `font-weight` CSS property
1530
1817
  */
1531
- export type SprinklePropFontWeight = "400" | "500" | "600" | "700" | "inherit";
1818
+ export type SprinklePropFontWeight =
1819
+ | "400"
1820
+ | "500"
1821
+ | "600"
1822
+ | "700"
1823
+ | "inherit"
1824
+ | ProteusValue;
1532
1825
  /**
1533
1826
  * Set the element's `gap` CSS property
1534
1827
  */
@@ -1547,15 +1840,21 @@ export type SprinklePropGap =
1547
1840
  | "40"
1548
1841
  | "48"
1549
1842
  | "64"
1550
- | "80";
1843
+ | "80"
1844
+ | ProteusValue;
1551
1845
  /**
1552
1846
  * Set the element's size across grid columns
1553
1847
  */
1554
- export type SprinklePropGridColumn = "1" | "2" | "3" | "4";
1848
+ export type SprinklePropGridColumn = "1" | "2" | "3" | "4" | ProteusValue;
1555
1849
  /**
1556
1850
  * Control number of columns in a grid layout
1557
1851
  */
1558
- export type SprinklePropGridTemplateColumns = "1" | "2" | "3" | "4";
1852
+ export type SprinklePropGridTemplateColumns =
1853
+ | "1"
1854
+ | "2"
1855
+ | "3"
1856
+ | "4"
1857
+ | ProteusValue;
1559
1858
  /**
1560
1859
  * Set the element's height. Only accepts predefined size tokens.
1561
1860
  */
@@ -1590,7 +1889,8 @@ export type SprinklePropH =
1590
1889
  | "min"
1591
1890
  | "sm"
1592
1891
  | "xl"
1593
- | "xs";
1892
+ | "xs"
1893
+ | ProteusValue;
1594
1894
  /**
1595
1895
  * Set the element's `justify-content` CSS property
1596
1896
  */
@@ -1604,7 +1904,8 @@ export type SprinklePropJustifyContent =
1604
1904
  | "space-between"
1605
1905
  | "space-evenly"
1606
1906
  | "start"
1607
- | "stretch";
1907
+ | "stretch"
1908
+ | ProteusValue;
1608
1909
  /**
1609
1910
  * Set the element's `justify-items` CSS property
1610
1911
  */
@@ -1613,7 +1914,8 @@ export type SprinklePropJustifyItems =
1613
1914
  | "end"
1614
1915
  | "normal"
1615
1916
  | "start"
1616
- | "stretch";
1917
+ | "stretch"
1918
+ | ProteusValue;
1617
1919
  /**
1618
1920
  * Set the element's margin on all sides. Only accepts predefined spacing tokens.
1619
1921
  */
@@ -1633,15 +1935,28 @@ export type SprinklePropM =
1633
1935
  | "48"
1634
1936
  | "64"
1635
1937
  | "80"
1636
- | "auto";
1938
+ | "auto"
1939
+ | ProteusValue;
1637
1940
  /**
1638
1941
  * Set the element's maximum height. Only accepts predefined maxSize tokens.
1639
1942
  */
1640
- export type SprinklePropMaxH = "full" | "lg" | "md" | "sm" | "xs";
1943
+ export type SprinklePropMaxH =
1944
+ | "full"
1945
+ | "lg"
1946
+ | "md"
1947
+ | "sm"
1948
+ | "xs"
1949
+ | ProteusValue;
1641
1950
  /**
1642
1951
  * Set the element's maximum width. Only accepts predefined maxSize tokens.
1643
1952
  */
1644
- export type SprinklePropMaxW = "full" | "lg" | "md" | "sm" | "xs";
1953
+ export type SprinklePropMaxW =
1954
+ | "full"
1955
+ | "lg"
1956
+ | "md"
1957
+ | "sm"
1958
+ | "xs"
1959
+ | ProteusValue;
1645
1960
  /**
1646
1961
  * Set the element's bottom margin. Only accepts predefined spacing tokens.
1647
1962
  */
@@ -1661,7 +1976,8 @@ export type SprinklePropMb =
1661
1976
  | "48"
1662
1977
  | "64"
1663
1978
  | "80"
1664
- | "auto";
1979
+ | "auto"
1980
+ | ProteusValue;
1665
1981
  /**
1666
1982
  * Set the element's left margin. Only accepts predefined spacing tokens.
1667
1983
  */
@@ -1681,7 +1997,8 @@ export type SprinklePropMl =
1681
1997
  | "48"
1682
1998
  | "64"
1683
1999
  | "80"
1684
- | "auto";
2000
+ | "auto"
2001
+ | ProteusValue;
1685
2002
  /**
1686
2003
  * Set the element's right margin. Only accepts predefined spacing tokens.
1687
2004
  */
@@ -1701,7 +2018,8 @@ export type SprinklePropMr =
1701
2018
  | "48"
1702
2019
  | "64"
1703
2020
  | "80"
1704
- | "auto";
2021
+ | "auto"
2022
+ | ProteusValue;
1705
2023
  /**
1706
2024
  * Set the element's top margin. Only accepts predefined spacing tokens.
1707
2025
  */
@@ -1721,7 +2039,8 @@ export type SprinklePropMt =
1721
2039
  | "48"
1722
2040
  | "64"
1723
2041
  | "80"
1724
- | "auto";
2042
+ | "auto"
2043
+ | ProteusValue;
1725
2044
  /**
1726
2045
  * Set the element's left and right margin. Only accepts predefined spacing tokens.
1727
2046
  */
@@ -1741,7 +2060,9 @@ export type SprinklePropMx =
1741
2060
  | "48"
1742
2061
  | "64"
1743
2062
  | "80"
1744
- | "auto";
2063
+ | "auto"
2064
+ | ProteusValue;
2065
+
1745
2066
  /**
1746
2067
  * Set the element's top and bottom margin. Only accepts predefined spacing tokens.
1747
2068
  */
@@ -1761,24 +2082,37 @@ export type SprinklePropMy =
1761
2082
  | "48"
1762
2083
  | "64"
1763
2084
  | "80"
1764
- | "auto";
2085
+ | "auto"
2086
+ | ProteusValue;
1765
2087
  /**
1766
2088
  * Set the element's `object-fit` CSS property
1767
2089
  */
1768
- export type SprinklePropObjectFit = "contain" | "cover" | "fill" | "none";
2090
+ export type SprinklePropObjectFit =
2091
+ | "contain"
2092
+ | "cover"
2093
+ | "fill"
2094
+ | "none"
2095
+ | ProteusValue;
1769
2096
  /**
1770
2097
  * Set the element's `overflow` CSS property
1771
2098
  */
1772
- export type SprinklePropOverflow = "auto" | "hidden" | "visible";
2099
+ export type SprinklePropOverflow = "auto" | "hidden" | "visible" | ProteusValue;
1773
2100
  /**
1774
2101
  * Set the element's `overflow-x` CSS property
1775
2102
  */
1776
- export type SprinklePropOverflowX = "auto" | "hidden" | "visible";
1777
-
2103
+ export type SprinklePropOverflowX =
2104
+ | "auto"
2105
+ | "hidden"
2106
+ | "visible"
2107
+ | ProteusValue;
1778
2108
  /**
1779
2109
  * Set the element's `overflow-y` CSS property
1780
2110
  */
1781
- export type SprinklePropOverflowY = "auto" | "hidden" | "visible";
2111
+ export type SprinklePropOverflowY =
2112
+ | "auto"
2113
+ | "hidden"
2114
+ | "visible"
2115
+ | ProteusValue;
1782
2116
  /**
1783
2117
  * Set the element's padding on all sides. Only accepts predefined spacing tokens.
1784
2118
  */
@@ -1797,7 +2131,8 @@ export type SprinklePropP =
1797
2131
  | "40"
1798
2132
  | "48"
1799
2133
  | "64"
1800
- | "80";
2134
+ | "80"
2135
+ | ProteusValue;
1801
2136
  /**
1802
2137
  * Set the element's bottom padding. Only accepts predefined spacing tokens.
1803
2138
  */
@@ -1816,7 +2151,8 @@ export type SprinklePropPb =
1816
2151
  | "40"
1817
2152
  | "48"
1818
2153
  | "64"
1819
- | "80";
2154
+ | "80"
2155
+ | ProteusValue;
1820
2156
  /**
1821
2157
  * Set the element's left padding. Only accepts predefined spacing tokens.
1822
2158
  */
@@ -1835,15 +2171,16 @@ export type SprinklePropPl =
1835
2171
  | "40"
1836
2172
  | "48"
1837
2173
  | "64"
1838
- | "80";
2174
+ | "80"
2175
+ | ProteusValue;
1839
2176
  /**
1840
2177
  * Set the element's `place-items` CSS property
1841
2178
  */
1842
- export type SprinklePropPlaceItems = "center";
2179
+ export type SprinklePropPlaceItems = "center" | ProteusValue;
1843
2180
  /**
1844
2181
  * Set the element's `pointer-events` CSS property
1845
2182
  */
1846
- export type SprinklePropPointerEvents = "auto" | "none";
2183
+ export type SprinklePropPointerEvents = "auto" | "none" | ProteusValue;
1847
2184
  /**
1848
2185
  * Set the element's right padding. Only accepts predefined spacing tokens.
1849
2186
  */
@@ -1862,7 +2199,8 @@ export type SprinklePropPr =
1862
2199
  | "40"
1863
2200
  | "48"
1864
2201
  | "64"
1865
- | "80";
2202
+ | "80"
2203
+ | ProteusValue;
1866
2204
  /**
1867
2205
  * Set the element's top padding. Only accepts predefined spacing tokens.
1868
2206
  */
@@ -1881,7 +2219,8 @@ export type SprinklePropPt =
1881
2219
  | "40"
1882
2220
  | "48"
1883
2221
  | "64"
1884
- | "80";
2222
+ | "80"
2223
+ | ProteusValue;
1885
2224
  /**
1886
2225
  * Set the element's left and right padding. Only accepts predefined spacing tokens.
1887
2226
  */
@@ -1900,7 +2239,8 @@ export type SprinklePropPx =
1900
2239
  | "40"
1901
2240
  | "48"
1902
2241
  | "64"
1903
- | "80";
2242
+ | "80"
2243
+ | ProteusValue;
1904
2244
  /**
1905
2245
  * Set the element's top and bottom padding. Only accepts predefined spacing tokens.
1906
2246
  */
@@ -1919,7 +2259,8 @@ export type SprinklePropPy =
1919
2259
  | "40"
1920
2260
  | "48"
1921
2261
  | "64"
1922
- | "80";
2262
+ | "80"
2263
+ | ProteusValue;
1923
2264
  /**
1924
2265
  * Set the element's border radius. Only accepts predefined borderRadius tokens.
1925
2266
  */
@@ -1931,11 +2272,18 @@ export type SprinklePropRounded =
1931
2272
  | "none"
1932
2273
  | "sm"
1933
2274
  | "xl"
1934
- | "xs";
2275
+ | "xs"
2276
+ | ProteusValue;
1935
2277
  /**
1936
2278
  * Set the element's box shadow. Only accepts predefined boxShadow tokens.
1937
2279
  */
1938
- export type SprinklePropShadow = "lg" | "md" | "none" | "sm" | "xl";
2280
+ export type SprinklePropShadow =
2281
+ | "lg"
2282
+ | "md"
2283
+ | "none"
2284
+ | "sm"
2285
+ | "xl"
2286
+ | ProteusValue;
1939
2287
  /**
1940
2288
  * Set the element's width and height. Only accepts predefined size tokens.
1941
2289
  *
@@ -1973,15 +2321,25 @@ export type SprinklePropSize =
1973
2321
  | "min"
1974
2322
  | "sm"
1975
2323
  | "xl"
1976
- | "xs";
2324
+ | "xs"
2325
+ | ProteusValue;
1977
2326
  /**
1978
2327
  * Set the element's `text-align` CSS property
1979
2328
  */
1980
- export type SprinklePropTextAlign = "center" | "end" | "justify" | "start";
2329
+ export type SprinklePropTextAlign =
2330
+ | "center"
2331
+ | "end"
2332
+ | "justify"
2333
+ | "start"
2334
+ | ProteusValue;
1981
2335
  /**
1982
2336
  * Set the element's `text-transform` CSS property
1983
2337
  */
1984
- export type SprinklePropTextTransform = "capitalize" | "none" | "uppercase";
2338
+ export type SprinklePropTextTransform =
2339
+ | "capitalize"
2340
+ | "none"
2341
+ | "uppercase"
2342
+ | ProteusValue;
1985
2343
  /**
1986
2344
  * Control which CSS properties should transition
1987
2345
  */
@@ -1990,7 +2348,8 @@ export type SprinklePropTransition =
1990
2348
  | "colors"
1991
2349
  | "none"
1992
2350
  | "opacity"
1993
- | "transform";
2351
+ | "transform"
2352
+ | ProteusValue;
1994
2353
  /**
1995
2354
  * Set the element's width. Only accepts predefined size tokens.
1996
2355
  */
@@ -2025,11 +2384,12 @@ export type SprinklePropW =
2025
2384
  | "min"
2026
2385
  | "sm"
2027
2386
  | "xl"
2028
- | "xs";
2387
+ | "xs"
2388
+ | ProteusValue;
2029
2389
  /**
2030
2390
  * Set the element's `white-space` CSS property
2031
2391
  */
2032
- export type SprinklePropWhiteSpace = "nowrap";
2392
+ export type SprinklePropWhiteSpace = "nowrap" | ProteusValue;
2033
2393
  /**
2034
2394
  * Set the element's stacking order. Only accepts predefined zIndex tokens (e.g., popover, toast, tooltip) or numeric values (0, 10, 20, 30, auto).
2035
2395
  */
@@ -2041,7 +2401,8 @@ export type SprinklePropZ =
2041
2401
  | "auto"
2042
2402
  | "popover"
2043
2403
  | "toast"
2044
- | "tooltip";
2404
+ | "tooltip"
2405
+ | ProteusValue;
2045
2406
 
2046
2407
  /**
2047
2408
  * Builder namespace for Adaptive UI Document components.
@@ -2056,9 +2417,21 @@ export const UI = {
2056
2417
  $type: "Action" as const,
2057
2418
  ...props,
2058
2419
  }),
2420
+ Badge: (props: Omit<ProteusBadge, "$type">): ProteusBadge => ({
2421
+ $type: "Badge" as const,
2422
+ ...props,
2423
+ }),
2059
2424
  CancelAction: (
2060
2425
  props: Omit<ProteusCancelAction, "$type">,
2061
2426
  ): ProteusCancelAction => ({ $type: "CancelAction" as const, ...props }),
2427
+ Chart: (props: Omit<ProteusChart, "$type">): ProteusChart => ({
2428
+ $type: "Chart" as const,
2429
+ ...props,
2430
+ }),
2431
+ DataTable: (props: Omit<ProteusDataTable, "$type">): ProteusDataTable => ({
2432
+ $type: "DataTable" as const,
2433
+ ...props,
2434
+ }),
2062
2435
  Document: (props: Omit<ProteusDocument, "$type">): ProteusDocument => ({
2063
2436
  $type: "Document" as const,
2064
2437
  ...props,
@@ -2122,6 +2495,10 @@ export const UI = {
2122
2495
  $type: "Textarea" as const,
2123
2496
  ...props,
2124
2497
  }),
2498
+ Time: (props: Omit<ProteusTime, "$type">): ProteusTime => ({
2499
+ $type: "Time" as const,
2500
+ ...props,
2501
+ }),
2125
2502
  Value: (props: Omit<ProteusValue, "$type">): ProteusValue => ({
2126
2503
  $type: "Value" as const,
2127
2504
  ...props,