@ex-grid/mantine 0.0.0-stage → 0.2.0-rc.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.
- package/LICENSE +21 -0
- package/README.md +42 -2
- package/dist/index.d.ts +91 -0
- package/dist/index.js +824 -0
- package/dist/index.js.map +7 -0
- package/package.json +37 -4
- package/styles.css +229 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AkiraMisawa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ex-grid/mantine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ExGrid for Mantine: the design-system Wrapper that draws ExGrid for React's Chrome with Mantine's components and maps its Visual Tokens onto a Mantine theme.
|
|
4
|
+
|
|
5
|
+
It is one of the packages of the ExGrid family: Excel-like grids, sheets, pivot tables and charts for reading
|
|
6
|
+
money and risk numbers, published to npm under `@ex-grid` and to NuGet for Blazor, at one shared version.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @ex-grid/mantine @mantine/core @mantine/hooks react react-dom
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`@mantine/core`, `@mantine/hooks`, `react` and `react-dom` are peer dependencies: your application provides them, at the versions `package.json` names.
|
|
15
|
+
|
|
16
|
+
It depends on exactly the version of `@ex-grid/core` and `@ex-grid/react` it was built with, so upgrade the family's packages together.
|
|
17
|
+
|
|
18
|
+
What it draws reads these stylesheets. Import them once in your application, after the design system's own:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import '@ex-grid/core/styles.css';
|
|
22
|
+
import '@ex-grid/mantine/styles.css';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Documentation
|
|
26
|
+
|
|
27
|
+
[ExGrid on the documentation site](https://akiramisawa.github.io/ex-grid/exgrid), read for React with the switch at the top, and every
|
|
28
|
+
version's [Release Notes](https://akiramisawa.github.io/ex-grid/release-notes).
|
|
29
|
+
|
|
30
|
+
> **The API may still change.** While the version is `0.x`, it may change from one version to the next; each
|
|
31
|
+
> version's Release Notes say what changed. A prerelease, a version with a suffix such as `-rc.1`, passed every
|
|
32
|
+
> test layer in CI on the commit it was built from. A version without a suffix is published only once the
|
|
33
|
+
> project's [Definition of Done](https://github.com/AkiraMisawa/ex-grid/blob/main/docs/definition-of-done.md) is
|
|
34
|
+
> signed off on it.
|
|
35
|
+
|
|
36
|
+
## Requirements
|
|
37
|
+
|
|
38
|
+
- **Chrome or Edge.** They are the supported browsers; Safari and Firefox are out of scope.
|
|
39
|
+
- **React 19.2.0 or a later 19.x.**
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { ExGridChrome } from '@ex-grid/react';
|
|
4
|
+
import { ExGridProps } from '@ex-grid/react';
|
|
5
|
+
import { GridDensity } from '@ex-grid/core';
|
|
6
|
+
import { GridPresentationDefaults } from '@ex-grid/core';
|
|
7
|
+
import { GridPresentationDefaultsOptions } from '@ex-grid/core';
|
|
8
|
+
import { MantineRadius } from '@mantine/core';
|
|
9
|
+
import { MantineShadow } from '@mantine/core';
|
|
10
|
+
import { MantineSize } from '@mantine/core';
|
|
11
|
+
import { ReactElement } from 'react';
|
|
12
|
+
|
|
13
|
+
/** Every Chrome slot drawn in Mantine's components: what {@link MantineExGrid} hands its grid. A Consumer that frames
|
|
14
|
+
* an ExGrid itself spreads it into the grid's `chrome`, inside an element of the class `mantine-ex-grid` and a
|
|
15
|
+
* {@link MantineSizeContext}, as MantineExGrid draws them. */
|
|
16
|
+
export declare const mantineChrome: ExGridChrome<unknown>;
|
|
17
|
+
|
|
18
|
+
/** Mantine's default font stack (`-apple-system`, `BlinkMacSystemFont`, `Segoe UI`, `Roboto`, `Helvetica`,
|
|
19
|
+
* `Arial`, `sans-serif`) with the widest widths any face it resolves to was measured at: macOS's system face, Segoe UI,
|
|
20
|
+
* Roboto, Liberation Sans for Helvetica and Arial on Linux, and DejaVu Sans. What the cells are drawn in unless a
|
|
21
|
+
* font is given. */
|
|
22
|
+
export declare const mantineDefaultFont: MantineExGridFont;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An Excel-like grid drawn with Mantine: the Chrome slots a `chrome` prop leaves are Mantine's, the cells are in
|
|
26
|
+
* the font whose widths the grid judges `####` by, and the colours follow the theme and its scheme with no render.
|
|
27
|
+
* Needs Mantine's MantineProvider above it and `@ex-grid/mantine/styles.css` loaded after Mantine's styles.
|
|
28
|
+
*/
|
|
29
|
+
export declare function MantineExGrid<Row>(props: MantineExGridProps<Row>): ReactElement;
|
|
30
|
+
|
|
31
|
+
/** A font for the grid's cells, with the widths measured for it (ADR-0027): `family` is written as
|
|
32
|
+
* `--ex-font-family` and `widths` are what `####` is judged by, in the same render. */
|
|
33
|
+
export declare interface MantineExGridFont {
|
|
34
|
+
/** The CSS font family list, as `font-family` takes it. */
|
|
35
|
+
readonly family: string;
|
|
36
|
+
/** The widths measured for that family (`tests/GlyphWidths` measures one). */
|
|
37
|
+
readonly widths: MantineExGridFontWidths;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The widths a font is charged at, in the forms the grid takes: everything a Wrapper's presentation defaults hold
|
|
41
|
+
* but the Density, hover band and Row Stripes, which are the Wrapper's words. */
|
|
42
|
+
export declare type MantineExGridFontWidths = Omit<GridPresentationDefaultsOptions, 'density' | 'highlightHoverRow' | 'stripeRows'>;
|
|
43
|
+
|
|
44
|
+
/** A MantineExGrid's props: an ExGrid's, and the Paper's and Table's words Mantine draws a grid with. No
|
|
45
|
+
* `presentationDefaults`: the Wrapper's are its own, made from `font`, `striped` and `highlightOnHover`, so the
|
|
46
|
+
* widths `####` is judged by are always the font's the Paper writes (ADR-0027). */
|
|
47
|
+
export declare type MantineExGridProps<Row> = Omit<ExGridProps<Row>, 'presentationDefaults'> & {
|
|
48
|
+
/** The Paper's border, Mantine's `withBorder`. */
|
|
49
|
+
readonly withBorder?: boolean;
|
|
50
|
+
/** The Paper's corner radius, a theme radius or a CSS length; `0` sets the grid square in its Paper. */
|
|
51
|
+
readonly radius?: MantineRadius;
|
|
52
|
+
/** The Paper's shadow. */
|
|
53
|
+
readonly shadow?: MantineShadow;
|
|
54
|
+
/** Row Stripes where the grid is given no `stripeRows`, Mantine's Table's `striped` (ADR-0038). */
|
|
55
|
+
readonly striped?: boolean;
|
|
56
|
+
/** The hover band where the grid is given no `highlightHoverRow`, Mantine's Table's `highlightOnHover` (ADR-0029). */
|
|
57
|
+
readonly highlightOnHover?: boolean;
|
|
58
|
+
/** A rule between columns, Mantine's Table's `withColumnBorders`. */
|
|
59
|
+
readonly withColumnBorders?: boolean;
|
|
60
|
+
/** The cells' font with its widths (ADR-0027); Mantine's default stack unless given. */
|
|
61
|
+
readonly font?: MantineExGridFont;
|
|
62
|
+
/** A class for the Paper. */
|
|
63
|
+
readonly className?: string;
|
|
64
|
+
/** A style for the Paper. */
|
|
65
|
+
readonly style?: CSSProperties;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** What the Wrapper hands a grid: `font`'s widths, and the Density, hover band and Row Stripes its words map onto. A
|
|
69
|
+
* value the grid is given beats these, and these beat the preset (ADR-0028). */
|
|
70
|
+
export declare function mantinePresentationDefaults(font: MantineExGridFont, words?: MantinePresentationWords): GridPresentationDefaults;
|
|
71
|
+
|
|
72
|
+
/** What Mantine's own words are on the Wrapper: its Table's `striped` and `highlightOnHover`. */
|
|
73
|
+
export declare interface MantinePresentationWords {
|
|
74
|
+
/** The preset the grid takes where it is given none. */
|
|
75
|
+
readonly density?: GridDensity;
|
|
76
|
+
/** Row Stripes, Mantine's Table's `striped` (ADR-0038). */
|
|
77
|
+
readonly striped?: boolean;
|
|
78
|
+
/** The hover band, Mantine's Table's `highlightOnHover` (ADR-0029). */
|
|
79
|
+
readonly highlightOnHover?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The size Mantine's components are drawn at inside a grid: the one its density maps onto, handed down from
|
|
83
|
+
* MantineExGrid through React's context, which a portal keeps. A frame of the Consumer's own that draws
|
|
84
|
+
* {@link mantineChrome} gives it, as it gives the class `mantine-ex-grid` the Wrapper's stylesheet is scoped to. */
|
|
85
|
+
export declare const MantineSizeContext: Context<MantineSize>;
|
|
86
|
+
|
|
87
|
+
/** The size Mantine's components are drawn at in a grid of `density` (ADR-0390): Mantine has no word like Dense, so
|
|
88
|
+
* the preset picks a size, `xs` for the compact ones and `sm`, Mantine's own default, for Standard. */
|
|
89
|
+
export declare function mantineSizeOf(density: GridDensity): MantineSize;
|
|
90
|
+
|
|
91
|
+
export { }
|