Compare commits

...

10 Commits

Author SHA1 Message Date
semantic-release-bot
8a887ca858 chore(release): 3.5.5 [CI SKIP] 2022-10-08 05:54:20 +00:00
AAGaming
0ce1b5499d fix(sidebarnavigation): no dont 2022-10-08 01:53:35 -04:00
semantic-release-bot
554163cc5d chore(release): 3.5.4 [CI SKIP] 2022-10-08 05:51:16 +00:00
AAGaming
d6b00b0733 fix(sidebarnavigation): allow null pags 2022-10-08 01:50:25 -04:00
semantic-release-bot
f8ddf210f0 chore(release): 3.5.3 [CI SKIP] 2022-10-08 02:52:44 +00:00
AAGaming
4024b76918 fix(tabs): fix props and add example 2022-10-07 22:51:59 -04:00
semantic-release-bot
245dd0f3cf chore(release): 3.5.2 [CI SKIP] 2022-10-08 02:22:06 +00:00
AAGaming
7161e757e9 fix(Tabs): make onShowTab required 2022-10-07 22:21:30 -04:00
semantic-release-bot
c60d1e9787 chore(release): 3.5.1 [CI SKIP] 2022-10-08 02:11:59 +00:00
AAGaming
0e0e0d204a fix(Tabs): actually export it lmao 2022-10-07 22:11:23 -04:00
7 changed files with 82 additions and 18 deletions

View File

@@ -6,7 +6,8 @@
{ {
"preset": "angular", "preset": "angular",
"releaseRules": [ "releaseRules": [
{"type": "chore", "scope": "classes", "release": "patch"} {"type": "chore", "scope": "classes", "release": "patch"},
{"type": "*", "scope": "docs", "release": false}
] ]
} }
], ],

View File

@@ -1,3 +1,38 @@
## [3.5.5](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.5.4...v3.5.5) (2022-10-08)
### Bug Fixes
* **sidebarnavigation:** no dont ([0ce1b54](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/0ce1b5499df699f602aa83ab87ad8b246d133eac))
## [3.5.4](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.5.3...v3.5.4) (2022-10-08)
### Bug Fixes
* **sidebarnavigation:** allow null pags ([d6b00b0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/d6b00b07337f7a9d38813eeec7c0a848d5c15f17))
## [3.5.3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.5.2...v3.5.3) (2022-10-08)
### Bug Fixes
* **tabs:** fix props and add example ([4024b76](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/4024b76918eea43e43a24c162a937877f18627f0))
## [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) # [3.5.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.4.0...v3.5.0) (2022-10-08)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "decky-frontend-lib", "name": "decky-frontend-lib",
"version": "3.5.0", "version": "3.5.5",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "decky-frontend-lib", "name": "decky-frontend-lib",
"version": "3.5.0", "version": "3.5.5",
"license": "LGPL-2.1", "license": "LGPL-2.1",
"dependencies": { "dependencies": {
"minimist": "^1.2.6" "minimist": "^1.2.6"

View File

@@ -1,6 +1,6 @@
{ {
"name": "decky-frontend-lib", "name": "decky-frontend-lib",
"version": "3.5.0", "version": "3.5.5",
"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",

View File

@@ -2,7 +2,7 @@ import { ReactNode, VFC } from 'react';
import { Module, findModuleChild } from '../webpack'; import { Module, findModuleChild } from '../webpack';
export interface SidebarNavigationPages { export interface SidebarNavigationPage {
title: string; title: string;
content: ReactNode; content: ReactNode;
icon?: ReactNode; icon?: ReactNode;
@@ -16,7 +16,7 @@ export interface SidebarNavigationPages {
export interface SidebarNavigationProps { export interface SidebarNavigationProps {
title?: string; title?: string;
pages: SidebarNavigationPages[]; pages: SidebarNavigationPage[];
showTitle?: boolean; showTitle?: boolean;
disableRouteReporting?: boolean; disableRouteReporting?: boolean;
page?: string; page?: string;

View File

@@ -5,11 +5,11 @@ import { FooterLegendProps } from './FooterLegend';
/** /**
* Individual tab objects for the Tabs component * Individual tab objects for the Tabs component
* *
* @property id ID of this tab, can be used with activeTab to auto-focus a given tab * `id` ID of this tab, can be used with activeTab to auto-focus a given tab
* @property title Title shown in the header bar * `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 * `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 * `content` Content of the tab
* @property footer Sets up button handlers and labels * `footer` Sets up button handlers and labels
*/ */
export interface Tab { export interface Tab {
id: string; id: string;
@@ -22,16 +22,43 @@ export interface Tab {
/** /**
* Props for the {@link Tabs} * Props for the {@link Tabs}
* *
* @property tabs array of {@link Tab} * `tabs` array of {@link Tab}
* @property activeTab tab to automatically focus, {@link Tab.id} * `activeTab` tab currently active, needs to be one of the tabs {@link Tab.id}, must be set using a `useState` in the `onShowTab` handler
* @property onShowTab Currently unknown. * `onShowTab` Called when the active tab should change, needs to set `activeTab`. See example.
* @property autoFocusContents Whether to automatically focus the tab contents or not. * `autoFocusContents` Whether to automatically focus the tab contents or not.
* @property footer Sets up button handlers and labels * `footer` Sets up button handlers and labels
*
* @example
* const Component: FC = () => {
* const [currentTab, setCurrentTab] = useState<string>("Tab1");
*
* return (
* <Tabs
* title="Theme Manager"
* activeTab={currentTabRoute}
* onShowTab={(tabID: string) => {
* setCurrentTabRoute(tabID);
* }}
* tabs={[
* {
* title: "Tab 1",
* content: <Tab1Component />,
* id: "Tab1",
* },
* {
* title: "Tab 2",
* content: <Tab2Component />,
* id: "Tab2",
* },
* ]}
* />
* );
* };
*/ */
export interface TabsProps { export interface TabsProps {
tabs: Tab[]; tabs: Tab[];
activeTab?: string; activeTab: string;
onShowTab?: (...args: unknown[]) => void; onShowTab: (tab: string) => void;
autoFocusContents?: boolean; autoFocusContents?: boolean;
} }

View File

@@ -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';