@bouko/proton 1.0.0 → 1.0.1
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 640 640" width="1em" height="1em">
|
|
2
|
+
<path
|
|
3
|
+
d="M128 512L512 512C547.3 512 576 483.3 576 448L576 208C576 172.7 547.3 144 512 144L362.7 144C355.8 144 349 141.8 343.5 137.6L305.1 108.8C294 100.5 280.5 96 266.7 96L128 96C92.7 96 64 124.7 64 160L64 448C64 483.3 92.7 512 128 512z"
|
|
4
|
+
fill="currentColor"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
package/dist/components/index.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ColumnBox, RowBox } from "@bouko/react";
|
|
3
|
+
import { toast } from "@bouko/toast";
|
|
4
|
+
import Folder from "../assets/icons/folder.svg";
|
|
5
|
+
export default function PathSelector({ title, value, update, original }) {
|
|
6
|
+
const choosePath = async () => {
|
|
7
|
+
const result = await window.api.app.choosePath({
|
|
8
|
+
title: title || "Choose Folder",
|
|
9
|
+
default: original
|
|
10
|
+
});
|
|
11
|
+
if (!result)
|
|
12
|
+
return toast.error("No folder select");
|
|
13
|
+
console.log("result", result);
|
|
14
|
+
update(result);
|
|
15
|
+
};
|
|
16
|
+
const resetPath = () => update();
|
|
17
|
+
return (_jsxs(ColumnBox, { style: "items-start gap-2", children: [_jsxs(RowBox, { style: "gap-2", centerY: true, children: [_jsx(Folder, { className: "text-accent" }), _jsx("span", { className: "text-sm text-primary", children: title })] }), _jsxs("div", { className: "flex gap-1 justify-center items-center pl-3 pr-[0.35rem] py-1 bg-background-light border border-border rounded-full", children: [_jsx("span", { className: "mr-2 text-xs text-primary-darker font-mono", children: value }), _jsx("span", { className: "pr-1 pl-[0.3rem] py-[0.11rem] text-px bg-accent rounded-l-full rounded-r-md font-semibold text-background cursor-pointer duration-200 hover:bg-accent-light border border-accent-dark", onClick: () => choosePath(), children: "SET" }), _jsx("span", { className: "pl-1 pr-[0.3rem] py-[0.11rem] text-px bg-surface-light rounded-l-md rounded-r-full font-semibold text-primary-darker cursor-pointer duration-200 border border-border hover:border-light", onClick: () => resetPath(), children: "X" })] })] }));
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
|
|
3
3
|
"name": "@bouko/proton",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
7
7
|
"author": "",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@bouko/react": "^3.1.3",
|
|
30
|
+
"@bouko/toast": "^0.0.1",
|
|
30
31
|
"@bouko/ts": "^0.3.8",
|
|
31
32
|
"path": "^0.12.7"
|
|
32
33
|
},
|