@okta/odyssey-react-mui 1.27.0 → 1.28.1

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 (221) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/{Button.js → Buttons/BaseButton.js} +11 -10
  3. package/dist/Buttons/BaseButton.js.map +1 -0
  4. package/dist/{MenuButton.js → Buttons/BaseMenuButton.js} +30 -10
  5. package/dist/Buttons/BaseMenuButton.js.map +1 -0
  6. package/dist/Buttons/Button.js +24 -0
  7. package/dist/Buttons/Button.js.map +1 -0
  8. package/dist/Buttons/ButtonContext.js.map +1 -0
  9. package/dist/Buttons/MenuButton.js +25 -0
  10. package/dist/Buttons/MenuButton.js.map +1 -0
  11. package/dist/Buttons/MenuContext.js.map +1 -0
  12. package/dist/Buttons/MenuItem.js.map +1 -0
  13. package/dist/Buttons/index.js +18 -0
  14. package/dist/Buttons/index.js.map +1 -0
  15. package/dist/Card.js +1 -2
  16. package/dist/Card.js.map +1 -1
  17. package/dist/DataTable/DataTable.js +1 -2
  18. package/dist/DataTable/DataTable.js.map +1 -1
  19. package/dist/DataTable/DataTableRowActions.js +1 -2
  20. package/dist/DataTable/DataTableRowActions.js.map +1 -1
  21. package/dist/DataTable/DataTableSettings.js +1 -2
  22. package/dist/DataTable/DataTableSettings.js.map +1 -1
  23. package/dist/Dialog.js +1 -1
  24. package/dist/Dialog.js.map +1 -1
  25. package/dist/Drawer.js +1 -1
  26. package/dist/Drawer.js.map +1 -1
  27. package/dist/FileUploader/FileUploader.js +1 -1
  28. package/dist/FileUploader/FileUploader.js.map +1 -1
  29. package/dist/Form.js.map +1 -1
  30. package/dist/Pagination/Pagination.js +1 -1
  31. package/dist/Pagination/Pagination.js.map +1 -1
  32. package/dist/Toast.js +1 -1
  33. package/dist/Toast.js.map +1 -1
  34. package/dist/index.js +1 -3
  35. package/dist/index.js.map +1 -1
  36. package/dist/index.scss +1 -1
  37. package/dist/labs/AppSwitcher/AppSwitcher.js +76 -0
  38. package/dist/labs/AppSwitcher/AppSwitcher.js.map +1 -0
  39. package/dist/labs/AppSwitcher/AppSwitcherApp.js +112 -0
  40. package/dist/labs/AppSwitcher/AppSwitcherApp.js.map +1 -0
  41. package/dist/labs/{SideNav → AppSwitcher}/OktaAura.js +16 -3
  42. package/dist/labs/AppSwitcher/OktaAura.js.map +1 -0
  43. package/dist/labs/AppSwitcher/index.js +13 -0
  44. package/dist/labs/AppSwitcher/index.js.map +1 -0
  45. package/dist/labs/AppTile.js +102 -65
  46. package/dist/labs/AppTile.js.map +1 -1
  47. package/dist/labs/DataFilters.js +1 -1
  48. package/dist/labs/DataFilters.js.map +1 -1
  49. package/dist/labs/DataTable.js.map +1 -1
  50. package/dist/labs/DataTablePagination.js +1 -1
  51. package/dist/labs/DataTablePagination.js.map +1 -1
  52. package/dist/labs/DataView/BulkActionsMenu.js +1 -2
  53. package/dist/labs/DataView/BulkActionsMenu.js.map +1 -1
  54. package/dist/labs/DataView/DataCard.js +53 -42
  55. package/dist/labs/DataView/DataCard.js.map +1 -1
  56. package/dist/labs/DataView/DataView.js +1 -1
  57. package/dist/labs/DataView/DataView.js.map +1 -1
  58. package/dist/labs/DataView/LayoutSwitcher.js +1 -2
  59. package/dist/labs/DataView/LayoutSwitcher.js.map +1 -1
  60. package/dist/labs/DataView/RowActions.js +1 -1
  61. package/dist/labs/DataView/RowActions.js.map +1 -1
  62. package/dist/labs/DataView/TableLayoutContent.js +1 -2
  63. package/dist/labs/DataView/TableLayoutContent.js.map +1 -1
  64. package/dist/labs/DataView/TableSettings.js +1 -2
  65. package/dist/labs/DataView/TableSettings.js.map +1 -1
  66. package/dist/labs/DatePicker.js +1 -1
  67. package/dist/labs/DatePicker.js.map +1 -1
  68. package/dist/labs/SideNav/SideNav.js +5 -4
  69. package/dist/labs/SideNav/SideNav.js.map +1 -1
  70. package/dist/labs/TopNav/UserProfile.js +16 -3
  71. package/dist/labs/TopNav/UserProfile.js.map +1 -1
  72. package/dist/labs/TopNav/UserProfileMenuButton.js +41 -0
  73. package/dist/labs/TopNav/UserProfileMenuButton.js.map +1 -0
  74. package/dist/labs/TopNav/index.js +1 -0
  75. package/dist/labs/TopNav/index.js.map +1 -1
  76. package/dist/labs/UiShell/UiShell.js +6 -5
  77. package/dist/labs/UiShell/UiShell.js.map +1 -1
  78. package/dist/labs/UiShell/UiShellContent.js +53 -13
  79. package/dist/labs/UiShell/UiShellContent.js.map +1 -1
  80. package/dist/labs/UiShell/renderUiShell.js +4 -0
  81. package/dist/labs/UiShell/renderUiShell.js.map +1 -1
  82. package/dist/labs/index.js +1 -0
  83. package/dist/labs/index.js.map +1 -1
  84. package/dist/src/{Button.d.ts → Buttons/BaseButton.d.ts} +12 -34
  85. package/dist/src/Buttons/BaseButton.d.ts.map +1 -0
  86. package/dist/src/{MenuButton.d.ts → Buttons/BaseMenuButton.d.ts} +37 -14
  87. package/dist/src/Buttons/BaseMenuButton.d.ts.map +1 -0
  88. package/dist/src/Buttons/Button.d.ts +16 -0
  89. package/dist/src/Buttons/Button.d.ts.map +1 -0
  90. package/dist/src/Buttons/ButtonContext.d.ts.map +1 -0
  91. package/dist/src/Buttons/MenuButton.d.ts +17 -0
  92. package/dist/src/Buttons/MenuButton.d.ts.map +1 -0
  93. package/dist/src/Buttons/MenuContext.d.ts.map +1 -0
  94. package/dist/src/{MenuItem.d.ts → Buttons/MenuItem.d.ts} +1 -1
  95. package/dist/src/Buttons/MenuItem.d.ts.map +1 -0
  96. package/dist/src/Buttons/index.d.ts +18 -0
  97. package/dist/src/Buttons/index.d.ts.map +1 -0
  98. package/dist/src/Card.d.ts +1 -2
  99. package/dist/src/Card.d.ts.map +1 -1
  100. package/dist/src/DataTable/DataTable.d.ts +1 -1
  101. package/dist/src/DataTable/DataTable.d.ts.map +1 -1
  102. package/dist/src/DataTable/DataTableRowActions.d.ts +1 -2
  103. package/dist/src/DataTable/DataTableRowActions.d.ts.map +1 -1
  104. package/dist/src/DataTable/DataTableSettings.d.ts.map +1 -1
  105. package/dist/src/Dialog.d.ts +1 -1
  106. package/dist/src/Dialog.d.ts.map +1 -1
  107. package/dist/src/Drawer.d.ts +1 -1
  108. package/dist/src/Drawer.d.ts.map +1 -1
  109. package/dist/src/Form.d.ts +1 -1
  110. package/dist/src/Form.d.ts.map +1 -1
  111. package/dist/src/index.d.ts +1 -3
  112. package/dist/src/index.d.ts.map +1 -1
  113. package/dist/src/labs/AppSwitcher/AppSwitcher.d.ts +20 -0
  114. package/dist/src/labs/AppSwitcher/AppSwitcher.d.ts.map +1 -0
  115. package/dist/src/labs/AppSwitcher/AppSwitcherApp.d.ts +24 -0
  116. package/dist/src/labs/AppSwitcher/AppSwitcherApp.d.ts.map +1 -0
  117. package/dist/src/labs/AppSwitcher/OktaAura.d.ts.map +1 -0
  118. package/dist/src/labs/AppSwitcher/index.d.ts +13 -0
  119. package/dist/src/labs/AppSwitcher/index.d.ts.map +1 -0
  120. package/dist/src/labs/AppTile.d.ts +6 -4
  121. package/dist/src/labs/AppTile.d.ts.map +1 -1
  122. package/dist/src/labs/DataTable.d.ts +1 -1
  123. package/dist/src/labs/DataTable.d.ts.map +1 -1
  124. package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -1
  125. package/dist/src/labs/DataView/DataCard.d.ts +1 -2
  126. package/dist/src/labs/DataView/DataCard.d.ts.map +1 -1
  127. package/dist/src/labs/DataView/LayoutSwitcher.d.ts.map +1 -1
  128. package/dist/src/labs/DataView/RowActions.d.ts +1 -2
  129. package/dist/src/labs/DataView/RowActions.d.ts.map +1 -1
  130. package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -1
  131. package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -1
  132. package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -1
  133. package/dist/src/labs/TopNav/UserProfile.d.ts +5 -1
  134. package/dist/src/labs/TopNav/UserProfile.d.ts.map +1 -1
  135. package/dist/src/labs/TopNav/UserProfileMenuButton.d.ts +17 -0
  136. package/dist/src/labs/TopNav/UserProfileMenuButton.d.ts.map +1 -0
  137. package/dist/src/labs/TopNav/index.d.ts +1 -0
  138. package/dist/src/labs/TopNav/index.d.ts.map +1 -1
  139. package/dist/src/labs/UiShell/UiShell.d.ts +2 -2
  140. package/dist/src/labs/UiShell/UiShell.d.ts.map +1 -1
  141. package/dist/src/labs/UiShell/UiShellContent.d.ts +19 -2
  142. package/dist/src/labs/UiShell/UiShellContent.d.ts.map +1 -1
  143. package/dist/src/labs/UiShell/renderUiShell.d.ts +2 -2
  144. package/dist/src/labs/UiShell/renderUiShell.d.ts.map +1 -1
  145. package/dist/src/labs/index.d.ts +1 -0
  146. package/dist/src/labs/index.d.ts.map +1 -1
  147. package/dist/src/theme/components.d.ts.map +1 -1
  148. package/dist/src/web-component/renderReactInWebComponent.d.ts +2 -2
  149. package/dist/src/web-component/renderReactInWebComponent.d.ts.map +1 -1
  150. package/dist/theme/components.js +25 -27
  151. package/dist/theme/components.js.map +1 -1
  152. package/dist/tsconfig.production.tsbuildinfo +1 -1
  153. package/dist/web-component/renderReactInWebComponent.js +6 -7
  154. package/dist/web-component/renderReactInWebComponent.js.map +1 -1
  155. package/package.json +3 -3
  156. package/src/{Button.tsx → Buttons/BaseButton.tsx} +48 -68
  157. package/src/{MenuButton.tsx → Buttons/BaseMenuButton.tsx} +94 -32
  158. package/src/Buttons/Button.tsx +30 -0
  159. package/src/Buttons/MenuButton.tsx +35 -0
  160. package/src/{MenuItem.tsx → Buttons/MenuItem.tsx} +1 -1
  161. package/src/Buttons/index.ts +22 -0
  162. package/src/Card.tsx +1 -3
  163. package/src/DataTable/DataTable.tsx +1 -2
  164. package/src/DataTable/DataTableRowActions.tsx +1 -3
  165. package/src/DataTable/DataTableSettings.tsx +1 -2
  166. package/src/Dialog.tsx +1 -1
  167. package/src/Drawer.tsx +1 -1
  168. package/src/FileUploader/FileUploader.tsx +1 -1
  169. package/src/Form.tsx +1 -1
  170. package/src/Pagination/Pagination.test.tsx +58 -36
  171. package/src/Pagination/Pagination.tsx +1 -1
  172. package/src/Toast.tsx +1 -1
  173. package/src/index.ts +1 -3
  174. package/src/labs/AppSwitcher/AppSwitcher.tsx +94 -0
  175. package/src/labs/AppSwitcher/AppSwitcherApp.tsx +146 -0
  176. package/src/labs/{SideNav → AppSwitcher}/OktaAura.tsx +19 -4
  177. package/src/labs/AppSwitcher/index.ts +13 -0
  178. package/src/labs/AppTile.tsx +171 -85
  179. package/src/labs/DataFilters.tsx +1 -1
  180. package/src/labs/DataTable.tsx +1 -1
  181. package/src/labs/DataTablePagination.tsx +1 -1
  182. package/src/labs/DataView/BulkActionsMenu.tsx +1 -2
  183. package/src/labs/DataView/DataCard.tsx +56 -31
  184. package/src/labs/DataView/DataView.tsx +1 -1
  185. package/src/labs/DataView/LayoutSwitcher.tsx +1 -2
  186. package/src/labs/DataView/RowActions.tsx +1 -3
  187. package/src/labs/DataView/TableLayoutContent.tsx +1 -2
  188. package/src/labs/DataView/TableSettings.tsx +1 -2
  189. package/src/labs/DatePicker.tsx +1 -1
  190. package/src/labs/SideNav/SideNav.tsx +10 -4
  191. package/src/labs/TopNav/UserProfile.tsx +26 -2
  192. package/src/labs/TopNav/UserProfileMenuButton.tsx +57 -0
  193. package/src/labs/TopNav/index.ts +1 -0
  194. package/src/labs/UiShell/UiShell.test.tsx +23 -38
  195. package/src/labs/UiShell/UiShell.tsx +14 -6
  196. package/src/labs/UiShell/UiShellContent.tsx +85 -16
  197. package/src/labs/UiShell/renderUiShell.test.tsx +21 -15
  198. package/src/labs/UiShell/renderUiShell.tsx +8 -1
  199. package/src/labs/index.ts +1 -0
  200. package/src/theme/components.tsx +25 -28
  201. package/src/web-component/renderReactInWebComponent.ts +10 -5
  202. package/dist/Button.js.map +0 -1
  203. package/dist/ButtonContext.js.map +0 -1
  204. package/dist/MenuButton.js.map +0 -1
  205. package/dist/MenuContext.js.map +0 -1
  206. package/dist/MenuItem.js.map +0 -1
  207. package/dist/labs/SideNav/OktaAura.js.map +0 -1
  208. package/dist/src/Button.d.ts.map +0 -1
  209. package/dist/src/ButtonContext.d.ts.map +0 -1
  210. package/dist/src/MenuButton.d.ts.map +0 -1
  211. package/dist/src/MenuContext.d.ts.map +0 -1
  212. package/dist/src/MenuItem.d.ts.map +0 -1
  213. package/dist/src/labs/SideNav/OktaAura.d.ts.map +0 -1
  214. /package/dist/{ButtonContext.js → Buttons/ButtonContext.js} +0 -0
  215. /package/dist/{MenuContext.js → Buttons/MenuContext.js} +0 -0
  216. /package/dist/{MenuItem.js → Buttons/MenuItem.js} +0 -0
  217. /package/dist/src/{ButtonContext.d.ts → Buttons/ButtonContext.d.ts} +0 -0
  218. /package/dist/src/{MenuContext.d.ts → Buttons/MenuContext.d.ts} +0 -0
  219. /package/dist/src/labs/{SideNav → AppSwitcher}/OktaAura.d.ts +0 -0
  220. /package/src/{ButtonContext.tsx → Buttons/ButtonContext.tsx} +0 -0
  221. /package/src/{MenuContext.ts → Buttons/MenuContext.ts} +0 -0
@@ -25,16 +25,19 @@ import {
25
25
  } from "@mui/material";
26
26
  import styled from "@emotion/styled";
27
27
 
28
- import { Button } from ".././Button";
28
+ import { Button } from "../Buttons";
29
29
  import {
30
30
  DesignTokens,
31
31
  useOdysseyDesignTokens,
32
32
  } from ".././OdysseyDesignTokensContext";
33
- import { Heading5, Paragraph, Subordinate, Support } from ".././Typography";
33
+ import { Heading5, Paragraph, Subordinate } from ".././Typography";
34
34
  import { Box } from ".././Box";
35
35
 
36
- export const APP_TILE_IMAGE_HEIGHT = "64px";
37
- export const APP_TILE_PLACEHOLDER_IMAGE_WIDTH = "64px";
36
+ export const APP_TILE_COMPACT_IMAGE_HEIGHT = "2.85714286rem"; // 40px
37
+ export const APP_TILE_IMAGE_HEIGHT = "4.57142857rem"; // 64px
38
+ export const APP_TILE_PLACEHOLDER_IMAGE_WIDTH = "4.57142857rem"; // 64px
39
+
40
+ export const appTileVariantValues = ["comfortable", "compact"] as const;
38
41
 
39
42
  export type AppTileProps = {
40
43
  // Text that appears in the upper right corner of the tile
@@ -49,10 +52,10 @@ export type AppTileProps = {
49
52
  isLoading?: boolean;
50
53
  // Event handler for when the user clicks the tile
51
54
  onClick: MouseEventHandler;
52
- // An 'eyebrow' of text above the title
53
- overline?: string;
54
55
  // A string for the tile title
55
56
  title?: string;
57
+ // Whether the tile is comfortable or compact
58
+ variant?: (typeof appTileVariantValues)[number];
56
59
  } & (
57
60
  | {
58
61
  // Event that fires when the user clicks the action button in the upper-right corner
@@ -85,106 +88,203 @@ type LoadingTileProps = {
85
88
  description: boolean;
86
89
  hasTopSection: boolean;
87
90
  image: boolean;
88
- overline: boolean;
89
91
  title: boolean;
92
+ variant: AppTileProps["variant"];
90
93
  };
91
94
 
92
95
  const ImageContainer = styled("div", {
93
- shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
96
+ shouldForwardProp: (prop) =>
97
+ prop !== "odysseyDesignTokens" && prop !== "variant",
94
98
  })<{
95
99
  odysseyDesignTokens: DesignTokens;
96
- }>(({ odysseyDesignTokens }) => ({
100
+ variant: AppTileProps["variant"];
101
+ }>(({ odysseyDesignTokens, variant }) => ({
97
102
  display: "flex",
98
103
  alignItems: "flex-start",
99
- maxHeight: APP_TILE_IMAGE_HEIGHT,
100
- marginBlockEnd: odysseyDesignTokens.Spacing5,
104
+ justifyContent: variant === "compact" ? "center" : "flex-start",
105
+ maxHeight:
106
+ variant === "compact"
107
+ ? APP_TILE_COMPACT_IMAGE_HEIGHT
108
+ : APP_TILE_IMAGE_HEIGHT,
109
+ marginBlockEnd:
110
+ variant === "compact"
111
+ ? odysseyDesignTokens.Spacing4
112
+ : odysseyDesignTokens.Spacing3,
101
113
 
102
114
  ["img"]: {
103
- height: APP_TILE_IMAGE_HEIGHT,
115
+ height:
116
+ variant === "compact"
117
+ ? APP_TILE_COMPACT_IMAGE_HEIGHT
118
+ : APP_TILE_IMAGE_HEIGHT,
119
+ width: variant === "compact" ? "100%" : "auto",
104
120
  maxWidth: "100%",
105
121
  },
106
122
  }));
107
123
 
108
124
  const ActionContainer = styled("div", {
109
- shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
110
- })<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({
111
- alignItems: "center",
112
- display: "flex",
113
- minHeight: odysseyDesignTokens.Spacing6,
114
- position: "absolute",
115
- right: odysseyDesignTokens.Spacing2,
116
- top: odysseyDesignTokens.Spacing2,
117
- gap: odysseyDesignTokens.Spacing1,
118
- zIndex: 1,
125
+ shouldForwardProp: (prop) =>
126
+ prop !== "odysseyDesignTokens" && prop !== "variant",
127
+ })<{ odysseyDesignTokens: DesignTokens; variant: AppTileProps["variant"] }>(
128
+ ({ odysseyDesignTokens, variant = "comfortable" }) => ({
129
+ alignItems: "center",
130
+ display: "flex",
131
+ minHeight: odysseyDesignTokens.Spacing6,
132
+ position: "absolute",
133
+ right: variant === "compact" ? 0 : odysseyDesignTokens.Spacing2,
134
+ top: variant === "compact" ? 0 : odysseyDesignTokens.Spacing2,
135
+ gap: odysseyDesignTokens.Spacing1,
136
+ zIndex: 1,
119
137
 
120
- ["& > .MuiTypography-root:last-child"]: {
121
- marginInlineEnd: odysseyDesignTokens.Spacing2,
122
- },
123
- }));
138
+ ["& > .MuiTypography-root:last-child"]: {
139
+ marginInlineEnd: odysseyDesignTokens.Spacing2,
140
+ },
141
+ }),
142
+ );
124
143
 
125
144
  const ContentContainer = styled("div", {
126
145
  shouldForwardProp: (prop) =>
127
- prop !== "odysseyDesignTokens" && prop !== "hasTopSection",
128
- })<{ odysseyDesignTokens: DesignTokens; hasTopSection: boolean }>(
129
- ({ odysseyDesignTokens, hasTopSection }) => ({
130
- alignItems: "flex-start",
131
- paddingBlockStart: hasTopSection ? odysseyDesignTokens.Spacing4 : 0,
132
- }),
133
- );
146
+ prop !== "odysseyDesignTokens" &&
147
+ prop !== "hasTopSection" &&
148
+ prop !== "variant",
149
+ })<{
150
+ odysseyDesignTokens: DesignTokens;
151
+ hasTopSection: boolean;
152
+ variant: AppTileProps["variant"];
153
+ }>(({ odysseyDesignTokens, hasTopSection, variant }) => ({
154
+ alignItems: "flex-start",
155
+ paddingBlockStart: hasTopSection ? odysseyDesignTokens.Spacing4 : 0,
156
+ height: "100%",
157
+
158
+ [".MuiTypography-root"]: {
159
+ fontSize:
160
+ variant === "compact"
161
+ ? odysseyDesignTokens.TypographySizeSubordinate
162
+ : "auto",
163
+ textAlign: variant === "compact" ? "center" : "left",
164
+ },
165
+
166
+ ["& :last-child"]: {
167
+ marginBlockEnd: "0 !important",
168
+ },
169
+ }));
134
170
 
135
171
  const ChildrenContainer = styled("div", {
136
172
  shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
137
173
  })<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({
138
174
  ["&:not(:first-child)"]: {
139
- marginBlockStart: odysseyDesignTokens.Spacing3,
175
+ marginBlockStart: odysseyDesignTokens.Spacing4,
176
+ },
177
+ }));
178
+
179
+ const StyledMuiCard = styled(MuiCard, {
180
+ shouldForwardProp: (prop) =>
181
+ prop !== "odysseyDesignTokens" &&
182
+ prop !== "isPlaceholder" &&
183
+ prop !== "isCompact",
184
+ })<{
185
+ odysseyDesignTokens: DesignTokens;
186
+ isPlaceholder?: boolean;
187
+ isCompact: boolean;
188
+ }>(({ odysseyDesignTokens, isPlaceholder = false, isCompact = false }) => ({
189
+ position: "relative",
190
+ boxShadow: "none",
191
+ overflow: "unset",
192
+ display: "flex",
193
+ justifyContent: isPlaceholder && isCompact ? "center" : "flex-start",
194
+ padding: odysseyDesignTokens.Spacing4,
195
+ border: `${odysseyDesignTokens.BorderWidthMain} ${odysseyDesignTokens.HueNeutral200} ${odysseyDesignTokens.BorderStyleMain}`,
196
+ borderRadius: odysseyDesignTokens.BorderRadiusMain,
197
+ transition: `border ${odysseyDesignTokens.TransitionDurationMain} ${odysseyDesignTokens.TransitionTimingMain}`,
198
+
199
+ "&::after": {
200
+ position: "absolute",
201
+ top: 0,
202
+ left: 0,
203
+ width: "100%",
204
+ height: "100%",
205
+ opacity: 0,
206
+ boxShadow: odysseyDesignTokens.DepthMedium,
207
+ borderRadius: odysseyDesignTokens.BorderRadiusMain,
208
+ transition: `opacity ${odysseyDesignTokens.TransitionDurationMain} ${odysseyDesignTokens.TransitionTimingMain}`,
209
+ zIndex: "-1",
210
+ content: '""',
140
211
  },
212
+
213
+ "&:hover": {
214
+ borderColor: "transparent",
215
+
216
+ "&::after": {
217
+ opacity: 1,
218
+ },
219
+ },
220
+ }));
221
+
222
+ const StyledMuiCardActionArea = styled(MuiCardActionArea, {
223
+ shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
224
+ })<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({
225
+ margin: `-${odysseyDesignTokens.Spacing4}`,
226
+ padding: odysseyDesignTokens.Spacing4,
141
227
  }));
142
228
 
143
229
  const LoadingTile = ({
144
230
  image,
145
- overline,
146
231
  title,
147
232
  description,
148
233
  children,
149
234
  hasTopSection,
235
+ variant,
150
236
  }: LoadingTileProps) => {
151
237
  const odysseyDesignTokens = useOdysseyDesignTokens();
152
238
 
153
239
  return (
154
- <MuiCard className="isClickable">
240
+ <StyledMuiCard
241
+ odysseyDesignTokens={odysseyDesignTokens}
242
+ isPlaceholder
243
+ isCompact={variant === "compact"}
244
+ >
155
245
  <ContentContainer
156
246
  odysseyDesignTokens={odysseyDesignTokens}
157
247
  hasTopSection={hasTopSection}
248
+ variant={variant}
158
249
  >
159
250
  {hasTopSection && (
160
- <ActionContainer odysseyDesignTokens={odysseyDesignTokens}>
251
+ <ActionContainer
252
+ odysseyDesignTokens={odysseyDesignTokens}
253
+ variant={variant}
254
+ >
161
255
  <Subordinate>
162
- <MuiSkeleton width={50} />
256
+ {variant !== "compact" && <MuiSkeleton width={50} />}
163
257
  </Subordinate>
164
258
  </ActionContainer>
165
259
  )}
166
260
  <Box sx={{ width: "100%" }}>
167
261
  {image && (
168
- <ImageContainer odysseyDesignTokens={odysseyDesignTokens}>
262
+ <ImageContainer
263
+ odysseyDesignTokens={odysseyDesignTokens}
264
+ variant={variant}
265
+ >
169
266
  <MuiSkeleton
170
- height={APP_TILE_IMAGE_HEIGHT}
171
- width={APP_TILE_PLACEHOLDER_IMAGE_WIDTH}
267
+ height={
268
+ variant === "compact"
269
+ ? APP_TILE_COMPACT_IMAGE_HEIGHT
270
+ : APP_TILE_IMAGE_HEIGHT
271
+ }
272
+ width={
273
+ variant === "compact"
274
+ ? APP_TILE_COMPACT_IMAGE_HEIGHT
275
+ : APP_TILE_PLACEHOLDER_IMAGE_WIDTH
276
+ }
172
277
  variant="rectangular"
173
278
  />
174
279
  </ImageContainer>
175
280
  )}
176
281
 
177
- {overline && (
178
- <Support>
179
- <MuiSkeleton />
180
- </Support>
181
- )}
182
282
  {title && (
183
283
  <Heading5>
184
284
  <MuiSkeleton />
185
285
  </Heading5>
186
286
  )}
187
- {description && (
287
+ {description && variant !== "compact" && (
188
288
  <Paragraph>
189
289
  <MuiSkeleton />
190
290
  </Paragraph>
@@ -200,38 +300,10 @@ const LoadingTile = ({
200
300
  )}
201
301
  </Box>
202
302
  </ContentContainer>
203
- </MuiCard>
303
+ </StyledMuiCard>
204
304
  );
205
305
  };
206
306
 
207
- const StyledMuiCard = styled(MuiCard, {
208
- shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
209
- })<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({
210
- position: "relative",
211
- boxShadow: "none",
212
- overflow: "unset",
213
-
214
- "&::after": {
215
- position: "absolute",
216
- top: 0,
217
- left: 0,
218
- width: "100%",
219
- height: "100%",
220
- opacity: 0,
221
- boxShadow: odysseyDesignTokens.DepthMedium,
222
- borderRadius: odysseyDesignTokens.BorderRadiusOuter,
223
- transition: `opacity ${odysseyDesignTokens.TransitionDurationMain}`,
224
- zIndex: "-1",
225
- content: '""',
226
- },
227
-
228
- "&:hover": {
229
- "&::after": {
230
- opacity: 1,
231
- },
232
- },
233
- }));
234
-
235
307
  const AppTile = ({
236
308
  actionAriaControls,
237
309
  actionAriaHasPopup,
@@ -245,8 +317,8 @@ const AppTile = ({
245
317
  isLoading,
246
318
  onActionClick,
247
319
  onClick,
248
- overline,
249
320
  title,
321
+ variant = "comfortable",
250
322
  }: AppTileProps) => {
251
323
  const odysseyDesignTokens = useOdysseyDesignTokens();
252
324
 
@@ -255,16 +327,19 @@ const AppTile = ({
255
327
  <ContentContainer
256
328
  odysseyDesignTokens={odysseyDesignTokens}
257
329
  hasTopSection={typeof onActionClick === "function" || !!auxiliaryText}
330
+ variant={variant}
258
331
  >
259
332
  {image && (
260
- <ImageContainer odysseyDesignTokens={odysseyDesignTokens}>
333
+ <ImageContainer
334
+ odysseyDesignTokens={odysseyDesignTokens}
335
+ variant={variant}
336
+ >
261
337
  {image}
262
338
  </ImageContainer>
263
339
  )}
264
340
 
265
- {overline && <Support component="div">{overline}</Support>}
266
341
  {title && <Heading5 component="div">{title}</Heading5>}
267
- {description && (
342
+ {description && variant !== "compact" && (
268
343
  <Paragraph color="textSecondary">{description}</Paragraph>
269
344
  )}
270
345
  {children && (
@@ -279,26 +354,32 @@ const AppTile = ({
279
354
  auxiliaryText,
280
355
  onActionClick,
281
356
  odysseyDesignTokens,
282
- overline,
283
357
  title,
284
358
  description,
285
359
  children,
360
+ variant,
286
361
  ],
287
362
  );
288
363
 
289
364
  return isLoading ? (
290
365
  <LoadingTile
291
366
  image={Boolean(image)}
292
- overline={Boolean(overline)}
293
367
  title={Boolean(title)}
294
368
  description={Boolean(description)}
295
369
  children={Boolean(children)}
296
370
  hasTopSection={typeof onActionClick === "function" || !!auxiliaryText}
371
+ variant={variant}
297
372
  />
298
373
  ) : (
299
- <StyledMuiCard odysseyDesignTokens={odysseyDesignTokens}>
374
+ <StyledMuiCard
375
+ odysseyDesignTokens={odysseyDesignTokens}
376
+ isCompact={variant === "compact"}
377
+ >
300
378
  {(onActionClick || auxiliaryText) && (
301
- <ActionContainer odysseyDesignTokens={odysseyDesignTokens}>
379
+ <ActionContainer
380
+ odysseyDesignTokens={odysseyDesignTokens}
381
+ variant={variant}
382
+ >
302
383
  {auxiliaryText && !isLoading && (
303
384
  <Subordinate>{auxiliaryText}</Subordinate>
304
385
  )}
@@ -318,7 +399,12 @@ const AppTile = ({
318
399
  </ActionContainer>
319
400
  )}
320
401
 
321
- <MuiCardActionArea onClick={onClick}>{tileContent}</MuiCardActionArea>
402
+ <StyledMuiCardActionArea
403
+ odysseyDesignTokens={odysseyDesignTokens}
404
+ onClick={onClick}
405
+ >
406
+ {tileContent}
407
+ </StyledMuiCardActionArea>
322
408
  </StyledMuiCard>
323
409
  );
324
410
  };
@@ -33,7 +33,7 @@ import styled from "@emotion/styled";
33
33
 
34
34
  import { Autocomplete } from "../Autocomplete";
35
35
  import { Box } from "../Box";
36
- import { Button } from "../Button";
36
+ import { Button } from "../Buttons";
37
37
  import { CheckboxGroup } from "../CheckboxGroup";
38
38
  import { Checkbox } from "../Checkbox";
39
39
  import {
@@ -53,7 +53,7 @@ import {
53
53
  paginationTypeValues,
54
54
  } from "./DataTablePagination";
55
55
  import { DataFilter, DataFilters } from "./DataFilters";
56
- import { Button } from "../Button";
56
+ import { Button } from "../Buttons";
57
57
  import { Box } from "../Box";
58
58
  import { MenuButton, MenuItem } from "..";
59
59
  import { ArrowUnsortedIcon } from "../icons.generated";
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { memo } from "react";
14
14
  import { Box } from "../Box";
15
- import { Button } from "../Button";
15
+ import { Button } from "../Buttons";
16
16
  import { Support } from "../Typography";
17
17
  import { ArrowLeftIcon, ArrowRightIcon } from "../icons.generated";
18
18
 
@@ -16,9 +16,8 @@ import styled from "@emotion/styled";
16
16
  import { useTranslation } from "react-i18next";
17
17
 
18
18
  import { Box } from "../../Box";
19
- import { Button } from "../../Button";
19
+ import { Button, MenuButton } from "../../Buttons";
20
20
  import { ChevronDownIcon } from "../../icons.generated";
21
- import { MenuButton } from "../../MenuButton";
22
21
  import { UniversalProps } from "./componentTypes";
23
22
  import {
24
23
  DesignTokens,
@@ -29,14 +29,17 @@ import styled from "@emotion/styled";
29
29
  import { useTranslation } from "react-i18next";
30
30
 
31
31
  import { Box } from "../../Box";
32
- import { Button } from "../../Button";
33
- import { ButtonContext } from "../../ButtonContext";
32
+ import {
33
+ Button,
34
+ ButtonContext,
35
+ MenuButton,
36
+ MenuButtonProps,
37
+ } from "../../Buttons";
34
38
  import {
35
39
  DesignTokens,
36
40
  useOdysseyDesignTokens,
37
41
  } from "../../OdysseyDesignTokensContext";
38
42
  import { Heading5, Paragraph, Support } from "../../Typography";
39
- import { MenuButton, MenuButtonProps } from "../../MenuButton";
40
43
  import {
41
44
  ChevronDownIcon,
42
45
  ChevronUpIcon,
@@ -114,7 +117,10 @@ const MenuButtonContainer = styled("div", {
114
117
  }>(({ odysseyDesignTokens, variant }) => ({
115
118
  position: "absolute",
116
119
  right: odysseyDesignTokens.Spacing3,
117
- top: odysseyDesignTokens.Spacing3,
120
+ top:
121
+ variant === "compact"
122
+ ? odysseyDesignTokens.Spacing4
123
+ : odysseyDesignTokens.Spacing3,
118
124
  height: variant === "compact" ? CARD_IMAGE_SIZE_COMPACT : "auto",
119
125
  display: "flex",
120
126
  alignItems: "center",
@@ -128,11 +134,14 @@ const CardInnerContainer = styled("div", {
128
134
  }));
129
135
 
130
136
  const CardImageAndContentContainer = styled("div", {
131
- shouldForwardProp: (prop) => prop !== "variant",
132
- })<{ variant: (typeof cardVariantValues)[number] }>(({ variant }) => ({
133
- display: "flex",
134
- flexDirection: variant === "tile" ? "column" : "row",
135
- }));
137
+ shouldForwardProp: (prop) => prop !== "variant" && prop !== "centerContent",
138
+ })<{ variant: (typeof cardVariantValues)[number]; centerContent: boolean }>(
139
+ ({ variant, centerContent }) => ({
140
+ display: "flex",
141
+ flexDirection: variant === "tile" ? "column" : "row",
142
+ alignItems: centerContent ? "center" : "flex-start",
143
+ }),
144
+ );
136
145
 
137
146
  const CardContent = styled("div", {
138
147
  shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
@@ -140,9 +149,12 @@ const CardContent = styled("div", {
140
149
  odysseyDesignTokens: DesignTokens;
141
150
  variant: (typeof cardVariantValues)[number];
142
151
  }>(({ odysseyDesignTokens, variant }) => ({
143
- "& > .MuiTypography-h5": {
152
+ "& > .MuiTypography-h5:not(:last-child)": {
144
153
  marginBlockEnd: `${variant === "compact" ? odysseyDesignTokens.Spacing1 : odysseyDesignTokens.Spacing3} !important`,
145
154
  },
155
+ "& > *:last-child": {
156
+ marginBlockEnd: 0,
157
+ },
146
158
  }));
147
159
 
148
160
  const CardChildrenContainer = styled("div", {
@@ -221,11 +233,25 @@ const DataCard = ({
221
233
  variant,
222
234
  ]);
223
235
 
224
- const cardContent = useMemo(
225
- () => (
236
+ const cardContent = useMemo(() => {
237
+ const countDefinedProps = (
238
+ props: Array<string | ReactNode | undefined>,
239
+ ) => {
240
+ return props.filter((prop) => prop !== undefined).length;
241
+ };
242
+
243
+ const shouldCenterContent =
244
+ variant === "compact" &&
245
+ (!renderDetailPanel || !isDetailPanelOpen) &&
246
+ countDefinedProps([title, description, overline, button, children]) <= 2;
247
+
248
+ return (
226
249
  <CardInnerContainer odysseyDesignTokens={odysseyDesignTokens}>
227
250
  {(AccessoryProp || renderDetailPanel) && <Box>{Accessory}</Box>}
228
- <CardImageAndContentContainer variant={variant}>
251
+ <CardImageAndContentContainer
252
+ variant={variant}
253
+ centerContent={shouldCenterContent}
254
+ >
229
255
  {image && (
230
256
  <ImageContainer
231
257
  odysseyDesignTokens={odysseyDesignTokens}
@@ -268,24 +294,23 @@ const DataCard = ({
268
294
  </CardContent>
269
295
  </CardImageAndContentContainer>
270
296
  </CardInnerContainer>
271
- ),
272
- [
273
- odysseyDesignTokens,
274
- AccessoryProp,
275
- renderDetailPanel,
276
- Accessory,
277
- variant,
278
- image,
279
- menuButtonChildren,
280
- overline,
281
- title,
282
- description,
283
- button,
284
- children,
285
- isDetailPanelOpen,
286
- row,
287
- ],
288
- );
297
+ );
298
+ }, [
299
+ odysseyDesignTokens,
300
+ AccessoryProp,
301
+ renderDetailPanel,
302
+ Accessory,
303
+ variant,
304
+ image,
305
+ menuButtonChildren,
306
+ overline,
307
+ title,
308
+ description,
309
+ button,
310
+ children,
311
+ isDetailPanelOpen,
312
+ row,
313
+ ]);
289
314
 
290
315
  return (
291
316
  <MuiCard
@@ -35,7 +35,7 @@ import { DataFilters } from "../DataFilters";
35
35
  import { EmptyState } from "../../EmptyState";
36
36
  import { fetchData } from "./fetchData";
37
37
  import { LayoutSwitcher } from "./LayoutSwitcher";
38
- import { MenuButton } from "../../MenuButton";
38
+ import { MenuButton } from "../../Buttons";
39
39
  import { MoreIcon } from "../../icons.generated";
40
40
  import { TableSettings } from "./TableSettings";
41
41
  import { Pagination, usePagination } from "../../Pagination";
@@ -14,8 +14,7 @@ import { Dispatch, memo, useCallback, SetStateAction, useMemo } from "react";
14
14
  import { useTranslation } from "react-i18next";
15
15
 
16
16
  import { AvailableLayouts, DataLayout } from "./componentTypes";
17
- import { MenuButton } from "../../MenuButton";
18
- import { MenuItem } from "../../MenuItem";
17
+ import { MenuButton, MenuItem } from "../../Buttons";
19
18
 
20
19
  export type LayoutSwitcherProps = {
21
20
  availableLayouts: AvailableLayouts;
@@ -20,10 +20,8 @@ import {
20
20
  ArrowTopIcon,
21
21
  ArrowUpIcon,
22
22
  } from "../../icons.generated";
23
- import { Button } from "../../Button";
24
- import { MenuItem } from "../../MenuItem";
23
+ import { Button, MenuButtonProps, MenuItem } from "../../Buttons";
25
24
  import { DataTableProps } from "./DataTable";
26
- import { MenuButtonProps } from "../../MenuButton";
27
25
 
28
26
  export type RowActionsProps = {
29
27
  isRowReorderingDisabled?: boolean;
@@ -41,7 +41,7 @@ import {
41
41
  DragIndicatorIcon,
42
42
  } from "../../icons.generated";
43
43
  import { Box } from "../../Box";
44
- import { Button } from "../../Button";
44
+ import { Button, MenuButton } from "../../Buttons";
45
45
  import { TableLayoutProps, TableState, UniversalProps } from "./componentTypes";
46
46
  import { DataTableCell } from "./dataTypes";
47
47
  import {
@@ -49,7 +49,6 @@ import {
49
49
  displayColumnDefOptions,
50
50
  ScrollableTableContainer,
51
51
  } from "./tableConstants";
52
- import { MenuButton } from "../../MenuButton";
53
52
  import { MoreIcon } from "../../icons.generated";
54
53
  import { RowActions } from "./RowActions";
55
54
  import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext";
@@ -17,8 +17,7 @@ import { useTranslation } from "react-i18next";
17
17
 
18
18
  import { densityValues } from "./constants";
19
19
  import { ListIcon, ShowIcon } from "../../icons.generated";
20
- import { MenuButton } from "../../MenuButton";
21
- import { MenuItem } from "../../MenuItem";
20
+ import { MenuButton, MenuItem } from "../../Buttons";
22
21
  import { TableLayoutProps, TableState } from "./componentTypes";
23
22
 
24
23
  export type TableSettingsProps = {
@@ -32,7 +32,7 @@ import { DateTime } from "luxon";
32
32
  import { AdapterLuxon } from "@mui/x-date-pickers/AdapterLuxon";
33
33
  import styled from "@emotion/styled";
34
34
 
35
- import { Button } from "../Button";
35
+ import { Button } from "../Buttons";
36
36
  import {
37
37
  ArrowLeftIcon,
38
38
  ArrowRightIcon,