Convert all remaining files to typescript.

This commit is contained in:
Jas Singh
2024-07-26 23:11:33 -07:00
parent ca5dcc629b
commit b511d76e11
84 changed files with 2075 additions and 1987 deletions

View File

@@ -0,0 +1,38 @@
import { Action } from "lib/types/power.js";
import PopupWindow from "../PopupWindow.js";
import powermenu from "./helpers/actions.js";
import icons from "../../icons/index.js";
const SysButton = (action: Action, label: string) =>
Widget.Button({
class_name: `widget-button powermenu-button-${action}`,
on_clicked: () => powermenu.action(action),
child: Widget.Box({
vertical: true,
class_name: "system-button widget-box",
children: [
Widget.Icon({
class_name: `system-button_icon ${action}`,
icon: icons.powermenu[action],
}),
Widget.Label({
class_name: `system-button_label ${action}`,
label,
}),
],
}),
});
export default () =>
PopupWindow({
name: "powermenu",
transition: "crossfade",
child: Widget.Box({
class_name: "powermenu horizontal",
children: [
SysButton("shutdown", "SHUTDOWN"),
SysButton("logout", "LOG OUT"),
SysButton("reboot", "REBOOT"),
SysButton("sleep", "SLEEP"),
],
}),
});