@recursica/mantine-adapter 0.26.0 → 0.27.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 +17 -0
- 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 +1289 -1254
- package/dist/mantine-adapter.js.map +1 -1
- package/dist/src/components/Accordion/Accordion.d.ts +3 -4
- package/dist/src/components/AutoComplete/AutoComplete.d.ts +4 -6
- package/dist/src/components/Avatar/Avatar.d.ts +2 -3
- package/dist/src/components/Badge/Badge.d.ts +1 -1
- package/dist/src/components/Button/Button.d.ts +1 -1
- package/dist/src/components/Card/Card.d.ts +10 -2
- package/dist/src/components/Checkbox/CheckboxGroup.d.ts +2 -6
- package/dist/src/components/Container/Container.d.ts +14 -2
- package/dist/src/components/DatePicker/DatePicker.d.ts +1 -5
- package/dist/src/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/components/Flex/Flex.d.ts +26 -3
- package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +1 -0
- package/dist/src/components/Group/Group.d.ts +14 -2
- package/dist/src/components/Link/Link.d.ts +3 -4
- package/dist/src/components/Menu/Menu.d.ts +2 -2
- package/dist/src/components/Panel/Panel.d.ts +6 -4
- package/dist/src/components/Radio/RadioGroup.d.ts +2 -6
- package/dist/src/components/Slider/Slider.d.ts +1 -5
- package/dist/src/components/Stack/Stack.d.ts +27 -4
- package/dist/src/components/Stepper/Stepper.d.ts +4 -2
- package/dist/src/components/Switch/SwitchGroup.d.ts +2 -6
- package/dist/src/components/Table/Table.d.ts +16 -3
- package/dist/src/components/Tabs/Tabs.d.ts +4 -2
- package/dist/src/components/Text/Text.d.ts +3 -2
- package/dist/src/components/TextArea/TextArea.d.ts +1 -1
- package/dist/src/components/TextField/TextField.d.ts +1 -5
- package/dist/src/components/Title/Title.d.ts +2 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/utils/filterStylingProps.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.tsx +1 -1
- package/src/components/AutoComplete/AutoComplete.tsx +13 -4
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +7 -0
- package/src/components/Card/Card.module.css +1 -0
- package/src/components/Card/Card.tsx +25 -1
- package/src/components/Checkbox/CheckboxGroup.tsx +6 -3
- package/src/components/Container/Container.tsx +4 -2
- package/src/components/DatePicker/DatePicker.tsx +1 -3
- package/src/components/Dropdown/Dropdown.tsx +4 -11
- package/src/components/Flex/Flex.tsx +7 -2
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +1 -0
- package/src/components/Group/Group.tsx +7 -2
- package/src/components/Link/Link.tsx +3 -3
- package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +3 -3
- package/src/components/Panel/Panel.stories.tsx +8 -8
- package/src/components/Panel/Panel.tsx +11 -4
- package/src/components/Radio/RadioGroup.tsx +6 -3
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +5 -1
- package/src/components/Stack/Stack.tsx +7 -2
- package/src/components/Stepper/Stepper.tsx +5 -1
- package/src/components/Switch/SwitchGroup.tsx +6 -3
- package/src/components/Table/Table.module.css +7 -0
- package/src/components/Table/Table.stories.tsx +33 -3
- package/src/components/Table/Table.tsx +56 -5
- package/src/components/Tabs/Tabs.tsx +5 -1
- package/src/components/Text/Text.tsx +3 -1
- package/src/components/TextArea/TextArea.tsx +2 -9
- package/src/components/Title/Title.tsx +3 -1
- package/src/index.ts +14 -0
- package/src/utils/filterStylingProps.ts +1 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Table } from "./Table";
|
|
3
|
-
import { ComingSoon } from "@recursica/storybook-template";
|
|
4
3
|
|
|
5
4
|
const meta: Meta<typeof Table> = {
|
|
6
|
-
title: "UI-Kit
|
|
5
|
+
title: "UI-Kit/Table",
|
|
7
6
|
component: Table,
|
|
8
7
|
tags: ["autodocs"],
|
|
9
8
|
};
|
|
@@ -12,6 +11,37 @@ export default meta;
|
|
|
12
11
|
|
|
13
12
|
type Story = StoryObj<typeof Table>;
|
|
14
13
|
|
|
14
|
+
const elements = [
|
|
15
|
+
{ position: 6, mass: 12.011, symbol: "C", name: "Carbon" },
|
|
16
|
+
{ position: 7, mass: 14.007, symbol: "N", name: "Nitrogen" },
|
|
17
|
+
{ position: 8, mass: 15.999, symbol: "O", name: "Oxygen" },
|
|
18
|
+
{ position: 9, mass: 18.998, symbol: "F", name: "Fluorine" },
|
|
19
|
+
{ position: 10, mass: 20.18, symbol: "Ne", name: "Neon" },
|
|
20
|
+
];
|
|
21
|
+
|
|
15
22
|
export const Default: Story = {
|
|
16
|
-
render: () =>
|
|
23
|
+
render: () => {
|
|
24
|
+
const rows = elements.map((element) => (
|
|
25
|
+
<Table.Tr key={element.name}>
|
|
26
|
+
<Table.Td>{element.position}</Table.Td>
|
|
27
|
+
<Table.Td>{element.name}</Table.Td>
|
|
28
|
+
<Table.Td>{element.symbol}</Table.Td>
|
|
29
|
+
<Table.Td>{element.mass}</Table.Td>
|
|
30
|
+
</Table.Tr>
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Table>
|
|
35
|
+
<Table.Thead>
|
|
36
|
+
<Table.Tr>
|
|
37
|
+
<Table.Th>Element position</Table.Th>
|
|
38
|
+
<Table.Th>Element name</Table.Th>
|
|
39
|
+
<Table.Th>Symbol</Table.Th>
|
|
40
|
+
<Table.Th>Atomic mass</Table.Th>
|
|
41
|
+
</Table.Tr>
|
|
42
|
+
</Table.Thead>
|
|
43
|
+
<Table.Tbody>{rows}</Table.Tbody>
|
|
44
|
+
</Table>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
17
47
|
};
|
|
@@ -1,9 +1,60 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Table as MantineTable,
|
|
4
|
+
type TableProps as MantineTableProps,
|
|
5
|
+
} from "@mantine/core";
|
|
6
|
+
import {
|
|
7
|
+
filterStylingProps,
|
|
8
|
+
type RecursicaOverStyled,
|
|
9
|
+
} from "../../utils/filterStylingProps";
|
|
2
10
|
import { type RecursicaTableProps } from "@recursica/adapter-common";
|
|
11
|
+
import styles from "./Table.module.css";
|
|
3
12
|
|
|
4
|
-
export type TableProps =
|
|
5
|
-
RecursicaTableProps
|
|
13
|
+
export type TableProps = RecursicaOverStyled<
|
|
14
|
+
MantineTableProps & RecursicaTableProps
|
|
15
|
+
>;
|
|
6
16
|
|
|
7
|
-
|
|
8
|
-
|
|
17
|
+
const TableBase = forwardRef<HTMLTableElement, TableProps>(function Table(
|
|
18
|
+
{ overStyled = false, className, ...rest },
|
|
19
|
+
ref,
|
|
20
|
+
) {
|
|
21
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
22
|
+
const classNameProp = (sanitizedProps as Record<string, unknown>)
|
|
23
|
+
.className as string | undefined;
|
|
24
|
+
|
|
25
|
+
const rootClass = styles.root;
|
|
26
|
+
const finalClass = classNameProp
|
|
27
|
+
? `${rootClass} ${classNameProp}`
|
|
28
|
+
: rootClass;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<MantineTable
|
|
32
|
+
ref={ref}
|
|
33
|
+
className={finalClass}
|
|
34
|
+
{...(sanitizedProps as unknown as MantineTableProps)}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
TableBase.displayName = "Table";
|
|
40
|
+
|
|
41
|
+
type TableComponent = typeof TableBase & {
|
|
42
|
+
Thead: typeof MantineTable.Thead;
|
|
43
|
+
Tbody: typeof MantineTable.Tbody;
|
|
44
|
+
Tr: typeof MantineTable.Tr;
|
|
45
|
+
Th: typeof MantineTable.Th;
|
|
46
|
+
Td: typeof MantineTable.Td;
|
|
47
|
+
Tfoot: typeof MantineTable.Tfoot;
|
|
48
|
+
Caption: typeof MantineTable.Caption;
|
|
49
|
+
ScrollContainer: typeof MantineTable.ScrollContainer;
|
|
9
50
|
};
|
|
51
|
+
|
|
52
|
+
export const Table = TableBase as TableComponent;
|
|
53
|
+
Table.Thead = MantineTable.Thead;
|
|
54
|
+
Table.Tbody = MantineTable.Tbody;
|
|
55
|
+
Table.Tr = MantineTable.Tr;
|
|
56
|
+
Table.Th = MantineTable.Th;
|
|
57
|
+
Table.Td = MantineTable.Td;
|
|
58
|
+
Table.Tfoot = MantineTable.Tfoot;
|
|
59
|
+
Table.Caption = MantineTable.Caption;
|
|
60
|
+
Table.ScrollContainer = MantineTable.ScrollContainer;
|
|
@@ -14,7 +14,11 @@ import styles from "./Tabs.module.css";
|
|
|
14
14
|
|
|
15
15
|
import { type RecursicaTabsProps } from "@recursica/adapter-common";
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export interface RecursicaTabsPropsExtended
|
|
18
|
+
extends Omit<MantineTabsProps, "variant">,
|
|
19
|
+
RecursicaTabsProps {}
|
|
20
|
+
|
|
21
|
+
export type TabsProps = RecursicaOverStyled<RecursicaTabsPropsExtended>;
|
|
18
22
|
|
|
19
23
|
const _Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(props, ref) {
|
|
20
24
|
const {
|
|
@@ -11,7 +11,9 @@ import {
|
|
|
11
11
|
|
|
12
12
|
import { type RecursicaTextProps } from "@recursica/adapter-common";
|
|
13
13
|
|
|
14
|
-
export type TextProps = RecursicaOverStyled<
|
|
14
|
+
export type TextProps = RecursicaOverStyled<
|
|
15
|
+
Omit<MantineTextProps, "variant"> & RecursicaTextProps
|
|
16
|
+
>;
|
|
15
17
|
|
|
16
18
|
const _Text = forwardRef<HTMLDivElement, TextProps>(function Text(
|
|
17
19
|
{ overStyled = false, variant = "body", ...rest },
|
|
@@ -19,16 +19,9 @@ export interface RecursicaTextAreaProps
|
|
|
19
19
|
MantineTextareaProps,
|
|
20
20
|
"size" | "variant" | "radius" | "wrapperProps"
|
|
21
21
|
>,
|
|
22
|
-
|
|
22
|
+
Omit<
|
|
23
23
|
RecursicaFormControlWrapperProps,
|
|
24
|
-
| "
|
|
25
|
-
| "assistiveWithIcon"
|
|
26
|
-
| "formLayout"
|
|
27
|
-
| "labelSize"
|
|
28
|
-
| "labelAlignment"
|
|
29
|
-
| "labelOptionalText"
|
|
30
|
-
| "labelWithEditIcon"
|
|
31
|
-
| "onLabelEditClick"
|
|
24
|
+
"controlMaxWidth" | "controlMinWidth"
|
|
32
25
|
>,
|
|
33
26
|
ReadOnlyControlProps,
|
|
34
27
|
BaseRecursicaTextAreaProps {}
|
|
@@ -10,7 +10,9 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import { type RecursicaTitleProps } from "@recursica/adapter-common";
|
|
12
12
|
|
|
13
|
-
export type TitleProps = RecursicaOverStyled<
|
|
13
|
+
export type TitleProps = RecursicaOverStyled<
|
|
14
|
+
Omit<MantineTitleProps, "size"> & RecursicaTitleProps
|
|
15
|
+
>;
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Enforces highly accessible structural markup utilizing semantic `<h1>` through `<h6>` tags securely bound directly to Recursica typographic scales.
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import "@recursica/adapter-common/style.css";
|
|
2
2
|
export * from "./components";
|
|
3
3
|
export * from "@recursica/adapter-common";
|
|
4
|
+
|
|
5
|
+
export type {
|
|
6
|
+
RecursicaCheckboxGroupProps,
|
|
7
|
+
RecursicaDatePickerProps,
|
|
8
|
+
RecursicaDropdownProps,
|
|
9
|
+
RecursicaNumberInputProps,
|
|
10
|
+
RecursicaRadioGroupProps,
|
|
11
|
+
RecursicaReadOnlyFieldProps,
|
|
12
|
+
RecursicaReadOnlyTextFieldProps,
|
|
13
|
+
RecursicaSliderProps,
|
|
14
|
+
RecursicaSwitchGroupProps,
|
|
15
|
+
RecursicaTextAreaProps,
|
|
16
|
+
RecursicaTextFieldProps,
|
|
17
|
+
} from "./components";
|