@centreon/ui 25.3.3 → 25.4.0-MON-191119-npm-develop.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 (187) hide show
  1. package/package.json +25 -11
  2. package/public/mockServiceWorker.js +8 -31
  3. package/src/ActionsList/index.tsx +1 -0
  4. package/src/Button/Icon/index.tsx +3 -1
  5. package/src/Button/Save/index.stories.tsx +1 -0
  6. package/src/Checkbox/Checkbox.tsx +3 -1
  7. package/src/Checkbox/CheckboxGroup/index.tsx +6 -1
  8. package/src/Colors/index.tsx +1 -1
  9. package/src/Dashboard/Dashboard.styles.ts +1 -1
  10. package/src/Dashboard/Layout.tsx +1 -1
  11. package/src/Dialog/UnsavedChanges/index.stories.tsx +1 -0
  12. package/src/Form/CollapsibleGroup.tsx +13 -13
  13. package/src/Form/Form.cypress.spec.tsx +137 -2
  14. package/src/Form/Form.stories.tsx +11 -31
  15. package/src/Form/Form.tsx +2 -0
  16. package/src/Form/Inputs/Checkbox.tsx +3 -2
  17. package/src/Form/Inputs/ConnectedAutocomplete.tsx +6 -1
  18. package/src/Form/Inputs/Grid.tsx +18 -29
  19. package/src/Form/Inputs/SubGroupDivider.tsx +7 -0
  20. package/src/Form/Inputs/Text.tsx +1 -0
  21. package/src/Form/Inputs/index.tsx +31 -24
  22. package/src/Form/Inputs/models.ts +8 -1
  23. package/src/Form/Section/FormSection.tsx +34 -0
  24. package/src/Form/Section/PanelTabs.tsx +13 -0
  25. package/src/Form/Section/navigateToSection.ts +9 -0
  26. package/src/Form/storiesData.tsx +14 -4
  27. package/src/Graph/BarChart/BarChart.cypress.spec.tsx +46 -6
  28. package/src/Graph/BarChart/BarChart.stories.tsx +60 -0
  29. package/src/Graph/BarChart/BarChart.tsx +56 -32
  30. package/src/Graph/BarChart/BarGroup.tsx +22 -32
  31. package/src/Graph/BarChart/MemoizedGroup.tsx +8 -11
  32. package/src/Graph/BarChart/ResponsiveBarChart.tsx +145 -32
  33. package/src/Graph/BarChart/Tooltip/BarChartTooltip.tsx +2 -2
  34. package/src/Graph/Chart/BasicComponents/Lines/StackedLines/index.tsx +7 -1
  35. package/src/Graph/Chart/BasicComponents/Lines/StackedLines/useStackedLines.ts +18 -45
  36. package/src/Graph/Chart/BasicComponents/Lines/index.tsx +42 -28
  37. package/src/Graph/Chart/Chart.cypress.spec.tsx +85 -15
  38. package/src/Graph/Chart/Chart.stories.tsx +84 -1
  39. package/src/Graph/Chart/Chart.tsx +17 -4
  40. package/src/Graph/Chart/InteractiveComponents/AnchorPoint/RegularAnchorPoint.tsx +8 -2
  41. package/src/Graph/Chart/InteractiveComponents/AnchorPoint/StackedAnchorPoint.tsx +10 -3
  42. package/src/Graph/Chart/InteractiveComponents/AnchorPoint/useTickGraph.ts +19 -2
  43. package/src/Graph/Chart/InteractiveComponents/Annotations/Annotation/index.tsx +1 -1
  44. package/src/Graph/Chart/InteractiveComponents/GraphValueTooltip/useGraphValueTooltip.ts +2 -4
  45. package/src/Graph/Chart/InteractiveComponents/ZoomPreview/index.tsx +14 -3
  46. package/src/Graph/Chart/InteractiveComponents/ZoomPreview/models.ts +3 -0
  47. package/src/Graph/Chart/InteractiveComponents/ZoomPreview/useZoomPreview.ts +12 -10
  48. package/src/Graph/Chart/InteractiveComponents/index.tsx +63 -5
  49. package/src/Graph/Chart/Legend/index.tsx +26 -2
  50. package/src/Graph/Chart/helpers/index.ts +4 -3
  51. package/src/Graph/Chart/index.tsx +45 -45
  52. package/src/Graph/Chart/models.ts +8 -0
  53. package/src/Graph/Chart/useChartData.ts +14 -2
  54. package/src/Graph/Gauge/Gauge.tsx +18 -14
  55. package/src/Graph/Gauge/ResponsiveGauge.tsx +10 -6
  56. package/src/Graph/Gauge/useResizeObserver.ts +68 -0
  57. package/src/Graph/SingleBar/ResponsiveSingleBar.tsx +18 -16
  58. package/src/Graph/SingleBar/ThresholdLine.tsx +4 -4
  59. package/src/Graph/SingleBar/models.ts +1 -0
  60. package/src/Graph/Text/Text.styles.ts +2 -2
  61. package/src/Graph/Text/Text.tsx +23 -10
  62. package/src/Graph/Timeline/ResponsiveTimeline.tsx +4 -0
  63. package/src/Graph/Timeline/Timeline.tsx +21 -4
  64. package/src/Graph/Tree/Links.tsx +2 -2
  65. package/src/Graph/Tree/Tree.tsx +2 -2
  66. package/src/Graph/Tree/constants.ts +1 -1
  67. package/src/Graph/common/BaseChart/BaseChart.tsx +6 -1
  68. package/src/Graph/common/BaseChart/ChartSvgWrapper.tsx +5 -4
  69. package/src/Graph/common/BaseChart/Header/index.tsx +3 -1
  70. package/src/Graph/common/BaseChart/useComputeBaseChartDimensions.ts +13 -9
  71. package/src/Graph/common/timeSeries/index.test.ts +20 -0
  72. package/src/Graph/common/timeSeries/index.ts +225 -44
  73. package/src/Graph/common/timeSeries/models.ts +6 -2
  74. package/src/Graph/common/utils.ts +45 -12
  75. package/src/Graph/index.ts +3 -1
  76. package/src/Graph/mockedData/dataWithMissingPoint.json +74 -0
  77. package/src/Graph/mockedData/pingServiceWithStackedKeys.json +205 -0
  78. package/src/Icon/RegexIcon.tsx +20 -0
  79. package/src/Icon/index.ts +1 -0
  80. package/src/InputField/Select/Autocomplete/Connected/Multi/MultiConnectedAutocompleteField.cypress.spec.tsx +68 -14
  81. package/src/InputField/Select/Autocomplete/Connected/index.tsx +49 -14
  82. package/src/InputField/Select/Autocomplete/Multi/Listbox.tsx +78 -0
  83. package/src/InputField/Select/Autocomplete/Multi/Multi.styles.ts +26 -0
  84. package/src/InputField/Select/Autocomplete/Multi/Multi.tsx +124 -0
  85. package/src/InputField/Select/Autocomplete/Multi/index.tsx +1 -117
  86. package/src/InputField/Select/Autocomplete/index.tsx +28 -17
  87. package/src/InputField/Select/Option.tsx +3 -3
  88. package/src/InputField/Select/index.tsx +4 -0
  89. package/src/InputField/Text/index.tsx +4 -2
  90. package/src/InputField/translatedLabels.ts +4 -0
  91. package/src/Listing/ActionBar/Pagination.tsx +10 -23
  92. package/src/Listing/ActionBar/PaginationActions.tsx +1 -10
  93. package/src/Listing/ActionBar/index.tsx +1 -1
  94. package/src/Listing/Cell/DataCell.tsx +6 -6
  95. package/src/Listing/Cell/EllipsisTypography.tsx +10 -32
  96. package/src/Listing/Cell/index.tsx +57 -89
  97. package/src/Listing/Checkbox.tsx +8 -20
  98. package/src/Listing/Header/Cell/ListingHeaderCell.tsx +17 -14
  99. package/src/Listing/Header/Cell/SelectActionListingHeaderCell.tsx +5 -9
  100. package/src/Listing/Header/ListingHeader.tsx +2 -5
  101. package/src/Listing/Header/_internals/Label.tsx +1 -17
  102. package/src/Listing/Row/EmptyRow.tsx +2 -6
  103. package/src/Listing/Row/Row.tsx +7 -36
  104. package/src/Listing/index.stories.tsx +1 -0
  105. package/src/Listing/index.tsx +26 -26
  106. package/src/Listing/useStyleTable.ts +58 -32
  107. package/src/ListingPage/index.stories.tsx +1 -0
  108. package/src/Module/index.tsx +8 -2
  109. package/src/MultiSelectEntries/index.stories.tsx +1 -0
  110. package/src/MultiSelectEntries/index.tsx +1 -1
  111. package/src/Pagination/Pagination.cypress.spec.tsx +137 -0
  112. package/src/Pagination/Pagination.stories.tsx +46 -0
  113. package/src/Pagination/Pagination.styles.ts +56 -0
  114. package/src/Pagination/Pagination.tsx +146 -0
  115. package/src/Pagination/index.ts +3 -0
  116. package/src/Pagination/utils.ts +7 -0
  117. package/src/SortableItems/index.stories.tsx +2 -2
  118. package/src/StoryBookThemeProvider/index.tsx +3 -1
  119. package/src/ThemeProvider/base.css +49 -0
  120. package/src/ThemeProvider/index.tsx +21 -47
  121. package/src/ThemeProvider/palettes.ts +5 -3
  122. package/src/ThemeProvider/tailwindcss.css +230 -0
  123. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +9 -11
  124. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +1 -0
  125. package/src/TimePeriods/DateTimePickerInput.tsx +3 -1
  126. package/src/api/customFetch.ts +0 -9
  127. package/src/api/models.ts +9 -0
  128. package/src/api/useBulkResponse.ts +58 -0
  129. package/src/api/useGraphQuery/index.ts +108 -12
  130. package/src/components/Avatar/Avatar.stories.tsx +1 -0
  131. package/src/components/Button/Button.module.css +38 -0
  132. package/src/components/Button/Button.stories.tsx +25 -0
  133. package/src/components/Button/Button.tsx +2 -5
  134. package/src/components/CrudPage/Actions/Actions.styles.ts +15 -1
  135. package/src/components/CrudPage/Actions/Actions.tsx +7 -4
  136. package/src/components/CrudPage/Actions/Search.tsx +15 -14
  137. package/src/components/CrudPage/CrudPage.stories.tsx +1 -0
  138. package/src/components/CrudPage/CrudPageRoot.tsx +1 -1
  139. package/src/components/DataTable/DataTable.stories.tsx +1 -0
  140. package/src/components/DataTable/EmptyState/DataTableEmptyState.stories.tsx +1 -0
  141. package/src/components/DataTable/EmptyState/DataTableEmptyState.styles.ts +3 -1
  142. package/src/components/DataTable/EmptyState/DataTableEmptyState.tsx +4 -1
  143. package/src/components/DataTable/Item/DataTableItem.stories.tsx +1 -0
  144. package/src/components/Form/AccessRights/AccessRights.stories.tsx +1 -0
  145. package/src/components/Form/AccessRights/ShareInput/ShareInput.tsx +4 -3
  146. package/src/components/Form/AccessRights/ShareInput/useShareInput.tsx +15 -10
  147. package/src/components/Form/FormActions.tsx +21 -12
  148. package/src/components/Header/PageHeader/PageHeader.styles.ts +5 -5
  149. package/src/components/Layout/AreaIndicator.tsx +4 -6
  150. package/src/components/Layout/PageLayout/PageLayout.stories.tsx +1 -0
  151. package/src/components/Layout/PageLayout/PageLayout.styles.ts +1 -1
  152. package/src/components/Layout/PageLayout/PageLayout.tsx +9 -3
  153. package/src/components/Layout/PageLayout/PageLayoutActions.tsx +5 -3
  154. package/src/components/Layout/PageLayout/PageLayoutBody.tsx +5 -3
  155. package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +5 -3
  156. package/src/components/Layout/PageLayout/PageQuickAccess.tsx +17 -17
  157. package/src/components/Menu/Button/MenuButton.tsx +6 -6
  158. package/src/components/Menu/MenuDivider.tsx +1 -5
  159. package/src/components/Menu/MenuItem.tsx +1 -5
  160. package/src/components/Menu/MenuItems.tsx +5 -4
  161. package/src/components/Modal/ConfirmationModal/ConfirmationModal.stories.tsx +1 -0
  162. package/src/components/Modal/ConfirmationModal/ConfirmationModal.tsx +4 -1
  163. package/src/components/Modal/Modal.stories.tsx +21 -0
  164. package/src/components/Modal/Modal.styles.ts +1 -19
  165. package/src/components/Modal/Modal.tsx +1 -1
  166. package/src/components/Modal/ModalBody.tsx +6 -4
  167. package/src/components/Modal/ModalHeader.tsx +9 -5
  168. package/src/components/Modal/modal.module.css +16 -0
  169. package/src/components/Tabs/Tab.styles.ts +0 -6
  170. package/src/components/Tabs/Tabs.tsx +37 -15
  171. package/src/index.ts +4 -0
  172. package/src/queryParameters/url/index.ts +7 -2
  173. package/src/utils/index.ts +1 -0
  174. package/src/utils/useLocale/index.ts +9 -0
  175. package/src/utils/useLocale/useLocale.cypress.spec.tsx +38 -0
  176. package/src/utils/useLocaleDateTimeFormat/index.ts +4 -2
  177. package/src/utils/usePluralizedTranslation.ts +2 -3
  178. package/src/Listing/Cell/DataCell.styles.ts +0 -27
  179. package/src/Listing/Header/Cell/ListingHeaderCell.styles.ts +0 -71
  180. package/src/Listing/Header/Cell/SelectActionListingHeaderCell.styles.ts +0 -26
  181. package/src/Listing/Header/ListingHeader.styles.ts +0 -16
  182. package/src/Listing/Listing.styles.ts +0 -78
  183. package/src/Listing/Row/EmptyRow.styles.ts +0 -14
  184. package/src/components/Button/Button.styles.ts +0 -44
  185. package/src/components/Layout/AreaIndicator.styles.ts +0 -33
  186. package/src/components/Menu/Button/MenuButton.styles.ts +0 -27
  187. package/src/components/Menu/Menu.styles.ts +0 -68
@@ -1,7 +1,6 @@
1
1
  import { useAtom } from 'jotai';
2
- import { append, equals, includes, isNil, omit, reject } from 'ramda';
2
+ import { append, equals, includes, isNil, reject } from 'ramda';
3
3
  import { CSSObject } from 'tss-react';
4
- import { makeStyles } from 'tss-react/mui';
5
4
 
6
5
  import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
7
6
  import {
@@ -9,7 +8,8 @@ import {
9
8
  TableCellBaseProps,
10
9
  TableCellProps,
11
10
  Theme,
12
- alpha
11
+ alpha,
12
+ useTheme
13
13
  } from '@mui/material';
14
14
 
15
15
  import { ListingVariant } from '@centreon/ui-context';
@@ -25,6 +25,13 @@ interface GetBackgroundColorProps extends Omit<Props, 'isRowHighlighted'> {
25
25
  theme: Theme;
26
26
  }
27
27
 
28
+ interface GetRowHighlightStyleProps {
29
+ isRowHighlighted?: boolean;
30
+ theme: Theme;
31
+ disableRowCondition;
32
+ row;
33
+ }
34
+
28
35
  const getBackgroundColor = ({
29
36
  isRowHovered,
30
37
  row,
@@ -51,73 +58,20 @@ const getBackgroundColor = ({
51
58
  return 'unset';
52
59
  };
53
60
 
54
- interface StylesProps extends Props {
55
- isRowHighlighted?: boolean;
56
- listingVariant?: ListingVariant;
57
- }
58
-
59
- interface GetRowHighlightStyleProps {
60
- isRowHighlighted?: boolean;
61
- theme: Theme;
62
- }
63
-
64
- const getRowHighlightStyle = ({
61
+ const getRowTextColor = ({
65
62
  isRowHighlighted,
66
- theme
67
- }: GetRowHighlightStyleProps): CSSObject | undefined =>
68
- isRowHighlighted
69
- ? {
70
- color: theme.palette.text.primary
71
- }
72
- : undefined;
73
-
74
- const useStyles = makeStyles<StylesProps>()(
75
- (
76
- theme,
77
- {
78
- isRowHovered,
79
- row,
80
- rowColorConditions,
81
- disableRowCondition,
82
- isRowHighlighted,
83
- listingVariant
84
- }
85
- ) => ({
86
- caret: {
87
- transition: theme.transitions.create('transform', {
88
- duration: theme.transitions.duration.short
89
- })
90
- },
91
- caretLess: {
92
- transform: 'rotate3d(0,0,1,0deg)'
93
- },
94
- caretMore: {
95
- transform: 'rotate3d(0,0,1,180deg)'
96
- },
97
- root: {
98
- alignItems: 'center',
99
- backgroundColor: getBackgroundColor({
100
- disableRowCondition,
101
- isRowHovered,
102
- row,
103
- rowColorConditions,
104
- theme
105
- }),
106
- borderBottom: `1px solid ${theme.palette.divider}`,
107
- display: 'flex',
108
- 'div:nth-of-type(n)': {
109
- alignItems: 'center',
110
- display: 'flex'
111
- },
112
- height: '100%',
113
- overflow: 'hidden',
114
- ...getTextStyleByViewMode({ listingVariant, theme }),
115
- p: getRowHighlightStyle({ isRowHighlighted, theme }),
116
- padding: theme.spacing(0, 1),
117
- whiteSpace: 'nowrap'
118
- }
119
- })
120
- );
63
+ theme,
64
+ disableRowCondition,
65
+ row
66
+ }: GetRowHighlightStyleProps): CSSObject | undefined => {
67
+ if (isRowHighlighted) {
68
+ return { color: theme.palette.text.primary };
69
+ }
70
+
71
+ if (disableRowCondition(row)) {
72
+ return { color: alpha(theme.palette.text.secondary, 0.5) };
73
+ }
74
+ };
121
75
 
122
76
  interface Props
123
77
  extends Pick<
@@ -153,15 +107,22 @@ const Cell = ({
153
107
  subItemsRowProperty,
154
108
  labelCollapse,
155
109
  labelExpand,
110
+ disableRowCondition,
111
+ isRowHovered,
112
+ isRowHighlighted,
113
+ rowColorConditions,
114
+ listingVariant,
115
+ row,
116
+ style,
156
117
  ...props
157
118
  }: Props): JSX.Element => {
158
- const { classes, cx } = useStyles(props);
119
+ const theme = useTheme();
159
120
 
160
121
  const [subItemsPivots, setSubItemsPivots] = useAtom(subItemsPivotsAtom);
161
122
 
162
123
  const { children } = props;
163
124
 
164
- const rowId = props.row?.id;
125
+ const rowId = row?.id;
165
126
 
166
127
  const click = (e): void => {
167
128
  e.preventDefault();
@@ -174,39 +135,46 @@ const Cell = ({
174
135
 
175
136
  const isSubItemsExpanded = isPivotExistInTheList(rowId)(subItemsPivots);
176
137
 
177
- const hasSubItems = subItemsRowProperty && props.row[subItemsRowProperty];
138
+ const hasSubItems = subItemsRowProperty && row[subItemsRowProperty];
178
139
 
179
140
  return (
180
141
  <TableCell
142
+ style={{
143
+ backgroundColor: getBackgroundColor({
144
+ disableRowCondition,
145
+ isRowHovered,
146
+ row,
147
+ rowColorConditions,
148
+ theme
149
+ }),
150
+ ...getTextStyleByViewMode({
151
+ listingVariant,
152
+ theme
153
+ }),
154
+ ...getRowTextColor({
155
+ isRowHighlighted,
156
+ disableRowCondition,
157
+ row,
158
+ theme
159
+ }),
160
+ ...style
161
+ }}
181
162
  classes={{
182
- root: cx(classes.root)
163
+ root: 'flex items-center h-full overflow-hidden border-b-1 border-divider px-2 whitespace-nowrap py-0'
183
164
  }}
184
165
  component={'div' as unknown as ElementType<TableCellBaseProps>}
185
- {...omit(
186
- [
187
- 'isRowHovered',
188
- 'row',
189
- 'rowColorConditions',
190
- 'disableRowCondition',
191
- 'isRowHighlighted',
192
- 'listingVariant'
193
- ],
194
- props
195
- )}
166
+ {...props}
196
167
  >
197
168
  {displaySubItemsCaret && hasSubItems && (
198
169
  <IconButton
199
170
  ariaLabel={`${isSubItemsExpanded ? labelCollapse : labelExpand} ${
200
- props.row.id
171
+ row.id
201
172
  }`}
202
173
  size="small"
203
174
  onClick={click}
204
175
  >
205
176
  <ExpandMoreIcon
206
- className={cx(
207
- classes.caret,
208
- isSubItemsExpanded ? classes.caretMore : classes.caretLess
209
- )}
177
+ className={`transition-transform ${isSubItemsExpanded ? 'rotate-z-180' : 'rotate-z-0'} transform-gpu`}
210
178
  fontSize="small"
211
179
  />
212
180
  </IconButton>
@@ -1,30 +1,18 @@
1
- import { makeStyles } from 'tss-react/mui';
2
-
3
1
  import { CheckboxProps, Checkbox as MuiCheckbox } from '@mui/material';
4
2
 
5
- const useStyles = makeStyles()({
6
- container: {
7
- padding: 0
8
- }
9
- });
10
-
11
3
  const Checkbox = ({
12
4
  className,
13
5
  ...props
14
6
  }: { className?: string } & Omit<
15
7
  CheckboxProps,
16
8
  'size' | 'color'
17
- >): JSX.Element => {
18
- const { classes, cx } = useStyles();
19
-
20
- return (
21
- <MuiCheckbox
22
- className={cx(classes.container, className)}
23
- color="primary"
24
- size="small"
25
- {...props}
26
- />
27
- );
28
- };
9
+ >): JSX.Element => (
10
+ <MuiCheckbox
11
+ className={`p-0 ${className}`}
12
+ color="primary"
13
+ size="small"
14
+ {...props}
15
+ />
16
+ );
29
17
 
30
18
  export default Checkbox;
@@ -12,7 +12,8 @@ import { Column } from '../../models';
12
12
  import { DraggableIconButton } from '../_internals/DraggableIconButton';
13
13
  import HeaderLabel from '../_internals/Label';
14
14
 
15
- import { StylesProps, useStyles } from './ListingHeaderCell.styles';
15
+ import useStyleTable from '../../useStyleTable';
16
+ import { StylesProps } from './ListingHeaderCell.styles';
16
17
 
17
18
  type Props = Pick<
18
19
  ListingProps<unknown>,
@@ -39,11 +40,7 @@ const ListingHeaderCell = ({
39
40
  listingVariant,
40
41
  ...props
41
42
  }: Props): JSX.Element => {
42
- const { classes, cx } = useStyles({
43
- isDragging,
44
- isInDragOverlay,
45
- listingVariant
46
- });
43
+ const { dataStyle } = useStyleTable({ listingVariant });
47
44
  const columnLabel = column.shortLabel || column.label;
48
45
 
49
46
  const columnSortField = column.sortField || column.id;
@@ -72,32 +69,38 @@ const ListingHeaderCell = ({
72
69
 
73
70
  return (
74
71
  <TableCell
75
- className={classes.tableCell}
72
+ className={`bg-background-listing-header border-b-0 h-[inherit] py-0 px-2 ${isInDragOverlay && 'block opacity-70'}`}
76
73
  component={'div' as unknown as React.ElementType<TableCellBaseProps>}
77
- data-isdragging={isDragging}
78
- data-isindragoverlay={isInDragOverlay}
79
74
  ref={itemRef}
80
- style={style}
75
+ style={{
76
+ ...style,
77
+ height: dataStyle.header.height
78
+ }}
81
79
  >
82
- <div className={classes.content}>
80
+ <div className="flex items-center h-full justify-between text-white p-0">
83
81
  {column.sortable ? (
84
82
  <TableSortLabel
85
83
  active={sortField === columnSortField}
86
84
  aria-label={`Column ${column.label}`}
87
- className={classes.active}
85
+ className="text-white"
86
+ classes={{
87
+ icon: 'text-white'
88
+ }}
88
89
  direction={sortOrder || 'desc'}
89
90
  onClick={sort}
90
91
  >
91
92
  {headerContent}
92
93
  </TableSortLabel>
93
94
  ) : (
94
- <div className={classes.simpleHeaderCellContent}>{headerContent}</div>
95
+ <div className="mr-4 inline-flex items-center select-none">
96
+ {headerContent}
97
+ </div>
95
98
  )}
96
99
 
97
100
  {columnConfiguration?.sortable && areColumnsEditable && (
98
101
  <DraggableIconButton
99
102
  {...props}
100
- className={cx(classes.dragHandle, 'dragHandle')}
103
+ className={`p-0 ${isDragging ? 'cursor-grabbing' : 'cursor-grab'} text-white opacity-0 hover:opacity-100 focus:opacity-100`}
101
104
  columnLabel={columnLabel}
102
105
  />
103
106
  )}
@@ -9,8 +9,6 @@ import { PredefinedRowSelection } from '../../models';
9
9
  import { labelPredefinedRowsSelectionMenu } from '../../translatedLabels';
10
10
  import PredefinedSelectionList from '../_internals/PredefinedSelectionList';
11
11
 
12
- import { useStyles } from './SelectActionListingHeaderCell.styles';
13
-
14
12
  export interface SelectActionListingHeaderCellProps {
15
13
  onSelectAllClick: (event) => void;
16
14
  onSelectRowsWithCondition: (condition) => void;
@@ -26,27 +24,25 @@ const SelectActionListingHeaderCell = ({
26
24
  predefinedRowsSelection,
27
25
  onSelectRowsWithCondition
28
26
  }: SelectActionListingHeaderCellProps): JSX.Element => {
29
- const { classes } = useStyles();
30
-
31
27
  const hasRows = not(equals(rowCount, 0));
32
28
 
33
29
  return (
34
30
  <TableCell
35
- className={classes.checkboxHeaderCell}
31
+ className="bg-background-listing-header h-full pt-0 pr-1 pb-0 pl-3 flex flex-row items-center leading=[inherit] justify-start border-b-0"
36
32
  component={'div' as unknown as React.ElementType<TableCellBaseProps>}
37
33
  >
38
34
  <Checkbox
39
35
  checked={hasRows && selectedRowCount === rowCount}
40
- className={classes.checkbox}
36
+ className="text-white"
41
37
  indeterminate={
42
38
  hasRows && selectedRowCount > 0 && selectedRowCount < rowCount
43
39
  }
44
- inputProps={{ 'aria-label': 'Select all' }}
40
+ slotProps={{ input: { 'aria-label': 'Select all' } }}
45
41
  onChange={onSelectAllClick}
46
42
  />
47
43
  {not(isEmpty(predefinedRowsSelection)) ? (
48
44
  <PopoverMenu
49
- className={classes.predefinedRowsMenu}
45
+ className="text-white"
50
46
  icon={<ArrowDropDownIcon />}
51
47
  title={labelPredefinedRowsSelectionMenu}
52
48
  >
@@ -59,7 +55,7 @@ const SelectActionListingHeaderCell = ({
59
55
  )}
60
56
  </PopoverMenu>
61
57
  ) : (
62
- <div className={classes.predefinedRowsMenu} />
58
+ <div className="text-white" />
63
59
  )}
64
60
  </TableCell>
65
61
  );
@@ -16,7 +16,6 @@ import {
16
16
  SelectActionListingHeaderCell,
17
17
  SelectActionListingHeaderCellProps
18
18
  } from './Cell/SelectActionListingHeaderCell';
19
- import { useStyles } from './ListingHeader.styles';
20
19
 
21
20
  type Props = Pick<
22
21
  ListingProps<unknown>,
@@ -62,8 +61,6 @@ const ListingHeader = ({
62
61
  predefinedRowsSelection,
63
62
  onSelectRowsWithCondition
64
63
  }: Props): JSX.Element => {
65
- const { classes, cx } = useStyles();
66
-
67
64
  const visibleColumns = getVisibleColumns({
68
65
  columnConfiguration,
69
66
  columns
@@ -105,8 +102,8 @@ const ListingHeader = ({
105
102
  );
106
103
 
107
104
  return (
108
- <TableHead className={cx(classes.row, 'listingHeader')} component="div">
109
- <TableRow className={classes.row} component="div">
105
+ <TableHead className="contents" component="div">
106
+ <TableRow className="contents" component="div">
110
107
  {checkable && (
111
108
  <SelectActionListingHeaderCell
112
109
  predefinedRowsSelection={predefinedRowsSelection}
@@ -1,14 +1,6 @@
1
- import { makeStyles } from 'tss-react/mui';
2
-
3
1
  import { Typography, TypographyProps } from '@mui/material';
4
2
  import { ReactNode } from 'react';
5
3
 
6
- const useStyles = makeStyles()(() => ({
7
- root: {
8
- fontWeight: 'bold'
9
- }
10
- }));
11
-
12
4
  interface Props {
13
5
  children: ReactNode;
14
6
  }
@@ -17,16 +9,8 @@ const HeaderLabel = ({
17
9
  children,
18
10
  className
19
11
  }: Props & Pick<TypographyProps, 'className'>): JSX.Element => {
20
- const { classes } = useStyles();
21
-
22
12
  return (
23
- <Typography
24
- className={className}
25
- classes={{
26
- root: classes.root
27
- }}
28
- variant="body2"
29
- >
13
+ <Typography className={`font-bold ${className}`} variant="body2">
30
14
  {children}
31
15
  </Typography>
32
16
  );
@@ -4,20 +4,16 @@ import { TableRow } from '@mui/material';
4
4
 
5
5
  import Cell from '../Cell';
6
6
 
7
- import { useStyles } from './EmptyRow.styles';
8
-
9
7
  interface EmptyRowProps {
10
8
  children: ReactNode;
11
9
  }
12
10
 
13
11
  const EmptyRow = ({ children }: EmptyRowProps): JSX.Element => {
14
- const { classes } = useStyles();
15
-
16
12
  return (
17
- <TableRow className={classes.emptyDataRow} component="div" tabIndex={-1}>
13
+ <TableRow className="contents" component="div" tabIndex={-1}>
18
14
  <Cell
19
15
  align="center"
20
- className={classes.emptyDataCell}
16
+ className="col-span-full flex justify-center"
21
17
  disableRowCondition={(): boolean => false}
22
18
  isRowHovered={false}
23
19
  >
@@ -3,7 +3,6 @@
3
3
  import { memo, useEffect, useRef } from 'react';
4
4
 
5
5
  import { equals, gte, lt, not, pluck } from 'ramda';
6
- import { makeStyles } from 'tss-react/mui';
7
6
 
8
7
  import { TableRow, TableRowProps, useTheme } from '@mui/material';
9
8
 
@@ -14,27 +13,6 @@ import { useViewportIntersection } from '../../utils/useViewportIntersection';
14
13
  import { performanceRowsLimit } from '../index';
15
14
  import { Column, ColumnConfiguration, RowColorCondition } from '../models';
16
15
 
17
- const useStyles = makeStyles()((theme) => {
18
- return {
19
- intersectionRow: {
20
- display: 'contents',
21
- width: '100%'
22
- },
23
- row: {
24
- cursor: 'pointer',
25
- display: 'contents',
26
- width: '100%'
27
- },
28
- skeleton: {
29
- height: theme.spacing(2.5),
30
- width: '100%'
31
- },
32
- skeletonContainer: {
33
- padding: theme.spacing(0.5)
34
- }
35
- };
36
- });
37
-
38
16
  type Props = {
39
17
  checkable: boolean;
40
18
  children;
@@ -70,22 +48,20 @@ const Row = memo<RowProps>(
70
48
  checkable,
71
49
  limit
72
50
  }: RowProps): JSX.Element => {
73
- const { classes } = useStyles();
74
-
75
51
  if (not(isInViewport) && gte(limit, performanceRowsLimit)) {
76
52
  return (
77
- <div style={{ display: 'contents' }}>
53
+ <div className="contents">
78
54
  {checkable && (
79
- <div className={classes.skeletonContainer}>
55
+ <div className="p-1">
80
56
  <div>
81
- <LoadingSkeleton className={classes.skeleton} />
57
+ <LoadingSkeleton className="w-full" />
82
58
  </div>
83
59
  </div>
84
60
  )}
85
61
  {visibleColumns.map(({ id }) => (
86
- <div className={classes.skeletonContainer} key={`loading_${id}`}>
62
+ <div className="p-1" key={`loading_${id}`}>
87
63
  <div>
88
- <LoadingSkeleton className={classes.skeleton} />
64
+ <LoadingSkeleton className="w-full" />
89
65
  </div>
90
66
  </div>
91
67
  ))}
@@ -95,7 +71,7 @@ const Row = memo<RowProps>(
95
71
 
96
72
  return (
97
73
  <TableRow
98
- className={classes.row}
74
+ className="cursor-pointer contents w-full"
99
75
  component="div"
100
76
  tabIndex={tabIndex}
101
77
  onClick={onClick}
@@ -203,7 +179,6 @@ const IntersectionRow = ({ isHovered, ...rest }: Props): JSX.Element => {
203
179
  root: rowRef.current?.parentElement?.parentElement?.parentElement,
204
180
  rootMargin: `${theme.spacing(20)} 0px ${theme.spacing(20)} 0px`
205
181
  });
206
- const { classes } = useStyles();
207
182
 
208
183
  const getFirstCellElement = (): ChildNode | null | undefined =>
209
184
  rowRef.current?.firstChild?.firstChild?.firstChild;
@@ -213,11 +188,7 @@ const IntersectionRow = ({ isHovered, ...rest }: Props): JSX.Element => {
213
188
  }, [getFirstCellElement()]);
214
189
 
215
190
  return (
216
- <div
217
- className={classes.intersectionRow}
218
- data-is-hovered={isHovered}
219
- ref={rowRef}
220
- >
191
+ <div className="contents w-full" data-is-hovered={isHovered} ref={rowRef}>
221
192
  <Row {...rest} isHovered={isHovered} isInViewport={isInViewport} />
222
193
  </div>
223
194
  );
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable no-alert */
2
2
  /* eslint-disable react/prop-types */
3
+ import '../ThemeProvider/tailwindcss.css';
3
4
  import { useState } from 'react';
4
5
 
5
6
  import { Meta, StoryObj } from '@storybook/react';
@@ -1,5 +1,3 @@
1
- /* eslint-disable react/no-array-index-key */
2
-
3
1
  import { useAtomValue } from 'jotai';
4
2
  import {
5
3
  concat,
@@ -49,7 +47,6 @@ import DataCell from './Cell/DataCell';
49
47
  import Checkbox from './Checkbox';
50
48
  import { EmptyResult } from './EmptyResult/EmptyResult';
51
49
  import { ListingHeader } from './Header';
52
- import { useListingStyles } from './Listing.styles';
53
50
  import ListingRow from './Row/Row';
54
51
  import { SkeletonLoader } from './Row/SkeletonLoaderRows';
55
52
  import {
@@ -62,7 +59,7 @@ import {
62
59
  } from './models';
63
60
  import { subItemsPivotsAtom } from './tableAtoms';
64
61
  import { labelNoResultFound as defaultLabelNoResultFound } from './translatedLabels';
65
- import useStyleTable from './useStyleTable';
62
+ import useStyleTable, { useColumnStyle } from './useStyleTable';
66
63
 
67
64
  const subItemPrefixKey = 'listing';
68
65
 
@@ -207,11 +204,13 @@ const Listing = <
207
204
  columnConfiguration,
208
205
  columns
209
206
  });
210
- const { dataStyle, getGridTemplateColumn } = useStyleTable({
211
- checkable,
212
- currentVisibleColumns,
207
+ const { dataStyle } = useStyleTable({
213
208
  listingVariant
214
209
  });
210
+ const gridTemplateColumn = useColumnStyle({
211
+ checkable,
212
+ currentVisibleColumns
213
+ });
215
214
 
216
215
  const { t } = useTranslation();
217
216
 
@@ -288,14 +287,6 @@ const Listing = <
288
287
  },
289
288
  [allSubItemIds]
290
289
  );
291
-
292
- const { classes } = useListingStyles({
293
- dataStyle,
294
- getGridTemplateColumn,
295
- isResponsive,
296
- rows: rowsToDisplay
297
- });
298
-
299
290
  const { isShiftKeyDown } = useKeyObserver();
300
291
 
301
292
  const haveSameId = (row: TRow, rowToCompare: TRow): boolean =>
@@ -517,20 +508,20 @@ const Listing = <
517
508
  const areColumnsEditable = not(isNil(onSelectColumns));
518
509
 
519
510
  return (
520
- <div className={classes.listingContainer}>
511
+ <div className="h-full w-full overflow-hidden">
521
512
  {loading && rows.length > 0 && (
522
- <LinearProgress className={classes.loadingIndicator} />
513
+ <LinearProgress className="w-full h-[3px]" />
523
514
  )}
524
515
  {(!loading || (loading && rows.length < 1)) && (
525
- <div className={classes.loadingIndicator} />
516
+ <div className="w-full h-[3px]" />
526
517
  )}
527
518
  <div
528
- className={classes.container}
519
+ className="bg-[none] flex flex-col h-full w-full"
529
520
  ref={containerRef as RefObject<HTMLDivElement>}
530
521
  >
531
522
  {isActionBarVisible && (
532
523
  <div
533
- className={classes.actionBar}
524
+ className="flex items-center"
534
525
  ref={actionBarRef as RefObject<HTMLDivElement>}
535
526
  >
536
527
  <ListingActionBar
@@ -564,7 +555,7 @@ const Listing = <
564
555
  >
565
556
  {({ height }) => (
566
557
  <Box
567
- className={classes.tableWrapper}
558
+ className="border-b-[none] overflow-auto"
568
559
  component="div"
569
560
  style={{
570
561
  height: innerScrollDisabled ? '100%' : `calc(${height}px - 4px)`
@@ -575,7 +566,13 @@ const Listing = <
575
566
  ) : (
576
567
  <Table
577
568
  stickyHeader
578
- className={classes.table}
569
+ className="grid items-center relative"
570
+ style={{
571
+ gridTemplateColumns: gridTemplateColumn,
572
+ gridTemplateRows: `${dataStyle.header.height}px repeat(${
573
+ rowsToDisplay.length || 1
574
+ }, ${isResponsive ? 'auto' : `${dataStyle.body.height}px`})`
575
+ }}
579
576
  component="div"
580
577
  size="small"
581
578
  >
@@ -598,7 +595,7 @@ const Listing = <
598
595
  />
599
596
 
600
597
  <TableBody
601
- className={classes.tableBody}
598
+ className="contents relative"
602
599
  component="div"
603
600
  onMouseLeave={clearHoveredRow}
604
601
  >
@@ -649,7 +646,7 @@ const Listing = <
649
646
  (!isSubItem || subItems.canCheckSubItems ? (
650
647
  <Cell
651
648
  align="left"
652
- className={classes.checkbox}
649
+ className="justify-start"
653
650
  disableRowCondition={disableRowCondition}
654
651
  isRowHovered={isRowHovered}
655
652
  row={row}
@@ -662,9 +659,12 @@ const Listing = <
662
659
  disableRowCheckCondition(row) ||
663
660
  disableRowCondition(row)
664
661
  }
665
- inputProps={{
666
- 'aria-label': `Select row ${getId(row)}`
662
+ slotProps={{
663
+ input: {
664
+ 'aria-label': `Select row ${getId(row)}`
665
+ }
667
666
  }}
667
+ className="pl-1"
668
668
  />
669
669
  </Cell>
670
670
  ) : (