@recursica/mantine-adapter 0.32.0 → 0.33.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 (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +1 -1
  3. package/src/components/Accordion/USAGE.md +90 -0
  4. package/src/components/AssistiveElement/USAGE.md +36 -0
  5. package/src/components/AutoComplete/USAGE.md +66 -0
  6. package/src/components/Avatar/USAGE.md +65 -0
  7. package/src/components/Badge/USAGE.md +59 -0
  8. package/src/components/Breadcrumb/USAGE.md +59 -0
  9. package/src/components/Button/USAGE.md +100 -0
  10. package/src/components/Card/USAGE.md +71 -0
  11. package/src/components/Checkbox/USAGE.md +64 -0
  12. package/src/components/Chip/USAGE.md +77 -0
  13. package/src/components/Container/USAGE.md +47 -0
  14. package/src/components/DatePicker/USAGE.md +55 -0
  15. package/src/components/Dropdown/USAGE.md +51 -0
  16. package/src/components/FileInput/USAGE.md +36 -0
  17. package/src/components/FileUpload/USAGE.md +41 -0
  18. package/src/components/Flex/USAGE.md +48 -0
  19. package/src/components/FormControlLayout/USAGE.md +40 -0
  20. package/src/components/FormControlWrapper/USAGE.md +75 -0
  21. package/src/components/Group/USAGE.md +48 -0
  22. package/src/components/HoverCard/USAGE.md +121 -0
  23. package/src/components/Label/USAGE.md +87 -0
  24. package/src/components/Link/USAGE.md +69 -0
  25. package/src/components/Loader/USAGE.md +63 -0
  26. package/src/components/Menu/USAGE.md +124 -0
  27. package/src/components/Modal/USAGE.md +58 -0
  28. package/src/components/NumberInput/USAGE.md +55 -0
  29. package/src/components/Pagination/USAGE.md +55 -0
  30. package/src/components/Panel/USAGE.md +145 -0
  31. package/src/components/Popover/USAGE.md +121 -0
  32. package/src/components/Radio/USAGE.md +36 -0
  33. package/src/components/ReadOnlyField/USAGE.md +52 -0
  34. package/src/components/SegmentedControl/USAGE.md +56 -0
  35. package/src/components/Slider/USAGE.md +86 -0
  36. package/src/components/Stack/USAGE.md +48 -0
  37. package/src/components/Stepper/USAGE.md +41 -0
  38. package/src/components/Switch/USAGE.md +65 -0
  39. package/src/components/Table/USAGE.md +51 -0
  40. package/src/components/Tabs/USAGE.md +45 -0
  41. package/src/components/Text/USAGE.md +40 -0
  42. package/src/components/TextArea/USAGE.md +48 -0
  43. package/src/components/TextField/USAGE.md +60 -0
  44. package/src/components/TimePicker/USAGE.md +36 -0
  45. package/src/components/Timeline/USAGE.md +57 -0
  46. package/src/components/Title/USAGE.md +36 -0
  47. package/src/components/Toast/USAGE.md +80 -0
  48. package/src/components/Tooltip/USAGE.md +124 -0
  49. package/src/components/TransferList/USAGE.md +46 -0
  50. package/src/components/Tree/USAGE.md +46 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @recursica/mantine-adapter
2
2
 
3
+ ## 0.33.0
4
+
5
+ ### Minor Changes
6
+
7
+ - db7701f: Updated layout of docs and mcp
8
+
3
9
  ## 0.32.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "url": "git+https://github.com/borderux/recursica.git",
14
14
  "directory": "packages/mantine-adapter"
15
15
  },
16
- "version": "0.32.0",
16
+ "version": "0.33.0",
17
17
  "type": "module",
18
18
  "main": "./dist/mantine-adapter.cjs",
19
19
  "module": "./dist/mantine-adapter.js",
@@ -0,0 +1,90 @@
1
+ # Accordion - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Accordion` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { Accordion } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { Accordion } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return (
23
+ <Accordion>
24
+ <Accordion.Item value="item-1">
25
+ <Accordion.Control>Section 1</Accordion.Control>
26
+ <Accordion.Panel>Section 1 content</Accordion.Panel>
27
+ </Accordion.Item>
28
+ </Accordion>
29
+ );
30
+ }
31
+ ```
32
+
33
+ ---
34
+
35
+ ## 3. Design System Integration
36
+
37
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
38
+
39
+ > [!IMPORTANT]
40
+ >
41
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
42
+ > - **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.
43
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
44
+
45
+ ---
46
+
47
+ ## 4. Key Integration Features & Constraints
48
+
49
+ ## 1. Hybrid Composition API (Smart Rendering Flow)
50
+
51
+ **Decision:** We fundamentally maintain the exact library composition API structure (`<Accordion>`, `<Accordion.Item>`, `<Accordion.Control>`, `<Accordion.Panel>`) while actively supporting an auto-completing flattened prop schema matching the unified Recursica API (`title`, `leftIcon`, `divider`).
52
+ **Implementation:** Avoid rigid raw parameter dumps. Mantine dynamically injects explicit `id` logic, keyboard ARIA mapping, and focus tracking correctly across `Control` to `Panel` DOM connections natively. By exposing the hierarchical mapping 1:1, Recursica safely adopts these capabilities. However, to strictly support Recursica's unified prop mapping interface:
53
+
54
+ - **Auto-Construction:** If integrators natively pass `title` and/or `leftIcon` props into `<AccordionItem>`, the component structurally auto-generates the internal `AccordionControl` sub-wrappers mapping the text and SVG natively, whilst treating `children` implicitly as the Panel contents.
55
+ - **Graceful Falldown:** If `title` is heavily omitted, the node immediately falls backward into raw Mantine composability expecting integrators mapped `<Accordion.Control>` entirely manually.
56
+
57
+ ---
58
+
59
+ ## 2. Default Configuration Reset (`unstyled`)
60
+
61
+ **Decision:** We strip Mantine's inner styles away completely from Accordion mappings by leveraging React's default `variant="unstyled"`.
62
+ **Implementation:** In `Accordion.tsx`, `<MantineAccordion>` binds `variant="unstyled"`. This effectively deletes Mantine's precomputed padding, borders, and shadow mappings allowing our targeted `classNames` inside `Accordion.module.css` to become the exact source of foundational truth without "fighting" `!important` tags or unpredictable flex-layouts inherited globally.
63
+
64
+ ---
65
+
66
+ ## 3. Strict SVG Icons Wrapper (`.iconLeftWrapper`)
67
+
68
+ **Decision:** Identical logic enforced as seen within Buttons: SVG scales dynamically inside `.mantine-leftSection` based on SVGs internal definition boundaries potentially corrupting header gaps.
69
+ **Implementation:** `AccordionControl` captures `<span className={styles.iconLeftWrapper} aria-hidden>` forcing `object-fit: contain` mapped exactly to the `properties_icon-left-size` Recursica dimension token forcing integrator SVG overrides inline perfectly.
70
+
71
+ ---
72
+
73
+ ## 4. Transparent Global Hover Fixes
74
+
75
+ **Decision:** We nullify internal Mantine button hover actions and exclusively utilize Recursica's hover structure natively.
76
+ **Implementation:** We construct `.control::after` pseudo-objects dynamically pulling our `hover-color` & `hover-opacity` bindings. Mantine's native action sets `.control:hover { background-color: var(...) }` dynamically causing internal layer overlaps. We enforce `background-color: transparent` strictly overriding it, preserving our pseudo-overlay layer-cascade cleanly.
77
+
78
+ ---
79
+
80
+ ## 5. Active Target Hooks (`[data-active]`)
81
+
82
+ **Decision:** Collapsed and expanded state tracking requires separate background maps across `AccordionItem`.
83
+ **Implementation:** Rather than syncing React `useState` hooks matching `Accordion.value`, we defer to Mantine's inherent DOM mapping: `.item[data-active]` implicitly triggers exactly when Mantine registers an expansion state swap changing values down dynamically on the element layer, perfectly binding to `--recursica_..._background-expanded`.
84
+
85
+ ---
86
+
87
+ ## 6. Nullifying Isolated State Bounds (`open` boolean)
88
+
89
+ **Decision:** We do not bind isolated `open={true}` state properties natively on individual `<AccordionItem>` configurations.
90
+ **Implementation:** Recursica natively dictates an item-level `open` tracking mapping. However, internally mapping boolean flags structurally across specific tree nodes heavily corrupts Mantine's DOM layout algorithms mapping parent-driven transition listeners. Mantine forces all expanded-height logic to run symmetrically off the `<Accordion value="...">` string matching array to accurately bind ARIA transitions. We explicitly ignore isolated item `<AccordionItem open={...}>` booleans to shield the rendering sequence cleanly.
@@ -0,0 +1,36 @@
1
+ # AssistiveElement - Usage Guide
2
+
3
+ This document describes how to integrate and use the `AssistiveElement` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { AssistiveElement } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { AssistiveElement } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return <AssistiveElement state="error" message="This field is required" />;
23
+ }
24
+ ```
25
+
26
+ ---
27
+
28
+ ## 3. Design System Integration
29
+
30
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
31
+
32
+ > [!IMPORTANT]
33
+ >
34
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
35
+ > - **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.
36
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
@@ -0,0 +1,66 @@
1
+ # AutoComplete - Usage Guide
2
+
3
+ This document describes how to integrate and use the `AutoComplete` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { AutoComplete } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { AutoComplete } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return (
23
+ <AutoComplete
24
+ label="Country"
25
+ placeholder="Type a country name..."
26
+ data={["USA", "Canada", "Mexico"]}
27
+ />
28
+ );
29
+ }
30
+ ```
31
+
32
+ ---
33
+
34
+ ## 3. Design System Integration
35
+
36
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
37
+
38
+ > [!IMPORTANT]
39
+ >
40
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
41
+ > - **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.
42
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
43
+
44
+ ---
45
+
46
+ ## 4. Key Integration Features & Constraints
47
+
48
+ ## Form Control Wrapping
49
+
50
+ The `AutoComplete` component is wrapped using the `WithReadOnlyWrapper` to seamlessly bridge standard `InputWrapperProps` attributes (like `label`, `error`, `assistiveText`) directly onto the macro Recursica `<FormControlWrapper>`.
51
+
52
+ ## CSS Layout Execution
53
+
54
+ The baseline structure maps identical `HARDCODED VALUES` as standard text inputs (`border-width: 1px`, `display: flex`). The `.root` dynamically overrides the `--input-left-section-size` and `--input-right-section-size` to accurately allocate whitespace for prepended or appended icons natively matching the underlying UI token layout system securely.
55
+
56
+ ## Dropdown Styling
57
+
58
+ The Mantine `<Autocomplete>` dropdown menu and options are styled strictly using native UI-Kit variables mapping border radii, shadows, and base colors (`.dropdown` and `.option`).
59
+
60
+ ## State Cascade Architecture
61
+
62
+ Focus, errors, and disabled visual states are enforced explicitly via the outer `<FormControlWrapper>` boundary emitting context down structurally (`[data-error]`, `[data-disabled]`) and evaluated efficiently against scoped nested selectors natively inside `AutoComplete.module.css`.
63
+
64
+ ## Missing Active Option Color
65
+
66
+ Currently, there is no explicit JSON token for the background color of an active/hovered option in the AutoComplete dropdown. We temporarily map `.option:hover` and `.option[data-combobox-active]` to the `--recursica_ui-kit_components_autocomplete_variants_states_focus_properties_colors_background` variable. Because this variable maps to the base field background, the highlight is currently invisible. This will be updated once the correct token is added to the UI kit.
@@ -0,0 +1,65 @@
1
+ # Avatar - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Avatar` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { Avatar } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { Avatar } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return (
23
+ <Avatar src="https://example.com/avatar.png" alt="User Name" radius="xl" />
24
+ );
25
+ }
26
+ ```
27
+
28
+ ---
29
+
30
+ ## 3. Design System Integration
31
+
32
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
33
+
34
+ > [!IMPORTANT]
35
+ >
36
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
37
+ > - **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.
38
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
39
+
40
+ ---
41
+
42
+ ## 4. Key Integration Features & Constraints
43
+
44
+ ## Architecture Decisions
45
+
46
+ The `Avatar` component is an adapter over Mantine's `Avatar`. To ensure adherence to the `COMPONENT_GUIDE_WALKTHROUGH.md`:
47
+
48
+ - We do not wrap `MantineAvatar` in any custom standard `div` elements, preserving DOM structure.
49
+ - All styles strictly pull from explicit `--recursica_ui-kit_components_avatar_*` CSS tokens.
50
+
51
+ ## Structural Workarounds
52
+
53
+ ### Implicit `data-style`
54
+
55
+ Mantine's Avatar implicitly renders an image, an icon, or a text node based on the properties passed (`src`, `var`, `children`).
56
+ Recursica Tokens split Avatar styling distinctly across three separate categories: `image`, `icon`, and `text`.
57
+ To correctly map these variables, our React component observes standard prop states and manually injects a `data-style="image|icon|text"` onto the root. The `Avatar.module.css` explicitly gates padding and generic sizing modifiers under these `data-style` attributes.
58
+
59
+ ### Flex Layout & Internal Spans
60
+
61
+ Since Avatar children (icons or initials) require robust centering that might differ heavily across Recursica size mappings, all child content defaults to being wrapped in `span` elements (either `.textWrapper` or `.iconWrapper`). These spans enforce 100% height and flex formatting independent of the Mantine container constraints.
62
+
63
+ ### CSS Reset Hacks
64
+
65
+ Noticeable `/* HARDCODE: ... */` hacks are deployed within `.root` to completely zero-out Mantine's `--avatar-bg` and internal variables statically since Recursica handles background-colors inherently via the CSS variants cascade.
@@ -0,0 +1,59 @@
1
+ # Badge - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Badge` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { Badge } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { Badge } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return (
23
+ <Badge variant="filled" size="md">
24
+ Active
25
+ </Badge>
26
+ );
27
+ }
28
+ ```
29
+
30
+ ---
31
+
32
+ ## 3. Design System Integration
33
+
34
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
35
+
36
+ > [!IMPORTANT]
37
+ >
38
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
39
+ > - **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.
40
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
41
+
42
+ ---
43
+
44
+ ## 4. Key Integration Features & Constraints
45
+
46
+ ## 1. Stripped Size Properties
47
+
48
+ As logged in `COMPONENT_ISSUES.md`, there are currently no Figma variables mapped for different `size` variants (`small`, `default`, etc.). The component explicitly `Omit`s the Mantine `size` property from its signature to prevent integrators from attempting to drive sizes that do not exist in the tokens.
49
+
50
+ ## 2. Intent-Based Variants
51
+
52
+ Mantine supports multiple visual variants (`outline`, `filled`, `light`). However, the existing variable schema for `Badge` only defines "Styles" which act as intents (`alert`, `primary-color`, `success`, `warning`).
53
+
54
+ - Default is arbitrarily mapped to `primary-color` as we lack a pure `neutral` schema right now.
55
+ - `variant` mapped to underlying Mantine prop has been hardcoded to `filled`, since the Recursica coloring fully replaces the Mantine DOM.
56
+
57
+ ## 3. The `overStyled` Prop
58
+
59
+ This component implements the newly added `overStyled` architectural standard. By default, passing inline `{style}` React properties to `Badge` will be ignored. This prevents accidental cascading regressions of our strict CSS-variables layouts unless a developer explicitly forces `overStyled={true}`.
@@ -0,0 +1,59 @@
1
+ # Breadcrumb - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Breadcrumb` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { Breadcrumb } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { Breadcrumb } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return (
23
+ <Breadcrumb>
24
+ <Link href="/">Home</Link>
25
+ <Link href="/components">Components</Link>
26
+ <Text>Button</Text>
27
+ </Breadcrumb>
28
+ );
29
+ }
30
+ ```
31
+
32
+ ---
33
+
34
+ ## 3. Design System Integration
35
+
36
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
37
+
38
+ > [!IMPORTANT]
39
+ >
40
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
41
+ > - **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.
42
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
43
+
44
+ ---
45
+
46
+ ## 4. Key Integration Features & Constraints
47
+
48
+ ## Missing Variants and Sizes
49
+
50
+ The `Breadcrumb` currently does not establish any size (`xs`, `sm`, etc.) or variant variables in the underlying design tokens (`recursica_ui-kit.json`). Only basic structural definitions for `padding` and `item-gap` exist. Because of this, the `size` and `variant` properties have been explicitly omitted from the passed mantine props.
51
+
52
+ ## Gap Styling
53
+
54
+ We attach `gap` to `.root` directly within `.module.css`. Mantine's inner `separator` divs can natively accept our CSS variables for structural layout.
55
+
56
+ ## Composition and Separators
57
+
58
+ We preserve standard hierarchical composition based on Mantine's defaults. The component natively accepts typical anchor tags as children without wrapping them in structural spans, allowing developers to utilize `Link` wrappers as needed contextually.
59
+ The separator character is inherited natively from Mantine's default configuration (`/`) unless overridden by passing `separator={<Icon />}` to the component props.
@@ -0,0 +1,100 @@
1
+ # Button - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Button` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { Button } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { Button } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return (
23
+ <Button variant="primary" onClick={() => console.log("Clicked!")}>
24
+ Click Me
25
+ </Button>
26
+ );
27
+ }
28
+ ```
29
+
30
+ ---
31
+
32
+ ## 3. Design System Integration
33
+
34
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
35
+
36
+ > [!IMPORTANT]
37
+ >
38
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
39
+ > - **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.
40
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
41
+
42
+ ---
43
+
44
+ ## 4. Key Integration Features & Constraints
45
+
46
+ ## Icon size: Recursica defines it
47
+
48
+ **Decision:** Icon size is **not** left to the developer. Recursica defines it via the design tokens; the Button enforces it so callers cannot pass an arbitrarily sized icon.
49
+
50
+ **Implementation:**
51
+
52
+ - When `icon` is provided, the Button wraps it in a single element with class `iconWrapper` before passing it to Mantine’s `leftSection`.
53
+ - In `Button.module.css`, `.iconWrapper` has explicit `width` and `height` from the Recursica tokens mapping natively based on `data-size`.
54
+ - The rule `.iconWrapper > *` sets `width: 100%`, `height: 100%`, and `object-fit: contain` so whatever the caller passes scales cleanly with the token constraints.
55
+
56
+ ---
57
+
58
+ ## Icon-only buttons: accessibility and width
59
+
60
+ **Decision:** When the button has an icon and no visible label (icon-only), callers must provide an accessible name, and the button must not show extra space to the right of the icon.
61
+
62
+ **Accessibility:** We document that icon-only buttons must pass `aria-label` (e.g. `aria-label="Submit"`). In development we log a console warning if `icon` is set, `children` is empty, and `aria-label` is missing.
63
+
64
+ **Width:** Mantine’s layout natively applies structural section gaps. We detect icon-only and set a `data-icon-only` hook so that `Button.module.css` zeros out the sections spacing allowing the button to precisely hit `min-width` perfectly centered.
65
+
66
+ ---
67
+
68
+ ## Label truncation at max-width
69
+
70
+ **Decision:** When the button hits its Recursica max-width (500px), the label truncates with an ellipsis instead of wrapping.
71
+
72
+ **Implementation:**
73
+ Mantine's `.mantine-Button-label` flex centering breaks primitive truncation logic. To combat this:
74
+
75
+ - **`.root`** has `overflow: hidden`.
76
+ - **`.root > *`** forces `min-width: 0`.
77
+ - The structural children wrap into `<span className={styles.labelText}>`.
78
+ - **`.labelText`** binds `overflow: hidden; text-overflow: ellipsis; white-space: nowrap;` creating flawless string cutoffs strictly at exact UI constraints.
79
+
80
+ ---
81
+
82
+ ## Disabled state: brand theme opacity (implicit)
83
+
84
+ **Decision:** The UI kit enforces global brand theme disabled opacities. The `.root:disabled` logic implicitly overrides visibility locally via `var(--recursica_brand_states_disabled)`.
85
+
86
+ ---
87
+
88
+ ## Loader color contrast
89
+
90
+ **Decision:** When a Button is in a loading state, the `Recursica Loader` component is injected. The `Loader` component strictly defines its own colors and styles per variant, meaning it does not inherit the text color (`currentColor`) from the Button.
91
+
92
+ **Constraint:** This can lead to contrast issues (e.g., a blue dots loader inside a solid blue button). Design has explicitly decided not to address this at the moment. As such, developers using the `loading` prop must be aware that the loader's color is fixed by its internal tokens, not by the button's context.
93
+
94
+ ---
95
+
96
+ ## Loading state enforces disabled state
97
+
98
+ **Decision:** When `loading={true}` is passed to the Button, the component explicitly forces `disabled={true}` natively on the underlying element.
99
+
100
+ **Implementation:** This ensures that loading buttons automatically inherit the brand theme disabled opacities (via the `:disabled` CSS pseudo-class) rather than relying solely on Mantine's native `data-disabled` dataset logic, which may not trigger the strict visual fade required by the Recursica design system.
@@ -0,0 +1,71 @@
1
+ # Card - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Card` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { Card } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { Card } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return (
23
+ <Card>
24
+ <Card.Header>
25
+ <Title order={3}>Card Title</Title>
26
+ </Card.Header>
27
+ <Card.Content>
28
+ <Text>
29
+ This is some card content styled natively via design tokens.
30
+ </Text>
31
+ </Card.Content>
32
+ <Card.Footer>
33
+ <Button variant="secondary">Cancel</Button>
34
+ <Button variant="primary">Submit</Button>
35
+ </Card.Footer>
36
+ </Card>
37
+ );
38
+ }
39
+ ```
40
+
41
+ ---
42
+
43
+ ## 3. Design System Integration
44
+
45
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
46
+
47
+ > [!IMPORTANT]
48
+ >
49
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
50
+ > - **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.
51
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
52
+
53
+ ---
54
+
55
+ ## 4. Key Integration Features & Constraints
56
+
57
+ ## Architecture Overrides
58
+
59
+ Because Mantine natively constructs `Card` bounding boxes with generic inner `<Card.Section>` elements that depend on explicit user styling (and lack implicit native designations for "Header" vs "Footer"), we implemented an explicit component wrapper departure:
60
+
61
+ - `<Card.Header>` explicitly hooks `--recursica_ui-kit_components_card_properties_header-background` and corresponding padding variables.
62
+ - `<Card.Footer>` explicitly hooks `--recursica_ui-kit_components_card_properties_footer-background` and corresponding padding variables.
63
+
64
+ Mantine's generic `<Card.Section>` calculates negative margins implicitly. Because of this, it is crucial that our local CSS module declares `--card-padding: var(--recursica_ui-kit_components_card_properties_padding)` directly on `.root` so that all generic or explicit section wrappers natively stretch across the bounding box properly.
65
+
66
+ ## Layout Alignment Exceptions
67
+
68
+ To allow Cards to fit cleanly inside dynamic/flex layouts (like dashboard panels, grid tracks, or sidebar layout segments), the Card wrapper implements a custom gatekeeper bypass for outer styling properties:
69
+
70
+ - Exposes a safe subset of flexbox/dimensions styling properties (`flex`, `flexGrow`, `flexShrink`, `flexBasis`, `grow`, `h`, `height`) on the root `<Card>` component to allow proper sizing alongside layout siblings.
71
+ - Sets `<Card.Content>` to `flex-grow: 1;` by default via CSS modules. Since the root `<Card>` has `display: flex; flex-direction: column;`, this makes the content area expand to fill all vertical space, pushing `<Card.Footer>` to align at the absolute bottom of the bounding box.
@@ -0,0 +1,64 @@
1
+ # Checkbox - Usage Guide
2
+
3
+ This document describes how to integrate and use the `Checkbox` component in your projects using `@recursica/mantine-adapter`.
4
+
5
+ ---
6
+
7
+ ## 1. Import Reference
8
+
9
+ ```tsx
10
+ import { Checkbox } from "@recursica/mantine-adapter";
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 2. Basic Example
16
+
17
+ ```tsx
18
+ import React from "react";
19
+ import { Checkbox } from "@recursica/mantine-adapter";
20
+
21
+ export default function Demo() {
22
+ return <Checkbox label="Accept terms and conditions" defaultChecked />;
23
+ }
24
+ ```
25
+
26
+ ---
27
+
28
+ ## 3. Design System Integration
29
+
30
+ All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
31
+
32
+ > [!IMPORTANT]
33
+ >
34
+ > - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
35
+ > - **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.
36
+ > - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
37
+
38
+ ---
39
+
40
+ ## 4. Key Integration Features & Constraints
41
+
42
+ ## Architectural Philosophy
43
+
44
+ The `Checkbox` primitive requires aggressive structural modifications to decouple Mantine's built-in arrays (`<Checkbox.Group>`) tying the raw DOM nodes seamlessly back into Recursica's unified form definitions flawlessly.
45
+
46
+ ### Checkbox Alignment Anchoring (gap overflow hack)
47
+
48
+ By default, placing a Checkbox alongside a deeply wrapping multi-line label causes native geometric drifts natively. Because Mantine aligns the Checkbox graphic to the top of standard `display: flex` boxes, its optical center will appear natively skewed slightly _too high_ against the very first typographic text-line.
49
+
50
+ We mathematically fix this alignment within `Checkbox.module.css` using explicit design variable arithmetic natively.
51
+ \`\`\`css
52
+ margin-top: calc(
53
+ (
54
+ var(--recursica_ui-kit_components_checkbox-item_properties_text_line-height) \*
55
+ var(--recursica_ui-kit_components_checkbox-item_properties_text_font-size) -
56
+ var(--recursica_ui-kit_components_checkbox_properties_size)
57
+ ) / 2
58
+ ) !important;
59
+ \`\`\`
60
+ This calculation ensures that the optical center of the `.inner` checkmark vector perfectly snaps onto the relative center of the text's line-height, permanently solving pixel-drifts natively!
61
+
62
+ ### Checkbox.Group Overrides
63
+
64
+ To decouple `<CheckboxGroup>` away from `<Input.Wrapper>`, we explicitly extract the raw array execution mapped correctly against our identical `RecursicaFormControlWrapperProps` schema structurally!