flipper-ui 0.26.20 → 0.26.22

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/core/PinInput.js CHANGED
@@ -58,7 +58,7 @@ var PinInput = function PinInput(_ref) {
58
58
  }, [isValidating]);
59
59
  var onPaste = function onPaste(event) {
60
60
  var pastedValue = event.clipboardData.getData('text/plain');
61
- var splitValues = pastedValue.split('');
61
+ var splitValues = pastedValue.trim().split('');
62
62
  var intValues = [];
63
63
  var _iterator = _createForOfIteratorHelper(splitValues),
64
64
  _step;
@@ -9,6 +9,27 @@ import { PropWithDataCy } from '../types';
9
9
  * @interface IStepCardProps
10
10
  */
11
11
  export interface IStepCardProps {
12
+ /**
13
+ * Whether the step card expansion panel is initially expanded or not
14
+ * @type {boolean}
15
+ * @memberof IStepCardProps
16
+ * @default undefined
17
+ */
18
+ expanded?: boolean;
19
+ /**
20
+ * Callback fired when the expansion state changes
21
+ * @type {(event: React.ChangeEvent<{}>, expanded: boolean) => void}
22
+ * @memberof IStepCardProps
23
+ * @default undefined
24
+ * @example
25
+ * const handleChange = (event: React.ChangeEvent<{}>, expanded: boolean) => {
26
+ * setExpanded(expanded)
27
+ * }
28
+ * <StepCard onChange={handleChange} />
29
+ * @example
30
+ * <StepCard onChange={(event, expanded) => setExpanded(expanded)} />
31
+ */
32
+ onChange?: (event: React.ChangeEvent<Record<string, unknown>>, expanded: boolean) => void;
12
33
  /**
13
34
  * Whether the step card is full width
14
35
  * @type {boolean}
@@ -203,5 +224,5 @@ export interface IStepCardProps {
203
224
  * defaultExpanded={false}
204
225
  * />
205
226
  */
206
- declare const StepCard: (props: IStepCardProps) => JSX.Element;
227
+ declare const StepCard: ({ expanded, loading, percentage, time, steps, remainingSteps, title, titleProps, subTitle, image, showBottomPercentage, expandable, showIcon, summary, summaryProps, expansionPanelDetailsProps, linearProgressBarProps, summaryLinearProgressBarProps, rootProps, onStepUrlClick, fullWidth, padding, margin, onChange }: IStepCardProps) => JSX.Element;
207
228
  export default StepCard;
@@ -45,48 +45,57 @@ var _styles = require("./styles");
45
45
  * defaultExpanded={false}
46
46
  * />
47
47
  */
48
- var StepCard = function StepCard(props) {
49
- var _props$loading = props.loading,
50
- loading = _props$loading === void 0 ? false : _props$loading,
51
- percentage = props.percentage,
52
- time = props.time,
53
- steps = props.steps,
54
- remainingSteps = props.remainingSteps,
55
- title = props.title,
56
- titleProps = props.titleProps,
57
- subTitle = props.subTitle,
58
- image = props.image,
59
- _props$showBottomPerc = props.showBottomPercentage,
60
- showBottomPercentage = _props$showBottomPerc === void 0 ? true : _props$showBottomPerc,
61
- _props$expandable = props.expandable,
62
- expandable = _props$expandable === void 0 ? true : _props$expandable,
63
- _props$showIcon = props.showIcon,
64
- showIcon = _props$showIcon === void 0 ? true : _props$showIcon,
65
- summary = props.summary,
66
- summaryProps = props.summaryProps,
67
- expansionPanelDetailsProps = props.expansionPanelDetailsProps,
68
- linearProgressBarProps = props.linearProgressBarProps,
69
- summaryLinearProgressBarProps = props.summaryLinearProgressBarProps,
70
- rootProps = props.rootProps,
71
- onStepUrlClick = props.onStepUrlClick,
72
- fullWidth = props.fullWidth,
73
- padding = props.padding,
74
- margin = props.margin;
48
+ var StepCard = function StepCard(_ref) {
49
+ var expanded = _ref.expanded,
50
+ _ref$loading = _ref.loading,
51
+ loading = _ref$loading === void 0 ? false : _ref$loading,
52
+ percentage = _ref.percentage,
53
+ _ref$time = _ref.time,
54
+ time = _ref$time === void 0 ? 0 : _ref$time,
55
+ steps = _ref.steps,
56
+ _ref$remainingSteps = _ref.remainingSteps,
57
+ remainingSteps = _ref$remainingSteps === void 0 ? 0 : _ref$remainingSteps,
58
+ title = _ref.title,
59
+ titleProps = _ref.titleProps,
60
+ subTitle = _ref.subTitle,
61
+ image = _ref.image,
62
+ _ref$showBottomPercen = _ref.showBottomPercentage,
63
+ showBottomPercentage = _ref$showBottomPercen === void 0 ? true : _ref$showBottomPercen,
64
+ _ref$expandable = _ref.expandable,
65
+ expandable = _ref$expandable === void 0 ? true : _ref$expandable,
66
+ _ref$showIcon = _ref.showIcon,
67
+ showIcon = _ref$showIcon === void 0 ? true : _ref$showIcon,
68
+ summary = _ref.summary,
69
+ summaryProps = _ref.summaryProps,
70
+ expansionPanelDetailsProps = _ref.expansionPanelDetailsProps,
71
+ linearProgressBarProps = _ref.linearProgressBarProps,
72
+ summaryLinearProgressBarProps = _ref.summaryLinearProgressBarProps,
73
+ rootProps = _ref.rootProps,
74
+ onStepUrlClick = _ref.onStepUrlClick,
75
+ fullWidth = _ref.fullWidth,
76
+ padding = _ref.padding,
77
+ margin = _ref.margin,
78
+ onChange = _ref.onChange;
75
79
  return loading ? /*#__PURE__*/_react["default"].createElement(_StepCardSkeleton["default"], {
76
80
  expandable: expandable,
77
81
  showIcon: showIcon,
78
- showBottomPercentage: showBottomPercentage
82
+ showBottomPercentage: showBottomPercentage,
83
+ fullWidth: fullWidth
79
84
  }) : /*#__PURE__*/_react["default"].createElement(_styles.Container, (0, _extends2["default"])({
80
85
  margin: margin,
81
86
  fullWidth: fullWidth
82
- }, rootProps), /*#__PURE__*/_react["default"].createElement(_ExpansionPanel["default"], null, /*#__PURE__*/_react["default"].createElement(_StepCardPanel.StepCardPanel, {
87
+ }, rootProps), /*#__PURE__*/_react["default"].createElement(_ExpansionPanel["default"], (0, _extends2["default"])({}, expanded ? {
88
+ expanded: expanded
89
+ } : {}, {
90
+ onChange: onChange
91
+ }), /*#__PURE__*/_react["default"].createElement(_StepCardPanel.StepCardPanel, {
83
92
  fullWidth: fullWidth,
84
93
  title: title,
85
94
  padding: padding,
86
95
  summary: summary,
87
96
  expandable: expandable,
88
- remainingSteps: remainingSteps || 0,
89
- time: time || 0,
97
+ remainingSteps: remainingSteps,
98
+ time: time,
90
99
  showIcon: showIcon,
91
100
  showBottomPercentage: showBottomPercentage,
92
101
  subTitle: subTitle,
@@ -6,6 +6,7 @@ interface IStepCardPanelProps {
6
6
  subTitle?: boolean;
7
7
  padding?: React.CSSProperties['padding'];
8
8
  margin?: React.CSSProperties['margin'];
9
+ fullWidth?: boolean;
9
10
  }
10
11
  declare const StepCardSkeleton: (props: IStepCardPanelProps) => JSX.Element;
11
12
  export default StepCardSkeleton;
@@ -16,7 +16,8 @@ var StepCardSkeleton = function StepCardSkeleton(props) {
16
16
  showIcon = props.showIcon,
17
17
  subTitle = props.subTitle,
18
18
  padding = props.padding,
19
- margin = props.margin;
19
+ margin = props.margin,
20
+ fullWidth = props.fullWidth;
20
21
  var TextSkeleton = function TextSkeleton() {
21
22
  return /*#__PURE__*/_react["default"].createElement(_lab.Skeleton, {
22
23
  variant: "text",
@@ -43,10 +44,12 @@ var StepCardSkeleton = function StepCardSkeleton(props) {
43
44
  })));
44
45
  };
45
46
  return /*#__PURE__*/_react["default"].createElement(_styles.Container, {
46
- margin: margin
47
+ margin: margin,
48
+ fullWidth: fullWidth
47
49
  }, /*#__PURE__*/_react["default"].createElement(_ExpansionPanel["default"], null, /*#__PURE__*/_react["default"].createElement(_styles.StepContainer, {
48
50
  padding: padding
49
51
  }, /*#__PURE__*/_react["default"].createElement(_styles.StepCardRow, {
52
+ fullWidth: fullWidth,
50
53
  minHeight: expandable ? '100px' : '100%'
51
54
  }, /*#__PURE__*/_react["default"].createElement(_styles.StepCardColumn, {
52
55
  justifyContent: "start"
@@ -57,7 +60,8 @@ var StepCardSkeleton = function StepCardSkeleton(props) {
57
60
  }), /*#__PURE__*/_react["default"].createElement(_styles.TitleContainer, null, /*#__PURE__*/_react["default"].createElement(TextSkeleton, null), subTitle && /*#__PURE__*/_react["default"].createElement(TextSkeleton, null))), /*#__PURE__*/_react["default"].createElement(_styles.StepCardColumn, {
58
61
  justifyContent: "end"
59
62
  }, expandable ? /*#__PURE__*/_react["default"].createElement(TextSkeleton, null) : /*#__PURE__*/_react["default"].createElement(NormalProgress, null))), showBottomPercentage && /*#__PURE__*/_react["default"].createElement(_styles.StepCardRow, {
60
- minHeight: "15px"
63
+ minHeight: "15px",
64
+ fullWidth: fullWidth
61
65
  }, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
62
66
  style: {
63
67
  width: '100%'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flipper-ui",
3
- "version": "0.26.20",
3
+ "version": "0.26.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "homepage": "https://flipper-ui.ngi.com.br/",