@recursica/mantine-adapter 0.34.0 → 0.35.1

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.
@@ -0,0 +1,47 @@
1
+ # Grid - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Grid` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { Grid } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { Grid } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return (
23
+ <Grid gap="rec-default">
24
+ <Grid.Col span={6}>Half width</Grid.Col>
25
+ <Grid.Col span={{ base: 12, sm: 6, md: 3 }}>Responsive width</Grid.Col>
26
+ </Grid>
27
+ );
28
+ }
29
+ ```
30
+
31
+ ---
32
+
33
+ ## 3. Design System Integration
34
+
35
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
36
+
37
+ > [!IMPORTANT]
38
+ >
39
+ > - **Anti-override protection**: `Grid` is a primitive layout component (see [OVERSTYLING.md](../../../OVERSTYLING.md)) and is exempt from the `RecursicaOverStyled` gatekeeper, so standard Mantine layout props pass through freely.
40
+ > - **No Direct Layers**: Do not pass a `layer` prop to this component. To place it on a specific visual layer, wrap it in a `<Layer layer={0|1|2|3}>` component natively.
41
+ > - **Variables and Theming**: Spacing is entirely determined by the `rec-*` token scale, mapped transparently to standard Mantine gutter values.
42
+
43
+ ---
44
+
45
+ ## 4. Key Integration Features & Constraints
46
+
47
+ The `Grid` component maps directly to Mantine's `Grid`/`Grid.Col`. The one deviation from Mantine's native API: the prop for spacing between columns is named `gap` (not Mantine's `gutter`), for consistency with `Flex`, `Stack`, and `Group`. Everything else — `columns`, `grow`, `justify`, `align` on `Grid`, and `span`, `offset`, `order`, `visibleFrom`, `hiddenFrom` on `Grid.Col` — matches Mantine's own naming and accepts the same shapes, including per-breakpoint objects (`{ base, xs, sm, md, lg, xl }`).
@@ -0,0 +1,54 @@
1
+ # Layer - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Layer` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ > [!NOTE] > `Layer` is defined once in `@recursica/adapter-common` and re-exported here so it shares the exact same behavior across every Recursica adapter.
6
+
7
+ ---
8
+
9
+ ## 1. Import Reference
10
+
11
+ ```tsx
12
+ import { Layer } from "@recursica/mantine-adapter";
13
+ ```
14
+
15
+ ---
16
+
17
+ ## 2. Basic Example
18
+
19
+ `Layer` sets `data-recursica-layer` on its root element, which is what makes the theme+layer scoped CSS variables (surface color, border, elevation, padding) in `recursica_variables_scoped.css` actually apply. [`RecursicaThemeProvider`](../RecursicaThemeProvider/USAGE.md) automatically wraps your app in a `layer={0}` `Layer` by default (via its `initLayer0` prop), so you don't need to add one yourself for the base page. You still add `Layer`s manually for anything visually elevated above the page background:
20
+
21
+ ```tsx
22
+ import {
23
+ RecursicaThemeProvider,
24
+ Layer,
25
+ Card,
26
+ } from "@recursica/mantine-adapter";
27
+
28
+ function App() {
29
+ return (
30
+ <RecursicaThemeProvider theme="light">
31
+ {/* Page background/surface already uses layer 0, applied automatically */}
32
+ <Layer layer={1}>
33
+ <Card>Elevated content sits on layer 1</Card>
34
+ </Layer>
35
+ </RecursicaThemeProvider>
36
+ );
37
+ }
38
+ ```
39
+
40
+ ---
41
+
42
+ ## 3. Design System Integration
43
+
44
+ > [!IMPORTANT]
45
+ >
46
+ > - **Layer 0 is automatic**: `RecursicaThemeProvider` applies it for you by default. Only opt out (`initLayer0={false}`) if you need to control exactly where layer 0 starts in the tree, or need `contentsOnly` on the base layer — see [RecursicaThemeProvider usage](../RecursicaThemeProvider/USAGE.md).
47
+ > - **Layers 1–3 are manual**: Wrap any content that's visually elevated above the page background (a Card, Modal, Popover, etc.) in its own `<Layer layer={1|2|3}>`. Nesting `Layer`s is how Recursica communicates elevation to descendant components — do **not** pass a `layer` prop directly to other components; wrap them in a `Layer` instead (every other component's `USAGE.md` repeats this rule).
48
+ > - **`contentsOnly`**: When `true`, `Layer` renders with `display: contents` and omits `data-recursica-layer` entirely — use this when you need a layer boundary in your component tree without adding an extra DOM box or applying layer styling (e.g. a purely structural wrapper).
49
+
50
+ ---
51
+
52
+ ## 4. Key Integration Features & Constraints
53
+
54
+ `Layer` has no visual variants of its own — its entire purpose is to bind a subtree to a numbered layer's design tokens. It does not accept `overStyled`; instead, if you find yourself needing to override a layer's surface styling, that's a signal you may want a different layer number rather than an escape hatch.
@@ -0,0 +1,60 @@
1
+ # RecursicaThemeProvider - Usage Guide
2
+
3
+ This document describes how to integrate and use `RecursicaThemeProvider` in your projects using `@recursica/mantine-adapter`.
4
+
5
+ > [!NOTE] > `RecursicaThemeProvider` is defined once in `@recursica/adapter-common` and re-exported here so it shares the exact same behavior across every Recursica adapter.
6
+
7
+ ---
8
+
9
+ ## 1. Import Reference
10
+
11
+ ```tsx
12
+ import { RecursicaThemeProvider } from "@recursica/mantine-adapter";
13
+ ```
14
+
15
+ ---
16
+
17
+ ## 2. Basic Example
18
+
19
+ ```tsx
20
+ import { MantineProvider } from "@mantine/core";
21
+ import { RecursicaThemeProvider } from "@recursica/mantine-adapter";
22
+
23
+ function App() {
24
+ return (
25
+ <MantineProvider>
26
+ <RecursicaThemeProvider theme="light">
27
+ {/* Your App Components */}
28
+ </RecursicaThemeProvider>
29
+ </MantineProvider>
30
+ );
31
+ }
32
+ ```
33
+
34
+ By default, `RecursicaThemeProvider` also wraps `children` in a base [`Layer`](../Layer/USAGE.md) (`layer={0}`), so surface/border/elevation variables resolve immediately — no separate `Layer` needed for the page background.
35
+
36
+ If you want to place the base layer yourself (e.g. to use `contentsOnly`, or to control exactly where layer 0 starts in the tree), opt out with `initLayer0={false}`:
37
+
38
+ ```tsx
39
+ import { RecursicaThemeProvider, Layer } from "@recursica/mantine-adapter";
40
+
41
+ <RecursicaThemeProvider theme="light" initLayer0={false}>
42
+ <Layer layer={0}>{/* Your App Components */}</Layer>
43
+ </RecursicaThemeProvider>;
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 3. Design System Integration
49
+
50
+ > [!IMPORTANT]
51
+ >
52
+ > - **Required for setup**: `RecursicaThemeProvider` must wrap your entire application, once, near the root. See [SETUP.md](../../../SETUP.md) for the full setup sequence.
53
+ > - **`initLayer0` (default `true`)**: Automatically wraps `children` in a layer-0 [`Layer`](../Layer/USAGE.md). `RecursicaThemeProvider` itself only sets `data-recursica-theme` (`"light"` or `"dark"`, defaults to `"light"`) on `document.documentElement` — without a `Layer` in the tree (either the automatic one or one you add yourself with `initLayer0={false}`), none of Recursica's surface CSS variables resolve.
54
+ > - **Runtime theme switching**: Changing the `theme` prop re-runs the effect and updates `data-recursica-theme` immediately, so you can drive light/dark switching from application state.
55
+
56
+ ---
57
+
58
+ ## 4. Key Integration Features & Constraints
59
+
60
+ `RecursicaThemeProvider` also wires up the `overStyled` development-mode visual auditing helper (see [OVERSTYLING.md](../../../OVERSTYLING.md)) — `recursica.toggleOverStyled()` in the browser console only works once this provider has mounted.
@@ -1,4 +1,5 @@
1
1
  export * from "./Accordion";
2
+ export * from "./AssistiveElement/AssistiveElement";
2
3
  export * from "./AutoComplete/AutoComplete";
3
4
  export * from "./Avatar";
4
5
  export * from "./Badge/Badge";
@@ -15,6 +16,7 @@ export * from "./FileInput/FileInput";
15
16
  export * from "./FileUpload/FileUpload";
16
17
  export * from "./Flex/Flex";
17
18
  export * from "./FormControlLayout/FormControlLayout";
19
+ export * from "./Grid/Grid";
18
20
  export * from "./Group/Group";
19
21
  export * from "./HoverCard/HoverCard";
20
22
  export * from "./Link/Link";
package/src/index.ts CHANGED
@@ -6,6 +6,8 @@ export * from "@recursica/adapter-common";
6
6
 
7
7
  // Expose unwrapped structural layout primitives to preserve their polymorphic types
8
8
  export const Flex = rawComponents.Flex;
9
+ export const Grid = rawComponents.Grid;
10
+ export const GridCol = rawComponents.GridCol;
9
11
  export const Group = rawComponents.Group;
10
12
  export const Stack = rawComponents.Stack;
11
13
  export const Container = rawComponents.Container;
@@ -25,6 +27,9 @@ export const AccordionControl = wrapComponent(
25
27
  export const AccordionPanel = wrapComponent(
26
28
  rawComponents.AccordionPanel,
27
29
  ) as typeof rawComponents.AccordionPanel;
30
+ export const AssistiveElement = wrapComponent(
31
+ rawComponents.AssistiveElement,
32
+ ) as typeof rawComponents.AssistiveElement;
28
33
  export const AutoComplete = wrapComponent(
29
34
  rawComponents.AutoComplete,
30
35
  ) as typeof rawComponents.AutoComplete;