@koine/react 1.1.11 → 1.1.12
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/Carousel/CarouselCss.d.ts +6 -1
- package/Details/Details.d.ts +298 -13
- package/Dialog/DialogMui.d.ts +328 -19
- package/Dialog/css/bare.d.ts +352 -43
- package/Dialog/m/bare.d.ts +322 -13
- package/Dialog/sc/bare.d.ts +325 -17
- package/Dialog/sc/framer.d.ts +316 -7
- package/Dialog/sc/framerMaterial.d.ts +316 -7
- package/Dialog/sc/material.d.ts +325 -16
- package/Dialog/tw/bare.d.ts +358 -49
- package/Dialog/tw/elegant.d.ts +379 -70
- package/Dialog/tw/framer.d.ts +340 -31
- package/Dialog/tw/framerMaterial.d.ts +356 -47
- package/Dialog/tw/material.d.ts +379 -70
- package/Form/Form.d.ts +45 -19
- package/Form/sc/bare.d.ts +33 -8
- package/Forms/Checkbox/Checkbox.d.ts +1 -1
- package/Forms/Input/Input.d.ts +1 -1
- package/Forms/Password/Password.d.ts +1 -1
- package/Forms/Radio/Radio.d.ts +1 -1
- package/Forms/Switch/Switch.d.ts +1 -1
- package/Forms/Textarea/Textarea.d.ts +1 -1
- package/Forms/Textarea/TextareaRich.d.ts +1 -1
- package/Link/Link.d.ts +1 -1
- package/Menu/MenuMui.d.ts +0 -35
- package/Menu/MenuMui.js +164 -77
- package/Menu/MenuMui.mjs +165 -75
- package/MenuItem/MenuItemMui.d.ts +0 -6
- package/MenuItem/MenuItemMui.js +31 -17
- package/MenuItem/MenuItemMui.mjs +32 -15
- package/Tabs/TabsMui.d.ts +287 -55
- package/Tabs/tw/bare.d.ts +311 -80
- package/Tabs/tw/material.d.ts +326 -136
- package/package.json +25 -22
package/Menu/MenuMui.js
CHANGED
|
@@ -1,78 +1,165 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
2
|
+
// import React, { forwardRef, useId, useMemo, useRef, useState } from "react";
|
|
3
|
+
// import { unstable_useEventCallback as useEventCallback } from "@mui/utils";
|
|
4
|
+
// import {
|
|
5
|
+
// motion as m,
|
|
6
|
+
// AnimatePresence,
|
|
7
|
+
// type HTMLMotionProps,
|
|
8
|
+
// } from "framer-motion";
|
|
9
|
+
// import {
|
|
10
|
+
// useMenu,
|
|
11
|
+
// MenuUnstyledContext,
|
|
12
|
+
// type MenuUnstyledContextType,
|
|
13
|
+
// type MenuUnstyledActions,
|
|
14
|
+
// } from "@mui/base/MenuUnstyled";
|
|
15
|
+
// import ModalUnstyled from "@mui/base/ModalUnstyled";
|
|
16
|
+
// import ClickAwayListener from "@mui/base/ClickAwayListener";
|
|
17
|
+
// import { usePopper, type PopperChildrenProps } from "react-popper";
|
|
18
|
+
// import clsx from "@koine/utils/clsx";
|
|
19
|
+
// const MenuRoot = m.div;
|
|
20
|
+
// const MenuBackdrop = () => <div className="fixed inset-0" />;
|
|
21
|
+
// /**
|
|
22
|
+
// * Props we control, cannot be overriden from implementers
|
|
23
|
+
// */
|
|
24
|
+
// type MenuButtonOwnProps = {
|
|
25
|
+
// "aria-controls"?: string;
|
|
26
|
+
// "aria-haspopup": true | "true";
|
|
27
|
+
// "aria-expanded"?: true | "true";
|
|
28
|
+
// onClick: (event: React.MouseEvent<HTMLButtonElement>) => unknown;
|
|
29
|
+
// onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => unknown;
|
|
30
|
+
// };
|
|
31
|
+
// type MenuButtonProps = Omit<
|
|
32
|
+
// React.ComponentPropsWithRef<"button">,
|
|
33
|
+
// keyof MenuButtonOwnProps
|
|
34
|
+
// > &
|
|
35
|
+
// MenuButtonOwnProps;
|
|
36
|
+
// export type MenuItemsProps = {
|
|
37
|
+
// /**
|
|
38
|
+
// * Closes the parent menu
|
|
39
|
+
// */
|
|
40
|
+
// close: () => unknown;
|
|
41
|
+
// };
|
|
42
|
+
// /**
|
|
43
|
+
// * Props we control, cannot be overriden from implementers
|
|
44
|
+
// */
|
|
45
|
+
// type MenuOwnProps = ReturnType<typeof useMenu>["getListboxProps"] & {
|
|
46
|
+
// onKeyDown: (event: React.KeyboardEvent) => unknown;
|
|
47
|
+
// style: React.StyleHTMLAttributes<HTMLDivElement>;
|
|
48
|
+
// };
|
|
49
|
+
// export type MenuProps = Omit<
|
|
50
|
+
// Omit<HTMLMotionProps<"div">, "children"> & {
|
|
51
|
+
// placement?: PopperChildrenProps["placement"];
|
|
52
|
+
// Button: (props: MenuButtonProps) => JSX.Element;
|
|
53
|
+
// children: (props: MenuItemsProps) => React.ReactNode;
|
|
54
|
+
// },
|
|
55
|
+
// keyof MenuOwnProps
|
|
56
|
+
// >;
|
|
57
|
+
// export const Menu = forwardRef(function Menu(props: MenuProps, ref) {
|
|
58
|
+
// const { Button, placement, children, className, ...htmlAttributes } = props;
|
|
59
|
+
// const id = useId();
|
|
60
|
+
// const buttonRef = useRef<HTMLButtonElement>(null);
|
|
61
|
+
// const menuActions = useRef<MenuUnstyledActions>(null);
|
|
62
|
+
// const [popperElement, setPopperElement] = useState(null);
|
|
63
|
+
// const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
|
|
64
|
+
// const open = Boolean(anchorEl);
|
|
65
|
+
// const { styles } = usePopper(anchorEl, popperElement, {
|
|
66
|
+
// placement,
|
|
67
|
+
// // strategy: "absolute",
|
|
68
|
+
// });
|
|
69
|
+
// const {
|
|
70
|
+
// registerItem,
|
|
71
|
+
// unregisterItem,
|
|
72
|
+
// getListboxProps,
|
|
73
|
+
// getItemProps,
|
|
74
|
+
// getItemState,
|
|
75
|
+
// } = useMenu({
|
|
76
|
+
// listboxId: id,
|
|
77
|
+
// listboxRef: setPopperElement,
|
|
78
|
+
// // these two make the Tab key behaviour correct, closing the menu on Tab
|
|
79
|
+
// // press and re-focusing the Button trigger element
|
|
80
|
+
// open,
|
|
81
|
+
// onClose: () => setAnchorEl(null),
|
|
82
|
+
// });
|
|
83
|
+
// const contextValue: MenuUnstyledContextType = {
|
|
84
|
+
// registerItem,
|
|
85
|
+
// unregisterItem,
|
|
86
|
+
// getItemState,
|
|
87
|
+
// getItemProps,
|
|
88
|
+
// open,
|
|
89
|
+
// };
|
|
90
|
+
// const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
91
|
+
// if (open) {
|
|
92
|
+
// setAnchorEl(null);
|
|
93
|
+
// } else {
|
|
94
|
+
// setAnchorEl(event.currentTarget);
|
|
95
|
+
// }
|
|
96
|
+
// };
|
|
97
|
+
// const handleButtonKeyDown = (
|
|
98
|
+
// event: React.KeyboardEvent<HTMLButtonElement>
|
|
99
|
+
// ) => {
|
|
100
|
+
// if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
101
|
+
// event.preventDefault();
|
|
102
|
+
// setAnchorEl(event.currentTarget);
|
|
103
|
+
// if (event.key === "ArrowUp") {
|
|
104
|
+
// menuActions.current?.highlightLastItem();
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
107
|
+
// };
|
|
108
|
+
// const close = useEventCallback(() => {
|
|
109
|
+
// setAnchorEl(null);
|
|
110
|
+
// buttonRef.current?.focus();
|
|
111
|
+
// });
|
|
112
|
+
// const renderChildren = useMemo(() => {
|
|
113
|
+
// const childrenProps: MenuItemsProps = { close };
|
|
114
|
+
// return children(childrenProps);
|
|
115
|
+
// }, [children, close]);
|
|
116
|
+
// return (
|
|
117
|
+
// <>
|
|
118
|
+
// <Button
|
|
119
|
+
// ref={buttonRef}
|
|
120
|
+
// id={id}
|
|
121
|
+
// aria-haspopup="true"
|
|
122
|
+
// aria-controls={open ? id : undefined}
|
|
123
|
+
// aria-expanded={open ? "true" : undefined}
|
|
124
|
+
// onClick={handleButtonClick}
|
|
125
|
+
// onKeyDown={handleButtonKeyDown}
|
|
126
|
+
// />
|
|
127
|
+
// <AnimatePresence>
|
|
128
|
+
// {open && (
|
|
129
|
+
// <ModalUnstyled
|
|
130
|
+
// slots={{ backdrop: MenuBackdrop }}
|
|
131
|
+
// onClose={close}
|
|
132
|
+
// onBackdropClick={close}
|
|
133
|
+
// open={open}
|
|
134
|
+
// >
|
|
135
|
+
// <div>
|
|
136
|
+
// <ClickAwayListener onClickAway={close}>
|
|
137
|
+
// <MenuRoot
|
|
138
|
+
// initial={{
|
|
139
|
+
// opacity: 0,
|
|
140
|
+
// }}
|
|
141
|
+
// animate={{
|
|
142
|
+
// opacity: 1,
|
|
143
|
+
// }}
|
|
144
|
+
// exit={{
|
|
145
|
+
// opacity: 0,
|
|
146
|
+
// }}
|
|
147
|
+
// className={clsx(className)}
|
|
148
|
+
// style={styles["popper"]}
|
|
149
|
+
// {...htmlAttributes}
|
|
150
|
+
// {...getListboxProps()}
|
|
151
|
+
// aria-labelledby={id}
|
|
152
|
+
// >
|
|
153
|
+
// <MenuUnstyledContext.Provider value={contextValue}>
|
|
154
|
+
// {renderChildren}
|
|
155
|
+
// </MenuUnstyledContext.Provider>
|
|
156
|
+
// </MenuRoot>
|
|
157
|
+
// </ClickAwayListener>
|
|
158
|
+
// </div>
|
|
159
|
+
// </ModalUnstyled>
|
|
160
|
+
// )}
|
|
161
|
+
// </AnimatePresence>
|
|
162
|
+
// </>
|
|
163
|
+
// );
|
|
164
|
+
// });
|
|
165
|
+
// export default Menu;
|
package/Menu/MenuMui.mjs
CHANGED
|
@@ -1,75 +1,165 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// import React, { forwardRef, useId, useMemo, useRef, useState } from "react";
|
|
3
|
+
// import { unstable_useEventCallback as useEventCallback } from "@mui/utils";
|
|
4
|
+
// import {
|
|
5
|
+
// motion as m,
|
|
6
|
+
// AnimatePresence,
|
|
7
|
+
// type HTMLMotionProps,
|
|
8
|
+
// } from "framer-motion";
|
|
9
|
+
// import {
|
|
10
|
+
// useMenu,
|
|
11
|
+
// MenuUnstyledContext,
|
|
12
|
+
// type MenuUnstyledContextType,
|
|
13
|
+
// type MenuUnstyledActions,
|
|
14
|
+
// } from "@mui/base/MenuUnstyled";
|
|
15
|
+
// import ModalUnstyled from "@mui/base/ModalUnstyled";
|
|
16
|
+
// import ClickAwayListener from "@mui/base/ClickAwayListener";
|
|
17
|
+
// import { usePopper, type PopperChildrenProps } from "react-popper";
|
|
18
|
+
// import clsx from "@koine/utils/clsx";
|
|
19
|
+
// const MenuRoot = m.div;
|
|
20
|
+
// const MenuBackdrop = () => <div className="fixed inset-0" />;
|
|
21
|
+
// /**
|
|
22
|
+
// * Props we control, cannot be overriden from implementers
|
|
23
|
+
// */
|
|
24
|
+
// type MenuButtonOwnProps = {
|
|
25
|
+
// "aria-controls"?: string;
|
|
26
|
+
// "aria-haspopup": true | "true";
|
|
27
|
+
// "aria-expanded"?: true | "true";
|
|
28
|
+
// onClick: (event: React.MouseEvent<HTMLButtonElement>) => unknown;
|
|
29
|
+
// onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => unknown;
|
|
30
|
+
// };
|
|
31
|
+
// type MenuButtonProps = Omit<
|
|
32
|
+
// React.ComponentPropsWithRef<"button">,
|
|
33
|
+
// keyof MenuButtonOwnProps
|
|
34
|
+
// > &
|
|
35
|
+
// MenuButtonOwnProps;
|
|
36
|
+
// export type MenuItemsProps = {
|
|
37
|
+
// /**
|
|
38
|
+
// * Closes the parent menu
|
|
39
|
+
// */
|
|
40
|
+
// close: () => unknown;
|
|
41
|
+
// };
|
|
42
|
+
// /**
|
|
43
|
+
// * Props we control, cannot be overriden from implementers
|
|
44
|
+
// */
|
|
45
|
+
// type MenuOwnProps = ReturnType<typeof useMenu>["getListboxProps"] & {
|
|
46
|
+
// onKeyDown: (event: React.KeyboardEvent) => unknown;
|
|
47
|
+
// style: React.StyleHTMLAttributes<HTMLDivElement>;
|
|
48
|
+
// };
|
|
49
|
+
// export type MenuProps = Omit<
|
|
50
|
+
// Omit<HTMLMotionProps<"div">, "children"> & {
|
|
51
|
+
// placement?: PopperChildrenProps["placement"];
|
|
52
|
+
// Button: (props: MenuButtonProps) => JSX.Element;
|
|
53
|
+
// children: (props: MenuItemsProps) => React.ReactNode;
|
|
54
|
+
// },
|
|
55
|
+
// keyof MenuOwnProps
|
|
56
|
+
// >;
|
|
57
|
+
// export const Menu = forwardRef(function Menu(props: MenuProps, ref) {
|
|
58
|
+
// const { Button, placement, children, className, ...htmlAttributes } = props;
|
|
59
|
+
// const id = useId();
|
|
60
|
+
// const buttonRef = useRef<HTMLButtonElement>(null);
|
|
61
|
+
// const menuActions = useRef<MenuUnstyledActions>(null);
|
|
62
|
+
// const [popperElement, setPopperElement] = useState(null);
|
|
63
|
+
// const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
|
|
64
|
+
// const open = Boolean(anchorEl);
|
|
65
|
+
// const { styles } = usePopper(anchorEl, popperElement, {
|
|
66
|
+
// placement,
|
|
67
|
+
// // strategy: "absolute",
|
|
68
|
+
// });
|
|
69
|
+
// const {
|
|
70
|
+
// registerItem,
|
|
71
|
+
// unregisterItem,
|
|
72
|
+
// getListboxProps,
|
|
73
|
+
// getItemProps,
|
|
74
|
+
// getItemState,
|
|
75
|
+
// } = useMenu({
|
|
76
|
+
// listboxId: id,
|
|
77
|
+
// listboxRef: setPopperElement,
|
|
78
|
+
// // these two make the Tab key behaviour correct, closing the menu on Tab
|
|
79
|
+
// // press and re-focusing the Button trigger element
|
|
80
|
+
// open,
|
|
81
|
+
// onClose: () => setAnchorEl(null),
|
|
82
|
+
// });
|
|
83
|
+
// const contextValue: MenuUnstyledContextType = {
|
|
84
|
+
// registerItem,
|
|
85
|
+
// unregisterItem,
|
|
86
|
+
// getItemState,
|
|
87
|
+
// getItemProps,
|
|
88
|
+
// open,
|
|
89
|
+
// };
|
|
90
|
+
// const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
91
|
+
// if (open) {
|
|
92
|
+
// setAnchorEl(null);
|
|
93
|
+
// } else {
|
|
94
|
+
// setAnchorEl(event.currentTarget);
|
|
95
|
+
// }
|
|
96
|
+
// };
|
|
97
|
+
// const handleButtonKeyDown = (
|
|
98
|
+
// event: React.KeyboardEvent<HTMLButtonElement>
|
|
99
|
+
// ) => {
|
|
100
|
+
// if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
101
|
+
// event.preventDefault();
|
|
102
|
+
// setAnchorEl(event.currentTarget);
|
|
103
|
+
// if (event.key === "ArrowUp") {
|
|
104
|
+
// menuActions.current?.highlightLastItem();
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
107
|
+
// };
|
|
108
|
+
// const close = useEventCallback(() => {
|
|
109
|
+
// setAnchorEl(null);
|
|
110
|
+
// buttonRef.current?.focus();
|
|
111
|
+
// });
|
|
112
|
+
// const renderChildren = useMemo(() => {
|
|
113
|
+
// const childrenProps: MenuItemsProps = { close };
|
|
114
|
+
// return children(childrenProps);
|
|
115
|
+
// }, [children, close]);
|
|
116
|
+
// return (
|
|
117
|
+
// <>
|
|
118
|
+
// <Button
|
|
119
|
+
// ref={buttonRef}
|
|
120
|
+
// id={id}
|
|
121
|
+
// aria-haspopup="true"
|
|
122
|
+
// aria-controls={open ? id : undefined}
|
|
123
|
+
// aria-expanded={open ? "true" : undefined}
|
|
124
|
+
// onClick={handleButtonClick}
|
|
125
|
+
// onKeyDown={handleButtonKeyDown}
|
|
126
|
+
// />
|
|
127
|
+
// <AnimatePresence>
|
|
128
|
+
// {open && (
|
|
129
|
+
// <ModalUnstyled
|
|
130
|
+
// slots={{ backdrop: MenuBackdrop }}
|
|
131
|
+
// onClose={close}
|
|
132
|
+
// onBackdropClick={close}
|
|
133
|
+
// open={open}
|
|
134
|
+
// >
|
|
135
|
+
// <div>
|
|
136
|
+
// <ClickAwayListener onClickAway={close}>
|
|
137
|
+
// <MenuRoot
|
|
138
|
+
// initial={{
|
|
139
|
+
// opacity: 0,
|
|
140
|
+
// }}
|
|
141
|
+
// animate={{
|
|
142
|
+
// opacity: 1,
|
|
143
|
+
// }}
|
|
144
|
+
// exit={{
|
|
145
|
+
// opacity: 0,
|
|
146
|
+
// }}
|
|
147
|
+
// className={clsx(className)}
|
|
148
|
+
// style={styles["popper"]}
|
|
149
|
+
// {...htmlAttributes}
|
|
150
|
+
// {...getListboxProps()}
|
|
151
|
+
// aria-labelledby={id}
|
|
152
|
+
// >
|
|
153
|
+
// <MenuUnstyledContext.Provider value={contextValue}>
|
|
154
|
+
// {renderChildren}
|
|
155
|
+
// </MenuUnstyledContext.Provider>
|
|
156
|
+
// </MenuRoot>
|
|
157
|
+
// </ClickAwayListener>
|
|
158
|
+
// </div>
|
|
159
|
+
// </ModalUnstyled>
|
|
160
|
+
// )}
|
|
161
|
+
// </AnimatePresence>
|
|
162
|
+
// </>
|
|
163
|
+
// );
|
|
164
|
+
// });
|
|
165
|
+
// export default Menu;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { type MenuItemsProps } from "../Menu/MenuMui";
|
|
3
|
-
import { Polymorphic } from "../typings";
|
|
4
|
-
export type MenuItemProps = React.PropsWithChildren<Partial<MenuItemsProps>>;
|
|
5
|
-
export declare const MenuItem: Polymorphic.ComponentForwarded<"button", MenuItemProps>;
|
|
6
|
-
export default MenuItem;
|
package/MenuItem/MenuItemMui.js
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
// import React, { forwardRef } from "react";
|
|
3
|
+
// import { useMenuItem } from "@mui/base/MenuItemUnstyled";
|
|
4
|
+
// // import { useMenuItem } from "./useMenuItem";
|
|
5
|
+
// import clsx from "@koine/utils/clsx";
|
|
6
|
+
// import { type MenuItemsProps } from "../Menu/MenuMui";
|
|
7
|
+
// import { Polymorphic } from "../typings";
|
|
8
|
+
// export type MenuItemProps = React.PropsWithChildren<Partial<MenuItemsProps>>;
|
|
9
|
+
// export const MenuItem = forwardRef(function MenuItem<
|
|
10
|
+
// T extends React.ElementType = "button"
|
|
11
|
+
// >(props: Polymorphic.Props<T, MenuItemProps>, ref: Polymorphic.Ref<T>) {
|
|
12
|
+
// const {
|
|
13
|
+
// as: As = "button",
|
|
14
|
+
// children,
|
|
15
|
+
// className,
|
|
16
|
+
// disabled: disabledProp,
|
|
17
|
+
// ...other
|
|
18
|
+
// } = props;
|
|
19
|
+
// const { getRootProps, disabled, focusVisible } = useMenuItem({
|
|
20
|
+
// ref,
|
|
21
|
+
// disabled: disabledProp,
|
|
22
|
+
// });
|
|
23
|
+
// return (
|
|
24
|
+
// <As
|
|
25
|
+
// className={clsx(focusVisible && "", disabled && "", className)}
|
|
26
|
+
// {...getRootProps(other)}
|
|
27
|
+
// >
|
|
28
|
+
// {children}
|
|
29
|
+
// </As>
|
|
30
|
+
// );
|
|
31
|
+
// }) as Polymorphic.ComponentForwarded<"button", MenuItemProps>;
|
|
32
|
+
// export default MenuItem;
|
package/MenuItem/MenuItemMui.mjs
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useMenuItem } from "
|
|
5
|
-
// import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// import React, { forwardRef } from "react";
|
|
3
|
+
// import { useMenuItem } from "@mui/base/MenuItemUnstyled";
|
|
4
|
+
// // import { useMenuItem } from "./useMenuItem";
|
|
5
|
+
// import clsx from "@koine/utils/clsx";
|
|
6
|
+
// import { type MenuItemsProps } from "../Menu/MenuMui";
|
|
7
|
+
// import { Polymorphic } from "../typings";
|
|
8
|
+
// export type MenuItemProps = React.PropsWithChildren<Partial<MenuItemsProps>>;
|
|
9
|
+
// export const MenuItem = forwardRef(function MenuItem<
|
|
10
|
+
// T extends React.ElementType = "button"
|
|
11
|
+
// >(props: Polymorphic.Props<T, MenuItemProps>, ref: Polymorphic.Ref<T>) {
|
|
12
|
+
// const {
|
|
13
|
+
// as: As = "button",
|
|
14
|
+
// children,
|
|
15
|
+
// className,
|
|
16
|
+
// disabled: disabledProp,
|
|
17
|
+
// ...other
|
|
18
|
+
// } = props;
|
|
19
|
+
// const { getRootProps, disabled, focusVisible } = useMenuItem({
|
|
20
|
+
// ref,
|
|
21
|
+
// disabled: disabledProp,
|
|
22
|
+
// });
|
|
23
|
+
// return (
|
|
24
|
+
// <As
|
|
25
|
+
// className={clsx(focusVisible && "", disabled && "", className)}
|
|
26
|
+
// {...getRootProps(other)}
|
|
27
|
+
// >
|
|
28
|
+
// {children}
|
|
29
|
+
// </As>
|
|
30
|
+
// );
|
|
31
|
+
// }) as Polymorphic.ComponentForwarded<"button", MenuItemProps>;
|
|
32
|
+
// export default MenuItem;
|