@pushwoosh/smart-components-kit 1.0.34 → 1.0.36

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.
@@ -7,6 +7,7 @@ type DynamicContentPickerProps = {
7
7
  text: string;
8
8
  title?: string;
9
9
  initState?: State;
10
+ error?: ReactNode;
10
11
  renderDynamicContent?: (props: RenderDynamicContentProps) => ReactNode;
11
12
  };
12
13
  export declare const DynamicContentPicker: FC<DynamicContentPickerProps>;
@@ -1,6 +1,8 @@
1
1
  import { arrow, autoPlacement, offset, useFloating } from '@floating-ui/react-dom';
2
2
  import React, { useMemo, useReducer, useRef, useState } from 'react';
3
+ import { Color } from '@pushwoosh/kit-constants';
3
4
  import { Horizontal } from '@pushwoosh/kit-helpers';
5
+ import { WarningRoundIcon } from '@pushwoosh/kit-icons';
4
6
  import { Text } from '@pushwoosh/kit-typography';
5
7
  import { Arrow, FieldPlace, TextPlace } from './styled';
6
8
  import { VariedDynamicContentPickerFormSmart } from '../DynamicContentPickerForm/VariedDynamicContentPickerFormSmart';
@@ -24,6 +26,7 @@ export const DynamicContentPicker = ({
24
26
  text,
25
27
  title,
26
28
  initState,
29
+ error,
27
30
  renderDynamicContent
28
31
  }) => {
29
32
  var _middlewareData$arrow, _middlewareData$arrow2;
@@ -60,10 +63,21 @@ export const DynamicContentPicker = ({
60
63
  return React.createElement(React.Fragment, null, React.createElement(FieldPlace, {
61
64
  ref: refs.setReference
62
65
  }, React.createElement(Horizontal, {
63
- "$padding": "8px 16px"
66
+ "$padding": "8px 16px",
67
+ "$justifyContent": "space-between"
64
68
  }, React.createElement(Text, {
65
69
  "$variant": "h4"
66
- }, title)), React.createElement(Horizontal, {
70
+ }, title), error && React.createElement(Horizontal, {
71
+ "$alignItems": "center",
72
+ "$gap": 8
73
+ }, React.createElement(WarningRoundIcon, {
74
+ size: "small",
75
+ view: "lined",
76
+ color: Color.WARNING
77
+ }), React.createElement(Text, {
78
+ "$variant": "footnote",
79
+ color: Color.WARNING
80
+ }, error))), React.createElement(Horizontal, {
67
81
  "$padding": "12px 16px"
68
82
  }, React.createElement(TextPlace, null, parsedLines.map((line, index) => React.createElement(Line, {
69
83
  key: index /* eslint-disable-line react/no-array-index-key */,
@@ -13,6 +13,7 @@ type ExportCsvBannerProps = {
13
13
  updateExportTask: (exportTask: Partial<ExportTask>) => void;
14
14
  showLastExportLocalStorageKey?: string;
15
15
  lastTasksParams?: GetLastTasksRequest;
16
+ isKeepPageOpenWarning?: boolean;
16
17
  };
17
- export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, }: ExportCsvBannerProps) => React.JSX.Element | null;
18
+ export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, isKeepPageOpenWarning, }: ExportCsvBannerProps) => React.JSX.Element | null;
18
19
  export {};
@@ -3,13 +3,15 @@ import { ExportResult, ProgressBar, Button } from '@pushwoosh/dumb-components';
3
3
  import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
4
4
  import { Horizontal } from '@pushwoosh/kit-helpers';
5
5
  import { DangerTriangleIcon, DownloadIcon } from '@pushwoosh/kit-icons';
6
+ import { Text } from '@pushwoosh/kit-typography';
6
7
  import { useExportService } from '../useExportService';
7
8
  import { useExportVisibility } from './hooks/useExportVisibility';
8
9
  export const ExportCsvBanner = ({
9
10
  exportTask,
10
11
  updateExportTask,
11
12
  showLastExportLocalStorageKey,
12
- lastTasksParams
13
+ lastTasksParams,
14
+ isKeepPageOpenWarning
13
15
  }) => {
14
16
  const {
15
17
  getLastTasks,
@@ -105,10 +107,18 @@ export const ExportCsvBanner = ({
105
107
  view: "filled"
106
108
  })
107
109
  }, "Download CSV"))
108
- }), status === 'STATUS_PENDING' && React.createElement(ProgressBar, {
110
+ }), status === 'STATUS_PENDING' && (isKeepPageOpenWarning ? React.createElement(ProgressBar, {
111
+ title: progressTitle,
112
+ percentValue: progress,
113
+ rightSlot: React.createElement(Text, {
114
+ "$color": Color.WARNING,
115
+ "$variant": "h5",
116
+ "$uppercase": true
117
+ }, "Keep page open during export")
118
+ }) : React.createElement(ProgressBar, {
109
119
  title: progressTitle,
110
120
  percentValue: progress
111
- }), status === 'STATUS_FAILED' && React.createElement(ExportResult, {
121
+ })), status === 'STATUS_FAILED' && React.createElement(ExportResult, {
112
122
  type: "error",
113
123
  title: "Export failed",
114
124
  subtitle: "Please try again",
package/package.json CHANGED
@@ -51,5 +51,5 @@
51
51
  "engines": {
52
52
  "node": ">= 18"
53
53
  },
54
- "version": "1.0.34"
54
+ "version": "1.0.36"
55
55
  }