@wise/dynamic-flow-types 3.3.5 → 3.5.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.
package/build/main.js CHANGED
@@ -322,6 +322,9 @@ var linkBehaviorSchema = import_zod.z.object({
322
322
  type: import_zod.z.literal("link"),
323
323
  url: import_zod.z.string()
324
324
  });
325
+ var refreshBehaviorSchema = import_zod.z.object({
326
+ type: import_zod.z.literal("refresh")
327
+ });
325
328
  var linkSchema = import_zod.z.object({
326
329
  url: import_zod.z.string()
327
330
  });
@@ -410,7 +413,8 @@ var behaviorSchema = import_zod.z.lazy(
410
413
  containerBehaviorSchema,
411
414
  dismissBehaviorSchema,
412
415
  linkBehaviorSchema,
413
- modalBehaviorSchema
416
+ modalBehaviorSchema,
417
+ refreshBehaviorSchema
414
418
  ])
415
419
  );
416
420
  var reviewLayoutCallToActionSchema = import_zod.z.lazy(
@@ -495,6 +499,13 @@ var decisionLayoutOptionSchema = import_zod.z.lazy(
495
499
  inlineAlert: inlineAlertSchema.optional()
496
500
  })
497
501
  );
502
+ var sectionLayoutCallToActionSchema = import_zod.z.lazy(
503
+ () => import_zod.z.object({
504
+ title: import_zod.z.string(),
505
+ accessibilityDescription: import_zod.z.string().optional(),
506
+ behavior: behaviorSchema
507
+ })
508
+ );
498
509
  var statusListLayoutSchema = import_zod.z.lazy(
499
510
  () => import_zod.z.object({
500
511
  type: import_zod.z.literal("status-list"),
@@ -514,11 +525,14 @@ var statusListLayoutItemSchema = import_zod.z.lazy(
514
525
  tag: import_zod.z.string().optional()
515
526
  })
516
527
  );
517
- var itemCallToActionSchema = import_zod.z.lazy(
528
+ var sectionLayoutSchema = import_zod.z.lazy(
518
529
  () => import_zod.z.object({
530
+ type: import_zod.z.literal("section"),
531
+ components: import_zod.z.array(layoutSchema),
519
532
  title: import_zod.z.string(),
520
- accessibilityDescription: import_zod.z.string().optional(),
521
- behavior: behaviorSchema
533
+ callToAction: sectionLayoutCallToActionSchema.optional(),
534
+ control: import_zod.z.string().optional(),
535
+ margin: sizeSchema.optional()
522
536
  })
523
537
  );
524
538
  var layoutSchema = import_zod.z.lazy(
@@ -541,9 +555,17 @@ var layoutSchema = import_zod.z.lazy(
541
555
  paragraphLayoutSchema,
542
556
  reviewLayoutSchema,
543
557
  searchLayoutSchema,
558
+ sectionLayoutSchema,
544
559
  statusListLayoutSchema
545
560
  ])
546
561
  );
562
+ var itemCallToActionSchema = import_zod.z.lazy(
563
+ () => import_zod.z.object({
564
+ title: import_zod.z.string(),
565
+ accessibilityDescription: import_zod.z.string().optional(),
566
+ behavior: behaviorSchema
567
+ })
568
+ );
547
569
  var boxLayoutSchema = import_zod.z.lazy(
548
570
  () => import_zod.z.object({
549
571
  type: import_zod.z.literal("box"),
@@ -748,7 +770,8 @@ var booleanSchemaSchema = import_zod.z.lazy(
748
770
  validationAsync: validateAsyncSchema.optional(),
749
771
  alert: alertLayoutSchema.optional(),
750
772
  autofillKey: import_zod.z.string().optional(),
751
- help: helpSchema.optional()
773
+ help: helpSchema.optional(),
774
+ onChange: behaviorSchema.optional()
752
775
  })
753
776
  );
754
777
  var constSchemaSchema = import_zod.z.lazy(
@@ -799,7 +822,8 @@ var integerSchemaSchema = import_zod.z.lazy(
799
822
  alert: alertLayoutSchema.optional(),
800
823
  autocompleteHint: import_zod.z.array(autocompleteTokenSchema).optional(),
801
824
  autofillKey: import_zod.z.string().optional(),
802
- help: helpSchema.optional()
825
+ help: helpSchema.optional(),
826
+ onChange: behaviorSchema.optional()
803
827
  })
804
828
  );
805
829
  var numberSchemaSchema = import_zod.z.lazy(
@@ -832,7 +856,8 @@ var numberSchemaSchema = import_zod.z.lazy(
832
856
  alert: alertLayoutSchema.optional(),
833
857
  autocompleteHint: import_zod.z.array(autocompleteTokenSchema).optional(),
834
858
  autofillKey: import_zod.z.string().optional(),
835
- help: helpSchema.optional()
859
+ help: helpSchema.optional(),
860
+ onChange: behaviorSchema.optional()
836
861
  })
837
862
  );
838
863
  var objectSchemaSchema = import_zod.z.lazy(
@@ -884,7 +909,8 @@ var oneOfSchemaSchema = import_zod.z.lazy(
884
909
  autocompleteHint: import_zod.z.array(autocompleteTokenSchema).optional(),
885
910
  autofillKey: import_zod.z.string().optional(),
886
911
  validationMessages: import_zod.z.record(import_zod.z.string()).optional(),
887
- disabled: import_zod.z.boolean().optional()
912
+ disabled: import_zod.z.boolean().optional(),
913
+ onChange: behaviorSchema.optional()
888
914
  })
889
915
  );
890
916
  var stringSchemaSchema = import_zod.z.lazy(
@@ -929,7 +955,8 @@ var stringSchemaSchema = import_zod.z.lazy(
929
955
  autocompleteHint: import_zod.z.array(autocompleteTokenSchema).optional(),
930
956
  autofillKey: import_zod.z.string().optional(),
931
957
  help: helpSchema.optional(),
932
- suggestions: suggestionsSchema.optional()
958
+ suggestions: suggestionsSchema.optional(),
959
+ onChange: behaviorSchema.optional()
933
960
  })
934
961
  );
935
962
  var arraySchemaListSchema = import_zod.z.lazy(
package/build/main.mjs CHANGED
@@ -294,6 +294,9 @@ var linkBehaviorSchema = z.object({
294
294
  type: z.literal("link"),
295
295
  url: z.string()
296
296
  });
297
+ var refreshBehaviorSchema = z.object({
298
+ type: z.literal("refresh")
299
+ });
297
300
  var linkSchema = z.object({
298
301
  url: z.string()
299
302
  });
@@ -382,7 +385,8 @@ var behaviorSchema = z.lazy(
382
385
  containerBehaviorSchema,
383
386
  dismissBehaviorSchema,
384
387
  linkBehaviorSchema,
385
- modalBehaviorSchema
388
+ modalBehaviorSchema,
389
+ refreshBehaviorSchema
386
390
  ])
387
391
  );
388
392
  var reviewLayoutCallToActionSchema = z.lazy(
@@ -467,6 +471,13 @@ var decisionLayoutOptionSchema = z.lazy(
467
471
  inlineAlert: inlineAlertSchema.optional()
468
472
  })
469
473
  );
474
+ var sectionLayoutCallToActionSchema = z.lazy(
475
+ () => z.object({
476
+ title: z.string(),
477
+ accessibilityDescription: z.string().optional(),
478
+ behavior: behaviorSchema
479
+ })
480
+ );
470
481
  var statusListLayoutSchema = z.lazy(
471
482
  () => z.object({
472
483
  type: z.literal("status-list"),
@@ -486,11 +497,14 @@ var statusListLayoutItemSchema = z.lazy(
486
497
  tag: z.string().optional()
487
498
  })
488
499
  );
489
- var itemCallToActionSchema = z.lazy(
500
+ var sectionLayoutSchema = z.lazy(
490
501
  () => z.object({
502
+ type: z.literal("section"),
503
+ components: z.array(layoutSchema),
491
504
  title: z.string(),
492
- accessibilityDescription: z.string().optional(),
493
- behavior: behaviorSchema
505
+ callToAction: sectionLayoutCallToActionSchema.optional(),
506
+ control: z.string().optional(),
507
+ margin: sizeSchema.optional()
494
508
  })
495
509
  );
496
510
  var layoutSchema = z.lazy(
@@ -513,9 +527,17 @@ var layoutSchema = z.lazy(
513
527
  paragraphLayoutSchema,
514
528
  reviewLayoutSchema,
515
529
  searchLayoutSchema,
530
+ sectionLayoutSchema,
516
531
  statusListLayoutSchema
517
532
  ])
518
533
  );
534
+ var itemCallToActionSchema = z.lazy(
535
+ () => z.object({
536
+ title: z.string(),
537
+ accessibilityDescription: z.string().optional(),
538
+ behavior: behaviorSchema
539
+ })
540
+ );
519
541
  var boxLayoutSchema = z.lazy(
520
542
  () => z.object({
521
543
  type: z.literal("box"),
@@ -720,7 +742,8 @@ var booleanSchemaSchema = z.lazy(
720
742
  validationAsync: validateAsyncSchema.optional(),
721
743
  alert: alertLayoutSchema.optional(),
722
744
  autofillKey: z.string().optional(),
723
- help: helpSchema.optional()
745
+ help: helpSchema.optional(),
746
+ onChange: behaviorSchema.optional()
724
747
  })
725
748
  );
726
749
  var constSchemaSchema = z.lazy(
@@ -771,7 +794,8 @@ var integerSchemaSchema = z.lazy(
771
794
  alert: alertLayoutSchema.optional(),
772
795
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
773
796
  autofillKey: z.string().optional(),
774
- help: helpSchema.optional()
797
+ help: helpSchema.optional(),
798
+ onChange: behaviorSchema.optional()
775
799
  })
776
800
  );
777
801
  var numberSchemaSchema = z.lazy(
@@ -804,7 +828,8 @@ var numberSchemaSchema = z.lazy(
804
828
  alert: alertLayoutSchema.optional(),
805
829
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
806
830
  autofillKey: z.string().optional(),
807
- help: helpSchema.optional()
831
+ help: helpSchema.optional(),
832
+ onChange: behaviorSchema.optional()
808
833
  })
809
834
  );
810
835
  var objectSchemaSchema = z.lazy(
@@ -856,7 +881,8 @@ var oneOfSchemaSchema = z.lazy(
856
881
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
857
882
  autofillKey: z.string().optional(),
858
883
  validationMessages: z.record(z.string()).optional(),
859
- disabled: z.boolean().optional()
884
+ disabled: z.boolean().optional(),
885
+ onChange: behaviorSchema.optional()
860
886
  })
861
887
  );
862
888
  var stringSchemaSchema = z.lazy(
@@ -901,7 +927,8 @@ var stringSchemaSchema = z.lazy(
901
927
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
902
928
  autofillKey: z.string().optional(),
903
929
  help: helpSchema.optional(),
904
- suggestions: suggestionsSchema.optional()
930
+ suggestions: suggestionsSchema.optional(),
931
+ onChange: behaviorSchema.optional()
905
932
  })
906
933
  );
907
934
  var arraySchemaListSchema = z.lazy(
@@ -3,7 +3,8 @@ import type { ContainerBehavior } from './ContainerBehavior';
3
3
  import type { DismissBehavior } from './DismissBehavior';
4
4
  import type { LinkBehavior } from './LinkBehavior';
5
5
  import type { ModalBehavior } from './ModalBehavior';
6
+ import type { RefreshBehavior } from './RefreshBehavior';
6
7
  /**
7
8
  * Describes the result of performing some interaction.
8
9
  */
9
- export type Behavior = ActionBehavior | ContainerBehavior | DismissBehavior | LinkBehavior | ModalBehavior;
10
+ export type Behavior = ActionBehavior | ContainerBehavior | DismissBehavior | LinkBehavior | ModalBehavior | RefreshBehavior;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Refreshes the current step with the behavior is triggered
3
+ */
4
+ export type RefreshBehavior = {
5
+ /**
6
+ * It must be `refresh`.
7
+ */
8
+ type: 'refresh';
9
+ };
@@ -50,6 +50,8 @@ export type { ReviewLayout } from './layout/ReviewLayout';
50
50
  export type { ReviewLayoutCallToAction } from './layout/ReviewLayoutCallToAction';
51
51
  export type { ReviewLayoutField } from './layout/ReviewLayoutField';
52
52
  export type { SearchLayout } from './layout/SearchLayout';
53
+ export type { SectionLayout } from './layout/SectionLayout';
54
+ export type { SectionLayoutCallToAction } from './layout/SectionLayoutCallToAction';
53
55
  export type { StatusListLayout } from './layout/StatusListLayout';
54
56
  export type { StatusListLayoutItem } from './layout/StatusListLayoutItem';
55
57
  export type { StatusListLayoutStatus } from './layout/StatusListLayoutStatus';
@@ -16,8 +16,9 @@ import type { ModalLayout } from './ModalLayout';
16
16
  import type { ParagraphLayout } from './ParagraphLayout';
17
17
  import type { ReviewLayout } from './ReviewLayout';
18
18
  import type { SearchLayout } from './SearchLayout';
19
+ import type { SectionLayout } from './SectionLayout';
19
20
  import type { StatusListLayout } from './StatusListLayout';
20
21
  /**
21
22
  * Layouts allow you to display information to the user and customise how a step is structured.
22
23
  */
23
- export type Layout = AlertLayout | BoxLayout | ButtonLayout | ColumnsLayout | DecisionLayout | DividerLayout | FormLayout | HeadingLayout | ImageLayout | InfoLayout | InstructionsLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | ModalLayout | ParagraphLayout | ReviewLayout | SearchLayout | StatusListLayout;
24
+ export type Layout = AlertLayout | BoxLayout | ButtonLayout | ColumnsLayout | DecisionLayout | DividerLayout | FormLayout | HeadingLayout | ImageLayout | InfoLayout | InstructionsLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | ModalLayout | ParagraphLayout | ReviewLayout | SearchLayout | SectionLayout | StatusListLayout;
@@ -0,0 +1,32 @@
1
+ import type { Layout } from './Layout';
2
+ import type { SectionLayoutCallToAction } from './SectionLayoutCallToAction';
3
+ import type { Size } from '../misc/Size';
4
+ /**
5
+ * A container for a group of layout components topped with a section header.
6
+ */
7
+ export type SectionLayout = {
8
+ /**
9
+ * It must be 'section'.
10
+ */
11
+ type: 'section';
12
+ /**
13
+ * The contained components.
14
+ */
15
+ components: Layout[];
16
+ /**
17
+ * The user-facing title.
18
+ */
19
+ title: string;
20
+ /**
21
+ * A titled call to action which can be performed by the user.
22
+ */
23
+ callToAction?: SectionLayoutCallToAction;
24
+ /**
25
+ * Specify a particular control to use to represent the layout. If the control is unknown, it will be ignored.
26
+ */
27
+ control?: string;
28
+ /**
29
+ * The vertical margin to apply after this component. Defaults to `md`.
30
+ */
31
+ margin?: Size;
32
+ };
@@ -0,0 +1,18 @@
1
+ import type { Behavior } from '../feature/Behavior';
2
+ /**
3
+ * The call to action configuration used by [com.wise.dynamicflow.layout.SectionLayout].
4
+ */
5
+ export type SectionLayoutCallToAction = {
6
+ /**
7
+ * A user-facing title.
8
+ */
9
+ title: string;
10
+ /**
11
+ * A description of the call to action to be used by screen readers.
12
+ */
13
+ accessibilityDescription?: string;
14
+ /**
15
+ * Behavior that should be performed when user interacts with call to action.
16
+ */
17
+ behavior: Behavior;
18
+ };
@@ -5,6 +5,7 @@ import type { PersistAsync } from '../feature/PersistAsync';
5
5
  import type { ValidateAsync } from '../feature/ValidateAsync';
6
6
  import type { AlertLayout } from '../layout/AlertLayout';
7
7
  import type { Help } from '../feature/Help';
8
+ import type { Behavior } from '../feature/Behavior';
8
9
  /**
9
10
  * Represents a boolean value in the submission.
10
11
  * The submission value is either `true` or `false`, defaulting to `false`.
@@ -129,4 +130,8 @@ export type BooleanSchema = {
129
130
  * Provide additional help information to the user.
130
131
  */
131
132
  help?: Help;
133
+ /**
134
+ * The [com.wise.dynamicflow.feature.Behavior] that should be performed when the schema value changes.
135
+ */
136
+ onChange?: Behavior;
132
137
  };
@@ -6,6 +6,7 @@ import type { ValidateAsync } from '../feature/ValidateAsync';
6
6
  import type { AlertLayout } from '../layout/AlertLayout';
7
7
  import type { AutocompleteToken } from '../misc/AutocompleteToken';
8
8
  import type { Help } from '../feature/Help';
9
+ import type { Behavior } from '../feature/Behavior';
9
10
  /**
10
11
  * Represents a numeric value which must be a whole number. For floating point numbers, use a [NumberSchema] instead.
11
12
  * When not provided, the submission value is `null`.
@@ -155,4 +156,8 @@ export type IntegerSchema = {
155
156
  * Provide additional help information to the user.
156
157
  */
157
158
  help?: Help;
159
+ /**
160
+ * The [com.wise.dynamicflow.feature.Behavior] that should be performed when the schema value changes.
161
+ */
162
+ onChange?: Behavior;
158
163
  };
@@ -6,6 +6,7 @@ import type { ValidateAsync } from '../feature/ValidateAsync';
6
6
  import type { AlertLayout } from '../layout/AlertLayout';
7
7
  import type { AutocompleteToken } from '../misc/AutocompleteToken';
8
8
  import type { Help } from '../feature/Help';
9
+ import type { Behavior } from '../feature/Behavior';
9
10
  /**
10
11
  * Represents any numeric value - either an integer or a floating point number.
11
12
  * If the value should always be an integer, consider using an [IntegerSchema] instead.
@@ -156,4 +157,8 @@ export type NumberSchema = {
156
157
  * Provide additional help information to the user.
157
158
  */
158
159
  help?: Help;
160
+ /**
161
+ * The [com.wise.dynamicflow.feature.Behavior] that should be performed when the schema value changes.
162
+ */
163
+ onChange?: Behavior;
159
164
  };
@@ -6,6 +6,7 @@ import type { SummaryProvider } from '../feature/SummaryProvider';
6
6
  import type { AlertLayout } from '../layout/AlertLayout';
7
7
  import type { Help } from '../feature/Help';
8
8
  import type { AutocompleteToken } from '../misc/AutocompleteToken';
9
+ import type { Behavior } from '../feature/Behavior';
9
10
  /**
10
11
  * Offers a choice between a number of child schemas.
11
12
  * Use a oneOf schema to represent either the selection of one of many constant values (e.g. a select box or dropdown)
@@ -209,4 +210,8 @@ export type OneOfSchema = {
209
210
  * Defaults to false.
210
211
  */
211
212
  disabled?: boolean;
213
+ /**
214
+ * The [com.wise.dynamicflow.feature.Behavior] that should be performed when the schema value changes.
215
+ */
216
+ onChange?: Behavior;
212
217
  };
@@ -11,6 +11,7 @@ import type { UploadSource } from '../feature/UploadSource';
11
11
  import type { AutocompleteToken } from '../misc/AutocompleteToken';
12
12
  import type { Help } from '../feature/Help';
13
13
  import type { Suggestions } from '../feature/Suggestions';
14
+ import type { Behavior } from '../feature/Behavior';
14
15
  /**
15
16
  * Represents a string value in the submission.
16
17
  * This could be used for standard text input, or a format can be provided
@@ -220,4 +221,8 @@ export type StringSchema = {
220
221
  * @experimental This feature may be changed in the future without notice.
221
222
  */
222
223
  suggestions?: Suggestions;
224
+ /**
225
+ * The [com.wise.dynamicflow.feature.Behavior] that should be performed when the schema value changes.
226
+ */
227
+ onChange?: Behavior;
223
228
  };
@@ -1,3 +1,4 @@
1
+ import { CallToAction } from './CallToAction';
1
2
  import { Context, Margin } from './constants';
2
3
  import { BaseRendererProps } from './RendererProps';
3
4
  export type AlertRendererProps = BaseRendererProps & {
@@ -6,15 +7,5 @@ export type AlertRendererProps = BaseRendererProps & {
6
7
  context: Context;
7
8
  margin: Margin;
8
9
  markdown: string;
9
- callToAction?: AlertCallToAction;
10
+ callToAction?: CallToAction;
10
11
  };
11
- export type AlertCallToAction = {
12
- title: string;
13
- accessibilityDescription?: string;
14
- } & ({
15
- type: 'link';
16
- href: string;
17
- } | {
18
- type: 'action' | 'dismiss' | 'modal';
19
- onClick: () => void;
20
- });
@@ -0,0 +1,8 @@
1
+ export type CallToAction = {
2
+ /** @deprecated */
3
+ type: string;
4
+ accessibilityDescription?: string;
5
+ href?: string;
6
+ title: string;
7
+ onClick: () => void;
8
+ };
@@ -1,11 +1,12 @@
1
1
  import { SupportingValues } from '../next';
2
+ import { CallToAction } from './CallToAction';
2
3
  import { Icon } from './Icon';
3
4
  import { Image } from './Image';
4
5
  import { BaseRendererProps } from './RendererProps';
5
6
  import { AdditionalInfo, InlineAlert, Margin } from './constants';
6
7
  export type ListRendererProps = BaseRendererProps & {
7
8
  type: 'list';
8
- callToAction?: ListCallToAction;
9
+ callToAction?: CallToAction;
9
10
  control?: string;
10
11
  items: ListItem[];
11
12
  margin: Margin;
@@ -30,13 +31,3 @@ export type ListItem = {
30
31
  /** @experimental This feature may be changed in the future without notice. */
31
32
  inlineAlert?: InlineAlert;
32
33
  };
33
- export type ListCallToAction = {
34
- accessibilityDescription?: string;
35
- title: string;
36
- onClick: () => void;
37
- } & ({
38
- type: 'action' | 'modal' | 'dismiss';
39
- } | {
40
- type: 'link';
41
- href: string;
42
- });
@@ -1,39 +1,40 @@
1
- import { AlertRendererProps } from './AlertRendererProps';
2
- import { BoxRendererProps } from './BoxRendererProps';
3
- import { ButtonRendererProps } from './ButtonRendererProps';
4
- import { CheckboxInputRendererProps } from './CheckboxInputRendererProps';
5
- import { ColumnsRendererProps } from './ColumnsRendererProps';
6
- import { CoreContainerRendererProps } from './CoreContainerRendererProps';
7
- import { DateInputRendererProps } from './DateInputRendererProps';
8
- import { DecisionRendererProps } from './DecisionRendererProps';
9
- import { DividerRendererProps } from './DividerRendererProps';
10
- import { ExternalConfirmationRendererProps } from './ExternalConfirmationRendererProps';
11
- import { FormRendererProps } from './FormRendererProps';
12
- import { HeadingRendererProps } from './HeadingRendererProps';
13
- import { HiddenRendererProps } from './HiddenRendererProps';
14
- import { ImageRendererProps } from './ImageRendererProps';
15
- import { InstructionsRendererProps } from './InstructionsRendererProps';
16
- import { IntegerInputRendererProps } from './IntegerInputRendererProps';
17
- import { ListRendererProps } from './ListRendererProps';
18
- import { LoadingIndicatorRendererProps } from './LoadingIndicatorRendererProps';
19
- import { MarkdownRendererProps } from './MarkdownRendererProps';
20
- import { ModalContentRendererProps } from './ModalContentRendererProps';
21
- import { ModalRendererProps } from './ModalRendererProps';
22
- import { MultiSelectInputRendererProps } from './MultiSelectInputRendererProps';
23
- import { MultiUploadInputRendererProps } from './MultiUploadInputRendererProps';
24
- import { NumberInputRendererProps } from './NumberInputRendererProps';
25
- import { ParagraphRendererProps } from './ParagraphRendererProps';
26
- import { RepeatableRendererProps } from './RepeatableRendererProps';
27
- import { ReviewRendererProps } from './ReviewRendererProps';
28
- import { RootRendererProps } from './RootRendererProps';
29
- import { SearchRendererProps } from './SearchRendererProps';
30
- import { FormSectionRendererProps } from './FormSectionRendererProps';
31
- import { SelectInputRendererProps } from './SelectInputRendererProps';
32
- import { StatusListRendererProps } from './StatusListRendererProps';
33
- import { AnalyticsEventDispatcher, LoadingState, StepRendererProps } from './StepRendererProps';
34
- import { TextInputRendererProps } from './TextInputRendererProps';
35
- import { UploadInputRendererProps } from './UploadInputRendererProps';
36
- export type RendererProps = AlertRendererProps | CheckboxInputRendererProps | BoxRendererProps | ButtonRendererProps | ColumnsRendererProps | CoreContainerRendererProps | DateInputRendererProps | DecisionRendererProps | DividerRendererProps | ExternalConfirmationRendererProps | FormRendererProps | HeadingRendererProps | HiddenRendererProps | ImageRendererProps | InstructionsRendererProps | IntegerInputRendererProps | ListRendererProps | LoadingIndicatorRendererProps | MarkdownRendererProps | ModalRendererProps | ModalContentRendererProps | MultiSelectInputRendererProps | MultiUploadInputRendererProps | NumberInputRendererProps | ParagraphRendererProps | RepeatableRendererProps | ReviewRendererProps | RootRendererProps | SearchRendererProps | FormSectionRendererProps | SelectInputRendererProps | StatusListRendererProps | StepRendererProps | TextInputRendererProps | UploadInputRendererProps;
1
+ import type { AlertRendererProps } from './AlertRendererProps';
2
+ import type { BoxRendererProps } from './BoxRendererProps';
3
+ import type { ButtonRendererProps } from './ButtonRendererProps';
4
+ import type { CheckboxInputRendererProps } from './CheckboxInputRendererProps';
5
+ import type { ColumnsRendererProps } from './ColumnsRendererProps';
6
+ import type { CoreContainerRendererProps } from './CoreContainerRendererProps';
7
+ import type { DateInputRendererProps } from './DateInputRendererProps';
8
+ import type { DecisionRendererProps } from './DecisionRendererProps';
9
+ import type { DividerRendererProps } from './DividerRendererProps';
10
+ import type { ExternalConfirmationRendererProps } from './ExternalConfirmationRendererProps';
11
+ import type { FormRendererProps } from './FormRendererProps';
12
+ import type { FormSectionRendererProps } from './FormSectionRendererProps';
13
+ import type { HeadingRendererProps } from './HeadingRendererProps';
14
+ import type { HiddenRendererProps } from './HiddenRendererProps';
15
+ import type { ImageRendererProps } from './ImageRendererProps';
16
+ import type { InstructionsRendererProps } from './InstructionsRendererProps';
17
+ import type { IntegerInputRendererProps } from './IntegerInputRendererProps';
18
+ import type { ListRendererProps } from './ListRendererProps';
19
+ import type { LoadingIndicatorRendererProps } from './LoadingIndicatorRendererProps';
20
+ import type { MarkdownRendererProps } from './MarkdownRendererProps';
21
+ import type { ModalContentRendererProps } from './ModalContentRendererProps';
22
+ import type { ModalRendererProps } from './ModalRendererProps';
23
+ import type { MultiSelectInputRendererProps } from './MultiSelectInputRendererProps';
24
+ import type { MultiUploadInputRendererProps } from './MultiUploadInputRendererProps';
25
+ import type { NumberInputRendererProps } from './NumberInputRendererProps';
26
+ import type { ParagraphRendererProps } from './ParagraphRendererProps';
27
+ import type { RepeatableRendererProps } from './RepeatableRendererProps';
28
+ import type { ReviewRendererProps } from './ReviewRendererProps';
29
+ import type { RootRendererProps } from './RootRendererProps';
30
+ import type { SearchRendererProps } from './SearchRendererProps';
31
+ import type { SectionRendererProps } from './SectionRendererProps';
32
+ import type { SelectInputRendererProps } from './SelectInputRendererProps';
33
+ import type { StatusListRendererProps } from './StatusListRendererProps';
34
+ import type { AnalyticsEventDispatcher, LoadingState, StepRendererProps } from './StepRendererProps';
35
+ import type { TextInputRendererProps } from './TextInputRendererProps';
36
+ import type { UploadInputRendererProps } from './UploadInputRendererProps';
37
+ export type RendererProps = AlertRendererProps | CheckboxInputRendererProps | BoxRendererProps | ButtonRendererProps | ColumnsRendererProps | CoreContainerRendererProps | DateInputRendererProps | DecisionRendererProps | DividerRendererProps | ExternalConfirmationRendererProps | FormRendererProps | HeadingRendererProps | HiddenRendererProps | ImageRendererProps | InstructionsRendererProps | IntegerInputRendererProps | ListRendererProps | LoadingIndicatorRendererProps | MarkdownRendererProps | ModalRendererProps | ModalContentRendererProps | MultiSelectInputRendererProps | MultiUploadInputRendererProps | NumberInputRendererProps | ParagraphRendererProps | RepeatableRendererProps | ReviewRendererProps | RootRendererProps | SearchRendererProps | FormSectionRendererProps | SelectInputRendererProps | SectionRendererProps | StatusListRendererProps | StepRendererProps | TextInputRendererProps | UploadInputRendererProps;
37
38
  export type Renderer<P extends RendererProps> = {
38
39
  canRenderType: P['type'];
39
40
  canRender?: (props: P) => boolean;
@@ -43,7 +44,7 @@ export type RendererContext = {
43
44
  render: RenderFunction;
44
45
  };
45
46
  export type RenderFunction = (props: RendererProps | null) => JSX.Element | null;
46
- export type Renderers = readonly (Renderer<StepRendererProps> | Renderer<CoreContainerRendererProps> | Renderer<AlertRendererProps> | Renderer<BoxRendererProps> | Renderer<ColumnsRendererProps> | Renderer<DecisionRendererProps> | Renderer<DividerRendererProps> | Renderer<ExternalConfirmationRendererProps> | Renderer<FormRendererProps> | Renderer<HeadingRendererProps> | Renderer<InstructionsRendererProps> | Renderer<ListRendererProps> | Renderer<LoadingIndicatorRendererProps> | Renderer<MarkdownRendererProps> | Renderer<ImageRendererProps> | Renderer<ModalRendererProps> | Renderer<ModalContentRendererProps> | Renderer<ParagraphRendererProps> | Renderer<ReviewRendererProps> | Renderer<SearchRendererProps> | Renderer<StatusListRendererProps> | Renderer<CheckboxInputRendererProps> | Renderer<ButtonRendererProps> | Renderer<DateInputRendererProps> | Renderer<HiddenRendererProps> | Renderer<IntegerInputRendererProps> | Renderer<NumberInputRendererProps> | Renderer<RepeatableRendererProps> | Renderer<RootRendererProps> | Renderer<FormSectionRendererProps> | Renderer<SelectInputRendererProps> | Renderer<MultiSelectInputRendererProps> | Renderer<TextInputRendererProps> | Renderer<UploadInputRendererProps> | Renderer<MultiUploadInputRendererProps>)[];
47
+ export type Renderers = readonly (Renderer<StepRendererProps> | Renderer<CoreContainerRendererProps> | Renderer<AlertRendererProps> | Renderer<BoxRendererProps> | Renderer<ColumnsRendererProps> | Renderer<DecisionRendererProps> | Renderer<DividerRendererProps> | Renderer<ExternalConfirmationRendererProps> | Renderer<FormRendererProps> | Renderer<HeadingRendererProps> | Renderer<InstructionsRendererProps> | Renderer<ListRendererProps> | Renderer<LoadingIndicatorRendererProps> | Renderer<MarkdownRendererProps> | Renderer<ImageRendererProps> | Renderer<ModalRendererProps> | Renderer<ModalContentRendererProps> | Renderer<ParagraphRendererProps> | Renderer<ReviewRendererProps> | Renderer<SearchRendererProps> | Renderer<StatusListRendererProps> | Renderer<CheckboxInputRendererProps> | Renderer<ButtonRendererProps> | Renderer<DateInputRendererProps> | Renderer<HiddenRendererProps> | Renderer<IntegerInputRendererProps> | Renderer<NumberInputRendererProps> | Renderer<RepeatableRendererProps> | Renderer<RootRendererProps> | Renderer<FormSectionRendererProps> | Renderer<SelectInputRendererProps> | Renderer<SectionRendererProps> | Renderer<MultiSelectInputRendererProps> | Renderer<TextInputRendererProps> | Renderer<UploadInputRendererProps> | Renderer<MultiUploadInputRendererProps>)[];
47
48
  export type BaseRendererProps = {
48
49
  uid: string;
49
50
  render: RenderFunction;
@@ -1,3 +1,4 @@
1
+ import { CallToAction } from './CallToAction';
1
2
  import { AdditionalInfo, InlineAlert, Margin } from './constants';
2
3
  import { Icon } from './Icon';
3
4
  import { Image } from './Image';
@@ -8,7 +9,7 @@ export type ReviewRendererProps = BaseRendererProps & {
8
9
  fields: ReviewField[];
9
10
  margin: Margin;
10
11
  title?: string;
11
- callToAction?: ReviewCallToAction;
12
+ callToAction?: CallToAction;
12
13
  };
13
14
  export type ReviewField = {
14
15
  help?: string;
@@ -21,15 +22,9 @@ export type ReviewField = {
21
22
  /** @experimental This feature may be changed in the future without notice. */
22
23
  inlineAlert?: InlineAlert;
23
24
  /** @experimental This feature may be changed in the future without notice. */
24
- callToAction?: ReviewCallToAction;
25
+ callToAction?: CallToAction;
25
26
  /** @experimental This feature may be changed in the future without notice. */
26
27
  icon?: Icon;
27
28
  /** @experimental This feature may be changed in the future without notice. */
28
29
  image?: Image;
29
30
  };
30
- export type ReviewCallToAction = {
31
- accessibilityDescription?: string;
32
- href?: string;
33
- title: string;
34
- onClick: () => void;
35
- };
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { CallToAction } from './CallToAction';
3
+ import { Margin } from './constants';
4
+ import { BaseRendererProps, RendererProps } from './RendererProps';
5
+ export type SectionRendererProps = BaseRendererProps & {
6
+ type: 'section';
7
+ control?: string;
8
+ title: string;
9
+ children: ReactNode;
10
+ childrenProps: RendererProps[];
11
+ margin: Margin;
12
+ callToAction?: CallToAction;
13
+ };
@@ -1,3 +1,4 @@
1
+ import { CallToAction } from './CallToAction';
1
2
  import { Icon } from './Icon';
2
3
  import { BaseRendererProps } from './RendererProps';
3
4
  import { Margin } from './constants';
@@ -13,13 +14,7 @@ export type StatusListItem = {
13
14
  icon: Icon;
14
15
  status?: 'done' | 'not-done' | 'pending';
15
16
  title: string;
16
- callToAction?: StatusListItemCallToAction;
17
+ callToAction?: CallToAction;
17
18
  tag?: string;
18
19
  };
19
- export type StatusListItemCallToAction = {
20
- accessibilityDescription?: string;
21
- href?: string;
22
- title: string;
23
- onClick: () => void;
24
- };
25
20
  export type StatusListItemStatus = 'done' | 'not-done' | 'pending';