@redsift/table 6.1.0-alpha.0 → 6.2.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/index.js CHANGED
@@ -1,5 +1,6 @@
1
+ import { GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridVisibleSortedRowIdsSelector, DataGridPro } from '@mui/x-data-grid-pro';
2
+ export { GRID_DETAIL_PANEL_TOGGLE_COL_DEF } from '@mui/x-data-grid-pro';
1
3
  import React, { forwardRef, useRef } from 'react';
2
- import { GridToolbarContainer, GridToolbarColumnsButton, GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExport, gridVisibleSortedRowIdsSelector, DataGridPro } from '@mui/x-data-grid-pro';
3
4
  import styled, { css } from 'styled-components';
4
5
 
5
6
  function ownKeys(object, enumerableOnly) {
@@ -167,6 +168,181 @@ class LicenseInfo {
167
168
 
168
169
  }
169
170
 
171
+ /** Component Type. */
172
+
173
+ /**
174
+ * JS falsy values.
175
+ * (excluding `NaN` as it can't be distinguished from `number`)
176
+ */
177
+
178
+ /** Get types of the values of a record. */
179
+
180
+ /**
181
+ * Color palette.
182
+ */
183
+ const ColorPalette = {
184
+ primary: 'primary',
185
+ secondary: 'secondary',
186
+ error: 'error',
187
+ warning: 'warning',
188
+ info: 'info',
189
+ success: 'success'
190
+ };
191
+
192
+ // Material Design Icons v7.0.96
193
+ var mdiChevronDown = "M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z";
194
+ var mdiChevronRight = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";
195
+ var mdiChevronUp = "M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z";
196
+ var mdiFilterVariant = "M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z";
197
+
198
+ /**
199
+ * Component size.
200
+ */
201
+ const IconSize = {
202
+ large: 'large',
203
+ medium: 'medium',
204
+ small: 'small'
205
+ };
206
+
207
+ /**
208
+ * Component style.
209
+ */
210
+ const StyledIcon = styled.span`
211
+ font-style: normal;
212
+ position: relative;
213
+
214
+ ${_ref => {
215
+ let {
216
+ $color
217
+ } = _ref;
218
+ return $color && Object.keys(ColorPalette).indexOf($color) !== -1 ? css`
219
+ color: var(--redsift-color-${$color}-main);
220
+ ` : css`
221
+ color: ${$color || css`var(--redsift-color-action-active)`};
222
+ `;
223
+ }}
224
+
225
+ ${_ref2 => {
226
+ let {
227
+ $size
228
+ } = _ref2;
229
+ switch ($size) {
230
+ case IconSize.large:
231
+ return css`
232
+ font-size: 35px;
233
+ height: 35px;
234
+ line-height: 35px;
235
+ width: 35px;
236
+
237
+ & .redsift-badge-standard {
238
+ position: absolute;
239
+ right: -23px;
240
+ top: 0px;
241
+ }
242
+
243
+ & .redsift-badge-dot {
244
+ position: absolute;
245
+ right: -7px;
246
+ top: 4px;
247
+ }
248
+ `;
249
+ case IconSize.small:
250
+ return css`
251
+ font-size: 20px;
252
+ height: 20px;
253
+ line-height: 20px;
254
+ width: 20px;
255
+
256
+ & .redsift-badge-standard {
257
+ position: absolute;
258
+ right: -24px;
259
+ top: -8px;
260
+ }
261
+
262
+ & .redsift-badge-dot {
263
+ position: absolute;
264
+ right: -8px;
265
+ top: 1px;
266
+ }
267
+ `;
268
+ case IconSize.medium:
269
+ default:
270
+ return css`
271
+ font-size: 24px;
272
+ height: 24px;
273
+ line-height: 24px;
274
+ width: 24px;
275
+
276
+ & .redsift-badge-standard {
277
+ position: absolute;
278
+ right: -24px;
279
+ top: -6px;
280
+ }
281
+
282
+ & .redsift-badge-dot {
283
+ position: absolute;
284
+ right: -8px;
285
+ top: 2px;
286
+ }
287
+ `;
288
+ }
289
+ }}
290
+ `;
291
+
292
+ const _excluded$2 = ["aria-hidden", "aria-label", "badge", "className", "color", "icon", "size", "svgProps"];
293
+ const COMPONENT_NAME$3 = 'RedSiftIcon';
294
+ const CLASSNAME$3 = 'redsift-icon';
295
+ const DEFAULT_PROPS$2 = {
296
+ size: IconSize.medium
297
+ };
298
+
299
+ /**
300
+ * The Icon component.
301
+ */
302
+ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
303
+ const iconRef = ref || useRef();
304
+ let {
305
+ 'aria-hidden': ariaHidden,
306
+ 'aria-label': ariaLabel,
307
+ badge,
308
+ className,
309
+ color,
310
+ icon,
311
+ size,
312
+ svgProps
313
+ } = props,
314
+ forwardedProps = _objectWithoutProperties(props, _excluded$2);
315
+ if (!ariaHidden) {
316
+ ariaHidden = undefined;
317
+ }
318
+ return /*#__PURE__*/React.createElement(StyledIcon, _extends({}, forwardedProps, {
319
+ $color: color,
320
+ $size: size,
321
+ "aria-hidden": ariaLabel ? ariaHidden || undefined : true,
322
+ "aria-label": ariaLabel,
323
+ className: classNames(Icon.className, className),
324
+ ref: iconRef
325
+ }), /*#__PURE__*/React.createElement("svg", _extends({}, svgProps, {
326
+ "aria-hidden": ariaLabel ? ariaHidden || undefined : true,
327
+ "aria-label": ariaLabel,
328
+ focusable: "false",
329
+ height: "1em",
330
+ preserveAspectRatio: "xMidYMid meet",
331
+ role: "img",
332
+ style: {
333
+ verticalAlign: '-0.125em'
334
+ },
335
+ viewBox: "0 0 24 24",
336
+ width: "1em"
337
+ }), /*#__PURE__*/React.createElement("path", {
338
+ d: icon,
339
+ fill: "currentColor"
340
+ })), badge ? badge : null);
341
+ });
342
+ Icon.className = CLASSNAME$3;
343
+ Icon.defaultProps = DEFAULT_PROPS$2;
344
+ Icon.displayName = COMPONENT_NAME$3;
345
+
170
346
  /**
171
347
  * Component style.
172
348
  */
@@ -180,6 +356,8 @@ const StyledDataGrid = styled.div`
180
356
  `;
181
357
  }}
182
358
 
359
+ width: 100%;
360
+
183
361
  .MuiDataGrid-root {
184
362
  font-family: var(--redsift-typography-datagrid-font-family);
185
363
  border: none;
@@ -205,15 +383,6 @@ const StyledDataGrid = styled.div`
205
383
  display: none;
206
384
  }
207
385
 
208
- .MuiDataGrid-toolbarContainer {
209
- font-family: var(--redsift-typography-datagrid-font-family);
210
-
211
- button {
212
- font-family: var(--redsift-typography-datagrid-font-family);
213
- color: #000000;
214
- }
215
- }
216
-
217
386
  .MuiTablePagination-root {
218
387
  .MuiTablePagination-selectLabel {
219
388
  font-family: var(--redsift-typography-datagrid-font-family);
@@ -240,8 +409,46 @@ const StyledDataGrid = styled.div`
240
409
  }
241
410
  `;
242
411
 
412
+ /**
413
+ * Component style.
414
+ */
415
+ const GridToolbarWrapper = styled.div`
416
+ .MuiButtonBase-root-JobBs.MuiButton-root {
417
+ svg {
418
+ path {
419
+ fill: var(--redsift-color-primary-main);
420
+ }
421
+ }
422
+ }
423
+
424
+ .MuiDataGrid-toolbarContainer {
425
+ font-family: var(--redsift-typography-datagrid-font-family);
426
+
427
+ button {
428
+ font-family: var(--redsift-typography-datagrid-font-family);
429
+ font-size: var(--redsift-typography-button-large-font-size);
430
+ line-height: var(--redsift-typography-button-large-line-height);
431
+ color: var(--redsift-color-primary-main);
432
+ border-radius: 0px;
433
+ padding: 6px 8px;
434
+
435
+ .MuiButton-startIcon {
436
+ margin-left: 0px;
437
+
438
+ svg {
439
+ color: var(--redsift-color-primary-main);
440
+ }
441
+ }
442
+ }
443
+
444
+ button:hover {
445
+ background: var(--redsift-color-primary-outlined-hover);
446
+ }
447
+ }
448
+ `;
449
+
243
450
  const Toolbar = () => {
244
- return /*#__PURE__*/React.createElement(GridToolbarContainer, null, /*#__PURE__*/React.createElement(GridToolbarColumnsButton, null), /*#__PURE__*/React.createElement(GridToolbarFilterButton, null), /*#__PURE__*/React.createElement(GridToolbarDensitySelector, null), /*#__PURE__*/React.createElement(GridToolbarExport, {
451
+ return /*#__PURE__*/React.createElement(GridToolbarWrapper, null, /*#__PURE__*/React.createElement(GridToolbarContainer, null, /*#__PURE__*/React.createElement(GridToolbarFilterButton, null), /*#__PURE__*/React.createElement(GridToolbarColumnsButton, null), /*#__PURE__*/React.createElement(GridToolbarDensitySelector, null), /*#__PURE__*/React.createElement(GridToolbarExport, {
245
452
  csvOptions: {
246
453
  allColumns: true,
247
454
  fileName: 'csv',
@@ -255,16 +462,36 @@ const Toolbar = () => {
255
462
  printOptions: {
256
463
  disableToolbarButton: true
257
464
  }
258
- }));
465
+ })));
259
466
  };
260
467
 
261
- const _excluded = ["className", "hideToolbar", "license", "$height"];
262
- const COMPONENT_NAME = 'RedSiftDataGrid';
263
- const CLASSNAME = 'redsift-data-grid';
264
- const DEFAULT_PROPS = {
265
- license: process.env.MUI_LICENSE_KEY || '',
468
+ const _excluded$1 = ["className", "hideToolbar", "license", "$height"];
469
+ const COMPONENT_NAME$2 = 'RedSiftDataGrid';
470
+ const CLASSNAME$2 = 'redsift-data-grid';
471
+ const DEFAULT_PROPS$1 = {
472
+ license: process.env.MUI_LICENSE_KEY,
266
473
  $height: '500px'
267
474
  };
475
+ const ColumnSortedAscendingIcon = () => /*#__PURE__*/React.createElement(Icon, {
476
+ icon: mdiChevronUp,
477
+ size: 'small'
478
+ });
479
+ const ColumnSortedDescendingIcon = () => /*#__PURE__*/React.createElement(Icon, {
480
+ icon: mdiChevronDown,
481
+ size: 'small'
482
+ });
483
+ const DetailPanelExpandIcon = () => /*#__PURE__*/React.createElement(Icon, {
484
+ icon: mdiChevronRight,
485
+ size: 'small'
486
+ });
487
+ const DetailPanelCollapseIcon = () => /*#__PURE__*/React.createElement(Icon, {
488
+ icon: mdiChevronDown,
489
+ size: 'small'
490
+ });
491
+ const ColumnFilteredIcon = () => /*#__PURE__*/React.createElement(Icon, {
492
+ icon: mdiFilterVariant,
493
+ size: 'small'
494
+ });
268
495
  const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
269
496
  const datagridRef = ref || useRef();
270
497
  const {
@@ -273,21 +500,353 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
273
500
  license,
274
501
  $height
275
502
  } = props,
276
- forwardedProps = _objectWithoutProperties(props, _excluded);
503
+ forwardedProps = _objectWithoutProperties(props, _excluded$1);
277
504
  LicenseInfo.setLicenseKey(license);
278
505
  return /*#__PURE__*/React.createElement(StyledDataGrid, {
279
506
  ref: datagridRef,
280
507
  className: classNames(DataGrid.className, className),
281
508
  $height: $height
282
509
  }, /*#__PURE__*/React.createElement(DataGridPro, _extends({}, forwardedProps, {
283
- components: _objectSpread2(_objectSpread2({}, props.components), !hideToolbar && {
510
+ components: _objectSpread2(_objectSpread2({
511
+ ColumnFilteredIcon,
512
+ ColumnSortedAscendingIcon,
513
+ ColumnSortedDescendingIcon,
514
+ DetailPanelExpandIcon,
515
+ DetailPanelCollapseIcon,
516
+ OpenFilterButtonIcon: ColumnFilteredIcon
517
+ }, props.components), !hideToolbar && {
284
518
  Toolbar
285
519
  })
286
520
  })));
287
521
  });
288
- DataGrid.className = CLASSNAME;
289
- DataGrid.defaultProps = DEFAULT_PROPS;
290
- DataGrid.displayName = COMPONENT_NAME;
522
+ DataGrid.className = CLASSNAME$2;
523
+ DataGrid.defaultProps = DEFAULT_PROPS$1;
524
+ DataGrid.displayName = COMPONENT_NAME$2;
525
+
526
+ /** Get types of the values of a record. */
527
+
528
+ /**
529
+ * Component variant.
530
+ */
531
+ const ShieldVariant = {
532
+ success: 'success',
533
+ successLocked: 'successLocked',
534
+ successUnlocked: 'successUnlocked',
535
+ fail: 'fail',
536
+ failLocked: 'failLocked',
537
+ failUnlocked: 'failUnlocked',
538
+ warning: 'warning',
539
+ warningLocked: 'warningLocked',
540
+ warningUnlocked: 'warningUnlocked',
541
+ noData: 'noData',
542
+ ignored: 'ignored',
543
+ email: 'email',
544
+ question: 'question'
545
+ };
546
+
547
+ const StyledShield = styled.div`
548
+ display: flex;
549
+ margin: 0 8px;
550
+ `;
551
+
552
+ const LockedIcon = _ref => {
553
+ let {
554
+ color
555
+ } = _ref;
556
+ return /*#__PURE__*/React.createElement("svg", {
557
+ width: "16.36",
558
+ height: "19.63",
559
+ viewBox: "0 0 20 24",
560
+ fill: "none",
561
+ xmlns: "http://www.w3.org/2000/svg"
562
+ }, /*#__PURE__*/React.createElement("path", {
563
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
564
+ fill: color
565
+ }), /*#__PURE__*/React.createElement("path", {
566
+ d: "M13.5 9.66667H12.9167V8.5C12.9167 6.89 11.61 5.58333 10 5.58333C8.39 5.58333 7.08333 6.89 7.08333 8.5V9.66667H6.5C5.85833 9.66667 5.33333 10.1917 5.33333 10.8333V16.6667C5.33333 17.3083 5.85833 17.8333 6.5 17.8333H13.5C14.1417 17.8333 14.6667 17.3083 14.6667 16.6667V10.8333C14.6667 10.1917 14.1417 9.66667 13.5 9.66667ZM10 14.9167C9.35833 14.9167 8.83333 14.3917 8.83333 13.75C8.83333 13.1083 9.35833 12.5833 10 12.5833C10.6417 12.5833 11.1667 13.1083 11.1667 13.75C11.1667 14.3917 10.6417 14.9167 10 14.9167ZM11.8083 9.66667H8.19167V8.5C8.19167 7.5025 9.0025 6.69167 10 6.69167C10.9975 6.69167 11.8083 7.5025 11.8083 8.5V9.66667Z",
567
+ fill: "white"
568
+ }));
569
+ };
570
+
571
+ const UnlockedIcon = _ref => {
572
+ let {
573
+ color
574
+ } = _ref;
575
+ return /*#__PURE__*/React.createElement("svg", {
576
+ width: "16.36",
577
+ height: "19.63",
578
+ viewBox: "0 0 20 24",
579
+ fill: "none",
580
+ xmlns: "http://www.w3.org/2000/svg"
581
+ }, /*#__PURE__*/React.createElement("path", {
582
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
583
+ fill: color
584
+ }), /*#__PURE__*/React.createElement("path", {
585
+ d: "M10 14.9167C10.6417 14.9167 11.1667 14.3917 11.1667 13.75C11.1667 13.1083 10.6417 12.5833 10 12.5833C9.35833 12.5833 8.83333 13.1083 8.83333 13.75C8.83333 14.3917 9.35833 14.9167 10 14.9167ZM13.5 9.66667H12.9167V8.5C12.9167 6.89 11.61 5.58334 10 5.58334C8.39 5.58334 7.08333 6.89 7.08333 8.5H8.19167C8.19167 7.5025 9.0025 6.69167 10 6.69167C10.9975 6.69167 11.8083 7.5025 11.8083 8.5V9.66667H6.5C5.85833 9.66667 5.33333 10.1917 5.33333 10.8333V16.6667C5.33333 17.3083 5.85833 17.8333 6.5 17.8333H13.5C14.1417 17.8333 14.6667 17.3083 14.6667 16.6667V10.8333C14.6667 10.1917 14.1417 9.66667 13.5 9.66667ZM13.5 16.6667H6.5V10.8333H13.5V16.6667Z",
586
+ fill: "white"
587
+ }));
588
+ };
589
+
590
+ const SuccessIcon = _ref => {
591
+ let {
592
+ color
593
+ } = _ref;
594
+ return /*#__PURE__*/React.createElement("svg", {
595
+ width: "16.36",
596
+ height: "19.63",
597
+ viewBox: "0 0 20 24",
598
+ fill: "none",
599
+ xmlns: "http://www.w3.org/2000/svg"
600
+ }, /*#__PURE__*/React.createElement("path", {
601
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
602
+ fill: color
603
+ }), /*#__PURE__*/React.createElement("path", {
604
+ fillRule: "evenodd",
605
+ clipRule: "evenodd",
606
+ d: "M8 16.5711L16.4853 8.08579L15.0711 6.67158L8 13.7426L5.17157 10.9142L3.75736 12.3284L8 16.5711Z",
607
+ fill: "white"
608
+ }));
609
+ };
610
+
611
+ const WarningIcon = _ref => {
612
+ let {
613
+ color
614
+ } = _ref;
615
+ return /*#__PURE__*/React.createElement("svg", {
616
+ width: "16.36",
617
+ height: "19.63",
618
+ viewBox: "0 0 20 24",
619
+ fill: "none",
620
+ xmlns: "http://www.w3.org/2000/svg"
621
+ }, /*#__PURE__*/React.createElement("path", {
622
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
623
+ fill: color
624
+ }), /*#__PURE__*/React.createElement("path", {
625
+ fillRule: "evenodd",
626
+ clipRule: "evenodd",
627
+ d: "M10 5C10.7177 5 11.3804 5.38457 11.7365 6.00772L15.7365 13.0077C16.0902 13.6267 16.0877 14.3872 15.7298 15.0039C15.372 15.6205 14.7129 16 14 16H6C5.28706 16 4.62802 15.6205 4.27018 15.0039C3.91234 14.3872 3.9098 13.6267 4.26351 13.0077L8.26351 6.00772C8.6196 5.38457 9.28229 5 10 5ZM10 7L6 14H14L10 7Z",
628
+ fill: "white"
629
+ }));
630
+ };
631
+
632
+ const FailIcon = _ref => {
633
+ let {
634
+ color
635
+ } = _ref;
636
+ return /*#__PURE__*/React.createElement("svg", {
637
+ width: "16.36",
638
+ height: "19.63",
639
+ viewBox: "0 0 20 24",
640
+ fill: "none",
641
+ xmlns: "http://www.w3.org/2000/svg"
642
+ }, /*#__PURE__*/React.createElement("path", {
643
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
644
+ fill: color
645
+ }), /*#__PURE__*/React.createElement("path", {
646
+ fillRule: "evenodd",
647
+ clipRule: "evenodd",
648
+ d: "M9 15V5H11V15H9Z",
649
+ fill: "white"
650
+ }));
651
+ };
652
+
653
+ const NoDataIcon = () => /*#__PURE__*/React.createElement("svg", {
654
+ width: "16.36",
655
+ height: "19.63",
656
+ viewBox: "0 0 20 24",
657
+ fill: "none",
658
+ xmlns: "http://www.w3.org/2000/svg"
659
+ }, /*#__PURE__*/React.createElement("path", {
660
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
661
+ fill: "#BDBDBD"
662
+ }), /*#__PURE__*/React.createElement("path", {
663
+ fillRule: "evenodd",
664
+ clipRule: "evenodd",
665
+ d: "M16 13H4V11H16V13Z",
666
+ fill: "white"
667
+ }));
668
+
669
+ const IgnoredIcon = () => /*#__PURE__*/React.createElement("svg", {
670
+ width: "16.36",
671
+ height: "19.63",
672
+ viewBox: "0 0 20 24",
673
+ fill: "none",
674
+ xmlns: "http://www.w3.org/2000/svg"
675
+ }, /*#__PURE__*/React.createElement("path", {
676
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
677
+ fill: "#BDBDBD"
678
+ }), /*#__PURE__*/React.createElement("path", {
679
+ d: "M10 6.16666C6.78 6.16666 4.16667 8.77999 4.16667 12C4.16667 15.22 6.78 17.8333 10 17.8333C13.22 17.8333 15.8333 15.22 15.8333 12C15.8333 8.77999 13.22 6.16666 10 6.16666ZM5.33333 12C5.33333 9.42166 7.42167 7.33332 10 7.33332C11.0792 7.33332 12.0708 7.70082 12.8583 8.31916L6.31917 14.8583C5.70083 14.0708 5.33333 13.0792 5.33333 12ZM10 16.6667C8.92083 16.6667 7.92917 16.2992 7.14167 15.6808L13.6808 9.14166C14.2992 9.92916 14.6667 10.9208 14.6667 12C14.6667 14.5783 12.5783 16.6667 10 16.6667Z",
680
+ fill: "white"
681
+ }));
682
+
683
+ const QuestionIcon = () => /*#__PURE__*/React.createElement("svg", {
684
+ width: "16.36",
685
+ height: "19.63",
686
+ viewBox: "0 0 20 24",
687
+ fill: "none",
688
+ xmlns: "http://www.w3.org/2000/svg"
689
+ }, /*#__PURE__*/React.createElement("path", {
690
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
691
+ fill: "#BDBDBD"
692
+ }), /*#__PURE__*/React.createElement("path", {
693
+ d: "M9 17H11V15H9V17ZM10 5C7.79 5 6 6.79 6 9H8C8 7.9 8.9 7 10 7C11.1 7 12 7.9 12 9C12 11 9 10.75 9 14H11C11 11.75 14 11.5 14 9C14 6.79 12.21 5 10 5Z",
694
+ fill: "white"
695
+ }));
696
+
697
+ const EmailIcon = _ref => {
698
+ let {
699
+ color
700
+ } = _ref;
701
+ return /*#__PURE__*/React.createElement("svg", {
702
+ width: "16.36",
703
+ height: "19.63",
704
+ viewBox: "0 0 20 24",
705
+ fill: "none",
706
+ xmlns: "http://www.w3.org/2000/svg"
707
+ }, /*#__PURE__*/React.createElement("path", {
708
+ d: "M10 0L0 4.36364V10.9091C0 16.9636 4.26667 22.6255 10 24C15.7333 22.6255 20 16.9636 20 10.9091V4.36364L10 0Z",
709
+ fill: color
710
+ }), /*#__PURE__*/React.createElement("path", {
711
+ d: "M14.6667 6.33334H5.33333C4.69167 6.33334 4.1725 6.85834 4.1725 7.50001L4.16667 14.5C4.16667 15.1417 4.69167 15.6667 5.33333 15.6667H14.6667C15.3083 15.6667 15.8333 15.1417 15.8333 14.5V7.50001C15.8333 6.85834 15.3083 6.33334 14.6667 6.33334ZM14.6667 14.5H5.33333V8.66668L10 11.5833L14.6667 8.66668V14.5ZM10 10.4167L5.33333 7.50001H14.6667L10 10.4167Z",
712
+ fill: "white"
713
+ }));
714
+ };
715
+
716
+ const COMPONENT_NAME$1 = 'RedSiftShield';
717
+ const CLASSNAME$1 = 'redsift-shield';
718
+ const DEFAULT_PROPS = {
719
+ variant: ShieldVariant.success
720
+ };
721
+ const colors = {
722
+ success: '#4caf50',
723
+ warning: '#FCBB54',
724
+ error: '#e06354',
725
+ primary: '#0075da'
726
+ };
727
+
728
+ /**
729
+ * Variant map to icon.
730
+ */
731
+ const shieldVariantIcons = {
732
+ success: /*#__PURE__*/React.createElement(SuccessIcon, {
733
+ color: colors.success
734
+ }),
735
+ successLocked: /*#__PURE__*/React.createElement(LockedIcon, {
736
+ color: colors.success
737
+ }),
738
+ successUnlocked: /*#__PURE__*/React.createElement(UnlockedIcon, {
739
+ color: colors.success
740
+ }),
741
+ fail: /*#__PURE__*/React.createElement(FailIcon, {
742
+ color: colors.error
743
+ }),
744
+ failLocked: /*#__PURE__*/React.createElement(LockedIcon, {
745
+ color: colors.error
746
+ }),
747
+ failUnlocked: /*#__PURE__*/React.createElement(UnlockedIcon, {
748
+ color: colors.error
749
+ }),
750
+ warning: /*#__PURE__*/React.createElement(WarningIcon, {
751
+ color: colors.warning
752
+ }),
753
+ warningLocked: /*#__PURE__*/React.createElement(LockedIcon, {
754
+ color: colors.warning
755
+ }),
756
+ warningUnlocked: /*#__PURE__*/React.createElement(UnlockedIcon, {
757
+ color: colors.warning
758
+ }),
759
+ noData: /*#__PURE__*/React.createElement(NoDataIcon, null),
760
+ ignored: /*#__PURE__*/React.createElement(IgnoredIcon, null),
761
+ email: /*#__PURE__*/React.createElement(EmailIcon, {
762
+ color: colors.primary
763
+ }),
764
+ question: /*#__PURE__*/React.createElement(QuestionIcon, null)
765
+ };
766
+
767
+ /**
768
+ * The Shield component.
769
+ */
770
+ const Shield = /*#__PURE__*/forwardRef((props, ref) => {
771
+ const shieldRef = ref || useRef();
772
+ const {
773
+ className,
774
+ variant
775
+ } = props;
776
+ return /*#__PURE__*/React.createElement(StyledShield, {
777
+ className: classNames(Shield.className, `${Shield.className}-${variant}`, className),
778
+ ref: shieldRef
779
+ }, shieldVariantIcons[variant]);
780
+ });
781
+ Shield.className = CLASSNAME$1;
782
+ Shield.defaultProps = DEFAULT_PROPS;
783
+ Shield.displayName = COMPONENT_NAME$1;
784
+
785
+ const StyledTextCell = styled.div`
786
+ display: flex;
787
+ align-items: center;
788
+ justify-content: flex-start;
789
+ box-sizing: border-box;
790
+ white-space: nowrap;
791
+ overflow: hidden;
792
+ text-overflow: ellipsis;
793
+
794
+ .redsift-shield {
795
+ margin: 0 8px 0 0;
796
+ }
797
+
798
+ > .redsift-icon {
799
+ margin: 0 8px 0 0;
800
+ width: 16px;
801
+ }
802
+ `;
803
+ const StyledTextCellText = styled.div`
804
+ white-space: nowrap;
805
+ overflow: hidden;
806
+ text-overflow: ellipsis;
807
+ box-sizing: border-box;
808
+ width: 100%;
809
+ `;
810
+
811
+ const _excluded = ["badge", "children", "className", "leftIcon", "leftIconColor", "rightIcon", "rightIconColor", "shieldVariant"];
812
+ const COMPONENT_NAME = 'RedSiftDataGridCell';
813
+ const CLASSNAME = 'redsift-datagrid-cell';
814
+
815
+ /**
816
+ * The Cell component.
817
+ */
818
+ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
819
+ const textCellRef = ref || useRef();
820
+ const {
821
+ badge,
822
+ children,
823
+ className,
824
+ leftIcon,
825
+ leftIconColor,
826
+ rightIcon,
827
+ rightIconColor,
828
+ shieldVariant
829
+ } = props,
830
+ forwardedProps = _objectWithoutProperties(props, _excluded);
831
+ return /*#__PURE__*/React.createElement(StyledTextCell, _extends({}, forwardedProps, {
832
+ className: classNames(TextCell.className, className),
833
+ ref: textCellRef
834
+ }), /*#__PURE__*/React.createElement(React.Fragment, null, shieldVariant ? /*#__PURE__*/React.createElement(Shield, {
835
+ variant: shieldVariant
836
+ }) : null, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
837
+ icon: leftIcon,
838
+ "aria-hidden": "true",
839
+ size: "small",
840
+ color: leftIconColor
841
+ }) : null, /*#__PURE__*/React.createElement(StyledTextCellText, null, children), badge ? badge : null, rightIcon ? /*#__PURE__*/React.createElement(Icon, {
842
+ icon: rightIcon,
843
+ "aria-hidden": "true",
844
+ size: "small",
845
+ color: rightIconColor
846
+ }) : null));
847
+ });
848
+ TextCell.className = CLASSNAME;
849
+ TextCell.displayName = COMPONENT_NAME;
291
850
 
292
- export { DataGrid, Toolbar };
851
+ export { DataGrid, Shield, ShieldVariant, TextCell, Toolbar };
293
852
  //# sourceMappingURL=index.js.map