@pushwoosh/smart-components-kit 1.0.35 → 1.0.37

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 */,
package/package.json CHANGED
@@ -51,5 +51,5 @@
51
51
  "engines": {
52
52
  "node": ">= 18"
53
53
  },
54
- "version": "1.0.35"
54
+ "version": "1.0.37"
55
55
  }