@react95/core 8.0.0-alpha.8 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +18 -42
  2. package/cjs/Avatar/Avatar.cjs +2 -19
  3. package/cjs/Button/Button.cjs +1 -1
  4. package/cjs/Fieldset/Fieldset.cjs +1 -1
  5. package/cjs/Frame/Frame.cjs +1 -0
  6. package/cjs/Input/Input.cjs +1 -20
  7. package/cjs/List/List.cjs +3 -5
  8. package/cjs/List/ListDivider.cjs +1 -11
  9. package/cjs/Modal/Modal.cjs +17 -36
  10. package/cjs/Modal/ModalProvider.cjs +6 -21
  11. package/cjs/Range/Range.cjs +9 -28
  12. package/cjs/Tabs/Tabs.cjs +16 -19
  13. package/cjs/TextArea/TextArea.cjs +2 -19
  14. package/cjs/TitleBar/TitleBar.cjs +10 -8
  15. package/cjs/Tooltip/Tooltip.cjs +6 -23
  16. package/cjs/Tree/Node.cjs +10 -27
  17. package/cjs/Tree/Tree.css.ts.vanilla.css +1 -1
  18. package/cjs/Video/Video.cjs +28 -44
  19. package/cjs/Video/buttons/Fullscreen.cjs +2 -19
  20. package/cjs/Video/buttons/Pause.cjs +2 -19
  21. package/cjs/Video/buttons/Play.cjs +2 -19
  22. package/cjs/Video/buttons/Stop.cjs +2 -19
  23. package/esm/Alert/Alert.mjs +6 -6
  24. package/esm/Avatar/Avatar.mjs +2 -2
  25. package/esm/Button/Button.mjs +4 -4
  26. package/esm/Checkbox/Checkbox.mjs +3 -3
  27. package/esm/Dropdown/Dropdown.mjs +2 -2
  28. package/esm/Fieldset/Fieldset.mjs +2 -2
  29. package/esm/Frame/Frame.mjs +4 -3
  30. package/esm/Input/Input.mjs +2 -4
  31. package/esm/List/List.mjs +3 -5
  32. package/esm/List/ListDivider.mjs +2 -12
  33. package/esm/List/ListItem.mjs +3 -3
  34. package/esm/Modal/Modal.mjs +9 -11
  35. package/esm/Modal/ModalProvider.mjs +6 -4
  36. package/esm/ProgressBar/ProgressBar.mjs +4 -4
  37. package/esm/RadioButton/RadioButton.mjs +3 -3
  38. package/esm/Range/Range.mjs +11 -13
  39. package/esm/Tabs/Tab.mjs +2 -2
  40. package/esm/Tabs/Tabs.mjs +21 -24
  41. package/esm/TaskBar/Clock.mjs +3 -3
  42. package/esm/TaskBar/TaskBar.mjs +9 -9
  43. package/esm/TaskBar/WindowButton.mjs +3 -3
  44. package/esm/TextArea/TextArea.mjs +2 -2
  45. package/esm/TitleBar/TitleBar.mjs +16 -14
  46. package/esm/Tooltip/Tooltip.mjs +5 -5
  47. package/esm/Tree/Node.mjs +2 -2
  48. package/esm/Tree/Tree.css.ts.vanilla.css +1 -1
  49. package/esm/Tree/Tree.mjs +2 -2
  50. package/esm/Video/Video.mjs +14 -13
  51. package/esm/Video/buttons/Fullscreen.mjs +1 -1
  52. package/esm/Video/buttons/Pause.mjs +1 -1
  53. package/esm/Video/buttons/Play.mjs +1 -1
  54. package/esm/Video/buttons/Stop.mjs +1 -1
  55. package/package.json +5 -4
  56. package/types/Avatar/Avatar.d.ts +9 -0
  57. package/types/Button/Button.d.ts +7 -0
  58. package/{@types → types}/Checkbox/Checkbox.d.ts +3 -2
  59. package/{@types → types}/Dropdown/Dropdown.d.ts +2 -1
  60. package/{@types → types}/Fieldset/Fieldset.d.ts +2 -1
  61. package/{@types → types}/Frame/Frame.d.ts +7 -4
  62. package/{@types → types}/Input/Input.d.ts +1 -1
  63. package/{@types → types}/List/ListItem.d.ts +3 -2
  64. package/{@types → types}/Modal/Modal.d.ts +8 -8
  65. package/{@types → types}/Modal/ModalContext.d.ts +2 -2
  66. package/types/Modal/ModalProvider.d.ts +3 -0
  67. package/types/ProgressBar/ProgressBar.d.ts +9 -0
  68. package/{@types → types}/RadioButton/RadioButton.d.ts +2 -1
  69. package/{@types → types}/Range/Range.d.ts +1 -1
  70. package/{@types → types}/Tabs/Tab.d.ts +3 -2
  71. package/{@types → types}/Tabs/Tabs.d.ts +3 -2
  72. package/{@types → types}/TaskBar/TaskBar.d.ts +2 -1
  73. package/{@types → types}/TaskBar/WindowButton.d.ts +2 -1
  74. package/{@types → types}/TextArea/TextArea.d.ts +1 -1
  75. package/{@types → types}/TitleBar/TitleBar.d.ts +5 -4
  76. package/{@types → types}/Tooltip/Tooltip.d.ts +3 -2
  77. package/{@types → types}/Tree/Node.d.ts +7 -6
  78. package/{@types → types}/Tree/Tree.d.ts +2 -2
  79. package/types/Video/Video.d.ts +17 -0
  80. package/types/Video/buttons/Fullscreen.d.ts +4 -0
  81. package/types/Video/buttons/Pause.d.ts +4 -0
  82. package/types/Video/buttons/Play.d.ts +4 -0
  83. package/types/Video/buttons/Stop.d.ts +4 -0
  84. package/@types/Avatar/Avatar.d.ts +0 -6
  85. package/@types/Button/Button.d.ts +0 -4
  86. package/@types/Modal/ModalProvider.d.ts +0 -3
  87. package/@types/ProgressBar/ProgressBar.d.ts +0 -6
  88. package/@types/Video/Video.d.ts +0 -16
  89. package/@types/Video/buttons/Fullscreen.d.ts +0 -3
  90. package/@types/Video/buttons/Pause.d.ts +0 -3
  91. package/@types/Video/buttons/Play.d.ts +0 -3
  92. package/@types/Video/buttons/Stop.d.ts +0 -3
  93. package/{@types → types}/Alert/Alert.css.d.ts +0 -0
  94. package/{@types → types}/Alert/Alert.d.ts +0 -0
  95. package/{@types → types}/Avatar/Avatar.css.d.ts +0 -0
  96. package/{@types → types}/Button/Button.css.d.ts +0 -0
  97. package/{@types → types}/Checkbox/Checkbox.css.d.ts +0 -0
  98. package/{@types → types}/Cursor/Cursor.css.d.ts +0 -0
  99. package/{@types → types}/Dropdown/Dropdown.css.d.ts +0 -0
  100. package/{@types → types}/Fieldset/Fieldset.css.d.ts +0 -0
  101. package/{@types → types}/Frame/Frame.css.d.ts +0 -0
  102. package/{@types → types}/Frame/props.d.ts +0 -0
  103. package/{@types → types}/Input/Input.css.d.ts +0 -0
  104. package/{@types → types}/List/List.css.d.ts +0 -0
  105. package/{@types → types}/List/List.d.ts +1 -1
  106. /package/{@types → types}/List/ListDivider.d.ts +0 -0
  107. /package/{@types → types}/Modal/Modal.css.d.ts +0 -0
  108. /package/{@types → types}/ProgressBar/ProgressBar.css.d.ts +0 -0
  109. /package/{@types → types}/RadioButton/RadioButton.css.d.ts +0 -0
  110. /package/{@types → types}/RadioButton/radioButtonStates.d.ts +0 -0
  111. /package/{@types → types}/Range/Range.css.d.ts +0 -0
  112. /package/{@types → types}/Tabs/Tabs.css.d.ts +0 -0
  113. /package/{@types → types}/TaskBar/Clock.d.ts +0 -0
  114. /package/{@types → types}/TaskBar/TaskBar.css.d.ts +0 -0
  115. /package/{@types → types}/TitleBar/TitleBar.css.d.ts +0 -0
  116. /package/{@types → types}/Tooltip/Tooltip.css.d.ts +0 -0
  117. /package/{@types → types}/Tree/Tree.css.d.ts +0 -0
  118. /package/{@types → types}/Video/Video.css.d.ts +0 -0
  119. /package/{@types → types}/Video/buttons/index.d.ts +0 -0
  120. /package/{@types → types}/index.d.ts +0 -0
  121. /package/{@types → types}/shared/font-names.d.ts +0 -0
  122. /package/{@types → types}/themes/all.d.ts +0 -0
  123. /package/{@types → types}/themes/azureOrange.css.d.ts +0 -0
  124. /package/{@types → types}/themes/baseTheme.d.ts +0 -0
  125. /package/{@types → types}/themes/bee.css.d.ts +0 -0
  126. /package/{@types → types}/themes/blackAndWhite.css.d.ts +0 -0
  127. /package/{@types → types}/themes/brick.css.d.ts +0 -0
  128. /package/{@types → types}/themes/candy.css.d.ts +0 -0
  129. /package/{@types → types}/themes/coldGray.css.d.ts +0 -0
  130. /package/{@types → types}/themes/contract.css.d.ts +0 -0
  131. /package/{@types → types}/themes/counterStrike.css.d.ts +0 -0
  132. /package/{@types → types}/themes/eggplant.css.d.ts +0 -0
  133. /package/{@types → types}/themes/highContrast.css.d.ts +0 -0
  134. /package/{@types → types}/themes/lilac.css.d.ts +0 -0
  135. /package/{@types → types}/themes/lilacRoseDark.css.d.ts +0 -0
  136. /package/{@types → types}/themes/maple.css.d.ts +0 -0
  137. /package/{@types → types}/themes/marine.css.d.ts +0 -0
  138. /package/{@types → types}/themes/matrix.css.d.ts +0 -0
  139. /package/{@types → types}/themes/millenium.css.d.ts +0 -0
  140. /package/{@types → types}/themes/modernDark.css.d.ts +0 -0
  141. /package/{@types → types}/themes/molecule.css.d.ts +0 -0
  142. /package/{@types → types}/themes/ninjaTurtles.css.d.ts +0 -0
  143. /package/{@types → types}/themes/olive.css.d.ts +0 -0
  144. /package/{@types → types}/themes/pamelaAnderson.css.d.ts +0 -0
  145. /package/{@types → types}/themes/plum.css.d.ts +0 -0
  146. /package/{@types → types}/themes/rainyDay.css.d.ts +0 -0
  147. /package/{@types → types}/themes/rose.css.d.ts +0 -0
  148. /package/{@types → types}/themes/slate.css.d.ts +0 -0
  149. /package/{@types → types}/themes/spruce.css.d.ts +0 -0
  150. /package/{@types → types}/themes/storm.css.d.ts +0 -0
  151. /package/{@types → types}/themes/theSixtiesUSA.css.d.ts +0 -0
  152. /package/{@types → types}/themes/tokyoDark.css.d.ts +0 -0
  153. /package/{@types → types}/themes/tooSexy.css.d.ts +0 -0
  154. /package/{@types → types}/themes/travel.css.d.ts +0 -0
  155. /package/{@types → types}/themes/vaporTeal.css.d.ts +0 -0
  156. /package/{@types → types}/themes/vermillion.css.d.ts +0 -0
  157. /package/{@types → types}/themes/violetDark.css.d.ts +0 -0
  158. /package/{@types → types}/themes/water.css.d.ts +0 -0
  159. /package/{@types → types}/themes/win95.css.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import React, { forwardRef, useContext, useState, useEffect } from "react";
2
2
  import Draggable from "react-draggable";
3
3
  import { Button } from "../Button/Button.mjs";
4
4
  import { TitleBar } from "../TitleBar/TitleBar.mjs";
@@ -30,11 +30,11 @@ const ModalRenderer = ({
30
30
  updateWindow,
31
31
  setActiveWindow,
32
32
  activeWindow
33
- } = React.useContext(ModalContext);
34
- const [id, setId] = React.useState(null);
35
- const [menuOpened, setMenuOpened] = React.useState("");
36
- const [isActive, setIsActive] = React.useState(false);
37
- React.useEffect(() => {
33
+ } = useContext(ModalContext);
34
+ const [id, setId] = useState(null);
35
+ const [menuOpened, setMenuOpened] = useState("");
36
+ const [isActive, setIsActive] = useState(false);
37
+ useEffect(() => {
38
38
  if (!id) {
39
39
  const newId = addWindows({ icon, title, hasButton });
40
40
  if (newId) {
@@ -45,14 +45,14 @@ const ModalRenderer = ({
45
45
  updateWindow(id, { icon, title, hasButton });
46
46
  }
47
47
  }, [id, icon, title, hasButton]);
48
- React.useEffect(() => {
48
+ useEffect(() => {
49
49
  return () => {
50
50
  if (id) {
51
51
  removeWindow(id);
52
52
  }
53
53
  };
54
54
  }, [id]);
55
- React.useEffect(() => setIsActive(id === activeWindow), [id, activeWindow]);
55
+ useEffect(() => setIsActive(id === activeWindow), [id, activeWindow]);
56
56
  return /* @__PURE__ */ React.createElement(
57
57
  Draggable,
58
58
  {
@@ -113,9 +113,7 @@ const ModalRenderer = ({
113
113
  )
114
114
  );
115
115
  };
116
- const Modal = React.forwardRef(
117
- ModalRenderer
118
- );
116
+ const Modal = forwardRef(ModalRenderer);
119
117
  Modal.displayName = "Modal";
120
118
  Modal.defaultProps = {
121
119
  icon: void 0,
@@ -1,5 +1,5 @@
1
1
  import { nanoid } from "nanoid";
2
- import * as React from "react";
2
+ import React, { useReducer, useState } from "react";
3
3
  import { ModalContext } from "./ModalContext.mjs";
4
4
  const windowStackReducer = (state, action) => {
5
5
  const newWindows = { ...state };
@@ -20,9 +20,11 @@ const windowStackReducer = (state, action) => {
20
20
  return state;
21
21
  }
22
22
  };
23
- const ModalProvider = ({ children }) => {
24
- const [windows, dispatch] = React.useReducer(windowStackReducer, {});
25
- const [activeWindow, setActiveWindow] = React.useState();
23
+ const ModalProvider = ({
24
+ children
25
+ }) => {
26
+ const [windows, dispatch] = useReducer(windowStackReducer, {});
27
+ const [activeWindow, setActiveWindow] = useState();
26
28
  const addWindows = (window) => {
27
29
  const id = nanoid();
28
30
  dispatch({ type: "ADD_WINDOW", id, window });
@@ -1,9 +1,9 @@
1
- import React__default, { forwardRef } from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import cn from "classnames";
3
3
  import { Frame } from "../Frame/Frame.mjs";
4
4
  import { wrapper, whiteBar, container, progress } from "./ProgressBar.css.mjs";
5
5
  const ProgressBar = forwardRef(
6
- ({ width = "150px", percent = 0, ...rest }, ref) => /* @__PURE__ */ React__default.createElement(
6
+ ({ width = "150px", percent = 0, ...rest }, ref) => /* @__PURE__ */ React.createElement(
7
7
  Frame,
8
8
  {
9
9
  ...rest,
@@ -11,8 +11,8 @@ const ProgressBar = forwardRef(
11
11
  className: cn(wrapper, rest.className),
12
12
  ref
13
13
  },
14
- /* @__PURE__ */ React__default.createElement(Frame, { className: whiteBar, width }, `${percent}%`),
15
- /* @__PURE__ */ React__default.createElement(Frame, { className: container, width: `${percent}%` }, /* @__PURE__ */ React__default.createElement(Frame, { className: progress, width }, `${percent}%`))
14
+ /* @__PURE__ */ React.createElement(Frame, { className: whiteBar, width }, `${percent}%`),
15
+ /* @__PURE__ */ React.createElement(Frame, { className: container, width: `${percent}%` }, /* @__PURE__ */ React.createElement(Frame, { className: progress, width }, `${percent}%`))
16
16
  )
17
17
  );
18
18
  export {
@@ -1,7 +1,7 @@
1
- import React__default, { forwardRef } from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { label, field, icon, text } from "./RadioButton.css.mjs";
3
3
  const RadioButton = forwardRef(
4
- ({ children, disabled, ...props }, ref) => /* @__PURE__ */ React__default.createElement("label", { className: label }, /* @__PURE__ */ React__default.createElement(
4
+ ({ children, disabled, ...props }, ref) => /* @__PURE__ */ React.createElement("label", { className: label }, /* @__PURE__ */ React.createElement(
5
5
  "input",
6
6
  {
7
7
  type: "radio",
@@ -10,7 +10,7 @@ const RadioButton = forwardRef(
10
10
  ref,
11
11
  ...props
12
12
  }
13
- ), /* @__PURE__ */ React__default.createElement("span", { className: icon }), /* @__PURE__ */ React__default.createElement("span", { className: text }, children))
13
+ ), /* @__PURE__ */ React.createElement("span", { className: icon }), /* @__PURE__ */ React.createElement("span", { className: text }, children))
14
14
  );
15
15
  export {
16
16
  RadioButton
@@ -1,19 +1,17 @@
1
- import * as React from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { Frame } from "../Frame/Frame.mjs";
3
3
  import { range } from "./Range.css.mjs";
4
4
  import cn from "classnames";
5
- const Range = React.forwardRef(
6
- (rest, ref) => /* @__PURE__ */ React.createElement(
7
- Frame,
8
- {
9
- ...rest,
10
- ref,
11
- className: cn(range, rest.className),
12
- as: "input",
13
- type: "range"
14
- }
15
- )
16
- );
5
+ const Range = forwardRef((rest, ref) => /* @__PURE__ */ React.createElement(
6
+ Frame,
7
+ {
8
+ ...rest,
9
+ ref,
10
+ className: cn(range, rest.className),
11
+ as: "input",
12
+ type: "range"
13
+ }
14
+ ));
17
15
  export {
18
16
  Range
19
17
  };
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, {
@@ -10,7 +10,7 @@
10
10
  margin-left: var(--r95-space-6);
11
11
  }
12
12
  .r95_z2881c1 {
13
- margin-left: var(--r95-space-12);
13
+ margin-left: var(--r95-space-13);
14
14
  border-left-width: thin;
15
15
  border-left-style: dotted;
16
16
  border-left-color: var(--r95-color-borderDarkest);
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,16 +1,17 @@
1
1
  {
2
2
  "name": "@react95/core",
3
- "version": "8.0.0-alpha.8",
3
+ "version": "8.0.0",
4
4
  "description": "Windows 95 styleguide",
5
5
  "main": "cjs/index.cjs",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
9
- "types": "./@types/index.d.ts",
9
+ "types": "./types/index.d.ts",
10
10
  "import": "./esm",
11
11
  "require": "./cjs"
12
12
  },
13
13
  "./themes/*.css": {
14
+ "types": "./types/themes/all.d.ts",
14
15
  "import": "./esm/themes/*.css.mjs",
15
16
  "require": "./cjs/themes/*.css.cjs"
16
17
  },
@@ -54,8 +55,8 @@
54
55
  "nostalgic",
55
56
  "design-system"
56
57
  ],
57
- "gitHead": "331e56d9a86ca5dd318af278f34a32c3f79645b8",
58
+ "gitHead": "c0027899739b008d4ccaada7d0625fdc98242bdf",
58
59
  "module": "esm/index.mjs",
59
60
  "private": false,
60
- "types": "@types/index.d.ts"
61
+ "types": "types/index.d.ts"
61
62
  }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ElementType, ReactElement, ElementRef, ForwardedRef, ImgHTMLAttributes } from 'react';
3
+ import { FrameProps } from '../Frame/Frame';
4
+ export type AvatarProps<TAs extends ElementType> = Omit<ImgHTMLAttributes<HTMLDivElement>, 'width' | 'color' | 'height'> & FrameProps<TAs> & {
5
+ circle?: boolean;
6
+ };
7
+ export declare const Avatar: <TAs extends React.ElementType = "div">(props: AvatarProps<TAs> & {
8
+ ref?: ForwardedRef<ElementRef<TAs>>;
9
+ }) => ReactElement;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { ElementType, ReactElement, ElementRef, ForwardedRef, ButtonHTMLAttributes } from 'react';
3
+ import { FrameProps } from '../Frame/Frame';
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>>;