mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-22 19:08:46 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e52cca8a2 | ||
|
|
3dbca1a056 | ||
|
|
c6692138c6 | ||
|
|
25c33b2a05 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
||||
## [3.7.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.1...v3.7.2) (2022-10-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **tabs:** unkill build ([3dbca1a](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/3dbca1a0567592a597e70ce5e9bef157f709c765))
|
||||
|
||||
## [3.7.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.7.0...v3.7.1) (2022-10-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Tabs:** temp remove until we have a way to grab it on beta ([25c33b2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/25c33b2a05a30c3c72008c5f459c3b77f819db5a))
|
||||
|
||||
# [3.7.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v3.6.1...v3.7.0) (2022-10-24)
|
||||
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "decky-frontend-lib",
|
||||
"version": "3.7.0",
|
||||
"version": "3.7.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "decky-frontend-lib",
|
||||
"version": "3.7.0",
|
||||
"version": "3.7.2",
|
||||
"license": "LGPL-2.1",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.6"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "decky-frontend-lib",
|
||||
"version": "3.7.0",
|
||||
"version": "3.7.2",
|
||||
"description": "A library for building decky plugins",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -1,74 +1,74 @@
|
||||
import { FC, ReactNode } from 'react';
|
||||
import { findModule } from '../webpack';
|
||||
import { FooterLegendProps } from './FooterLegend';
|
||||
// import { FC, ReactNode } from 'react';
|
||||
// import { findModule } from '../webpack';
|
||||
// import { FooterLegendProps } from './FooterLegend';
|
||||
|
||||
/**
|
||||
* Individual tab objects for the Tabs component
|
||||
*
|
||||
* `id` ID of this tab, can be used with activeTab to auto-focus a given tab
|
||||
* `title` Title shown in the header bar
|
||||
* `renderTabAddon` Return a {@link ReactNode} to render it next to the tab title, i.e. the counts for each tab on the Media page
|
||||
* `content` Content of the tab
|
||||
* `footer` Sets up button handlers and labels
|
||||
*/
|
||||
export interface Tab {
|
||||
id: string;
|
||||
title: string;
|
||||
renderTabAddon?: () => ReactNode;
|
||||
content: ReactNode;
|
||||
footer?: FooterLegendProps;
|
||||
}
|
||||
// /**
|
||||
// * Individual tab objects for the Tabs component
|
||||
// *
|
||||
// * `id` ID of this tab, can be used with activeTab to auto-focus a given tab
|
||||
// * `title` Title shown in the header bar
|
||||
// * `renderTabAddon` Return a {@link ReactNode} to render it next to the tab title, i.e. the counts for each tab on the Media page
|
||||
// * `content` Content of the tab
|
||||
// * `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}
|
||||
*
|
||||
* `tabs` array of {@link Tab}
|
||||
* `activeTab` tab currently active, needs to be one of the tabs {@link Tab.id}, must be set using a `useState` in the `onShowTab` handler
|
||||
* `onShowTab` Called when the active tab should change, needs to set `activeTab`. See example.
|
||||
* `autoFocusContents` Whether to automatically focus the tab contents or not.
|
||||
* `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 {
|
||||
tabs: Tab[];
|
||||
activeTab: string;
|
||||
onShowTab: (tab: string) => void;
|
||||
autoFocusContents?: boolean;
|
||||
}
|
||||
// /**
|
||||
// * Props for the {@link Tabs}
|
||||
// *
|
||||
// * `tabs` array of {@link Tab}
|
||||
// * `activeTab` tab currently active, needs to be one of the tabs {@link Tab.id}, must be set using a `useState` in the `onShowTab` handler
|
||||
// * `onShowTab` Called when the active tab should change, needs to set `activeTab`. See example.
|
||||
// * `autoFocusContents` Whether to automatically focus the tab contents or not.
|
||||
// * `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 {
|
||||
// tabs: Tab[];
|
||||
// activeTab: string;
|
||||
// onShowTab: (tab: string) => 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>;
|
||||
// /**
|
||||
// * 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(") && x?.type?.toString()?.includes("[\"tabs\"")) as FC<TabsProps>;
|
||||
@@ -17,7 +17,7 @@ export * from './SliderField';
|
||||
export * from './Spinner';
|
||||
export * from './static-classes';
|
||||
export * from './SteamSpinner';
|
||||
export * from './Tabs';
|
||||
//export * from './Tabs';
|
||||
export * from './TextField';
|
||||
export * from './Toggle';
|
||||
export * from './ToggleField';
|
||||
|
||||
Reference in New Issue
Block a user