@recursica/mui-adapter 0.10.0 → 0.11.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 +11 -0
- package/dist/mui-adapter.cjs +30 -20
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.js +2394 -2104
- 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/Dropdown/Dropdown.d.ts +1 -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/Timeline/index.d.ts +1 -0
- package/dist/src/components/Typography/index.d.ts +1 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/index.d.ts +84 -1
- package/package.json +1 -1
- package/src/OverStyling.tsx +63 -2
- package/src/components/Accordion/Accordion.tsx +1 -0
- 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/Dropdown/Dropdown.tsx +8 -2
- package/src/components/HoverCard/HoverCard.tsx +7 -4
- package/src/components/Menu/Menu.stories.tsx +14 -8
- package/src/components/Modal/Modal.tsx +11 -4
- 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/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/TextArea/TextArea.tsx +9 -1
- package/src/components/TextField/TextField.tsx +2 -0
- package/src/components/Timeline/index.ts +1 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/index.ts +169 -1
|
@@ -129,7 +129,7 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>(
|
|
|
129
129
|
if (!isNaN(parsed)) {
|
|
130
130
|
// Clamp input value to bounds
|
|
131
131
|
const clamped = Math.max(min, Math.min(max, parsed));
|
|
132
|
-
handleValueChange(null as
|
|
132
|
+
handleValueChange(null as unknown as Event, clamped);
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
|
|
@@ -211,7 +211,7 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>(
|
|
|
211
211
|
label={label}
|
|
212
212
|
assistiveText={assistiveText}
|
|
213
213
|
assistiveWithIcon={assistiveWithIcon}
|
|
214
|
-
error={error
|
|
214
|
+
error={!!error}
|
|
215
215
|
required={required}
|
|
216
216
|
id={id}
|
|
217
217
|
readOnly={readOnly}
|
|
@@ -239,14 +239,22 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>(
|
|
|
239
239
|
disabled={disabled}
|
|
240
240
|
value={resolvedValue}
|
|
241
241
|
onChange={handleValueChange}
|
|
242
|
-
onChangeCommitted={
|
|
242
|
+
onChangeCommitted={
|
|
243
|
+
onChangeEnd as unknown as (
|
|
244
|
+
event: Event | React.SyntheticEvent,
|
|
245
|
+
value: number | number[],
|
|
246
|
+
) => void
|
|
247
|
+
}
|
|
243
248
|
min={min}
|
|
244
249
|
max={max}
|
|
245
250
|
step={step}
|
|
246
251
|
valueLabelDisplay={tooltipLabel === null ? "off" : "auto"}
|
|
247
252
|
valueLabelFormat={
|
|
248
253
|
typeof tooltipLabel === "function"
|
|
249
|
-
? (tooltipLabel as
|
|
254
|
+
? (tooltipLabel as unknown as (
|
|
255
|
+
value: number,
|
|
256
|
+
index: number,
|
|
257
|
+
) => React.ReactNode)
|
|
250
258
|
: undefined
|
|
251
259
|
}
|
|
252
260
|
{...(sanitizedProps as unknown as MuiSliderProps)}
|
|
@@ -37,7 +37,7 @@ export type RecursicaSwitchPropsAlias =
|
|
|
37
37
|
|
|
38
38
|
export type SwitchProps = RecursicaOverStyled<RecursicaSwitchPropsAlias>;
|
|
39
39
|
|
|
40
|
-
type SwitchComponent =
|
|
40
|
+
type SwitchComponent = React.ComponentType<SwitchProps>;
|
|
41
41
|
|
|
42
42
|
export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
|
|
43
43
|
function Switch(props, ref) {
|
|
@@ -137,6 +137,7 @@ export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
|
|
|
137
137
|
// We omit Mui's sizing/coloring so we rely strictly on variables from Switch.module.css
|
|
138
138
|
const switchNode = (
|
|
139
139
|
<MuiSwitch
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
141
|
ref={ref as any}
|
|
141
142
|
className={!label ? `${finalClass} ${styles.inner}` : styles.inner}
|
|
142
143
|
classes={mergedClassNames}
|
|
@@ -22,7 +22,7 @@ export type TableProps = RecursicaOverStyled<
|
|
|
22
22
|
>;
|
|
23
23
|
|
|
24
24
|
const TableBase = forwardRef<HTMLTableElement, TableProps>(function Table(
|
|
25
|
-
{ overStyled = false,
|
|
25
|
+
{ overStyled = false, ...rest },
|
|
26
26
|
ref,
|
|
27
27
|
) {
|
|
28
28
|
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
@@ -18,7 +18,14 @@ import { type RecursicaTextAreaProps as BaseRecursicaTextAreaProps } from "@recu
|
|
|
18
18
|
export interface RecursicaTextAreaProps
|
|
19
19
|
extends Omit<
|
|
20
20
|
MuiTextareaProps,
|
|
21
|
-
|
|
21
|
+
| keyof React.HTMLAttributes<HTMLDivElement>
|
|
22
|
+
| "size"
|
|
23
|
+
| "variant"
|
|
24
|
+
| "radius"
|
|
25
|
+
| "wrapperProps"
|
|
26
|
+
| "maxRows"
|
|
27
|
+
| "minRows"
|
|
28
|
+
| "classes"
|
|
22
29
|
>,
|
|
23
30
|
Omit<
|
|
24
31
|
RecursicaFormControlWrapperProps,
|
|
@@ -122,6 +129,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
|
122
129
|
/* Naked Input execution safely decoupled from Mui's macro Input.Wrapper DOM hooks */
|
|
123
130
|
<MuiTextarea
|
|
124
131
|
multiline
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
133
|
inputRef={ref as any}
|
|
126
134
|
classes={mergedClassNames}
|
|
127
135
|
disabled={disabled}
|
|
@@ -137,7 +137,9 @@ export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
|
137
137
|
required={required}
|
|
138
138
|
id={id}
|
|
139
139
|
readOnly={readOnly}
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
141
|
readOnlyComponent={readOnlyComponent as any}
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
141
143
|
emptyValueComponent={(emptyValueComponent as any) || undefined}
|
|
142
144
|
readOnlyType="text"
|
|
143
145
|
readOnlyValue={value !== undefined ? value : defaultValue}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Typography";
|
package/src/components/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,7 +1,175 @@
|
|
|
1
1
|
import "@recursica/adapter-common/style.css";
|
|
2
|
-
|
|
2
|
+
import * as rawComponents from "./components";
|
|
3
|
+
import { wrapComponent } from "@recursica/adapter-common";
|
|
4
|
+
|
|
3
5
|
export * from "@recursica/adapter-common";
|
|
4
6
|
|
|
7
|
+
// Expose unwrapped structural layout primitives to preserve their polymorphic types
|
|
8
|
+
export const Box = rawComponents.Box;
|
|
9
|
+
export const Flex = rawComponents.Flex;
|
|
10
|
+
export const Group = rawComponents.Group;
|
|
11
|
+
export const Stack = rawComponents.Stack;
|
|
12
|
+
export const Container = rawComponents.Container;
|
|
13
|
+
export const Typography = rawComponents.Typography;
|
|
14
|
+
export const FileInput = rawComponents.FileInput;
|
|
15
|
+
export const FileUpload = rawComponents.FileUpload;
|
|
16
|
+
|
|
17
|
+
// Statically wrap and export components to inject overStyled visual highlight in dev mode
|
|
18
|
+
export const Accordion = wrapComponent(
|
|
19
|
+
rawComponents.Accordion,
|
|
20
|
+
) as typeof rawComponents.Accordion;
|
|
21
|
+
export const AccordionItem = wrapComponent(
|
|
22
|
+
rawComponents.AccordionItem,
|
|
23
|
+
) as typeof rawComponents.AccordionItem;
|
|
24
|
+
export const AccordionControl = wrapComponent(
|
|
25
|
+
rawComponents.AccordionControl,
|
|
26
|
+
) as typeof rawComponents.AccordionControl;
|
|
27
|
+
export const AccordionPanel = wrapComponent(
|
|
28
|
+
rawComponents.AccordionPanel,
|
|
29
|
+
) as typeof rawComponents.AccordionPanel;
|
|
30
|
+
export const AssistiveElement = wrapComponent(
|
|
31
|
+
rawComponents.AssistiveElement,
|
|
32
|
+
) as typeof rawComponents.AssistiveElement;
|
|
33
|
+
export const Autocomplete = wrapComponent(
|
|
34
|
+
rawComponents.Autocomplete,
|
|
35
|
+
) as typeof rawComponents.Autocomplete;
|
|
36
|
+
export const Avatar = wrapComponent(
|
|
37
|
+
rawComponents.Avatar,
|
|
38
|
+
) as typeof rawComponents.Avatar;
|
|
39
|
+
export const Badge = wrapComponent(
|
|
40
|
+
rawComponents.Badge,
|
|
41
|
+
) as typeof rawComponents.Badge;
|
|
42
|
+
export const Breadcrumb = wrapComponent(
|
|
43
|
+
rawComponents.Breadcrumb,
|
|
44
|
+
) as typeof rawComponents.Breadcrumb;
|
|
45
|
+
export const Button = wrapComponent(
|
|
46
|
+
rawComponents.Button,
|
|
47
|
+
) as typeof rawComponents.Button;
|
|
48
|
+
export const Card = wrapComponent(
|
|
49
|
+
rawComponents.Card,
|
|
50
|
+
) as typeof rawComponents.Card;
|
|
51
|
+
export const Checkbox = wrapComponent(
|
|
52
|
+
rawComponents.Checkbox,
|
|
53
|
+
) as typeof rawComponents.Checkbox;
|
|
54
|
+
export const CheckboxGroup = wrapComponent(
|
|
55
|
+
rawComponents.CheckboxGroup,
|
|
56
|
+
) as typeof rawComponents.CheckboxGroup;
|
|
57
|
+
export const Chip = wrapComponent(
|
|
58
|
+
rawComponents.Chip,
|
|
59
|
+
) as typeof rawComponents.Chip;
|
|
60
|
+
export const DatePicker = wrapComponent(
|
|
61
|
+
rawComponents.DatePicker,
|
|
62
|
+
) as typeof rawComponents.DatePicker;
|
|
63
|
+
export const Dropdown = wrapComponent(
|
|
64
|
+
rawComponents.Dropdown,
|
|
65
|
+
) as typeof rawComponents.Dropdown;
|
|
66
|
+
export const FormControlLayout = wrapComponent(
|
|
67
|
+
rawComponents.FormControlLayout,
|
|
68
|
+
) as typeof rawComponents.FormControlLayout;
|
|
69
|
+
export const FormControlWrapper = wrapComponent(
|
|
70
|
+
rawComponents.FormControlWrapper,
|
|
71
|
+
) as typeof rawComponents.FormControlWrapper;
|
|
72
|
+
export const HoverCard = wrapComponent(
|
|
73
|
+
rawComponents.HoverCard,
|
|
74
|
+
) as typeof rawComponents.HoverCard;
|
|
75
|
+
export const Label = wrapComponent(
|
|
76
|
+
rawComponents.Label,
|
|
77
|
+
) as typeof rawComponents.Label;
|
|
78
|
+
export const Link = wrapComponent(
|
|
79
|
+
rawComponents.Link,
|
|
80
|
+
) as typeof rawComponents.Link;
|
|
81
|
+
export const Loader = wrapComponent(
|
|
82
|
+
rawComponents.Loader,
|
|
83
|
+
) as typeof rawComponents.Loader;
|
|
84
|
+
export const Menu = wrapComponent(
|
|
85
|
+
rawComponents.Menu,
|
|
86
|
+
) as typeof rawComponents.Menu;
|
|
87
|
+
export const MenuItem = wrapComponent(
|
|
88
|
+
rawComponents.MenuItem,
|
|
89
|
+
) as typeof rawComponents.MenuItem;
|
|
90
|
+
export const MenuDivider = wrapComponent(
|
|
91
|
+
rawComponents.MenuDivider,
|
|
92
|
+
) as typeof rawComponents.MenuDivider;
|
|
93
|
+
export const Modal = wrapComponent(
|
|
94
|
+
rawComponents.Modal,
|
|
95
|
+
) as typeof rawComponents.Modal;
|
|
96
|
+
export const NumberInput = wrapComponent(
|
|
97
|
+
rawComponents.NumberInput,
|
|
98
|
+
) as typeof rawComponents.NumberInput;
|
|
99
|
+
export const Pagination = wrapComponent(
|
|
100
|
+
rawComponents.Pagination,
|
|
101
|
+
) as typeof rawComponents.Pagination;
|
|
102
|
+
export const Panel = wrapComponent(
|
|
103
|
+
rawComponents.Panel,
|
|
104
|
+
) as typeof rawComponents.Panel;
|
|
105
|
+
export const PanelFooter = wrapComponent(
|
|
106
|
+
rawComponents.PanelFooter,
|
|
107
|
+
) as typeof rawComponents.PanelFooter;
|
|
108
|
+
export const Radio = wrapComponent(
|
|
109
|
+
rawComponents.Radio,
|
|
110
|
+
) as typeof rawComponents.Radio;
|
|
111
|
+
export const RadioGroup = wrapComponent(
|
|
112
|
+
rawComponents.RadioGroup,
|
|
113
|
+
) as typeof rawComponents.RadioGroup;
|
|
114
|
+
export const ReadOnlyField = wrapComponent(
|
|
115
|
+
rawComponents.ReadOnlyField,
|
|
116
|
+
) as typeof rawComponents.ReadOnlyField;
|
|
117
|
+
export const SegmentedControl = wrapComponent(
|
|
118
|
+
rawComponents.SegmentedControl,
|
|
119
|
+
) as typeof rawComponents.SegmentedControl;
|
|
120
|
+
export const Slider = wrapComponent(
|
|
121
|
+
rawComponents.Slider,
|
|
122
|
+
) as typeof rawComponents.Slider;
|
|
123
|
+
export const Stepper = wrapComponent(
|
|
124
|
+
rawComponents.Stepper,
|
|
125
|
+
) as typeof rawComponents.Stepper;
|
|
126
|
+
export const Switch = wrapComponent(
|
|
127
|
+
rawComponents.Switch,
|
|
128
|
+
) as typeof rawComponents.Switch;
|
|
129
|
+
export const SwitchGroup = wrapComponent(
|
|
130
|
+
rawComponents.SwitchGroup,
|
|
131
|
+
) as typeof rawComponents.SwitchGroup;
|
|
132
|
+
export const Table = wrapComponent(
|
|
133
|
+
rawComponents.Table,
|
|
134
|
+
) as typeof rawComponents.Table;
|
|
135
|
+
export const Tab = wrapComponent(rawComponents.Tab) as typeof rawComponents.Tab;
|
|
136
|
+
export const TabPanel = wrapComponent(
|
|
137
|
+
rawComponents.TabPanel,
|
|
138
|
+
) as typeof rawComponents.TabPanel;
|
|
139
|
+
export const Tabs = wrapComponent(
|
|
140
|
+
rawComponents.Tabs,
|
|
141
|
+
) as typeof rawComponents.Tabs;
|
|
142
|
+
export const Text = wrapComponent(
|
|
143
|
+
rawComponents.Text,
|
|
144
|
+
) as typeof rawComponents.Text;
|
|
145
|
+
export const TextArea = wrapComponent(
|
|
146
|
+
rawComponents.TextArea,
|
|
147
|
+
) as typeof rawComponents.TextArea;
|
|
148
|
+
export const TextField = wrapComponent(
|
|
149
|
+
rawComponents.TextField,
|
|
150
|
+
) as typeof rawComponents.TextField;
|
|
151
|
+
export const TimePicker = wrapComponent(
|
|
152
|
+
rawComponents.TimePicker,
|
|
153
|
+
) as typeof rawComponents.TimePicker;
|
|
154
|
+
export const Timeline = wrapComponent(
|
|
155
|
+
rawComponents.Timeline,
|
|
156
|
+
) as typeof rawComponents.Timeline;
|
|
157
|
+
export const TimelineItem = wrapComponent(
|
|
158
|
+
rawComponents.TimelineItem,
|
|
159
|
+
) as typeof rawComponents.TimelineItem;
|
|
160
|
+
export const Title = wrapComponent(
|
|
161
|
+
rawComponents.Title,
|
|
162
|
+
) as typeof rawComponents.Title;
|
|
163
|
+
export const Toast = wrapComponent(
|
|
164
|
+
rawComponents.Toast,
|
|
165
|
+
) as typeof rawComponents.Toast;
|
|
166
|
+
export const Tooltip = wrapComponent(
|
|
167
|
+
rawComponents.Tooltip,
|
|
168
|
+
) as typeof rawComponents.Tooltip;
|
|
169
|
+
export const TransferList = wrapComponent(
|
|
170
|
+
rawComponents.TransferList,
|
|
171
|
+
) as typeof rawComponents.TransferList;
|
|
172
|
+
|
|
5
173
|
export type {
|
|
6
174
|
RecursicaAutocompleteProps,
|
|
7
175
|
RecursicaDropdownProps,
|