@react95/core 9.6.3 → 9.6.5

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.
@@ -20,12 +20,11 @@ const RenderImage = ({ option }) => {
20
20
  };
21
21
  const Alert = React.forwardRef(
22
22
  ({ type = "error", message, hasSound = false, dragOptions, ...rest }, ref) => {
23
- if (hasSound) {
24
- React.useEffect(() => {
25
- const audio = new Audio(chord);
26
- audio.play();
27
- }, []);
28
- }
23
+ React.useEffect(() => {
24
+ if (!hasSound) return;
25
+ const audio = new Audio(chord);
26
+ audio.play();
27
+ }, [hasSound]);
29
28
  return /* @__PURE__ */ React.createElement(
30
29
  Modal.Modal,
31
30
  {
@@ -11,6 +11,8 @@ const cn = require("classnames");
11
11
  const usehooksTs = require("usehooks-ts");
12
12
  const useModal = require("../shared/use-modal.cjs");
13
13
  const modalTypes = require("../shared/modal-types.cjs");
14
+ const EMPTY_BUTTONS = [];
15
+ const EMPTY_MENU = [];
14
16
  const ModalContent = Frame.fixedForwardRef(
15
17
  (rest, ref) => /* @__PURE__ */ React.createElement(Frame.Frame, { ...rest, ref, className: cn(Modal_css.content, rest.className) })
16
18
  );
@@ -38,11 +40,11 @@ const ModalMinimize = Frame.fixedForwardRef(
38
40
  const ModalRenderer = ({
39
41
  id: providedId,
40
42
  hasWindowButton: hasButton = true,
41
- buttons = [],
43
+ buttons = EMPTY_BUTTONS,
42
44
  buttonsAlignment = "flex-end",
43
45
  children,
44
46
  icon,
45
- menu = [],
47
+ menu = EMPTY_MENU,
46
48
  title,
47
49
  dragOptions,
48
50
  titleBarOptions,
package/cjs/Tree/Node.cjs CHANGED
@@ -33,8 +33,9 @@ const NodeIcon = ({
33
33
  }
34
34
  return /* @__PURE__ */ React.createElement(icons$1.Folder, { variant: "16x16_4", "data-testid": "react95-default-icon-folder" });
35
35
  };
36
+ const EMPTY_CHILDREN = [];
36
37
  const Node = ({
37
- children = [],
38
+ children = EMPTY_CHILDREN,
38
39
  id,
39
40
  icon,
40
41
  label,
@@ -1,4 +1,3 @@
1
1
  require('./azureOrange.css.ts.vanilla.css');
2
2
  "use strict";
3
- require("./contract.css.ts.vanilla.css.cjs");
4
3
  /* empty css */
@@ -1,3 +1,4 @@
1
1
  require('./blackAndWhite.css.ts.vanilla.css');
2
2
  "use strict";
3
+ require("./contract.css.ts.vanilla.css.cjs");
3
4
  /* empty css */
@@ -18,12 +18,11 @@ const RenderImage = ({ option }) => {
18
18
  };
19
19
  const Alert = forwardRef(
20
20
  ({ type = "error", message: message$1, hasSound = false, dragOptions, ...rest }, ref) => {
21
- if (hasSound) {
22
- useEffect(() => {
23
- const audio = new Audio(sound);
24
- audio.play();
25
- }, []);
26
- }
21
+ useEffect(() => {
22
+ if (!hasSound) return;
23
+ const audio = new Audio(sound);
24
+ audio.play();
25
+ }, [hasSound]);
27
26
  return /* @__PURE__ */ React.createElement(
28
27
  Modal,
29
28
  {
@@ -9,6 +9,8 @@ import cn from "classnames";
9
9
  import { useOnClickOutside } from "usehooks-ts";
10
10
  import { useModal } from "../shared/use-modal.mjs";
11
11
  import { ModalEvents } from "../shared/modal-types.mjs";
12
+ const EMPTY_BUTTONS = [];
13
+ const EMPTY_MENU = [];
12
14
  const ModalContent = fixedForwardRef(
13
15
  (rest, ref) => /* @__PURE__ */ React.createElement(Frame, { ...rest, ref, className: cn(content, rest.className) })
14
16
  );
@@ -36,11 +38,11 @@ const ModalMinimize = fixedForwardRef(
36
38
  const ModalRenderer = ({
37
39
  id: providedId,
38
40
  hasWindowButton: hasButton = true,
39
- buttons = [],
41
+ buttons = EMPTY_BUTTONS,
40
42
  buttonsAlignment = "flex-end",
41
43
  children,
42
44
  icon,
43
- menu = [],
45
+ menu = EMPTY_MENU,
44
46
  title,
45
47
  dragOptions,
46
48
  titleBarOptions,
package/esm/Tree/Node.mjs CHANGED
@@ -31,8 +31,9 @@ const NodeIcon = ({
31
31
  }
32
32
  return /* @__PURE__ */ React.createElement(Folder, { variant: "16x16_4", "data-testid": "react95-default-icon-folder" });
33
33
  };
34
+ const EMPTY_CHILDREN = [];
34
35
  const Node = ({
35
- children = [],
36
+ children = EMPTY_CHILDREN,
36
37
  id,
37
38
  icon,
38
39
  label: label$1,
@@ -1,3 +1,2 @@
1
1
  import './azureOrange.css.ts.vanilla.css';
2
- import "./contract.css.ts.vanilla.css.mjs";
3
2
  /* empty css */
@@ -1,2 +1,3 @@
1
1
  import './blackAndWhite.css.ts.vanilla.css';
2
+ import "./contract.css.ts.vanilla.css.mjs";
2
3
  /* empty css */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react95/core",
3
- "version": "9.6.3",
3
+ "version": "9.6.5",
4
4
  "description": "Windows 95 styleguide",
5
5
  "main": "cjs/index.cjs",
6
6
  "type": "module",
@@ -165,7 +165,7 @@
165
165
  "license": "MIT",
166
166
  "dependencies": {
167
167
  "@neodrag/react": "^2.0.4",
168
- "@react95/icons": "^2.2.0",
168
+ "@react95/icons": "^2.3.0",
169
169
  "@vanilla-extract/dynamic": "^2.1.0",
170
170
  "@vanilla-extract/recipes": "^0.5.1",
171
171
  "classnames": "^2.5.1",
@@ -196,7 +196,7 @@
196
196
  "url": "https://github.com/React95/React95/issues"
197
197
  },
198
198
  "homepage": "https://github.com/React95/React95#readme",
199
- "gitHead": "36ac448be03019c664597540ac75250a50a99ed2",
199
+ "gitHead": "52f59c27485bc28470ea18001ed426c0024ce7b3",
200
200
  "module": "esm/index.mjs",
201
201
  "private": false,
202
202
  "types": "types/index.d.ts"
@@ -1 +1 @@
1
- export declare const Cursor: Record<"Help" | "Auto" | "Text" | "VerticalText" | "Crosshair" | "Pointer" | "Progress" | "Wait" | "Alias" | "Copy" | "Move" | "None" | "NoDrop" | "NotAllowed" | "Grab" | "Grabbing" | "ColResize" | "RowResize" | "NResize" | "EResize" | "SResize" | "WResize" | "NsResize" | "EwResize" | "NeResize" | "NwResize" | "SeResize" | "SwResize" | "NeswResize" | "NwseResize" | "ZoomIn" | "ZoomOut", string>;
1
+ export declare const Cursor: Record<"Help" | "Copy" | "Auto" | "Text" | "VerticalText" | "Crosshair" | "Pointer" | "Progress" | "Wait" | "Alias" | "Move" | "None" | "NoDrop" | "NotAllowed" | "Grab" | "Grabbing" | "ColResize" | "RowResize" | "NResize" | "EResize" | "SResize" | "WResize" | "NsResize" | "EwResize" | "NeResize" | "NwResize" | "SeResize" | "SwResize" | "NeswResize" | "NwseResize" | "ZoomIn" | "ZoomOut", string>;
@@ -2,14 +2,14 @@ import React from 'react';
2
2
  import type { FC, ReactElement, MouseEvent, KeyboardEvent, LiHTMLAttributes } from 'react';
3
3
  import { FrameProps } from '../Frame/Frame';
4
4
  export declare const icons: {
5
- readonly FILE_MEDIA: React.FC<import("@react95/icons").MediaCdProps>;
6
- readonly FILE_TEXT: React.FC<import("@react95/icons").FileTextProps>;
7
- readonly FILE_UNKNOWN: React.FC<import("@react95/icons").BatProps>;
8
- readonly FILE_FONT: React.FC<import("@react95/icons").FileFont2Props>;
9
- readonly FILE_PEN: React.FC<import("@react95/icons").FilePenProps>;
10
- readonly FILE_SETTINGS: React.FC<import("@react95/icons").FileSettingsProps>;
11
- readonly FILE_TEXT_SETTINGS: React.FC<import("@react95/icons").FileTextSettingsProps>;
12
- readonly FILE_EXECUTABLE: React.FC<import("@react95/icons").BatExecProps>;
5
+ readonly FILE_MEDIA: React.MemoExoticComponent<({ variant, ...rest }: import("@react95/icons").MediaCdProps) => React.JSX.Element>;
6
+ readonly FILE_TEXT: React.MemoExoticComponent<({ variant, ...rest }: import("@react95/icons").FileTextProps) => React.JSX.Element>;
7
+ readonly FILE_UNKNOWN: React.MemoExoticComponent<({ variant, ...rest }: import("@react95/icons").BatProps) => React.JSX.Element>;
8
+ readonly FILE_FONT: React.MemoExoticComponent<({ variant, ...rest }: import("@react95/icons").FileFont2Props) => React.JSX.Element>;
9
+ readonly FILE_PEN: React.MemoExoticComponent<({ variant, ...rest }: import("@react95/icons").FilePenProps) => React.JSX.Element>;
10
+ readonly FILE_SETTINGS: React.MemoExoticComponent<({ variant, ...rest }: import("@react95/icons").FileSettingsProps) => React.JSX.Element>;
11
+ readonly FILE_TEXT_SETTINGS: React.MemoExoticComponent<({ variant, ...rest }: import("@react95/icons").FileTextSettingsProps) => React.JSX.Element>;
12
+ readonly FILE_EXECUTABLE: React.MemoExoticComponent<({ variant, ...rest }: import("@react95/icons").BatExecProps) => React.JSX.Element>;
13
13
  };
14
14
  export type NodeProps = {
15
15
  label: string;