@recursica/adapter-mantine-v8 1.2.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/OVERSTYLING.md +1 -1
  3. package/SETUP.md +34 -3
  4. package/dist/adapter-mantine-v8.cjs +2 -2
  5. package/dist/adapter-mantine-v8.cjs.map +1 -1
  6. package/dist/adapter-mantine-v8.css +1 -1
  7. package/dist/adapter-mantine-v8.js +3171 -3010
  8. package/dist/adapter-mantine-v8.js.map +1 -1
  9. package/dist/index.d.ts +191 -164
  10. package/llms.txt +1 -1
  11. package/package.json +4 -4
  12. package/recursica_brand.json +2 -2
  13. package/recursica_tokens.json +2 -2
  14. package/recursica_ui-kit.json +2 -2
  15. package/recursica_variables_scoped.css +7 -3
  16. package/src/components/Checkbox/Checkbox.module.css +1 -3
  17. package/src/components/Container/USAGE.md +0 -1
  18. package/src/components/FileInput/FileInput.module.css +8 -0
  19. package/src/components/FileUpload/FileUpload.module.css +1 -0
  20. package/src/components/FileUpload/FileUpload.tsx +1 -0
  21. package/src/components/Flex/USAGE.md +2 -1
  22. package/src/components/Group/USAGE.md +2 -1
  23. package/src/components/LayoutGrid/LAYOUT_GRID_IMPLEMENTATION_NOTES.md +88 -0
  24. package/src/components/LayoutGrid/LayoutGrid.columns.dom.test.tsx +66 -0
  25. package/src/components/LayoutGrid/LayoutGrid.module.css +48 -0
  26. package/src/components/LayoutGrid/LayoutGrid.stories.tsx +61 -0
  27. package/src/components/LayoutGrid/LayoutGrid.test.tsx +1 -0
  28. package/src/components/LayoutGrid/LayoutGrid.tsx +309 -0
  29. package/src/components/LayoutGrid/USAGE.md +76 -0
  30. package/src/components/Menu/Menu.stories.tsx +0 -1
  31. package/src/components/Pagination/IMPLEMENTATION_NOTES.md +29 -8
  32. package/src/components/Pagination/Pagination.icons.tsx +0 -32
  33. package/src/components/Pagination/Pagination.manifest.dom.test.tsx +108 -0
  34. package/src/components/Pagination/Pagination.module.css +25 -155
  35. package/src/components/Pagination/Pagination.tsx +328 -197
  36. package/src/components/Pagination/USAGE.md +1 -0
  37. package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +8 -0
  38. package/src/components/Panel/Panel.module.css +27 -2
  39. package/src/components/Panel/Panel.stories.tsx +4 -4
  40. package/src/components/Panel/Panel.tsx +10 -1
  41. package/src/components/Radio/Radio.module.css +2 -2
  42. package/src/components/SegmentedControl/SegmentedControl.module.css +26 -0
  43. package/src/components/Stack/USAGE.md +2 -1
  44. package/src/components/Stepper/Stepper.module.css +15 -0
  45. package/src/components/Switch/Switch.module.css +5 -0
  46. package/src/components/Tabs/Tabs.module.css +5 -0
  47. package/src/components/Tabs/Tabs.tsx +1 -0
  48. package/src/components/index.ts +1 -1
  49. package/src/index.ts +1 -0
  50. package/src/utils/breakpointsFromRecManifest.test.ts +40 -0
  51. package/src/utils/breakpointsFromRecManifest.ts +75 -0
  52. package/src/utils/index.ts +1 -0
  53. package/src/components/Grid/GRID_IMPLEMENTATION_NOTES.md +0 -85
  54. package/src/components/Grid/Grid.module.css +0 -41
  55. package/src/components/Grid/Grid.stories.tsx +0 -200
  56. package/src/components/Grid/Grid.test.tsx +0 -1
  57. package/src/components/Grid/Grid.tsx +0 -179
  58. package/src/components/Grid/USAGE.md +0 -61
@@ -1,179 +0,0 @@
1
- import { forwardRef } from "react";
2
- import {
3
- Grid as MantineGrid,
4
- type GridProps as MantineGridProps,
5
- type GridColProps as MantineGridColProps,
6
- createPolymorphicComponent,
7
- } from "@mantine/core";
8
- import {
9
- mapLayoutProps,
10
- type WithRecursicaSpacing,
11
- } from "../../utils/filterStylingProps";
12
- import {
13
- type RecursicaGridColProps,
14
- type RecursicaGridProps,
15
- } from "@recursica/adapter-common";
16
- import styles from "./Grid.module.css";
17
-
18
- /**
19
- * Grid layout wrapper.
20
- *
21
- * Note: Unlike complex UI components, primitive layout components (Flex, Stack, Group, Container, Grid)
22
- * DO NOT use the `RecursicaOverStyled` gatekeeper. Developers must be able to freely pass
23
- * width, height, padding, margins, and flexbox alignment props to construct structural layouts.
24
- *
25
- * Recursica's `layout-grids` tokens (column-gutter, row-gutter, margin) are design-system-managed
26
- * values, not integrator-facing settings — Grid applies them itself via CSS variables. Mantine's
27
- * own `gutter` prop is not accepted; only `columns` (from `RecursicaGridProps` in
28
- * `adapter-common`) is exposed as an override, matching how `Container.size` overrides its own
29
- * token-backed default. See `GRID_IMPLEMENTATION_NOTES.md`.
30
- */
31
- export type GridProps = WithRecursicaSpacing<
32
- Omit<MantineGridProps, "gutter" | "columns"> & RecursicaGridProps
33
- >;
34
-
35
- const _Grid = forwardRef<HTMLDivElement, GridProps>(function Grid(
36
- { children, columns, ...rest },
37
- ref,
38
- ) {
39
- const mergedClassNames: Partial<Record<string, string>> = {
40
- root: styles.root,
41
- inner: styles.inner,
42
- col: styles.col,
43
- };
44
-
45
- const classNamesProp = rest.classNames;
46
- if (
47
- classNamesProp &&
48
- typeof classNamesProp === "object" &&
49
- !Array.isArray(classNamesProp)
50
- ) {
51
- const o = classNamesProp as Partial<Record<string, string>>;
52
- mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;
53
- mergedClassNames.inner = o.inner
54
- ? `${styles.inner} ${o.inner}`
55
- : styles.inner;
56
- mergedClassNames.col = o.col ? `${styles.col} ${o.col}` : styles.col;
57
- }
58
-
59
- const classNameProp = rest.className as string | undefined;
60
- const finalClass = classNameProp
61
- ? `${styles.root} ${classNameProp}`
62
- : styles.root;
63
-
64
- // `gutter` is no longer a supported prop — column-gutter is design-system-managed (see below),
65
- // dropped defensively here so a caller still passing the old prop name at runtime can't shadow
66
- // the token-driven value passed to Mantine below via the `{...mappedRest}` spread.
67
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
68
- const { gutter: _legacyGutter, ...restWithoutGutter } = rest as Record<
69
- string,
70
- unknown
71
- >;
72
-
73
- const mappedRest = mapLayoutProps(
74
- restWithoutGutter as Record<string, unknown>,
75
- );
76
-
77
- // `columns` has no CSS-variable equivalent in Mantine — it computes each column's flex-basis
78
- // from a plain number, so the design system default is baked in here as a JS default rather
79
- // than wired live through CSS. Sourced from --recursica_brand_layout-grids_default_columns.
80
- const resolvedColumns = columns ?? 6;
81
-
82
- return (
83
- <MantineGrid
84
- ref={ref}
85
- columns={resolvedColumns}
86
- gutter="var(--recursica_brand_layout-grids_default_column-gutter)"
87
- className={finalClass}
88
- classNames={mergedClassNames}
89
- {...(mappedRest as unknown as Omit<
90
- MantineGridProps,
91
- "gutter" | "columns"
92
- >)}
93
- >
94
- {children}
95
- </MantineGrid>
96
- );
97
- });
98
- _Grid.displayName = "Grid";
99
-
100
- /**
101
- * Recursica Grid layout wrapper.
102
- *
103
- * Supports polymorphism via the `component` prop for custom element rendering.
104
- * @example
105
- * ```tsx
106
- * <Grid>
107
- * <Grid.Col span={3}>Quarter width (defaults to 6 columns)</Grid.Col>
108
- * <Grid.Col span={3}>Quarter width</Grid.Col>
109
- * </Grid>
110
- * ```
111
- */
112
- const GridBase = createPolymorphicComponent<"div", GridProps>(_Grid);
113
-
114
- // ============================================================
115
- // GRID.COL
116
- // ============================================================
117
-
118
- // TODO(grid-col-contract): `RecursicaGridColProps` currently only contributes `children` here —
119
- // `span`, `order`, `visibleFrom`, and `hiddenFrom` are all drafted in that type (adapter-common)
120
- // but commented out for now (2026-09-22, Matt — paused to get Grid merged). Until they're
121
- // restored there, this stays a plain pass-through of Mantine's own `GridColProps`; no Omit needed
122
- // since nothing here is contract-backed yet. Re-add the intersection/Omit once
123
- // `RecursicaGridColProps` picks these back up. See `GRID_IMPLEMENTATION_NOTES.md`.
124
- export type GridColProps = WithRecursicaSpacing<
125
- MantineGridColProps & RecursicaGridColProps
126
- >;
127
-
128
- const _GridCol = forwardRef<HTMLDivElement, GridColProps>(function GridCol(
129
- { children, ...rest },
130
- ref,
131
- ) {
132
- const mergedClassNames: Partial<Record<string, string>> = {
133
- col: styles.col,
134
- };
135
-
136
- const classNamesProp = rest.classNames;
137
- if (
138
- classNamesProp &&
139
- typeof classNamesProp === "object" &&
140
- !Array.isArray(classNamesProp)
141
- ) {
142
- const o = classNamesProp as Partial<Record<string, string>>;
143
- mergedClassNames.col = o.col ? `${styles.col} ${o.col}` : styles.col;
144
- }
145
-
146
- const classNameProp = rest.className as string | undefined;
147
- const finalClass = classNameProp
148
- ? `${styles.col} ${classNameProp}`
149
- : styles.col;
150
-
151
- return (
152
- <MantineGrid.Col
153
- ref={ref}
154
- className={finalClass}
155
- classNames={mergedClassNames}
156
- {...(mapLayoutProps(
157
- rest as Record<string, unknown>,
158
- ) as unknown as MantineGridColProps)}
159
- >
160
- {children}
161
- </MantineGrid.Col>
162
- );
163
- });
164
- _GridCol.displayName = "GridCol";
165
-
166
- export const GridCol = createPolymorphicComponent<"div", GridColProps>(
167
- _GridCol,
168
- );
169
-
170
- // ============================================================
171
- // DOT NOTATION EXPORT
172
- // ============================================================
173
-
174
- type GridComponent = typeof GridBase & {
175
- Col: typeof GridCol;
176
- };
177
-
178
- export const Grid = GridBase as GridComponent;
179
- Grid.Col = GridCol;
@@ -1,61 +0,0 @@
1
- # Grid - Usage Guide
2
-
3
- This document describes how to integrate and use the `Grid` component in your projects using `@recursica/adapter-mantine-v8`.
4
-
5
- ---
6
-
7
- ## 1. Import Reference
8
-
9
- ```tsx
10
- import { Grid } from "@recursica/adapter-mantine-v8";
11
- ```
12
-
13
- ---
14
-
15
- ## 2. Basic Example
16
-
17
- ```tsx
18
- import React from "react";
19
- import { Grid } from "@recursica/adapter-mantine-v8";
20
-
21
- export default function Demo() {
22
- return (
23
- // No props needed for the design system default: 6 columns, with the design system's own
24
- // column-gutter/row-gutter/margin values.
25
- <Grid>
26
- <Grid.Col span={3}>Half width (of 6)</Grid.Col>
27
- <Grid.Col span={{ xs: 6, sm: 3, md: 2 }}>Responsive width</Grid.Col>
28
- </Grid>
29
- );
30
- }
31
- ```
32
-
33
- ---
34
-
35
- ## 3. Design System Integration
36
-
37
- All Recursica components in the `@recursica/adapter-mantine-v8` package adhere strictly to design system spacing, scaling, and behavior patterns.
38
-
39
- > [!IMPORTANT]
40
- >
41
- > - **Anti-override protection**: `Grid` is a primitive layout component (see [OVERSTYLING.md](../../../OVERSTYLING.md)), so standard Mantine layout props pass through freely without needing `overStyled`.
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**: Grid follows the design system's own `layout-grids` tokens — 6 columns, with column-gutter/row-gutter/margin applied automatically. Only `columns` is an integrator-facing override; the gutter/margin values are design-system-managed and not configurable via props.
44
-
45
- ---
46
-
47
- ## 4. Key Integration Features & Constraints
48
-
49
- `Grid.Col`'s `span`, `offset`, `order`, `visibleFrom`, `hiddenFrom` match Mantine's own naming and
50
- accept the same shapes, including per-breakpoint objects (`{ xs, sm, md, lg, xl }`) — all still a
51
- straight Mantine pass-through for now. A formal `RecursicaGridColProps` contract in
52
- `adapter-common` is scaffolded but not filled in yet (TODO, tracked in
53
- `GRID_IMPLEMENTATION_NOTES.md`).
54
-
55
- `Grid` no longer accepts Mantine's own `gutter` prop — column-gutter, row-gutter, and margin are
56
- design-system-managed (Forge-controlled, applied via CSS variables) rather than integrator
57
- settings:
58
-
59
- - `columns?: number` — the only design-token-backed override on Grid; defaults to 6.
60
-
61
- `grow`, `justify`, `align` are unchanged, matching Mantine's own naming.