@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
@@ -12,25 +12,8 @@ const Pause = require("./buttons/Pause.cjs");
12
12
  const Stop = require("./buttons/Stop.cjs");
13
13
  const Fullscreen = require("./buttons/Fullscreen.cjs");
14
14
  const cn = require("classnames");
15
- function _interopNamespaceDefault(e) {
16
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
17
- if (e) {
18
- for (const k in e) {
19
- if (k !== "default") {
20
- const d = Object.getOwnPropertyDescriptor(e, k);
21
- Object.defineProperty(n, k, d.get ? d : {
22
- enumerable: true,
23
- get: () => e[k]
24
- });
25
- }
26
- }
27
- }
28
- n.default = e;
29
- return Object.freeze(n);
30
- }
31
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
32
- const Source = ({ src }) => /* @__PURE__ */ React__namespace.createElement("source", { src, type: `video/${src.substring(src.length - 3)}` });
33
- const PlayOrPause = ({ playing }) => playing ? /* @__PURE__ */ React__namespace.createElement(Pause, null) : /* @__PURE__ */ React__namespace.createElement(Play, null);
15
+ const Source = ({ src }) => /* @__PURE__ */ React.createElement("source", { src, type: `video/${src.substring(src.length - 3)}` });
16
+ const PlayOrPause = ({ playing }) => playing ? /* @__PURE__ */ React.createElement(Pause, null) : /* @__PURE__ */ React.createElement(Play, null);
34
17
  const arrayFy = (str) => [].concat(str);
35
18
  function updateProgressBar(player, updateProgress) {
36
19
  const percentage = Math.floor(100 / player.duration * player.currentTime);
@@ -47,20 +30,20 @@ function parseCurrentTime(secs) {
47
30
  return [hours, minutes, seconds].map((v) => v < 10 ? `0${v}` : v).filter((v, i) => v !== "00" || i > 0).join(":");
48
31
  }
49
32
  const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
50
- const [playing, setPlaying] = React__namespace.useState(false);
51
- const [loadeddata, setLoadeddata] = React__namespace.useState(false);
52
- const [progress, setProgress] = React__namespace.useState(0);
53
- const player = React__namespace.useRef(null);
54
- const progressRef = React__namespace.useRef(null);
55
- const wrapperRef = React__namespace.useRef(null);
56
- const playPauseRef = React__namespace.useRef(null);
57
- const stopRef = React__namespace.useRef(null);
58
- const fullScreenRef = React__namespace.useRef(null);
33
+ const [playing, setPlaying] = React.useState(false);
34
+ const [loadeddata, setLoadeddata] = React.useState(false);
35
+ const [progress, setProgress] = React.useState(0);
36
+ const player = React.useRef(null);
37
+ const progressRef = React.useRef(null);
38
+ const wrapperRef = React.useRef(null);
39
+ const playPauseRef = React.useRef(null);
40
+ const stopRef = React.useRef(null);
41
+ const fullScreenRef = React.useRef(null);
59
42
  const paths = arrayFy(src);
60
43
  const [pathname] = paths;
61
44
  const normalizedName = name || pathname.replace(/^.*[\\/]/, "");
62
45
  const title = `${normalizedName}${!loadeddata ? " (Opening)" : ""}`;
63
- React__namespace.useImperativeHandle(ref, () => ({
46
+ React.useImperativeHandle(ref, () => ({
64
47
  get video() {
65
48
  return player;
66
49
  },
@@ -80,7 +63,7 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
80
63
  return fullScreenRef;
81
64
  }
82
65
  }));
83
- React__namespace.useEffect(() => {
66
+ React.useEffect(() => {
84
67
  var _a, _b, _c, _d;
85
68
  (_a = player.current) == null ? void 0 : _a.addEventListener(
86
69
  "ended",
@@ -114,7 +97,7 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
114
97
  false
115
98
  );
116
99
  }, [player.current]);
117
- return /* @__PURE__ */ React__namespace.createElement(
100
+ return /* @__PURE__ */ React.createElement(
118
101
  Frame.Frame,
119
102
  {
120
103
  ...props,
@@ -123,18 +106,18 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
123
106
  backgroundColor: "$material",
124
107
  ref: wrapperRef
125
108
  },
126
- /* @__PURE__ */ React__namespace.createElement(TitleBar.TitleBar, { icon: /* @__PURE__ */ React__namespace.createElement(icons.Mplayer113, { variant: "16x16_4" }), title }),
127
- /* @__PURE__ */ React__namespace.createElement(
109
+ /* @__PURE__ */ React.createElement(TitleBar.TitleBar, { icon: /* @__PURE__ */ React.createElement(icons.Mplayer113, { variant: "16x16_4" }), title }),
110
+ /* @__PURE__ */ React.createElement(
128
111
  "video",
129
112
  {
130
113
  className: Video_css.videoTag({ visible: loadeddata }),
131
114
  ...videoProps,
132
115
  ref: player
133
116
  },
134
- paths.map((s) => /* @__PURE__ */ React__namespace.createElement(Source, { key: s, src: s }))
117
+ paths.map((s) => /* @__PURE__ */ React.createElement(Source, { key: s, src: s }))
135
118
  ),
136
- loadeddata && /* @__PURE__ */ React__namespace.createElement("span", { className: Video_css.divider }),
137
- /* @__PURE__ */ React__namespace.createElement(Frame.Frame, { maxWidth: "250px", mx: "auto", mb: "$4" }, /* @__PURE__ */ React__namespace.createElement("div", { className: Video_css.countDownContainer }, /* @__PURE__ */ React__namespace.createElement(Frame.Frame, { display: "flex", flexDirection: "column", w: "40%" }, /* @__PURE__ */ React__namespace.createElement(
119
+ loadeddata && /* @__PURE__ */ React.createElement("span", { className: Video_css.divider }),
120
+ /* @__PURE__ */ React.createElement(Frame.Frame, { maxWidth: "250px", mx: "auto", mb: "$4" }, /* @__PURE__ */ React.createElement("div", { className: Video_css.countDownContainer }, /* @__PURE__ */ React.createElement(Frame.Frame, { display: "flex", flexDirection: "column", w: "40%" }, /* @__PURE__ */ React.createElement(
138
121
  "div",
139
122
  {
140
123
  className: Video_css.videoFont,
@@ -143,9 +126,10 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
143
126
  }
144
127
  },
145
128
  player.current && parseCurrentTime(player.current.duration)
146
- ), /* @__PURE__ */ React__namespace.createElement("div", { className: Video_css.videoFont, style: { height: 12 } }, !loadeddata && "Openning")), /* @__PURE__ */ React__namespace.createElement(Frame.Frame, { display: "flex", flexDirection: "column", w: "40%" }, /* @__PURE__ */ React__namespace.createElement("div", { className: cn(Video_css.videoFont, Video_css.currentTime) }, player.current && parseCurrentTime(player.current.currentTime)), /* @__PURE__ */ React__namespace.createElement("div", { className: cn(Video_css.videoFont, Video_css.elapsedTime) }, "time"))), /* @__PURE__ */ React__namespace.createElement("div", { className: Video_css.controls }, /* @__PURE__ */ React__namespace.createElement(
129
+ ), /* @__PURE__ */ React.createElement("div", { className: Video_css.videoFont, style: { height: 12 } }, !loadeddata && "Openning")), /* @__PURE__ */ React.createElement(Frame.Frame, { display: "flex", flexDirection: "column", w: "40%" }, /* @__PURE__ */ React.createElement("div", { className: cn(Video_css.videoFont, Video_css.currentTime) }, player.current && parseCurrentTime(player.current.currentTime)), /* @__PURE__ */ React.createElement("div", { className: cn(Video_css.videoFont, Video_css.elapsedTime) }, "time"))), /* @__PURE__ */ React.createElement("div", { className: Video_css.controls }, /* @__PURE__ */ React.createElement(
147
130
  Button.Button,
148
131
  {
132
+ as: "button",
149
133
  className: Video_css.controlBtn,
150
134
  disabled: !loadeddata,
151
135
  onClick: () => {
@@ -159,14 +143,14 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
159
143
  },
160
144
  ref: playPauseRef
161
145
  },
162
- loadeddata ? /* @__PURE__ */ React__namespace.createElement(PlayOrPause, { playing }) : /* @__PURE__ */ React__namespace.createElement(
146
+ loadeddata ? /* @__PURE__ */ React.createElement(PlayOrPause, { playing }) : /* @__PURE__ */ React.createElement(
163
147
  icons.User4,
164
148
  {
165
149
  style: { borderRight: "none", borderBottom: "none" },
166
150
  variant: "32x32_4"
167
151
  }
168
152
  )
169
- ), /* @__PURE__ */ React__namespace.createElement(
153
+ ), /* @__PURE__ */ React.createElement(
170
154
  Button.Button,
171
155
  {
172
156
  className: Video_css.controlBtn,
@@ -180,8 +164,8 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
180
164
  },
181
165
  ref: stopRef
182
166
  },
183
- /* @__PURE__ */ React__namespace.createElement(Stop, null)
184
- ), /* @__PURE__ */ React__namespace.createElement(
167
+ /* @__PURE__ */ React.createElement(Stop, null)
168
+ ), /* @__PURE__ */ React.createElement(
185
169
  Button.Button,
186
170
  {
187
171
  className: Video_css.controlBtn,
@@ -192,8 +176,8 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
192
176
  },
193
177
  ref: fullScreenRef
194
178
  },
195
- /* @__PURE__ */ React__namespace.createElement(Fullscreen, null)
196
- ), /* @__PURE__ */ React__namespace.createElement(
179
+ /* @__PURE__ */ React.createElement(Fullscreen, null)
180
+ ), /* @__PURE__ */ React.createElement(
197
181
  Range.Range,
198
182
  {
199
183
  className: Video_css.range,
@@ -219,5 +203,5 @@ const VideoRenderer = ({ name, src, videoProps, ...props }, ref) => {
219
203
  )))
220
204
  );
221
205
  };
222
- const Video = React__namespace.forwardRef(VideoRenderer);
206
+ const Video = React.forwardRef(VideoRenderer);
223
207
  exports.Video = Video;
@@ -1,23 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- function _interopNamespaceDefault(e) {
4
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
5
- if (e) {
6
- for (const k in e) {
7
- if (k !== "default") {
8
- const d = Object.getOwnPropertyDescriptor(e, k);
9
- Object.defineProperty(n, k, d.get ? d : {
10
- enumerable: true,
11
- get: () => e[k]
12
- });
13
- }
14
- }
15
- }
16
- n.default = e;
17
- return Object.freeze(n);
18
- }
19
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
20
- const Fullscreen = (props) => /* @__PURE__ */ React__namespace.createElement(
3
+ const Fullscreen = (props) => /* @__PURE__ */ React.createElement(
21
4
  "svg",
22
5
  {
23
6
  xmlns: "http://www.w3.org/2000/svg",
@@ -27,7 +10,7 @@ const Fullscreen = (props) => /* @__PURE__ */ React__namespace.createElement(
27
10
  "aria-label": "fullscreen",
28
11
  ...props
29
12
  },
30
- /* @__PURE__ */ React__namespace.createElement(
13
+ /* @__PURE__ */ React.createElement(
31
14
  "path",
32
15
  {
33
16
  d: "M24 9h-2v-5h-7v-2h9v7zm-9 13v-2h7v-5h2v7h-9zm-15-7h2v5h7v2h-9v-7zm9-13v2h-7v5h-2v-7h9zm11 4h-16v12h16v-12z",
@@ -1,23 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- function _interopNamespaceDefault(e) {
4
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
5
- if (e) {
6
- for (const k in e) {
7
- if (k !== "default") {
8
- const d = Object.getOwnPropertyDescriptor(e, k);
9
- Object.defineProperty(n, k, d.get ? d : {
10
- enumerable: true,
11
- get: () => e[k]
12
- });
13
- }
14
- }
15
- }
16
- n.default = e;
17
- return Object.freeze(n);
18
- }
19
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
20
- const Pause = (props) => /* @__PURE__ */ React__namespace.createElement(
3
+ const Pause = (props) => /* @__PURE__ */ React.createElement(
21
4
  "svg",
22
5
  {
23
6
  height: "6",
@@ -27,7 +10,7 @@ const Pause = (props) => /* @__PURE__ */ React__namespace.createElement(
27
10
  "aria-label": "pause",
28
11
  ...props
29
12
  },
30
- /* @__PURE__ */ React__namespace.createElement("path", { d: "M256.471 2h176.765v424.236H256.471zM2 2h176.765v424.236H2z" })
13
+ /* @__PURE__ */ React.createElement("path", { d: "M256.471 2h176.765v424.236H256.471zM2 2h176.765v424.236H2z" })
31
14
  );
32
15
  const Pause$1 = Pause;
33
16
  module.exports = Pause$1;
@@ -1,23 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- function _interopNamespaceDefault(e) {
4
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
5
- if (e) {
6
- for (const k in e) {
7
- if (k !== "default") {
8
- const d = Object.getOwnPropertyDescriptor(e, k);
9
- Object.defineProperty(n, k, d.get ? d : {
10
- enumerable: true,
11
- get: () => e[k]
12
- });
13
- }
14
- }
15
- }
16
- n.default = e;
17
- return Object.freeze(n);
18
- }
19
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
20
- const Play = (props) => /* @__PURE__ */ React__namespace.createElement(
3
+ const Play = (props) => /* @__PURE__ */ React.createElement(
21
4
  "svg",
22
5
  {
23
6
  height: "6",
@@ -27,7 +10,7 @@ const Play = (props) => /* @__PURE__ */ React__namespace.createElement(
27
10
  "aria-label": "play",
28
11
  ...props
29
12
  },
30
- /* @__PURE__ */ React__namespace.createElement("path", { d: "M35.353 0l424.236 247.471L35.353 494.942z" })
13
+ /* @__PURE__ */ React.createElement("path", { d: "M35.353 0l424.236 247.471L35.353 494.942z" })
31
14
  );
32
15
  const Play$1 = Play;
33
16
  module.exports = Play$1;
@@ -1,23 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- function _interopNamespaceDefault(e) {
4
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
5
- if (e) {
6
- for (const k in e) {
7
- if (k !== "default") {
8
- const d = Object.getOwnPropertyDescriptor(e, k);
9
- Object.defineProperty(n, k, d.get ? d : {
10
- enumerable: true,
11
- get: () => e[k]
12
- });
13
- }
14
- }
15
- }
16
- n.default = e;
17
- return Object.freeze(n);
18
- }
19
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
20
- const Stop = (props) => /* @__PURE__ */ React__namespace.createElement(
3
+ const Stop = (props) => /* @__PURE__ */ React.createElement(
21
4
  "svg",
22
5
  {
23
6
  xmlns: "http://www.w3.org/2000/svg",
@@ -26,7 +9,7 @@ const Stop = (props) => /* @__PURE__ */ React__namespace.createElement(
26
9
  "aria-label": "stop",
27
10
  ...props
28
11
  },
29
- /* @__PURE__ */ React__namespace.createElement("path", { d: "M0 0h306v306H0z" })
12
+ /* @__PURE__ */ React.createElement("path", { d: "M0 0h306v306H0z" })
30
13
  );
31
14
  const Stop$1 = Stop;
32
15
  module.exports = Stop$1;
@@ -1,4 +1,4 @@
1
- import React__default, { forwardRef, useEffect } from "react";
1
+ import React, { forwardRef, useEffect } from "react";
2
2
  import { User4, User2, User3, User5 } from "@react95/icons";
3
3
  import { dialog, icon, message } from "./Alert.css.mjs";
4
4
  import { Modal } from "../Modal/Modal.mjs";
@@ -6,14 +6,14 @@ import sound from "./assets/chord.mp3.mjs";
6
6
  const RenderImage = ({ option }) => {
7
7
  switch (option) {
8
8
  case "info":
9
- return /* @__PURE__ */ React__default.createElement(User5, { width: 32, height: 32, variant: "32x32_4" });
9
+ return /* @__PURE__ */ React.createElement(User5, { width: 32, height: 32, variant: "32x32_4" });
10
10
  case "question":
11
- return /* @__PURE__ */ React__default.createElement(User3, { width: 32, height: 32, variant: "32x32_4" });
11
+ return /* @__PURE__ */ React.createElement(User3, { width: 32, height: 32, variant: "32x32_4" });
12
12
  case "warning":
13
- return /* @__PURE__ */ React__default.createElement(User2, { width: 32, height: 32, variant: "32x32_4" });
13
+ return /* @__PURE__ */ React.createElement(User2, { width: 32, height: 32, variant: "32x32_4" });
14
14
  case "error":
15
15
  default:
16
- return /* @__PURE__ */ React__default.createElement(User4, { width: 32, height: 32, variant: "32x32_4" });
16
+ return /* @__PURE__ */ React.createElement(User4, { width: 32, height: 32, variant: "32x32_4" });
17
17
  }
18
18
  };
19
19
  const Alert = forwardRef(
@@ -24,7 +24,7 @@ const Alert = forwardRef(
24
24
  audio.play();
25
25
  }, []);
26
26
  }
27
- return /* @__PURE__ */ React__default.createElement(Modal, { height: "120", hasWindowButton: false, ...rest, ref }, /* @__PURE__ */ React__default.createElement("div", { className: dialog }, /* @__PURE__ */ React__default.createElement("div", { className: icon }, /* @__PURE__ */ React__default.createElement(RenderImage, { option: type })), /* @__PURE__ */ React__default.createElement("div", { className: message }, message$1)));
27
+ return /* @__PURE__ */ React.createElement(Modal, { height: "120", hasWindowButton: false, ...rest, ref }, /* @__PURE__ */ React.createElement("div", { className: dialog }, /* @__PURE__ */ React.createElement("div", { className: icon }, /* @__PURE__ */ React.createElement(RenderImage, { option: type })), /* @__PURE__ */ React.createElement("div", { className: message }, message$1)));
28
28
  }
29
29
  );
30
30
  Alert.defaultProps = {
@@ -1,7 +1,7 @@
1
- import * as React from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { avatar, imgStyle } from "./Avatar.css.mjs";
3
3
  import { Frame } from "../Frame/Frame.mjs";
4
- const Avatar = React.forwardRef(
4
+ const Avatar = forwardRef(
5
5
  ({ src, srcSet, alt, circle, children, size = "48px", ...otherProps }, ref) => /* @__PURE__ */ React.createElement(Frame, { className: avatar({ circle }), ref, ...otherProps, size }, src || srcSet ? /* @__PURE__ */ React.createElement("img", { className: imgStyle, src, srcSet, alt }) : children)
6
6
  );
7
7
  export {
@@ -1,10 +1,10 @@
1
- import React__default, { forwardRef } from "react";
1
+ import React from "react";
2
2
  import cn from "classnames";
3
3
  import { button } from "./Button.css.mjs";
4
- import { Frame } from "../Frame/Frame.mjs";
5
- const Button = forwardRef(
4
+ import { fixedForwardRef, Frame } from "../Frame/Frame.mjs";
5
+ const Button = fixedForwardRef(
6
6
  (props, ref) => {
7
- return /* @__PURE__ */ React__default.createElement(
7
+ return /* @__PURE__ */ React.createElement(
8
8
  Frame,
9
9
  {
10
10
  as: "button",
@@ -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 "./Checkbox.css.mjs";
3
3
  const Checkbox = forwardRef(
4
- ({ children, style, label: label$1, disabled = false, ...rest }, ref) => /* @__PURE__ */ React__default.createElement("label", { style, className: label }, /* @__PURE__ */ React__default.createElement(
4
+ ({ children, style, label: label$1, disabled = false, ...rest }, ref) => /* @__PURE__ */ React.createElement("label", { style, className: label }, /* @__PURE__ */ React.createElement(
5
5
  "input",
6
6
  {
7
7
  className: field,
@@ -10,7 +10,7 @@ const Checkbox = forwardRef(
10
10
  ...rest,
11
11
  ref
12
12
  }
13
- ), /* @__PURE__ */ React__default.createElement("span", { className: icon }), /* @__PURE__ */ React__default.createElement("span", { className: text }, children || label$1))
13
+ ), /* @__PURE__ */ React.createElement("span", { className: icon }), /* @__PURE__ */ React.createElement("span", { className: text }, children || label$1))
14
14
  );
15
15
  export {
16
16
  Checkbox
@@ -1,4 +1,4 @@
1
- import React__default, { forwardRef } from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import cn from "classnames";
3
3
  import { wrapper, select } from "./Dropdown.css.mjs";
4
4
  import { Frame } from "../Frame/Frame.mjs";
@@ -12,7 +12,7 @@ const defaultOptions = [
12
12
  const Dropdown = forwardRef(
13
13
  ({ options = defaultOptions, ...rest }, ref) => {
14
14
  const { style, otherProps, className } = sprinkles(rest);
15
- return /* @__PURE__ */ React__default.createElement(Frame, { style, className: cn(wrapper, className) }, /* @__PURE__ */ React__default.createElement("select", { ...otherProps, className: cn(select), ref }, options && options.map((option) => /* @__PURE__ */ React__default.createElement("option", { key: option, value: option }, option))));
15
+ return /* @__PURE__ */ React.createElement(Frame, { style, className: cn(wrapper, className) }, /* @__PURE__ */ React.createElement("select", { ...otherProps, className: cn(select), ref }, options && options.map((option) => /* @__PURE__ */ React.createElement("option", { key: option, value: option }, option))));
16
16
  }
17
17
  );
18
18
  export {
@@ -1,8 +1,8 @@
1
- import React__default, { forwardRef } from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { field, legend } from "./Fieldset.css.mjs";
3
3
  import { Frame } from "../Frame/Frame.mjs";
4
4
  const Fieldset = forwardRef(
5
- ({ legend: legend$1, children, ...rest }, ref) => /* @__PURE__ */ React__default.createElement(Frame, { as: "fieldset", ...rest, ref, className: field }, legend$1 && /* @__PURE__ */ React__default.createElement("legend", { className: legend }, legend$1), children)
5
+ ({ legend: legend$1, children, ...rest }, ref) => /* @__PURE__ */ React.createElement(Frame, { ...rest, as: "fieldset", ref, className: field }, legend$1 && /* @__PURE__ */ React.createElement("legend", { className: legend }, legend$1), children)
6
6
  );
7
7
  export {
8
8
  Fieldset
@@ -1,4 +1,4 @@
1
- import React__default, { forwardRef } from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { sprinkles } from "./Frame.css.mjs";
3
3
  import cn from "classnames";
4
4
  const fixedForwardRef = forwardRef;
@@ -6,7 +6,7 @@ const FrameComponent = (props, ref) => {
6
6
  const { as, children, ...rest } = props;
7
7
  const Component = as || "div";
8
8
  const { className, style, otherProps } = sprinkles(rest);
9
- return /* @__PURE__ */ React__default.createElement(
9
+ return /* @__PURE__ */ React.createElement(
10
10
  Component,
11
11
  {
12
12
  ...otherProps,
@@ -19,5 +19,6 @@ const FrameComponent = (props, ref) => {
19
19
  };
20
20
  const Frame = fixedForwardRef(FrameComponent);
21
21
  export {
22
- Frame
22
+ Frame,
23
+ fixedForwardRef
23
24
  };
@@ -1,9 +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.css.mjs";
4
- const Input = React.forwardRef(
5
- (rest, ref) => /* @__PURE__ */ React.createElement(Frame, { ...rest, ref, className: input, as: "input" })
6
- );
4
+ const Input = forwardRef((rest, ref) => /* @__PURE__ */ React.createElement(Frame, { ...rest, ref, className: input, as: "input" }));
7
5
  export {
8
6
  Input
9
7
  };
package/esm/List/List.mjs CHANGED
@@ -1,12 +1,10 @@
1
+ import React, { forwardRef } from "react";
2
+ import cn from "classnames";
1
3
  import { ListItem } from "./ListItem.mjs";
2
4
  import { Divider } from "./ListDivider.mjs";
3
5
  import { Frame } from "../Frame/Frame.mjs";
4
- import React__default from "react";
5
6
  import { list } from "./List.css.mjs";
6
- import cn from "classnames";
7
- const ListRenderer = React__default.forwardRef(
8
- (rest, ref) => /* @__PURE__ */ React__default.createElement(Frame, { ...rest, ref, className: cn(list, rest.className), as: "ul" })
9
- );
7
+ const ListRenderer = forwardRef((rest, ref) => /* @__PURE__ */ React.createElement(Frame, { ...rest, ref, className: cn(list, rest.className), as: "ul" }));
10
8
  const List = Object.assign(ListRenderer, {
11
9
  Item: ListItem,
12
10
  Divider
@@ -1,18 +1,8 @@
1
- import React__default from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { Frame } from "../Frame/Frame.mjs";
3
3
  import { divider } from "./List.css.mjs";
4
4
  import cn from "classnames";
5
- const Divider = React__default.forwardRef(
6
- (rest, ref) => /* @__PURE__ */ React__default.createElement(
7
- Frame,
8
- {
9
- ...rest,
10
- ref,
11
- className: cn(divider, rest.className),
12
- as: "li"
13
- }
14
- )
15
- );
5
+ const Divider = forwardRef((rest, ref) => /* @__PURE__ */ React.createElement(Frame, { ...rest, ref, className: cn(divider, rest.className), as: "li" }));
16
6
  Divider.displayName = "List.Divider";
17
7
  export {
18
8
  Divider
@@ -1,10 +1,10 @@
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 { listItem } from "./List.css.mjs";
5
- const Item = React__default.forwardRef((rest, ref) => /* @__PURE__ */ React__default.createElement(Frame, { ...rest, ref, className: cn(listItem, rest.className), as: "li" }));
5
+ const Item = forwardRef((rest, ref) => /* @__PURE__ */ React.createElement(Frame, { ...rest, ref, className: cn(listItem, rest.className), as: "li" }));
6
6
  const ListItem = forwardRef(
7
- ({ icon, children = [], ...rest }, ref) => /* @__PURE__ */ React__default.createElement(Item, { ...rest, ref }, icon, children)
7
+ ({ icon, children = [], ...rest }, ref) => /* @__PURE__ */ React.createElement(Item, { ...rest, ref }, icon, children)
8
8
  );
9
9
  ListItem.displayName = "List.Item";
10
10
  export {
@@ -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
  };