@wise/dynamic-flow-types 3.12.0 → 3.13.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
@@ -215,6 +215,9 @@ var instructionsLayoutItemSchema = import_zod.z.object({
215
215
  var modalLayoutTriggerSchema = import_zod.z.object({
216
216
  title: import_zod.z.string()
217
217
  });
218
+ var helpSchema = import_zod.z.object({
219
+ markdown: import_zod.z.string()
220
+ });
218
221
  var searchLayoutSchema = import_zod.z.object({
219
222
  type: import_zod.z.literal("search"),
220
223
  title: import_zod.z.string(),
@@ -264,9 +267,6 @@ var columnsLayoutBiasSchema = import_zod.z.union([
264
267
  import_zod.z.literal("left"),
265
268
  import_zod.z.literal("right")
266
269
  ]);
267
- var helpSchema = import_zod.z.object({
268
- markdown: import_zod.z.string()
269
- });
270
270
  var searchSearchRequestSchema = import_zod.z.object({
271
271
  url: import_zod.z.string(),
272
272
  method: httpMethodSchema,
@@ -364,6 +364,18 @@ var instructionsLayoutSchema = import_zod.z.object({
364
364
  margin: sizeSchema.optional(),
365
365
  analyticsId: import_zod.z.string().optional()
366
366
  });
367
+ var progressLayoutSchema = import_zod.z.object({
368
+ type: import_zod.z.literal("progress"),
369
+ title: import_zod.z.string().optional(),
370
+ description: import_zod.z.string().optional(),
371
+ progress: import_zod.z.number(),
372
+ progressText: import_zod.z.string(),
373
+ context: contextSchema.optional(),
374
+ help: helpSchema.optional(),
375
+ control: import_zod.z.string().optional(),
376
+ margin: sizeSchema.optional(),
377
+ analyticsId: import_zod.z.string().optional()
378
+ });
367
379
  var actionResponseBodySchema = import_zod.z.object({
368
380
  action: actionSchema
369
381
  });
@@ -626,6 +638,7 @@ var layoutSchema = import_zod.z.lazy(
626
638
  markdownLayoutSchema,
627
639
  modalLayoutSchema,
628
640
  paragraphLayoutSchema,
641
+ progressLayoutSchema,
629
642
  reviewLayoutSchema,
630
643
  searchLayoutSchema,
631
644
  sectionLayoutSchema,
@@ -784,8 +797,8 @@ var linkHandlerSchema = import_zod.z.lazy(
784
797
  );
785
798
  var toolbarSchema = import_zod.z.lazy(
786
799
  () => import_zod.z.object({
787
- control: import_zod.z.string().optional(),
788
- items: import_zod.z.array(toolbarItemSchema)
800
+ items: import_zod.z.array(toolbarItemSchema),
801
+ control: import_zod.z.string().optional()
789
802
  })
790
803
  );
791
804
  var allOfSchemaSchema = import_zod.z.lazy(
package/build/main.mjs CHANGED
@@ -187,6 +187,9 @@ var instructionsLayoutItemSchema = z.object({
187
187
  var modalLayoutTriggerSchema = z.object({
188
188
  title: z.string()
189
189
  });
190
+ var helpSchema = z.object({
191
+ markdown: z.string()
192
+ });
190
193
  var searchLayoutSchema = z.object({
191
194
  type: z.literal("search"),
192
195
  title: z.string(),
@@ -236,9 +239,6 @@ var columnsLayoutBiasSchema = z.union([
236
239
  z.literal("left"),
237
240
  z.literal("right")
238
241
  ]);
239
- var helpSchema = z.object({
240
- markdown: z.string()
241
- });
242
242
  var searchSearchRequestSchema = z.object({
243
243
  url: z.string(),
244
244
  method: httpMethodSchema,
@@ -336,6 +336,18 @@ var instructionsLayoutSchema = z.object({
336
336
  margin: sizeSchema.optional(),
337
337
  analyticsId: z.string().optional()
338
338
  });
339
+ var progressLayoutSchema = z.object({
340
+ type: z.literal("progress"),
341
+ title: z.string().optional(),
342
+ description: z.string().optional(),
343
+ progress: z.number(),
344
+ progressText: z.string(),
345
+ context: contextSchema.optional(),
346
+ help: helpSchema.optional(),
347
+ control: z.string().optional(),
348
+ margin: sizeSchema.optional(),
349
+ analyticsId: z.string().optional()
350
+ });
339
351
  var actionResponseBodySchema = z.object({
340
352
  action: actionSchema
341
353
  });
@@ -598,6 +610,7 @@ var layoutSchema = z.lazy(
598
610
  markdownLayoutSchema,
599
611
  modalLayoutSchema,
600
612
  paragraphLayoutSchema,
613
+ progressLayoutSchema,
601
614
  reviewLayoutSchema,
602
615
  searchLayoutSchema,
603
616
  sectionLayoutSchema,
@@ -756,8 +769,8 @@ var linkHandlerSchema = z.lazy(
756
769
  );
757
770
  var toolbarSchema = z.lazy(
758
771
  () => z.object({
759
- control: z.string().optional(),
760
- items: z.array(toolbarItemSchema)
772
+ items: z.array(toolbarItemSchema),
773
+ control: z.string().optional()
761
774
  })
762
775
  );
763
776
  var allOfSchemaSchema = z.lazy(
@@ -1,14 +1,14 @@
1
1
  import type { ToolbarItem } from './ToolbarItem';
2
2
  /**
3
- * `Toolbar` contains an optional array of type `Toolbar.Item` containing items to be displayed in the toolbar.
3
+ * Used to display items in the screen's toolbar, typically a horizontal bar at the top of the screen.
4
4
  */
5
5
  export type Toolbar = {
6
- /**
7
- * Specify a particular control to use to represent the toolbar. If the control is unknown, it will be ignored.
8
- */
9
- control?: string;
10
6
  /**
11
7
  * The items to be displayed in the toolbar.
12
8
  */
13
9
  items: ToolbarItem[];
10
+ /**
11
+ * Specify a particular control to use to represent the toolbar. If the control is unknown, it will be ignored.
12
+ */
13
+ control?: string;
14
14
  };
@@ -48,6 +48,7 @@ export type { ModalLayout } from './layout/ModalLayout';
48
48
  export type { ModalLayoutContent } from './layout/ModalLayoutContent';
49
49
  export type { ModalLayoutTrigger } from './layout/ModalLayoutTrigger';
50
50
  export type { ParagraphLayout } from './layout/ParagraphLayout';
51
+ export type { ProgressLayout } from './layout/ProgressLayout';
51
52
  export type { ReviewLayout } from './layout/ReviewLayout';
52
53
  export type { ReviewLayoutCallToAction } from './layout/ReviewLayoutCallToAction';
53
54
  export type { ReviewLayoutField } from './layout/ReviewLayoutField';
@@ -14,6 +14,7 @@ import type { LoadingIndicatorLayout } from './LoadingIndicatorLayout';
14
14
  import type { MarkdownLayout } from './MarkdownLayout';
15
15
  import type { ModalLayout } from './ModalLayout';
16
16
  import type { ParagraphLayout } from './ParagraphLayout';
17
+ import type { ProgressLayout } from './ProgressLayout';
17
18
  import type { ReviewLayout } from './ReviewLayout';
18
19
  import type { SearchLayout } from './SearchLayout';
19
20
  import type { SectionLayout } from './SectionLayout';
@@ -22,4 +23,4 @@ import type { TabsLayout } from './TabsLayout';
22
23
  /**
23
24
  * Layouts allow you to display information to the user and customise how a step is structured.
24
25
  */
25
- export type Layout = AlertLayout | BoxLayout | ButtonLayout | ColumnsLayout | DecisionLayout | DividerLayout | FormLayout | HeadingLayout | ImageLayout | InfoLayout | InstructionsLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | ModalLayout | ParagraphLayout | ReviewLayout | SearchLayout | SectionLayout | StatusListLayout | TabsLayout;
26
+ export type Layout = AlertLayout | BoxLayout | ButtonLayout | ColumnsLayout | DecisionLayout | DividerLayout | FormLayout | HeadingLayout | ImageLayout | InfoLayout | InstructionsLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | ModalLayout | ParagraphLayout | ProgressLayout | ReviewLayout | SearchLayout | SectionLayout | StatusListLayout | TabsLayout;
@@ -0,0 +1,48 @@
1
+ import type { Context } from '../misc/Context';
2
+ import type { Help } from '../feature/Help';
3
+ import type { Size } from '../misc/Size';
4
+ /**
5
+ * An indicator which can be used to show progress towards a goal or limit.
6
+ */
7
+ export type ProgressLayout = {
8
+ /**
9
+ * It must be `progress`.
10
+ */
11
+ type: 'progress';
12
+ /**
13
+ * The user-facing title of the progress indicator.
14
+ */
15
+ title?: string;
16
+ /**
17
+ * The user-facing description of the progress indicator.
18
+ */
19
+ description?: string;
20
+ /**
21
+ * The progress towards the total, as a float between 0 and 1.
22
+ */
23
+ progress: number;
24
+ /**
25
+ * A text representation of the progress, to be displayed to the user and/or used by assistive technologies (e.g. 5GB remaining or 10/125 cats herded).
26
+ */
27
+ progressText: string;
28
+ /**
29
+ * The sentiment of the progress (e.g. warning can be used to indicate approaching a limit).
30
+ */
31
+ context?: Context;
32
+ /**
33
+ * Provide additional helpful information to the user.
34
+ */
35
+ help?: Help;
36
+ /**
37
+ * Specify a particular control to use to represent the layout. If the control is unknown, it will be ignored.
38
+ */
39
+ control?: string;
40
+ /**
41
+ * The vertical margin to apply after this component. Defaults to `md`.
42
+ */
43
+ margin?: Size;
44
+ /**
45
+ * An optional identifier to be used in analytics tracking.
46
+ */
47
+ analyticsId?: string;
48
+ };
@@ -0,0 +1,13 @@
1
+ import { Context, Margin } from './constants';
2
+ import { BaseRendererProps } from './RendererProps';
3
+ export type ProgressRendererProps = BaseRendererProps & {
4
+ type: 'progress';
5
+ context: Context;
6
+ control?: string;
7
+ description?: string;
8
+ help?: string;
9
+ margin: Margin;
10
+ progress: number;
11
+ progressText: string;
12
+ title?: string;
13
+ };
@@ -24,6 +24,7 @@ import type { MultiSelectInputRendererProps } from './MultiSelectInputRendererPr
24
24
  import type { MultiUploadInputRendererProps } from './MultiUploadInputRendererProps';
25
25
  import type { NumberInputRendererProps } from './NumberInputRendererProps';
26
26
  import type { ParagraphRendererProps } from './ParagraphRendererProps';
27
+ import type { ProgressRendererProps } from './ProgressRendererProps';
27
28
  import type { RepeatableRendererProps } from './RepeatableRendererProps';
28
29
  import type { ReviewRendererProps } from './ReviewRendererProps';
29
30
  import type { RootRendererProps } from './RootRendererProps';
@@ -35,7 +36,7 @@ import type { AnalyticsEventDispatcher, LoadingState, StepRendererProps } from '
35
36
  import { TabsRendererProps } from './TabsRendererProps';
36
37
  import type { TextInputRendererProps } from './TextInputRendererProps';
37
38
  import type { UploadInputRendererProps } from './UploadInputRendererProps';
38
- export type RendererProps = AlertRendererProps | CheckboxInputRendererProps | BoxRendererProps | ButtonRendererProps | ColumnsRendererProps | CoreContainerRendererProps | DateInputRendererProps | DecisionRendererProps | DividerRendererProps | ExternalConfirmationRendererProps | FormRendererProps | HeadingRendererProps | HiddenRendererProps | ImageRendererProps | InstructionsRendererProps | IntegerInputRendererProps | ListRendererProps | LoadingIndicatorRendererProps | MarkdownRendererProps | ModalLayoutRendererProps | ModalRendererProps | MultiSelectInputRendererProps | MultiUploadInputRendererProps | NumberInputRendererProps | ParagraphRendererProps | RepeatableRendererProps | ReviewRendererProps | RootRendererProps | SearchRendererProps | FormSectionRendererProps | SelectInputRendererProps | SectionRendererProps | StatusListRendererProps | StepRendererProps | TabsRendererProps | TextInputRendererProps | UploadInputRendererProps;
39
+ export type RendererProps = AlertRendererProps | CheckboxInputRendererProps | BoxRendererProps | ButtonRendererProps | ColumnsRendererProps | CoreContainerRendererProps | DateInputRendererProps | DecisionRendererProps | DividerRendererProps | ExternalConfirmationRendererProps | FormRendererProps | HeadingRendererProps | HiddenRendererProps | ImageRendererProps | InstructionsRendererProps | IntegerInputRendererProps | ListRendererProps | LoadingIndicatorRendererProps | MarkdownRendererProps | ModalLayoutRendererProps | ModalRendererProps | MultiSelectInputRendererProps | MultiUploadInputRendererProps | NumberInputRendererProps | ParagraphRendererProps | ProgressRendererProps | RepeatableRendererProps | ReviewRendererProps | RootRendererProps | SearchRendererProps | FormSectionRendererProps | SelectInputRendererProps | SectionRendererProps | StatusListRendererProps | StepRendererProps | TabsRendererProps | TextInputRendererProps | UploadInputRendererProps;
39
40
  export type Renderer<P extends RendererProps> = {
40
41
  canRenderType: P['type'];
41
42
  canRender?: (props: P) => boolean;
@@ -45,7 +46,7 @@ export type RendererContext = {
45
46
  render: RenderFunction;
46
47
  };
47
48
  export type RenderFunction = (props: RendererProps | null) => JSX.Element | null;
48
- 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<ModalLayoutRendererProps> | Renderer<ModalRendererProps> | 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<TabsRendererProps> | Renderer<TextInputRendererProps> | Renderer<UploadInputRendererProps> | Renderer<MultiUploadInputRendererProps>)[];
49
+ 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<ModalLayoutRendererProps> | Renderer<ModalRendererProps> | Renderer<ParagraphRendererProps> | Renderer<ProgressRendererProps> | 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<TabsRendererProps> | Renderer<TextInputRendererProps> | Renderer<UploadInputRendererProps> | Renderer<MultiUploadInputRendererProps>)[];
49
50
  export type BaseRendererProps = {
50
51
  uid: string;
51
52
  analyticsId?: string;
@@ -25,6 +25,7 @@ export type { MultiSelectInputRendererProps } from './MultiSelectInputRendererPr
25
25
  export type { MultiUploadInputRendererProps } from './MultiUploadInputRendererProps';
26
26
  export type { NumberInputRendererProps } from './NumberInputRendererProps';
27
27
  export type { ParagraphRendererProps } from './ParagraphRendererProps';
28
+ export type { ProgressRendererProps } from './ProgressRendererProps';
28
29
  export type { RepeatableItemRendererProps, RepeatableRendererProps, } from './RepeatableRendererProps';
29
30
  export type { ReviewField, ReviewRendererProps } from './ReviewRendererProps';
30
31
  export type { RootRendererProps } from './RootRendererProps';
@@ -256,6 +256,13 @@ export declare const modalLayoutTriggerSchema: z.ZodObject<{
256
256
  }, {
257
257
  title: string;
258
258
  }>;
259
+ export declare const helpSchema: z.ZodObject<{
260
+ markdown: z.ZodString;
261
+ }, "strip", z.ZodTypeAny, {
262
+ markdown: string;
263
+ }, {
264
+ markdown: string;
265
+ }>;
259
266
  export declare const searchLayoutSchema: z.ZodObject<{
260
267
  type: z.ZodLiteral<"search">;
261
268
  title: z.ZodString;
@@ -389,13 +396,6 @@ export declare const markdownLayoutSchema: z.ZodObject<{
389
396
  align?: "left" | "right" | "center" | undefined;
390
397
  }>;
391
398
  export declare const columnsLayoutBiasSchema: z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"left">, z.ZodLiteral<"right">]>;
392
- export declare const helpSchema: z.ZodObject<{
393
- markdown: z.ZodString;
394
- }, "strip", z.ZodTypeAny, {
395
- markdown: string;
396
- }, {
397
- markdown: string;
398
- }>;
399
399
  export declare const searchSearchRequestSchema: z.ZodObject<{
400
400
  url: z.ZodString;
401
401
  method: z.ZodUnion<[z.ZodLiteral<"GET">, z.ZodLiteral<"POST">, z.ZodLiteral<"PUT">, z.ZodLiteral<"PATCH">, z.ZodLiteral<"DELETE">]>;
@@ -622,6 +622,50 @@ export declare const instructionsLayoutSchema: z.ZodObject<{
622
622
  control?: string | undefined;
623
623
  margin?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
624
624
  }>;
625
+ export declare const progressLayoutSchema: z.ZodObject<{
626
+ type: z.ZodLiteral<"progress">;
627
+ title: z.ZodOptional<z.ZodString>;
628
+ description: z.ZodOptional<z.ZodString>;
629
+ progress: z.ZodNumber;
630
+ progressText: z.ZodString;
631
+ context: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"positive">, z.ZodLiteral<"neutral">, z.ZodLiteral<"warning">, z.ZodLiteral<"negative">, z.ZodLiteral<"success">, z.ZodLiteral<"failure">, z.ZodLiteral<"info">, z.ZodLiteral<"primary">]>>;
632
+ help: z.ZodOptional<z.ZodObject<{
633
+ markdown: z.ZodString;
634
+ }, "strip", z.ZodTypeAny, {
635
+ markdown: string;
636
+ }, {
637
+ markdown: string;
638
+ }>>;
639
+ control: z.ZodOptional<z.ZodString>;
640
+ margin: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"xs">, z.ZodLiteral<"sm">, z.ZodLiteral<"md">, z.ZodLiteral<"lg">, z.ZodLiteral<"xl">]>>;
641
+ analyticsId: z.ZodOptional<z.ZodString>;
642
+ }, "strip", z.ZodTypeAny, {
643
+ type: "progress";
644
+ progress: number;
645
+ progressText: string;
646
+ analyticsId?: string | undefined;
647
+ description?: string | undefined;
648
+ help?: {
649
+ markdown: string;
650
+ } | undefined;
651
+ title?: string | undefined;
652
+ control?: string | undefined;
653
+ context?: "neutral" | "warning" | "positive" | "negative" | "success" | "failure" | "info" | "primary" | undefined;
654
+ margin?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
655
+ }, {
656
+ type: "progress";
657
+ progress: number;
658
+ progressText: string;
659
+ analyticsId?: string | undefined;
660
+ description?: string | undefined;
661
+ help?: {
662
+ markdown: string;
663
+ } | undefined;
664
+ title?: string | undefined;
665
+ control?: string | undefined;
666
+ context?: "neutral" | "warning" | "positive" | "negative" | "success" | "failure" | "info" | "primary" | undefined;
667
+ margin?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
668
+ }>;
625
669
  export declare const actionResponseBodySchema: z.ZodObject<{
626
670
  action: z.ZodObject<{
627
671
  title: z.ZodOptional<z.ZodString>;
@@ -328,6 +328,19 @@ export const markdownLayoutSchema = z.object({
328
328
  analyticsId: z.string().optional(),
329
329
  });
330
330
 
331
+ export const progressLayoutSchema = z.object({
332
+ type: z.literal('progress'),
333
+ title: z.string().optional(),
334
+ description: z.string().optional(),
335
+ progress: z.number(),
336
+ progressText: z.string(),
337
+ context: contextSchema.optional(),
338
+ help: helpSchema.optional(),
339
+ control: z.string().optional(),
340
+ margin: sizeSchema.optional(),
341
+ analyticsId: z.string().optional(),
342
+ });
343
+
331
344
  export const searchLayoutSchema = z.object({
332
345
  type: z.literal('search'),
333
346
  title: z.string(),
@@ -938,6 +951,7 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
938
951
  markdownLayoutSchema,
939
952
  modalLayoutSchema,
940
953
  paragraphLayoutSchema,
954
+ progressLayoutSchema,
941
955
  reviewLayoutSchema,
942
956
  searchLayoutSchema,
943
957
  sectionLayoutSchema,
@@ -964,8 +978,8 @@ export const toolbarButtonSchema: z.ZodSchema<ToolbarButton> = z.lazy(() =>
964
978
 
965
979
  export const toolbarSchema: z.ZodSchema<Toolbar> = z.lazy(() =>
966
980
  z.object({
967
- control: z.string().optional(),
968
981
  items: z.array(toolbarItemSchema),
982
+ control: z.string().optional(),
969
983
  }),
970
984
  );
971
985
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-types",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "Dynamic Flow TypeScript Types",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {