@recursica/adapter-mui-v7 1.1.0 → 1.3.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 (55) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/OVERSTYLING.md +1 -1
  3. package/SETUP.md +26 -3
  4. package/dist/adapter-mui-v7.cjs +69 -69
  5. package/dist/adapter-mui-v7.cjs.map +1 -1
  6. package/dist/adapter-mui-v7.css +1 -1
  7. package/dist/adapter-mui-v7.js +5955 -5739
  8. package/dist/adapter-mui-v7.js.map +1 -1
  9. package/dist/index.d.ts +69 -51
  10. package/llms.txt +1 -1
  11. package/package.json +4 -4
  12. package/recursica_brand.json +2 -2
  13. package/recursica_tokens.json +2 -2
  14. package/recursica_ui-kit.json +2 -2
  15. package/recursica_variables_scoped.css +7 -3
  16. package/src/components/Checkbox/Checkbox.module.css +1 -3
  17. package/src/components/Container/USAGE.md +0 -1
  18. package/src/components/FileInput/FileInput.module.css +8 -0
  19. package/src/components/FileUpload/FileUpload.module.css +1 -0
  20. package/src/components/FileUpload/FileUpload.tsx +1 -0
  21. package/src/components/Flex/USAGE.md +2 -1
  22. package/src/components/Group/USAGE.md +2 -1
  23. package/src/components/LayoutGrid/LAYOUT_GRID_IMPLEMENTATION_NOTES.md +82 -0
  24. package/src/components/LayoutGrid/LayoutGrid.columns.dom.test.tsx +78 -0
  25. package/src/components/{Grid/Grid.module.css → LayoutGrid/LayoutGrid.module.css} +11 -10
  26. package/src/components/LayoutGrid/LayoutGrid.stories.tsx +61 -0
  27. package/src/components/LayoutGrid/LayoutGrid.test.tsx +1 -0
  28. package/src/components/LayoutGrid/LayoutGrid.tsx +181 -0
  29. package/src/components/LayoutGrid/USAGE.md +79 -0
  30. package/src/components/LayoutGrid/index.ts +1 -0
  31. package/src/components/Menu/Menu.stories.tsx +0 -3
  32. package/src/components/Pagination/IMPLEMENTATION_NOTES.md +42 -38
  33. package/src/components/Pagination/Pagination.icons.tsx +0 -32
  34. package/src/components/Pagination/Pagination.manifest.dom.test.tsx +105 -0
  35. package/src/components/Pagination/Pagination.module.css +25 -164
  36. package/src/components/Pagination/Pagination.tsx +221 -97
  37. package/src/components/Pagination/USAGE.md +8 -1
  38. package/src/components/Panel/Panel.module.css +24 -1
  39. package/src/components/Panel/Panel.stories.tsx +4 -4
  40. package/src/components/Panel/Panel.tsx +10 -1
  41. package/src/components/Radio/Radio.module.css +2 -2
  42. package/src/components/SegmentedControl/SegmentedControl.module.css +18 -0
  43. package/src/components/Stack/USAGE.md +2 -1
  44. package/src/components/Stepper/Stepper.module.css +0 -21
  45. package/src/components/index.ts +1 -1
  46. package/src/index.ts +1 -0
  47. package/src/utils/breakpointsFromRecManifest.test.ts +40 -0
  48. package/src/utils/breakpointsFromRecManifest.ts +72 -0
  49. package/src/utils/index.ts +1 -0
  50. package/src/components/Grid/Grid.stories.tsx +0 -151
  51. package/src/components/Grid/Grid.test.tsx +0 -1
  52. package/src/components/Grid/Grid.tsx +0 -189
  53. package/src/components/Grid/IMPLEMENTATION_NOTES.md +0 -99
  54. package/src/components/Grid/USAGE.md +0 -57
  55. package/src/components/Grid/index.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @recursica/adapter-mui-v7
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Major Changes
6
+
7
+ - 07418dd: `Pagination` now renders Recursica Buttons whose style and size come from the Forge manifest, so `RecursicaThemeProvider` needs the `manifest` prop or Pagination throws; MUI's `Pagination` props are no longer passed through.
8
+ - 07418dd: `Grid` is now `LayoutGrid` (`LayoutGrid.Col`) and follows Forge's breakpoint-aware layout grids (columns, gutters, margin); it no longer accepts the `columns` prop. Use MUI's Grid directly for a fixed N-column grid.
9
+
10
+ ### Minor Changes
11
+
12
+ - 07418dd: New opt-in `breakpointsFromRecManifest` builds MUI `theme.breakpoints.values` from the Forge manifest's layout grids.
13
+
14
+ ### Patch Changes
15
+
16
+ - fbaba46: Updated @recursica/adapter-common, adapter-tester and storybook-template. FileUpload is capped at the form-field max-width, FileInput keeps a fixed height with a file, and vertical Stepper no longer adds extra step spacing.
17
+
18
+ Panel rounds only the corners facing the page and its width follows the Forge max-width token capped to the viewport. RadioGroup/CheckboxGroup side-by-side layouts stack vertically, vertical SegmentedControl uses a concentric container radius, and the Menu WithSubmenus story no longer forces a width.
19
+
3
20
  ## 1.1.0
4
21
 
5
22
  ### Minor Changes
package/OVERSTYLING.md CHANGED
@@ -42,6 +42,6 @@ Available Recursica layout tokens:
42
42
 
43
43
  ## Primitive Layout Components Exemption
44
44
 
45
- Unlike complex UI components (Buttons, Tabs, Inputs) which are strictly protected, **Primitive Layout Components** (`Flex`, `Stack`, `Group`, `Container`, `Grid`) are entirely exempt from the `RecursicaOverStyled` gatekeeper.
45
+ Unlike complex UI components (Buttons, Tabs, Inputs) which are strictly protected, **Primitive Layout Components** (`Flex`, `Stack`, `Group`, `Container`, `LayoutGrid`) are entirely exempt from the `RecursicaOverStyled` gatekeeper.
46
46
 
47
47
  Because the entire functional purpose of these components is structural layout composition, developers are free to pass any standard MUI width, height, padding, margin, gap, and alignment property directly to them without needing to flag `overStyled={true}`. The internal custom token mapper (such as converting `gap="rec-md"`) is still active natively on these wrappers.
package/SETUP.md CHANGED
@@ -36,11 +36,12 @@ Before consuming Recursica components, integrate the CSS and design tokens into
36
36
  ```tsx
37
37
  import { StyledEngineProvider } from "@mui/material/styles";
38
38
  import { RecursicaThemeProvider } from "@recursica/adapter-mui-v7";
39
+ import manifest from "./path/to/recursica_manifest.json";
39
40
 
40
41
  function App() {
41
42
  return (
42
43
  <StyledEngineProvider injectFirst>
43
- <RecursicaThemeProvider theme="light">
44
+ <RecursicaThemeProvider theme="light" manifest={manifest}>
44
45
  {/* Your App Components */}
45
46
  </RecursicaThemeProvider>
46
47
  </StyledEngineProvider>
@@ -48,13 +49,35 @@ Before consuming Recursica components, integrate the CSS and design tokens into
48
49
  }
49
50
  ```
50
51
 
52
+ Pass the parsed `recursica_manifest.json` from your Forge export as `manifest`. Components that are configured by it (currently `Pagination`, for its Button variants) read it from here and throw if it's missing.
53
+
51
54
  3. **Integrate Google Fonts**: Integrating custom fonts depends on how you load fonts in your project and which fonts are specified in your `recursica_variables_scoped.css` (since it is project-dependent). We suggest loading them via Google Fonts, as shown in this example:
52
55
 
53
56
  ```css
54
57
  @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
55
58
  ```
56
59
 
57
- 4. **Configure PostCSS Plugin (Optional but Recommended)**: It is highly recommended (but optional) to install the `@recursica/recursica-postcss-vars` plugin to verify that Recursica CSS variables are properly connected in case they change.
60
+ 4. **Align MUI's breakpoints with Forge's (Optional but Recommended)**: Forge defines your layout grids (columns, gutters, margin) per breakpoint, and they switch via plain CSS `@media`. MUI's responsive props (`size={{ xs: 12, md: 6 }}`) switch at `theme.breakpoints` instead, which Forge never edits. If the two differ, a page changes layout at two different widths. `breakpointsFromRecManifest` builds breakpoint values from the `recursica_manifest.json` in your Forge export, so both switch at the same widths:
61
+
62
+ ```tsx
63
+ import { ThemeProvider, createTheme } from "@mui/material/styles";
64
+ import { breakpointsFromRecManifest } from "@recursica/adapter-mui-v7";
65
+ import manifest from "./path/to/recursica_manifest.json";
66
+
67
+ // e.g. { mobile: 0, tablet: 481, default: 781 } when Forge defines extra grids
68
+ const theme = createTheme({
69
+ breakpoints: {
70
+ values: {
71
+ ...createTheme().breakpoints.values,
72
+ ...breakpointsFromRecManifest(manifest),
73
+ },
74
+ },
75
+ });
76
+ ```
77
+
78
+ Each non-default grid starts at its `min-width` (a grid with only a `max-width` starts at `0`), and the `default` grid is named `default` and starts one pixel past the widest `max-width`. If your manifest only defines the `default` grid (the stock export), it returns `{}` and your theme is unchanged. MUI's `values` replaces its defaults instead of merging, hence the spread of `createTheme().breakpoints.values`; use Forge's names (`mobile`, `tablet`, ...) in responsive props to switch where Forge does. TypeScript needs a module augmentation of MUI's `BreakpointOverrides` to accept custom names. The result is a plain object you can edit, and nothing applies it automatically. See the [LayoutGrid usage guide](src/components/LayoutGrid/USAGE.md).
79
+
80
+ 5. **Configure PostCSS Plugin (Optional but Recommended)**: It is highly recommended (but optional) to install the `@recursica/recursica-postcss-vars` plugin to verify that Recursica CSS variables are properly connected in case they change.
58
81
 
59
82
  Install the plugin as a dev dependency:
60
83
 
@@ -75,7 +98,7 @@ Before consuming Recursica components, integrate the CSS and design tokens into
75
98
  };
76
99
  ```
77
100
 
78
- 5. **Configure ESLint Plugin (Optional but Recommended)**: It is highly recommended (but optional) to install `eslint-plugin-recursica`, which flags use of the `overStyled` escape-hatch prop so it stays easy to audit.
101
+ 6. **Configure ESLint Plugin (Optional but Recommended)**: It is highly recommended (but optional) to install `eslint-plugin-recursica`, which flags use of the `overStyled` escape-hatch prop so it stays easy to audit.
79
102
 
80
103
  Install the plugin as a dev dependency:
81
104