@recursica/mui-adapter 0.10.0 → 0.12.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 +26 -0
- package/dist/mui-adapter.cjs +30 -20
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.css +1 -1
- package/dist/mui-adapter.js +2840 -2484
- package/dist/mui-adapter.js.map +1 -1
- package/dist/src/components/Avatar/Avatar.d.ts +16 -1
- package/dist/src/components/Badge/Badge.d.ts +16 -1
- package/dist/src/components/Card/Card.d.ts +36 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts +17 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +2 -1
- package/dist/src/components/Radio/index.d.ts +1 -0
- package/dist/src/components/Switch/Switch.d.ts +1 -1
- package/dist/src/components/Switch/index.d.ts +1 -0
- package/dist/src/components/TextArea/TextArea.d.ts +1 -1
- package/dist/src/components/TextField/TextField.d.ts +1 -1
- package/dist/src/components/Timeline/index.d.ts +1 -0
- package/dist/src/components/Tree/Tree.d.ts +9 -0
- package/dist/src/components/Tree/index.d.ts +1 -0
- package/dist/src/components/Typography/index.d.ts +1 -0
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/index.d.ts +85 -1
- package/package.json +2 -2
- package/src/OverStyling.tsx +63 -2
- package/src/components/Accordion/Accordion.tsx +8 -6
- package/src/components/Autocomplete/Autocomplete.tsx +2 -0
- package/src/components/Avatar/Avatar.tsx +2 -2
- package/src/components/Badge/Badge.tsx +1 -1
- package/src/components/Card/Card.tsx +4 -2
- package/src/components/Checkbox/Checkbox.tsx +6 -1
- package/src/components/Checkbox/CheckboxGroup.tsx +1 -0
- package/src/components/Container/Container.tsx +6 -3
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -1
- package/src/components/DatePicker/DatePicker.tsx +40 -3
- package/src/components/Dropdown/Dropdown.stories.tsx +0 -6
- package/src/components/Dropdown/Dropdown.tsx +9 -2
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +5 -1
- package/src/components/HoverCard/HoverCard.stories.tsx +1 -1
- package/src/components/HoverCard/HoverCard.tsx +7 -4
- package/src/components/Menu/Menu.stories.tsx +15 -9
- package/src/components/Modal/Modal.tsx +11 -4
- package/src/components/NumberInput/NumberInput.stories.tsx +0 -2
- package/src/components/NumberInput/NumberInput.tsx +27 -0
- package/src/components/Pagination/Pagination.tsx +12 -5
- package/src/components/Radio/Radio.tsx +1 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +5 -1
- package/src/components/Slider/Slider.tsx +12 -4
- package/src/components/Stack/Stack.tsx +8 -2
- package/src/components/Stepper/Stepper.stories.tsx +2 -2
- package/src/components/Stepper/Stepper.tsx +1 -0
- package/src/components/Switch/Switch.tsx +2 -1
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Tabs/Tabs.stories.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +2 -0
- package/src/components/TextArea/TextArea.tsx +10 -1
- package/src/components/TextField/TextField.tsx +8 -1
- package/src/components/Timeline/TimelineItem.tsx +2 -0
- package/src/components/Timeline/index.ts +1 -0
- package/src/components/Tree/Tree.module.css +43 -0
- package/src/components/Tree/Tree.stories.tsx +14 -0
- package/src/components/Tree/Tree.tsx +24 -0
- package/src/components/Tree/index.ts +1 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +172 -1
|
@@ -7,4 +7,19 @@ export type AvatarProps = RecursicaOverStyled<Omit<MuiAvatarProps, "variant" | "
|
|
|
7
7
|
*
|
|
8
8
|
* Supports polymorphism via the `component` prop or `renderRoot` for custom element rendering.
|
|
9
9
|
*/
|
|
10
|
-
export declare const Avatar:
|
|
10
|
+
export declare const Avatar: import('react').ForwardRefExoticComponent<(Omit<Omit<import('@recursica/adapter-common').WithRecursicaSpacing<Omit<MuiAvatarProps, "color" | "variant" | "size" | "radius"> & RecursicaAvatarProps>, import('@recursica/adapter-common').BlockedStylingKeys> & import('@recursica/adapter-common').ForbiddenStyles & {
|
|
11
|
+
overStyled?: false | undefined;
|
|
12
|
+
}, "ref"> | Omit<Omit<Omit<MuiAvatarProps, "color" | "variant" | "size" | "radius"> & RecursicaAvatarProps, "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "gap" | "rowGap" | "columnGap"> & {
|
|
13
|
+
m?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
14
|
+
mx?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
15
|
+
my?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
16
|
+
mt?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
17
|
+
mb?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
18
|
+
ml?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
19
|
+
mr?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
20
|
+
gap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
21
|
+
rowGap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
22
|
+
columnGap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
23
|
+
} & {
|
|
24
|
+
overStyled: true;
|
|
25
|
+
}, "ref">) & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -7,4 +7,19 @@ export type BadgeProps = RecursicaOverStyled<Omit<MuiBadgeProps, "variant" | "si
|
|
|
7
7
|
*
|
|
8
8
|
* Supports polymorphism via the `component` prop or `renderRoot` for custom element rendering.
|
|
9
9
|
*/
|
|
10
|
-
export declare const Badge:
|
|
10
|
+
export declare const Badge: import('react').ForwardRefExoticComponent<(Omit<Omit<import('@recursica/adapter-common').WithRecursicaSpacing<Omit<MuiBadgeProps, "color" | "variant" | "size" | "radius"> & RecursicaBadgeProps>, import('@recursica/adapter-common').BlockedStylingKeys> & import('@recursica/adapter-common').ForbiddenStyles & {
|
|
11
|
+
overStyled?: false | undefined;
|
|
12
|
+
}, "ref"> | Omit<Omit<Omit<MuiBadgeProps, "color" | "variant" | "size" | "radius"> & RecursicaBadgeProps, "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "gap" | "rowGap" | "columnGap"> & {
|
|
13
|
+
m?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
14
|
+
mx?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
15
|
+
my?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
16
|
+
mt?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
17
|
+
mb?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
18
|
+
ml?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
19
|
+
mr?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
20
|
+
gap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
21
|
+
rowGap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
22
|
+
columnGap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
23
|
+
} & {
|
|
24
|
+
overStyled: true;
|
|
25
|
+
}, "ref">) & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -36,7 +36,42 @@ export declare const CardContent: import('react').ForwardRefExoticComponent<Card
|
|
|
36
36
|
* Supports polymorphism via the `component` prop or `renderRoot` for custom element rendering.
|
|
37
37
|
* Use dot-notation sub-components for structured card layouts.
|
|
38
38
|
*/
|
|
39
|
-
declare const PolymorphicCard:
|
|
39
|
+
declare const PolymorphicCard: import('react').ForwardRefExoticComponent<(Omit<Omit<import('@recursica/adapter-common').WithRecursicaSpacing<import('@mui/material').CardOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "classes" | "style" | "sx" | "children" | "variant" | "elevation" | "square" | "raised"> & {
|
|
40
|
+
component?: React.ElementType | undefined;
|
|
41
|
+
} & RecursicaCardProps>, import('@recursica/adapter-common').BlockedStylingKeys> & import('@recursica/adapter-common').ForbiddenStyles & {
|
|
42
|
+
overStyled?: false | undefined;
|
|
43
|
+
} & {
|
|
44
|
+
flex?: string | number;
|
|
45
|
+
flexGrow?: string | number;
|
|
46
|
+
flexShrink?: string | number;
|
|
47
|
+
flexBasis?: string | number;
|
|
48
|
+
grow?: string | number;
|
|
49
|
+
h?: string | number;
|
|
50
|
+
height?: string | number;
|
|
51
|
+
}, "ref"> | Omit<Omit<import('@mui/material').CardOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className" | "classes" | "style" | "sx" | "children" | "variant" | "elevation" | "square" | "raised"> & {
|
|
52
|
+
component?: React.ElementType | undefined;
|
|
53
|
+
} & RecursicaCardProps, "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "gap" | "rowGap" | "columnGap"> & {
|
|
54
|
+
m?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
55
|
+
mx?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
56
|
+
my?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
57
|
+
mt?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
58
|
+
mb?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
59
|
+
ml?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
60
|
+
mr?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
61
|
+
gap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
62
|
+
rowGap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
63
|
+
columnGap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
64
|
+
} & {
|
|
65
|
+
overStyled: true;
|
|
66
|
+
} & {
|
|
67
|
+
flex?: string | number;
|
|
68
|
+
flexGrow?: string | number;
|
|
69
|
+
flexShrink?: string | number;
|
|
70
|
+
flexBasis?: string | number;
|
|
71
|
+
grow?: string | number;
|
|
72
|
+
h?: string | number;
|
|
73
|
+
height?: string | number;
|
|
74
|
+
}, "ref">) & import('react').RefAttributes<HTMLDivElement>>;
|
|
40
75
|
export declare const Card: typeof PolymorphicCard & {
|
|
41
76
|
Section: typeof CardSection;
|
|
42
77
|
Header: typeof CardHeader;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { RecursicaDatePickerProps } from '@recursica/adapter-common';
|
|
3
|
-
export type DatePickerProps = React.HTMLAttributes<HTMLDivElement> & RecursicaDatePickerProps
|
|
3
|
+
export type DatePickerProps = Omit<React.HTMLAttributes<HTMLDivElement>, "value" | "onChange" | "defaultValue"> & RecursicaDatePickerProps & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
assistiveText?: string;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
withAsterisk?: boolean;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
value?: Date | null;
|
|
12
|
+
defaultValue?: Date | null;
|
|
13
|
+
onChange?: (value: Date | null) => void;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
formLayout?: "stacked" | "side-by-side";
|
|
16
|
+
leftSection?: React.ReactNode;
|
|
17
|
+
labelWithEditIcon?: boolean;
|
|
18
|
+
onLabelEditClick?: () => void;
|
|
19
|
+
};
|
|
4
20
|
export declare const DatePicker: React.FC<DatePickerProps>;
|
|
@@ -3,7 +3,7 @@ import { SelectProps as MuiSelectProps } from '@mui/material';
|
|
|
3
3
|
import { ReadOnlyControlProps, RecursicaDropdownProps as BaseRecursicaDropdownProps } from '@recursica/adapter-common';
|
|
4
4
|
import { RecursicaOverStyled } from '../../utils/filterStylingProps';
|
|
5
5
|
import { RecursicaFormControlWrapperProps } from '../FormControlWrapper/FormControlWrapper';
|
|
6
|
-
export interface RecursicaDropdownProps extends Omit<MuiSelectProps, "size" | "variant" | "classes" | "inputProps" | "SelectDisplayProps">, Omit<RecursicaFormControlWrapperProps, "controlMaxWidth" | "controlMinWidth">, ReadOnlyControlProps, BaseRecursicaDropdownProps {
|
|
6
|
+
export interface RecursicaDropdownProps extends Omit<MuiSelectProps, keyof React.HTMLAttributes<HTMLDivElement> | "size" | "variant" | "classes" | "inputProps" | "SelectDisplayProps" | "ref" | "error">, Omit<RecursicaFormControlWrapperProps, "controlMaxWidth" | "controlMinWidth">, ReadOnlyControlProps, BaseRecursicaDropdownProps {
|
|
7
7
|
}
|
|
8
8
|
export type DropdownProps = RecursicaOverStyled<RecursicaDropdownProps>;
|
|
9
9
|
export declare const Dropdown: React.ForwardRefExoticComponent<(Omit<Omit<import('@recursica/adapter-common').WithRecursicaSpacing<RecursicaDropdownProps>, import('@recursica/adapter-common').BlockedStylingKeys> & import('@recursica/adapter-common').ForbiddenStyles & {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { FormControlProps } from '@mui/material';
|
|
3
3
|
import { RecursicaFormControlWrapperProps as BaseRecursicaFormControlWrapperProps } from '@recursica/adapter-common';
|
|
4
|
-
export interface RecursicaFormControlWrapperProps extends Omit<FormControlProps, "margin" | "variant" | "size" | "color">, BaseRecursicaFormControlWrapperProps {
|
|
4
|
+
export interface RecursicaFormControlWrapperProps extends Omit<FormControlProps, "margin" | "variant" | "size" | "color" | "error">, BaseRecursicaFormControlWrapperProps {
|
|
5
5
|
overStyled?: boolean;
|
|
6
6
|
label?: React.ReactNode;
|
|
7
7
|
focused?: boolean;
|
|
8
|
+
error?: React.ReactNode;
|
|
8
9
|
}
|
|
9
10
|
export type FormControlWrapperProps = RecursicaFormControlWrapperProps;
|
|
10
11
|
export declare const FormControlWrapper: React.ForwardRefExoticComponent<Omit<RecursicaFormControlWrapperProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,6 +5,6 @@ import { FormControlLayoutProps } from '../FormControlLayout/FormControlLayout';
|
|
|
5
5
|
export type SwitchWrapperProps = Omit<MuiSwitchProps, "size" | "color" | "radius" | "variant"> & RecursicaSwitchProps & ReadOnlyControlProps & Pick<FormControlLayoutProps, "formLayout" | "labelSize" | "controlMaxWidth" | "controlMinWidth">;
|
|
6
6
|
export type RecursicaSwitchPropsAlias = RequireAccessibleLabel<SwitchWrapperProps>;
|
|
7
7
|
export type SwitchProps = RecursicaOverStyled<RecursicaSwitchPropsAlias>;
|
|
8
|
-
type SwitchComponent =
|
|
8
|
+
type SwitchComponent = React.ComponentType<SwitchProps>;
|
|
9
9
|
export declare const Switch: SwitchComponent;
|
|
10
10
|
export {};
|
|
@@ -3,7 +3,7 @@ import { TextFieldProps as MuiTextareaProps } from '@mui/material';
|
|
|
3
3
|
import { ReadOnlyControlProps, RecursicaTextAreaProps as BaseRecursicaTextAreaProps } from '@recursica/adapter-common';
|
|
4
4
|
import { RecursicaOverStyled } from '../../utils/filterStylingProps';
|
|
5
5
|
import { RecursicaFormControlWrapperProps } from '../FormControlWrapper/FormControlWrapper';
|
|
6
|
-
export interface RecursicaTextAreaProps extends Omit<MuiTextareaProps, "size" | "variant" | "radius" | "wrapperProps" | "maxRows" | "minRows">, Omit<RecursicaFormControlWrapperProps, "controlMaxWidth" | "controlMinWidth">, ReadOnlyControlProps, BaseRecursicaTextAreaProps {
|
|
6
|
+
export interface RecursicaTextAreaProps extends Omit<MuiTextareaProps, keyof React.HTMLAttributes<HTMLDivElement> | "size" | "variant" | "radius" | "wrapperProps" | "maxRows" | "minRows" | "classes" | "error">, Omit<RecursicaFormControlWrapperProps, "controlMaxWidth" | "controlMinWidth">, ReadOnlyControlProps, BaseRecursicaTextAreaProps {
|
|
7
7
|
}
|
|
8
8
|
export type TextAreaProps = RecursicaOverStyled<RecursicaTextAreaProps>;
|
|
9
9
|
export declare const TextArea: React.ForwardRefExoticComponent<(Omit<Omit<import('@recursica/adapter-common').WithRecursicaSpacing<RecursicaTextAreaProps>, import('@recursica/adapter-common').BlockedStylingKeys> & import('@recursica/adapter-common').ForbiddenStyles & {
|
|
@@ -3,7 +3,7 @@ import { InputBaseProps } from '@mui/material';
|
|
|
3
3
|
import { ReadOnlyControlProps, RecursicaTextFieldProps as BaseRecursicaTextFieldProps } from '@recursica/adapter-common';
|
|
4
4
|
import { RecursicaOverStyled } from '../../utils/filterStylingProps';
|
|
5
5
|
import { RecursicaFormControlWrapperProps } from '../FormControlWrapper/FormControlWrapper';
|
|
6
|
-
export interface RecursicaTextFieldProps extends Omit<InputBaseProps, "color" | "size" | "startAdornment" | "endAdornment" | "autoComplete">, Omit<React.ComponentPropsWithoutRef<"input">, keyof InputBaseProps | "size" | "color" | "style" | "className" | "id">, Pick<RecursicaFormControlWrapperProps, "label" | "error" | "required" | "id" | "assistiveText" | "assistiveWithIcon" | "formLayout" | "labelSize" | "labelAlignment" | "labelOptionalText" | "labelWithEditIcon" | "onLabelEditClick">, ReadOnlyControlProps, BaseRecursicaTextFieldProps {
|
|
6
|
+
export interface RecursicaTextFieldProps extends Omit<InputBaseProps, "color" | "size" | "startAdornment" | "endAdornment" | "autoComplete" | "error">, Omit<React.ComponentPropsWithoutRef<"input">, keyof InputBaseProps | "size" | "color" | "style" | "className" | "id">, Pick<RecursicaFormControlWrapperProps, "label" | "error" | "required" | "id" | "assistiveText" | "assistiveWithIcon" | "formLayout" | "labelSize" | "labelAlignment" | "labelOptionalText" | "labelWithEditIcon" | "onLabelEditClick">, ReadOnlyControlProps, BaseRecursicaTextFieldProps {
|
|
7
7
|
}
|
|
8
8
|
export type TextFieldProps = RecursicaOverStyled<RecursicaTextFieldProps>;
|
|
9
9
|
export declare const TextField: React.ForwardRefExoticComponent<(Omit<Omit<import('@recursica/adapter-common').WithRecursicaSpacing<RecursicaTextFieldProps>, import('@recursica/adapter-common').BlockedStylingKeys> & import('@recursica/adapter-common').ForbiddenStyles & {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RecursicaOverStyled } from '../../utils/filterStylingProps';
|
|
3
|
+
export interface TreeProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
4
|
+
overStyled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Placeholder component for Tree (Coming Soon).
|
|
8
|
+
*/
|
|
9
|
+
export declare const Tree: React.ForwardRefExoticComponent<RecursicaOverStyled<TreeProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Tree';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Typography';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,3 +1,87 @@
|
|
|
1
|
-
|
|
1
|
+
import * as rawComponents from "./components";
|
|
2
2
|
export * from '@recursica/adapter-common';
|
|
3
|
+
export declare const Box: <C extends React.ElementType = "div">(props: rawComponents.BoxProps<C> & {
|
|
4
|
+
ref?: React.ForwardedRef<any>;
|
|
5
|
+
}) => React.ReactElement | null;
|
|
6
|
+
export declare const Flex: import('react').ForwardRefExoticComponent<Omit<rawComponents.FlexProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const Group: import('react').ForwardRefExoticComponent<Omit<rawComponents.GroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const Stack: import('react').ForwardRefExoticComponent<Omit<rawComponents.StackProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const Container: import('react').ForwardRefExoticComponent<Omit<rawComponents.ContainerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const Typography: import('react').ForwardRefExoticComponent<(Omit<Omit<import('@recursica/adapter-common').WithRecursicaSpacing<Omit<import('@mui/material').TypographyProps, "variant"> & {
|
|
11
|
+
typographyClass: string;
|
|
12
|
+
component?: React.ElementType;
|
|
13
|
+
}>, import('@recursica/adapter-common').BlockedStylingKeys> & import('@recursica/adapter-common').ForbiddenStyles & {
|
|
14
|
+
overStyled?: false | undefined;
|
|
15
|
+
}, "ref"> | Omit<Omit<Omit<import('@mui/material').TypographyProps, "variant"> & {
|
|
16
|
+
typographyClass: string;
|
|
17
|
+
component?: React.ElementType;
|
|
18
|
+
}, "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "gap" | "rowGap" | "columnGap"> & {
|
|
19
|
+
m?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
20
|
+
mx?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
21
|
+
my?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
22
|
+
mt?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
23
|
+
mb?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
24
|
+
ml?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
25
|
+
mr?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
26
|
+
gap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
27
|
+
rowGap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
28
|
+
columnGap?: string | number | import('@recursica/adapter-common').RecursicaSpacing;
|
|
29
|
+
} & {
|
|
30
|
+
overStyled: true;
|
|
31
|
+
}, "ref">) & import('react').RefAttributes<HTMLElement>>;
|
|
32
|
+
export declare const FileInput: import('react').FC<rawComponents.FileInputProps>;
|
|
33
|
+
export declare const FileUpload: import('react').FC<rawComponents.FileUploadProps>;
|
|
34
|
+
export declare const Accordion: typeof rawComponents.Accordion;
|
|
35
|
+
export declare const AccordionItem: typeof rawComponents.AccordionItem;
|
|
36
|
+
export declare const AccordionControl: typeof rawComponents.AccordionControl;
|
|
37
|
+
export declare const AccordionPanel: typeof rawComponents.AccordionPanel;
|
|
38
|
+
export declare const AssistiveElement: typeof rawComponents.AssistiveElement;
|
|
39
|
+
export declare const Autocomplete: typeof rawComponents.Autocomplete;
|
|
40
|
+
export declare const Avatar: typeof rawComponents.Avatar;
|
|
41
|
+
export declare const Badge: typeof rawComponents.Badge;
|
|
42
|
+
export declare const Breadcrumb: typeof rawComponents.Breadcrumb;
|
|
43
|
+
export declare const Button: typeof rawComponents.Button;
|
|
44
|
+
export declare const Card: typeof rawComponents.Card;
|
|
45
|
+
export declare const Checkbox: typeof rawComponents.Checkbox;
|
|
46
|
+
export declare const CheckboxGroup: typeof rawComponents.CheckboxGroup;
|
|
47
|
+
export declare const Chip: typeof rawComponents.Chip;
|
|
48
|
+
export declare const DatePicker: typeof rawComponents.DatePicker;
|
|
49
|
+
export declare const Dropdown: typeof rawComponents.Dropdown;
|
|
50
|
+
export declare const FormControlLayout: typeof rawComponents.FormControlLayout;
|
|
51
|
+
export declare const FormControlWrapper: typeof rawComponents.FormControlWrapper;
|
|
52
|
+
export declare const HoverCard: typeof rawComponents.HoverCard;
|
|
53
|
+
export declare const Label: typeof rawComponents.Label;
|
|
54
|
+
export declare const Link: typeof rawComponents.Link;
|
|
55
|
+
export declare const Loader: typeof rawComponents.Loader;
|
|
56
|
+
export declare const Menu: typeof rawComponents.Menu;
|
|
57
|
+
export declare const MenuItem: typeof rawComponents.MenuItem;
|
|
58
|
+
export declare const MenuDivider: typeof rawComponents.MenuDivider;
|
|
59
|
+
export declare const Modal: typeof rawComponents.Modal;
|
|
60
|
+
export declare const NumberInput: typeof rawComponents.NumberInput;
|
|
61
|
+
export declare const Pagination: typeof rawComponents.Pagination;
|
|
62
|
+
export declare const Panel: typeof rawComponents.Panel;
|
|
63
|
+
export declare const PanelFooter: typeof rawComponents.PanelFooter;
|
|
64
|
+
export declare const Radio: typeof rawComponents.Radio;
|
|
65
|
+
export declare const RadioGroup: typeof rawComponents.RadioGroup;
|
|
66
|
+
export declare const ReadOnlyField: typeof rawComponents.ReadOnlyField;
|
|
67
|
+
export declare const SegmentedControl: typeof rawComponents.SegmentedControl;
|
|
68
|
+
export declare const Slider: typeof rawComponents.Slider;
|
|
69
|
+
export declare const Stepper: typeof rawComponents.Stepper;
|
|
70
|
+
export declare const Switch: typeof rawComponents.Switch;
|
|
71
|
+
export declare const SwitchGroup: typeof rawComponents.SwitchGroup;
|
|
72
|
+
export declare const Table: typeof rawComponents.Table;
|
|
73
|
+
export declare const Tab: typeof rawComponents.Tab;
|
|
74
|
+
export declare const TabPanel: typeof rawComponents.TabPanel;
|
|
75
|
+
export declare const Tabs: typeof rawComponents.Tabs;
|
|
76
|
+
export declare const Text: typeof rawComponents.Text;
|
|
77
|
+
export declare const TextArea: typeof rawComponents.TextArea;
|
|
78
|
+
export declare const TextField: typeof rawComponents.TextField;
|
|
79
|
+
export declare const TimePicker: typeof rawComponents.TimePicker;
|
|
80
|
+
export declare const Timeline: typeof rawComponents.Timeline;
|
|
81
|
+
export declare const TimelineItem: typeof rawComponents.TimelineItem;
|
|
82
|
+
export declare const Title: typeof rawComponents.Title;
|
|
83
|
+
export declare const Toast: typeof rawComponents.Toast;
|
|
84
|
+
export declare const Tooltip: typeof rawComponents.Tooltip;
|
|
85
|
+
export declare const TransferList: typeof rawComponents.TransferList;
|
|
86
|
+
export declare const Tree: typeof rawComponents.Tree;
|
|
3
87
|
export type { RecursicaAutocompleteProps, RecursicaDropdownProps, RecursicaFormControlWrapperProps, RecursicaNumberInputProps, RecursicaSliderProps, RecursicaTextAreaProps, RecursicaTextFieldProps, RecursicaToastProps, } from './components';
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "git+https://github.com/borderux/recursica.git",
|
|
14
14
|
"directory": "packages/mui-adapter"
|
|
15
15
|
},
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.12.0",
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"build-storybook": "storybook build -o storybook-static",
|
|
57
57
|
"lint": "eslint .",
|
|
58
58
|
"storybook": "storybook dev -p 6012",
|
|
59
|
-
"analyze-tokens": "analyze-tokens --css recursica_variables_scoped.css --dir src/components --output token-analysis.json",
|
|
59
|
+
"analyze-tokens": "analyze-tokens --css @recursica/official-release/recursica_variables_scoped.css --dir src/components --output token-analysis.json",
|
|
60
60
|
"prebuild": "npm run analyze-tokens"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
package/src/OverStyling.tsx
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import { Paper, Divider } from "@mui/material";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
Container,
|
|
4
|
+
Stack,
|
|
5
|
+
Box,
|
|
6
|
+
Text as RawText,
|
|
7
|
+
Title,
|
|
8
|
+
Switch as RawSwitch,
|
|
9
|
+
} from "./components";
|
|
10
|
+
import { Button as RawButton } from "./components/Button/Button";
|
|
11
|
+
import {
|
|
12
|
+
useGlobalOverStyled,
|
|
13
|
+
toggleGlobalOverStyled,
|
|
14
|
+
wrapComponent,
|
|
15
|
+
} from "@recursica/adapter-common";
|
|
16
|
+
|
|
17
|
+
const Button = wrapComponent(RawButton);
|
|
18
|
+
const Text = wrapComponent(RawText);
|
|
19
|
+
const Switch = wrapComponent(RawSwitch);
|
|
4
20
|
|
|
5
21
|
export const OverStylingInfo = () => {
|
|
22
|
+
const isHighlightActive = useGlobalOverStyled();
|
|
6
23
|
return (
|
|
7
24
|
<Container size="md" style={{ padding: "32px 0" }}>
|
|
8
25
|
<Paper variant="outlined" sx={{ p: 4, borderRadius: 2 }}>
|
|
@@ -172,6 +189,50 @@ export const OverStylingInfo = () => {
|
|
|
172
189
|
|
|
173
190
|
<Divider sx={{ mb: 4 }} />
|
|
174
191
|
|
|
192
|
+
<Title order={6} mb={1}>
|
|
193
|
+
Visual Auditing & Highlights (Development Only)
|
|
194
|
+
</Title>
|
|
195
|
+
<Text mb={2}>
|
|
196
|
+
To make it easy to spot technical debt and design system violations,
|
|
197
|
+
Recursica automatically tracks any component that uses the{" "}
|
|
198
|
+
<code>overStyled={`{true}`}</code> prop.
|
|
199
|
+
</Text>
|
|
200
|
+
<Text mb={2}>
|
|
201
|
+
In <strong>development builds</strong>, you can highlight all
|
|
202
|
+
over-styled components on the page. Open your browser's developer
|
|
203
|
+
console and run:
|
|
204
|
+
</Text>
|
|
205
|
+
<Box
|
|
206
|
+
component="pre"
|
|
207
|
+
sx={{
|
|
208
|
+
p: 1.5,
|
|
209
|
+
bgcolor: "grey.100",
|
|
210
|
+
borderRadius: 1,
|
|
211
|
+
fontSize: 13,
|
|
212
|
+
mt: 1,
|
|
213
|
+
mb: 2,
|
|
214
|
+
}}
|
|
215
|
+
>
|
|
216
|
+
<code>recursica.toggleOverStyled()</code>
|
|
217
|
+
</Box>
|
|
218
|
+
<Stack direction="row" alignItems="center" gap="rec-sm" mb="rec-md">
|
|
219
|
+
<Switch
|
|
220
|
+
label="Highlight Over-Styled Components"
|
|
221
|
+
checked={isHighlightActive}
|
|
222
|
+
onChange={() => toggleGlobalOverStyled()}
|
|
223
|
+
/>
|
|
224
|
+
</Stack>
|
|
225
|
+
<Text mb={4}>
|
|
226
|
+
This toggles a <strong>cyan 2px box shadow</strong> outline around the
|
|
227
|
+
children of all over-styled components. The wrapping elements use{" "}
|
|
228
|
+
<code>display: contents</code> under the hood to ensure they occupy
|
|
229
|
+
zero DOM space and do not affect flex, grid, or absolute positioning
|
|
230
|
+
flow. In production builds, this debugging helper is completely
|
|
231
|
+
disabled and stripped with zero performance overhead.
|
|
232
|
+
</Text>
|
|
233
|
+
|
|
234
|
+
<Divider sx={{ mb: 4 }} />
|
|
235
|
+
|
|
175
236
|
<Title order={6} mb={2}>
|
|
176
237
|
Live Example
|
|
177
238
|
</Title>
|
|
@@ -37,6 +37,7 @@ const ChevronIcon = () => (
|
|
|
37
37
|
const AccordionContext = createContext<{
|
|
38
38
|
value: string | string[] | null;
|
|
39
39
|
onChange: (val: string) => void;
|
|
40
|
+
chevron?: React.ReactNode;
|
|
40
41
|
} | null>(null);
|
|
41
42
|
|
|
42
43
|
// ==== ACCORDION CONTAINER ====
|
|
@@ -53,6 +54,7 @@ const AccordionBase = forwardRef<HTMLDivElement, AccordionProps>(
|
|
|
53
54
|
defaultValue,
|
|
54
55
|
onChange,
|
|
55
56
|
multiple = false,
|
|
57
|
+
chevron,
|
|
56
58
|
children,
|
|
57
59
|
...rest
|
|
58
60
|
},
|
|
@@ -90,7 +92,7 @@ const AccordionBase = forwardRef<HTMLDivElement, AccordionProps>(
|
|
|
90
92
|
|
|
91
93
|
return (
|
|
92
94
|
<AccordionContext.Provider
|
|
93
|
-
value={{ value: activeValue, onChange: handleItemChange }}
|
|
95
|
+
value={{ value: activeValue, onChange: handleItemChange, chevron }}
|
|
94
96
|
>
|
|
95
97
|
<div
|
|
96
98
|
ref={ref}
|
|
@@ -175,6 +177,7 @@ export const AccordionItem = forwardRef<
|
|
|
175
177
|
</>
|
|
176
178
|
) : (
|
|
177
179
|
children
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
178
181
|
)) as any
|
|
179
182
|
}
|
|
180
183
|
</MuiAccordion>
|
|
@@ -201,15 +204,14 @@ export const AccordionControl = forwardRef<
|
|
|
201
204
|
const finalClass =
|
|
202
205
|
[styles.control, classNameProp].filter(Boolean).join(" ") || undefined;
|
|
203
206
|
|
|
207
|
+
const ctx = useContext(AccordionContext);
|
|
208
|
+
const resolvedChevron = ctx?.chevron ?? <ChevronIcon />;
|
|
209
|
+
|
|
204
210
|
return (
|
|
205
211
|
<MuiAccordionSummary
|
|
206
212
|
ref={ref}
|
|
207
213
|
className={finalClass}
|
|
208
|
-
expandIcon={
|
|
209
|
-
<span className={styles.chevron}>
|
|
210
|
-
<ChevronIcon />
|
|
211
|
-
</span>
|
|
212
|
-
}
|
|
214
|
+
expandIcon={<span className={styles.chevron}>{resolvedChevron}</span>}
|
|
213
215
|
{...(sanitizedProps as unknown as MuiAccordionSummaryProps)}
|
|
214
216
|
>
|
|
215
217
|
{leftIcon && (
|
|
@@ -18,6 +18,7 @@ import { type RecursicaAutocompleteProps as BaseRecursicaAutocompleteProps } fro
|
|
|
18
18
|
|
|
19
19
|
export interface RecursicaAutocompleteProps
|
|
20
20
|
extends Omit<
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
22
|
MuiAutocompleteProps<any, any, any, any, "div">,
|
|
22
23
|
| "variant"
|
|
23
24
|
| "size"
|
|
@@ -32,6 +33,7 @@ export interface RecursicaAutocompleteProps
|
|
|
32
33
|
| "controlMaxWidth"
|
|
33
34
|
| "controlMinWidth"
|
|
34
35
|
| "error"
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
37
|
| keyof MuiAutocompleteProps<any, any, any, any, "div">
|
|
36
38
|
>,
|
|
37
39
|
ReadOnlyControlProps,
|
|
@@ -74,7 +74,7 @@ const _Avatar = forwardRef<HTMLDivElement, AvatarProps>(function Avatar(
|
|
|
74
74
|
ref={ref}
|
|
75
75
|
className={classNameProp}
|
|
76
76
|
classes={mergedClassNames}
|
|
77
|
-
variant={mapVariant[variant] as
|
|
77
|
+
variant={mapVariant[variant] as unknown as MuiAvatarProps["variant"]}
|
|
78
78
|
src={src}
|
|
79
79
|
data-variant={variant}
|
|
80
80
|
data-size={size}
|
|
@@ -98,4 +98,4 @@ _Avatar.displayName = "Avatar";
|
|
|
98
98
|
*
|
|
99
99
|
* Supports polymorphism via the `component` prop or `renderRoot` for custom element rendering.
|
|
100
100
|
*/
|
|
101
|
-
export const Avatar = _Avatar
|
|
101
|
+
export const Avatar = _Avatar;
|
|
@@ -45,7 +45,9 @@ const CardBase = forwardRef<HTMLDivElement, CardProps>(function Card(
|
|
|
45
45
|
] as const;
|
|
46
46
|
safeCardLayoutKeys.forEach((key) => {
|
|
47
47
|
if (key in rest && !(key in sanitizedProps)) {
|
|
48
|
-
(sanitizedProps as
|
|
48
|
+
(sanitizedProps as Record<string, unknown>)[key] = (
|
|
49
|
+
rest as Record<string, unknown>
|
|
50
|
+
)[key];
|
|
49
51
|
}
|
|
50
52
|
});
|
|
51
53
|
|
|
@@ -193,7 +195,7 @@ CardContent.displayName = "CardContent";
|
|
|
193
195
|
* Supports polymorphism via the `component` prop or `renderRoot` for custom element rendering.
|
|
194
196
|
* Use dot-notation sub-components for structured card layouts.
|
|
195
197
|
*/
|
|
196
|
-
const PolymorphicCard = CardBase
|
|
198
|
+
const PolymorphicCard = CardBase;
|
|
197
199
|
|
|
198
200
|
// Attach static components for dot-notation access
|
|
199
201
|
const _card = PolymorphicCard as unknown as Record<string, unknown>;
|
|
@@ -133,7 +133,12 @@ export const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(
|
|
|
133
133
|
}
|
|
134
134
|
} else {
|
|
135
135
|
if (restRecord.onChange) {
|
|
136
|
-
(
|
|
136
|
+
(
|
|
137
|
+
restRecord.onChange as (
|
|
138
|
+
event: React.ChangeEvent<HTMLInputElement>,
|
|
139
|
+
checked: boolean,
|
|
140
|
+
) => void
|
|
141
|
+
)(e, e.target.checked);
|
|
137
142
|
}
|
|
138
143
|
}
|
|
139
144
|
};
|
|
@@ -11,6 +11,7 @@ import styles from "./Checkbox.module.css";
|
|
|
11
11
|
|
|
12
12
|
import { FormGroup as MuiFormGroup } from "@mui/material";
|
|
13
13
|
|
|
14
|
+
// eslint-disable-next-line react-refresh/only-export-components
|
|
14
15
|
export const CheckboxGroupContext = React.createContext<{
|
|
15
16
|
value?: any[];
|
|
16
17
|
onChange?: (event: React.SyntheticEvent, value: any) => void;
|
|
@@ -20,7 +20,7 @@ export type ContainerProps = WithRecursicaSpacing<
|
|
|
20
20
|
>;
|
|
21
21
|
|
|
22
22
|
export const Container = forwardRef<HTMLDivElement, ContainerProps>(
|
|
23
|
-
function Container({ children, size, ...rest }, ref) {
|
|
23
|
+
function Container({ children, size, fluid, ...rest }, ref) {
|
|
24
24
|
const mapSize: Record<string, "xs" | "sm" | "md" | "lg" | "xl"> = {
|
|
25
25
|
"rec-sm": "sm",
|
|
26
26
|
"rec-default": "md",
|
|
@@ -30,8 +30,11 @@ export const Container = forwardRef<HTMLDivElement, ContainerProps>(
|
|
|
30
30
|
"rec-2xl": "xl",
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const resolvedSize =
|
|
34
|
-
|
|
33
|
+
const resolvedSize = fluid
|
|
34
|
+
? false
|
|
35
|
+
: typeof size === "string" && mapSize[size]
|
|
36
|
+
? mapSize[size]
|
|
37
|
+
: size;
|
|
35
38
|
|
|
36
39
|
return (
|
|
37
40
|
<MUIContainer
|
|
@@ -1,10 +1,47 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
2
|
import React from "react";
|
|
2
3
|
import "./DatePicker.module.css";
|
|
3
4
|
import { type RecursicaDatePickerProps } from "@recursica/adapter-common";
|
|
4
5
|
|
|
5
|
-
export type DatePickerProps =
|
|
6
|
-
|
|
6
|
+
export type DatePickerProps = Omit<
|
|
7
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
8
|
+
"value" | "onChange" | "defaultValue"
|
|
9
|
+
> &
|
|
10
|
+
RecursicaDatePickerProps & {
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
assistiveText?: string;
|
|
14
|
+
error?: React.ReactNode;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
withAsterisk?: boolean;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
value?: Date | null;
|
|
19
|
+
defaultValue?: Date | null;
|
|
20
|
+
onChange?: (value: Date | null) => void;
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
formLayout?: "stacked" | "side-by-side";
|
|
23
|
+
leftSection?: React.ReactNode;
|
|
24
|
+
labelWithEditIcon?: boolean;
|
|
25
|
+
onLabelEditClick?: () => void;
|
|
26
|
+
};
|
|
7
27
|
|
|
8
|
-
export const DatePicker: React.FC<DatePickerProps> = (
|
|
28
|
+
export const DatePicker: React.FC<DatePickerProps> = ({
|
|
29
|
+
disabled,
|
|
30
|
+
label,
|
|
31
|
+
assistiveText,
|
|
32
|
+
error,
|
|
33
|
+
required,
|
|
34
|
+
withAsterisk,
|
|
35
|
+
placeholder,
|
|
36
|
+
value,
|
|
37
|
+
defaultValue,
|
|
38
|
+
onChange,
|
|
39
|
+
readOnly,
|
|
40
|
+
formLayout,
|
|
41
|
+
leftSection,
|
|
42
|
+
labelWithEditIcon,
|
|
43
|
+
onLabelEditClick,
|
|
44
|
+
...props
|
|
45
|
+
}) => {
|
|
9
46
|
return <div {...props}>DatePicker</div>;
|
|
10
47
|
};
|