@okta/odyssey-react-mui 1.12.9 → 1.12.10

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.12.9",
3
+ "version": "1.12.10",
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.14.9",
52
52
  "@mui/utils": "^5.11.2",
53
53
  "@mui/x-date-pickers": "^5.0.15",
54
- "@okta/odyssey-design-tokens": "1.12.9",
54
+ "@okta/odyssey-design-tokens": "1.12.10",
55
55
  "date-fns": "^2.30.0",
56
56
  "i18next": "^23.5.1",
57
57
  "material-react-table": "^2.0.2",
@@ -63,5 +63,5 @@
63
63
  "react": ">=17 <19",
64
64
  "react-dom": ">=17 <19"
65
65
  },
66
- "gitHead": "13304462f9cf9ef8d67b9a3450eb9fe49175ca49"
66
+ "gitHead": "2a402061b4989b855a103baa728d19e33fa54a49"
67
67
  }
package/src/Button.tsx CHANGED
@@ -135,8 +135,8 @@ const Button = ({
135
135
  variant,
136
136
  }: ButtonProps) => {
137
137
  const muiProps = useMuiProps();
138
-
139
138
  const localButtonRef = useRef<HTMLButtonElement>(null);
139
+
140
140
  useImperativeHandle(
141
141
  buttonRef,
142
142
  () => {
@@ -150,28 +150,32 @@ const Button = ({
150
150
  );
151
151
 
152
152
  const renderButton = useCallback(
153
- (muiProps) => (
154
- <MuiButton
155
- {...muiProps}
156
- aria-label={ariaLabel}
157
- aria-labelledby={ariaLabelledBy}
158
- aria-describedby={ariaDescribedBy}
159
- data-se={testId}
160
- disabled={isDisabled}
161
- endIcon={endIcon}
162
- fullWidth={isFullWidth}
163
- id={id}
164
- onClick={onClick}
165
- ref={localButtonRef}
166
- size={size}
167
- startIcon={startIcon}
168
- translate={translate}
169
- type={type}
170
- variant={variant}
171
- >
172
- {label}
173
- </MuiButton>
174
- ),
153
+ (muiProps) => {
154
+ muiProps?.ref?.(localButtonRef.current);
155
+
156
+ return (
157
+ <MuiButton
158
+ {...muiProps}
159
+ aria-label={ariaLabel}
160
+ aria-labelledby={ariaLabelledBy}
161
+ aria-describedby={ariaDescribedBy}
162
+ data-se={testId}
163
+ disabled={isDisabled}
164
+ endIcon={endIcon}
165
+ fullWidth={isFullWidth}
166
+ id={id}
167
+ onClick={onClick}
168
+ ref={localButtonRef}
169
+ size={size}
170
+ startIcon={startIcon}
171
+ translate={translate}
172
+ type={type}
173
+ variant={variant}
174
+ >
175
+ {label}
176
+ </MuiButton>
177
+ );
178
+ },
175
179
  [
176
180
  ariaDescribedBy,
177
181
  ariaLabel,
@@ -191,17 +195,15 @@ const Button = ({
191
195
  ]
192
196
  );
193
197
 
194
- return (
195
- <>
196
- {tooltipText && !isDisabled && (
197
- <Tooltip ariaType="description" placement="top" text={tooltipText}>
198
- <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>
199
- </Tooltip>
200
- )}
198
+ if (tooltipText) {
199
+ return (
200
+ <Tooltip ariaType="description" placement="top" text={tooltipText}>
201
+ <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>
202
+ </Tooltip>
203
+ );
204
+ }
201
205
 
202
- {(isDisabled || !tooltipText) && renderButton(muiProps)}
203
- </>
204
- );
206
+ return renderButton(muiProps);
205
207
  };
206
208
 
207
209
  const MemoizedButton = memo(Button);
@@ -13,7 +13,6 @@
13
13
  import { createContext, useContext } from "react";
14
14
 
15
15
  export type MuiPropsContextType = Record<string, unknown>;
16
-
17
16
  export const MuiPropsContext = createContext<MuiPropsContextType>({});
18
17
 
19
18
  export const useMuiProps = () => useContext(MuiPropsContext);
package/src/Select.tsx CHANGED
@@ -288,11 +288,13 @@ const Select = <
288
288
  />
289
289
  )}
290
290
  {option.text}
291
- {internalSelectedValues === option?.value && (
292
- <ListItemSecondaryAction>
293
- <CheckIcon />
294
- </ListItemSecondaryAction>
295
- )}
291
+ {!hasMultipleChoices &&
292
+ (internalSelectedValues?.includes(option.value) ||
293
+ internalSelectedValues === option.value) && (
294
+ <ListItemSecondaryAction>
295
+ <CheckIcon />
296
+ </ListItemSecondaryAction>
297
+ )}
296
298
  </MenuItem>
297
299
  );
298
300
  }),