@recursica/mui-adapter 0.21.0 → 0.22.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 (187) hide show
  1. package/ARCHITECTURE.md +3 -0
  2. package/CHANGELOG.md +58 -0
  3. package/dist/index.d.ts +2929 -2
  4. package/dist/mui-adapter.cjs +68 -68
  5. package/dist/mui-adapter.cjs.map +1 -1
  6. package/dist/mui-adapter.css +1 -1
  7. package/dist/mui-adapter.js +5660 -5582
  8. package/dist/mui-adapter.js.map +1 -1
  9. package/package.json +1 -1
  10. package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +63 -0
  11. package/src/components/Accordion/Accordion.module.css +21 -2
  12. package/src/components/Accordion/Accordion.stories.tsx +38 -0
  13. package/src/components/Accordion/Accordion.tsx +27 -12
  14. package/src/components/AssistiveElement/ASSISTIVEELEMENT_IMPLEMENTATION_NOTES.md +59 -0
  15. package/src/components/AssistiveElement/AssistiveElement.module.css +8 -1
  16. package/src/components/AssistiveElement/AssistiveElement.tsx +17 -7
  17. package/src/components/Autocomplete/Autocomplete.tsx +18 -2
  18. package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +36 -0
  19. package/src/components/Avatar/Avatar.tsx +6 -9
  20. package/src/components/Badge/Badge.module.css +0 -12
  21. package/src/components/Badge/Badge.tsx +0 -4
  22. package/src/components/Card/Card.tsx +5 -5
  23. package/src/components/Checkbox/Checkbox.module.css +17 -21
  24. package/src/components/Checkbox/Checkbox.tsx +24 -18
  25. package/src/components/Chip/Chip.module.css +16 -7
  26. package/src/components/Chip/Chip.tsx +1 -1
  27. package/src/components/Flex/Flex.tsx +1 -1
  28. package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +35 -0
  29. package/src/components/FormControlWrapper/FormControlWrapper.tsx +24 -8
  30. package/src/components/Grid/Grid.tsx +1 -1
  31. package/src/components/Group/Group.tsx +1 -1
  32. package/src/components/HoverCard/HoverCard.tsx +1 -1
  33. package/src/components/Label/Label.module.css +15 -2
  34. package/src/components/Label/Label.tsx +7 -6
  35. package/src/components/Menu/Menu.tsx +1 -1
  36. package/src/components/Modal/Modal.tsx +1 -1
  37. package/src/components/NumberInput/NumberInput.tsx +1 -1
  38. package/src/components/Pagination/Pagination.tsx +1 -1
  39. package/src/components/Panel/Panel.tsx +1 -1
  40. package/src/components/Radio/Radio.module.css +33 -38
  41. package/src/components/Radio/Radio.tsx +58 -44
  42. package/src/components/Radio/RadioGroup.tsx +5 -0
  43. package/src/components/SegmentedControl/SegmentedControl.module.css +0 -7
  44. package/src/components/SegmentedControl/SegmentedControl.tsx +4 -8
  45. package/src/components/Slider/Slider.tsx +1 -1
  46. package/src/components/Stack/Stack.tsx +1 -1
  47. package/src/components/Stepper/Stepper.tsx +3 -3
  48. package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +123 -0
  49. package/src/components/Switch/Switch.module.css +152 -89
  50. package/src/components/Switch/Switch.tsx +140 -33
  51. package/src/components/Switch/SwitchGroup.tsx +37 -9
  52. package/src/components/Table/Table.tsx +1 -1
  53. package/src/components/Tabs/IMPLEMENTATION_NOTES.md +10 -0
  54. package/src/components/Tabs/Tabs.module.css +120 -43
  55. package/src/components/Tabs/Tabs.stories.tsx +5 -2
  56. package/src/components/Tabs/Tabs.tsx +1 -1
  57. package/src/components/Tabs/USAGE.md +27 -11
  58. package/src/components/TextField/TextField.tsx +1 -1
  59. package/src/components/TimePicker/TimePicker.tsx +1 -1
  60. package/src/components/Timeline/Timeline.tsx +1 -1
  61. package/src/components/Timeline/TimelineItem.tsx +2 -2
  62. package/src/components/Toast/Toast.tsx +4 -4
  63. package/src/components/Tooltip/Tooltip.tsx +1 -1
  64. package/src/components/Tree/Tree.tsx +1 -1
  65. package/dist/src/OverStyling.d.ts +0 -1
  66. package/dist/src/Version.d.ts +0 -1
  67. package/dist/src/components/Accordion/Accordion.d.ts +0 -77
  68. package/dist/src/components/Accordion/index.d.ts +0 -1
  69. package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +0 -7
  70. package/dist/src/components/AssistiveElement/index.d.ts +0 -1
  71. package/dist/src/components/Autocomplete/Autocomplete.d.ts +0 -24
  72. package/dist/src/components/Autocomplete/index.d.ts +0 -1
  73. package/dist/src/components/Avatar/Avatar.d.ts +0 -25
  74. package/dist/src/components/Avatar/index.d.ts +0 -1
  75. package/dist/src/components/Badge/Badge.d.ts +0 -25
  76. package/dist/src/components/Badge/index.d.ts +0 -1
  77. package/dist/src/components/Box/Box.d.ts +0 -8
  78. package/dist/src/components/Box/index.d.ts +0 -1
  79. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +0 -20
  80. package/dist/src/components/Breadcrumb/index.d.ts +0 -1
  81. package/dist/src/components/Button/Button.d.ts +0 -37
  82. package/dist/src/components/Button/index.d.ts +0 -1
  83. package/dist/src/components/Card/Card.d.ts +0 -81
  84. package/dist/src/components/Card/index.d.ts +0 -1
  85. package/dist/src/components/Checkbox/Checkbox.d.ts +0 -14
  86. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +0 -29
  87. package/dist/src/components/Checkbox/index.d.ts +0 -5
  88. package/dist/src/components/Chip/Chip.d.ts +0 -21
  89. package/dist/src/components/Chip/index.d.ts +0 -1
  90. package/dist/src/components/Container/Container.d.ts +0 -5
  91. package/dist/src/components/Container/index.d.ts +0 -1
  92. package/dist/src/components/DatePicker/DatePicker.d.ts +0 -20
  93. package/dist/src/components/DatePicker/index.d.ts +0 -1
  94. package/dist/src/components/Dropdown/BareDropdown.d.ts +0 -41
  95. package/dist/src/components/Dropdown/Dropdown.d.ts +0 -24
  96. package/dist/src/components/Dropdown/index.d.ts +0 -1
  97. package/dist/src/components/FileInput/FileInput.d.ts +0 -3
  98. package/dist/src/components/FileInput/index.d.ts +0 -1
  99. package/dist/src/components/FileUpload/FileUpload.d.ts +0 -3
  100. package/dist/src/components/FileUpload/index.d.ts +0 -1
  101. package/dist/src/components/Flex/Flex.d.ts +0 -5
  102. package/dist/src/components/Flex/index.d.ts +0 -1
  103. package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +0 -6
  104. package/dist/src/components/FormControlLayout/index.d.ts +0 -1
  105. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +0 -11
  106. package/dist/src/components/FormControlWrapper/index.d.ts +0 -1
  107. package/dist/src/components/Grid/Grid.d.ts +0 -12
  108. package/dist/src/components/Grid/index.d.ts +0 -1
  109. package/dist/src/components/Group/Group.d.ts +0 -5
  110. package/dist/src/components/Group/index.d.ts +0 -1
  111. package/dist/src/components/HoverCard/HoverCard.d.ts +0 -29
  112. package/dist/src/components/HoverCard/index.d.ts +0 -1
  113. package/dist/src/components/Label/Label.d.ts +0 -7
  114. package/dist/src/components/Label/index.d.ts +0 -1
  115. package/dist/src/components/Link/Link.d.ts +0 -20
  116. package/dist/src/components/Link/index.d.ts +0 -1
  117. package/dist/src/components/Loader/Loader.d.ts +0 -5
  118. package/dist/src/components/Loader/index.d.ts +0 -1
  119. package/dist/src/components/Menu/Menu.d.ts +0 -54
  120. package/dist/src/components/Menu/index.d.ts +0 -1
  121. package/dist/src/components/Modal/Modal.d.ts +0 -78
  122. package/dist/src/components/Modal/index.d.ts +0 -1
  123. package/dist/src/components/NumberInput/NumberInput.d.ts +0 -24
  124. package/dist/src/components/NumberInput/index.d.ts +0 -1
  125. package/dist/src/components/Pagination/Pagination.d.ts +0 -23
  126. package/dist/src/components/Pagination/Pagination.icons.d.ts +0 -8
  127. package/dist/src/components/Pagination/index.d.ts +0 -1
  128. package/dist/src/components/Panel/Panel.d.ts +0 -52
  129. package/dist/src/components/Panel/index.d.ts +0 -1
  130. package/dist/src/components/Radio/Radio.d.ts +0 -13
  131. package/dist/src/components/Radio/RadioGroup.d.ts +0 -9
  132. package/dist/src/components/Radio/index.d.ts +0 -2
  133. package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +0 -5
  134. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +0 -5
  135. package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +0 -5
  136. package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +0 -8
  137. package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +0 -28
  138. package/dist/src/components/ReadOnlyField/index.d.ts +0 -2
  139. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +0 -32
  140. package/dist/src/components/SegmentedControl/index.d.ts +0 -1
  141. package/dist/src/components/Slider/Slider.d.ts +0 -30
  142. package/dist/src/components/Slider/index.d.ts +0 -1
  143. package/dist/src/components/Stack/Stack.d.ts +0 -5
  144. package/dist/src/components/Stack/index.d.ts +0 -1
  145. package/dist/src/components/Stepper/Stepper.d.ts +0 -97
  146. package/dist/src/components/Stepper/index.d.ts +0 -1
  147. package/dist/src/components/Switch/Switch.d.ts +0 -10
  148. package/dist/src/components/Switch/SwitchGroup.d.ts +0 -24
  149. package/dist/src/components/Switch/index.d.ts +0 -2
  150. package/dist/src/components/Table/Table.d.ts +0 -154
  151. package/dist/src/components/Table/index.d.ts +0 -1
  152. package/dist/src/components/Tabs/Tabs.d.ts +0 -57
  153. package/dist/src/components/Tabs/index.d.ts +0 -1
  154. package/dist/src/components/Text/Text.d.ts +0 -20
  155. package/dist/src/components/Text/index.d.ts +0 -1
  156. package/dist/src/components/TextArea/TextArea.d.ts +0 -24
  157. package/dist/src/components/TextArea/index.d.ts +0 -1
  158. package/dist/src/components/TextField/TextField.d.ts +0 -24
  159. package/dist/src/components/TextField/index.d.ts +0 -1
  160. package/dist/src/components/TimePicker/TimePicker.d.ts +0 -17
  161. package/dist/src/components/TimePicker/index.d.ts +0 -1
  162. package/dist/src/components/Timeline/Timeline.d.ts +0 -16
  163. package/dist/src/components/Timeline/TimelineItem.d.ts +0 -29
  164. package/dist/src/components/Timeline/index.d.ts +0 -2
  165. package/dist/src/components/Title/Title.d.ts +0 -21
  166. package/dist/src/components/Title/index.d.ts +0 -1
  167. package/dist/src/components/Toast/Toast.d.ts +0 -32
  168. package/dist/src/components/Toast/index.d.ts +0 -1
  169. package/dist/src/components/Tooltip/Tooltip.d.ts +0 -28
  170. package/dist/src/components/Tooltip/index.d.ts +0 -1
  171. package/dist/src/components/TransferList/TransferList.d.ts +0 -4
  172. package/dist/src/components/TransferList/index.d.ts +0 -1
  173. package/dist/src/components/Tree/Tree.d.ts +0 -18
  174. package/dist/src/components/Tree/index.d.ts +0 -1
  175. package/dist/src/components/Typography/Typography.d.ts +0 -38
  176. package/dist/src/components/Typography/index.d.ts +0 -1
  177. package/dist/src/components/index.d.ts +0 -50
  178. package/dist/src/index.d.ts +0 -91
  179. package/dist/src/types/index.d.ts +0 -6
  180. package/dist/src/utils/ColorSchemeWrapper.d.ts +0 -3
  181. package/dist/src/utils/RequireAccessibleLabel.d.ts +0 -1
  182. package/dist/src/utils/copyToClipboard.d.ts +0 -8
  183. package/dist/src/utils/filterStylingProps.d.ts +0 -29
  184. package/dist/src/utils/index.d.ts +0 -1
  185. package/dist/vite.config.d.ts +0 -2
  186. package/dist/vitest.workspace.d.ts +0 -2
  187. package/src/types/mantine.d.ts +0 -7
package/ARCHITECTURE.md CHANGED
@@ -13,3 +13,6 @@ This document describes the high-level architecture and philosophy of the `@recu
13
13
 
14
14
  - Components map closely to Material UI's structure but enforce Recursica design tokens.
15
15
  - We avoid over-styling; components only diverge from MUI defaults when dictated by the Recursica design system.
16
+ - Each component adheres to the underlying UI-kit prop signature so that they can easily replace components in the existing code-base
17
+ - Recursica defines a set of common props that are shared across all framework adapters. These sometimes serve the same purpose as existing UI-kit props. In that case, the Recursica prop takes precedence and are the preferred way to achieve the desired effect.
18
+ - Adapter props are removed from the underlying UI-kit when it leads to behavior that Recursica does not support. Recursica is opinionated about the behavior of its components and does not support all of the behavior of the underlying UI-kit.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # @recursica/mui-adapter
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 106bc34: Accordion: closed silent prop-contract conflicts where native `expanded`/`onChange`/`expandIcon`/`icon` could override Recursica's own computed state, made `variant` a real predefined union instead of a bare string, and formally supported a per-item `disabled` prop in both adapters.
8
+ Also documented `children` across all Accordion sub-components in `RecursicaAccordionProps.ts`, including a new `RecursicaAccordionPanelProps` interface for the Panel.
9
+ - 106bc34: AssistiveElement: `assistiveVariant="error"` now defaults `role="alert"` in both adapters so
10
+ error text is announced by assistive tech as it appears or changes (an explicit `role` still
11
+ wins). Also (MUI only) closed a prop-contract conflict where native `error`/`component` could
12
+ silently override Recursica's own computed values, added the missing `RecursicaOverStyled`
13
+ wrapper, and hardened a CSS specificity tie against MUI's own `.Mui-error` color. Documented
14
+ `children` in `RecursicaAssistiveElementProps.ts` and added implementation notes to both adapters.
15
+
16
+ ### Patch Changes
17
+
18
+ - 106bc34: Autocomplete (MUI): fixed four bugs, all traced to `renderInput` discarding MUI's `InputProps` (dropping the `classes.inputRoot` className, the anchor ref, and adornment slots). Restored `InputProps` so the design-system border/padding actually applies instead of MUI's default underline chrome; wired `leftSection`/`rightSection` into `startAdornment`/`endAdornment` (previously destructured but never rendered, so icons never showed); and stopped coercing `error` to a boolean before the wrapper, which was discarding the error message string (ErrorState story showed no assistive text).
19
+ - 106bc34: Avatar (MUI): fixed `variant` being fed into MUI's native shape prop instead of a color treatment, making it a silent no-op. Also documented `children` in the shared prop types and added missing mui-adapter implementation notes.
20
+ - 106bc34: Checkbox (MUI): fixed the checkmark never appearing on click — `checked` was always
21
+ forced onto MUI's native input even for plain uncontrolled usage (no `checked`/only
22
+ `defaultChecked`), pinning it to a value that never updates after the initial render.
23
+ Now only forced when grouped (CheckboxGroup owns state) or the caller explicitly passes
24
+ `checked`, matching the existing `Switch` pattern. Also fixed the label rendering
25
+ vertically offset from the checkbox (`.labelWrapper` needed `display: flex` to blockify
26
+ the native inline `<label>`, mirroring Mantine's own wrapper) and the checkmark icon
27
+ rendering off-center inside the box in both standalone Checkbox and CheckboxGroup
28
+ (`.input` now centers its icon child directly).
29
+ - 106bc34: Disabled Checkbox/Switch's MUI-default click ripple (not present in Mantine) and made their description/error text mutually exclusive (error wins), matching the same fixes just made to Radio.
30
+ - 106bc34: Chip (MUI): fixed three visual bugs vs `mantine-adapter` — extra right padding on short-text chips (duplicate `min-width`/`max-width` applied on both `.root` and `.label`, now only on `.root`), delete/leading icon color and spacing leaking MUI's own default styles (fixed via CSS specificity match on `.leadingIcon`/`.removeIconWrapper`), and a missing icon-text gap on the leading icon (accidental blanket `margin: 0` collapsed it — restored `margin-right` for the gap, matching the selected-state check icon).
31
+ - 106bc34: FormControlWrapper (MUI): fixed ARIA wiring to match the Mantine adapter — a self-generated
32
+ `id` fallback (via `useId`) now fires by default instead of only when a caller supplies their
33
+ own `id`, and help/error text each get their own id (`aria-describedby`/`aria-errormessage`)
34
+ instead of sharing one. Neither attribute is set if the child already has its own explicit
35
+ value.
36
+ - 106bc34: Label (MUI): fixed focused descendant controls (e.g. a grouped Switch/Checkbox) bleeding MUI's default blue into the label text, mirroring the existing `.Mui-error` override with a matching `.Mui-focused` one.
37
+ - 106bc34: Label (MUI): fixed optional text rendering inline next to the label instead of on its own line — `innerLayout` now wraps and `optionalText` is forced onto a full-width row, matching `mantine-adapter`.
38
+ - 106bc34: Audited every component for the "spread after computed props" ordering bug (caller props silently overriding internal className/classes/icon/sx/onChange) and reordered spread-first in ~25 components. See COMPONENT_DEV_GUIDE.md §3.2 (adapter-common) for the rule.
39
+ - 106bc34: Removed leftover literal Mantine references from mui-adapter CSS/types (dead `:global(.mantine-*)` selectors, unused classes wiring, a stray `@mantine/core` type augmentation) and swapped a hardcoded Mantine red for the real error-text token in Radio/Checkbox/Switch.
40
+ - 106bc34: Radio/Checkbox/Switch description and error text now render through the shared `AssistiveElement` component instead of locally styled divs, removing the last hardcoded hex values (Mantine's default dimmed gray) from mui-adapter CSS.
41
+ - 106bc34: Fixed Radio rendering no visible circle (only the label) — `classes` was being read as `classNames` with Mantine-shaped slot names MUI doesn't support, so the circle's styling was silently dropped. Also fixed the label rendering vertically offset from the circle, disabled MUI's default click ripple, made description/error mutually exclusive (error wins), and reordered the props spread so it can no longer silently override the render-critical props placed after it.
42
+ - 106bc34: Fixed RadioGroup selection not updating in mui-adapter — its onChange was typed and wired as MUI's native `(event, value)`, but Mantine's RadioGroup (the cross-adapter source of truth) only ever calls back with `(value)`. Normalized the shared contract and mui-adapter's wiring to single-argument.
43
+ - 106bc34: Switch: attached `SwitchGroup` as the `Switch.Group` compound export (it existed standalone but was never attached), and tightened `RecursicaSwitchGroupProps` value types from `unknown[]` to `string[]`.
44
+ - 106bc34: Switch (MUI): `SwitchGroup` now actually controls its children via a `SwitchGroupContext` (same pattern as `Checkbox`/`CheckboxGroup`) — previously `value`/`defaultValue`/`onChange` were destructured and discarded, so grouped switches never checked or updated.
45
+ - 106bc34: SwitchGroup: fixed `side-by-side` layout always rendering as if stacked — the group was capped to the switch-item label's own 200px max-width, narrower than the mandatory 224px label column, guaranteeing a wrap.
46
+ - 106bc34: Switch (MUI): fixed track/thumb geometry, checked-state color and opacity, thumb icon, disabled-state opacity, the focus ring target/color, and a `classes`/`classNames` prop bug — bringing it to visual parity with `mantine-adapter`.
47
+ - 106bc34: Tabs (MUI): fixed missing `value` on `Tabs` (never read `TabContext`, so no tab was ever selected), the panel rendering beside instead of below the tab list, and dead `.Mui-selected`/`.panel` CSS selectors.
48
+ - Updated dependencies [106bc34]
49
+ - Updated dependencies [106bc34]
50
+ - Updated dependencies [106bc34]
51
+ - Updated dependencies [106bc34]
52
+ - Updated dependencies [106bc34]
53
+ - @recursica/adapter-common@0.15.0
54
+
55
+ ## 0.21.1
56
+
57
+ ### Patch Changes
58
+
59
+ - 778151b: Bundle `@recursica/adapter-common`'s types into each adapter's published `.d.ts` (via `vite-plugin-dts`'s `rollupTypes` + `bundledPackages`). Previously the generated declaration files re-exported and referenced `@recursica/adapter-common` by bare package specifier, which meant consumers' TypeScript needed `@recursica/adapter-common` resolvable even though the runtime JS and CSS were already fully self-contained. No public API changes — type names and shapes are unchanged, they're just inlined now instead of imported from the dependency.
60
+
3
61
  ## 0.21.0
4
62
 
5
63
  ### Minor Changes