@recursica/mantine-adapter 0.50.2 → 0.50.4
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 +20 -0
- package/dist/index.d.ts +107 -139
- package/dist/mantine-adapter.cjs +1 -1
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.css +1 -1
- package/dist/mantine-adapter.js +4 -3
- package/dist/mantine-adapter.js.map +1 -1
- package/package.json +5 -4
- package/src/components/Accordion/Accordion.test.tsx +1 -0
- package/src/components/AssistiveElement/AssistiveElement.test.tsx +1 -0
- package/src/components/AutoComplete/AutoComplete.test.tsx +1 -0
- package/src/components/Avatar/Avatar.test.tsx +1 -0
- package/src/components/Badge/Badge.test.tsx +1 -0
- package/src/components/Breadcrumb/Breadcrumb.test.tsx +1 -0
- package/src/components/Button/Button.module.css +1 -0
- package/src/components/Button/Button.styleIsolation.dom.test.tsx +98 -0
- package/src/components/Button/IMPLEMENTATION_NOTES.md +2 -0
- package/src/components/Card/Card.test.tsx +1 -0
- package/src/components/Checkbox/Checkbox.test.tsx +1 -0
- package/src/components/Chip/Chip.test.tsx +1 -0
- package/src/components/Container/Container.test.tsx +1 -0
- package/src/components/DatePicker/DatePicker.test.tsx +1 -0
- package/src/components/Dropdown/Dropdown.test.tsx +1 -0
- package/src/components/FileInput/FileInput.test.tsx +1 -0
- package/src/components/FileUpload/FileUpload.test.tsx +1 -0
- package/src/components/Flex/Flex.test.tsx +1 -0
- package/src/components/Flex/Flex.tsx +5 -5
- package/src/components/FormControlLayout/FormControlLayout.test.tsx +1 -0
- package/src/components/FormControlWrapper/FormControlWrapper.test.tsx +1 -0
- package/src/components/Grid/GRID_IMPLEMENTATION_NOTES.md +2 -2
- package/src/components/Grid/Grid.stories.tsx +11 -11
- package/src/components/Grid/Grid.test.tsx +1 -0
- package/src/components/Grid/Grid.tsx +10 -15
- package/src/components/Grid/USAGE.md +3 -3
- package/src/components/Group/Group.test.tsx +1 -0
- package/src/components/Group/Group.tsx +5 -5
- package/src/components/HoverCard/HoverCard.test.tsx +1 -0
- package/src/components/Label/Label.test.tsx +1 -0
- package/src/components/Link/Link.test.tsx +1 -0
- package/src/components/Loader/Loader.test.tsx +1 -0
- package/src/components/Menu/Menu.test.tsx +1 -0
- package/src/components/Modal/Modal.test.tsx +1 -0
- package/src/components/NumberInput/NumberInput.test.tsx +1 -0
- package/src/components/Pagination/Pagination.test.tsx +1 -0
- package/src/components/Panel/Panel.test.tsx +1 -0
- package/src/components/Popover/Popover.test.tsx +1 -0
- package/src/components/Radio/Radio.test.tsx +1 -0
- package/src/components/ReadOnlyField/ReadOnlyField.test.tsx +1 -0
- package/src/components/SegmentedControl/SegmentedControl.test.tsx +1 -0
- package/src/components/Slider/Slider.test.tsx +1 -0
- package/src/components/Stack/Stack.test.tsx +1 -0
- package/src/components/Stack/Stack.tsx +5 -5
- package/src/components/Stepper/Stepper.test.tsx +1 -0
- package/src/components/Switch/Switch.test.tsx +1 -0
- package/src/components/Table/Table.test.tsx +1 -0
- package/src/components/Tabs/Tabs.test.tsx +1 -0
- package/src/components/Text/Text.stories.tsx +3 -16
- package/src/components/Text/Text.test.tsx +1 -0
- package/src/components/TextArea/TextArea.test.tsx +1 -0
- package/src/components/TextField/TextField.test.tsx +1 -0
- package/src/components/TimePicker/TimePicker.test.tsx +1 -0
- package/src/components/Timeline/Timeline.test.tsx +1 -0
- package/src/components/Title/Title.stories.tsx +3 -16
- package/src/components/Title/Title.test.tsx +1 -0
- package/src/components/Toast/Toast.test.tsx +1 -0
- package/src/components/Tooltip/Tooltip.test.tsx +1 -0
- package/src/components/TransferList/TransferList.test.tsx +1 -0
- package/src/components/Tree/Tree.test.tsx +1 -0
- package/src/utils/filterStylingProps.test.ts +85 -0
- package/src/utils/filterStylingProps.ts +1 -0
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.50.
|
|
16
|
+
"version": "0.50.4",
|
|
17
17
|
"type": "module",
|
|
18
18
|
"main": "./dist/mantine-adapter.cjs",
|
|
19
19
|
"module": "./dist/mantine-adapter.js",
|
|
@@ -55,10 +55,11 @@
|
|
|
55
55
|
"lint": "eslint .",
|
|
56
56
|
"storybook": "storybook dev -p 6011",
|
|
57
57
|
"analyze-tokens": "analyze-tokens --css @recursica/official-release/recursica_variables_scoped.css --dir src/components --output token-analysis.json",
|
|
58
|
-
"prebuild": "npm run analyze-tokens"
|
|
58
|
+
"prebuild": "npm run analyze-tokens",
|
|
59
|
+
"test": "vitest run --project unit",
|
|
60
|
+
"test:dom": "vitest run --project dom"
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
|
-
"@chromatic-com/storybook": "^5.1.1",
|
|
62
63
|
"@eslint/js": "^9.25.0",
|
|
63
64
|
"@recursica/recursica-postcss-vars": "*",
|
|
64
65
|
"@recursica/storybook-template": "*",
|
|
@@ -94,7 +95,7 @@
|
|
|
94
95
|
"vitest": "^3.2.4"
|
|
95
96
|
},
|
|
96
97
|
"dependencies": {
|
|
97
|
-
"@recursica/adapter-common": "^0.25.
|
|
98
|
+
"@recursica/adapter-common": "^0.25.1",
|
|
98
99
|
"@recursica/official-release": "^2.8.0"
|
|
99
100
|
},
|
|
100
101
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Accordion component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future AssistiveElement component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future AutoComplete component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Avatar component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Badge component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Breadcrumb component tests. Add tests here if/when needed.
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
position: relative;
|
|
25
25
|
transition: all 0.2s ease;
|
|
26
26
|
width: fit-content; /* Prevent stretching in flex columns */
|
|
27
|
+
max-width: 100%; /* Let a constraining parent (e.g. max-width container) actually shrink the button; fit-content alone ignores it */
|
|
27
28
|
|
|
28
29
|
/* Shared Defaults */
|
|
29
30
|
font-family: var(
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { describe, it, expect } from "vitest";
|
|
3
|
+
import { createRoot, type Root } from "react-dom/client";
|
|
4
|
+
import { flushSync } from "react-dom";
|
|
5
|
+
import { MantineProvider, Button as MantineButton } from "@mantine/core";
|
|
6
|
+
import { Button as RecursicaButton } from "./Button";
|
|
7
|
+
|
|
8
|
+
function mount(node: React.ReactElement): {
|
|
9
|
+
container: HTMLElement;
|
|
10
|
+
root: Root;
|
|
11
|
+
} {
|
|
12
|
+
const container = document.createElement("div");
|
|
13
|
+
document.body.appendChild(container);
|
|
14
|
+
const root = createRoot(container);
|
|
15
|
+
flushSync(() => root.render(node));
|
|
16
|
+
return { container, root };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function unmount({ container, root }: { container: HTMLElement; root: Root }) {
|
|
20
|
+
root.unmount();
|
|
21
|
+
container.remove();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function withProvider(node: React.ReactElement) {
|
|
25
|
+
return <MantineProvider defaultColorScheme="light">{node}</MantineProvider>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Guards against Recursica's Button CSS bleeding onto (or being bled onto by) a plain,
|
|
30
|
+
* unwrapped Mantine Button rendered in the same document. The two must be visibly different
|
|
31
|
+
* (Recursica's own classes/data-attributes), but the plain kit button must render identically
|
|
32
|
+
* whether or not a Recursica Button exists alongside it.
|
|
33
|
+
*/
|
|
34
|
+
describe("Button style isolation from the underlying Mantine kit", () => {
|
|
35
|
+
it("adds Recursica-only classes/attributes without leaking them onto a plain Mantine Button", () => {
|
|
36
|
+
const recursica = mount(
|
|
37
|
+
withProvider(<RecursicaButton>Recursica</RecursicaButton>),
|
|
38
|
+
);
|
|
39
|
+
const kit = mount(withProvider(<MantineButton>Plain</MantineButton>));
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const recursicaButton = recursica.container.querySelector("button")!;
|
|
43
|
+
const kitButton = kit.container.querySelector("button")!;
|
|
44
|
+
|
|
45
|
+
const recursicaClasses = Array.from(recursicaButton.classList);
|
|
46
|
+
const kitClasses = new Set(kitButton.classList);
|
|
47
|
+
const recursicaOnlyClasses = recursicaClasses.filter(
|
|
48
|
+
(cls) => !kitClasses.has(cls),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Recursica's Button.module.css classes must exist...
|
|
52
|
+
expect(recursicaOnlyClasses.length).toBeGreaterThan(0);
|
|
53
|
+
// ...and none of them are present on the plain kit button.
|
|
54
|
+
for (const cls of recursicaOnlyClasses) {
|
|
55
|
+
expect(kitButton.classList.contains(cls)).toBe(false);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Recursica-only markers confirm the two are meaningfully different components.
|
|
59
|
+
expect(recursicaButton.getAttribute("data-variant")).toBe("solid");
|
|
60
|
+
expect(kitButton.getAttribute("data-variant")).toBeNull();
|
|
61
|
+
} finally {
|
|
62
|
+
unmount(recursica);
|
|
63
|
+
unmount(kit);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("renders a plain Mantine Button identically whether or not Recursica's Button is mounted alongside it", () => {
|
|
68
|
+
const recursica = mount(
|
|
69
|
+
withProvider(<RecursicaButton>Recursica</RecursicaButton>),
|
|
70
|
+
);
|
|
71
|
+
const kitAlongsideRecursica = mount(
|
|
72
|
+
withProvider(<MantineButton>Plain</MantineButton>),
|
|
73
|
+
);
|
|
74
|
+
const kitIsolated = mount(
|
|
75
|
+
withProvider(<MantineButton>Plain</MantineButton>),
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
try {
|
|
79
|
+
const kitButton =
|
|
80
|
+
kitAlongsideRecursica.container.querySelector("button")!;
|
|
81
|
+
const isolatedButton = kitIsolated.container.querySelector("button")!;
|
|
82
|
+
|
|
83
|
+
expect(Array.from(kitButton.classList).sort()).toEqual(
|
|
84
|
+
Array.from(isolatedButton.classList).sort(),
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const kitStyle = getComputedStyle(kitButton);
|
|
88
|
+
const isolatedStyle = getComputedStyle(isolatedButton);
|
|
89
|
+
expect(kitStyle.borderRadius).toBe(isolatedStyle.borderRadius);
|
|
90
|
+
expect(kitStyle.backgroundColor).toBe(isolatedStyle.backgroundColor);
|
|
91
|
+
expect(kitStyle.fontFamily).toBe(isolatedStyle.fontFamily);
|
|
92
|
+
} finally {
|
|
93
|
+
unmount(recursica);
|
|
94
|
+
unmount(kitAlongsideRecursica);
|
|
95
|
+
unmount(kitIsolated);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
@@ -38,6 +38,8 @@ Mantine's `.mantine-Button-label` flex centering breaks primitive truncation log
|
|
|
38
38
|
- The structural children wrap into `<span className={styles.labelText}>`.
|
|
39
39
|
- **`.labelText`** binds `overflow: hidden; text-overflow: ellipsis; white-space: nowrap;` creating flawless string cutoffs strictly at exact UI constraints.
|
|
40
40
|
|
|
41
|
+
**Bug found (2026-08-27):** none of the above clips the button itself against a _constraining ancestor_ (e.g. `<div style={{ maxWidth: 250 }}>` — see the `TruncatedLabel` story). `.root` uses `width: fit-content` so it hugs its own content when unconstrained, but `fit-content` on this box doesn't reliably resize down against a narrower parent's resolved width — verified via Playwright: the button rendered at its full 534px `max-content` width and visually overflowed the 250px wrapper, even though the wrapper itself measured 250px. `max-width: 100%` on `.root` (percentage of the actual containing block) fixes it — it doesn't fight `width: fit-content` for the normal unconstrained case, it only kicks in when the parent is narrower than the content's intrinsic width.
|
|
42
|
+
|
|
41
43
|
---
|
|
42
44
|
|
|
43
45
|
## Disabled state: brand theme opacity (implicit)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Card component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Checkbox component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Chip component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Container component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future DatePicker component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Dropdown component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future FileInput component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future FileUpload component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Flex component tests. Add tests here if/when needed.
|
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
} from "../../utils/filterStylingProps";
|
|
11
11
|
import styles from "./Flex.module.css";
|
|
12
12
|
|
|
13
|
-
import { type RecursicaFlexProps } from "@recursica/adapter-common";
|
|
14
|
-
|
|
15
13
|
/**
|
|
16
14
|
* Flex layout wrapper.
|
|
17
15
|
*
|
|
18
16
|
* Note: Unlike complex UI components, primitive layout components (Flex, Stack, Group, Container)
|
|
19
17
|
* DO NOT use the `RecursicaOverStyled` gatekeeper. Developers must be able to freely pass
|
|
20
18
|
* width, height, padding, margins, and flexbox alignment props to construct structural layouts.
|
|
19
|
+
*
|
|
20
|
+
* No formal Recursica prop contract here: this simply passes through Mantine's own
|
|
21
|
+
* `FlexProps` (gap/rowGap/columnGap/direction/align/justify/wrap are all native to Mantine),
|
|
22
|
+
* layered only with rec- spacing token support via `WithRecursicaSpacing`.
|
|
21
23
|
*/
|
|
22
|
-
export type FlexProps = WithRecursicaSpacing<
|
|
23
|
-
MantineFlexProps & RecursicaFlexProps
|
|
24
|
-
>;
|
|
24
|
+
export type FlexProps = WithRecursicaSpacing<MantineFlexProps>;
|
|
25
25
|
|
|
26
26
|
const _Flex = forwardRef<HTMLDivElement, FlexProps>(function Flex(
|
|
27
27
|
{ children, gap = "rec-default", rowGap, columnGap, ...rest },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future FormControlLayout component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future FormControlWrapper component tests. Add tests here if/when needed.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The `Grid` component is a generic 12-column (by default) layout wrapper mapped directly to Mantine's `Grid`/`Grid.Col`. It requires no custom logical layouts or CSS workarounds — Mantine handles column geometry, breakpoints, and wrapping natively.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Per the layout-components rule (no formal Recursica common props definition — these simply pass through the underlying kit's own props), `Grid` and `Grid.Col` are typed directly off Mantine's own `GridProps`/`GridColProps` with no Recursica-specific prop renaming. The public prop for spacing between columns is Mantine's own `gutter` (previously renamed to `gap` for cross-component consistency — that rename has been reverted since it wasn't a real Mantine prop). `gutter` still accepts `rec-*` spacing tokens, resolved via `mapLayoutProps`, the same utility used elsewhere.
|
|
6
6
|
|
|
7
|
-
`Grid.Col`'s `span`, `offset`, `order`, `visibleFrom`, and `hiddenFrom` props are passed straight through to Mantine's `Grid.Col` unchanged
|
|
7
|
+
`Grid.Col`'s `span`, `offset`, `order`, `visibleFrom`, and `hiddenFrom` props are passed straight through to Mantine's `Grid.Col` unchanged, using Mantine's own breakpoint scale (`xs`/`sm`/`md`/`lg`/`xl` — there is no `base` breakpoint in Mantine; `xs` is the smallest).
|
|
8
8
|
|
|
9
9
|
Like the other primitive layout components, `Grid` and `Grid.Col` use `WithRecursicaSpacing<T>` rather than `RecursicaOverStyled<T>` and are listed in the "Primitive Layout Components Exemption" section of `OVERSTYLING.md`.
|
|
@@ -19,12 +19,12 @@ const meta: Meta<GridStoryProps> = {
|
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
args: {
|
|
22
|
-
|
|
22
|
+
gutter: "rec-default",
|
|
23
23
|
columns: 12,
|
|
24
24
|
grow: false,
|
|
25
25
|
},
|
|
26
26
|
argTypes: {
|
|
27
|
-
|
|
27
|
+
gutter: {
|
|
28
28
|
control: "select",
|
|
29
29
|
options: [
|
|
30
30
|
"rec-none",
|
|
@@ -35,7 +35,7 @@ const meta: Meta<GridStoryProps> = {
|
|
|
35
35
|
"rec-xl",
|
|
36
36
|
"rec-2xl",
|
|
37
37
|
],
|
|
38
|
-
description: "
|
|
38
|
+
description: "Gutter between columns",
|
|
39
39
|
},
|
|
40
40
|
columns: {
|
|
41
41
|
control: "number",
|
|
@@ -97,17 +97,17 @@ export const ResponsiveSpans: Story = {
|
|
|
97
97
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
98
98
|
render: ({ withLayer, layer, ...args }: any) => (
|
|
99
99
|
<Grid {...args}>
|
|
100
|
-
<Grid.Col span={{
|
|
101
|
-
<Swatch>
|
|
100
|
+
<Grid.Col span={{ xs: 12, sm: 6, md: 3 }}>
|
|
101
|
+
<Swatch>xs 12 / sm 6 / md 3</Swatch>
|
|
102
102
|
</Grid.Col>
|
|
103
|
-
<Grid.Col span={{
|
|
104
|
-
<Swatch>
|
|
103
|
+
<Grid.Col span={{ xs: 12, sm: 6, md: 3 }}>
|
|
104
|
+
<Swatch>xs 12 / sm 6 / md 3</Swatch>
|
|
105
105
|
</Grid.Col>
|
|
106
|
-
<Grid.Col span={{
|
|
107
|
-
<Swatch>
|
|
106
|
+
<Grid.Col span={{ xs: 12, sm: 6, md: 3 }}>
|
|
107
|
+
<Swatch>xs 12 / sm 6 / md 3</Swatch>
|
|
108
108
|
</Grid.Col>
|
|
109
|
-
<Grid.Col span={{
|
|
110
|
-
<Swatch>
|
|
109
|
+
<Grid.Col span={{ xs: 12, sm: 6, md: 3 }}>
|
|
110
|
+
<Swatch>xs 12 / sm 6 / md 3</Swatch>
|
|
111
111
|
</Grid.Col>
|
|
112
112
|
</Grid>
|
|
113
113
|
),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Grid component tests. Add tests here if/when needed.
|
|
@@ -11,24 +11,21 @@ import {
|
|
|
11
11
|
} from "../../utils/filterStylingProps";
|
|
12
12
|
import styles from "./Grid.module.css";
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
type RecursicaGridProps,
|
|
16
|
-
type RecursicaGridColProps,
|
|
17
|
-
} from "@recursica/adapter-common";
|
|
18
|
-
|
|
19
14
|
/**
|
|
20
15
|
* Grid layout wrapper.
|
|
21
16
|
*
|
|
22
17
|
* Note: Unlike complex UI components, primitive layout components (Flex, Stack, Group, Container, Grid)
|
|
23
18
|
* DO NOT use the `RecursicaOverStyled` gatekeeper. Developers must be able to freely pass
|
|
24
19
|
* width, height, padding, margins, and flexbox alignment props to construct structural layouts.
|
|
20
|
+
*
|
|
21
|
+
* No formal Recursica prop contract here: this simply passes through Mantine's own
|
|
22
|
+
* `GridProps` (gutter/grow/columns/justify/align are all native to Mantine), layered only
|
|
23
|
+
* with rec- spacing token support via `WithRecursicaSpacing`.
|
|
25
24
|
*/
|
|
26
|
-
export type GridProps = WithRecursicaSpacing<
|
|
27
|
-
Omit<MantineGridProps, "gutter"> & RecursicaGridProps
|
|
28
|
-
>;
|
|
25
|
+
export type GridProps = WithRecursicaSpacing<MantineGridProps>;
|
|
29
26
|
|
|
30
27
|
const _Grid = forwardRef<HTMLDivElement, GridProps>(function Grid(
|
|
31
|
-
{ children,
|
|
28
|
+
{ children, gutter = "rec-default", ...rest },
|
|
32
29
|
ref,
|
|
33
30
|
) {
|
|
34
31
|
const mergedClassNames: Partial<Record<string, string>> = {
|
|
@@ -50,15 +47,15 @@ const _Grid = forwardRef<HTMLDivElement, GridProps>(function Grid(
|
|
|
50
47
|
? `${styles.root} ${classNameProp}`
|
|
51
48
|
: styles.root;
|
|
52
49
|
|
|
53
|
-
const {
|
|
54
|
-
|
|
50
|
+
const { gutter: mappedGutter, ...mappedRest } = mapLayoutProps({
|
|
51
|
+
gutter,
|
|
55
52
|
...rest,
|
|
56
53
|
} as Record<string, unknown>);
|
|
57
54
|
|
|
58
55
|
return (
|
|
59
56
|
<MantineGrid
|
|
60
57
|
ref={ref}
|
|
61
|
-
gutter={
|
|
58
|
+
gutter={mappedGutter as MantineGridProps["gutter"]}
|
|
62
59
|
className={finalClass}
|
|
63
60
|
classNames={mergedClassNames}
|
|
64
61
|
{...(mappedRest as unknown as Omit<MantineGridProps, "gutter">)}
|
|
@@ -87,9 +84,7 @@ const GridBase = createPolymorphicComponent<"div", GridProps>(_Grid);
|
|
|
87
84
|
// GRID.COL
|
|
88
85
|
// ============================================================
|
|
89
86
|
|
|
90
|
-
export type GridColProps = WithRecursicaSpacing<
|
|
91
|
-
MantineGridColProps & RecursicaGridColProps
|
|
92
|
-
>;
|
|
87
|
+
export type GridColProps = WithRecursicaSpacing<MantineGridColProps>;
|
|
93
88
|
|
|
94
89
|
const _GridCol = forwardRef<HTMLDivElement, GridColProps>(function GridCol(
|
|
95
90
|
{ children, ...rest },
|
|
@@ -20,9 +20,9 @@ import { Grid } from "@recursica/mantine-adapter";
|
|
|
20
20
|
|
|
21
21
|
export default function Demo() {
|
|
22
22
|
return (
|
|
23
|
-
<Grid
|
|
23
|
+
<Grid gutter="rec-default">
|
|
24
24
|
<Grid.Col span={6}>Half width</Grid.Col>
|
|
25
|
-
<Grid.Col span={{
|
|
25
|
+
<Grid.Col span={{ xs: 12, sm: 6, md: 3 }}>Responsive width</Grid.Col>
|
|
26
26
|
</Grid>
|
|
27
27
|
);
|
|
28
28
|
}
|
|
@@ -44,4 +44,4 @@ All Recursica components in the `@recursica/mantine-adapter` package adhere stri
|
|
|
44
44
|
|
|
45
45
|
## 4. Key Integration Features & Constraints
|
|
46
46
|
|
|
47
|
-
The `Grid` component maps directly to Mantine's `Grid`/`Grid.Col
|
|
47
|
+
The `Grid` component maps directly to Mantine's `Grid`/`Grid.Col` with no Recursica-specific prop renaming — `gutter`, `columns`, `grow`, `justify`, `align` on `Grid`, and `span`, `offset`, `order`, `visibleFrom`, `hiddenFrom` on `Grid.Col` all match Mantine's own naming and accept the same shapes, including per-breakpoint objects (`{ xs, sm, md, lg, xl }`). `gutter` additionally accepts `rec-*` spacing tokens.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Group component tests. Add tests here if/when needed.
|
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
} from "../../utils/filterStylingProps";
|
|
10
10
|
import styles from "./Group.module.css";
|
|
11
11
|
|
|
12
|
-
import { type RecursicaGroupProps } from "@recursica/adapter-common";
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* Group flex layout wrapper.
|
|
16
14
|
*
|
|
17
15
|
* Note: Unlike complex UI components, primitive layout components (Flex, Stack, Group, Container)
|
|
18
16
|
* DO NOT use the `RecursicaOverStyled` gatekeeper. Developers must be able to freely pass
|
|
19
17
|
* width, height, padding, margins, and flexbox alignment props to construct structural layouts.
|
|
18
|
+
*
|
|
19
|
+
* No formal Recursica prop contract here: this simply passes through Mantine's own
|
|
20
|
+
* `GroupProps` (gap/rowGap/columnGap/justify/align/wrap are all native to Mantine),
|
|
21
|
+
* layered only with rec- spacing token support via `WithRecursicaSpacing`.
|
|
20
22
|
*/
|
|
21
|
-
export type GroupProps = WithRecursicaSpacing<
|
|
22
|
-
MantineGroupProps & RecursicaGroupProps
|
|
23
|
-
>;
|
|
23
|
+
export type GroupProps = WithRecursicaSpacing<MantineGroupProps>;
|
|
24
24
|
|
|
25
25
|
export const Group = forwardRef<HTMLDivElement, GroupProps>(function Group(
|
|
26
26
|
{ children, gap = "rec-default", ...rest },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future HoverCard component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Label component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Link component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Loader component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Menu component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Modal component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future NumberInput component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Pagination component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Panel component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Popover component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Radio component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future ReadOnlyField component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future SegmentedControl component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Slider component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Stack component tests. Add tests here if/when needed.
|
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
} from "../../utils/filterStylingProps";
|
|
11
11
|
import styles from "./Stack.module.css";
|
|
12
12
|
|
|
13
|
-
import { type RecursicaStackProps } from "@recursica/adapter-common";
|
|
14
|
-
|
|
15
13
|
/**
|
|
16
14
|
* Stack flex layout wrapper.
|
|
17
15
|
*
|
|
18
16
|
* Note: Unlike complex UI components, primitive layout components (Flex, Stack, Group, Container)
|
|
19
17
|
* DO NOT use the `RecursicaOverStyled` gatekeeper. Developers must be able to freely pass
|
|
20
18
|
* width, height, padding, margins, and flexbox alignment props to construct structural layouts.
|
|
19
|
+
*
|
|
20
|
+
* No formal Recursica prop contract here: this simply passes through Mantine's own
|
|
21
|
+
* `StackProps` (gap/align/justify are all native to Mantine), layered only with rec-
|
|
22
|
+
* spacing token support via `WithRecursicaSpacing`.
|
|
21
23
|
*/
|
|
22
|
-
export type StackProps = WithRecursicaSpacing<
|
|
23
|
-
MantineStackProps & RecursicaStackProps
|
|
24
|
-
>;
|
|
24
|
+
export type StackProps = WithRecursicaSpacing<MantineStackProps>;
|
|
25
25
|
|
|
26
26
|
const _Stack = forwardRef<HTMLDivElement, StackProps>(function Stack(
|
|
27
27
|
{ children, gap = "rec-default", ...rest },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Stepper component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Switch component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Table component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Tabs component tests. Add tests here if/when needed.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Text } from "./Text";
|
|
3
|
-
import { Layer } from "@recursica/adapter-common";
|
|
4
3
|
|
|
5
4
|
const meta: Meta<typeof Text> = {
|
|
6
5
|
title: "UI-Kit/Text",
|
|
@@ -46,25 +45,13 @@ export const Default: Story = {
|
|
|
46
45
|
children:
|
|
47
46
|
"This is standard body typography controlled by the central UI-kit boundaries exclusively.",
|
|
48
47
|
},
|
|
49
|
-
render: ({ ...args }) =>
|
|
50
|
-
<Layer layer={0} style={{ padding: "48px" }}>
|
|
51
|
-
<Text {...args} />
|
|
52
|
-
</Layer>
|
|
53
|
-
),
|
|
48
|
+
render: ({ ...args }) => <Text {...args} />,
|
|
54
49
|
};
|
|
55
50
|
|
|
56
51
|
export const StaticVariations: Story = {
|
|
57
52
|
args: {},
|
|
58
53
|
render: () => (
|
|
59
|
-
<
|
|
60
|
-
layer={0}
|
|
61
|
-
style={{
|
|
62
|
-
padding: "48px",
|
|
63
|
-
display: "flex",
|
|
64
|
-
flexDirection: "column",
|
|
65
|
-
gap: "16px",
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
54
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
68
55
|
<Text variant="body">
|
|
69
56
|
Body (Base paragraph and generic information flow)
|
|
70
57
|
</Text>
|
|
@@ -83,6 +70,6 @@ export const StaticVariations: Story = {
|
|
|
83
70
|
<Text variant="subtitle-small">
|
|
84
71
|
Subtitle Small (Section anchors deep in hierarchy)
|
|
85
72
|
</Text>
|
|
86
|
-
</
|
|
73
|
+
</div>
|
|
87
74
|
),
|
|
88
75
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Text component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future TextArea component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future TextField component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future TimePicker component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Timeline component tests. Add tests here if/when needed.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Title } from "./Title";
|
|
3
|
-
import { Layer } from "@recursica/adapter-common";
|
|
4
3
|
|
|
5
4
|
const meta: Meta<typeof Title> = {
|
|
6
5
|
title: "UI-Kit/Title",
|
|
@@ -33,31 +32,19 @@ export const Default: Story = {
|
|
|
33
32
|
order: 1,
|
|
34
33
|
children: "Semantic H1 Document Boundary",
|
|
35
34
|
},
|
|
36
|
-
render: ({ ...args }) =>
|
|
37
|
-
<Layer layer={0} style={{ padding: "48px" }}>
|
|
38
|
-
<Title {...args} />
|
|
39
|
-
</Layer>
|
|
40
|
-
),
|
|
35
|
+
render: ({ ...args }) => <Title {...args} />,
|
|
41
36
|
};
|
|
42
37
|
|
|
43
38
|
export const StaticVariations: Story = {
|
|
44
39
|
args: {},
|
|
45
40
|
render: () => (
|
|
46
|
-
<
|
|
47
|
-
layer={0}
|
|
48
|
-
style={{
|
|
49
|
-
padding: "48px",
|
|
50
|
-
display: "flex",
|
|
51
|
-
flexDirection: "column",
|
|
52
|
-
gap: "24px",
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
41
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "24px" }}>
|
|
55
42
|
<Title order={1}>H1 Title</Title>
|
|
56
43
|
<Title order={2}>H2 Title</Title>
|
|
57
44
|
<Title order={3}>H3 Title</Title>
|
|
58
45
|
<Title order={4}>H4 Title</Title>
|
|
59
46
|
<Title order={5}>H5 Title</Title>
|
|
60
47
|
<Title order={6}>H6 Title</Title>
|
|
61
|
-
</
|
|
48
|
+
</div>
|
|
62
49
|
),
|
|
63
50
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Title component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Toast component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Tooltip component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future TransferList component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Tree component tests. Add tests here if/when needed.
|