@indico-data/design-system 2.47.3 → 2.48.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.
Files changed (39) hide show
  1. package/lib/components/index.d.ts +1 -0
  2. package/lib/components/pagination/Pagination.d.ts +2 -0
  3. package/lib/components/pagination/Pagination.stories.d.ts +6 -0
  4. package/lib/components/pagination/__tests__/Pagination.test.d.ts +1 -0
  5. package/lib/components/pagination/index.d.ts +1 -0
  6. package/lib/components/pagination/types.d.ts +6 -0
  7. package/lib/components/table/__tests__/Table.test.d.ts +1 -0
  8. package/lib/components/table/components/TablePagination.d.ts +9 -0
  9. package/lib/components/table/components/__tests__/TablePagination.test.d.ts +1 -0
  10. package/lib/components/table/sampleData.d.ts +2 -0
  11. package/lib/components/table/types.d.ts +5 -4
  12. package/lib/index.css +50 -8
  13. package/lib/index.d.ts +5 -5
  14. package/lib/index.esm.css +50 -8
  15. package/lib/index.esm.js +69 -14
  16. package/lib/index.esm.js.map +1 -1
  17. package/lib/index.js +68 -13
  18. package/lib/index.js.map +1 -1
  19. package/package.json +1 -1
  20. package/src/components/index.ts +1 -0
  21. package/src/components/pagination/Pagination.mdx +31 -0
  22. package/src/components/pagination/Pagination.stories.tsx +80 -0
  23. package/src/components/pagination/Pagination.tsx +117 -0
  24. package/src/components/pagination/__tests__/Pagination.test.tsx +91 -0
  25. package/src/components/pagination/index.ts +1 -0
  26. package/src/components/pagination/styles/Pagination.scss +22 -0
  27. package/src/components/pagination/types.ts +6 -0
  28. package/src/components/table/Table.mdx +2 -0
  29. package/src/components/table/Table.stories.tsx +20 -28
  30. package/src/components/table/Table.tsx +9 -1
  31. package/src/components/table/__tests__/Table.test.tsx +10 -0
  32. package/src/components/table/components/TablePagination.tsx +44 -0
  33. package/src/components/table/components/__tests__/TablePagination.test.tsx +17 -0
  34. package/src/components/table/sampleData.ts +110 -0
  35. package/src/components/table/styles/Table.scss +40 -9
  36. package/src/components/table/styles/_variables.scss +1 -0
  37. package/src/components/table/types.ts +6 -6
  38. package/src/setup/setupIcons.ts +4 -0
  39. package/src/styles/index.scss +1 -0
@@ -12,7 +12,7 @@
12
12
 
13
13
  .table {
14
14
  border-radius: var(--pf-rounded);
15
- border: var(--pf-border-sm) solid var(--pf-table-border-color);
15
+ background-color: var(--pf-table-background-color);
16
16
 
17
17
  &--full-height {
18
18
  height: 100%;
@@ -26,17 +26,39 @@
26
26
  color: var(--pf-table-font-color);
27
27
  border-radius: var(--pf-rounded) !important;
28
28
  border: var(--pf-border-sm) solid var(--pf-table-border-color);
29
+ height: 100%;
30
+
31
+ // Webkit scrollbar styles
32
+ &::-webkit-scrollbar {
33
+ width: var(--pf-size-2);
34
+ height: var(--pf-size-2);
35
+ cursor: pointer;
36
+ }
37
+
38
+ &::-webkit-scrollbar-track {
39
+ background: var(--pf-table-background-color);
40
+ border-radius: var(--pf-rounded);
41
+ cursor: pointer;
42
+ }
43
+
44
+ &::-webkit-scrollbar-thumb {
45
+ background: var(--pf-table-border-color);
46
+ border-radius: var(--pf-rounded);
47
+ cursor: pointer;
48
+ &:hover {
49
+ background: var(--pf-primary-color);
50
+ }
51
+ }
52
+
53
+ // Firefox scrollbar styles
54
+ scrollbar-width: thin;
55
+ scrollbar-color: var(--pf-table-border-color) var(--pf-table-background-color);
29
56
  }
30
57
 
31
58
  & > *:nth-child(3) {
32
59
  margin-top: auto;
33
60
  background-color: transparent;
34
61
  border: none;
35
-
36
- .rdt_Pagination {
37
- background-color: transparent;
38
- border: none;
39
- }
40
62
  }
41
63
  .rdt_Table,
42
64
  .rdt_TableRow,
@@ -48,8 +70,7 @@
48
70
  .rdt_TableHead,
49
71
  .rdt_TableHeadRow,
50
72
  .rdt_TableBody,
51
- .rdt_ExpanderRow,
52
- .rdt_Pagination {
73
+ .rdt_ExpanderRow {
53
74
  background-color: var(--pf-table-background-color);
54
75
  color: var(--pf-table-font-color);
55
76
  }
@@ -68,7 +89,8 @@
68
89
 
69
90
  .rdt_TableHeader {
70
91
  border-radius: var(--pf-rounded) 0;
71
- border-bottom: var(--pf-border-sm) solid var(--pf-table-border-color);
92
+ border: var(--pf-border-sm) solid var(--pf-table-border-color);
93
+ border-bottom: none;
72
94
  }
73
95
 
74
96
  .rdt_TableHeadRow,
@@ -127,3 +149,12 @@
127
149
  }
128
150
  }
129
151
  }
152
+
153
+ .table__pagination {
154
+ padding-bottom: var(--pf-padding-4);
155
+ padding-top: var(--pf-padding-4);
156
+ background-color: var(--pf-table-pagination-background-color);
157
+ padding-left: var(
158
+ --pf-padding-4
159
+ ); // buttons have a visual illusion of having a gap, so we add padding to adjust the left side when the total results exist
160
+ }
@@ -27,4 +27,5 @@
27
27
  --pf-table-highlighted-color: var(--pf-primary-color);
28
28
  --pf-table-highlighted-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 8px 16px rgba(0, 0, 0, 0.3);
29
29
  --pf-table-font-size: var(--pf-font-size-body2);
30
+ --pf-table-pagination-background-color: var(--pf-primary-color-700);
30
31
  }
@@ -3,19 +3,19 @@ import {
3
3
  Direction as RDTDirection,
4
4
  Alignment as RDTAlignment,
5
5
  TableColumn as RDTTableColumn,
6
+ IDataTableProps,
6
7
  } from 'react-data-table-component';
7
8
 
8
9
  export type Direction = `${RDTDirection}`;
9
10
  export type Alignment = `${RDTAlignment}`;
10
11
  export type TableColumn<T> = RDTTableColumn<T>;
11
12
 
12
- export type TableProps<T> = Omit<
13
- RDTTableProps<T>,
14
- 'disabled' | 'progressPending' | 'direction' | 'subHeaderAlign'
15
- > & {
13
+ export interface TableProps<T>
14
+ extends Omit<IDataTableProps<T>, 'paginationComponent' | 'direction' | 'subHeaderAlign'> {
16
15
  isDisabled?: boolean;
17
16
  isLoading?: boolean;
18
17
  direction?: Direction;
19
- subHeaderAlign?: Alignment;
18
+ subHeaderAlign?: 'left' | 'right' | 'center';
20
19
  isFullHeight?: boolean;
21
- };
20
+ totalEntriesText?: string;
21
+ }
@@ -23,6 +23,8 @@ import {
23
23
  faQuestionCircle,
24
24
  faCopy,
25
25
  faXmark,
26
+ faChevronLeft,
27
+ faChevronRight,
26
28
  } from '@fortawesome/free-solid-svg-icons';
27
29
  import { indiconDefinitions } from '@/components/icons/indicons';
28
30
 
@@ -54,6 +56,8 @@ registerFontAwesomeIcons(
54
56
  faQuestionCircle,
55
57
  faCopy,
56
58
  faXmark,
59
+ faChevronLeft,
60
+ faChevronRight,
57
61
  // backwards compat, don't require registration of custom indicons
58
62
  // might want to consider doing so in the future
59
63
  ...indiconDefinitions,
@@ -23,6 +23,7 @@
23
23
  @import '../components/forms/date/datePicker/styles/DatePicker.scss';
24
24
  @import '../components/badge/styles/Badge.scss';
25
25
  @import '../components/modal/styles/Modal.scss';
26
+ @import '../components/pagination/styles/Pagination.scss';
26
27
 
27
28
  @import '../components/pill/styles/Pill.scss';
28
29
  @import 'sheets'; // Port to an sheets component when we build it