@okta/odyssey-react-mui 1.14.7 → 1.14.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okta/odyssey-react-mui",
3
- "version": "1.14.7",
3
+ "version": "1.14.8",
4
4
  "description": "React MUI components for Odyssey, Okta's design system",
5
5
  "author": "Okta, Inc.",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  "@mui/system": "^5.15.9",
52
52
  "@mui/utils": "^5.15.9",
53
53
  "@mui/x-date-pickers": "^5.0.15",
54
- "@okta/odyssey-design-tokens": "^1.14.7",
54
+ "@okta/odyssey-design-tokens": "^1.14.8",
55
55
  "date-fns": "^2.30.0",
56
56
  "i18next": "^23.8.2",
57
57
  "material-react-table": "^2.11.3",
@@ -63,5 +63,5 @@
63
63
  "react": ">=17 <19",
64
64
  "react-dom": ">=17 <19"
65
65
  },
66
- "gitHead": "f4d64bf568d491147afa57aaba6e218c1d496bab"
66
+ "gitHead": "2b39634867133ad133ba534abe2a086ace269d1a"
67
67
  }
@@ -101,7 +101,7 @@ const defaultTruncationValue = 5;
101
101
  const BreadcrumbList = ({
102
102
  children,
103
103
  homeHref,
104
- maxVisibleItems = defaultTruncationValue,
104
+ maxVisibleItems: maxVisibleItemsProp = defaultTruncationValue,
105
105
  testId,
106
106
  translate,
107
107
  }: BreadcrumbsProps) => {
@@ -109,6 +109,11 @@ const BreadcrumbList = ({
109
109
 
110
110
  const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
111
111
 
112
+ const maxVisibleItems = useMemo(
113
+ () => Math.min(Math.max(maxVisibleItemsProp, 0), children.length),
114
+ [maxVisibleItemsProp, children],
115
+ );
116
+
112
117
  const breadcrumbSections = useMemo(() => {
113
118
  if (children.length <= maxVisibleItems) {
114
119
  return {
@@ -155,7 +160,7 @@ const BreadcrumbList = ({
155
160
  </BreadcrumbContext.Provider>
156
161
  ))}
157
162
 
158
- {breadcrumbSections.insideMenu && (
163
+ {breadcrumbSections.insideMenu.length > 0 && (
159
164
  <>
160
165
  <ButtonBase onClick={onMenuButtonClick}>...</ButtonBase>
161
166
  <Menu
@@ -59,4 +59,6 @@ const DataTableEmptyState = ({
59
59
  };
60
60
 
61
61
  const MemoizedDataTableEmptyState = memo(DataTableEmptyState);
62
+ MemoizedDataTableEmptyState.displayName = "DataTableEmptyState";
63
+
62
64
  export { MemoizedDataTableEmptyState as DataTableEmptyState };
@@ -286,4 +286,6 @@ const DataTablePagination = ({
286
286
  };
287
287
 
288
288
  const MemoizedDataTablePagination = memo(DataTablePagination);
289
+ MemoizedDataTablePagination.displayName = "DataTablePagination";
290
+
289
291
  export { MemoizedDataTablePagination as DataTablePagination };
@@ -119,4 +119,6 @@ const DataTableRowActions = ({
119
119
  };
120
120
 
121
121
  const MemoizedDataTableRowActions = memo(DataTableRowActions);
122
+ MemoizedDataTableRowActions.displayName = "DataTableRowActions";
123
+
122
124
  export { MemoizedDataTableRowActions as DataTableRowActions };
@@ -132,4 +132,6 @@ const DataTableSettings = ({
132
132
  };
133
133
 
134
134
  const MemoizedDataTableSettings = memo(DataTableSettings);
135
+ MemoizedDataTableSettings.displayName = "DataTableSettings";
136
+
135
137
  export { MemoizedDataTableSettings as DataTableSettings };
@@ -124,6 +124,10 @@ const StaticTable = <TData extends DefaultMaterialReactTableData>({
124
124
  return <MaterialReactTable table={table} />;
125
125
  };
126
126
 
127
+ // Need the `typeof StaticTable` because generics don't get passed through `memo`.
127
128
  const MemoizedStaticTable = memo(StaticTable) as typeof StaticTable;
128
129
 
130
+ // @ts-expect-error displayName is expected to not be on `typeof StaticTable`
131
+ MemoizedStaticTable.displayName = "StaticTable";
132
+
129
133
  export { MemoizedStaticTable as StaticTable };