mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-20 10:00:08 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
747d70dcca | ||
|
|
7f9dfc5910 | ||
|
|
a3c1a7c7b7 |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,3 +1,15 @@
|
||||
# [0.4.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.3.0...v0.4.0) (2022-06-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **typings:** export all prop types ([7f9dfc5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/7f9dfc5910dfc172ba161d9b63763e85eb289a43))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **textfield:** extract TextField component ([a3c1a7c](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/a3c1a7c7b73eae475574a13b6ff9c75ff78cbcb6))
|
||||
|
||||
# [0.3.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v0.2.0...v0.3.0) (2022-06-04)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "decky-frontend-lib",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.0",
|
||||
"description": "A library for building decky plugins",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
||||
|
||||
import { CommonUIModule } from '../webpack';
|
||||
|
||||
interface ButtonProps {
|
||||
export interface ButtonProps {
|
||||
className?: string;
|
||||
noFocusRing?: boolean;
|
||||
disabled?: boolean;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
||||
|
||||
import { CommonUIModule } from '../webpack';
|
||||
|
||||
interface ButtonItemProps {
|
||||
export interface ButtonItemProps {
|
||||
label?: string;
|
||||
description?: string;
|
||||
layout?: 'below';
|
||||
|
||||
@@ -11,7 +11,7 @@ export const showContextMenu: (children: ReactNode, parent?: EventTarget) => voi
|
||||
}
|
||||
});
|
||||
|
||||
interface MenuProps {
|
||||
export interface MenuProps {
|
||||
label: string;
|
||||
onCancel?(): void;
|
||||
cancelText?: string;
|
||||
@@ -27,7 +27,7 @@ export const Menu: FC<MenuProps> = findModuleChild((m) => {
|
||||
}
|
||||
});
|
||||
|
||||
interface MenuItemProps {
|
||||
export interface MenuItemProps {
|
||||
onSelected?(): void;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { FC, ReactNode } from 'react';
|
||||
|
||||
import { findModuleChild } from '../webpack';
|
||||
|
||||
// TODO: there is another argument, figure out what it does
|
||||
@@ -11,18 +12,18 @@ export const showModal: (children: ReactNode, parent?: EventTarget) => void = fi
|
||||
}
|
||||
});
|
||||
|
||||
interface ModalRootProps {
|
||||
onMiddleButton?(): void,
|
||||
export interface ModalRootProps {
|
||||
onMiddleButton?(): void;
|
||||
onCancel?(): void;
|
||||
onOK?(): void;
|
||||
bAllowFullSize?: boolean;
|
||||
}
|
||||
|
||||
export const ModalRoot = findModuleChild(m => {
|
||||
if (typeof m !== "object") return undefined;
|
||||
export const ModalRoot = findModuleChild((m) => {
|
||||
if (typeof m !== 'object') return undefined;
|
||||
for (let prop in m) {
|
||||
if (!m[prop]?.prototype?.OK && m[prop]?.prototype?.Cancel && m[prop]?.prototype?.render) {
|
||||
return m[prop];
|
||||
}
|
||||
}
|
||||
}) as FC<ModalRootProps>;
|
||||
}) as FC<ModalRootProps>;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
||||
|
||||
import { findModuleChild } from '../webpack';
|
||||
|
||||
interface PanelSectionProps {
|
||||
export interface PanelSectionProps {
|
||||
title?: string;
|
||||
spinner?: boolean;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export enum QuickAccessTab {
|
||||
Decky,
|
||||
}
|
||||
|
||||
interface Router {
|
||||
export interface Router {
|
||||
CloseSideMenus(): void;
|
||||
OpenQuickAccessMenu(quickAccessTab: QuickAccessTab): void;
|
||||
GetQuickAccessTab(): QuickAccessTab;
|
||||
|
||||
@@ -2,13 +2,13 @@ import { FC } from 'react';
|
||||
|
||||
import { CommonUIModule } from '../webpack';
|
||||
|
||||
interface NotchLabel {
|
||||
export interface NotchLabel {
|
||||
notchIndex: number;
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
interface SliderProps {
|
||||
export interface SliderProps {
|
||||
label?: string;
|
||||
value: number;
|
||||
layout?: 'below';
|
||||
|
||||
29
src/deck-components/TextField.tsx
Normal file
29
src/deck-components/TextField.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { ChangeEventHandler, ReactNode, VFC } from 'react';
|
||||
|
||||
import { CommonUIModule, Module } from '../webpack';
|
||||
|
||||
export interface TextFieldProps {
|
||||
label?: ReactNode;
|
||||
requiredLabel?: ReactNode;
|
||||
description?: ReactNode;
|
||||
bShowCopyAction?: boolean;
|
||||
bShowClearAction?: boolean;
|
||||
bAlwaysShowClearAction?: boolean;
|
||||
bIsPassword?: boolean;
|
||||
rangeMin?: number;
|
||||
rangeMax?: number;
|
||||
mustBeNumeric?: boolean;
|
||||
mustBeURL?: boolean;
|
||||
mustBeEmail?: boolean;
|
||||
focusOnMount?: boolean;
|
||||
tooltip?: string;
|
||||
inlineControls?: ReactNode;
|
||||
onChange?(event: ChangeEventHandler<HTMLInputElement>): void;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export const TextField = Object.values(CommonUIModule).find(
|
||||
(mod: Module) => mod?.validateUrl && mod?.validateEmail,
|
||||
) as VFC<TextFieldProps>;
|
||||
|
||||
console.log(TextField);
|
||||
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
||||
|
||||
import { CommonUIModule } from '../webpack';
|
||||
|
||||
interface ToggleProps {
|
||||
export interface ToggleProps {
|
||||
label?: string;
|
||||
description?: string;
|
||||
checked: boolean;
|
||||
|
||||
@@ -8,4 +8,5 @@ export * from './Slider';
|
||||
export * from './Spinner';
|
||||
export * from './static-classes';
|
||||
export * from './SteamSpinner';
|
||||
export * from './TextField';
|
||||
export * from './Toggle';
|
||||
|
||||
Reference in New Issue
Block a user