@recursica/mui-adapter 0.35.0 → 0.37.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @recursica/mui-adapter
2
2
 
3
+ ## 0.37.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 786d870: Version bumped
8
+
9
+ ## 0.36.0
10
+
11
+ ### Minor Changes
12
+
13
+ - f618b38: Renamed the `Title` component to `Heading` (and `RecursicaTitleProps` to `RecursicaHeadingProps`) to match designers' semantic vocabulary. `Text` is unchanged. Breaking: update imports from `Title`/`TitleProps` to `Heading`/`HeadingProps`.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [f618b38]
18
+ - @recursica/adapter-common@0.26.0
19
+
3
20
  ## 0.35.0
4
21
 
5
22
  ### Minor Changes
package/SETUP.md CHANGED
@@ -24,16 +24,14 @@ npm install @mui/material@>=7.0.0 @emotion/react@>=11.14.0 @emotion/styled@>=11.
24
24
 
25
25
  Before consuming Recursica components, integrate the CSS and design tokens into your application:
26
26
 
27
- 1. **Theme Files Setup**: When you install `@recursica/mui-adapter`, a postinstall script automatically creates default theme files (including `recursica_variables_scoped.css` and JSON config files) in your project root. If they are missing, simply run `npm install` to create them. To customize or update these variables, you should use [Forge Recursica](https://forge.recursica.com) to export the updated theme files into your project.
28
- > [!IMPORTANT] > **AI Agent Directive**: The theme files (`recursica_variables_scoped.css` and associated JSON files) are created at the project root automatically via `npm install`. If they are not present, instruct the user to run `npm install`. Do NOT attempt to generate, mock, or write a placeholder CSS/JSON file yourself. When updates to these files are needed, instruct the user to export them from [Forge Recursica](https://forge.recursica.com) and replace the existing ones.
29
- 2. **Integrate CSS**: Import `recursica_variables_scoped.css` and the MUI adapter CSS `style.css` into your application entrypoint (e.g., `main.tsx` or `App.tsx`).
27
+ 1. **Integrate CSS**: Import `recursica_variables_scoped.css` and the MUI adapter CSS `style.css` into your application entrypoint (e.g., `main.tsx` or `App.tsx`).
30
28
 
31
29
  ```tsx
32
30
  import "./path/to/recursica_variables_scoped.css"; // Recursica theme variables
33
31
  import "@recursica/mui-adapter/style.css"; // MUI adapter styles
34
32
  ```
35
33
 
36
- 3. **Configure MUI's CSS Injection & Theme Provider**: Because the Recursica UI components use native CSS modules, they must be given a higher priority than MUI's default engine styles. You **must** wrap your application root in `<StyledEngineProvider injectFirst>` and `<RecursicaThemeProvider theme="light">` to correctly cascade design token properties. By default `RecursicaThemeProvider` also wraps its children in a `<Layer layer={0}>` (via the `initLayer0` prop, which defaults to `true`), so the base page surface/border/elevation variables resolve automatically with no extra setup:
34
+ 2. **Configure MUI's CSS Injection & Theme Provider**: Because the Recursica UI components use native CSS modules, they must be given a higher priority than MUI's default engine styles. You **must** wrap your application root in `<StyledEngineProvider injectFirst>` and `<RecursicaThemeProvider theme="light">` to correctly cascade design token properties. By default `RecursicaThemeProvider` also wraps its children in a `<Layer layer={0}>` (via the `initLayer0` prop, which defaults to `true`), so the base page surface/border/elevation variables resolve automatically with no extra setup:
37
35
 
38
36
  ```tsx
39
37
  import { StyledEngineProvider } from "@mui/material/styles";
@@ -50,13 +48,13 @@ Before consuming Recursica components, integrate the CSS and design tokens into
50
48
  }
51
49
  ```
52
50
 
53
- 4. **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:
51
+ 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:
54
52
 
55
53
  ```css
56
54
  @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
57
55
  ```
58
56
 
59
- 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.
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
58
 
61
59
  Install the plugin as a dev dependency:
62
60
 
@@ -76,3 +74,19 @@ Before consuming Recursica components, integrate the CSS and design tokens into
76
74
  },
77
75
  };
78
76
  ```
77
+
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.
79
+
80
+ Install the plugin as a dev dependency:
81
+
82
+ ```bash
83
+ npm install eslint-plugin-recursica --save-dev
84
+ ```
85
+
86
+ Then, add it to your `eslint.config.js`:
87
+
88
+ ```javascript
89
+ import recursica from "eslint-plugin-recursica";
90
+
91
+ export default [recursica.configs.recommended];
92
+ ```
package/dist/index.d.ts CHANGED
@@ -690,6 +690,29 @@ declare interface GroupOwnProps {
690
690
 
691
691
  declare type GroupProps = WithRecursicaSpacing<OmitSx<Omit<StackProps, "spacing" | "direction"> & GroupOwnProps>>;
692
692
 
693
+ export declare const Heading: typeof rawComponents.Heading;
694
+
695
+ declare const Heading_2: default_2.ForwardRefExoticComponent<(Omit<Omit<WithRecursicaSpacing<Omit<TypographyProps, "classes" | "variant"> & RecursicaHeadingProps>, BlockedStylingKeys> & ForbiddenStyles & {
696
+ overStyled?: false | undefined;
697
+ }, "ref"> | Omit<Omit<Omit<TypographyProps, "classes" | "variant"> & RecursicaHeadingProps, "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "gap" | "rowGap" | "columnGap" | "gutter" | "spacing"> & {
698
+ m?: string | number | RecursicaSpacing;
699
+ mx?: string | number | RecursicaSpacing;
700
+ my?: string | number | RecursicaSpacing;
701
+ mt?: string | number | RecursicaSpacing;
702
+ mb?: string | number | RecursicaSpacing;
703
+ ml?: string | number | RecursicaSpacing;
704
+ mr?: string | number | RecursicaSpacing;
705
+ gap?: string | number | RecursicaSpacing;
706
+ rowGap?: string | number | RecursicaSpacing;
707
+ columnGap?: string | number | RecursicaSpacing;
708
+ gutter?: string | number | RecursicaSpacing;
709
+ spacing?: string | number | RecursicaSpacing;
710
+ } & {
711
+ overStyled: true;
712
+ }, "ref">) & default_2.RefAttributes<HTMLElement>>;
713
+
714
+ declare type HeadingProps = RecursicaOverStyled<Omit<TypographyProps, "variant" | "classes"> & RecursicaHeadingProps>;
715
+
693
716
  export declare const HoverCard: typeof rawComponents.HoverCard;
694
717
 
695
718
  declare const HoverCard_2: HoverCardComponent;
@@ -1329,6 +1352,8 @@ declare namespace rawComponents {
1329
1352
  Grid_2 as Grid,
1330
1353
  GroupProps,
1331
1354
  Group_2 as Group,
1355
+ HeadingProps,
1356
+ Heading_2 as Heading,
1332
1357
  HoverCardProps,
1333
1358
  HoverCardTargetProps,
1334
1359
  HoverCardDropdownProps,
@@ -1440,8 +1465,6 @@ declare namespace rawComponents {
1440
1465
  Timeline_2 as Timeline,
1441
1466
  TimelineItemProps_2 as TimelineItemProps,
1442
1467
  TimelineItem_2 as TimelineItem,
1443
- TitleProps,
1444
- Title_2 as Title,
1445
1468
  RecursicaToastProps,
1446
1469
  ToastProps,
1447
1470
  Toast_2 as Toast,
@@ -1487,7 +1510,7 @@ export declare type ReadOnlyFieldType = "text" | "number" | "date" | "boolean" |
1487
1510
  /**
1488
1511
  * Official list of all components in Recursica.
1489
1512
  */
1490
- export declare const RECURSICA_COMPONENTS: readonly ["Accordion", "AssistiveElement", "Autocomplete", "Avatar", "Badge", "Box", "Breadcrumb", "Button", "Card", "Checkbox", "CheckboxGroup", "Chip", "Container", "DatePicker", "Dropdown", "EmptyValueRenderer", "FileInput", "FileUpload", "Flex", "FormControlLayout", "FormControlWrapper", "Grid", "Group", "HoverCard", "Label", "Layer", "Link", "Loader", "Menu", "Modal", "NumberInput", "Pagination", "Panel", "Popover", "Radio", "ReadOnlyField", "SegmentedControl", "Slider", "Stack", "Stepper", "Switch", "Table", "Tabs", "Text", "TextArea", "TextField", "TimePicker", "Timeline", "Title", "Toast", "Tooltip", "TransferList", "Tree", "Typography"];
1513
+ export declare const RECURSICA_COMPONENTS: readonly ["Accordion", "AssistiveElement", "Autocomplete", "Avatar", "Badge", "Box", "Breadcrumb", "Button", "Card", "Checkbox", "CheckboxGroup", "Chip", "Container", "DatePicker", "Dropdown", "EmptyValueRenderer", "FileInput", "FileUpload", "Flex", "FormControlLayout", "FormControlWrapper", "Grid", "Group", "Heading", "HoverCard", "Label", "Layer", "Link", "Loader", "Menu", "Modal", "NumberInput", "Pagination", "Panel", "Popover", "Radio", "ReadOnlyField", "SegmentedControl", "Slider", "Stack", "Stepper", "Switch", "Table", "Tabs", "Text", "TextArea", "TextField", "TimePicker", "Timeline", "Toast", "Tooltip", "TransferList", "Tree", "Typography"];
1491
1514
 
1492
1515
  /**
1493
1516
  * Props for the Recursica Accordion Control component.
@@ -2044,6 +2067,18 @@ declare interface RecursicaFormControlWrapperProps_2 extends RecursicaLabelProps
2044
2067
  controlMinWidth?: string | undefined;
2045
2068
  }
2046
2069
 
2070
+ /**
2071
+ * Props for the Recursica Heading component.
2072
+ */
2073
+ export declare interface RecursicaHeadingProps extends default_2.HTMLAttributes<HTMLHeadingElement> {
2074
+ /** Heading ordering hierarchies (1 represents H1, 6 represents H6) */
2075
+ order?: 1 | 2 | 3 | 4 | 5 | 6;
2076
+ /** Heading contents */
2077
+ children?: default_2.ReactNode;
2078
+ /** Polymorphic component override */
2079
+ component?: default_2.ElementType;
2080
+ }
2081
+
2047
2082
  /**
2048
2083
  * Props for the Recursica HoverCard component.
2049
2084
  */
@@ -2558,18 +2593,6 @@ declare interface RecursicaTimePickerProps_2 {
2558
2593
  maxTime?: string;
2559
2594
  }
2560
2595
 
2561
- /**
2562
- * Props for the Recursica Title component.
2563
- */
2564
- export declare interface RecursicaTitleProps extends default_2.HTMLAttributes<HTMLHeadingElement> {
2565
- /** Heading ordering hierarchies (1 represents H1, 6 represents H6) */
2566
- order?: 1 | 2 | 3 | 4 | 5 | 6;
2567
- /** Title contents */
2568
- children?: default_2.ReactNode;
2569
- /** Polymorphic component override */
2570
- component?: default_2.ElementType;
2571
- }
2572
-
2573
2596
  export declare interface RecursicaToastProps extends RecursicaToastProps_2 {
2574
2597
  withCloseButton?: boolean;
2575
2598
  title?: default_2.ReactNode;
@@ -3344,29 +3367,6 @@ declare const TimePicker_2: default_2.ForwardRefExoticComponent<TimePickerProps_
3344
3367
 
3345
3368
  declare type TimePickerProps_2 = RecursicaOverStyled<RecursicaTimePickerProps>;
3346
3369
 
3347
- export declare const Title: typeof rawComponents.Title;
3348
-
3349
- declare const Title_2: default_2.ForwardRefExoticComponent<(Omit<Omit<WithRecursicaSpacing<Omit<TypographyProps, "classes" | "variant"> & RecursicaTitleProps>, BlockedStylingKeys> & ForbiddenStyles & {
3350
- overStyled?: false | undefined;
3351
- }, "ref"> | Omit<Omit<Omit<TypographyProps, "classes" | "variant"> & RecursicaTitleProps, "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "gap" | "rowGap" | "columnGap" | "gutter" | "spacing"> & {
3352
- m?: string | number | RecursicaSpacing;
3353
- mx?: string | number | RecursicaSpacing;
3354
- my?: string | number | RecursicaSpacing;
3355
- mt?: string | number | RecursicaSpacing;
3356
- mb?: string | number | RecursicaSpacing;
3357
- ml?: string | number | RecursicaSpacing;
3358
- mr?: string | number | RecursicaSpacing;
3359
- gap?: string | number | RecursicaSpacing;
3360
- rowGap?: string | number | RecursicaSpacing;
3361
- columnGap?: string | number | RecursicaSpacing;
3362
- gutter?: string | number | RecursicaSpacing;
3363
- spacing?: string | number | RecursicaSpacing;
3364
- } & {
3365
- overStyled: true;
3366
- }, "ref">) & default_2.RefAttributes<HTMLElement>>;
3367
-
3368
- declare type TitleProps = RecursicaOverStyled<Omit<TypographyProps, "variant" | "classes"> & RecursicaTitleProps>;
3369
-
3370
3370
  export declare const Toast: typeof rawComponents.Toast;
3371
3371
 
3372
3372
  declare const Toast_2: default_2.ForwardRefExoticComponent<(Omit<Omit<WithRecursicaSpacing<Omit<AlertProps, "color" | "variant" | "onClose" | "radius"> & RecursicaToastProps>, BlockedStylingKeys> & ForbiddenStyles & {