@stratakit/mui 0.2.1 → 0.3.1

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +126 -24
  2. package/README.md +8 -4
  3. package/dist/DEV/Icon.js +6 -0
  4. package/dist/DEV/Root.internal.js +57 -0
  5. package/dist/DEV/Root.js +30 -35
  6. package/dist/DEV/createTheme.js +266 -15
  7. package/dist/DEV/styles.css.js +2 -2
  8. package/dist/DEV/~components/MuiBadge.js +20 -0
  9. package/dist/DEV/~components/MuiBottomNavigation.js +23 -0
  10. package/dist/DEV/~components/MuiButtonBase.js +53 -0
  11. package/dist/DEV/~components/MuiCard.js +102 -0
  12. package/dist/DEV/~components/MuiChip.js +84 -0
  13. package/dist/DEV/~components/MuiDivider.js +15 -0
  14. package/dist/DEV/~components/MuiIconButton.js +17 -0
  15. package/dist/DEV/~components/MuiSnackbar.js +12 -0
  16. package/dist/DEV/~components/MuiStepper.js +21 -0
  17. package/dist/DEV/~components/MuiTable.js +23 -0
  18. package/dist/Icon.d.ts +3 -1
  19. package/dist/Icon.js +6 -0
  20. package/dist/Root.d.ts +4 -2
  21. package/dist/Root.internal.d.ts +3 -0
  22. package/dist/Root.internal.js +77 -0
  23. package/dist/Root.js +9 -7
  24. package/dist/createTheme.js +516 -9
  25. package/dist/styles.css.js +2 -2
  26. package/dist/types.d.ts +161 -2
  27. package/dist/~components/MuiBadge.d.ts +7 -0
  28. package/dist/~components/MuiBadge.js +17 -0
  29. package/dist/~components/MuiBottomNavigation.d.ts +2 -0
  30. package/dist/~components/MuiBottomNavigation.js +23 -0
  31. package/dist/~components/MuiButtonBase.d.ts +7 -0
  32. package/dist/~components/MuiButtonBase.js +80 -0
  33. package/dist/~components/MuiCard.d.ts +5 -0
  34. package/dist/~components/MuiCard.js +112 -0
  35. package/dist/~components/MuiChip.d.ts +10 -0
  36. package/dist/~components/MuiChip.js +83 -0
  37. package/dist/~components/MuiDivider.d.ts +6 -0
  38. package/dist/~components/MuiDivider.js +22 -0
  39. package/dist/~components/MuiIconButton.d.ts +6 -0
  40. package/dist/~components/MuiIconButton.js +27 -0
  41. package/dist/~components/MuiSnackbar.d.ts +2 -0
  42. package/dist/~components/MuiSnackbar.js +12 -0
  43. package/dist/~components/MuiStepper.d.ts +2 -0
  44. package/dist/~components/MuiStepper.js +26 -0
  45. package/dist/~components/MuiTable.d.ts +4 -0
  46. package/dist/~components/MuiTable.js +28 -0
  47. package/package.json +13 -9
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import type Chip from "@mui/material/Chip";
3
+ import type { BaseProps } from "@stratakit/foundations/secret-internals";
4
+ type ChipProps = React.ComponentProps<typeof Chip>;
5
+ interface MuiChipProps extends BaseProps<"div">, Pick<ChipProps, "deleteLabel"> {
6
+ }
7
+ declare const MuiChip: React.ForwardRefExoticComponent<MuiChipProps & React.RefAttributes<HTMLElement | HTMLDivElement>>;
8
+ declare const MuiChipLabel: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLElement | HTMLSpanElement>>;
9
+ declare const MuiChipDeleteIcon: React.ForwardRefExoticComponent<Omit<import("@mui/material/IconButton").IconButtonOwnProps & Omit<import("@mui/material/ButtonBase").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "className" | "color" | "style" | "tabIndex" | "children" | "render" | "label" | "component" | "classes" | "sx" | "disabled" | "disableFocusRipple" | "loading" | "loadingIndicator" | "size" | "LinkComponent" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "edge">, "ref"> & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
10
+ export { MuiChip, MuiChipLabel, MuiChipDeleteIcon };
@@ -0,0 +1,83 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Role } from "@ariakit/react/role";
4
+ import { VisuallyHidden } from "@ariakit/react/visually-hidden";
5
+ import IconButton from "@mui/material/IconButton";
6
+ import { useTheme } from "@mui/material/styles";
7
+ import { forwardRef } from "@stratakit/foundations/secret-internals";
8
+ import { DismissCircleIcon } from "../Icon.js";
9
+ import { MuiButtonBase } from "./MuiButtonBase.js";
10
+ const MuiChipContext = React.createContext(void 0);
11
+ const MuiChip = forwardRef((props, forwardedRef) => {
12
+ const {
13
+ role,
14
+ deleteLabel,
15
+ ...rest
16
+ } = props;
17
+ const clearId = React.useId();
18
+ const [labelId, setLabelId] = React.useState(void 0);
19
+ const isClickable = props.className?.includes("MuiChip-clickable") ?? false;
20
+ return /* @__PURE__ */ jsx(MuiChipContext.Provider, {
21
+ value: {
22
+ labelId,
23
+ setLabelId,
24
+ clearId,
25
+ isClickable,
26
+ deleteLabel
27
+ },
28
+ children: /* @__PURE__ */ jsx(Role.div, {
29
+ ...rest,
30
+ role: role === "button" ? void 0 : role,
31
+ tabIndex: void 0,
32
+ ref: forwardedRef
33
+ })
34
+ });
35
+ });
36
+ const MuiChipLabel = forwardRef((props, forwardedRef) => {
37
+ const defaultId = React.useId();
38
+ const {
39
+ id = defaultId,
40
+ ...rest
41
+ } = props;
42
+ const {
43
+ setLabelId,
44
+ isClickable
45
+ } = React.useContext(MuiChipContext) ?? {};
46
+ React.useEffect(() => {
47
+ if (!setLabelId) return;
48
+ setLabelId(id);
49
+ return () => {
50
+ setLabelId(void 0);
51
+ };
52
+ }, [id, setLabelId]);
53
+ const Component = isClickable ? MuiButtonBase : Role.span;
54
+ return /* @__PURE__ */ jsx(Component, {
55
+ id,
56
+ ...rest,
57
+ ref: forwardedRef
58
+ });
59
+ });
60
+ const MuiChipDeleteIcon = forwardRef((props, forwardedRef) => {
61
+ const theme = useTheme();
62
+ const defaultLabel = theme.components?.MuiAutocomplete?.defaultProps?.clearText ?? "Clear";
63
+ const {
64
+ clearId,
65
+ labelId,
66
+ deleteLabel = defaultLabel
67
+ } = React.useContext(MuiChipContext) ?? {};
68
+ return /* @__PURE__ */ jsxs(IconButton, {
69
+ "aria-labelledby": `${clearId} ${labelId}`,
70
+ size: "small",
71
+ ...props,
72
+ ref: forwardedRef,
73
+ children: [/* @__PURE__ */ jsx(VisuallyHidden, {
74
+ id: clearId,
75
+ children: deleteLabel
76
+ }), /* @__PURE__ */ jsx(DismissCircleIcon, {})]
77
+ });
78
+ });
79
+ export {
80
+ MuiChip,
81
+ MuiChipDeleteIcon,
82
+ MuiChipLabel
83
+ };
@@ -0,0 +1,6 @@
1
+ import type { DividerOwnProps } from "@mui/material/Divider";
2
+ import type { BaseProps } from "@stratakit/foundations/secret-internals";
3
+ interface MuiDividerProps extends BaseProps<"hr">, Pick<DividerOwnProps, "children"> {
4
+ }
5
+ declare const MuiDivider: import("react").ForwardRefExoticComponent<MuiDividerProps & import("react").RefAttributes<HTMLElement | HTMLHRElement>>;
6
+ export { MuiDivider };
@@ -0,0 +1,22 @@
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 {
6
+ children,
7
+ ...rest
8
+ } = props;
9
+ const defaultRender = (() => {
10
+ if (children || props["aria-orientation"] === "vertical") return /* @__PURE__ */ jsx("div", {});
11
+ return /* @__PURE__ */ jsx("hr", {});
12
+ })();
13
+ return /* @__PURE__ */ jsx(Role, {
14
+ render: defaultRender,
15
+ ...rest,
16
+ ref: forwardedRef,
17
+ children
18
+ });
19
+ });
20
+ export {
21
+ MuiDivider
22
+ };
@@ -0,0 +1,6 @@
1
+ import type { IconButtonOwnProps } from "@mui/material/IconButton";
2
+ import type { BaseProps } from "@stratakit/foundations/secret-internals";
3
+ interface MuiIconButtonProps extends BaseProps<"button">, Pick<IconButtonOwnProps, "label"> {
4
+ }
5
+ declare const MuiIconButton: import("react").ForwardRefExoticComponent<MuiIconButtonProps & import("react").RefAttributes<HTMLElement | HTMLButtonElement>>;
6
+ export { MuiIconButton };
@@ -0,0 +1,27 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import Tooltip from "@mui/material/Tooltip";
3
+ import { forwardRef } from "@stratakit/foundations/secret-internals";
4
+ import { MuiButtonBase } from "./MuiButtonBase.js";
5
+ const MuiIconButton = forwardRef((props, forwardedRef) => {
6
+ const {
7
+ label,
8
+ ...rest
9
+ } = props;
10
+ if (label) {
11
+ return /* @__PURE__ */ jsx(Tooltip, {
12
+ title: label,
13
+ describeChild: false,
14
+ children: /* @__PURE__ */ jsx(MuiButtonBase, {
15
+ ...rest,
16
+ ref: forwardedRef
17
+ })
18
+ });
19
+ }
20
+ return /* @__PURE__ */ jsx(MuiButtonBase, {
21
+ ...rest,
22
+ ref: forwardedRef
23
+ });
24
+ });
25
+ export {
26
+ MuiIconButton
27
+ };
@@ -0,0 +1,2 @@
1
+ declare const MuiSnackbar: import("react").ForwardRefExoticComponent<Pick<import("@ariakit/react/role").RoleProps, "render"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "render"> & import("react").RefAttributes<HTMLElement | HTMLDivElement>>;
2
+ export { MuiSnackbar };
@@ -0,0 +1,12 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Portal } from "@ariakit/react/portal";
3
+ import { forwardRef } from "@stratakit/foundations/secret-internals";
4
+ const MuiSnackbar = forwardRef((props, forwardedRef) => {
5
+ return /* @__PURE__ */ jsx(Portal, {
6
+ ...props,
7
+ ref: forwardedRef
8
+ });
9
+ });
10
+ export {
11
+ MuiSnackbar
12
+ };
@@ -0,0 +1,2 @@
1
+ declare const MuiStepIcon: import("react").ForwardRefExoticComponent<Pick<import("@ariakit/react/role").RoleProps, "render"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "render"> & import("react").RefAttributes<HTMLElement | HTMLSpanElement>>;
2
+ export { MuiStepIcon };
@@ -0,0 +1,26 @@
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((props, forwardedRef) => {
6
+ const {
7
+ children: _,
8
+ ...rest
9
+ } = props;
10
+ const classList = props.className?.split(" ") ?? [];
11
+ const completed = classList.includes("Mui-completed");
12
+ const error = classList.includes("Mui-error");
13
+ const children = (() => {
14
+ if (error) return /* @__PURE__ */ jsx(ErrorIcon, {});
15
+ if (completed) return /* @__PURE__ */ jsx(CheckmarkIcon, {});
16
+ })();
17
+ return /* @__PURE__ */ jsx(Role.span, {
18
+ "aria-hidden": "true",
19
+ ...rest,
20
+ ref: forwardedRef,
21
+ children
22
+ });
23
+ });
24
+ export {
25
+ MuiStepIcon
26
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ declare const MuiTableHead: React.ForwardRefExoticComponent<Pick<import("@ariakit/react/role").RoleProps, "render"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "render"> & React.RefAttributes<HTMLElement | HTMLTableSectionElement>>;
3
+ declare const MuiTableCell: React.ForwardRefExoticComponent<Pick<import("@ariakit/react/role").RoleProps, "render"> & Omit<Omit<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref">, "render"> & React.RefAttributes<HTMLElement | HTMLTableDataCellElement>>;
4
+ export { MuiTableHead, MuiTableCell };
@@ -0,0 +1,28 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Role } from "@ariakit/react/role";
4
+ import { forwardRef } from "@stratakit/foundations/secret-internals";
5
+ const MuiTableHeadContext = React.createContext(false);
6
+ const MuiTableHead = forwardRef((props, forwardedRef) => {
7
+ return /* @__PURE__ */ jsx(MuiTableHeadContext.Provider, {
8
+ value: true,
9
+ children: /* @__PURE__ */ jsx(Role, {
10
+ render: /* @__PURE__ */ jsx("thead", {}),
11
+ ...props,
12
+ ref: forwardedRef
13
+ })
14
+ });
15
+ });
16
+ const MuiTableCell = forwardRef((props, forwardedRef) => {
17
+ const inHeader = React.useContext(MuiTableHeadContext);
18
+ const Component = inHeader ? "th" : "td";
19
+ return /* @__PURE__ */ jsx(Role, {
20
+ render: /* @__PURE__ */ jsx(Component, {}),
21
+ ...props,
22
+ ref: forwardedRef
23
+ });
24
+ });
25
+ export {
26
+ MuiTableCell,
27
+ MuiTableHead
28
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stratakit/mui",
3
3
  "type": "module",
4
- "version": "0.2.1",
4
+ "version": "0.3.1",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "types": "./dist/index.d.ts",
@@ -26,10 +26,10 @@
26
26
  ],
27
27
  "description": "StrataKit theme for Material UI",
28
28
  "author": "Bentley Systems",
29
- "homepage": "https://github.com/iTwin/design-system",
29
+ "homepage": "https://github.com/iTwin/stratakit",
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "https://github.com/iTwin/design-system.git",
32
+ "url": "https://github.com/iTwin/stratakit.git",
33
33
  "directory": "packages/mui"
34
34
  },
35
35
  "keywords": [
@@ -45,17 +45,21 @@
45
45
  "design system"
46
46
  ],
47
47
  "dependencies": {
48
- "@stratakit/foundations": "^0.4.6",
49
- "@stratakit/icons": "^0.3.0",
48
+ "@ariakit/react": "^0.4.21",
49
+ "@emotion/cache": "^11.14.0",
50
+ "@emotion/react": "^11.14.0",
51
+ "@emotion/styled": "^11.14.1",
52
+ "@stratakit/foundations": "^0.4.7",
53
+ "@stratakit/icons": "^0.3.1",
50
54
  "classnames": "^2.5.1",
51
55
  "react-compiler-runtime": "^1.0.0"
52
56
  },
53
57
  "devDependencies": {
54
- "@types/react": "^19.2.7",
58
+ "@types/react": "^19.2.14",
55
59
  "@types/react-dom": "^19.2.3",
56
- "esbuild": "^0.27.0",
57
- "react": "^19.2.3",
58
- "react-dom": "^19.2.3",
60
+ "esbuild": "^0.27.3",
61
+ "react": "^19.2.4",
62
+ "react-dom": "^19.2.4",
59
63
  "typescript": "~5.9.3"
60
64
  },
61
65
  "peerDependencies": {