sag_components 2.0.0-beta89 → 2.0.0-beta90

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/dist/index.d.ts CHANGED
@@ -1258,4 +1258,42 @@ declare function InsightsCarousel({ className, children, onClose, title, icon, t
1258
1258
  navColor?: string;
1259
1259
  }): react_jsx_runtime.JSX.Element;
1260
1260
 
1261
- export { AreaChart, BannerEventBoxList, BarChart, BarChartTwoRows, BarChartWithAreaChart, BarChartsByWeeks, BatteryChart, BreakdownPanel, BrushChart, BubbleChart, Button, CollapseData, CollapseHeader, DialogOverlay, DoubleBarSingleLine, DoublePanelDataRow, EventDetailsCard, EventList, FilterPanel, Heatmap, IconButton, InsightsCarousel, LinkButton, LinnerDataBox, MarketShareDescription, OneColumnContainer, PerformanceAnalyticsLegend, PieChart, PopupCharts, QuickFilter, ReportTable, SingleBarLineCharts, TabMenu, TopToggleList, TotalDoughnutChart, TotalHorizontalCharts, TwoBarCharts };
1261
+ declare function DownloadProgress(props: any): react_jsx_runtime.JSX.Element;
1262
+ declare namespace DownloadProgress {
1263
+ namespace propTypes {
1264
+ const title: PropTypes.Requireable<string>;
1265
+ const succeededMessage: PropTypes.Requireable<string>;
1266
+ const failedMessage: PropTypes.Requireable<string>;
1267
+ const downloadStatus: PropTypes.Requireable<string>;
1268
+ const showShadow: PropTypes.Requireable<boolean>;
1269
+ const progressPercent: PropTypes.Requireable<number>;
1270
+ const refreshInterval: PropTypes.Requireable<number>;
1271
+ const progressBarColor: PropTypes.Requireable<string>;
1272
+ const onTryAgainClick: PropTypes.Requireable<(...args: any[]) => any>;
1273
+ const className: PropTypes.Requireable<string>;
1274
+ }
1275
+ namespace defaultProps {
1276
+ const title_1: string;
1277
+ export { title_1 as title };
1278
+ const succeededMessage_1: string;
1279
+ export { succeededMessage_1 as succeededMessage };
1280
+ const failedMessage_1: string;
1281
+ export { failedMessage_1 as failedMessage };
1282
+ const downloadStatus_1: string;
1283
+ export { downloadStatus_1 as downloadStatus };
1284
+ const showShadow_1: boolean;
1285
+ export { showShadow_1 as showShadow };
1286
+ const progressPercent_1: number;
1287
+ export { progressPercent_1 as progressPercent };
1288
+ const refreshInterval_1: number;
1289
+ export { refreshInterval_1 as refreshInterval };
1290
+ const progressBarColor_1: string;
1291
+ export { progressBarColor_1 as progressBarColor };
1292
+ export function onTryAgainClick_1(): void;
1293
+ export { onTryAgainClick_1 as onTryAgainClick };
1294
+ const className_1: string;
1295
+ export { className_1 as className };
1296
+ }
1297
+ }
1298
+
1299
+ export { AreaChart, BannerEventBoxList, BarChart, BarChartTwoRows, BarChartWithAreaChart, BarChartsByWeeks, BatteryChart, BreakdownPanel, BrushChart, BubbleChart, Button, CollapseData, CollapseHeader, DialogOverlay, DoubleBarSingleLine, DoublePanelDataRow, DownloadProgress, EventDetailsCard, EventList, FilterPanel, Heatmap, IconButton, InsightsCarousel, LinkButton, LinnerDataBox, MarketShareDescription, OneColumnContainer, PerformanceAnalyticsLegend, PieChart, PopupCharts, QuickFilter, ReportTable, SingleBarLineCharts, TabMenu, TopToggleList, TotalDoughnutChart, TotalHorizontalCharts, TwoBarCharts };
package/dist/index.esm.js CHANGED
@@ -34154,5 +34154,250 @@ const InsightsCarousel = _ref => {
34154
34154
  })))));
34155
34155
  };
34156
34156
 
34157
- export { AreaChart, BannerEventBoxList, BarChart, BarChartTwoRows, BarChartWithAreaChart, BarChartsByWeeks, BatteryChart, BreakdownPanel, BrushChart, BubbleChart, Button, CollapseData, CollapseHeader, DialogOverlay, DoubleBarSingleLine, DoublePanelDataRow, EventDetailsCard, EventList, FilterPanel, Heatmap, IconButton, InsightsCarousel, LinkButton, LinnerDataBox, MarketShareDescription, OneColumnContainer, PerformanceAnalyticsLegend, PieChart, PopupCharts, QuickFilter, ReportTable, SingleBarLineCharts, TabMenu, TopToggleList, TotalDoughnutChart, TotalHorizontalCharts, TwoBarCharts };
34157
+ // eslint-disable-next-line react/prop-types
34158
+ const ErrorIcon = _ref => {
34159
+ let {
34160
+ color = '#FF3949',
34161
+ width = '18',
34162
+ height = '18'
34163
+ } = _ref;
34164
+ return /*#__PURE__*/React$1.createElement("svg", {
34165
+ width: width,
34166
+ height: height,
34167
+ viewBox: "0 0 14 13",
34168
+ fill: "none",
34169
+ xmlns: "http://www.w3.org/2000/svg"
34170
+ }, /*#__PURE__*/React$1.createElement("path", {
34171
+ d: "M7 1.625C5.24219 1.625 3.64844 2.5625 2.75781 4.0625C1.89062 5.58594 1.89062 7.4375 2.75781 8.9375C3.64844 10.4609 5.24219 11.375 7 11.375C8.73438 11.375 10.3281 10.4609 11.2188 8.9375C12.0859 7.4375 12.0859 5.58594 11.2188 4.0625C10.3281 2.5625 8.73438 1.625 7 1.625ZM7 12.5C4.84375 12.5 2.875 11.375 1.79688 9.5C0.71875 7.64844 0.71875 5.375 1.79688 3.5C2.875 1.64844 4.84375 0.5 7 0.5C9.13281 0.5 11.1016 1.64844 12.1797 3.5C13.2578 5.375 13.2578 7.64844 12.1797 9.5C11.1016 11.375 9.13281 12.5 7 12.5ZM7 3.5C7.30469 3.5 7.5625 3.75781 7.5625 4.0625V6.6875C7.5625 7.01562 7.30469 7.25 7 7.25C6.67188 7.25 6.4375 7.01562 6.4375 6.6875V4.0625C6.4375 3.75781 6.67188 3.5 7 3.5ZM7.75 8.75C7.75 9.17188 7.39844 9.5 7 9.5C6.57812 9.5 6.25 9.17188 6.25 8.75C6.25 8.35156 6.57812 8 7 8C7.39844 8 7.75 8.35156 7.75 8.75Z",
34172
+ fill: color
34173
+ }));
34174
+ };
34175
+
34176
+ // eslint-disable-next-line react/prop-types
34177
+ const SucceededIcon = _ref => {
34178
+ let {
34179
+ color = '#92CF17',
34180
+ width = '18',
34181
+ height = '18'
34182
+ } = _ref;
34183
+ return /*#__PURE__*/React$1.createElement("svg", {
34184
+ width: width,
34185
+ height: height,
34186
+ viewBox: "0 0 14 13",
34187
+ fill: "none",
34188
+ xmlns: "http://www.w3.org/2000/svg"
34189
+ }, /*#__PURE__*/React$1.createElement("path", {
34190
+ d: "M7 1.625C5.24219 1.625 3.64844 2.5625 2.75781 4.0625C1.89062 5.58594 1.89062 7.4375 2.75781 8.9375C3.64844 10.4609 5.24219 11.375 7 11.375C8.73438 11.375 10.3281 10.4609 11.2188 8.9375C12.0859 7.4375 12.0859 5.58594 11.2188 4.0625C10.3281 2.5625 8.73438 1.625 7 1.625ZM7 12.5C4.84375 12.5 2.875 11.375 1.79688 9.5C0.71875 7.64844 0.71875 5.375 1.79688 3.5C2.875 1.64844 4.84375 0.5 7 0.5C9.13281 0.5 11.1016 1.64844 12.1797 3.5C13.2578 5.375 13.2578 7.64844 12.1797 9.5C11.1016 11.375 9.13281 12.5 7 12.5ZM9.64844 5.39844L6.64844 8.39844C6.41406 8.63281 6.0625 8.63281 5.85156 8.39844L4.35156 6.89844C4.11719 6.6875 4.11719 6.33594 4.35156 6.125C4.5625 5.89062 4.91406 5.89062 5.14844 6.125L6.25 7.22656L8.85156 4.625C9.0625 4.39062 9.41406 4.39062 9.64844 4.625C9.85938 4.83594 9.85938 5.1875 9.64844 5.39844Z",
34191
+ fill: color
34192
+ }));
34193
+ };
34194
+
34195
+ // Styled-components for the progress container and the filler
34196
+ const ProgressBarContainer = styled.div`
34197
+ width: ${props => props.width};
34198
+ background-color: #F2F2F2;
34199
+ border-radius: 12px;
34200
+ height: ${props => props.height};
34201
+ margin: 5px 0;
34202
+ `;
34203
+ const ProgressBarFiller = styled.div`
34204
+ background-color: ${props => props.color};
34205
+ height: 100%;
34206
+ text-align: center;
34207
+ border-radius: 12px;
34208
+ transition: width 0.5s ease-in-out;
34209
+ width: ${props => props.progress}%;
34210
+ `;
34211
+
34212
+ const ProgressBar = props => {
34213
+ const {
34214
+ progressPercent,
34215
+ refreshInterval,
34216
+ height,
34217
+ width,
34218
+ color
34219
+ } = props;
34220
+ const [progress, setProgress] = useState(0);
34221
+ useEffect(() => {
34222
+ const timer = setInterval(() => {
34223
+ setProgress(currentProgress => {
34224
+ const newProgress = currentProgress + 1;
34225
+ if (newProgress > 100) {
34226
+ clearInterval(timer);
34227
+ return 100;
34228
+ }
34229
+ return newProgress;
34230
+ });
34231
+ }, refreshInterval);
34232
+ return () => clearInterval(timer);
34233
+ }, [progressPercent, refreshInterval]);
34234
+ useEffect(() => {
34235
+ setProgress(progressPercent);
34236
+ }, [progressPercent]);
34237
+ return /*#__PURE__*/React$1.createElement(ProgressBarContainer, {
34238
+ className: "ProgressBarContainer",
34239
+ width: width,
34240
+ height: height
34241
+ }, /*#__PURE__*/React$1.createElement(ProgressBarFiller, {
34242
+ className: "ProgressBarFiller",
34243
+ color: color,
34244
+ progress: progress
34245
+ }));
34246
+ };
34247
+ ProgressBar.propTypes = {
34248
+ progressPercent: PropTypes.number,
34249
+ refreshInterval: PropTypes.number,
34250
+ width: PropTypes.string,
34251
+ height: PropTypes.string,
34252
+ color: PropTypes.string
34253
+ };
34254
+ ProgressBar.defaultProps = {
34255
+ progressPercent: 0,
34256
+ refreshInterval: 100,
34257
+ width: '100%',
34258
+ height: '9px',
34259
+ color: '#066768'
34260
+ };
34261
+
34262
+ const DownloadProgressMainContainer = styled.div`
34263
+ font-family: "Poppins", sans-serif;
34264
+ font-style: normal;
34265
+ font-size: 12px;
34266
+ font-weight: 400;
34267
+ color: #212121;
34268
+ line-height: 14px;
34269
+ position: relative;
34270
+ margin: 0;
34271
+ padding: 10px;
34272
+ background: #ffffff;
34273
+ border-radius: 12px;
34274
+ box-shadow: ${props => props.showShadow ? '0px 0px 20px 0px rgba(0, 0, 0, 0.2)' : ''};
34275
+ `;
34276
+ const DownloadProgressContentContainer = styled.div`
34277
+ display: flex;
34278
+ align-items: center;
34279
+ margin: 0 10px;
34280
+ gap: 10px;
34281
+ `;
34282
+ const DownloadProgressTitle = styled.h3`
34283
+ font-weight: 400;
34284
+ margin: 10px;
34285
+ `;
34286
+ const DownloadProgressStatusMessage = styled.h3`
34287
+ margin: 3px 0;
34288
+ &.DownloadProgressStatusMessage_succeeded{
34289
+ font-weight: 500;
34290
+ }
34291
+ &.DownloadProgressStatusMessage_failed{
34292
+ color: #7F7D7D;
34293
+ font-weight: 400;
34294
+ }
34295
+ &.DownloadProgressStatusMessage_TryAgain{
34296
+ color: #1B30AA;
34297
+ font-weight: 400;
34298
+ text-decoration: underline;
34299
+ &:hover {
34300
+ background-Color: #f1f1f1;
34301
+ cursor: pointer;
34302
+ }
34303
+ }
34304
+ `;
34305
+
34306
+ const DownloadProgress = props => {
34307
+ const {
34308
+ title,
34309
+ succeededMessage,
34310
+ failedMessage,
34311
+ downloadStatus,
34312
+ showShadow,
34313
+ progressPercent,
34314
+ refreshInterval,
34315
+ progressBarColor,
34316
+ onTryAgainClick,
34317
+ className
34318
+ } = props;
34319
+ const [DownloadStatus, setDownloadStatus] = useState(downloadStatus);
34320
+ useEffect(() => {
34321
+ setDownloadStatus(downloadStatus);
34322
+ }, [downloadStatus]);
34323
+ const displayProgressContent = () => {
34324
+ let content = '';
34325
+ switch (DownloadStatus) {
34326
+ case 'inProgress':
34327
+ content = /*#__PURE__*/React$1.createElement(DownloadProgressContentContainer, {
34328
+ className: "DownloadProgressContentContainer"
34329
+ }, /*#__PURE__*/React$1.createElement(ProgressBar, {
34330
+ className: "ProgressBar",
34331
+ color: progressBarColor,
34332
+ progressPercent: progressPercent,
34333
+ refreshInterval: refreshInterval,
34334
+ width: "100%"
34335
+ }));
34336
+ break;
34337
+ case 'succeeded':
34338
+ content = /*#__PURE__*/React$1.createElement(DownloadProgressContentContainer, {
34339
+ className: "DownloadProgressContentContainer"
34340
+ }, /*#__PURE__*/React$1.createElement(DownloadProgressStatusMessage, {
34341
+ className: "DownloadProgressStatusMessage_succeeded"
34342
+ }, succeededMessage), /*#__PURE__*/React$1.createElement(SucceededIcon, {
34343
+ color: "#92CF17",
34344
+ width: "12px",
34345
+ height: "12px"
34346
+ }));
34347
+ break;
34348
+ case 'failed':
34349
+ content = /*#__PURE__*/React$1.createElement(DownloadProgressContentContainer, {
34350
+ className: "DownloadProgressContentContainer"
34351
+ }, /*#__PURE__*/React$1.createElement(DownloadProgressStatusMessage, {
34352
+ className: "DownloadProgressStatusMessage_failed"
34353
+ }, failedMessage), /*#__PURE__*/React$1.createElement(DownloadProgressStatusMessage, {
34354
+ className: "DownloadProgressStatusMessage_TryAgain",
34355
+ onClick: () => onTryAgainClick({
34356
+ eventName: 'onTryAgainClick'
34357
+ })
34358
+ }, "Try again"), /*#__PURE__*/React$1.createElement(ErrorIcon, {
34359
+ color: "#FF3949",
34360
+ width: "12px",
34361
+ height: "12px"
34362
+ }));
34363
+ break;
34364
+ default:
34365
+ content = '';
34366
+ break;
34367
+ }
34368
+ return content;
34369
+ };
34370
+ return /*#__PURE__*/React$1.createElement(DownloadProgressMainContainer, {
34371
+ className: className,
34372
+ showShadow: showShadow
34373
+ }, /*#__PURE__*/React$1.createElement(DownloadProgressTitle, {
34374
+ className: "DownloadProgressTitle"
34375
+ }, title), displayProgressContent());
34376
+ };
34377
+ DownloadProgress.propTypes = {
34378
+ title: PropTypes.string,
34379
+ succeededMessage: PropTypes.string,
34380
+ failedMessage: PropTypes.string,
34381
+ downloadStatus: PropTypes.string,
34382
+ showShadow: PropTypes.bool,
34383
+ progressPercent: PropTypes.number,
34384
+ refreshInterval: PropTypes.number,
34385
+ progressBarColor: PropTypes.string,
34386
+ onTryAgainClick: PropTypes.func,
34387
+ className: PropTypes.string
34388
+ };
34389
+ DownloadProgress.defaultProps = {
34390
+ title: 'CPG presentation shopper marketing, supplier name ',
34391
+ succeededMessage: 'File Downloaded',
34392
+ failedMessage: 'Something went wrong',
34393
+ downloadStatus: 'inProgress',
34394
+ showShadow: true,
34395
+ progressPercent: 0,
34396
+ refreshInterval: 100,
34397
+ progressBarColor: '#92CF17',
34398
+ onTryAgainClick: () => {},
34399
+ className: 'DownloadProgressMainContainer'
34400
+ };
34401
+
34402
+ export { AreaChart, BannerEventBoxList, BarChart, BarChartTwoRows, BarChartWithAreaChart, BarChartsByWeeks, BatteryChart, BreakdownPanel, BrushChart, BubbleChart, Button, CollapseData, CollapseHeader, DialogOverlay, DoubleBarSingleLine, DoublePanelDataRow, DownloadProgress, EventDetailsCard, EventList, FilterPanel, Heatmap, IconButton, InsightsCarousel, LinkButton, LinnerDataBox, MarketShareDescription, OneColumnContainer, PerformanceAnalyticsLegend, PieChart, PopupCharts, QuickFilter, ReportTable, SingleBarLineCharts, TabMenu, TopToggleList, TotalDoughnutChart, TotalHorizontalCharts, TwoBarCharts };
34158
34403
  //# sourceMappingURL=index.esm.js.map