@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.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/components/Accordion/USAGE.md +90 -0
- package/src/components/AssistiveElement/USAGE.md +36 -0
- package/src/components/AutoComplete/USAGE.md +66 -0
- package/src/components/Avatar/USAGE.md +65 -0
- package/src/components/Badge/USAGE.md +59 -0
- package/src/components/Breadcrumb/USAGE.md +59 -0
- package/src/components/Button/USAGE.md +100 -0
- package/src/components/Card/USAGE.md +71 -0
- package/src/components/Checkbox/USAGE.md +64 -0
- package/src/components/Chip/USAGE.md +77 -0
- package/src/components/Container/USAGE.md +47 -0
- package/src/components/DatePicker/USAGE.md +55 -0
- package/src/components/Dropdown/USAGE.md +51 -0
- package/src/components/FileInput/USAGE.md +36 -0
- package/src/components/FileUpload/USAGE.md +41 -0
- package/src/components/Flex/USAGE.md +48 -0
- package/src/components/FormControlLayout/USAGE.md +40 -0
- package/src/components/FormControlWrapper/USAGE.md +75 -0
- package/src/components/Group/USAGE.md +48 -0
- package/src/components/HoverCard/USAGE.md +121 -0
- package/src/components/Label/USAGE.md +87 -0
- package/src/components/Link/USAGE.md +69 -0
- package/src/components/Loader/USAGE.md +63 -0
- package/src/components/Menu/USAGE.md +124 -0
- package/src/components/Modal/USAGE.md +58 -0
- package/src/components/NumberInput/USAGE.md +55 -0
- package/src/components/Pagination/USAGE.md +55 -0
- package/src/components/Panel/USAGE.md +145 -0
- package/src/components/Popover/USAGE.md +121 -0
- package/src/components/Radio/USAGE.md +36 -0
- package/src/components/ReadOnlyField/USAGE.md +52 -0
- package/src/components/SegmentedControl/USAGE.md +56 -0
- package/src/components/Slider/USAGE.md +86 -0
- package/src/components/Stack/USAGE.md +48 -0
- package/src/components/Stepper/USAGE.md +41 -0
- package/src/components/Switch/USAGE.md +65 -0
- package/src/components/Table/USAGE.md +51 -0
- package/src/components/Tabs/USAGE.md +45 -0
- package/src/components/Text/USAGE.md +40 -0
- package/src/components/TextArea/USAGE.md +48 -0
- package/src/components/TextField/USAGE.md +60 -0
- package/src/components/TimePicker/USAGE.md +36 -0
- package/src/components/Timeline/USAGE.md +57 -0
- package/src/components/Title/USAGE.md +36 -0
- package/src/components/Toast/USAGE.md +80 -0
- package/src/components/Tooltip/USAGE.md +124 -0
- package/src/components/TransferList/USAGE.md +46 -0
- package/src/components/Tree/USAGE.md +46 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Popover - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Popover` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Popover } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Popover } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<Popover position="bottom" withArrow>
|
|
24
|
+
<Popover.Target>
|
|
25
|
+
<Button>Open Popover</Button>
|
|
26
|
+
</Popover.Target>
|
|
27
|
+
<Popover.Dropdown>
|
|
28
|
+
<Text size="sm">This is the popover content.</Text>
|
|
29
|
+
</Popover.Dropdown>
|
|
30
|
+
</Popover>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 3. Design System Integration
|
|
38
|
+
|
|
39
|
+
All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
|
|
40
|
+
|
|
41
|
+
> [!IMPORTANT]
|
|
42
|
+
>
|
|
43
|
+
> - **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.
|
|
44
|
+
> - **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.
|
|
45
|
+
> - **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.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 4. Key Integration Features & Constraints
|
|
50
|
+
|
|
51
|
+
## 1. Composable API Preservation (1:1 Mapping)
|
|
52
|
+
|
|
53
|
+
**Decision:** We maintain the exact library composition API structure (`<Popover>`, `<Popover.Target>`, `<Popover.Dropdown>`) as a 1:1 React component mapping.
|
|
54
|
+
|
|
55
|
+
**Implementation:** Mantine's Popover internally manages click detection, open/close state, Floating UI positioning, and portal rendering. By preserving the exact sub-component tree, Recursica safely inherits all of these behaviors without reimplementation.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 2. Popover.Target Pass-Through
|
|
60
|
+
|
|
61
|
+
**Decision:** `Popover.Target` is a transparent pass-through with no styling applied.
|
|
62
|
+
|
|
63
|
+
**Implementation:** The target wrapper exists solely to manage Mantine's ref forwarding and event binding for the trigger element. No `filterStylingProps` or CSS module classes are applied — the trigger's appearance is entirely controlled by whatever component the integrator places inside it (e.g., `<Button>`). This is identical to the `Menu.Target` and `HoverCard.Target` pattern.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 3. Token Namespace: `hover-card-popover`
|
|
68
|
+
|
|
69
|
+
**Decision:** The CSS module exclusively uses variables from the `--recursica_ui-kit_components_hover-card-popover_*` namespace.
|
|
70
|
+
|
|
71
|
+
**Implementation:** The Recursica token system defines a single shared namespace (`hover-card-popover`) for this component and HoverCard. It covers geometry (border-radius, border-size, padding, min/max-width), typography (content-text\_\*), elevation, and layer-aware colors (background, border-color, content).
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 4. Hardcoded Values
|
|
76
|
+
|
|
77
|
+
**Decision:** Two hardcoded values exist in the component.
|
|
78
|
+
|
|
79
|
+
### `border-style: solid` (CSS module)
|
|
80
|
+
|
|
81
|
+
Mantine renders the dropdown using its `Paper` component, which does not set `border-style` natively. Without this hardcoded value, the border-width and border-color tokens would have no visible effect. This is the same pattern used in the Menu component's dropdown.
|
|
82
|
+
|
|
83
|
+
### `arrowSize` defaulted to `16` (Popover.tsx)
|
|
84
|
+
|
|
85
|
+
Mantine's `arrowSize` prop is a JavaScript number used for inline style calculations: it sets `width`, `height`, and a positioning offset (`-arrowSize/2`) directly on the arrow `<div>` element. These inline styles **cannot** be overridden via CSS without `!important`, and the positioning offset has no CSS equivalent. This means the beak size cannot be fully CSS-driven — it is one of the rare cases where a design token value must be mirrored as a JS prop.
|
|
86
|
+
|
|
87
|
+
The default value `16` matches the Recursica `beak-size` token (`--recursica_ui-kit_components_hover-card-popover_properties_beak-size: 16px`). Developers can override `arrowSize` if needed, but should be aware this is a design system concern. If the token value changes, the default in `Popover.tsx` must also be updated.
|
|
88
|
+
|
|
89
|
+
This is documented as an open issue in `docs/COMPONENT_ISSUES.md`.
|
|
90
|
+
|
|
91
|
+
**Note:** Mantine calls this the "arrow"; Recursica calls it the "beak". The Recursica prop `withBeak` (defaulting to `true`) maps to Mantine's `withArrow`. Both `withBeak` and `withArrow` are accepted; `withBeak` takes precedence.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 5. Minimal CSS Override Philosophy
|
|
96
|
+
|
|
97
|
+
**Decision:** The CSS module only overrides visual design tokens (colors, typography, spacing, borders, shadows). All structural layout properties are deferred to Mantine's native behavior.
|
|
98
|
+
|
|
99
|
+
**Implementation:** Popover is an overlay component where Mantine's native Floating UI positioning and Paper layout are already correct. We avoid setting:
|
|
100
|
+
|
|
101
|
+
- `overflow` on the dropdown (Mantine handles scroll behavior natively)
|
|
102
|
+
- `display`, `position`, `z-index` (Floating UI controls these)
|
|
103
|
+
- `pointer-events` (Mantine manages hover detection across target and dropdown)
|
|
104
|
+
|
|
105
|
+
**Rationale:** Default to Mantine's native behavior and only override what the Recursica token system explicitly needs to control.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 6. ClassNames Merging on Root
|
|
110
|
+
|
|
111
|
+
**Decision:** The root `Popover` component binds CSS module classes via `classNames` on the Mantine root.
|
|
112
|
+
|
|
113
|
+
**Implementation:** The root component receives `classNames={{ dropdown: styles.dropdown, arrow: styles.arrow }}` and merges any consumer-provided `classNames` when `overStyled` is true. This ensures our token-driven styles are applied to the dropdown panel without wrapper divs, and the consumer's classes are additive.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 7. Default Position Override
|
|
118
|
+
|
|
119
|
+
**Decision:** Recursica defaults `position` to `"top"`. Mantine defaults to `"bottom"`.
|
|
120
|
+
|
|
121
|
+
**Implementation:** The `position="top"` default is set on the Mantine root element before the prop spread, so developer-provided `position` values still take precedence. This aligns with Recursica's design intent for overlay components to appear above their trigger by default.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Radio - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Radio` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Radio } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Radio } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return <Radio label="Option 1" name="radio-group" value="1" 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.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# ReadOnlyField - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `ReadOnlyField` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { ReadOnlyField } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { ReadOnlyField } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return <ReadOnlyField label="API Key" value="sk_test_123456789" copyable />;
|
|
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
|
+
## 1. Stripping Mantine Assumptions
|
|
43
|
+
|
|
44
|
+
Unlike standard input variables, standard HTML output `<p>` tags inherently carry margin and spacing assumptions from core browser stylesheets. To correctly map `ReadOnlyTextField` elements gracefully inside the generic `FormControlWrapper` bounded context, we hardcode resets:
|
|
45
|
+
|
|
46
|
+
- `margin: 0` explicitly strips block flow gap so `FormControlWrapper` handles vertical rhythm.
|
|
47
|
+
- `min-height`: Native `Input` boxes typically have baseline padding borders. We map directly to `var(--recursica_ui-kit_components_read-only-field_properties_min-height)` to ensure a side-by-side editable `TextField` and `ReadOnlyField` perfectly share roughly identical visual heights.
|
|
48
|
+
|
|
49
|
+
## 2. Unidirectional Editable Mode
|
|
50
|
+
|
|
51
|
+
The main wrapper intercepts `readOnly` boolean blocks, maintaining its own `isReadOnly` state. Natively, if a user clicks an exposed 'Edit' action (like our legacy SVG or custom `labelActionArea`), the context permanently switches to active.
|
|
52
|
+
There is intentionally no built-in reverse toggle inside typical field bindings (like input "Blur") to revert state. Parents must pass external controls to `readOnly` forcing the internal hooks to reset via standard `useEffect` propagation.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# SegmentedControl - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `SegmentedControl` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { SegmentedControl } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { SegmentedControl } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return <SegmentedControl data={["Preview", "Code", "Edit"]} />;
|
|
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
|
+
## 1. Stripping Mantine's Native Variants and Sizes
|
|
43
|
+
|
|
44
|
+
The Figma design tokens for the SegmentedControl component do not define nested layers of variants (such as `solid`, `outline`) or specific sizing steps (`xs`, `sm`, etc.). They are defined globally. Therefore, we explicitly `Omit` the standard `variant`, `size`, `radius`, and `color` props from the generic Mantine `SegmentedControlProps` interface.
|
|
45
|
+
|
|
46
|
+
## 2. Hardcoded Overrides for Figma Strictness
|
|
47
|
+
|
|
48
|
+
Mantine injects inline hover styles on `.label` (specifically, adding a subtle gray background when hovering). Since Recursica defines explicit transparent or specifically-driven hover states, we use `!important` tags within `SegmentedControl.module.css` for background and typography overriding.
|
|
49
|
+
|
|
50
|
+
## 3. Divider Separators
|
|
51
|
+
|
|
52
|
+
Mantine uses an `::before` pseudo-element on the `.control` block to draw standard visual separators between adjacent elements. Instead of stripping this functionality out, we hook directly into the pseudo-element and override its `background-color` with `--recursica_ui-kit_components_segmented-control_properties_colors_divider-color`.
|
|
53
|
+
|
|
54
|
+
## 4. Indicator Mapping
|
|
55
|
+
|
|
56
|
+
The moving active background element (`.indicator`) is decoupled from the actual text label. It is styled natively with its own background color, border size, and elevation shadow variables to match the exact visual parity of a "floating active chip" as defined in the Recursica properties map.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Slider - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Slider` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Slider } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Slider } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return <Slider defaultValue={50} min={0} max={100} label="Volume" />;
|
|
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
|
+
## 1. Bidirectional State Synchronization
|
|
43
|
+
|
|
44
|
+
**Decision:** Maintain a highly responsive, bidirectional connection between the sliding track value and the adjacent numeric text input.
|
|
45
|
+
**Implementation:**
|
|
46
|
+
|
|
47
|
+
- The slider track requires a clean `number` state, whereas the text box requires a `string` state (`inputValue`) to allow typing intermediate characters like decimals (`2.`), negative signs (`-`), or empty text without breaking standard React input binding.
|
|
48
|
+
- A `useEffect` hook continuously feeds the outer numeric state changes back into the text input value as a string representation.
|
|
49
|
+
- Input changes instantly parsed as float clamp bounds securely. On blur (`onBlur`), the input state is automatically sanitized and reset to the clean, clamped string representation of the final track value.
|
|
50
|
+
|
|
51
|
+
## 2. Outer Form Control Wrapper Integration
|
|
52
|
+
|
|
53
|
+
**Decision:** Bypass Mantine's native `Input.Wrapper` and `label` properties.
|
|
54
|
+
**Implementation:**
|
|
55
|
+
|
|
56
|
+
- Universal form wrappers like `<FormControlWrapper>` and `<WithReadOnlyWrapper>` handle the outer layout architecture, including labels, assistive text, error states, and optional edit-triggering fields.
|
|
57
|
+
- Therefore, we map the outer form label directly to the `label` property of the `Slider` (delegated to the wrapper), and rename Mantine's internal dragging tooltip label property to `tooltipLabel`.
|
|
58
|
+
|
|
59
|
+
## 3. Custom Min-Max Labels and Step Indicators
|
|
60
|
+
|
|
61
|
+
**Decision:** Enforce rigid typography tokens on lower bounds and custom mark indicators.
|
|
62
|
+
**Implementation:**
|
|
63
|
+
|
|
64
|
+
- Mantine's native mark and step structures are fully styles-mapped back to our scoped variables in `Slider.module.css`.
|
|
65
|
+
- Min and Max numeric guides are rendered directly to the left and right of the slider track, centered vertically and spaced automatically using standard input gaps, while dynamically fetching custom typography tokens for min-max labels to avoid hardcoded formatting constraints.
|
|
66
|
+
|
|
67
|
+
## 4. Visual Overrides for Stacked and Side-by-Side Spacing
|
|
68
|
+
|
|
69
|
+
**Decision:** Enforce layout margins dynamically based on container orientation parameters.
|
|
70
|
+
**Implementation:**
|
|
71
|
+
|
|
72
|
+
- Using custom layouts (e.g. `stacked` and `side-by-side`), we override the margins by assigning the component-specific Figma spacing variables to the unified `--form-control-margin-bottom` property.
|
|
73
|
+
|
|
74
|
+
## 5. Right-Aligned Floating Current Value
|
|
75
|
+
|
|
76
|
+
**Decision:** Position the current active value of the slider directly above the max guide (or right-side element) on the right side of the track.
|
|
77
|
+
**Implementation:**
|
|
78
|
+
|
|
79
|
+
- Wrap the max guide element in a relative layout container (`.rightGuideContainer`) to provide a positioning anchor.
|
|
80
|
+
- Place the active value element (`.currentValue`) inside `.rightGuideContainer` and position it absolutely (`bottom: calc(100% + var(--recursica_ui-kit_globals_form_properties_label-field-gap-vertical, 8px))`, `right: 0`).
|
|
81
|
+
- This absolute positioning strategy guarantees that the active value floats cleanly above the track's right side, while aligning it vertically on the Y-axis to sit in perfect baseline alignment with the component's left-aligned form label.
|
|
82
|
+
- Set typography using the Figma-aligned component-specific read-only value variables (`--recursica_ui-kit_components_slider_properties_read-only-value_...`).
|
|
83
|
+
- Allow the text color of both the floating current value (`.currentValue`) and the component's read-only value (`.readOnlyValue`) to naturally inherit from their parent states/form globals, automatically supporting default (`--form-field-text-valued`), disabled (`--form-field-disabled-text`), and error colors without explicit color overrides, matching the min/max guides.
|
|
84
|
+
- If `showInput` is enabled, the floating `.currentValue` is hidden since the active value is already displayed and editable within the adjacent numeric text input, avoiding visual redundancy.
|
|
85
|
+
- In `side-by-side` form layouts, the `.currentValue` is positioned inline (static positioning) to the right of the max label rather than floating above it, centered vertically with the max label and aligned right to the container. This uses CSS flexbox ordering (`order: 2` for `.currentValue` and `order: 1` for `.minMaxGuide`) to visually swap their positions while preserving clean, semantic DOM ordering.
|
|
86
|
+
- To ensure perfect, pixel-perfect vertical track alignment between sliders that show numeric text inputs (`showInput={true}`) and sliders that display the active inline value (`showInput={false}`), the `.currentValue` element is globally given a width equal to the input width (`var(--recursica_ui-kit_components_slider_properties_input-width)`) and right-aligned (`text-align: right`). In `side-by-side` layouts, `.rightGuideContainer`'s flex gap is also matched to the horizontal input-to-track gap (`var(--recursica_ui-kit_components_slider_properties_input-gap)`), making the horizontal space occupied by the rightmost elements exactly identical in both component modes.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Stack - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Stack` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Stack } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Stack } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<Stack gap="md" align="stretch">
|
|
24
|
+
<Text>Item 1</Text>
|
|
25
|
+
<Text>Item 2</Text>
|
|
26
|
+
</Stack>
|
|
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**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
|
|
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**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 4. Key Integration Features & Constraints
|
|
46
|
+
|
|
47
|
+
The `Stack` component is a generic flex layout wrapper mapped directly to Mantine's `Stack`.
|
|
48
|
+
It currently does not require any custom logical layouts or CSS workarounds since it serves only to organize layout structure, and doesn't enforce any strict design-system token styling itself. All gap, align, and justify properties pass safely through via the `filterStylingProps` layout-property allowance.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Stepper - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Stepper` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Stepper } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Stepper } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<Stepper active={1}>
|
|
24
|
+
<Stepper.Step label="First step" description="Create account" />
|
|
25
|
+
<Stepper.Step label="Second step" description="Verify email" />
|
|
26
|
+
</Stepper>
|
|
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**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
|
|
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**: 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,65 @@
|
|
|
1
|
+
# Switch - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Switch` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Switch } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Switch } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return <Switch label="Enable notifications" 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
|
+
## 1. Stripping Mantine's Size Engine
|
|
43
|
+
|
|
44
|
+
Mantine uses properties like `size`, `color`, and `radius` to dynamically map CSS layout values across its `.track` and `.thumb` nodes. We proactively strip and delete these properties using `filterStylingProps` to entirely neutralize this native behavior.
|
|
45
|
+
|
|
46
|
+
## 2. Hardcoded Values & Transitions
|
|
47
|
+
|
|
48
|
+
Mantine injects dynamic width/height attributes into its switch through inline CSS variables (e.g. `--switch-height`). To strictly enforce the UI Kit tokens without breaking Mantine's internal math, our `Switch.module.css` structurally remaps Mantine's internal variables explicitly:
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
--switch-width: var(--switch-track-width);
|
|
52
|
+
--switch-height: calc(
|
|
53
|
+
var(--switch-thumb-height) + (var(--switch-track-padding) * 2)
|
|
54
|
+
);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
We also hardcode `border: none` since the UI kit designs rely purely on box-shadow elevations and background color tracking. Mantine’s default border logic is entirely disabled.
|
|
58
|
+
|
|
59
|
+
## 3. ReadOnly Behavior
|
|
60
|
+
|
|
61
|
+
Similar to `Checkbox`, the `Switch` component handles `readOnly` presentation by dropping the entire underlying node tree and falling back structurally onto `<FormControlWrapper>` when `readOnly: true`. This strictly preserves exact baseline alignment across all primitives without trying to hack disabled CSS to look like read-only text.
|
|
62
|
+
|
|
63
|
+
## 4. Hover State Reset
|
|
64
|
+
|
|
65
|
+
Mantine forcefully triggers track hover color states globally. Since Recursica currently does not map specific hover states to switch backgrounds across themes (falling back to standard unselected tokens or simply providing a cursor), we structurally wipe out Mantine's `.track:hover` class block inside `Switch.module.css`.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Table - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Table` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Table } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { Table } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<Table>
|
|
24
|
+
<Table.Thead>
|
|
25
|
+
<Table.Tr>
|
|
26
|
+
<Table.Th>Name</Table.Th>
|
|
27
|
+
<Table.Th>Email</Table.Tr>
|
|
28
|
+
</Table.Tr>
|
|
29
|
+
</Table.Thead>
|
|
30
|
+
<Table.Tbody>
|
|
31
|
+
<Table.Tr>
|
|
32
|
+
<Table.Td>Jane Doe</Table.Tr>
|
|
33
|
+
<Table.Td>jane@example.com</Table.Tr>
|
|
34
|
+
</Table.Tr>
|
|
35
|
+
</Table.Tbody>
|
|
36
|
+
</Table>
|
|
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.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Tabs - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Tabs` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Tabs } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Tabs } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<Tabs defaultValue="home">
|
|
24
|
+
<Tabs.List>
|
|
25
|
+
<Tabs.Tab value="home">Home</Tabs.Tab>
|
|
26
|
+
<Tabs.Tab value="profile">Profile</Tabs.Tab>
|
|
27
|
+
</Tabs.List>
|
|
28
|
+
<Tabs.Panel value="home">Home content</Tabs.Panel>
|
|
29
|
+
<Tabs.Panel value="profile">Profile content</Tabs.Panel>
|
|
30
|
+
</Tabs>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 3. Design System Integration
|
|
38
|
+
|
|
39
|
+
All Recursica components in the `@recursica/mantine-adapter` package adhere strictly to design system spacing, scaling, and behavior patterns.
|
|
40
|
+
|
|
41
|
+
> [!IMPORTANT]
|
|
42
|
+
>
|
|
43
|
+
> - **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.
|
|
44
|
+
> - **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.
|
|
45
|
+
> - **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,40 @@
|
|
|
1
|
+
# Text - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Text` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Text } from "@recursica/mantine-adapter";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Text } from "@recursica/mantine-adapter";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<Text size="md" color="dimmed">
|
|
24
|
+
This is some styled body text.
|
|
25
|
+
</Text>
|
|
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.
|