@okta/odyssey-react-mui 1.14.8 → 1.15.9

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 (245) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +4 -0
  3. package/dist/Autocomplete.js +84 -2
  4. package/dist/Autocomplete.js.map +1 -1
  5. package/dist/Breadcrumbs.js +10 -1
  6. package/dist/Breadcrumbs.js.map +1 -1
  7. package/dist/Button.js +2 -2
  8. package/dist/Button.js.map +1 -1
  9. package/dist/Callout.js.map +1 -1
  10. package/dist/Checkbox.js +8 -4
  11. package/dist/Checkbox.js.map +1 -1
  12. package/dist/CheckboxGroup.js.map +1 -1
  13. package/dist/DataTable/DataTable.js +39 -10
  14. package/dist/DataTable/DataTable.js.map +1 -1
  15. package/dist/DataTable/index.js.map +1 -1
  16. package/dist/MenuButton.js.map +1 -1
  17. package/dist/RadioGroup.js.map +1 -1
  18. package/dist/Select.js +34 -45
  19. package/dist/Select.js.map +1 -1
  20. package/dist/Tabs.js +21 -0
  21. package/dist/Tabs.js.map +1 -1
  22. package/dist/Tile.js +14 -18
  23. package/dist/Tile.js.map +1 -1
  24. package/dist/labs/DataFilters.js +98 -97
  25. package/dist/labs/DataFilters.js.map +1 -1
  26. package/dist/labs/index.js +0 -1
  27. package/dist/labs/index.js.map +1 -1
  28. package/dist/properties/ts/odyssey-react-mui_cs.js +31 -3
  29. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  30. package/dist/properties/ts/odyssey-react-mui_da.js +31 -3
  31. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  32. package/dist/properties/ts/odyssey-react-mui_de.js +31 -3
  33. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  34. package/dist/properties/ts/odyssey-react-mui_el.js +31 -3
  35. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  36. package/dist/properties/ts/odyssey-react-mui_es.js +31 -3
  37. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  38. package/dist/properties/ts/odyssey-react-mui_fi.js +31 -3
  39. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  40. package/dist/properties/ts/odyssey-react-mui_fr.js +31 -3
  41. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  42. package/dist/properties/ts/odyssey-react-mui_hu.js +31 -3
  43. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  44. package/dist/properties/ts/odyssey-react-mui_id.js +31 -3
  45. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  46. package/dist/properties/ts/odyssey-react-mui_it.js +31 -3
  47. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  48. package/dist/properties/ts/odyssey-react-mui_ja.js +31 -3
  49. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  50. package/dist/properties/ts/odyssey-react-mui_ko.js +31 -3
  51. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  52. package/dist/properties/ts/odyssey-react-mui_ms.js +31 -3
  53. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  54. package/dist/properties/ts/odyssey-react-mui_nb.js +31 -3
  55. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  56. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +31 -3
  57. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  58. package/dist/properties/ts/odyssey-react-mui_ok_PL.js +34 -3
  59. package/dist/properties/ts/odyssey-react-mui_ok_PL.js.map +1 -1
  60. package/dist/properties/ts/odyssey-react-mui_ok_SK.js +34 -3
  61. package/dist/properties/ts/odyssey-react-mui_ok_SK.js.map +1 -1
  62. package/dist/properties/ts/odyssey-react-mui_pl.js +31 -3
  63. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  64. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +31 -3
  65. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  66. package/dist/properties/ts/odyssey-react-mui_ro.js +31 -3
  67. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  68. package/dist/properties/ts/odyssey-react-mui_ru.js +31 -3
  69. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  70. package/dist/properties/ts/odyssey-react-mui_sv.js +31 -3
  71. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  72. package/dist/properties/ts/odyssey-react-mui_th.js +31 -3
  73. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  74. package/dist/properties/ts/odyssey-react-mui_tr.js +31 -3
  75. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  76. package/dist/properties/ts/odyssey-react-mui_uk.js +31 -3
  77. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  78. package/dist/properties/ts/odyssey-react-mui_vi.js +31 -3
  79. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  80. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +31 -3
  81. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  82. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +31 -3
  83. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  84. package/dist/src/Autocomplete.d.ts +7 -1
  85. package/dist/src/Autocomplete.d.ts.map +1 -1
  86. package/dist/src/Breadcrumbs.d.ts.map +1 -1
  87. package/dist/src/Button.d.ts +31 -15
  88. package/dist/src/Button.d.ts.map +1 -1
  89. package/dist/src/Callout.d.ts +1 -1
  90. package/dist/src/Checkbox.d.ts.map +1 -1
  91. package/dist/src/CheckboxGroup.d.ts +2 -3
  92. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  93. package/dist/src/DataTable/DataTable.d.ts +13 -6
  94. package/dist/src/DataTable/DataTable.d.ts.map +1 -1
  95. package/dist/src/DataTable/index.d.ts +2 -2
  96. package/dist/src/DataTable/index.d.ts.map +1 -1
  97. package/dist/src/MenuButton.d.ts +3 -4
  98. package/dist/src/MenuButton.d.ts.map +1 -1
  99. package/dist/src/RadioGroup.d.ts +3 -3
  100. package/dist/src/RadioGroup.d.ts.map +1 -1
  101. package/dist/src/Select.d.ts.map +1 -1
  102. package/dist/src/Tabs.d.ts.map +1 -1
  103. package/dist/src/Tile.d.ts.map +1 -1
  104. package/dist/src/labs/DataFilters.d.ts +9 -1
  105. package/dist/src/labs/DataFilters.d.ts.map +1 -1
  106. package/dist/src/labs/index.d.ts +0 -1
  107. package/dist/src/labs/index.d.ts.map +1 -1
  108. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +30 -2
  109. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  110. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +30 -2
  111. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  112. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +30 -2
  113. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  114. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +30 -2
  115. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  116. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +30 -2
  117. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  118. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +30 -2
  119. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  120. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +30 -2
  121. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  122. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +30 -2
  123. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  124. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +30 -2
  125. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  126. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +30 -2
  127. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  128. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +30 -2
  129. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  130. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +30 -2
  131. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  132. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +30 -2
  133. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  134. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +30 -2
  135. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  136. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +30 -2
  137. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  138. package/dist/src/properties/ts/odyssey-react-mui_ok_PL.d.ts +33 -2
  139. package/dist/src/properties/ts/odyssey-react-mui_ok_PL.d.ts.map +1 -1
  140. package/dist/src/properties/ts/odyssey-react-mui_ok_SK.d.ts +33 -2
  141. package/dist/src/properties/ts/odyssey-react-mui_ok_SK.d.ts.map +1 -1
  142. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +30 -2
  143. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  144. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +30 -2
  145. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  146. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +30 -2
  147. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  148. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +30 -2
  149. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  150. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +30 -2
  151. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  152. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +30 -2
  153. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  154. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +30 -2
  155. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  156. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +30 -2
  157. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  158. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +30 -2
  159. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  160. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +30 -2
  161. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  162. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +30 -2
  163. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  164. package/dist/src/theme/components.d.ts.map +1 -1
  165. package/dist/theme/components.js +25 -8
  166. package/dist/theme/components.js.map +1 -1
  167. package/dist/tsconfig.production.tsbuildinfo +1 -1
  168. package/package.json +9 -7
  169. package/src/Autocomplete.tsx +124 -1
  170. package/src/Breadcrumbs.tsx +9 -1
  171. package/src/Button.tsx +32 -16
  172. package/src/Callout.tsx +1 -1
  173. package/src/Checkbox.tsx +4 -3
  174. package/src/CheckboxGroup.tsx +2 -5
  175. package/src/DataTable/DataTable.tsx +106 -26
  176. package/src/DataTable/index.tsx +1 -1
  177. package/src/MenuButton.tsx +11 -21
  178. package/src/RadioGroup.tsx +3 -3
  179. package/src/Select.tsx +84 -91
  180. package/src/Tabs.tsx +40 -1
  181. package/src/Tile.tsx +12 -14
  182. package/src/labs/DataFilters.tsx +211 -177
  183. package/src/labs/index.ts +0 -1
  184. package/src/properties/translations/odyssey-react-mui_cs.properties +36 -3
  185. package/src/properties/translations/odyssey-react-mui_da.properties +36 -3
  186. package/src/properties/translations/odyssey-react-mui_de.properties +36 -3
  187. package/src/properties/translations/odyssey-react-mui_el.properties +36 -3
  188. package/src/properties/translations/odyssey-react-mui_es.properties +36 -3
  189. package/src/properties/translations/odyssey-react-mui_fi.properties +36 -3
  190. package/src/properties/translations/odyssey-react-mui_fr.properties +36 -3
  191. package/src/properties/translations/odyssey-react-mui_hu.properties +36 -3
  192. package/src/properties/translations/odyssey-react-mui_id.properties +36 -3
  193. package/src/properties/translations/odyssey-react-mui_it.properties +36 -3
  194. package/src/properties/translations/odyssey-react-mui_ja.properties +36 -3
  195. package/src/properties/translations/odyssey-react-mui_ko.properties +36 -3
  196. package/src/properties/translations/odyssey-react-mui_ms.properties +36 -3
  197. package/src/properties/translations/odyssey-react-mui_nb.properties +36 -3
  198. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +36 -3
  199. package/src/properties/translations/odyssey-react-mui_ok_PL.properties +33 -2
  200. package/src/properties/translations/odyssey-react-mui_ok_SK.properties +33 -2
  201. package/src/properties/translations/odyssey-react-mui_pl.properties +36 -3
  202. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +36 -3
  203. package/src/properties/translations/odyssey-react-mui_ro.properties +36 -3
  204. package/src/properties/translations/odyssey-react-mui_ru.properties +36 -3
  205. package/src/properties/translations/odyssey-react-mui_sv.properties +36 -3
  206. package/src/properties/translations/odyssey-react-mui_th.properties +36 -3
  207. package/src/properties/translations/odyssey-react-mui_tr.properties +36 -3
  208. package/src/properties/translations/odyssey-react-mui_uk.properties +36 -3
  209. package/src/properties/translations/odyssey-react-mui_vi.properties +36 -3
  210. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +36 -3
  211. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +36 -3
  212. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  213. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  214. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  215. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  216. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  217. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  218. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  219. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  220. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  221. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  222. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  223. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  224. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  225. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  226. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  227. package/src/properties/ts/odyssey-react-mui_ok_PL.ts +1 -1
  228. package/src/properties/ts/odyssey-react-mui_ok_SK.ts +1 -1
  229. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  230. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  231. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  232. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  233. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  234. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  235. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  236. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  237. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  238. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  239. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  240. package/src/theme/components.tsx +28 -7
  241. package/dist/labs/VirtualizedAutocomplete.js +0 -134
  242. package/dist/labs/VirtualizedAutocomplete.js.map +0 -1
  243. package/dist/src/labs/VirtualizedAutocomplete.d.ts +0 -90
  244. package/dist/src/labs/VirtualizedAutocomplete.d.ts.map +0 -1
  245. package/src/labs/VirtualizedAutocomplete.tsx +0 -365
@@ -10,21 +10,17 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import { memo, type ReactElement, useCallback, useMemo, useState } from "react";
14
13
  import {
15
- Divider,
16
- ListSubheader,
17
- Menu as MuiMenu,
18
- PopoverOrigin,
19
- } from "@mui/material";
20
-
21
- import {
22
- Button,
23
- buttonSizeValues,
24
- buttonVariantValues,
25
- MenuItem,
26
- useUniqueId,
27
- } from "./";
14
+ memo,
15
+ type ReactElement,
16
+ useCallback,
17
+ useMemo,
18
+ useState,
19
+ ReactNode,
20
+ } from "react";
21
+ import { Menu as MuiMenu, PopoverOrigin } from "@mui/material";
22
+
23
+ import { Button, buttonSizeValues, buttonVariantValues, useUniqueId } from "./";
28
24
  import { ChevronDownIcon, MoreIcon } from "./icons.generated";
29
25
  import { FieldComponentProps } from "./FieldComponentProps";
30
26
  import { MenuContext, MenuContextType } from "./MenuContext";
@@ -45,13 +41,7 @@ export type MenuButtonProps = {
45
41
  /**
46
42
  * The <MenuItem> components within the Menu.
47
43
  */
48
- children:
49
- | ReactElement<typeof MenuItem | typeof Divider | typeof ListSubheader>
50
- | Array<
51
- | ReactElement<typeof MenuItem | typeof Divider | typeof ListSubheader>
52
- | NullElement
53
- >
54
- | NullElement;
44
+ children: ReactNode | NullElement;
55
45
  /**
56
46
  * The end Icon on the trigggering Button
57
47
  */
@@ -14,9 +14,9 @@ import {
14
14
  RadioGroup as MuiRadioGroup,
15
15
  type RadioGroupProps as MuiRadioGroupProps,
16
16
  } from "@mui/material";
17
- import { memo, ReactElement, useCallback, useRef } from "react";
17
+ import { memo, ReactNode, useCallback, useRef } from "react";
18
18
 
19
- import { Radio, RadioProps } from "./Radio";
19
+ import { RadioProps } from "./Radio";
20
20
  import { Field } from "./Field";
21
21
  import {
22
22
  FieldComponentProps,
@@ -29,7 +29,7 @@ export type RadioGroupProps = {
29
29
  /**
30
30
  * The Radio components within the group. Must include two or more.
31
31
  */
32
- children: Array<ReactElement<typeof Radio>>;
32
+ children: ReactNode;
33
33
  /**
34
34
  * The text value of the Radio that should be selected by default
35
35
  */
package/src/Select.tsx CHANGED
@@ -92,6 +92,7 @@ const NonInteractiveIcon = styled(CloseCircleFilledIcon, {
92
92
  margin-inline-start: ${({ odysseyDesignTokens }) =>
93
93
  odysseyDesignTokens.Spacing2};
94
94
  margin-inline-end: -${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};
95
+ margin-block-end: -1px;
95
96
  `;
96
97
 
97
98
  const ChipsInnerContainer = styled(MuiBox, {
@@ -104,20 +105,9 @@ const ChipsInnerContainer = styled(MuiBox, {
104
105
  display: flex;
105
106
  flex-wrap: wrap;
106
107
  gap: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};
107
- pointer-events: ${({ isInteractive }) => (isInteractive ? "auto" : "none")};
108
+ pointer-events: none;
108
109
  opacity: ${({ isInteractive }) => (isInteractive ? 1 : 0)};
109
- `;
110
-
111
- const ChipsSpacer = styled("div", {
112
- shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
113
- })<{
114
- odysseyDesignTokens: DesignTokens;
115
- }>`
116
- display: inline-block;
117
- border-color: transparent;
118
- border-style: solid none;
119
- border-width: 1px;
120
- height: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing6};
110
+ min-height: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing6};
121
111
  `;
122
112
 
123
113
  export type SelectValueType<HasMultipleChoices> =
@@ -280,12 +270,14 @@ const Select = <
280
270
  } = event;
281
271
  if (controlledStateRef.current !== CONTROLLED) {
282
272
  setInternalSelectedValues(
283
- (typeof value === "string" ? value.split(",") : value) as Value,
273
+ (typeof value === "string" && hasMultipleChoices
274
+ ? value.split(",")
275
+ : value) as Value,
284
276
  );
285
277
  }
286
278
  onChangeProp?.(event, child);
287
279
  },
288
- [onChangeProp],
280
+ [hasMultipleChoices, onChangeProp],
289
281
  );
290
282
 
291
283
  // Normalize the options array to accommodate the various
@@ -312,73 +304,74 @@ const Select = <
312
304
  [options],
313
305
  );
314
306
 
315
- const Chips = useCallback(
316
- ({
317
- selection,
318
- isInteractive,
319
- }: {
320
- selection: string[];
321
- isInteractive: boolean;
322
- }) => {
323
- const removeSelection = (itemToRemove: string) => {
324
- if (Array.isArray(internalSelectedValues)) {
325
- const newValue = internalSelectedValues.filter(
326
- (item: string) => item !== itemToRemove,
327
- );
307
+ const removeSelectedValue = useCallback(
308
+ (selectedValue: string) => {
309
+ if (Array.isArray(internalSelectedValues)) {
310
+ const newValue = internalSelectedValues.filter(
311
+ (internalSelectedValue) => internalSelectedValue !== selectedValue,
312
+ );
328
313
 
329
- const syntheticEvent = {
330
- target: { value: newValue },
331
- } as SelectChangeEvent<Value>;
314
+ const syntheticEvent = {
315
+ target: { value: newValue },
316
+ } as SelectChangeEvent<Value>;
332
317
 
333
- onChange(syntheticEvent, null);
334
- }
335
- };
318
+ onChange(syntheticEvent, null);
319
+ }
320
+ },
321
+ [internalSelectedValues, onChange],
322
+ );
336
323
 
324
+ const Chips = useCallback(
325
+ ({ isInteractive }: { isInteractive: boolean }) => {
337
326
  const stopPropagation = (event: MouseEvent<SVGSVGElement>) =>
338
327
  event.stopPropagation();
339
328
 
329
+ const hasNonInteractiveIcon =
330
+ !isInteractive &&
331
+ controlledStateRef.current === CONTROLLED &&
332
+ hasMultipleChoices;
333
+
340
334
  return (
341
- <ChipsInnerContainer
342
- isInteractive={isInteractive}
343
- odysseyDesignTokens={odysseyDesignTokens}
344
- >
345
- <ChipsSpacer odysseyDesignTokens={odysseyDesignTokens} />
346
- {selection.map(
347
- (item: string) =>
348
- item?.length > 0 && (
349
- <MuiChip
350
- key={item}
351
- label={
352
- <>
353
- {item}
354
- {!isInteractive &&
355
- controlledStateRef.current === CONTROLLED &&
356
- hasMultipleChoices && (
335
+ Array.isArray(internalSelectedValues) && (
336
+ <ChipsInnerContainer
337
+ isInteractive={isInteractive}
338
+ odysseyDesignTokens={odysseyDesignTokens}
339
+ >
340
+ {internalSelectedValues.map(
341
+ (item) =>
342
+ item?.length > 0 && (
343
+ <MuiChip
344
+ key={item}
345
+ label={
346
+ <>
347
+ {item}
348
+ {hasNonInteractiveIcon && (
357
349
  <NonInteractiveIcon
358
350
  odysseyDesignTokens={odysseyDesignTokens}
359
351
  />
360
352
  )}
361
- </>
362
- }
363
- tabIndex={-1}
364
- onDelete={
365
- isInteractive && controlledStateRef.current === CONTROLLED
366
- ? () => removeSelection(item)
367
- : undefined
368
- }
369
- deleteIcon={
370
- <CloseCircleFilledIcon
371
- sx={{ pointerEvents: "auto" }}
372
- // We need to stop event propagation on mouse down to prevent the deletion
373
- // from being blocked by the Select list opening, and also ensure that
374
- // the pointerEvent is registered even when the parent's are not
375
- onMouseDown={stopPropagation}
376
- />
377
- }
378
- />
379
- ),
380
- )}
381
- </ChipsInnerContainer>
353
+ </>
354
+ }
355
+ tabIndex={-1}
356
+ onDelete={
357
+ isInteractive && controlledStateRef.current === CONTROLLED
358
+ ? () => removeSelectedValue(item)
359
+ : undefined
360
+ }
361
+ deleteIcon={
362
+ <CloseCircleFilledIcon
363
+ sx={{ pointerEvents: "auto" }}
364
+ // We need to stop event propagation on mouse down to prevent the deletion
365
+ // from being blocked by the Select list opening, and also ensure that
366
+ // the pointerEvent is registered even when the parent's are not
367
+ onMouseDown={stopPropagation}
368
+ />
369
+ }
370
+ />
371
+ ),
372
+ )}
373
+ </ChipsInnerContainer>
374
+ )
382
375
  );
383
376
  },
384
377
  [
@@ -386,13 +379,13 @@ const Select = <
386
379
  hasMultipleChoices,
387
380
  internalSelectedValues,
388
381
  odysseyDesignTokens,
389
- onChange,
382
+ removeSelectedValue,
390
383
  ],
391
384
  );
392
385
 
393
386
  // Convert the options into the ReactNode children
394
387
  // that will populate the <Select>
395
- const children = useMemo(
388
+ const renderedOptions = useMemo(
396
389
  () =>
397
390
  normalizedOptions.map((option, index) => {
398
391
  if (option.type === "heading") {
@@ -413,22 +406,18 @@ const Select = <
413
406
  >
414
407
  {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}
415
408
  {option.text}
416
- {!hasMultipleChoices &&
417
- (internalSelectedValues?.includes(option.value) ||
418
- internalSelectedValues === option.value) && (
419
- <ListItemSecondaryAction>
420
- <CheckIcon />
421
- </ListItemSecondaryAction>
422
- )}
409
+ {!hasMultipleChoices && internalSelectedValues === option.value && (
410
+ <ListItemSecondaryAction>
411
+ <CheckIcon />
412
+ </ListItemSecondaryAction>
413
+ )}
423
414
  </MuiMenuItem>
424
415
  );
425
416
  }),
426
417
  [hasMultipleChoices, normalizedOptions, internalSelectedValues],
427
418
  );
428
-
429
419
  const renderValue = useCallback(
430
- (value: Value) =>
431
- Array.isArray(value) && <Chips selection={value} isInteractive={false} />,
420
+ (value: Value) => Array.isArray(value) && <Chips isInteractive={false} />,
432
421
  [Chips],
433
422
  );
434
423
 
@@ -444,7 +433,6 @@ const Select = <
444
433
  {...inputValues}
445
434
  aria-describedby={ariaDescribedBy}
446
435
  aria-errormessage={errorMessageElementId}
447
- children={children}
448
436
  id={id}
449
437
  inputProps={{ "data-se": testId }}
450
438
  inputRef={localInputRef}
@@ -456,16 +444,21 @@ const Select = <
456
444
  onFocus={onFocus}
457
445
  renderValue={hasMultipleChoices ? renderValue : undefined}
458
446
  translate={translate}
459
- />
460
- {hasMultipleChoices && Array.isArray(value) && (
461
- <ChipsPositioningContainer odysseyDesignTokens={odysseyDesignTokens}>
462
- <Chips selection={value} isInteractive={true} />
463
- </ChipsPositioningContainer>
447
+ >
448
+ {renderedOptions}
449
+ </MuiSelect>
450
+ {hasMultipleChoices && (
451
+ <>
452
+ <ChipsPositioningContainer
453
+ odysseyDesignTokens={odysseyDesignTokens}
454
+ >
455
+ <Chips isInteractive={true} />
456
+ </ChipsPositioningContainer>
457
+ </>
464
458
  )}
465
459
  </SelectContainer>
466
460
  ),
467
461
  [
468
- children,
469
462
  Chips,
470
463
  inputValues,
471
464
  hasMultipleChoices,
@@ -474,10 +467,10 @@ const Select = <
474
467
  onBlur,
475
468
  onChange,
476
469
  onFocus,
470
+ renderedOptions,
477
471
  renderValue,
478
472
  testId,
479
473
  translate,
480
- value,
481
474
  ],
482
475
  );
483
476
 
package/src/Tabs.tsx CHANGED
@@ -121,7 +121,15 @@ const Tabs = ({
121
121
  onChange: onChangeProp,
122
122
  }: TabsProps & Pick<HtmlProps, "ariaLabel">) => {
123
123
  const [tabState, setTabState] = useState(initialValue ?? value ?? "0");
124
-
124
+ /*
125
+ The scrollButtons prop is initially set to `false`.
126
+ It's then reset to `auto` when the document is visible.
127
+ This prevents a rare bug where scroll buttons appear
128
+ when the component is rendered while hidden and the
129
+ screen is wide enough to not need scroll buttons.
130
+ */
131
+ const [scrollButtons, setScrollButtons] =
132
+ useState<MuiTabListProps["scrollButtons"]>(false);
125
133
  const onChange = useCallback<NonNullable<MuiTabListProps["onChange"]>>(
126
134
  (event, value: string) => {
127
135
  setTabState(value);
@@ -136,6 +144,36 @@ const Tabs = ({
136
144
  }
137
145
  }, [value]);
138
146
 
147
+ // listen for visibility change to reset scroll buttons override
148
+ useEffect(() => {
149
+ // keep track of animation frame to cancel when needed
150
+ let animationFrame: number;
151
+
152
+ // called when unmounted or scroll buttons is reset
153
+ const cleanup = () => {
154
+ cancelAnimationFrame(animationFrame);
155
+ document.removeEventListener("visibilitychange", refreshScrollButtons);
156
+ };
157
+
158
+ // Reset the scroll buttons override when the document becomes visible.
159
+ // If called, then the document is hidden because the event listener
160
+ // is only registered if the document is hidden
161
+ function refreshScrollButtons() {
162
+ animationFrame = requestAnimationFrame(() => {
163
+ cleanup();
164
+ setScrollButtons("auto");
165
+ });
166
+ }
167
+
168
+ // don't override scroll buttons if it's already set to "auto"
169
+ if (scrollButtons !== "auto") {
170
+ document.addEventListener("visibilitychange", refreshScrollButtons);
171
+ }
172
+ return () => {
173
+ cleanup();
174
+ };
175
+ }, [scrollButtons]);
176
+
139
177
  const renderTab = useCallback(
140
178
  (tab: TabItemProps, index: number) => {
141
179
  const {
@@ -177,6 +215,7 @@ const Tabs = ({
177
215
  onChange={onChange}
178
216
  aria-label={ariaLabel}
179
217
  variant="scrollable"
218
+ scrollButtons={scrollButtons}
180
219
  >
181
220
  {tabs.map((tab, index) => renderTab(tab, index))}
182
221
  </MuiTabList>
package/src/Tile.tsx CHANGED
@@ -77,23 +77,21 @@ const ImageContainer = styled("div", {
77
77
  })<{
78
78
  odysseyDesignTokens: DesignTokens;
79
79
  hasMenuButtonChildren: boolean;
80
- }>`
81
- display: flex;
82
- align-items: flex-start;
83
- max-height: ${TILE_IMAGE_HEIGHT};
84
- margin-block-end: ${({ odysseyDesignTokens }) =>
85
- odysseyDesignTokens.Spacing5};
86
- padding-right: ${({ odysseyDesignTokens, hasMenuButtonChildren }) =>
87
- hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0};
88
- `;
80
+ }>(({ odysseyDesignTokens, hasMenuButtonChildren }) => ({
81
+ display: "flex",
82
+ alignItems: "flex-start",
83
+ maxHeight: `${TILE_IMAGE_HEIGHT}`,
84
+ marginBlockEnd: odysseyDesignTokens.Spacing5,
85
+ paddingRight: hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0,
86
+ }));
89
87
 
90
88
  const MenuButtonContainer = styled("div", {
91
89
  shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
92
- })<{ odysseyDesignTokens: DesignTokens }>`
93
- position: absolute;
94
- right: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing3};
95
- top: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing3};
96
- `;
90
+ })<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({
91
+ position: "absolute",
92
+ right: odysseyDesignTokens.Spacing3,
93
+ top: odysseyDesignTokens.Spacing3,
94
+ }));
97
95
 
98
96
  const buttonProviderValue = { isFullWidth: true };
99
97