@recursica/mui-adapter 0.6.0 → 0.7.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/ARCHITECTURE.md +15 -0
- package/CHANGELOG.md +6 -0
- package/SETUP.md +77 -0
- package/USAGE.md +55 -0
- package/dist/mui-adapter.cjs +26 -26
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.css +1 -1
- package/dist/mui-adapter.js +3721 -3511
- package/dist/mui-adapter.js.map +1 -1
- package/dist/src/components/Accordion/Accordion.d.ts +9 -29
- package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +2 -5
- package/dist/src/components/Autocomplete/Autocomplete.d.ts +4 -8
- package/dist/src/components/Avatar/Avatar.d.ts +1 -6
- package/dist/src/components/Badge/Badge.d.ts +1 -4
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/dist/src/components/Button/Button.d.ts +2 -17
- package/dist/src/components/Card/Card.d.ts +2 -4
- package/dist/src/components/Checkbox/Checkbox.d.ts +4 -6
- package/dist/src/components/Checkbox/CheckboxGroup.d.ts +8 -6
- package/dist/src/components/Chip/Chip.d.ts +2 -11
- package/dist/src/components/Container/Container.d.ts +1 -5
- package/dist/src/components/DatePicker/DatePicker.d.ts +2 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +4 -14
- package/dist/src/components/Flex/Flex.d.ts +2 -22
- package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +2 -7
- package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +3 -18
- package/dist/src/components/Group/Group.d.ts +2 -7
- package/dist/src/components/HoverCard/HoverCard.d.ts +13 -39
- package/dist/src/components/Label/Label.d.ts +2 -9
- package/dist/src/components/Link/Link.d.ts +2 -6
- package/dist/src/components/Loader/Loader.d.ts +2 -7
- package/dist/src/components/Menu/Menu.d.ts +24 -98
- package/dist/src/components/Modal/Modal.d.ts +32 -31
- package/dist/src/components/NumberInput/NumberInput.d.ts +3 -5
- package/dist/src/components/Pagination/Pagination.d.ts +8 -41
- package/dist/src/components/Panel/Panel.d.ts +5 -18
- package/dist/src/components/Radio/Radio.d.ts +4 -4
- package/dist/src/components/Radio/RadioGroup.d.ts +3 -7
- package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +2 -5
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +5 -15
- package/dist/src/components/Slider/Slider.d.ts +4 -14
- package/dist/src/components/Stack/Stack.d.ts +2 -5
- package/dist/src/components/Stepper/Stepper.d.ts +36 -16
- package/dist/src/components/Switch/Switch.d.ts +4 -4
- package/dist/src/components/Switch/SwitchGroup.d.ts +4 -4
- package/dist/src/components/Table/Table.d.ts +2 -1
- package/dist/src/components/Tabs/Tabs.d.ts +11 -26
- package/dist/src/components/Text/Text.d.ts +2 -16
- package/dist/src/components/TextArea/TextArea.d.ts +3 -9
- package/dist/src/components/TextField/TextField.d.ts +3 -7
- package/dist/src/components/TimePicker/TimePicker.d.ts +2 -1
- package/dist/src/components/Timeline/Timeline.d.ts +2 -1
- package/dist/src/components/Timeline/TimelineItem.d.ts +2 -13
- package/dist/src/components/Title/Title.d.ts +2 -15
- package/dist/src/components/Toast/Toast.d.ts +11 -16
- package/dist/src/components/Tooltip/Tooltip.d.ts +7 -21
- package/dist/src/components/TransferList/TransferList.d.ts +2 -1
- package/dist/src/components/Typography/Typography.d.ts +1 -1
- package/dist/src/utils/RequireAccessibleLabel.d.ts +1 -18
- package/dist/src/utils/filterStylingProps.d.ts +1 -11
- package/llms.txt +16 -0
- package/package.json +6 -2
- package/src/components/Accordion/Accordion.module.css +1 -2
- package/src/components/Accordion/Accordion.stories.tsx +0 -18
- package/src/components/Accordion/Accordion.tsx +19 -23
- package/src/components/AssistiveElement/AssistiveElement.module.css +32 -29
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +10 -27
- package/src/components/AssistiveElement/AssistiveElement.tsx +11 -15
- package/src/components/Autocomplete/Autocomplete.module.css +17 -18
- package/src/components/Autocomplete/Autocomplete.stories.tsx +7 -16
- package/src/components/Autocomplete/Autocomplete.tsx +27 -45
- package/src/components/Avatar/Avatar.tsx +2 -13
- package/src/components/Badge/Badge.tsx +2 -5
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -4
- package/src/components/Button/Button.module.css +19 -61
- package/src/components/Button/Button.stories.tsx +24 -23
- package/src/components/Button/Button.tsx +7 -18
- package/src/components/Card/Card.module.css +36 -0
- package/src/components/Card/Card.tsx +6 -4
- package/src/components/Checkbox/Checkbox.module.css +27 -10
- package/src/components/Checkbox/Checkbox.tsx +124 -24
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +43 -23
- package/src/components/Chip/Chip.module.css +52 -34
- package/src/components/Chip/Chip.tsx +45 -47
- package/src/components/Container/Container.stories.tsx +103 -20
- package/src/components/Container/Container.tsx +1 -13
- package/src/components/DatePicker/DatePicker.stories.tsx +125 -19
- package/src/components/DatePicker/DatePicker.tsx +3 -1
- package/src/components/Dropdown/Dropdown.tsx +7 -9
- package/src/components/FileInput/FileInput.stories.tsx +2 -19
- package/src/components/FileUpload/FileUpload.stories.tsx +2 -19
- package/src/components/Flex/Flex.stories.tsx +113 -20
- package/src/components/Flex/Flex.tsx +16 -26
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +0 -8
- package/src/components/FormControlLayout/FormControlLayout.tsx +18 -7
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +1 -10
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +12 -21
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +11 -30
- package/src/components/Group/Group.stories.tsx +6 -30
- package/src/components/Group/Group.tsx +14 -9
- package/src/components/HoverCard/HoverCard.tsx +72 -75
- package/src/components/Label/Label.module.css +4 -0
- package/src/components/Label/Label.stories.tsx +18 -12
- package/src/components/Label/Label.tsx +3 -9
- package/src/components/Link/Link.module.css +4 -3
- package/src/components/Link/Link.stories.tsx +2 -8
- package/src/components/Link/Link.tsx +1 -5
- package/src/components/Loader/Loader.module.css +1 -2
- package/src/components/Loader/Loader.tsx +1 -7
- package/src/components/Menu/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Menu/Menu.stories.tsx +106 -188
- package/src/components/Menu/Menu.tsx +34 -280
- package/src/components/Modal/Modal.tsx +158 -160
- package/src/components/NumberInput/NumberInput.tsx +6 -18
- package/src/components/Pagination/IMPLEMENTATION_NOTES.md +3 -0
- package/src/components/Pagination/Pagination.module.css +12 -24
- package/src/components/Pagination/Pagination.stories.tsx +0 -8
- package/src/components/Pagination/Pagination.tsx +20 -140
- package/src/components/Panel/Panel.tsx +7 -30
- package/src/components/Radio/Radio.module.css +25 -10
- package/src/components/Radio/Radio.tsx +51 -19
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +26 -12
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +6 -6
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +5 -36
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +9 -13
- package/src/components/SegmentedControl/SegmentedControl.module.css +23 -47
- package/src/components/SegmentedControl/SegmentedControl.tsx +44 -14
- package/src/components/Slider/Slider.module.css +1 -4
- package/src/components/Slider/Slider.stories.tsx +3 -3
- package/src/components/Slider/Slider.tsx +26 -25
- package/src/components/Stack/Stack.stories.tsx +4 -25
- package/src/components/Stack/Stack.tsx +1 -5
- package/src/components/Stepper/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Stepper/Stepper.stories.tsx +56 -43
- package/src/components/Stepper/Stepper.tsx +89 -87
- package/src/components/Switch/Switch.module.css +21 -0
- package/src/components/Switch/Switch.tsx +63 -16
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +27 -18
- package/src/components/Table/Table.stories.tsx +1 -19
- package/src/components/Table/Table.tsx +3 -1
- package/src/components/Tabs/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Tabs/Tabs.stories.tsx +41 -24
- package/src/components/Tabs/Tabs.tsx +49 -66
- package/src/components/Text/Text.stories.tsx +5 -17
- package/src/components/Text/Text.tsx +1 -15
- package/src/components/TextArea/TextArea.tsx +7 -17
- package/src/components/TextField/TextField.stories.tsx +1 -27
- package/src/components/TextField/TextField.tsx +4 -6
- package/src/components/TimePicker/TimePicker.stories.tsx +2 -19
- package/src/components/TimePicker/TimePicker.tsx +3 -1
- package/src/components/Timeline/Timeline.tsx +4 -1
- package/src/components/Timeline/TimelineItem.tsx +1 -12
- package/src/components/Title/Title.stories.tsx +0 -18
- package/src/components/Title/Title.tsx +1 -7
- package/src/components/Toast/Toast.stories.tsx +1 -1
- package/src/components/Toast/Toast.tsx +62 -28
- package/src/components/Tooltip/Tooltip.tsx +11 -37
- package/src/components/TransferList/TransferList.stories.tsx +1 -19
- package/src/components/TransferList/TransferList.tsx +3 -1
- package/src/utils/RequireAccessibleLabel.ts +1 -12
- package/src/utils/filterStylingProps.ts +7 -20
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
type
|
|
4
|
+
FormGroup as MuiFormGroup,
|
|
5
|
+
type FormGroupProps as MuiFormGroupProps,
|
|
6
6
|
} from "@mui/material";
|
|
7
7
|
import { type ReadOnlyControlProps } from "@recursica/adapter-common";
|
|
8
8
|
import {
|
|
@@ -13,13 +13,25 @@ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/For
|
|
|
13
13
|
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
14
14
|
import styles from "./Switch.module.css";
|
|
15
15
|
|
|
16
|
+
import { type RecursicaSwitchGroupProps as BaseRecursicaSwitchGroupProps } from "@recursica/adapter-common";
|
|
17
|
+
|
|
16
18
|
export interface RecursicaSwitchGroupProps
|
|
17
|
-
extends Omit<
|
|
19
|
+
extends Omit<
|
|
20
|
+
MuiFormGroupProps,
|
|
21
|
+
| "size"
|
|
22
|
+
| "labelProps"
|
|
23
|
+
| "onChange"
|
|
24
|
+
| "classes"
|
|
25
|
+
| "ref"
|
|
26
|
+
| "value"
|
|
27
|
+
| "defaultValue"
|
|
28
|
+
>,
|
|
18
29
|
Omit<
|
|
19
30
|
RecursicaFormControlWrapperProps,
|
|
20
|
-
"controlMaxWidth" | "controlMinWidth"
|
|
31
|
+
"controlMaxWidth" | "controlMinWidth" | "classes" | "onChange"
|
|
21
32
|
>,
|
|
22
|
-
ReadOnlyControlProps
|
|
33
|
+
ReadOnlyControlProps,
|
|
34
|
+
BaseRecursicaSwitchGroupProps {}
|
|
23
35
|
|
|
24
36
|
export type SwitchGroupProps = RecursicaOverStyled<RecursicaSwitchGroupProps>;
|
|
25
37
|
|
|
@@ -43,7 +55,7 @@ export const SwitchGroup = forwardRef<HTMLDivElement, SwitchGroupProps>(
|
|
|
43
55
|
assistiveWithIcon,
|
|
44
56
|
error,
|
|
45
57
|
required,
|
|
46
|
-
withAsterisk
|
|
58
|
+
// removed withAsterisk
|
|
47
59
|
id,
|
|
48
60
|
className,
|
|
49
61
|
style,
|
|
@@ -53,6 +65,8 @@ export const SwitchGroup = forwardRef<HTMLDivElement, SwitchGroupProps>(
|
|
|
53
65
|
emptyValueComponent,
|
|
54
66
|
value,
|
|
55
67
|
defaultValue,
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
69
|
+
onChange,
|
|
56
70
|
...rest
|
|
57
71
|
} = props;
|
|
58
72
|
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
@@ -81,7 +95,6 @@ export const SwitchGroup = forwardRef<HTMLDivElement, SwitchGroupProps>(
|
|
|
81
95
|
assistiveWithIcon={assistiveWithIcon}
|
|
82
96
|
error={error}
|
|
83
97
|
required={required}
|
|
84
|
-
withAsterisk={withAsterisk}
|
|
85
98
|
id={id}
|
|
86
99
|
readOnly={readOnly && !!readOnlyComponent}
|
|
87
100
|
readOnlyComponent={readOnlyComponent}
|
|
@@ -90,22 +103,18 @@ export const SwitchGroup = forwardRef<HTMLDivElement, SwitchGroupProps>(
|
|
|
90
103
|
readOnlyValue={value !== undefined ? value : defaultValue}
|
|
91
104
|
readOnlyNativeProps={props}
|
|
92
105
|
activeComponent={
|
|
93
|
-
<
|
|
106
|
+
<MuiFormGroup
|
|
94
107
|
ref={ref}
|
|
95
|
-
|
|
96
|
-
{
|
|
97
|
-
|
|
98
|
-
value={value}
|
|
99
|
-
defaultValue={defaultValue}
|
|
108
|
+
{...(sanitizedProps as unknown as MuiFormGroupProps)}
|
|
109
|
+
className={`${styles.groupRoot} ${(sanitizedProps as any).className || ""}`.trim()}
|
|
110
|
+
data-layout={formLayout}
|
|
100
111
|
>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
112
|
+
{children}
|
|
113
|
+
</MuiFormGroup>
|
|
105
114
|
}
|
|
106
115
|
/>
|
|
107
116
|
);
|
|
108
117
|
},
|
|
109
118
|
);
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
SwitchGroup.displayName = "SwitchGroup";
|
|
@@ -6,28 +6,10 @@ const meta: Meta<typeof Table> = {
|
|
|
6
6
|
title: "UI-Kit/🚧 Table",
|
|
7
7
|
component: Table,
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
parameters: {
|
|
10
|
-
controls: {
|
|
11
|
-
include: [
|
|
12
|
-
"layer",
|
|
13
|
-
"withLayer",
|
|
14
|
-
"children",
|
|
15
|
-
"component",
|
|
16
|
-
"variant",
|
|
17
|
-
"size",
|
|
18
|
-
"icon",
|
|
19
|
-
"disabled",
|
|
20
|
-
"href",
|
|
21
|
-
"onClick",
|
|
22
|
-
"onChange",
|
|
23
|
-
"value",
|
|
24
|
-
"checked",
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
9
|
};
|
|
29
10
|
|
|
30
11
|
export default meta;
|
|
12
|
+
|
|
31
13
|
type Story = StoryObj<typeof Table>;
|
|
32
14
|
|
|
33
15
|
export const Default: Story = {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type RecursicaTableProps } from "@recursica/adapter-common";
|
|
2
3
|
|
|
3
|
-
export type TableProps = React.HTMLAttributes<HTMLDivElement
|
|
4
|
+
export type TableProps = React.HTMLAttributes<HTMLDivElement> &
|
|
5
|
+
RecursicaTableProps;
|
|
4
6
|
|
|
5
7
|
export const Table: React.FC<TableProps> = (props) => {
|
|
6
8
|
return <div {...props}>Table</div>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# Tabs Implementation Notes
|
|
2
|
+
|
|
3
|
+
- **Compositional API Dropped:** Mantine uses `<Tabs.List>`, `<Tabs.Tab>`, and `<Tabs.Panel>` natively with implicit context from `<Tabs>`. MUI relies on `@mui/lab/TabContext` and separates `Tabs` and `TabPanel`.
|
|
4
|
+
- **Monolithic API Adopted:** Following architectural review, we have opted to drop the broken dot-notation wrappers for `mui-adapter`. We now natively export `Tabs` (MUI List), `Tab` (MUI Item), and `TabPanel` (from `@mui/lab`). Developers must use `TabContext` (from `@mui/lab`) to manage state, just like native MUI. Storybook and visual regression tests have been updated to reflect this divergence while retaining core property mapping compatibility.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Tabs } from "./Tabs";
|
|
3
|
+
import { Tabs, Tab, TabPanel } from "./Tabs";
|
|
4
|
+
import { TabContext } from "@mui/lab";
|
|
3
5
|
import { Flex } from "../Flex/Flex";
|
|
4
6
|
|
|
5
7
|
const meta: Meta<typeof Tabs> = {
|
|
@@ -34,16 +36,26 @@ export default meta;
|
|
|
34
36
|
type Story = StoryObj<typeof Tabs>;
|
|
35
37
|
|
|
36
38
|
const InteractiveTabs = (
|
|
37
|
-
args: React.ComponentProps<typeof Tabs> & {
|
|
39
|
+
args: React.ComponentProps<typeof Tabs> & {
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
inverted?: boolean;
|
|
42
|
+
},
|
|
38
43
|
) => {
|
|
44
|
+
const [value, setValue] = useState("gallery");
|
|
45
|
+
|
|
46
|
+
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
|
|
47
|
+
setValue(newValue);
|
|
48
|
+
};
|
|
49
|
+
|
|
39
50
|
return (
|
|
40
51
|
<Flex w={600} h={300}>
|
|
41
|
-
<
|
|
42
|
-
<Tabs
|
|
43
|
-
<
|
|
52
|
+
<TabContext value={value}>
|
|
53
|
+
<Tabs onChange={handleChange} {...args}>
|
|
54
|
+
<Tab
|
|
44
55
|
value="gallery"
|
|
56
|
+
label="Gallery"
|
|
45
57
|
disabled={args.disabled}
|
|
46
|
-
|
|
58
|
+
icon={
|
|
47
59
|
<svg
|
|
48
60
|
xmlns="http://www.w3.org/2000/svg"
|
|
49
61
|
viewBox="0 0 24 24"
|
|
@@ -52,19 +64,21 @@ const InteractiveTabs = (
|
|
|
52
64
|
strokeWidth="2"
|
|
53
65
|
strokeLinecap="round"
|
|
54
66
|
strokeLinejoin="round"
|
|
67
|
+
width={16}
|
|
68
|
+
height={16}
|
|
55
69
|
>
|
|
56
70
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
57
71
|
<circle cx="8.5" cy="8.5" r="1.5"></circle>
|
|
58
72
|
<polyline points="21 15 16 10 5 21"></polyline>
|
|
59
73
|
</svg>
|
|
60
74
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<Tabs.Tab
|
|
75
|
+
iconPosition="start"
|
|
76
|
+
/>
|
|
77
|
+
<Tab
|
|
65
78
|
value="messages"
|
|
79
|
+
label="Messages"
|
|
66
80
|
disabled={args.disabled}
|
|
67
|
-
|
|
81
|
+
icon={
|
|
68
82
|
<svg
|
|
69
83
|
xmlns="http://www.w3.org/2000/svg"
|
|
70
84
|
viewBox="0 0 24 24"
|
|
@@ -73,17 +87,19 @@ const InteractiveTabs = (
|
|
|
73
87
|
strokeWidth="2"
|
|
74
88
|
strokeLinecap="round"
|
|
75
89
|
strokeLinejoin="round"
|
|
90
|
+
width={16}
|
|
91
|
+
height={16}
|
|
76
92
|
>
|
|
77
93
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
|
|
78
94
|
</svg>
|
|
79
95
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
<Tabs.Tab
|
|
96
|
+
iconPosition="start"
|
|
97
|
+
/>
|
|
98
|
+
<Tab
|
|
84
99
|
value="settings"
|
|
100
|
+
label="Settings"
|
|
85
101
|
disabled={args.disabled}
|
|
86
|
-
|
|
102
|
+
icon={
|
|
87
103
|
<svg
|
|
88
104
|
xmlns="http://www.w3.org/2000/svg"
|
|
89
105
|
viewBox="0 0 24 24"
|
|
@@ -92,22 +108,23 @@ const InteractiveTabs = (
|
|
|
92
108
|
strokeWidth="2"
|
|
93
109
|
strokeLinecap="round"
|
|
94
110
|
strokeLinejoin="round"
|
|
111
|
+
width={16}
|
|
112
|
+
height={16}
|
|
95
113
|
>
|
|
96
114
|
<circle cx="12" cy="12" r="3"></circle>
|
|
97
115
|
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
|
98
116
|
</svg>
|
|
99
117
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</Tabs.List>
|
|
118
|
+
iconPosition="start"
|
|
119
|
+
/>
|
|
120
|
+
</Tabs>
|
|
104
121
|
|
|
105
|
-
<
|
|
122
|
+
<TabPanel value="gallery">Gallery tab content</TabPanel>
|
|
106
123
|
|
|
107
|
-
<
|
|
124
|
+
<TabPanel value="messages">Messages tab content</TabPanel>
|
|
108
125
|
|
|
109
|
-
<
|
|
110
|
-
</
|
|
126
|
+
<TabPanel value="settings">Settings tab content</TabPanel>
|
|
127
|
+
</TabContext>
|
|
111
128
|
</Flex>
|
|
112
129
|
);
|
|
113
130
|
};
|
|
@@ -2,8 +2,8 @@ import { forwardRef } from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
Tabs as MuiTabs,
|
|
4
4
|
type TabsProps as MuiTabsProps,
|
|
5
|
-
|
|
6
|
-
type
|
|
5
|
+
Tab as MuiTab,
|
|
6
|
+
type TabProps as MuiTabProps,
|
|
7
7
|
} from "@mui/material";
|
|
8
8
|
import {
|
|
9
9
|
filterStylingProps,
|
|
@@ -11,95 +11,78 @@ import {
|
|
|
11
11
|
} from "../../utils/filterStylingProps";
|
|
12
12
|
import styles from "./Tabs.module.css";
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
extends Omit<MuiTabsProps, "variant" | "classNames" | "color" | "radius"> {
|
|
16
|
-
variant?: "default" | "outline" | "pills";
|
|
17
|
-
}
|
|
14
|
+
import { type RecursicaTabsProps } from "@recursica/adapter-common";
|
|
18
15
|
|
|
19
16
|
export type TabsProps = RecursicaOverStyled<RecursicaTabsProps>;
|
|
20
17
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
export const Tabs = forwardRef<HTMLDivElement, TabsProps>(
|
|
19
|
+
function Tabs(props, ref) {
|
|
20
|
+
const {
|
|
21
|
+
variant = "default",
|
|
22
|
+
orientation = "horizontal",
|
|
23
|
+
overStyled = false,
|
|
24
|
+
className,
|
|
25
|
+
...rest
|
|
26
|
+
} = props;
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
31
29
|
|
|
32
|
-
return (
|
|
33
|
-
<MuiTabs
|
|
34
|
-
ref={ref}
|
|
35
|
-
variant={variant}
|
|
36
|
-
orientation={orientation}
|
|
37
|
-
className={`${styles.root} ${className || ""}`}
|
|
38
|
-
data-variant={variant}
|
|
39
|
-
data-orientation={orientation}
|
|
40
|
-
classes={{
|
|
41
|
-
list: styles.list,
|
|
42
|
-
tab: styles.tab,
|
|
43
|
-
panel: styles.panel,
|
|
44
|
-
}}
|
|
45
|
-
{...(sanitizedProps as MuiTabsProps)}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
_Tabs.displayName = "Tabs";
|
|
51
|
-
|
|
52
|
-
export type TabsListProps = RecursicaOverStyled<MuiTabsListProps>;
|
|
53
|
-
|
|
54
|
-
const _TabsList = forwardRef<HTMLDivElement, TabsListProps>(
|
|
55
|
-
function TabsList(props, ref) {
|
|
56
|
-
const { overStyled = false, ...rest } = props;
|
|
57
30
|
return (
|
|
58
|
-
<
|
|
31
|
+
<MuiTabs
|
|
59
32
|
ref={ref}
|
|
60
|
-
{
|
|
33
|
+
orientation={orientation}
|
|
34
|
+
className={`${styles.root} ${className || ""}`}
|
|
35
|
+
data-variant={variant}
|
|
36
|
+
data-orientation={orientation}
|
|
37
|
+
classes={{
|
|
38
|
+
flexContainer: styles.list,
|
|
39
|
+
indicator: styles.indicator,
|
|
40
|
+
}}
|
|
41
|
+
{...(sanitizedProps as MuiTabsProps)}
|
|
61
42
|
/>
|
|
62
43
|
);
|
|
63
44
|
},
|
|
64
45
|
);
|
|
65
|
-
_TabsList.displayName = "Tabs.List";
|
|
66
46
|
|
|
67
|
-
|
|
47
|
+
Tabs.displayName = "Tabs";
|
|
48
|
+
|
|
49
|
+
export type TabProps = RecursicaOverStyled<MuiTabProps>;
|
|
50
|
+
|
|
51
|
+
export const Tab = forwardRef<HTMLDivElement, TabProps>(
|
|
52
|
+
function Tab(props, ref) {
|
|
53
|
+
const { overStyled = false, className, ...rest } = props;
|
|
54
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
68
55
|
|
|
69
|
-
const _TabsTab = forwardRef<HTMLButtonElement, TabsTabProps>(
|
|
70
|
-
function TabsTab(props, ref) {
|
|
71
|
-
const { overStyled = false, ...rest } = props;
|
|
72
56
|
return (
|
|
73
|
-
<
|
|
57
|
+
<MuiTab
|
|
74
58
|
ref={ref}
|
|
75
|
-
{
|
|
59
|
+
className={`${styles.tab} ${className || ""}`}
|
|
60
|
+
{...(sanitizedProps as MuiTabProps)}
|
|
76
61
|
/>
|
|
77
62
|
);
|
|
78
63
|
},
|
|
79
64
|
);
|
|
80
|
-
_TabsTab.displayName = "Tabs.Tab";
|
|
81
65
|
|
|
82
|
-
|
|
66
|
+
Tab.displayName = "Tab";
|
|
67
|
+
|
|
68
|
+
import { TabPanel as MuiTabPanel } from "@mui/lab";
|
|
69
|
+
import type { TabPanelProps as MuiTabPanelProps } from "@mui/lab";
|
|
70
|
+
|
|
71
|
+
export type TabPanelProps = RecursicaOverStyled<MuiTabPanelProps>;
|
|
72
|
+
|
|
73
|
+
export const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(
|
|
74
|
+
function TabPanel(props, ref) {
|
|
75
|
+
const { overStyled = false, className, ...rest } = props;
|
|
76
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
83
77
|
|
|
84
|
-
const _TabsPanel = forwardRef<HTMLDivElement, TabsPanelProps>(
|
|
85
|
-
function TabsPanel(props, ref) {
|
|
86
|
-
const { overStyled = false, ...rest } = props;
|
|
87
78
|
return (
|
|
88
|
-
<
|
|
79
|
+
<MuiTabPanel
|
|
89
80
|
ref={ref}
|
|
90
|
-
{
|
|
81
|
+
className={`${styles.panel} ${className || ""}`}
|
|
82
|
+
{...(sanitizedProps as MuiTabPanelProps)}
|
|
91
83
|
/>
|
|
92
84
|
);
|
|
93
85
|
},
|
|
94
86
|
);
|
|
95
|
-
_TabsPanel.displayName = "Tabs.Panel";
|
|
96
87
|
|
|
97
|
-
|
|
98
|
-
List: typeof _TabsList;
|
|
99
|
-
Tab: typeof _TabsTab;
|
|
100
|
-
Panel: typeof _TabsPanel;
|
|
101
|
-
} = Object.assign(_Tabs, {
|
|
102
|
-
List: _TabsList,
|
|
103
|
-
Tab: _TabsTab,
|
|
104
|
-
Panel: _TabsPanel,
|
|
105
|
-
});
|
|
88
|
+
TabPanel.displayName = "TabPanel";
|
|
@@ -13,23 +13,6 @@ const meta: Meta<typeof Text> = {
|
|
|
13
13
|
"The standard `<Text>` component controls common body sizing scales and implicit paragraphs governed by the active theme layer. For semantic headings (`h1` through `h6`), use `<Title>` instead.",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
|
-
controls: {
|
|
17
|
-
include: [
|
|
18
|
-
"layer",
|
|
19
|
-
"withLayer",
|
|
20
|
-
"variant",
|
|
21
|
-
"children",
|
|
22
|
-
"component",
|
|
23
|
-
"size",
|
|
24
|
-
"icon",
|
|
25
|
-
"disabled",
|
|
26
|
-
"href",
|
|
27
|
-
"onClick",
|
|
28
|
-
"onChange",
|
|
29
|
-
"value",
|
|
30
|
-
"checked",
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
16
|
},
|
|
34
17
|
argTypes: {
|
|
35
18
|
variant: {
|
|
@@ -45,6 +28,11 @@ const meta: Meta<typeof Text> = {
|
|
|
45
28
|
description:
|
|
46
29
|
"Controls the standard logical boundary definitions natively extracted from Figma.",
|
|
47
30
|
},
|
|
31
|
+
c: {
|
|
32
|
+
control: "text",
|
|
33
|
+
description:
|
|
34
|
+
"Standard Mantine color string mapped via internal boundaries. Example: `dimmed`",
|
|
35
|
+
},
|
|
48
36
|
},
|
|
49
37
|
};
|
|
50
38
|
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import { Typography } from "../Typography/Typography";
|
|
3
3
|
import { type RecursicaOverStyled } from "../../utils/filterStylingProps";
|
|
4
|
-
import { type
|
|
5
|
-
|
|
6
|
-
export type TextVariant =
|
|
7
|
-
| "body"
|
|
8
|
-
| "body-small"
|
|
9
|
-
| "caption"
|
|
10
|
-
| "overline"
|
|
11
|
-
| "subtitle"
|
|
12
|
-
| "subtitle-small";
|
|
13
|
-
|
|
14
|
-
export type RecursicaTextProps = Omit<MuiTypographyProps, "variant"> & {
|
|
15
|
-
variant?: TextVariant;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
component?: React.ElementType;
|
|
18
|
-
};
|
|
4
|
+
import { type RecursicaTextProps } from "@recursica/adapter-common";
|
|
19
5
|
|
|
20
6
|
export type TextProps = RecursicaOverStyled<RecursicaTextProps>;
|
|
21
7
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type TextFieldProps as MuiTextareaProps,
|
|
5
5
|
} from "@mui/material";
|
|
6
6
|
import { type ReadOnlyControlProps } from "@recursica/adapter-common";
|
|
7
|
-
|
|
7
|
+
// Removed unused TextField import
|
|
8
8
|
import {
|
|
9
9
|
filterStylingProps,
|
|
10
10
|
type RecursicaOverStyled,
|
|
@@ -13,6 +13,8 @@ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/For
|
|
|
13
13
|
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
14
14
|
import styles from "./TextArea.module.css";
|
|
15
15
|
|
|
16
|
+
import { type RecursicaTextAreaProps as BaseRecursicaTextAreaProps } from "@recursica/adapter-common";
|
|
17
|
+
|
|
16
18
|
export interface RecursicaTextAreaProps
|
|
17
19
|
extends Omit<
|
|
18
20
|
MuiTextareaProps,
|
|
@@ -29,14 +31,8 @@ export interface RecursicaTextAreaProps
|
|
|
29
31
|
| "labelWithEditIcon"
|
|
30
32
|
| "onLabelEditClick"
|
|
31
33
|
>,
|
|
32
|
-
ReadOnlyControlProps
|
|
33
|
-
|
|
34
|
-
maxRows?: number;
|
|
35
|
-
/** Minimum rows of autosize textarea */
|
|
36
|
-
minRows?: number;
|
|
37
|
-
/** If set, enables textarea height growing with its content */
|
|
38
|
-
autosize?: boolean;
|
|
39
|
-
}
|
|
34
|
+
ReadOnlyControlProps,
|
|
35
|
+
BaseRecursicaTextAreaProps {}
|
|
40
36
|
|
|
41
37
|
export type TextAreaProps = RecursicaOverStyled<RecursicaTextAreaProps>;
|
|
42
38
|
|
|
@@ -58,6 +54,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
|
58
54
|
assistiveWithIcon,
|
|
59
55
|
error,
|
|
60
56
|
required,
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
61
58
|
withAsterisk,
|
|
62
59
|
id,
|
|
63
60
|
className,
|
|
@@ -121,7 +118,6 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
|
121
118
|
assistiveWithIcon={assistiveWithIcon}
|
|
122
119
|
error={error}
|
|
123
120
|
required={required}
|
|
124
|
-
withAsterisk={withAsterisk}
|
|
125
121
|
id={id}
|
|
126
122
|
readOnly={readOnly}
|
|
127
123
|
readOnlyComponent={readOnlyComponent}
|
|
@@ -133,20 +129,14 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
|
133
129
|
/* Naked Input execution safely decoupled from Mui's macro Input.Wrapper DOM hooks */
|
|
134
130
|
<MuiTextarea
|
|
135
131
|
multiline
|
|
136
|
-
|
|
132
|
+
inputRef={ref as any}
|
|
137
133
|
classes={mergedClassNames}
|
|
138
134
|
disabled={disabled}
|
|
139
135
|
value={value}
|
|
140
136
|
defaultValue={defaultValue}
|
|
141
137
|
label={undefined}
|
|
142
|
-
description={undefined}
|
|
143
138
|
error={undefined}
|
|
144
139
|
required={undefined}
|
|
145
|
-
withAsterisk={undefined}
|
|
146
|
-
wrapperProps={{
|
|
147
|
-
"data-disabled": disabled ? "true" : undefined,
|
|
148
|
-
"data-error": error ? "true" : undefined,
|
|
149
|
-
}}
|
|
150
140
|
{...(sanitizedProps as unknown as MuiTextareaProps)}
|
|
151
141
|
/>
|
|
152
142
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import React from "react";
|
|
3
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
2
|
import { TextField } from "./TextField";
|
|
5
3
|
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
6
|
-
|
|
7
4
|
const meta: Meta<typeof TextField> = {
|
|
8
5
|
title: "UI-Kit/TextField",
|
|
9
6
|
component: TextField,
|
|
@@ -15,7 +12,7 @@ const meta: Meta<typeof TextField> = {
|
|
|
15
12
|
The \`TextField\` primitive functions as a universal text entry input natively integrated directly into the unified \`FormControlWrapper\` architecture.
|
|
16
13
|
|
|
17
14
|
### Architectural Decoupling
|
|
18
|
-
Recursica forcibly overrides the internal
|
|
15
|
+
Recursica forcibly overrides the internal Mantine \`Input.Wrapper\` defaults injecting an untamed \`<Input>\` layout primitive perfectly mapped back into our rigid design systems. State modifiers (e.g. Focus, Errors) hook flawlessly back onto our CSS module mapping variable colors strictly accurately.
|
|
19
16
|
|
|
20
17
|
### Examples
|
|
21
18
|
Always structure horizontal architectures via the generic \`formLayout\` parameter.
|
|
@@ -29,21 +26,6 @@ Always structure horizontal architectures via the generic \`formLayout\` paramet
|
|
|
29
26
|
`,
|
|
30
27
|
},
|
|
31
28
|
},
|
|
32
|
-
controls: {
|
|
33
|
-
include: [
|
|
34
|
-
"disabled",
|
|
35
|
-
"error",
|
|
36
|
-
"required",
|
|
37
|
-
"label",
|
|
38
|
-
"assistiveText",
|
|
39
|
-
"readOnly",
|
|
40
|
-
"formLayout",
|
|
41
|
-
"labelSize",
|
|
42
|
-
"labelAlignment",
|
|
43
|
-
"labelOptionalText",
|
|
44
|
-
"labelWithEditIcon",
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
29
|
},
|
|
48
30
|
argTypes: {
|
|
49
31
|
...formControlArgTypes,
|
|
@@ -86,7 +68,6 @@ export const Default: Story = {
|
|
|
86
68
|
assistiveText:
|
|
87
69
|
"Tokens are stored identically locally and strictly ephemeral.",
|
|
88
70
|
},
|
|
89
|
-
render: ({ ...args }: any) => <TextField {...args} />,
|
|
90
71
|
};
|
|
91
72
|
|
|
92
73
|
export const FormsSideBySide: Story = {
|
|
@@ -97,7 +78,6 @@ export const FormsSideBySide: Story = {
|
|
|
97
78
|
"Specify the exact cluster administrative credentials enforcing strict domain policies. This violently long string tests native textual wrapping safely mapping alongside inputs.",
|
|
98
79
|
formLayout: "side-by-side",
|
|
99
80
|
},
|
|
100
|
-
render: ({ ...args }: any) => <TextField {...args} />,
|
|
101
81
|
};
|
|
102
82
|
|
|
103
83
|
export const WithLeadingIcon: Story = {
|
|
@@ -120,7 +100,6 @@ export const WithLeadingIcon: Story = {
|
|
|
120
100
|
</svg>
|
|
121
101
|
),
|
|
122
102
|
},
|
|
123
|
-
render: ({ ...args }: any) => <TextField {...args} />,
|
|
124
103
|
};
|
|
125
104
|
|
|
126
105
|
export const WithTrailingIcon: Story = {
|
|
@@ -142,7 +121,6 @@ export const WithTrailingIcon: Story = {
|
|
|
142
121
|
</svg>
|
|
143
122
|
),
|
|
144
123
|
},
|
|
145
|
-
render: ({ ...args }: any) => <TextField {...args} />,
|
|
146
124
|
};
|
|
147
125
|
|
|
148
126
|
export const Disabled: Story = {
|
|
@@ -151,7 +129,6 @@ export const Disabled: Story = {
|
|
|
151
129
|
placeholder: "Disabled primitive map...",
|
|
152
130
|
disabled: true,
|
|
153
131
|
},
|
|
154
|
-
render: ({ ...args }: any) => <TextField {...args} />,
|
|
155
132
|
};
|
|
156
133
|
|
|
157
134
|
export const ErrorState: Story = {
|
|
@@ -163,7 +140,6 @@ export const ErrorState: Story = {
|
|
|
163
140
|
"Critical runtime node disconnect detected traversing DOM architecture.",
|
|
164
141
|
required: true,
|
|
165
142
|
},
|
|
166
|
-
render: ({ ...args }: any) => <TextField {...args} />,
|
|
167
143
|
};
|
|
168
144
|
|
|
169
145
|
export const StaticReadOnly: Story = {
|
|
@@ -173,7 +149,6 @@ export const StaticReadOnly: Story = {
|
|
|
173
149
|
value: "Explicitly Uneditable Bound Output",
|
|
174
150
|
readOnly: true,
|
|
175
151
|
},
|
|
176
|
-
render: ({ ...args }: any) => <TextField {...args} />,
|
|
177
152
|
};
|
|
178
153
|
|
|
179
154
|
export const EditableReadOnly: Story = {
|
|
@@ -184,5 +159,4 @@ export const EditableReadOnly: Story = {
|
|
|
184
159
|
readOnly: true,
|
|
185
160
|
labelWithEditIcon: true,
|
|
186
161
|
},
|
|
187
|
-
render: ({ ...args }: any) => <TextField {...args} />,
|
|
188
162
|
};
|
|
@@ -9,6 +9,8 @@ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/For
|
|
|
9
9
|
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
10
10
|
import styles from "./TextField.module.css";
|
|
11
11
|
|
|
12
|
+
import { type RecursicaTextFieldProps as BaseRecursicaTextFieldProps } from "@recursica/adapter-common";
|
|
13
|
+
|
|
12
14
|
export interface RecursicaTextFieldProps
|
|
13
15
|
extends Omit<
|
|
14
16
|
InputBaseProps,
|
|
@@ -33,12 +35,8 @@ export interface RecursicaTextFieldProps
|
|
|
33
35
|
| "labelWithEditIcon"
|
|
34
36
|
| "onLabelEditClick"
|
|
35
37
|
>,
|
|
36
|
-
ReadOnlyControlProps
|
|
37
|
-
|
|
38
|
-
leftSection?: React.ReactNode;
|
|
39
|
-
/** Renders a section on the right side of the input (e.g. clear button). Maps to Mantine's rightSection natively. */
|
|
40
|
-
rightSection?: React.ReactNode;
|
|
41
|
-
}
|
|
38
|
+
ReadOnlyControlProps,
|
|
39
|
+
BaseRecursicaTextFieldProps {}
|
|
42
40
|
|
|
43
41
|
export type TextFieldProps = RecursicaOverStyled<RecursicaTextFieldProps>;
|
|
44
42
|
|