@react95/core 8.0.0-alpha.10 → 8.0.0-alpha.11
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/cjs/Avatar/Avatar.cjs +2 -19
- package/cjs/Button/Button.cjs +1 -1
- package/cjs/Fieldset/Fieldset.cjs +1 -1
- package/cjs/Frame/Frame.cjs +1 -0
- package/cjs/Input/Input.cjs +1 -20
- package/cjs/List/List.cjs +3 -5
- package/cjs/List/ListDivider.cjs +1 -11
- package/cjs/Modal/Modal.cjs +17 -36
- package/cjs/Modal/ModalProvider.cjs +6 -21
- package/cjs/Range/Range.cjs +9 -28
- package/cjs/Tabs/Tabs.cjs +16 -19
- package/cjs/TextArea/TextArea.cjs +2 -19
- package/cjs/TitleBar/TitleBar.cjs +10 -8
- package/cjs/Tooltip/Tooltip.cjs +6 -23
- package/cjs/Tree/Node.cjs +10 -27
- package/cjs/Video/Video.cjs +28 -44
- package/cjs/Video/buttons/Fullscreen.cjs +2 -19
- package/cjs/Video/buttons/Pause.cjs +2 -19
- package/cjs/Video/buttons/Play.cjs +2 -19
- package/cjs/Video/buttons/Stop.cjs +2 -19
- package/esm/Alert/Alert.mjs +6 -6
- package/esm/Avatar/Avatar.mjs +2 -2
- package/esm/Button/Button.mjs +4 -4
- package/esm/Checkbox/Checkbox.mjs +3 -3
- package/esm/Dropdown/Dropdown.mjs +2 -2
- package/esm/Fieldset/Fieldset.mjs +2 -2
- package/esm/Frame/Frame.mjs +4 -3
- package/esm/Input/Input.mjs +2 -4
- package/esm/List/List.mjs +3 -5
- package/esm/List/ListDivider.mjs +2 -12
- package/esm/List/ListItem.mjs +3 -3
- package/esm/Modal/Modal.mjs +9 -11
- package/esm/Modal/ModalProvider.mjs +6 -4
- package/esm/ProgressBar/ProgressBar.mjs +4 -4
- package/esm/RadioButton/RadioButton.mjs +3 -3
- package/esm/Range/Range.mjs +11 -13
- package/esm/Tabs/Tab.mjs +2 -2
- package/esm/Tabs/Tabs.mjs +21 -24
- package/esm/TaskBar/Clock.mjs +3 -3
- package/esm/TaskBar/TaskBar.mjs +9 -9
- package/esm/TaskBar/WindowButton.mjs +3 -3
- package/esm/TextArea/TextArea.mjs +2 -2
- package/esm/TitleBar/TitleBar.mjs +16 -14
- package/esm/Tooltip/Tooltip.mjs +5 -5
- package/esm/Tree/Node.mjs +2 -2
- package/esm/Tree/Tree.mjs +2 -2
- package/esm/Video/Video.mjs +14 -13
- package/esm/Video/buttons/Fullscreen.mjs +1 -1
- package/esm/Video/buttons/Pause.mjs +1 -1
- package/esm/Video/buttons/Play.mjs +1 -1
- package/esm/Video/buttons/Stop.mjs +1 -1
- package/package.json +2 -2
- package/types/Avatar/Avatar.d.ts +7 -4
- package/types/Button/Button.d.ts +5 -2
- package/types/Checkbox/Checkbox.d.ts +3 -2
- package/types/Dropdown/Dropdown.d.ts +2 -1
- package/types/Fieldset/Fieldset.d.ts +2 -1
- package/types/Frame/Frame.d.ts +7 -4
- package/types/Input/Input.d.ts +1 -1
- package/types/List/List.d.ts +1 -1
- package/types/List/ListItem.d.ts +3 -2
- package/types/Modal/Modal.d.ts +8 -8
- package/types/Modal/ModalContext.d.ts +2 -2
- package/types/Modal/ModalProvider.d.ts +2 -2
- package/types/ProgressBar/ProgressBar.d.ts +6 -3
- package/types/RadioButton/RadioButton.d.ts +2 -1
- package/types/Range/Range.d.ts +1 -1
- package/types/Tabs/Tab.d.ts +3 -2
- package/types/Tabs/Tabs.d.ts +3 -2
- package/types/TaskBar/TaskBar.d.ts +2 -1
- package/types/TaskBar/WindowButton.d.ts +2 -1
- package/types/TextArea/TextArea.d.ts +1 -1
- package/types/TitleBar/TitleBar.d.ts +5 -4
- package/types/Tooltip/Tooltip.d.ts +3 -2
- package/types/Tree/Node.d.ts +7 -6
- package/types/Tree/Tree.d.ts +2 -2
- package/types/Video/Video.d.ts +10 -9
- package/types/Video/buttons/Fullscreen.d.ts +3 -2
- package/types/Video/buttons/Pause.d.ts +3 -2
- package/types/Video/buttons/Play.d.ts +3 -2
- package/types/Video/buttons/Stop.d.ts +3 -2
package/esm/Tabs/Tab.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import { tab } from "./Tabs.css.mjs";
|
|
3
3
|
import { Frame } from "../Frame/Frame.mjs";
|
|
4
4
|
const Tab = forwardRef(
|
|
5
|
-
({ activeTab, title, ...rest }, ref) => /* @__PURE__ */
|
|
5
|
+
({ activeTab, title, ...rest }, ref) => /* @__PURE__ */ React.createElement(
|
|
6
6
|
Frame,
|
|
7
7
|
{
|
|
8
8
|
...rest,
|
package/esm/Tabs/Tabs.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { forwardRef, Children, useState } from "react";
|
|
2
2
|
import cn from "classnames";
|
|
3
3
|
import { Tab } from "./Tab.mjs";
|
|
4
4
|
import { navbar, navContainer } from "./Tabs.css.mjs";
|
|
5
5
|
import { Frame } from "../Frame/Frame.mjs";
|
|
6
6
|
const Tabs = forwardRef(
|
|
7
7
|
({ children, defaultActiveTab, onChange, ...rest }, ref) => {
|
|
8
|
-
const [firstTab] =
|
|
9
|
-
const [activeTab, setActiveTab] =
|
|
8
|
+
const [firstTab] = Children.toArray(children);
|
|
9
|
+
const [activeTab, setActiveTab] = useState(
|
|
10
10
|
defaultActiveTab || firstTab.props.title
|
|
11
11
|
);
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
13
13
|
Frame,
|
|
14
14
|
{
|
|
15
15
|
...rest,
|
|
@@ -17,29 +17,26 @@ const Tabs = forwardRef(
|
|
|
17
17
|
as: "ol",
|
|
18
18
|
ref
|
|
19
19
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (onChange) {
|
|
33
|
-
onChange(title, e);
|
|
34
|
-
}
|
|
35
|
-
setActiveTab(title);
|
|
20
|
+
Children.map(children, (child) => {
|
|
21
|
+
const { title, disabled } = child.props;
|
|
22
|
+
return /* @__PURE__ */ React.createElement(
|
|
23
|
+
Tab,
|
|
24
|
+
{
|
|
25
|
+
key: title,
|
|
26
|
+
...child.props,
|
|
27
|
+
activeTab,
|
|
28
|
+
onClick: (e) => {
|
|
29
|
+
if (!disabled) {
|
|
30
|
+
if (onChange) {
|
|
31
|
+
onChange(title, e);
|
|
36
32
|
}
|
|
33
|
+
setActiveTab(title);
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
), /* @__PURE__ */
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
})
|
|
39
|
+
), /* @__PURE__ */ React.createElement(Frame, { className: navContainer, width: rest.width || rest.w }, Children.map(
|
|
43
40
|
children,
|
|
44
41
|
(child) => child.props.title === activeTab && child.props.children
|
|
45
42
|
)));
|
package/esm/TaskBar/Clock.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import { Frame } from "../Frame/Frame.mjs";
|
|
3
3
|
import { Tooltip } from "../Tooltip/Tooltip.mjs";
|
|
4
4
|
import { tooltip } from "./TaskBar.css.mjs";
|
|
@@ -16,7 +16,7 @@ const Clock = () => {
|
|
|
16
16
|
});
|
|
17
17
|
return () => clearInterval(interval);
|
|
18
18
|
}, []);
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ React.createElement(
|
|
20
20
|
Frame,
|
|
21
21
|
{
|
|
22
22
|
boxShadow: "$in",
|
|
@@ -26,7 +26,7 @@ const Clock = () => {
|
|
|
26
26
|
justifyContent: "center",
|
|
27
27
|
alignItems: "center"
|
|
28
28
|
},
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ React.createElement(Tooltip, { className: tooltip }, timer)
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
32
|
export {
|
package/esm/TaskBar/TaskBar.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { forwardRef, useState, useContext } from "react";
|
|
2
2
|
import { ModalContext } from "../Modal/ModalContext.mjs";
|
|
3
3
|
import { Frame } from "../Frame/Frame.mjs";
|
|
4
4
|
import { Clock } from "./Clock.mjs";
|
|
@@ -10,7 +10,7 @@ const TaskBar = forwardRef(
|
|
|
10
10
|
const [showList, toggleShowList] = useState(false);
|
|
11
11
|
const [activeStart, toggleActiveStart] = useState(false);
|
|
12
12
|
const { windows, activeWindow, setActiveWindow } = useContext(ModalContext);
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ React.createElement(
|
|
14
14
|
Frame,
|
|
15
15
|
{
|
|
16
16
|
position: "fixed",
|
|
@@ -27,7 +27,7 @@ const TaskBar = forwardRef(
|
|
|
27
27
|
boxShadow: "$out",
|
|
28
28
|
ref
|
|
29
29
|
},
|
|
30
|
-
showList && /* @__PURE__ */
|
|
30
|
+
showList && /* @__PURE__ */ React.createElement(
|
|
31
31
|
Frame,
|
|
32
32
|
{
|
|
33
33
|
position: "absolute",
|
|
@@ -39,11 +39,11 @@ const TaskBar = forwardRef(
|
|
|
39
39
|
},
|
|
40
40
|
list
|
|
41
41
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ React.createElement(
|
|
43
43
|
WindowButton,
|
|
44
44
|
{
|
|
45
45
|
small: true,
|
|
46
|
-
icon: /* @__PURE__ */
|
|
46
|
+
icon: /* @__PURE__ */ React.createElement(Logo, { variant: "32x32_4" }),
|
|
47
47
|
active: activeStart,
|
|
48
48
|
onClick: () => {
|
|
49
49
|
toggleActiveStart(!activeStart);
|
|
@@ -52,8 +52,8 @@ const TaskBar = forwardRef(
|
|
|
52
52
|
},
|
|
53
53
|
"Start"
|
|
54
54
|
),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
([windowId, { icon, title, hasButton }]) => hasButton && /* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ React.createElement(Frame, { w: "100%", paddingLeft: "$0", ml: "$2", display: "flex" }, Object.entries(windows).map(
|
|
56
|
+
([windowId, { icon, title, hasButton }]) => hasButton && /* @__PURE__ */ React.createElement(
|
|
57
57
|
WindowButton,
|
|
58
58
|
{
|
|
59
59
|
key: windowId,
|
|
@@ -62,10 +62,10 @@ const TaskBar = forwardRef(
|
|
|
62
62
|
onClick: () => setActiveWindow(windowId),
|
|
63
63
|
small: false
|
|
64
64
|
},
|
|
65
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ React.createElement("div", { className: truncate }, title)
|
|
66
66
|
)
|
|
67
67
|
)),
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ React.createElement(Clock, null)
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import { windowsButton, icon } from "./TaskBar.css.mjs";
|
|
3
3
|
const WindowButton = forwardRef(
|
|
4
|
-
({ children, small = false, icon: icon$1, active = false, ...props }, ref) => /* @__PURE__ */
|
|
4
|
+
({ children, small = false, icon: icon$1, active = false, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
5
5
|
"button",
|
|
6
6
|
{
|
|
7
7
|
className: windowsButton({ active, small }),
|
|
8
8
|
...props,
|
|
9
9
|
ref
|
|
10
10
|
},
|
|
11
|
-
/* @__PURE__ */
|
|
11
|
+
/* @__PURE__ */ React.createElement("div", { className: icon }, icon$1),
|
|
12
12
|
children
|
|
13
13
|
)
|
|
14
14
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import { Frame } from "../Frame/Frame.mjs";
|
|
3
3
|
import { input } from "../Input/Input.css.mjs";
|
|
4
|
-
const TextArea =
|
|
4
|
+
const TextArea = forwardRef(
|
|
5
5
|
(rest, ref) => /* @__PURE__ */ React.createElement(Frame, { ...rest, ref, className: input, as: "textarea" })
|
|
6
6
|
);
|
|
7
7
|
export {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import { Frame } from "../Frame/Frame.mjs";
|
|
3
3
|
import { optionsBox, option, titleBarBackground, title } from "./TitleBar.css.mjs";
|
|
4
4
|
import { button } from "../Button/Button.css.mjs";
|
|
5
5
|
import cn from "classnames";
|
|
6
|
-
const OptionsBox =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const OptionsBox = forwardRef(
|
|
7
|
+
(rest, ref) => /* @__PURE__ */ React.createElement(
|
|
8
|
+
Frame,
|
|
9
|
+
{
|
|
10
|
+
...rest,
|
|
11
|
+
ref,
|
|
12
|
+
className: cn(optionsBox, rest.className)
|
|
13
|
+
}
|
|
14
|
+
)
|
|
15
|
+
);
|
|
16
|
+
const Option = forwardRef(
|
|
17
|
+
(rest, ref) => /* @__PURE__ */ React.createElement(
|
|
16
18
|
Frame,
|
|
17
19
|
{
|
|
18
20
|
...rest,
|
|
@@ -22,7 +24,7 @@ const Option = React__default.forwardRef(
|
|
|
22
24
|
}
|
|
23
25
|
)
|
|
24
26
|
);
|
|
25
|
-
const TitleBarRenderer = ({ children, title: title$1 = "UNKNOWN.EXE", icon, active = true, ...rest }, ref) => /* @__PURE__ */
|
|
27
|
+
const TitleBarRenderer = ({ children, title: title$1 = "UNKNOWN.EXE", icon, active = true, ...rest }, ref) => /* @__PURE__ */ React.createElement(
|
|
26
28
|
Frame,
|
|
27
29
|
{
|
|
28
30
|
...rest,
|
|
@@ -30,11 +32,11 @@ const TitleBarRenderer = ({ children, title: title$1 = "UNKNOWN.EXE", icon, acti
|
|
|
30
32
|
ref
|
|
31
33
|
},
|
|
32
34
|
icon && icon,
|
|
33
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ React.createElement("div", { className: title }, title$1),
|
|
34
36
|
children
|
|
35
37
|
);
|
|
36
38
|
const TitleBar = Object.assign(
|
|
37
|
-
|
|
39
|
+
forwardRef(TitleBarRenderer),
|
|
38
40
|
{
|
|
39
41
|
Option,
|
|
40
42
|
OptionsBox
|
package/esm/Tooltip/Tooltip.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { wrapper, tip } from "./Tooltip.css.mjs";
|
|
1
|
+
import React, { forwardRef, useState } from "react";
|
|
3
2
|
import cn from "classnames";
|
|
3
|
+
import { wrapper, tip } from "./Tooltip.css.mjs";
|
|
4
4
|
function formatDate(date) {
|
|
5
5
|
const monthNames = [
|
|
6
6
|
"January",
|
|
@@ -27,8 +27,8 @@ const TooltipRenderer = ({
|
|
|
27
27
|
delay = 1e3,
|
|
28
28
|
...rest
|
|
29
29
|
}, ref) => {
|
|
30
|
-
const [show, setShow] =
|
|
31
|
-
const [delayTimer, setDelayTimer] =
|
|
30
|
+
const [show, setShow] = useState(false);
|
|
31
|
+
const [delayTimer, setDelayTimer] = useState(0);
|
|
32
32
|
const handleEnter = () => {
|
|
33
33
|
const timer = window.setTimeout(() => {
|
|
34
34
|
setShow(true);
|
|
@@ -52,7 +52,7 @@ const TooltipRenderer = ({
|
|
|
52
52
|
children
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
|
-
const Tooltip =
|
|
55
|
+
const Tooltip = forwardRef(
|
|
56
56
|
TooltipRenderer
|
|
57
57
|
);
|
|
58
58
|
export {
|
package/esm/Tree/Node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { MediaCd, FileText, Bat, FileFont2, FilePen, FileSettings, FileTextSettings, BatExec, FolderOpen, Folder } from "@react95/icons";
|
|
3
3
|
import { node, nodeContent, folderStatus, iconContainer, label, tree, nodeRoot } from "./Tree.css.mjs";
|
|
4
4
|
import { Frame } from "../Frame/Frame.mjs";
|
|
@@ -40,7 +40,7 @@ const Node = ({
|
|
|
40
40
|
},
|
|
41
41
|
...rest
|
|
42
42
|
}) => {
|
|
43
|
-
const [isOpen, setIsOpen] =
|
|
43
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
44
44
|
const hasChildren = children.length > 0;
|
|
45
45
|
const onClickHandler = (event) => {
|
|
46
46
|
onClick(event, {
|
package/esm/Tree/Tree.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import { NodeRoot, Node, icons } from "./Node.mjs";
|
|
3
3
|
import { tree } from "./Tree.css.mjs";
|
|
4
4
|
import { Frame } from "../Frame/Frame.mjs";
|
|
5
5
|
const Tree = forwardRef(
|
|
6
6
|
({ data, root, ...rest }, ref) => {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, root && /* @__PURE__ */ React.createElement(NodeRoot, { ...root }), /* @__PURE__ */ React.createElement(Frame, { ...rest, className: tree, as: "ul", ref }, data.map((dataNode) => /* @__PURE__ */ React.createElement(Node, { key: dataNode.id, ...dataNode }))));
|
|
8
8
|
}
|
|
9
9
|
);
|
|
10
10
|
Tree.defaultProps = {
|
package/esm/Video/Video.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { forwardRef, useState, useRef, useImperativeHandle, useEffect } from "react";
|
|
2
2
|
import { Mplayer113, User4 } from "@react95/icons";
|
|
3
3
|
import { videoTag, divider, countDownContainer, videoFont, currentTime, elapsedTime, controls, controlBtn, range } from "./Video.css.mjs";
|
|
4
4
|
import { Frame } from "../Frame/Frame.mjs";
|
|
@@ -28,20 +28,20 @@ function parseCurrentTime(secs) {
|
|
|
28
28
|
return [hours, minutes, seconds].map((v) => v < 10 ? `0${v}` : v).filter((v, i) => v !== "00" || i > 0).join(":");
|
|
29
29
|
}
|
|
30
30
|
const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
|
|
31
|
-
const [playing, setPlaying] =
|
|
32
|
-
const [loadeddata, setLoadeddata] =
|
|
33
|
-
const [progress, setProgress] =
|
|
34
|
-
const player =
|
|
35
|
-
const progressRef =
|
|
36
|
-
const wrapperRef =
|
|
37
|
-
const playPauseRef =
|
|
38
|
-
const stopRef =
|
|
39
|
-
const fullScreenRef =
|
|
31
|
+
const [playing, setPlaying] = useState(false);
|
|
32
|
+
const [loadeddata, setLoadeddata] = useState(false);
|
|
33
|
+
const [progress, setProgress] = useState(0);
|
|
34
|
+
const player = useRef(null);
|
|
35
|
+
const progressRef = useRef(null);
|
|
36
|
+
const wrapperRef = useRef(null);
|
|
37
|
+
const playPauseRef = useRef(null);
|
|
38
|
+
const stopRef = useRef(null);
|
|
39
|
+
const fullScreenRef = useRef(null);
|
|
40
40
|
const paths = arrayFy(src);
|
|
41
41
|
const [pathname] = paths;
|
|
42
42
|
const normalizedName = name || pathname.replace(/^.*[\\/]/, "");
|
|
43
43
|
const title = `${normalizedName}${!loadeddata ? " (Opening)" : ""}`;
|
|
44
|
-
|
|
44
|
+
useImperativeHandle(ref, () => ({
|
|
45
45
|
get video() {
|
|
46
46
|
return player;
|
|
47
47
|
},
|
|
@@ -61,7 +61,7 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
|
|
|
61
61
|
return fullScreenRef;
|
|
62
62
|
}
|
|
63
63
|
}));
|
|
64
|
-
|
|
64
|
+
useEffect(() => {
|
|
65
65
|
var _a, _b, _c, _d;
|
|
66
66
|
(_a = player.current) == null ? void 0 : _a.addEventListener(
|
|
67
67
|
"ended",
|
|
@@ -127,6 +127,7 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
|
|
|
127
127
|
), /* @__PURE__ */ React.createElement("div", { className: videoFont, style: { height: 12 } }, !loadeddata && "Openning")), /* @__PURE__ */ React.createElement(Frame, { display: "flex", flexDirection: "column", w: "40%" }, /* @__PURE__ */ React.createElement("div", { className: cn(videoFont, currentTime) }, player.current && parseCurrentTime(player.current.currentTime)), /* @__PURE__ */ React.createElement("div", { className: cn(videoFont, elapsedTime) }, "time"))), /* @__PURE__ */ React.createElement("div", { className: controls }, /* @__PURE__ */ React.createElement(
|
|
128
128
|
Button,
|
|
129
129
|
{
|
|
130
|
+
as: "button",
|
|
130
131
|
className: controlBtn,
|
|
131
132
|
disabled: !loadeddata,
|
|
132
133
|
onClick: () => {
|
|
@@ -200,7 +201,7 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
|
|
|
200
201
|
)))
|
|
201
202
|
);
|
|
202
203
|
};
|
|
203
|
-
const Video =
|
|
204
|
+
const Video = forwardRef(VideoRenderer);
|
|
204
205
|
export {
|
|
205
206
|
Video
|
|
206
207
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react95/core",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.11",
|
|
4
4
|
"description": "Windows 95 styleguide",
|
|
5
5
|
"main": "cjs/index.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"nostalgic",
|
|
56
56
|
"design-system"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "f6a0e8d85480ee86cab55bea9d73fbb448fa1517",
|
|
59
59
|
"module": "esm/index.mjs",
|
|
60
60
|
"private": false,
|
|
61
61
|
"types": "types/index.d.ts"
|
package/types/Avatar/Avatar.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ElementType, ReactElement, ElementRef, ForwardedRef, ImgHTMLAttributes } from 'react';
|
|
2
3
|
import { FrameProps } from '../Frame/Frame';
|
|
3
|
-
export
|
|
4
|
+
export type AvatarProps<TAs extends ElementType> = Omit<ImgHTMLAttributes<HTMLDivElement>, 'width' | 'color' | 'height'> & FrameProps<TAs> & {
|
|
4
5
|
circle?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare const Avatar: React.
|
|
6
|
+
};
|
|
7
|
+
export declare const Avatar: <TAs extends React.ElementType = "div">(props: AvatarProps<TAs> & {
|
|
8
|
+
ref?: ForwardedRef<ElementRef<TAs>>;
|
|
9
|
+
}) => ReactElement;
|
package/types/Button/Button.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ElementType, ReactElement, ElementRef, ForwardedRef, ButtonHTMLAttributes } from 'react';
|
|
2
3
|
import { FrameProps } from '../Frame/Frame';
|
|
3
|
-
export type ButtonProps =
|
|
4
|
-
export declare const Button: React.
|
|
4
|
+
export type ButtonProps<TAs extends ElementType> = ButtonHTMLAttributes<HTMLButtonElement> & FrameProps<TAs>;
|
|
5
|
+
export declare const Button: <TAs extends React.ElementType = "button">(props: ButtonProps<TAs> & {
|
|
6
|
+
ref?: ForwardedRef<ElementRef<TAs>>;
|
|
7
|
+
}) => ReactElement;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { CSSProperties, HTMLProps } from 'react';
|
|
2
3
|
export type LabelProps = {
|
|
3
4
|
disabled?: boolean;
|
|
4
5
|
};
|
|
5
6
|
export type CheckboxProps = {
|
|
6
7
|
label?: string;
|
|
7
8
|
children?: string;
|
|
8
|
-
style?:
|
|
9
|
-
} & LabelProps &
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
} & LabelProps & HTMLProps<HTMLInputElement>;
|
|
10
11
|
export declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { HTMLProps } from 'react';
|
|
2
3
|
import { FrameProps } from '../Frame/Frame';
|
|
3
4
|
export type DropdownProps = {
|
|
4
5
|
options?: Array<string | number>;
|
|
5
|
-
} &
|
|
6
|
+
} & HTMLProps<HTMLSelectElement> & Omit<FrameProps<'select'>, 'as'>;
|
|
6
7
|
export declare const Dropdown: React.ForwardRefExoticComponent<Omit<DropdownProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { HTMLProps } from 'react';
|
|
2
3
|
import { FrameProps } from '../Frame/Frame';
|
|
3
4
|
export type FieldSetProps = {
|
|
4
5
|
legend?: string;
|
|
5
|
-
} &
|
|
6
|
+
} & HTMLProps<HTMLFieldSetElement> & Omit<FrameProps<'fieldset'>, 'as'>;
|
|
6
7
|
export declare const Fieldset: React.ForwardRefExoticComponent<Omit<FieldSetProps, "ref"> & React.RefAttributes<HTMLFieldSetElement>>;
|
package/types/Frame/Frame.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ComponentPropsWithRef, ElementType, Ref, ReactNode, RefAttributes } from 'react';
|
|
2
3
|
import { Sprinkles } from './Frame.css';
|
|
4
|
+
type FixedForwardRef = <T, P = object>(render: (props: P, ref: Ref<T>) => ReactNode) => (props: P & RefAttributes<T>) => ReactNode;
|
|
5
|
+
export declare const fixedForwardRef: FixedForwardRef;
|
|
3
6
|
type DistributiveOmit<T, TOmitted extends PropertyKey> = T extends any ? Omit<T, TOmitted> : never;
|
|
4
|
-
export type FrameProps<TAs extends ElementType
|
|
7
|
+
export type FrameProps<TAs extends ElementType> = {
|
|
5
8
|
as?: TAs;
|
|
6
9
|
} & DistributiveOmit<ComponentPropsWithRef<ElementType extends TAs ? 'div' : TAs>, 'as'> & Sprinkles;
|
|
7
|
-
export declare const Frame: <TAs extends React.ElementType>(props: {
|
|
10
|
+
export declare const Frame: <TAs extends React.ElementType = "div">(props: {
|
|
8
11
|
as?: TAs | undefined;
|
|
9
12
|
} & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends TAs ? "div" : TAs>, "as"> & import("rainbow-sprinkles/dist/declarations/src/types").ChildSprinkles<{
|
|
10
13
|
readonly backgroundColor: {
|
|
@@ -2247,5 +2250,5 @@ export declare const Frame: <TAs extends React.ElementType>(props: {
|
|
|
2247
2250
|
default: string;
|
|
2248
2251
|
};
|
|
2249
2252
|
};
|
|
2250
|
-
}> & React.RefAttributes<any>) =>
|
|
2253
|
+
}> & React.RefAttributes<any>) => ReactNode;
|
|
2251
2254
|
export {};
|
package/types/Input/Input.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { FrameProps } from '../Frame/Frame';
|
|
3
3
|
export type InputProps = Omit<FrameProps<'input'>, 'as'>;
|
|
4
4
|
export declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
package/types/List/List.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ListItem } from './ListItem';
|
|
2
3
|
import { Divider } from './ListDivider';
|
|
3
4
|
import { FrameProps } from '../Frame/Frame';
|
|
4
|
-
import React from 'react';
|
|
5
5
|
export type ListProps = Omit<FrameProps<'ul'>, 'as'>;
|
|
6
6
|
declare const ListRenderer: React.ForwardRefExoticComponent<Omit<ListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
7
7
|
export type IListProps = typeof ListRenderer & {
|
package/types/List/ListItem.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ReactElement, HtmlHTMLAttributes } from 'react';
|
|
2
3
|
export type ListItemProps = {
|
|
3
|
-
icon?:
|
|
4
|
-
} &
|
|
4
|
+
icon?: ReactElement;
|
|
5
|
+
} & HtmlHTMLAttributes<HTMLLIElement>;
|
|
5
6
|
export declare const ListItem: React.ForwardRefExoticComponent<{
|
|
6
7
|
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
7
8
|
} & React.HtmlHTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
|
package/types/Modal/Modal.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/// <reference path="../../../../../types/draggable.d.ts" />
|
|
2
|
-
import
|
|
2
|
+
import React, { HTMLAttributes, ReactElement, MouseEvent } from 'react';
|
|
3
3
|
import { DraggableProps } from 'react-draggable';
|
|
4
4
|
import { List } from '../List/List';
|
|
5
5
|
import { FrameProps } from '../Frame/Frame';
|
|
6
6
|
export type ModalButtons = {
|
|
7
7
|
value: string;
|
|
8
|
-
onClick(event:
|
|
8
|
+
onClick(event: MouseEvent): void;
|
|
9
9
|
};
|
|
10
10
|
export type ModalMenu = {
|
|
11
11
|
name: string;
|
|
12
|
-
list:
|
|
12
|
+
list: ReactElement<typeof List>;
|
|
13
13
|
};
|
|
14
14
|
export type ModalDefaultPosition = {
|
|
15
15
|
x: number;
|
|
16
16
|
y: number;
|
|
17
17
|
};
|
|
18
18
|
export type ModalProps = {
|
|
19
|
-
icon?:
|
|
20
|
-
onClose(event:
|
|
21
|
-
onHelp?(event:
|
|
19
|
+
icon?: ReactElement;
|
|
20
|
+
onClose(event: MouseEvent): void;
|
|
21
|
+
onHelp?(event: MouseEvent): void;
|
|
22
22
|
title: string;
|
|
23
23
|
buttons?: Array<ModalButtons>;
|
|
24
24
|
menu?: Array<ModalMenu>;
|
|
25
25
|
defaultPosition?: DraggableProps['defaultPosition'];
|
|
26
26
|
positionOffset?: DraggableProps['positionOffset'];
|
|
27
27
|
hasWindowButton?: boolean;
|
|
28
|
-
buttonsAlignment?: FrameProps['justifyContent'];
|
|
29
|
-
} & Omit<FrameProps
|
|
28
|
+
buttonsAlignment?: FrameProps<'div'>['justifyContent'];
|
|
29
|
+
} & Omit<FrameProps<'div'>, 'as'> & HTMLAttributes<HTMLDivElement>;
|
|
30
30
|
export declare const Modal: React.ForwardRefExoticComponent<Omit<ModalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
2
2
|
export type ModalProviderProps = {};
|
|
3
|
-
export declare const ModalProvider:
|
|
3
|
+
export declare const ModalProvider: FC<PropsWithChildren<ModalProviderProps>>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ElementType, ReactElement, ElementRef, ForwardedRef } from 'react';
|
|
2
3
|
import { FrameProps } from '../Frame/Frame';
|
|
3
|
-
export type ProgressBarProps = {
|
|
4
|
+
export type ProgressBarProps<TAs extends ElementType> = {
|
|
4
5
|
percent?: number;
|
|
5
|
-
} & FrameProps
|
|
6
|
-
export declare const ProgressBar: React.
|
|
6
|
+
} & FrameProps<TAs>;
|
|
7
|
+
export declare const ProgressBar: <TAs extends React.ElementType = "div">(props: ProgressBarProps<TAs> & {
|
|
8
|
+
ref?: ForwardedRef<ElementRef<TAs>>;
|
|
9
|
+
}) => ReactElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import type { InputHTMLAttributes } from 'react';
|
|
3
|
+
export type RadioButtonProps = InputHTMLAttributes<HTMLInputElement>;
|
|
3
4
|
export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
|
package/types/Range/Range.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { FrameProps } from '../Frame/Frame';
|
|
3
3
|
export type RangeProps = Omit<FrameProps<'input'>, 'as'>;
|
|
4
4
|
export declare const Range: React.ForwardRefExoticComponent<Omit<RangeProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
package/types/Tabs/Tab.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { MouseEvent, HTMLProps } from 'react';
|
|
2
3
|
import { FrameProps } from '../Frame/Frame';
|
|
3
4
|
export type TabProps = {
|
|
4
5
|
activeTab?: string;
|
|
5
6
|
title: string;
|
|
6
7
|
disabled?: boolean;
|
|
7
|
-
onClick?(e:
|
|
8
|
-
} &
|
|
8
|
+
onClick?(e: MouseEvent): void;
|
|
9
|
+
} & HTMLProps<HTMLLIElement> & Omit<FrameProps<'li'>, 'as'>;
|
|
9
10
|
export declare const Tab: React.ForwardRefExoticComponent<Omit<TabProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|