@stratakit/mui 0.3.0 → 0.4.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 +56 -1
- package/dist/DEV/Icon.js +6 -0
- package/dist/DEV/Root.js +36 -28
- package/dist/DEV/index.js +1 -3
- package/dist/DEV/styles.css.js +1 -1
- package/dist/DEV/~components/MuiBottomNavigation.js +23 -0
- package/dist/DEV/~components/MuiButtonBase.js +2 -2
- package/dist/DEV/~components/MuiCard.js +44 -1
- package/dist/DEV/~components/MuiChip.js +42 -41
- package/dist/DEV/~components/MuiDivider.js +15 -0
- package/dist/DEV/~components/MuiStepper.js +21 -0
- package/dist/DEV/{createTheme.js → ~createTheme.js} +103 -18
- package/dist/Icon.d.ts +3 -1
- package/dist/Icon.js +6 -0
- package/dist/Root.d.ts +3 -2
- package/dist/Root.js +13 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/dist/styles.css.js +1 -1
- package/dist/types.d.ts +9 -1
- package/dist/~components/MuiBottomNavigation.d.ts +2 -0
- package/dist/~components/MuiBottomNavigation.js +23 -0
- package/dist/~components/MuiButtonBase.js +2 -1
- package/dist/~components/MuiCard.d.ts +2 -1
- package/dist/~components/MuiCard.js +64 -1
- package/dist/~components/MuiChip.d.ts +5 -4
- package/dist/~components/MuiChip.js +6 -5
- package/dist/~components/MuiDivider.d.ts +6 -0
- package/dist/~components/MuiDivider.js +22 -0
- package/dist/~components/MuiStepper.d.ts +2 -0
- package/dist/~components/MuiStepper.js +26 -0
- package/dist/~createTheme.d.ts +3 -0
- package/dist/{createTheme.js → ~createTheme.js} +93 -21
- package/package.json +3 -3
- package/dist/createTheme.d.ts +0 -16
|
@@ -4,56 +4,57 @@ import { Role } from "@ariakit/react/role";
|
|
|
4
4
|
import { VisuallyHidden } from "@ariakit/react/visually-hidden";
|
|
5
5
|
import IconButton from "@mui/material/IconButton";
|
|
6
6
|
import { useTheme } from "@mui/material/styles";
|
|
7
|
-
import {
|
|
7
|
+
import { forwardRef } from "@stratakit/foundations/secret-internals";
|
|
8
|
+
import { DismissCircleIcon } from "../Icon.js";
|
|
8
9
|
import { MuiButtonBase } from "./MuiButtonBase.js";
|
|
9
10
|
const MuiChipContext = React.createContext(void 0);
|
|
10
|
-
const MuiChip =
|
|
11
|
+
const MuiChip = forwardRef((props, forwardedRef) => {
|
|
12
|
+
const { role, deleteLabel, ...rest } = props;
|
|
13
|
+
const clearId = React.useId();
|
|
14
|
+
const [labelId, setLabelId] = React.useState(void 0);
|
|
15
|
+
const isClickable = props.className?.includes("MuiChip-clickable") ?? false;
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
MuiChipContext.Provider,
|
|
18
|
+
{
|
|
19
|
+
value: { labelId, setLabelId, clearId, isClickable, deleteLabel },
|
|
20
|
+
children: /* @__PURE__ */ jsx(
|
|
21
|
+
Role.div,
|
|
22
|
+
{
|
|
23
|
+
...rest,
|
|
24
|
+
role: role === "button" ? void 0 : role,
|
|
25
|
+
tabIndex: void 0,
|
|
26
|
+
ref: forwardedRef
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
DEV: MuiChip.displayName = "MuiChip";
|
|
33
|
+
const MuiChipLabel = forwardRef(
|
|
11
34
|
(props, forwardedRef) => {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
35
|
+
const defaultId = React.useId();
|
|
36
|
+
const { id = defaultId, ...rest } = props;
|
|
37
|
+
const { setLabelId, isClickable } = React.useContext(MuiChipContext) ?? {};
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
if (!setLabelId) return;
|
|
40
|
+
setLabelId(id);
|
|
41
|
+
return () => {
|
|
42
|
+
setLabelId(void 0);
|
|
43
|
+
};
|
|
44
|
+
}, [id, setLabelId]);
|
|
45
|
+
const Component = isClickable ? MuiButtonBase : Role.span;
|
|
16
46
|
return /* @__PURE__ */ jsx(
|
|
17
|
-
|
|
47
|
+
Component,
|
|
18
48
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
...rest,
|
|
24
|
-
role: role === "button" ? void 0 : role,
|
|
25
|
-
tabIndex: void 0,
|
|
26
|
-
ref: forwardedRef
|
|
27
|
-
}
|
|
28
|
-
)
|
|
49
|
+
id,
|
|
50
|
+
...rest,
|
|
51
|
+
ref: forwardedRef
|
|
29
52
|
}
|
|
30
53
|
);
|
|
31
54
|
}
|
|
32
55
|
);
|
|
33
|
-
DEV: MuiChip.displayName = "MuiChip";
|
|
34
|
-
const MuiChipLabel = React.forwardRef((props, forwardedRef) => {
|
|
35
|
-
const defaultId = React.useId();
|
|
36
|
-
const { id = defaultId, ...rest } = props;
|
|
37
|
-
const { setLabelId, isClickable } = React.useContext(MuiChipContext) ?? {};
|
|
38
|
-
React.useEffect(() => {
|
|
39
|
-
if (!setLabelId) return;
|
|
40
|
-
setLabelId(id);
|
|
41
|
-
return () => {
|
|
42
|
-
setLabelId(void 0);
|
|
43
|
-
};
|
|
44
|
-
}, [id, setLabelId]);
|
|
45
|
-
const Component = isClickable ? MuiButtonBase : Role.span;
|
|
46
|
-
return /* @__PURE__ */ jsx(
|
|
47
|
-
Component,
|
|
48
|
-
{
|
|
49
|
-
id,
|
|
50
|
-
...rest,
|
|
51
|
-
ref: forwardedRef
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
56
|
DEV: MuiChipLabel.displayName = "MuiChipLabel";
|
|
56
|
-
const MuiChipDeleteIcon =
|
|
57
|
+
const MuiChipDeleteIcon = forwardRef((props, forwardedRef) => {
|
|
57
58
|
const theme = useTheme();
|
|
58
59
|
const defaultLabel = theme.components?.MuiAutocomplete?.defaultProps?.clearText ?? "Clear";
|
|
59
60
|
const {
|
|
@@ -70,7 +71,7 @@ const MuiChipDeleteIcon = React.forwardRef((props, forwardedRef) => {
|
|
|
70
71
|
ref: forwardedRef,
|
|
71
72
|
children: [
|
|
72
73
|
/* @__PURE__ */ jsx(VisuallyHidden, { id: clearId, children: deleteLabel }),
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
+
/* @__PURE__ */ jsx(DismissCircleIcon, {})
|
|
74
75
|
]
|
|
75
76
|
}
|
|
76
77
|
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Role } from "@ariakit/react/role";
|
|
3
|
+
import { forwardRef } from "@stratakit/foundations/secret-internals";
|
|
4
|
+
const MuiDivider = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { children, ...rest } = props;
|
|
6
|
+
const defaultRender = (() => {
|
|
7
|
+
if (children || props["aria-orientation"] === "vertical") return /* @__PURE__ */ jsx("div", {});
|
|
8
|
+
return /* @__PURE__ */ jsx("hr", {});
|
|
9
|
+
})();
|
|
10
|
+
return /* @__PURE__ */ jsx(Role, { render: defaultRender, ...rest, ref: forwardedRef, children });
|
|
11
|
+
});
|
|
12
|
+
DEV: MuiDivider.displayName = "MuiDivider";
|
|
13
|
+
export {
|
|
14
|
+
MuiDivider
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Role } from "@ariakit/react/role";
|
|
3
|
+
import { forwardRef } from "@stratakit/foundations/secret-internals";
|
|
4
|
+
import { CheckmarkIcon, ErrorIcon } from "../Icon.js";
|
|
5
|
+
const MuiStepIcon = forwardRef(
|
|
6
|
+
(props, forwardedRef) => {
|
|
7
|
+
const { children: _, ...rest } = props;
|
|
8
|
+
const classList = props.className?.split(" ") ?? [];
|
|
9
|
+
const completed = classList.includes("Mui-completed");
|
|
10
|
+
const error = classList.includes("Mui-error");
|
|
11
|
+
const children = (() => {
|
|
12
|
+
if (error) return /* @__PURE__ */ jsx(ErrorIcon, {});
|
|
13
|
+
if (completed) return /* @__PURE__ */ jsx(CheckmarkIcon, {});
|
|
14
|
+
})();
|
|
15
|
+
return /* @__PURE__ */ jsx(Role.span, { "aria-hidden": "true", ...rest, ref: forwardedRef, children });
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
DEV: MuiStepIcon.displayName = "MuiStepIcon";
|
|
19
|
+
export {
|
|
20
|
+
MuiStepIcon
|
|
21
|
+
};
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Role } from "@ariakit/react/role";
|
|
4
4
|
import OutlinedInput from "@mui/material/OutlinedInput";
|
|
5
|
+
import StepConnector from "@mui/material/StepConnector";
|
|
5
6
|
import { createTheme as createMuiTheme } from "@mui/material/styles";
|
|
7
|
+
import cx from "classnames";
|
|
6
8
|
import { MuiBadge } from "./~components/MuiBadge.js";
|
|
9
|
+
import { MuiBottomNavigationAction } from "./~components/MuiBottomNavigation.js";
|
|
7
10
|
import { MuiButtonBase } from "./~components/MuiButtonBase.js";
|
|
8
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
MuiCard,
|
|
13
|
+
MuiCardActionArea,
|
|
14
|
+
MuiCardMedia
|
|
15
|
+
} from "./~components/MuiCard.js";
|
|
9
16
|
import {
|
|
10
17
|
MuiChip,
|
|
11
18
|
MuiChipDeleteIcon,
|
|
12
19
|
MuiChipLabel
|
|
13
20
|
} from "./~components/MuiChip.js";
|
|
21
|
+
import { MuiDivider } from "./~components/MuiDivider.js";
|
|
14
22
|
import { MuiIconButton } from "./~components/MuiIconButton.js";
|
|
15
23
|
import { MuiSnackbar } from "./~components/MuiSnackbar.js";
|
|
24
|
+
import { MuiStepIcon } from "./~components/MuiStepper.js";
|
|
16
25
|
import { MuiTableCell, MuiTableHead } from "./~components/MuiTable.js";
|
|
17
26
|
import {
|
|
18
27
|
ArrowDownIcon,
|
|
@@ -103,6 +112,7 @@ function createTheme() {
|
|
|
103
112
|
MuiAccordionSummary: {
|
|
104
113
|
defaultProps: {
|
|
105
114
|
component: Role.div,
|
|
115
|
+
nativeButton: false,
|
|
106
116
|
expandIcon: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
107
117
|
}
|
|
108
118
|
},
|
|
@@ -123,19 +133,46 @@ function createTheme() {
|
|
|
123
133
|
defaultProps: {
|
|
124
134
|
popupIcon: /* @__PURE__ */ jsx(ChevronDownIcon, {}),
|
|
125
135
|
clearIcon: /* @__PURE__ */ jsx(DismissIcon, {}),
|
|
136
|
+
renderOption: ({ key, ...props }, option, _, ownerState) => /* @__PURE__ */ jsx(
|
|
137
|
+
"li",
|
|
138
|
+
{
|
|
139
|
+
...props,
|
|
140
|
+
className: cx("MuiMenuItem-root", props.className),
|
|
141
|
+
children: ownerState.getOptionLabel(option)
|
|
142
|
+
},
|
|
143
|
+
key
|
|
144
|
+
),
|
|
126
145
|
slotProps: {
|
|
127
146
|
paper: {
|
|
128
147
|
elevation: 8
|
|
129
148
|
// match Menu elevation
|
|
130
149
|
},
|
|
150
|
+
chip: {
|
|
151
|
+
size: "small"
|
|
152
|
+
},
|
|
131
153
|
clearIndicator: {
|
|
132
|
-
tabIndex: 0
|
|
154
|
+
tabIndex: 0,
|
|
133
155
|
// make clear indicator focusable
|
|
156
|
+
size: "small"
|
|
157
|
+
},
|
|
158
|
+
popupIndicator: {
|
|
159
|
+
size: "small"
|
|
134
160
|
}
|
|
135
161
|
}
|
|
136
162
|
}
|
|
137
163
|
},
|
|
138
|
-
MuiAvatar: {
|
|
164
|
+
MuiAvatar: {
|
|
165
|
+
defaultProps: {
|
|
166
|
+
component: Role.div,
|
|
167
|
+
slotProps: { img: { draggable: false } }
|
|
168
|
+
},
|
|
169
|
+
styleOverrides: {
|
|
170
|
+
root: {
|
|
171
|
+
width: "var(--_MuiAvatar-size, 2rem)",
|
|
172
|
+
height: "var(--_MuiAvatar-size, 2rem)"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
139
176
|
MuiAvatarGroup: { defaultProps: { component: Role.div } },
|
|
140
177
|
MuiBackdrop: { defaultProps: { component: Role.div } },
|
|
141
178
|
MuiBadge: {
|
|
@@ -145,6 +182,11 @@ function createTheme() {
|
|
|
145
182
|
}
|
|
146
183
|
},
|
|
147
184
|
MuiBottomNavigation: { defaultProps: { component: Role.div } },
|
|
185
|
+
MuiBottomNavigationAction: {
|
|
186
|
+
defaultProps: {
|
|
187
|
+
component: MuiBottomNavigationAction
|
|
188
|
+
}
|
|
189
|
+
},
|
|
148
190
|
MuiBreadcrumbs: {
|
|
149
191
|
defaultProps: {
|
|
150
192
|
component: Role.nav,
|
|
@@ -179,18 +221,23 @@ function createTheme() {
|
|
|
179
221
|
MuiCardHeader: {
|
|
180
222
|
defaultProps: {
|
|
181
223
|
component: Role.div,
|
|
182
|
-
slotProps: {
|
|
224
|
+
slotProps: {
|
|
225
|
+
title: {
|
|
226
|
+
// biome-ignore lint/suspicious/noExplicitAny: MUI's CardHeader.title.component is hardcoded to "span"
|
|
227
|
+
component: Role.h2
|
|
228
|
+
}
|
|
229
|
+
}
|
|
183
230
|
}
|
|
184
231
|
},
|
|
185
|
-
MuiCardMedia: { defaultProps: { component:
|
|
232
|
+
MuiCardMedia: { defaultProps: { component: MuiCardMedia } },
|
|
186
233
|
MuiCheckbox: {
|
|
187
234
|
defaultProps: {
|
|
188
235
|
component: Role.span,
|
|
189
236
|
disableRipple: true,
|
|
190
237
|
// Checkbox doesn't inherit from ButtonBase
|
|
191
|
-
icon: /* @__PURE__ */ jsx(
|
|
192
|
-
checkedIcon: /* @__PURE__ */ jsx(
|
|
193
|
-
indeterminateIcon: /* @__PURE__ */ jsx(
|
|
238
|
+
icon: /* @__PURE__ */ jsx(Nothing, {}),
|
|
239
|
+
checkedIcon: /* @__PURE__ */ jsx(Nothing, {}),
|
|
240
|
+
indeterminateIcon: /* @__PURE__ */ jsx(Nothing, {})
|
|
194
241
|
}
|
|
195
242
|
},
|
|
196
243
|
MuiChip: {
|
|
@@ -208,7 +255,7 @@ function createTheme() {
|
|
|
208
255
|
MuiDialog: { defaultProps: { component: Role.div } },
|
|
209
256
|
MuiDialogContentText: { defaultProps: { component: Role.p } },
|
|
210
257
|
MuiDialogTitle: { defaultProps: { component: Role.h2 } },
|
|
211
|
-
MuiDivider: { defaultProps: { component:
|
|
258
|
+
MuiDivider: { defaultProps: { component: MuiDivider } },
|
|
212
259
|
MuiDrawer: { defaultProps: { component: Role.div } },
|
|
213
260
|
MuiFab: {
|
|
214
261
|
defaultProps: {
|
|
@@ -220,7 +267,6 @@ function createTheme() {
|
|
|
220
267
|
MuiFormHelperText: { defaultProps: { component: Role.p } },
|
|
221
268
|
MuiFormLabel: { defaultProps: { component: Role.label } },
|
|
222
269
|
MuiGrid: { defaultProps: { component: Role.div } },
|
|
223
|
-
MuiGridLegacy: { defaultProps: { component: Role.div } },
|
|
224
270
|
MuiIcon: { defaultProps: { component: Role.span } },
|
|
225
271
|
MuiIconButton: {
|
|
226
272
|
defaultProps: { component: MuiIconButton, color: "secondary" }
|
|
@@ -267,7 +313,10 @@ function createTheme() {
|
|
|
267
313
|
MuiList: { defaultProps: { component: Role.ul } },
|
|
268
314
|
MuiListItem: { defaultProps: { component: Role.li } },
|
|
269
315
|
MuiListItemButton: {
|
|
270
|
-
defaultProps: {
|
|
316
|
+
defaultProps: {
|
|
317
|
+
component: MuiButtonBase,
|
|
318
|
+
nativeButton: true
|
|
319
|
+
}
|
|
271
320
|
},
|
|
272
321
|
MuiListItemText: {
|
|
273
322
|
defaultProps: {
|
|
@@ -288,9 +337,11 @@ function createTheme() {
|
|
|
288
337
|
// Removes masked border from Select
|
|
289
338
|
}
|
|
290
339
|
},
|
|
340
|
+
MuiPagination: { defaultProps: { shape: "rounded" } },
|
|
291
341
|
MuiPaginationItem: {
|
|
292
342
|
defaultProps: {
|
|
293
343
|
component: MuiButtonBase,
|
|
344
|
+
shape: "rounded",
|
|
294
345
|
slots: {
|
|
295
346
|
previous: ChevronLeftIcon,
|
|
296
347
|
next: ChevronRightIcon,
|
|
@@ -306,8 +357,8 @@ function createTheme() {
|
|
|
306
357
|
component: Role.span,
|
|
307
358
|
disableRipple: true,
|
|
308
359
|
// Radio doesn't inherit from ButtonBase
|
|
309
|
-
icon: /* @__PURE__ */ jsx(
|
|
310
|
-
checkedIcon: /* @__PURE__ */ jsx(
|
|
360
|
+
icon: /* @__PURE__ */ jsx(Nothing, {}),
|
|
361
|
+
checkedIcon: /* @__PURE__ */ jsx(Nothing, {})
|
|
311
362
|
}
|
|
312
363
|
},
|
|
313
364
|
MuiRating: { defaultProps: { component: Role.span } },
|
|
@@ -335,15 +386,33 @@ function createTheme() {
|
|
|
335
386
|
},
|
|
336
387
|
MuiSnackbarContent: { defaultProps: { component: Role.div } },
|
|
337
388
|
MuiStack: { defaultProps: { component: Role.div } },
|
|
338
|
-
MuiStep: { defaultProps: { component: Role.
|
|
389
|
+
MuiStep: { defaultProps: { component: Role.li } },
|
|
339
390
|
MuiSwitch: { defaultProps: { component: Role.span } },
|
|
340
|
-
MuiStepper: {
|
|
391
|
+
MuiStepper: {
|
|
392
|
+
defaultProps: {
|
|
393
|
+
component: Role.ol,
|
|
394
|
+
connector: /* @__PURE__ */ jsx(StepConnector, { "aria-hidden": "true" })
|
|
395
|
+
// hiding the connector to prevent invalid markup
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
MuiStepLabel: {
|
|
399
|
+
defaultProps: {
|
|
400
|
+
slotProps: {
|
|
401
|
+
root: { component: Role.div },
|
|
402
|
+
stepIcon: { component: MuiStepIcon }
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
},
|
|
341
406
|
MuiSvgIcon: { defaultProps: { component: Role.svg } },
|
|
342
407
|
MuiSwipeableDrawer: { defaultProps: { component: Role.div } },
|
|
343
408
|
MuiTabs: { defaultProps: { component: Role.div } },
|
|
344
409
|
MuiTable: { defaultProps: { component: withRenderProp(Role, "table") } },
|
|
345
410
|
MuiTableBody: {
|
|
346
|
-
defaultProps: {
|
|
411
|
+
defaultProps: {
|
|
412
|
+
component: withRenderProp(Role, "tbody"),
|
|
413
|
+
role: void 0
|
|
414
|
+
// Removing role="rowgroup". See https://github.com/iTwin/stratakit/pull/1361
|
|
415
|
+
}
|
|
347
416
|
},
|
|
348
417
|
MuiTableCell: { defaultProps: { component: MuiTableCell } },
|
|
349
418
|
MuiTableContainer: {
|
|
@@ -384,7 +453,20 @@ function createTheme() {
|
|
|
384
453
|
MuiToolbar: { defaultProps: { component: Role.div } },
|
|
385
454
|
MuiTooltip: {
|
|
386
455
|
defaultProps: {
|
|
387
|
-
|
|
456
|
+
placement: "top",
|
|
457
|
+
describeChild: true,
|
|
458
|
+
slotProps: {
|
|
459
|
+
popper: {
|
|
460
|
+
modifiers: [
|
|
461
|
+
{
|
|
462
|
+
name: "offset",
|
|
463
|
+
options: {
|
|
464
|
+
offset: [0, 2]
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
}
|
|
388
470
|
}
|
|
389
471
|
},
|
|
390
472
|
MuiTypography: {
|
|
@@ -416,6 +498,9 @@ function withRenderProp(Role2, DefaultTagName) {
|
|
|
416
498
|
return /* @__PURE__ */ jsx(Role2, { render: /* @__PURE__ */ jsx(DefaultTagName, {}), ...props, ref: forwardedRef });
|
|
417
499
|
});
|
|
418
500
|
}
|
|
501
|
+
function Nothing() {
|
|
502
|
+
return null;
|
|
503
|
+
}
|
|
419
504
|
export {
|
|
420
505
|
createTheme
|
|
421
506
|
};
|
package/dist/Icon.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Icon } from "@stratakit/foundations";
|
|
3
3
|
declare const ArrowDownIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
4
|
+
declare const CheckmarkIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
4
5
|
declare const CaretsUpDownIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
5
6
|
declare const ChevronDownIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
6
7
|
declare const ChevronLeftIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -8,8 +9,9 @@ declare const ChevronLeftDoubleIcon: React.ForwardRefExoticComponent<Omit<React.
|
|
|
8
9
|
declare const ChevronRightIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
9
10
|
declare const ChevronRightDoubleIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
10
11
|
declare const DismissIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
12
|
+
declare const DismissCircleIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
11
13
|
declare const ErrorIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
12
14
|
declare const InfoIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
13
15
|
declare const SuccessIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
14
16
|
declare const WarningIcon: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
15
|
-
export { Icon, ArrowDownIcon, CaretsUpDownIcon, ChevronDownIcon, ChevronLeftIcon, ChevronLeftDoubleIcon, ChevronRightIcon, ChevronRightDoubleIcon, DismissIcon, InfoIcon, SuccessIcon, WarningIcon, ErrorIcon, };
|
|
17
|
+
export { Icon, ArrowDownIcon, CheckmarkIcon, CaretsUpDownIcon, ChevronDownIcon, ChevronLeftIcon, ChevronLeftDoubleIcon, ChevronRightIcon, ChevronRightDoubleIcon, DismissIcon, DismissCircleIcon, InfoIcon, SuccessIcon, WarningIcon, ErrorIcon, };
|
package/dist/Icon.js
CHANGED
|
@@ -3,12 +3,14 @@ import * as React from "react";
|
|
|
3
3
|
import { Icon } from "@stratakit/foundations";
|
|
4
4
|
import svgArrowDown from "@stratakit/icons/arrow-down.svg";
|
|
5
5
|
import svgCaretsUpDown from "@stratakit/icons/carets-up-down.svg";
|
|
6
|
+
import svgCheckmark from "@stratakit/icons/checkmark.svg";
|
|
6
7
|
import svgChevronDown from "@stratakit/icons/chevron-down.svg";
|
|
7
8
|
import svgChevronLeft from "@stratakit/icons/chevron-left.svg";
|
|
8
9
|
import svgChevronLeftDouble from "@stratakit/icons/chevron-left-double.svg";
|
|
9
10
|
import svgChevronRight from "@stratakit/icons/chevron-right.svg";
|
|
10
11
|
import svgChevronRightDouble from "@stratakit/icons/chevron-right-double.svg";
|
|
11
12
|
import svgDismiss from "@stratakit/icons/dismiss.svg";
|
|
13
|
+
import svgDismissCircle from "@stratakit/icons/dismiss-circle.svg";
|
|
12
14
|
import svgError from "@stratakit/icons/error.svg";
|
|
13
15
|
import svgInfo from "@stratakit/icons/info.svg";
|
|
14
16
|
import svgStatusSuccess from "@stratakit/icons/status-success.svg";
|
|
@@ -23,6 +25,7 @@ function createIconComponent(href) {
|
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
const ArrowDownIcon = createIconComponent(svgArrowDown);
|
|
28
|
+
const CheckmarkIcon = createIconComponent(svgCheckmark);
|
|
26
29
|
const CaretsUpDownIcon = createIconComponent(svgCaretsUpDown);
|
|
27
30
|
const ChevronDownIcon = createIconComponent(svgChevronDown);
|
|
28
31
|
const ChevronLeftIcon = createIconComponent(svgChevronLeft);
|
|
@@ -30,6 +33,7 @@ const ChevronLeftDoubleIcon = createIconComponent(svgChevronLeftDouble);
|
|
|
30
33
|
const ChevronRightIcon = createIconComponent(svgChevronRight);
|
|
31
34
|
const ChevronRightDoubleIcon = createIconComponent(svgChevronRightDouble);
|
|
32
35
|
const DismissIcon = createIconComponent(svgDismiss);
|
|
36
|
+
const DismissCircleIcon = createIconComponent(svgDismissCircle);
|
|
33
37
|
const ErrorIcon = createIconComponent(svgError);
|
|
34
38
|
const InfoIcon = createIconComponent(svgInfo);
|
|
35
39
|
const SuccessIcon = createIconComponent(svgStatusSuccess);
|
|
@@ -37,11 +41,13 @@ const WarningIcon = createIconComponent(svgWarning);
|
|
|
37
41
|
export {
|
|
38
42
|
ArrowDownIcon,
|
|
39
43
|
CaretsUpDownIcon,
|
|
44
|
+
CheckmarkIcon,
|
|
40
45
|
ChevronDownIcon,
|
|
41
46
|
ChevronLeftDoubleIcon,
|
|
42
47
|
ChevronLeftIcon,
|
|
43
48
|
ChevronRightDoubleIcon,
|
|
44
49
|
ChevronRightIcon,
|
|
50
|
+
DismissCircleIcon,
|
|
45
51
|
DismissIcon,
|
|
46
52
|
ErrorIcon,
|
|
47
53
|
Icon,
|
package/dist/Root.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Root as StrataKitRoot } from "@stratakit/foundations";
|
|
3
3
|
import type { BaseProps } from "@stratakit/foundations/secret-internals";
|
|
4
|
-
|
|
4
|
+
type StrataKitRootProps = React.ComponentPropsWithoutRef<typeof StrataKitRoot>;
|
|
5
|
+
interface RootProps extends BaseProps<"div">, Pick<StrataKitRootProps, "unstable_accentColor" | "rootNode"> {
|
|
5
6
|
children?: React.ReactNode;
|
|
6
7
|
/**
|
|
7
8
|
* The color scheme to use for all components on the page.
|
|
@@ -18,5 +19,5 @@ interface RootProps extends BaseProps<"div">, Pick<React.ComponentProps<typeof S
|
|
|
18
19
|
* </Root>
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
|
-
declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLElement | HTMLDivElement>>;
|
|
22
23
|
export { Root };
|
package/dist/Root.js
CHANGED
|
@@ -3,18 +3,19 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { ThemeProvider, useColorScheme } from "@mui/material/styles";
|
|
5
5
|
import { Root as StrataKitRoot } from "@stratakit/foundations";
|
|
6
|
-
import { RootContext, useSafeContext } from "@stratakit/foundations/secret-internals";
|
|
6
|
+
import { forwardRef, RootContext, useSafeContext } from "@stratakit/foundations/secret-internals";
|
|
7
7
|
import cx from "classnames";
|
|
8
|
-
import { createTheme } from "
|
|
8
|
+
import { createTheme } from "./~createTheme.js";
|
|
9
9
|
import { StyledEngineProvider } from "./Root.internal.js";
|
|
10
10
|
import css from "./styles.css.js";
|
|
11
11
|
const theme = createTheme();
|
|
12
12
|
const packageName = "@stratakit/mui";
|
|
13
|
-
const key = `${packageName}@${"0.
|
|
14
|
-
const Root =
|
|
13
|
+
const key = `${packageName}@${"0.4.0"}`;
|
|
14
|
+
const Root = forwardRef((props, forwardedRef) => {
|
|
15
15
|
const {
|
|
16
16
|
children,
|
|
17
17
|
colorScheme,
|
|
18
|
+
unstable_accentColor,
|
|
18
19
|
...rest
|
|
19
20
|
} = props;
|
|
20
21
|
return /* @__PURE__ */ jsx(StyledEngineProvider, {
|
|
@@ -26,23 +27,29 @@ const Root = React.forwardRef((props, forwardedRef) => {
|
|
|
26
27
|
}), /* @__PURE__ */ jsxs(RootInner, {
|
|
27
28
|
...rest,
|
|
28
29
|
colorScheme,
|
|
30
|
+
unstable_accentColor,
|
|
29
31
|
ref: forwardedRef,
|
|
30
32
|
children: [/* @__PURE__ */ jsx(Styles, {}), children]
|
|
31
33
|
})]
|
|
32
34
|
})
|
|
33
35
|
});
|
|
34
36
|
});
|
|
35
|
-
const RootInner =
|
|
37
|
+
const RootInner = forwardRef((props, forwardedRef) => {
|
|
36
38
|
const {
|
|
37
39
|
children,
|
|
38
40
|
colorScheme,
|
|
41
|
+
unstable_accentColor,
|
|
39
42
|
rootNode,
|
|
40
43
|
...rest
|
|
41
44
|
} = props;
|
|
42
45
|
return /* @__PURE__ */ jsx(StrataKitRoot, {
|
|
43
46
|
...rest,
|
|
44
47
|
className: cx("\u{1F95D}MuiRoot", props.className),
|
|
48
|
+
portalContainer: /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "\u{1F95D}MuiRoot"
|
|
50
|
+
}),
|
|
45
51
|
colorScheme,
|
|
52
|
+
unstable_accentColor,
|
|
46
53
|
rootNode,
|
|
47
54
|
synchronizeColorScheme: true,
|
|
48
55
|
ref: forwardedRef,
|
|
@@ -79,7 +86,7 @@ function Styles() {
|
|
|
79
86
|
const $ = _c(4);
|
|
80
87
|
const rootContext = useSafeContext(RootContext);
|
|
81
88
|
if (!rootContext.versions?.has(packageName)) {
|
|
82
|
-
rootContext.versions?.set(packageName, "0.
|
|
89
|
+
rootContext.versions?.set(packageName, "0.4.0");
|
|
83
90
|
}
|
|
84
91
|
const {
|
|
85
92
|
rootNode,
|
package/dist/index.d.ts
CHANGED