mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-31 06:58:16 +02:00
Initial commit
This commit is contained in:
5
src/deck-components/Backdrop.tsx
Normal file
5
src/deck-components/Backdrop.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
import { BackdropModule } from '../modules';
|
||||
|
||||
export const openBackdrop: (children: ReactNode) => void = BackdropModule.a;
|
||||
46
src/deck-components/Controls.tsx
Normal file
46
src/deck-components/Controls.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import { FC, VFC } from 'react';
|
||||
|
||||
import { ControlsModule } from '../modules';
|
||||
|
||||
interface ButtonProps {
|
||||
label?: string;
|
||||
description?: string;
|
||||
layout?: 'below';
|
||||
onClick?(): void;
|
||||
disabled?: boolean;
|
||||
bottomSeparator?: boolean;
|
||||
}
|
||||
|
||||
export const Button: FC<ButtonProps> = ControlsModule.a;
|
||||
|
||||
interface SwitchProps {
|
||||
label?: string;
|
||||
description?: string;
|
||||
checked: boolean;
|
||||
icon?: JSX.Element;
|
||||
disabled?: boolean;
|
||||
onChange?(checked: boolean): void;
|
||||
}
|
||||
|
||||
export const Switch: VFC<SwitchProps> = ControlsModule.j;
|
||||
|
||||
interface NotchLabel {
|
||||
notchIndex: number;
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
interface SliderProps {
|
||||
label?: string;
|
||||
value: number;
|
||||
layout?: 'below';
|
||||
icon?: JSX.Element;
|
||||
min?: number;
|
||||
max?: number;
|
||||
step?: number;
|
||||
notchCount?: number;
|
||||
notchLabels?: NotchLabel[];
|
||||
onChange?(value: number): void;
|
||||
}
|
||||
|
||||
export const Slider: VFC<SliderProps> = ControlsModule.l;
|
||||
20
src/deck-components/Dialogs.tsx
Normal file
20
src/deck-components/Dialogs.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { FC, VFC } from 'react';
|
||||
|
||||
import { DialogModule } from '../modules';
|
||||
|
||||
export const Dialog: FC = DialogModule.a;
|
||||
|
||||
export const DialogTitle: FC = DialogModule.u;
|
||||
|
||||
export const DialogBody: FC = DialogModule.d;
|
||||
|
||||
export const DialogActions: FC = DialogModule.r;
|
||||
|
||||
interface DialogConfirmButtonsProps {
|
||||
focusButton: 'primary';
|
||||
strOKText: string;
|
||||
onOK?(): void;
|
||||
onCancel?(): void;
|
||||
}
|
||||
|
||||
export const DialogConfirmButtons: VFC<DialogConfirmButtonsProps> = DialogModule.A;
|
||||
17
src/deck-components/Menus.tsx
Normal file
17
src/deck-components/Menus.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { FC } from 'react';
|
||||
|
||||
import { MenuModule } from '../modules';
|
||||
|
||||
interface SimpleMenuProps {
|
||||
label: string;
|
||||
onCancel?(): void;
|
||||
cancelText?: string;
|
||||
}
|
||||
|
||||
export const SimpleMenu: FC<SimpleMenuProps> = MenuModule.c;
|
||||
|
||||
interface MenuItemProps {
|
||||
onSelected?(): void;
|
||||
}
|
||||
|
||||
export const MenuItem: FC<MenuItemProps> = MenuModule.e;
|
||||
13
src/deck-components/Panels.tsx
Normal file
13
src/deck-components/Panels.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { FC } from 'react';
|
||||
|
||||
import { PanelModule } from '../modules';
|
||||
|
||||
interface PanelSectionProps {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
export const PanelSection: FC<PanelSectionProps> = PanelModule.a;
|
||||
|
||||
interface PanelSectionRowProps {}
|
||||
|
||||
export const PanelSectionRow: FC<PanelSectionRowProps> = PanelModule.b;
|
||||
13
src/deck-components/Tabs.tsx
Normal file
13
src/deck-components/Tabs.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { DetailedHTMLProps, FC, HTMLAttributes } from 'react';
|
||||
|
||||
export const TabTitle: FC<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>> = ({
|
||||
children,
|
||||
className,
|
||||
...props
|
||||
}) => {
|
||||
return (
|
||||
<div className={`quickaccessmenu_Title_34nl5 ${className}`} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
6
src/deck-components/index.ts
Normal file
6
src/deck-components/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from './Backdrop';
|
||||
export * from './Controls';
|
||||
export * from './Dialogs';
|
||||
export * from './Menus';
|
||||
export * from './Panels';
|
||||
export * from './Tabs';
|
||||
Reference in New Issue
Block a user