@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/CHANGELOG.md +4 -0
- package/dist/Button.js +27 -25
- package/dist/Button.js.map +1 -1
- package/dist/MuiPropsContext.js.map +1 -1
- package/dist/Select.js +1 -1
- package/dist/Select.js.map +1 -1
- package/dist/src/Button.d.ts.map +1 -1
- package/dist/src/MuiPropsContext.d.ts.map +1 -1
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Button.tsx +35 -33
- package/src/MuiPropsContext.ts +0 -1
- package/src/Select.tsx +7 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okta/odyssey-react-mui",
|
|
3
|
-
"version": "1.12.
|
|
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.
|
|
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": "
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
203
|
-
</>
|
|
204
|
-
);
|
|
206
|
+
return renderButton(muiProps);
|
|
205
207
|
};
|
|
206
208
|
|
|
207
209
|
const MemoizedButton = memo(Button);
|
package/src/MuiPropsContext.ts
CHANGED
|
@@ -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
|
-
{
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
}),
|