@recursica/mui-adapter 0.26.0 → 0.28.0
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 +17 -0
- package/dist/index.d.ts +83 -1
- package/dist/mui-adapter.cjs +73 -73
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.css +1 -1
- package/dist/mui-adapter.js +9400 -9255
- package/dist/mui-adapter.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Autocomplete/Autocomplete.tsx +46 -34
- package/src/components/Avatar/Avatar.tsx +11 -21
- package/src/components/Badge/Badge.tsx +9 -13
- package/src/components/Breadcrumb/Breadcrumb.module.css +10 -5
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -6
- package/src/components/Breadcrumb/Breadcrumb.tsx +13 -18
- package/src/components/Button/Button.tsx +17 -11
- package/src/components/Card/Card.tsx +9 -19
- package/src/components/Checkbox/Checkbox.tsx +22 -26
- package/src/components/Checkbox/CheckboxGroup.tsx +3 -3
- package/src/components/Chip/Chip.tsx +12 -19
- package/src/components/Dropdown/BareDropdown.tsx +14 -8
- package/src/components/Dropdown/Dropdown.icons.tsx +33 -0
- package/src/components/Dropdown/Dropdown.module.css +117 -15
- package/src/components/Dropdown/Dropdown.stories.tsx +21 -0
- package/src/components/Dropdown/Dropdown.tsx +102 -17
- package/src/components/Dropdown/USAGE.md +7 -0
- package/src/components/FileInput/FileInput.tsx +1 -1
- package/src/components/FileUpload/FileUpload.tsx +1 -1
- package/src/components/FormControlLayout/FormControlLayout.tsx +1 -1
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +1 -1
- package/src/components/HoverCard/HoverCard.module.css +25 -3
- package/src/components/HoverCard/HoverCard.tsx +13 -21
- package/src/components/Menu/Menu.module.css +3 -0
- package/src/components/Menu/Menu.stories.tsx +128 -5
- package/src/components/Menu/Menu.tsx +15 -7
- package/src/components/Modal/Modal.tsx +12 -6
- package/src/components/NumberInput/NumberInput.tsx +30 -15
- package/src/components/Pagination/Pagination.tsx +5 -15
- package/src/components/Panel/Panel.tsx +17 -25
- package/src/components/Popover/Popover.tsx +10 -18
- package/src/components/Radio/Radio.tsx +21 -26
- package/src/components/Radio/RadioGroup.tsx +3 -4
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +1 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +20 -25
- package/src/components/Slider/Slider.tsx +40 -43
- package/src/components/Stepper/Stepper.tsx +34 -14
- package/src/components/Switch/Switch.tsx +33 -49
- package/src/components/Switch/SwitchGroup.tsx +3 -3
- package/src/components/Tabs/Tabs.tsx +12 -4
- package/src/components/TextArea/TextArea.tsx +30 -7
- package/src/components/TextField/TextField.tsx +30 -26
- package/src/components/Timeline/Timeline.tsx +9 -1
- package/src/components/Timeline/TimelineItem.tsx +2 -2
- package/src/components/Toast/Toast.tsx +14 -23
- package/src/components/Tooltip/Tooltip.tsx +14 -27
- package/src/components/TransferList/TransferList.tsx +1 -1
- package/src/utils/filterStylingProps.ts +4 -0
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from "@mui/material";
|
|
5
5
|
import {
|
|
6
6
|
filterStylingProps,
|
|
7
|
+
mergeClassNames,
|
|
7
8
|
type RecursicaOverStyled,
|
|
8
9
|
} from "../../utils/filterStylingProps";
|
|
9
10
|
import styles from "./Tooltip.module.css";
|
|
@@ -48,32 +49,18 @@ const TooltipBase = function Tooltip({
|
|
|
48
49
|
const { title, ...restProps } = rest;
|
|
49
50
|
const sanitizedProps = filterStylingProps(restProps, overStyled);
|
|
50
51
|
|
|
51
|
-
// Bind CSS module classes to Mui's internal classNames API
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
)
|
|
63
|
-
const o = classNamesProp as Record<string, string>;
|
|
64
|
-
Object.keys(o).forEach((key) => {
|
|
65
|
-
if (mergedClassNames[key]) {
|
|
66
|
-
mergedClassNames[key] = `${mergedClassNames[key]} ${o[key]}`;
|
|
67
|
-
} else {
|
|
68
|
-
mergedClassNames[key] = o[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const withArrow = (sanitizedProps as Record<string, unknown>).withArrow as
|
|
74
|
-
| boolean
|
|
75
|
-
| undefined;
|
|
76
|
-
const resolvedWithArrow = withBeak ?? withArrow;
|
|
52
|
+
// Bind CSS module classes to Mui's internal classNames API. Note MUI's actual prop is
|
|
53
|
+
// "classes", not "classNames" (that's Mantine's naming) — this used to read the wrong key,
|
|
54
|
+
// silently no-op-ing any caller-supplied classes.
|
|
55
|
+
const mergedClassNames = mergeClassNames(
|
|
56
|
+
{
|
|
57
|
+
tooltip: styles.tooltip,
|
|
58
|
+
arrow: styles.arrow,
|
|
59
|
+
},
|
|
60
|
+
(sanitizedProps as Record<string, unknown>).classes as
|
|
61
|
+
| Partial<Record<string, string>>
|
|
62
|
+
| undefined,
|
|
63
|
+
);
|
|
77
64
|
|
|
78
65
|
return (
|
|
79
66
|
<MuiTooltip
|
|
@@ -81,7 +68,7 @@ const TooltipBase = function Tooltip({
|
|
|
81
68
|
title={label || title || ""}
|
|
82
69
|
open={opened}
|
|
83
70
|
placement="top" /* Recursica default; Mui defaults to "bottom" */
|
|
84
|
-
arrow={
|
|
71
|
+
arrow={withBeak}
|
|
85
72
|
classes={mergedClassNames}
|
|
86
73
|
/>
|
|
87
74
|
);
|
|
@@ -346,10 +346,10 @@ export const TransferList = forwardRef<HTMLDivElement, TransferListProps>(
|
|
|
346
346
|
readOnlyNativeProps={props}
|
|
347
347
|
activeComponent={
|
|
348
348
|
<div
|
|
349
|
+
{...(sanitizedProps as Record<string, unknown>)}
|
|
349
350
|
className={styles.root}
|
|
350
351
|
data-disabled={disabled ? "true" : undefined}
|
|
351
352
|
data-error={error ? "true" : undefined}
|
|
352
|
-
{...(sanitizedProps as Record<string, unknown>)}
|
|
353
353
|
>
|
|
354
354
|
<div className={styles.panes}>
|
|
355
355
|
{renderPane(
|