@recursica/mui-adapter 0.36.0 → 0.38.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 +21 -0
- package/SETUP.md +20 -6
- package/dist/index.d.ts +10 -0
- package/dist/mui-adapter.cjs +32 -32
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.css +1 -1
- package/dist/mui-adapter.js +1381 -1357
- package/dist/mui-adapter.js.map +1 -1
- package/package.json +10 -5
- package/recursica_brand.json +2677 -0
- package/recursica_tokens.json +799 -0
- package/recursica_ui-kit.json +14981 -0
- package/recursica_variables_scoped.css +30489 -0
- package/src/components/Label/Label.stories.tsx +63 -54
- package/src/components/Loader/Loader.animate.dom.test.tsx +72 -0
- package/src/components/Loader/Loader.module.css +10 -0
- package/src/components/Loader/Loader.stories.tsx +20 -0
- package/src/components/Loader/Loader.tsx +8 -1
- package/src/components/Table/TABLE_IMPLEMENTATION_NOTES.md +11 -0
- package/src/components/Table/Table.module.css +14 -0
- package/src/components/Table/Table.stories.tsx +1 -1
- package/src/components/Table/USAGE.md +2 -2
- package/src/components/TimePicker/TIMEPICKER_IMPLEMENTATION_NOTES.md +8 -1
- package/src/components/TimePicker/TimePicker.module.css +43 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +22 -0
- package/src/components/TimePicker/TimePicker.tsx +24 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @recursica/mui-adapter
|
|
2
2
|
|
|
3
|
+
## 0.38.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c31d5ae: Added an `animate` prop to `Loader` (default `true`) — set `false` to freeze its CSS animation for a deterministic render, e.g. a visual-regression snapshot. The `Static*` Loader stories now use it, and the animated `Default`/`LayerTwoOval` stories are excluded from adapter-tester's visual regression.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- c31d5ae: Fixed `Table` currency columns so header and footer cells right-align to match value cells. `Table.Th`/`Table.Cell` header context now supports `variant="currency"`.
|
|
12
|
+
- c31d5ae: Added `leftSection` support to `TimePicker` for an optional leading icon, matching `TextField`'s convention.
|
|
13
|
+
- Updated dependencies [c31d5ae]
|
|
14
|
+
- Updated dependencies [c31d5ae]
|
|
15
|
+
- Updated dependencies [c31d5ae]
|
|
16
|
+
- @recursica/adapter-common@0.27.0
|
|
17
|
+
|
|
18
|
+
## 0.37.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- 786d870: Version bumped
|
|
23
|
+
|
|
3
24
|
## 0.36.0
|
|
4
25
|
|
|
5
26
|
### 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. **
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
@@ -2165,6 +2165,12 @@ export declare interface RecursicaLoaderProps {
|
|
|
2165
2165
|
variant?: "oval" | "bars" | "dots";
|
|
2166
2166
|
/** Map to Recursica sizes */
|
|
2167
2167
|
size?: "sm" | "md" | "lg" | RecursicaSize;
|
|
2168
|
+
/** Freezes the loader's CSS animation when `false` — the loader still
|
|
2169
|
+
* renders its normal shape, just without motion. Defaults to `true` (the
|
|
2170
|
+
* normal, animated loader). Use `false` for a deterministic rendering,
|
|
2171
|
+
* e.g. a visual-regression snapshot, where a moving animation would
|
|
2172
|
+
* otherwise diff differently every run. */
|
|
2173
|
+
animate?: boolean;
|
|
2168
2174
|
}
|
|
2169
2175
|
|
|
2170
2176
|
/**
|
|
@@ -2449,6 +2455,8 @@ export declare interface RecursicaTableHeaderCellProps {
|
|
|
2449
2455
|
sorted?: "asc" | "desc" | false;
|
|
2450
2456
|
/** Disables the header cell, dimming it and applying the disabled cell colors */
|
|
2451
2457
|
disabled?: boolean;
|
|
2458
|
+
/** `"currency"` right-aligns the header cell to match a currency column's value cells */
|
|
2459
|
+
variant?: "default" | "currency";
|
|
2452
2460
|
}
|
|
2453
2461
|
|
|
2454
2462
|
/**
|
|
@@ -2591,6 +2599,8 @@ declare interface RecursicaTimePickerProps_2 {
|
|
|
2591
2599
|
minTime?: string;
|
|
2592
2600
|
/** Maximum possible time string. Format is `HH:mm` normally, or `HH:mm:ss` when `withSeconds` is true. */
|
|
2593
2601
|
maxTime?: string;
|
|
2602
|
+
/** Section rendered inside the time field on the left (e.g. icon). Naming rationale: see `RecursicaTextFieldProps.leftSection`. */
|
|
2603
|
+
leftSection?: default_2.ReactNode;
|
|
2594
2604
|
}
|
|
2595
2605
|
|
|
2596
2606
|
export declare interface RecursicaToastProps extends RecursicaToastProps_2 {
|