mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 10:29:00 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
245dd0f3cf | ||
|
|
7161e757e9 | ||
|
|
c60d1e9787 | ||
|
|
0e0e0d204a | ||
|
|
e5120928d3 | ||
|
|
abbd3cddae |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
|||||||
|
## [3.5.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.5.1...v3.5.2) (2022-10-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Tabs:** make onShowTab required ([7161e75](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/7161e757e9c98d677510e03eb2606ce58152f3b1))
|
||||||
|
|
||||||
|
## [3.5.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.5.0...v3.5.1) (2022-10-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Tabs:** actually export it lmao ([0e0e0d2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/0e0e0d204adc8d888f05e98edb6c1a1a171d00bb))
|
||||||
|
|
||||||
|
# [3.5.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.4.0...v3.5.0) (2022-10-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Tabs:** initial tabs component, props, docs ([abbd3cd](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/abbd3cddae24039cbc9b7d955924431e8fbacf94))
|
||||||
|
|
||||||
# [3.4.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.3.5...v3.4.0) (2022-10-06)
|
# [3.4.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.3.5...v3.4.0) (2022-10-06)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.4.0",
|
"version": "3.5.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.4.0",
|
"version": "3.5.2",
|
||||||
"license": "LGPL-2.1",
|
"license": "LGPL-2.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.6"
|
"minimist": "^1.2.6"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "3.4.0",
|
"version": "3.5.2",
|
||||||
"description": "A library for building decky plugins",
|
"description": "A library for building decky plugins",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
47
src/deck-components/Tabs.tsx
Normal file
47
src/deck-components/Tabs.tsx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import { FC, ReactNode } from 'react';
|
||||||
|
import { findModule } from '../webpack';
|
||||||
|
import { FooterLegendProps } from './FooterLegend';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Individual tab objects for the Tabs component
|
||||||
|
*
|
||||||
|
* @property id ID of this tab, can be used with activeTab to auto-focus a given tab
|
||||||
|
* @property title Title shown in the header bar
|
||||||
|
* @property renderTabAddon Return a {@link ReactNode} to render it next to the tab title, i.e. the counts for each tab on the Media page
|
||||||
|
* @property content Content of the tab
|
||||||
|
* @property footer Sets up button handlers and labels
|
||||||
|
*/
|
||||||
|
export interface Tab {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
renderTabAddon?: () => ReactNode;
|
||||||
|
content: ReactNode;
|
||||||
|
footer?: FooterLegendProps;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Props for the {@link Tabs}
|
||||||
|
*
|
||||||
|
* @property tabs array of {@link Tab}
|
||||||
|
* @property activeTab tab to automatically focus, {@link Tab.id}
|
||||||
|
* @property onShowTab Currently unknown, but required.
|
||||||
|
* @property autoFocusContents Whether to automatically focus the tab contents or not.
|
||||||
|
* @property footer Sets up button handlers and labels
|
||||||
|
*/
|
||||||
|
export interface TabsProps {
|
||||||
|
tabs: Tab[];
|
||||||
|
activeTab?: string;
|
||||||
|
onShowTab: (...args: unknown[]) => void;
|
||||||
|
autoFocusContents?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tabs component as used in the library and media tabs. See {@link TabsProps}
|
||||||
|
*/
|
||||||
|
export const Tabs = Object.values(findModule((m) => {
|
||||||
|
if (typeof m !== 'object') return false;
|
||||||
|
for (let prop in m) {
|
||||||
|
if (m[prop]?.Unbleed) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
})).find((x: any) => x?.type?.toString()?.includes("((function(){")) as FC<TabsProps>;
|
||||||
@@ -17,6 +17,7 @@ export * from './SliderField';
|
|||||||
export * from './Spinner';
|
export * from './Spinner';
|
||||||
export * from './static-classes';
|
export * from './static-classes';
|
||||||
export * from './SteamSpinner';
|
export * from './SteamSpinner';
|
||||||
|
export * from './Tabs';
|
||||||
export * from './TextField';
|
export * from './TextField';
|
||||||
export * from './Toggle';
|
export * from './Toggle';
|
||||||
export * from './ToggleField';
|
export * from './ToggleField';
|
||||||
|
|||||||
Reference in New Issue
Block a user