@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.
Files changed (81) hide show
  1. package/cjs/Avatar/Avatar.cjs +2 -19
  2. package/cjs/Button/Button.cjs +1 -1
  3. package/cjs/Fieldset/Fieldset.cjs +1 -1
  4. package/cjs/Frame/Frame.cjs +1 -0
  5. package/cjs/Input/Input.cjs +1 -20
  6. package/cjs/List/List.cjs +3 -5
  7. package/cjs/List/ListDivider.cjs +1 -11
  8. package/cjs/Modal/Modal.cjs +17 -36
  9. package/cjs/Modal/ModalProvider.cjs +6 -21
  10. package/cjs/Range/Range.cjs +9 -28
  11. package/cjs/Tabs/Tabs.cjs +16 -19
  12. package/cjs/TextArea/TextArea.cjs +2 -19
  13. package/cjs/TitleBar/TitleBar.cjs +10 -8
  14. package/cjs/Tooltip/Tooltip.cjs +6 -23
  15. package/cjs/Tree/Node.cjs +10 -27
  16. package/cjs/Video/Video.cjs +28 -44
  17. package/cjs/Video/buttons/Fullscreen.cjs +2 -19
  18. package/cjs/Video/buttons/Pause.cjs +2 -19
  19. package/cjs/Video/buttons/Play.cjs +2 -19
  20. package/cjs/Video/buttons/Stop.cjs +2 -19
  21. package/esm/Alert/Alert.mjs +6 -6
  22. package/esm/Avatar/Avatar.mjs +2 -2
  23. package/esm/Button/Button.mjs +4 -4
  24. package/esm/Checkbox/Checkbox.mjs +3 -3
  25. package/esm/Dropdown/Dropdown.mjs +2 -2
  26. package/esm/Fieldset/Fieldset.mjs +2 -2
  27. package/esm/Frame/Frame.mjs +4 -3
  28. package/esm/Input/Input.mjs +2 -4
  29. package/esm/List/List.mjs +3 -5
  30. package/esm/List/ListDivider.mjs +2 -12
  31. package/esm/List/ListItem.mjs +3 -3
  32. package/esm/Modal/Modal.mjs +9 -11
  33. package/esm/Modal/ModalProvider.mjs +6 -4
  34. package/esm/ProgressBar/ProgressBar.mjs +4 -4
  35. package/esm/RadioButton/RadioButton.mjs +3 -3
  36. package/esm/Range/Range.mjs +11 -13
  37. package/esm/Tabs/Tab.mjs +2 -2
  38. package/esm/Tabs/Tabs.mjs +21 -24
  39. package/esm/TaskBar/Clock.mjs +3 -3
  40. package/esm/TaskBar/TaskBar.mjs +9 -9
  41. package/esm/TaskBar/WindowButton.mjs +3 -3
  42. package/esm/TextArea/TextArea.mjs +2 -2
  43. package/esm/TitleBar/TitleBar.mjs +16 -14
  44. package/esm/Tooltip/Tooltip.mjs +5 -5
  45. package/esm/Tree/Node.mjs +2 -2
  46. package/esm/Tree/Tree.mjs +2 -2
  47. package/esm/Video/Video.mjs +14 -13
  48. package/esm/Video/buttons/Fullscreen.mjs +1 -1
  49. package/esm/Video/buttons/Pause.mjs +1 -1
  50. package/esm/Video/buttons/Play.mjs +1 -1
  51. package/esm/Video/buttons/Stop.mjs +1 -1
  52. package/package.json +2 -2
  53. package/types/Avatar/Avatar.d.ts +7 -4
  54. package/types/Button/Button.d.ts +5 -2
  55. package/types/Checkbox/Checkbox.d.ts +3 -2
  56. package/types/Dropdown/Dropdown.d.ts +2 -1
  57. package/types/Fieldset/Fieldset.d.ts +2 -1
  58. package/types/Frame/Frame.d.ts +7 -4
  59. package/types/Input/Input.d.ts +1 -1
  60. package/types/List/List.d.ts +1 -1
  61. package/types/List/ListItem.d.ts +3 -2
  62. package/types/Modal/Modal.d.ts +8 -8
  63. package/types/Modal/ModalContext.d.ts +2 -2
  64. package/types/Modal/ModalProvider.d.ts +2 -2
  65. package/types/ProgressBar/ProgressBar.d.ts +6 -3
  66. package/types/RadioButton/RadioButton.d.ts +2 -1
  67. package/types/Range/Range.d.ts +1 -1
  68. package/types/Tabs/Tab.d.ts +3 -2
  69. package/types/Tabs/Tabs.d.ts +3 -2
  70. package/types/TaskBar/TaskBar.d.ts +2 -1
  71. package/types/TaskBar/WindowButton.d.ts +2 -1
  72. package/types/TextArea/TextArea.d.ts +1 -1
  73. package/types/TitleBar/TitleBar.d.ts +5 -4
  74. package/types/Tooltip/Tooltip.d.ts +3 -2
  75. package/types/Tree/Node.d.ts +7 -6
  76. package/types/Tree/Tree.d.ts +2 -2
  77. package/types/Video/Video.d.ts +10 -9
  78. package/types/Video/buttons/Fullscreen.d.ts +3 -2
  79. package/types/Video/buttons/Pause.d.ts +3 -2
  80. package/types/Video/buttons/Play.d.ts +3 -2
  81. package/types/Video/buttons/Stop.d.ts +3 -2
package/esm/Tabs/Tab.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import React__default, { forwardRef } from "react";
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__ */ React__default.createElement(
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 React__default, { forwardRef } from "react";
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] = React__default.Children.toArray(children);
9
- const [activeTab, setActiveTab] = React__default.useState(
8
+ const [firstTab] = Children.toArray(children);
9
+ const [activeTab, setActiveTab] = useState(
10
10
  defaultActiveTab || firstTab.props.title
11
11
  );
12
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
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
- React__default.Children.map(
21
- children,
22
- (child) => {
23
- const { title, disabled } = child.props;
24
- return /* @__PURE__ */ React__default.createElement(
25
- Tab,
26
- {
27
- key: title,
28
- ...child.props,
29
- activeTab,
30
- onClick: (e) => {
31
- if (!disabled) {
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__ */ React__default.createElement(Frame, { className: navContainer, width: rest.width || rest.w }, React__default.Children.map(
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
  )));
@@ -1,4 +1,4 @@
1
- import React__default, { useState, useEffect } from "react";
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__ */ React__default.createElement(
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__ */ React__default.createElement(Tooltip, { className: tooltip }, timer)
29
+ /* @__PURE__ */ React.createElement(Tooltip, { className: tooltip }, timer)
30
30
  );
31
31
  };
32
32
  export {
@@ -1,4 +1,4 @@
1
- import React__default, { forwardRef, useState, useContext } from "react";
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__ */ React__default.createElement(
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__ */ React__default.createElement(
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__ */ React__default.createElement(
42
+ /* @__PURE__ */ React.createElement(
43
43
  WindowButton,
44
44
  {
45
45
  small: true,
46
- icon: /* @__PURE__ */ React__default.createElement(Logo, { variant: "32x32_4" }),
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__ */ React__default.createElement(Frame, { w: "100%", paddingLeft: "$0", ml: "$2", display: "flex" }, Object.entries(windows).map(
56
- ([windowId, { icon, title, hasButton }]) => hasButton && /* @__PURE__ */ React__default.createElement(
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__ */ React__default.createElement("div", { className: truncate }, title)
65
+ /* @__PURE__ */ React.createElement("div", { className: truncate }, title)
66
66
  )
67
67
  )),
68
- /* @__PURE__ */ React__default.createElement(Clock, null)
68
+ /* @__PURE__ */ React.createElement(Clock, null)
69
69
  );
70
70
  }
71
71
  );
@@ -1,14 +1,14 @@
1
- import React__default, { forwardRef } from "react";
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__ */ React__default.createElement(
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__ */ React__default.createElement("div", { className: icon }, icon$1),
11
+ /* @__PURE__ */ React.createElement("div", { className: icon }, icon$1),
12
12
  children
13
13
  )
14
14
  );
@@ -1,7 +1,7 @@
1
- import * as React from "react";
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 = React.forwardRef(
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 React__default from "react";
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 = React__default.forwardRef((rest, ref) => /* @__PURE__ */ React__default.createElement(
7
- Frame,
8
- {
9
- ...rest,
10
- ref,
11
- className: cn(optionsBox, rest.className)
12
- }
13
- ));
14
- const Option = React__default.forwardRef(
15
- (rest, ref) => /* @__PURE__ */ React__default.createElement(
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__ */ React__default.createElement(
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__ */ React__default.createElement("div", { className: title }, title$1),
35
+ /* @__PURE__ */ React.createElement("div", { className: title }, title$1),
34
36
  children
35
37
  );
36
38
  const TitleBar = Object.assign(
37
- React__default.forwardRef(TitleBarRenderer),
39
+ forwardRef(TitleBarRenderer),
38
40
  {
39
41
  Option,
40
42
  OptionsBox
@@ -1,6 +1,6 @@
1
- import * as React from "react";
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] = React.useState(false);
31
- const [delayTimer, setDelayTimer] = React.useState(0);
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 = React.forwardRef(
55
+ const Tooltip = forwardRef(
56
56
  TooltipRenderer
57
57
  );
58
58
  export {
package/esm/Tree/Node.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from "react";
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] = React.useState(false);
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 React__default, { forwardRef } from "react";
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__ */ React__default.createElement(React__default.Fragment, null, root && /* @__PURE__ */ React__default.createElement(NodeRoot, { ...root }), /* @__PURE__ */ React__default.createElement(Frame, { ...rest, className: tree, as: "ul", ref }, data.map((dataNode) => /* @__PURE__ */ React__default.createElement(Node, { key: dataNode.id, ...dataNode }))));
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 = {
@@ -1,4 +1,4 @@
1
- import * as React from "react";
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] = React.useState(false);
32
- const [loadeddata, setLoadeddata] = React.useState(false);
33
- const [progress, setProgress] = React.useState(0);
34
- const player = React.useRef(null);
35
- const progressRef = React.useRef(null);
36
- const wrapperRef = React.useRef(null);
37
- const playPauseRef = React.useRef(null);
38
- const stopRef = React.useRef(null);
39
- const fullScreenRef = React.useRef(null);
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
- React.useImperativeHandle(ref, () => ({
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
- React.useEffect(() => {
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 = React.forwardRef(VideoRenderer);
204
+ const Video = forwardRef(VideoRenderer);
204
205
  export {
205
206
  Video
206
207
  };
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  const Fullscreen = (props) => /* @__PURE__ */ React.createElement(
3
3
  "svg",
4
4
  {
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  const Pause = (props) => /* @__PURE__ */ React.createElement(
3
3
  "svg",
4
4
  {
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  const Play = (props) => /* @__PURE__ */ React.createElement(
3
3
  "svg",
4
4
  {
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  const Stop = (props) => /* @__PURE__ */ React.createElement(
3
3
  "svg",
4
4
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react95/core",
3
- "version": "8.0.0-alpha.10",
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": "2fe5ce2a0b216ee120f3e2ad8756cc505d32b3c3",
58
+ "gitHead": "f6a0e8d85480ee86cab55bea9d73fbb448fa1517",
59
59
  "module": "esm/index.mjs",
60
60
  "private": false,
61
61
  "types": "types/index.d.ts"
@@ -1,6 +1,9 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
+ import type { ElementType, ReactElement, ElementRef, ForwardedRef, ImgHTMLAttributes } from 'react';
2
3
  import { FrameProps } from '../Frame/Frame';
3
- export interface AvatarProps extends Omit<React.ImgHTMLAttributes<HTMLDivElement>, 'width' | 'color' | 'height'>, FrameProps {
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.ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
+ };
7
+ export declare const Avatar: <TAs extends React.ElementType = "div">(props: AvatarProps<TAs> & {
8
+ ref?: ForwardedRef<ElementRef<TAs>>;
9
+ }) => ReactElement;
@@ -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 = React.ButtonHTMLAttributes<HTMLButtonElement> & FrameProps;
4
- export declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
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?: React.CSSProperties;
9
- } & LabelProps & React.HTMLProps<HTMLInputElement>;
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
- } & React.HTMLProps<HTMLSelectElement> & Omit<FrameProps<'select'>, 'as'>;
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
- } & React.HTMLProps<HTMLFieldSetElement> & FrameProps;
6
+ } & HTMLProps<HTMLFieldSetElement> & Omit<FrameProps<'fieldset'>, 'as'>;
6
7
  export declare const Fieldset: React.ForwardRefExoticComponent<Omit<FieldSetProps, "ref"> & React.RefAttributes<HTMLFieldSetElement>>;
@@ -1,10 +1,13 @@
1
- import React, { ComponentPropsWithRef, ElementType } from '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 = 'div'> = {
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>) => React.ReactNode;
2253
+ }> & React.RefAttributes<any>) => ReactNode;
2251
2254
  export {};
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
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>>;
@@ -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 & {
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
+ import type { ReactElement, HtmlHTMLAttributes } from 'react';
2
3
  export type ListItemProps = {
3
- icon?: React.ReactElement;
4
- } & React.HtmlHTMLAttributes<HTMLLIElement>;
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>>;
@@ -1,30 +1,30 @@
1
1
  /// <reference path="../../../../../types/draggable.d.ts" />
2
- import * as React from 'react';
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: React.MouseEvent): void;
8
+ onClick(event: MouseEvent): void;
9
9
  };
10
10
  export type ModalMenu = {
11
11
  name: string;
12
- list: React.ReactElement<typeof 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?: React.ReactElement;
20
- onClose(event: React.MouseEvent): void;
21
- onHelp?(event: React.MouseEvent): void;
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, 'as'> & React.HTMLAttributes<HTMLDivElement>;
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,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import type { ReactElement } from 'react';
2
2
  export type Windows = {
3
- icon?: React.ReactElement;
3
+ icon?: ReactElement;
4
4
  title: string;
5
5
  hasButton: boolean;
6
6
  };
@@ -1,3 +1,3 @@
1
- import * as React from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  export type ModalProviderProps = {};
3
- export declare const ModalProvider: React.FC<React.PropsWithChildren<ModalProviderProps>>;
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.ForwardRefExoticComponent<Omit<ProgressBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
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
- export type RadioButtonProps = React.InputHTMLAttributes<HTMLInputElement>;
2
+ import type { InputHTMLAttributes } from 'react';
3
+ export type RadioButtonProps = InputHTMLAttributes<HTMLInputElement>;
3
4
  export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
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>>;
@@ -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: React.MouseEvent): void;
8
- } & React.HTMLProps<HTMLLIElement> & Omit<FrameProps<'li'>, 'as'>;
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>>;