@recursica/mui-adapter 0.25.0 → 0.27.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.
Files changed (78) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.d.ts +105 -19
  3. package/dist/mui-adapter.cjs +77 -77
  4. package/dist/mui-adapter.cjs.map +1 -1
  5. package/dist/mui-adapter.css +1 -1
  6. package/dist/mui-adapter.js +29867 -25282
  7. package/dist/mui-adapter.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/GlobalExemptions.modules.css +0 -6
  10. package/src/components/Accordion/Accordion.module.css +0 -8
  11. package/src/components/Autocomplete/Autocomplete.module.css +0 -8
  12. package/src/components/Autocomplete/Autocomplete.tsx +46 -34
  13. package/src/components/Avatar/Avatar.module.css +0 -8
  14. package/src/components/Avatar/Avatar.tsx +11 -21
  15. package/src/components/Badge/Badge.tsx +9 -13
  16. package/src/components/Breadcrumb/Breadcrumb.tsx +12 -18
  17. package/src/components/Button/Button.module.css +0 -13
  18. package/src/components/Button/Button.tsx +17 -11
  19. package/src/components/Card/Card.tsx +9 -19
  20. package/src/components/Checkbox/Checkbox.tsx +22 -26
  21. package/src/components/Checkbox/CheckboxGroup.tsx +3 -3
  22. package/src/components/Chip/Chip.module.css +0 -27
  23. package/src/components/Chip/Chip.tsx +12 -19
  24. package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +29 -0
  25. package/src/components/DatePicker/DatePicker.icons.tsx +35 -0
  26. package/src/components/DatePicker/DatePicker.module.css +451 -42
  27. package/src/components/DatePicker/DatePicker.stories.tsx +23 -25
  28. package/src/components/DatePicker/DatePicker.tsx +229 -47
  29. package/src/components/DatePicker/USAGE.md +14 -1
  30. package/src/components/Dropdown/BareDropdown.tsx +14 -8
  31. package/src/components/Dropdown/Dropdown.module.css +0 -7
  32. package/src/components/Dropdown/Dropdown.tsx +13 -6
  33. package/src/components/FileInput/FileInput.module.css +0 -21
  34. package/src/components/FileInput/FileInput.tsx +1 -1
  35. package/src/components/FileUpload/FileUpload.module.css +0 -11
  36. package/src/components/FileUpload/FileUpload.tsx +1 -1
  37. package/src/components/FormControlLayout/FormControlLayout.tsx +1 -1
  38. package/src/components/FormControlWrapper/FormControlWrapper.tsx +1 -1
  39. package/src/components/HoverCard/HoverCard.module.css +1 -7
  40. package/src/components/HoverCard/HoverCard.tsx +13 -21
  41. package/src/components/Label/Label.module.css +0 -6
  42. package/src/components/Link/Link.module.css +0 -13
  43. package/src/components/Menu/Menu.module.css +0 -5
  44. package/src/components/Menu/Menu.tsx +14 -6
  45. package/src/components/Modal/Modal.module.css +0 -11
  46. package/src/components/Modal/Modal.tsx +12 -6
  47. package/src/components/NumberInput/NumberInput.module.css +0 -7
  48. package/src/components/NumberInput/NumberInput.tsx +30 -15
  49. package/src/components/Pagination/Pagination.module.css +0 -81
  50. package/src/components/Pagination/Pagination.tsx +5 -15
  51. package/src/components/Panel/Panel.tsx +17 -25
  52. package/src/components/Popover/Popover.module.css +0 -5
  53. package/src/components/Popover/Popover.tsx +10 -18
  54. package/src/components/Radio/Radio.tsx +21 -26
  55. package/src/components/Radio/RadioGroup.tsx +3 -4
  56. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +1 -1
  57. package/src/components/SegmentedControl/SegmentedControl.module.css +0 -8
  58. package/src/components/SegmentedControl/SegmentedControl.tsx +20 -25
  59. package/src/components/Slider/Slider.tsx +40 -43
  60. package/src/components/Stepper/Stepper.tsx +34 -14
  61. package/src/components/Switch/Switch.tsx +33 -49
  62. package/src/components/Switch/SwitchGroup.tsx +3 -3
  63. package/src/components/Tabs/Tabs.tsx +12 -4
  64. package/src/components/TextArea/TextArea.module.css +0 -7
  65. package/src/components/TextArea/TextArea.tsx +30 -7
  66. package/src/components/TextField/TextField.module.css +0 -8
  67. package/src/components/TextField/TextField.tsx +30 -26
  68. package/src/components/TimePicker/TimePicker.module.css +0 -16
  69. package/src/components/Timeline/Timeline.module.css +0 -6
  70. package/src/components/Timeline/Timeline.tsx +9 -1
  71. package/src/components/Timeline/TimelineItem.tsx +2 -2
  72. package/src/components/Toast/Toast.module.css +0 -7
  73. package/src/components/Toast/Toast.tsx +14 -23
  74. package/src/components/Tooltip/Tooltip.module.css +0 -9
  75. package/src/components/Tooltip/Tooltip.tsx +14 -27
  76. package/src/components/TransferList/TransferList.module.css +0 -8
  77. package/src/components/TransferList/TransferList.tsx +1 -1
  78. package/src/utils/filterStylingProps.ts +4 -0
@@ -7,6 +7,7 @@ import {
7
7
  } from "@mui/material";
8
8
  import {
9
9
  filterStylingProps,
10
+ mergeClassNames,
10
11
  type RecursicaOverStyled,
11
12
  } from "../../utils/filterStylingProps";
12
13
  import styles from "./Toast.module.css";
@@ -63,29 +64,19 @@ export const Toast = React.forwardRef<HTMLDivElement, ToastProps>(
63
64
  ) {
64
65
  const sanitizedProps = filterStylingProps(rest, overStyled);
65
66
 
66
- const mergedClassNames: Partial<Record<string, string>> = {
67
- root: styles.root,
68
- message: styles.body,
69
- icon: styles.icon,
70
- action: styles.closeButton,
71
- };
72
-
73
- const classNamesProp = (sanitizedProps as Record<string, unknown>)
74
- .classNames;
75
- if (
76
- classNamesProp &&
77
- typeof classNamesProp === "object" &&
78
- !Array.isArray(classNamesProp)
79
- ) {
80
- const o = classNamesProp as Record<string, string>;
81
- Object.keys(o).forEach((key) => {
82
- if (mergedClassNames[key]) {
83
- mergedClassNames[key] = `${mergedClassNames[key]} ${o[key]}`;
84
- } else {
85
- mergedClassNames[key] = o[key];
86
- }
87
- });
88
- }
67
+ // Note MUI's actual prop is "classes", not "classNames" (that's Mantine's naming) — this
68
+ // used to read the wrong key, silently no-op-ing any caller-supplied classes.
69
+ const mergedClassNames = mergeClassNames(
70
+ {
71
+ root: styles.root,
72
+ message: styles.body,
73
+ icon: styles.icon,
74
+ action: styles.closeButton,
75
+ },
76
+ (sanitizedProps as Record<string, unknown>).classes as
77
+ | Partial<Record<string, string>>
78
+ | undefined,
79
+ );
89
80
 
90
81
  const handleClose = () => {
91
82
  if (onClose) onClose();
@@ -1,12 +1,3 @@
1
- /* EXEMPTIONS:
2
- - beak-inset is ignored because Tooltip positioning calculations are handled dynamically by Mantine/Floating UI at the React runtime.
3
- - beak-size is ignored because Mantine's tooltip arrows compute their sizing and positional offsets
4
- dynamically within the React rendering engine (requires inline pixel number rather than standard CSS variables).
5
- The beak size is checked in JS against a fixed value of 16px. If this variable changes, the TSX components
6
- need to be reviewed/re-compiled. */
7
- /* recursica-ignore: --recursica_ui-kit_components_tooltip_properties_beak-inset = 8px */
8
- /* recursica-ignore: --recursica_ui-kit_components_tooltip_properties_beak-size = 16px */
9
-
10
1
  /* HARDCODED VALUES:
11
2
  - border-style: solid. Structural rendering rule for the tooltip border (Mantine uses Box
12
3
  which may not set border-style natively). Same pattern as Menu / HoverCard.
@@ -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
- const mergedClassNames: Partial<Record<string, string>> = {
53
- tooltip: styles.tooltip,
54
- arrow: styles.arrow,
55
- };
56
-
57
- const classNamesProp = (sanitizedProps as Record<string, unknown>).classNames;
58
- if (
59
- classNamesProp &&
60
- typeof classNamesProp === "object" &&
61
- !Array.isArray(classNamesProp)
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={resolvedWithArrow}
71
+ arrow={withBeak}
85
72
  classes={mergedClassNames}
86
73
  />
87
74
  );
@@ -1,11 +1,3 @@
1
- /* EXEMPTIONS:
2
- - border-size variables are ignored because a uniform 1px border is applied globally to prevent
3
- unexpected layout shift or flickering during disabled/error state transitions (same exemption
4
- TextArea takes). */
5
- /* recursica-ignore: --recursica_ui-kit_components_transfer-list_properties_border-size */
6
- /* recursica-ignore: --recursica_ui-kit_components_transfer-list_variants_states_disabled_properties_border-size */
7
- /* recursica-ignore: --recursica_ui-kit_components_transfer-list_variants_states_error_properties_border-size */
8
-
9
1
  /* TOKEN INTERPRETATION NOTES (see TRANSFERLIST_IMPLEMENTATION_NOTES.md):
10
2
  - `properties_gap` is applied to the row that holds [source pane, transfer buttons, target pane] —
11
3
  it's the only unnested gap the schema defines at the component's own level.
@@ -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(
@@ -58,6 +58,10 @@ export {
58
58
  type BlockedStylingKeys,
59
59
  type ForbiddenStyles,
60
60
  type WithRecursicaSpacing,
61
+ omitUnsupportedProps,
62
+ withCallerOverride,
63
+ mergeClassNames,
64
+ mergeStyles,
61
65
  } from "@recursica/adapter-common";
62
66
 
63
67
  const LAYOUT_PROPS = new Set([