@recursica/mantine-adapter 0.50.6 → 0.52.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 +22 -0
- package/dist/index.d.ts +26 -26
- package/dist/mantine-adapter.cjs +2 -2
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.css +1 -1
- package/dist/mantine-adapter.js +779 -773
- package/dist/mantine-adapter.js.map +1 -1
- package/package.json +2 -2
- package/src/Introduction.stories.tsx +15 -15
- package/src/OverStyling.tsx +3 -3
- package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +10 -0
- package/src/components/Accordion/Accordion.module.css +5 -1
- package/src/components/AutoComplete/AUTOCOMPLETE_IMPLEMENTATION_NOTES.md +6 -1
- package/src/components/AutoComplete/AutoComplete.module.css +4 -1
- package/src/components/Button/Button.module.css +4 -1
- package/src/components/Button/IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Card/USAGE.md +1 -1
- package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +1 -1
- package/src/components/Dropdown/Dropdown.module.css +4 -1
- package/src/components/Heading/HEADING_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Heading/Heading.module.css +13 -0
- package/src/components/{Title/Title.stories.tsx → Heading/Heading.stories.tsx} +13 -13
- package/src/components/Heading/Heading.test.tsx +1 -0
- package/src/components/Heading/Heading.tsx +52 -0
- package/src/components/{Title → Heading}/USAGE.md +5 -5
- package/src/components/Modal/MODAL_IMPLEMENTATION_NOTES.md +6 -1
- package/src/components/Modal/Modal.module.css +4 -1
- package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +10 -0
- package/src/components/Panel/Panel.module.css +4 -1
- package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Text/Text.module.css +13 -0
- package/src/components/Text/Text.stories.tsx +1 -1
- package/src/components/Text/Text.tsx +5 -4
- package/src/components/index.ts +1 -1
- package/src/index.ts +3 -3
- package/src/components/Title/Title.test.tsx +0 -1
- package/src/components/Title/Title.tsx +0 -52
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Title as MantineTitle,
|
|
4
|
-
type TitleProps as MantineTitleProps,
|
|
5
|
-
} from "@mantine/core";
|
|
6
|
-
import {
|
|
7
|
-
filterStylingProps,
|
|
8
|
-
omitUnsupportedProps,
|
|
9
|
-
type RecursicaOverStyled,
|
|
10
|
-
} from "../../utils/filterStylingProps";
|
|
11
|
-
|
|
12
|
-
import { type RecursicaTitleProps } from "@recursica/adapter-common";
|
|
13
|
-
|
|
14
|
-
export type TitleProps = RecursicaOverStyled<
|
|
15
|
-
Omit<MantineTitleProps, "size"> & RecursicaTitleProps
|
|
16
|
-
>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Enforces highly accessible structural markup utilizing semantic `<h1>` through `<h6>` tags securely bound directly to Recursica typographic scales.
|
|
20
|
-
*/
|
|
21
|
-
export const Title = forwardRef<HTMLHeadingElement, TitleProps>(function Title(
|
|
22
|
-
{ overStyled = false, order = 1, ...rest },
|
|
23
|
-
ref,
|
|
24
|
-
) {
|
|
25
|
-
// Props this component intentionally doesn't support — deleted at runtime so they can't leak
|
|
26
|
-
// through even if a caller forces them via plain JavaScript, bypassing the `Omit<>` above.
|
|
27
|
-
const UNSUPPORTED_PROPS = [
|
|
28
|
-
"size", // Recursica controls Title sizing via the `order` prop + typography tokens, not Mantine's native `size`.
|
|
29
|
-
] as const satisfies readonly (keyof MantineTitleProps)[];
|
|
30
|
-
|
|
31
|
-
const sanitizedProps = omitUnsupportedProps(
|
|
32
|
-
filterStylingProps(rest, overStyled),
|
|
33
|
-
UNSUPPORTED_PROPS,
|
|
34
|
-
);
|
|
35
|
-
const classNameProp = (sanitizedProps as Record<string, unknown>)
|
|
36
|
-
.className as string | undefined;
|
|
37
|
-
|
|
38
|
-
const typographyClass = `recursica_brand_typography_h${order}`;
|
|
39
|
-
const mergedClassName = classNameProp
|
|
40
|
-
? `${typographyClass} ${classNameProp}`
|
|
41
|
-
: typographyClass;
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<MantineTitle
|
|
45
|
-
ref={ref}
|
|
46
|
-
{...(sanitizedProps as unknown as MantineTitleProps)}
|
|
47
|
-
order={order}
|
|
48
|
-
className={mergedClassName}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
});
|
|
52
|
-
Title.displayName = "Title";
|