@wise/dynamic-flow-types 3.3.5 → 3.4.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
@@ -495,6 +495,13 @@ var decisionLayoutOptionSchema = import_zod.z.lazy(
495
495
  inlineAlert: inlineAlertSchema.optional()
496
496
  })
497
497
  );
498
+ var sectionLayoutCallToActionSchema = import_zod.z.lazy(
499
+ () => import_zod.z.object({
500
+ title: import_zod.z.string(),
501
+ accessibilityDescription: import_zod.z.string().optional(),
502
+ behavior: behaviorSchema
503
+ })
504
+ );
498
505
  var statusListLayoutSchema = import_zod.z.lazy(
499
506
  () => import_zod.z.object({
500
507
  type: import_zod.z.literal("status-list"),
@@ -514,11 +521,14 @@ var statusListLayoutItemSchema = import_zod.z.lazy(
514
521
  tag: import_zod.z.string().optional()
515
522
  })
516
523
  );
517
- var itemCallToActionSchema = import_zod.z.lazy(
524
+ var sectionLayoutSchema = import_zod.z.lazy(
518
525
  () => import_zod.z.object({
526
+ type: import_zod.z.literal("section"),
527
+ components: import_zod.z.array(layoutSchema),
519
528
  title: import_zod.z.string(),
520
- accessibilityDescription: import_zod.z.string().optional(),
521
- behavior: behaviorSchema
529
+ callToAction: sectionLayoutCallToActionSchema.optional(),
530
+ control: import_zod.z.string().optional(),
531
+ margin: sizeSchema.optional()
522
532
  })
523
533
  );
524
534
  var layoutSchema = import_zod.z.lazy(
@@ -541,9 +551,17 @@ var layoutSchema = import_zod.z.lazy(
541
551
  paragraphLayoutSchema,
542
552
  reviewLayoutSchema,
543
553
  searchLayoutSchema,
554
+ sectionLayoutSchema,
544
555
  statusListLayoutSchema
545
556
  ])
546
557
  );
558
+ var itemCallToActionSchema = import_zod.z.lazy(
559
+ () => import_zod.z.object({
560
+ title: import_zod.z.string(),
561
+ accessibilityDescription: import_zod.z.string().optional(),
562
+ behavior: behaviorSchema
563
+ })
564
+ );
547
565
  var boxLayoutSchema = import_zod.z.lazy(
548
566
  () => import_zod.z.object({
549
567
  type: import_zod.z.literal("box"),
package/build/main.mjs CHANGED
@@ -467,6 +467,13 @@ var decisionLayoutOptionSchema = z.lazy(
467
467
  inlineAlert: inlineAlertSchema.optional()
468
468
  })
469
469
  );
470
+ var sectionLayoutCallToActionSchema = z.lazy(
471
+ () => z.object({
472
+ title: z.string(),
473
+ accessibilityDescription: z.string().optional(),
474
+ behavior: behaviorSchema
475
+ })
476
+ );
470
477
  var statusListLayoutSchema = z.lazy(
471
478
  () => z.object({
472
479
  type: z.literal("status-list"),
@@ -486,11 +493,14 @@ var statusListLayoutItemSchema = z.lazy(
486
493
  tag: z.string().optional()
487
494
  })
488
495
  );
489
- var itemCallToActionSchema = z.lazy(
496
+ var sectionLayoutSchema = z.lazy(
490
497
  () => z.object({
498
+ type: z.literal("section"),
499
+ components: z.array(layoutSchema),
491
500
  title: z.string(),
492
- accessibilityDescription: z.string().optional(),
493
- behavior: behaviorSchema
501
+ callToAction: sectionLayoutCallToActionSchema.optional(),
502
+ control: z.string().optional(),
503
+ margin: sizeSchema.optional()
494
504
  })
495
505
  );
496
506
  var layoutSchema = z.lazy(
@@ -513,9 +523,17 @@ var layoutSchema = z.lazy(
513
523
  paragraphLayoutSchema,
514
524
  reviewLayoutSchema,
515
525
  searchLayoutSchema,
526
+ sectionLayoutSchema,
516
527
  statusListLayoutSchema
517
528
  ])
518
529
  );
530
+ var itemCallToActionSchema = z.lazy(
531
+ () => z.object({
532
+ title: z.string(),
533
+ accessibilityDescription: z.string().optional(),
534
+ behavior: behaviorSchema
535
+ })
536
+ );
519
537
  var boxLayoutSchema = z.lazy(
520
538
  () => z.object({
521
539
  type: z.literal("box"),
@@ -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
+ };
@@ -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';
@@ -1,4 +1,5 @@
1
- export type { AlertCallToAction, AlertRendererProps } from './AlertRendererProps';
1
+ import type { CallToAction } from './CallToAction';
2
+ export type { AlertRendererProps } from './AlertRendererProps';
2
3
  export type { BoxRendererProps } from './BoxRendererProps';
3
4
  export type { ButtonRendererProps } from './ButtonRendererProps';
4
5
  export type { CheckboxInputRendererProps } from './CheckboxInputRendererProps';
@@ -9,6 +10,7 @@ export type { DecisionOption, DecisionRendererProps } from './DecisionRendererPr
9
10
  export type { DividerRendererProps } from './DividerRendererProps';
10
11
  export type { ExternalConfirmationRendererProps } from './ExternalConfirmationRendererProps';
11
12
  export type { FormRendererProps } from './FormRendererProps';
13
+ export type { FormSectionRendererProps } from './FormSectionRendererProps';
12
14
  export type { HeadingRendererProps } from './HeadingRendererProps';
13
15
  export type { HiddenRendererProps } from './HiddenRendererProps';
14
16
  export type { ImageRendererProps } from './ImageRendererProps';
@@ -23,14 +25,14 @@ export type { MultiSelectInputRendererProps } from './MultiSelectInputRendererPr
23
25
  export type { MultiUploadInputRendererProps } from './MultiUploadInputRendererProps';
24
26
  export type { NumberInputRendererProps } from './NumberInputRendererProps';
25
27
  export type { ParagraphRendererProps } from './ParagraphRendererProps';
26
- export type { RepeatableItemRendererProps, RepeatableRendererProps } from './RepeatableRendererProps';
27
- export type { ReviewCallToAction, ReviewField, ReviewRendererProps } from './ReviewRendererProps';
28
+ export type { RepeatableItemRendererProps, RepeatableRendererProps, } from './RepeatableRendererProps';
29
+ export type { ReviewField, ReviewRendererProps } from './ReviewRendererProps';
28
30
  export type { RootRendererProps } from './RootRendererProps';
29
- export type { ErrorSearchState, NoResultsSearchState, PendingSearchState, ResultsSearchState, SearchRendererProps, SearchResult, SearchState } from './SearchRendererProps';
30
- export type { FormSectionRendererProps } from './FormSectionRendererProps';
31
- export type { SelectInputRendererOption, SelectInputRendererProps } from './SelectInputRendererProps';
32
- export type { StatusListItem, StatusListItemCallToAction, StatusListItemStatus, StatusListRendererProps } from './StatusListRendererProps';
33
- export type { AnalyticsEventDispatcher, LoadingState, StepRendererProps } from './StepRendererProps';
31
+ export type { ErrorSearchState, NoResultsSearchState, PendingSearchState, ResultsSearchState, SearchRendererProps, SearchResult, SearchState, } from './SearchRendererProps';
32
+ export type { SectionRendererProps } from './SectionRendererProps';
33
+ export type { SelectInputRendererOption, SelectInputRendererProps, } from './SelectInputRendererProps';
34
+ export type { StatusListItem, StatusListItemStatus, StatusListRendererProps, } from './StatusListRendererProps';
35
+ export type { AnalyticsEventDispatcher, LoadingState, StepRendererProps, } from './StepRendererProps';
34
36
  export type { TextInputRendererProps } from './TextInputRendererProps';
35
37
  export type { UploadInputRendererProps } from './UploadInputRendererProps';
36
38
  export type { ValidationResult } from './BaseInputRendererProps';
@@ -38,3 +40,10 @@ export type { Align, Context, Margin, Size } from './constants';
38
40
  export type { Icon } from './Icon';
39
41
  export type { Image } from './Image';
40
42
  export type { Renderer, RendererProps, Renderers, RenderFunction } from './RendererProps';
43
+ export type { CallToAction } from './CallToAction';
44
+ /** @deprecated Please use `CallToAction` instead. */
45
+ export type AlertCallToAction = CallToAction;
46
+ /** @deprecated Please use `CallToAction` instead. */
47
+ export type ReviewCallToAction = CallToAction;
48
+ /** @deprecated Please use `CallToAction` instead. */
49
+ export type StatusListItemCallToAction = CallToAction;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { JsonElement, AdditionalInfo, Behavior, ReviewLayoutCallToAction, AlertLayout, AlertLayoutCallToAction, ListLayout, ListLayoutCallToAction, ListLayoutItem, DecisionLayout, DecisionLayoutOption, StatusListLayout, StatusListLayoutItem, ItemCallToAction, Layout, BoxLayout, ButtonLayout, ColumnsLayout, ModalLayout, ReviewLayout, ReviewLayoutField, ModalLayoutContent, ModalResponseBody, Step, Schema, Polling, LinkHandler, AllOfSchema, ArraySchema, BlobSchema, BooleanSchema, ConstSchema, IntegerSchema, NumberSchema, ObjectSchema, OneOfSchema, StringSchema, ArraySchemaList, PersistAsync, ArraySchemaTuple, PollingOnError, ModalBehavior } from '../next';
2
+ import type { JsonElement, AdditionalInfo, Behavior, ReviewLayoutCallToAction, AlertLayout, AlertLayoutCallToAction, ListLayout, ListLayoutCallToAction, ListLayoutItem, DecisionLayout, DecisionLayoutOption, SectionLayoutCallToAction, StatusListLayout, StatusListLayoutItem, SectionLayout, Layout, ItemCallToAction, BoxLayout, ButtonLayout, ColumnsLayout, ModalLayout, ReviewLayout, ReviewLayoutField, ModalLayoutContent, ModalResponseBody, Step, Schema, Polling, LinkHandler, AllOfSchema, ArraySchema, BlobSchema, BooleanSchema, ConstSchema, IntegerSchema, NumberSchema, ObjectSchema, OneOfSchema, StringSchema, ArraySchemaList, PersistAsync, ArraySchemaTuple, PollingOnError, ModalBehavior } from '../next';
3
3
  export declare const imageSchema: z.ZodObject<{
4
4
  text: z.ZodOptional<z.ZodString>;
5
5
  url: z.ZodOptional<z.ZodString>;
@@ -2213,10 +2213,12 @@ export declare const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToA
2213
2213
  export declare const listLayoutItemSchema: z.ZodSchema<ListLayoutItem>;
2214
2214
  export declare const decisionLayoutSchema: z.ZodSchema<DecisionLayout>;
2215
2215
  export declare const decisionLayoutOptionSchema: z.ZodSchema<DecisionLayoutOption>;
2216
+ export declare const sectionLayoutCallToActionSchema: z.ZodSchema<SectionLayoutCallToAction>;
2216
2217
  export declare const statusListLayoutSchema: z.ZodSchema<StatusListLayout>;
2217
2218
  export declare const statusListLayoutItemSchema: z.ZodSchema<StatusListLayoutItem>;
2218
- export declare const itemCallToActionSchema: z.ZodSchema<ItemCallToAction>;
2219
+ export declare const sectionLayoutSchema: z.ZodSchema<SectionLayout>;
2219
2220
  export declare const layoutSchema: z.ZodSchema<Layout>;
2221
+ export declare const itemCallToActionSchema: z.ZodSchema<ItemCallToAction>;
2220
2222
  export declare const boxLayoutSchema: z.ZodSchema<BoxLayout>;
2221
2223
  export declare const buttonLayoutSchema: z.ZodSchema<ButtonLayout>;
2222
2224
  export declare const columnsLayoutSchema: z.ZodSchema<ColumnsLayout>;
@@ -29,6 +29,8 @@ import type {
29
29
  DecisionLayout,
30
30
  DecisionLayoutOption,
31
31
  ColumnsLayout,
32
+ SectionLayout,
33
+ SectionLayoutCallToAction,
32
34
  ListLayout,
33
35
  ListLayoutCallToAction,
34
36
  ReviewLayoutCallToAction,
@@ -849,6 +851,7 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
849
851
  paragraphLayoutSchema,
850
852
  reviewLayoutSchema,
851
853
  searchLayoutSchema,
854
+ sectionLayoutSchema,
852
855
  statusListLayoutSchema,
853
856
  ]),
854
857
  );
@@ -963,6 +966,25 @@ export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
963
966
  }),
964
967
  );
965
968
 
969
+ export const sectionLayoutSchema: z.ZodSchema<SectionLayout> = z.lazy(() =>
970
+ z.object({
971
+ type: z.literal('section'),
972
+ components: z.array(layoutSchema),
973
+ title: z.string(),
974
+ callToAction: sectionLayoutCallToActionSchema.optional(),
975
+ control: z.string().optional(),
976
+ margin: sizeSchema.optional(),
977
+ }),
978
+ );
979
+
980
+ export const sectionLayoutCallToActionSchema: z.ZodSchema<SectionLayoutCallToAction> = z.lazy(() =>
981
+ z.object({
982
+ title: z.string(),
983
+ accessibilityDescription: z.string().optional(),
984
+ behavior: behaviorSchema,
985
+ }),
986
+ );
987
+
966
988
  export const listLayoutSchema: z.ZodSchema<ListLayout> = z.lazy(() =>
967
989
  z.object({
968
990
  type: z.literal('list'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-types",
3
- "version": "3.3.5",
3
+ "version": "3.4.0",
4
4
  "description": "Dynamic Flow TypeScript Types",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {