@bouko/electron 1.0.4 → 1.0.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.
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="1em" height="1em">
2
+ <path
3
+ d="M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z"
4
+ fill="currentColor"
5
+ />
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" width="1em" height="1em">
2
+ <path
3
+ d="M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"
4
+ fill="currentColor"
5
+ />
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ .draggable {
2
+ app-region: drag;
3
+ }
@@ -0,0 +1 @@
1
+ export { default as TitleBar } from "./title-bar";
@@ -0,0 +1 @@
1
+ export { default as TitleBar } from "./title-bar";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Title Bar Actions Component.
3
+ *
4
+ * Displays two buttons in the top right:
5
+ * > Minimize - Minimizes the app.
6
+ * > Close - Closes the app.
7
+ **/
8
+ declare const TitleBarActions: () => import("react/jsx-runtime").JSX.Element;
9
+ export default TitleBarActions;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { RowBox, IconButton } from "@bouko/react";
3
+ import Minimize from "../../assets/icons/dash.svg";
4
+ import Close from "../../assets/icons/x.svg";
5
+ /**
6
+ * Title Bar Actions Component.
7
+ *
8
+ * Displays two buttons in the top right:
9
+ * > Minimize - Minimizes the app.
10
+ * > Close - Closes the app.
11
+ **/
12
+ const TitleBarActions = () => (_jsxs(RowBox, { style: styles.container, children: [_jsx(IconButton, { variant: "ghost", style: styles.minimize, icon: _jsx(Minimize, {}), action: () => window.api.app.minimize() }), _jsx(IconButton, { variant: "ghost", style: styles.close, icon: _jsx(Close, {}), action: () => window.api.app.close() })] }));
13
+ const styles = {
14
+ container: "gap-2 items-center px-4",
15
+ minimize: "hover:!text-primary-darker",
16
+ close: "hover:!text-error"
17
+ };
18
+ export default TitleBarActions;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Title Bar Branding Component.
3
+ *
4
+ * Displays company banner in the top left of title bar.
5
+ **/
6
+ export default function TitleBarBranding({ banner }: {
7
+ banner: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Title Bar Branding Component.
4
+ *
5
+ * Displays company banner in the top left of title bar.
6
+ **/
7
+ export default function TitleBarBranding({ banner }) {
8
+ return (_jsx("img", { className: "w-auto h-6", src: banner, alt: "Logo" }));
9
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Title Bar component.
3
+ *
4
+ * Application-level title bar used in the root layout.
5
+ * Renders a horizontal bar with logo and window controls.
6
+ * Uses `draggable` class to replace frame of Electron
7
+ * window and make the app move on the user's screen.
8
+ **/
9
+ export default function TitleBar({ banner }: {
10
+ banner: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { RowBox } from "@bouko/react";
3
+ import Branding from "./branding";
4
+ import Actions from "./actions";
5
+ /**
6
+ * Title Bar component.
7
+ *
8
+ * Application-level title bar used in the root layout.
9
+ * Renders a horizontal bar with logo and window controls.
10
+ * Uses `draggable` class to replace frame of Electron
11
+ * window and make the app move on the user's screen.
12
+ **/
13
+ export default function TitleBar({ banner }) {
14
+ return (_jsxs(RowBox, { style: s.container, children: [_jsx("div", { className: s.subcontainer, children: _jsx(Branding, { banner: banner }) }), _jsx(Actions, {})] }));
15
+ }
16
+ const s = {
17
+ container: "bg-background-light border-b border-border-dark",
18
+ subcontainer: "grow p-4 draggable"
19
+ };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./ipc";
2
2
  export * from "./files";
3
3
  export * from "./csp";
4
+ export * from "./components";
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./ipc";
2
2
  export * from "./files";
3
3
  export * from "./csp";
4
+ export * from "./components";
@@ -0,0 +1,3 @@
1
+ .draggable {
2
+ app-region: drag;
3
+ }
package/package.json CHANGED
@@ -1,34 +1,72 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/electron",
4
- "version": "1.0.4",
4
+
5
+ "version": "1.0.5",
6
+
5
7
  "description": "",
8
+
6
9
  "keywords": [],
10
+
7
11
  "author": "",
12
+
8
13
  "license": "ISC",
14
+
9
15
  "main": "./dist/index.js",
16
+
10
17
  "types": "./dist/index.d.ts",
18
+
11
19
  "files": [
20
+
12
21
  "dist"
22
+
13
23
  ],
24
+
14
25
  "publishConfig": {
26
+
15
27
  "access": "public"
28
+
29
+ },
30
+
31
+ "exports": {
32
+
33
+ ".": "./dist/index.js",
34
+
35
+ "./styles.css": "./dist/styles.css"
36
+
16
37
  },
38
+
17
39
  "engines": {},
18
40
 
19
41
  "scripts": {
20
- "build": "tsc"
42
+
43
+ "build": "tsc",
44
+
45
+ "postbuild": "node ./scripts/copy-styles.mjs"
46
+
21
47
  },
22
48
 
23
49
  "dependencies": {
50
+
51
+ "@bouko/react": "^3.1.3",
52
+
24
53
  "@bouko/ts": "^0.3.8",
54
+
25
55
  "path": "^0.12.7"
56
+
26
57
  },
27
58
 
28
59
  "devDependencies": {
60
+
61
+ "@types/react": "^19.2.13",
62
+
29
63
  "electron": "^39.2.7",
64
+
30
65
  "react-router-dom": "^7.12.0",
66
+
31
67
  "typescript": "^5.9.3"
68
+
32
69
  }
33
70
 
34
- }
71
+ }
72
+