@talogic/react 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/app-shell.component.d.ts +8 -3
- package/app/index.d.ts +2 -0
- package/app/split-view.component.d.ts +46 -0
- package/index.js +642 -593
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/talogic-react.css +1 -1
package/README.md
CHANGED
|
@@ -81,7 +81,7 @@ the file and the rule disagree. `--primary-foreground`, `--sidebar-primary-foreg
|
|
|
81
81
|
| `product` | `ProductLogo`, `ProductSwitcher`, `PRODUCT_CATALOGUE` |
|
|
82
82
|
| `status` | `StatusBadge` and the run statuses, with the same word and colour in every product |
|
|
83
83
|
| `web` | `SiteHeader`, `Hero`, `ProductCard`, `FeatureGrid`, `HowItWorks`, `PricingTable`, `Faq`, `CtaBand`, `SiteFooter` |
|
|
84
|
-
| `app` | `AppShell` (with the ⌘K palette, a status bar, and the `AppShellHeader` and `AppShellBody` parts that pin a page header), `PageHeader`, `StatCard`, `FilterBar`, `FilterChip`, `RecordsTable`, `FormSection` |
|
|
84
|
+
| `app` | `AppShell` (with the ⌘K palette, a status bar, and the `AppShellHeader` and `AppShellBody` parts that pin a page header), `SplitView` (a list and a detail that scroll apart under the pinned header), `PageHeader`, `StatCard`, `FilterBar`, `FilterChip`, `RecordsTable`, `FormSection` |
|
|
85
85
|
| `desktop` | `TitleBar` (Tauri drag region), `Inspector`, `FlowNode`, `TimelineLanes`, `StatusBar` |
|
|
86
86
|
| `mobile` | `BottomNav`, `RecordButton`, `CaptureFrame` |
|
|
87
87
|
| `class-names`, `timecode` | `cn` and `formatTimecode` |
|
|
@@ -32,7 +32,8 @@ export interface AppShellPartProps {
|
|
|
32
32
|
export declare function AppShellHeader({ children, className }: AppShellPartProps): import("react").JSX.Element;
|
|
33
33
|
/**
|
|
34
34
|
* The scrolling content of a page in an {@link AppShell}. With it, the page area stops scrolling as a whole, so an
|
|
35
|
-
* {@link AppShellHeader} above it and the shell's status bar below it stay in view.
|
|
35
|
+
* {@link AppShellHeader} above it and the shell's status bar below it stay in view. With a {@link SplitView} as its
|
|
36
|
+
* child, the body does not scroll: each pane of the view scrolls on its own.
|
|
36
37
|
*
|
|
37
38
|
* @param props - The content.
|
|
38
39
|
* @returns The scrolling area.
|
|
@@ -84,6 +85,10 @@ export interface AppShellProps {
|
|
|
84
85
|
statusBar?: ReactNode;
|
|
85
86
|
/** The commands of the palette, opened with ⌘K or Ctrl+K. Without commands, the search button and shortcut are hidden. */
|
|
86
87
|
commands?: readonly AppCommand[];
|
|
88
|
+
/** The placeholder of the palette's search field. Default: "Type a command or search…". */
|
|
89
|
+
commandPlaceholder?: string;
|
|
90
|
+
/** The text the palette shows when no command matches. Default: "No results.". */
|
|
91
|
+
commandEmpty?: ReactNode;
|
|
87
92
|
/** The page. */
|
|
88
93
|
children: ReactNode;
|
|
89
94
|
className?: string;
|
|
@@ -94,7 +99,7 @@ export interface AppShellProps {
|
|
|
94
99
|
* card and the user, beside a top bar and the page. The sidebar collapses to its icons; on a phone it opens in a
|
|
95
100
|
* sheet from the top bar. ⌘K or Ctrl+K opens the command palette; the search shows the one for the user's system.
|
|
96
101
|
*
|
|
97
|
-
* @param props - Product, navigation, user, top bar, commands and the page.
|
|
102
|
+
* @param props - Product, navigation, user, top bar, commands with their palette texts, and the page.
|
|
98
103
|
* @returns The shell.
|
|
99
104
|
*/
|
|
100
|
-
export declare function AppShell({ product, brand, workspace, onProductChange, nav, secondaryNav, sidebarFooter, sidebarNote, user, breadcrumb, topActions, statusBar, commands, children, className }: AppShellProps): import("react").JSX.Element;
|
|
105
|
+
export declare function AppShell({ product, brand, workspace, onProductChange, nav, secondaryNav, sidebarFooter, sidebarNote, user, breadcrumb, topActions, statusBar, commands, commandPlaceholder, commandEmpty, children, className }: AppShellProps): import("react").JSX.Element;
|
package/app/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { PageHeader } from './page-header.component';
|
|
|
9
9
|
export type { PageHeaderProps } from './page-header.component';
|
|
10
10
|
export { RecordsTable } from './records-table.component';
|
|
11
11
|
export type { RecordsColumn, RecordsTableProps } from './records-table.component';
|
|
12
|
+
export { SplitView } from './split-view.component';
|
|
13
|
+
export type { SplitViewProps } from './split-view.component';
|
|
12
14
|
export { sparklinePath } from './sparkline.algorithm';
|
|
13
15
|
export { StatCard } from './stat-card.component';
|
|
14
16
|
export type { StatCardProps } from './stat-card.component';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** Props of {@link SplitView}. */
|
|
3
|
+
export interface SplitViewProps {
|
|
4
|
+
/** The list (master) pane, at the start. */
|
|
5
|
+
list: ReactNode;
|
|
6
|
+
/** The detail pane, at the end. It takes the width the list does not use. */
|
|
7
|
+
detail: ReactNode;
|
|
8
|
+
/** The accessible name of the list pane, such as `Situations`. */
|
|
9
|
+
listLabel: string;
|
|
10
|
+
/** The accessible name of the detail pane, such as `Situation`. */
|
|
11
|
+
detailLabel: string;
|
|
12
|
+
/** The narrowest width of the list, in pixels. Default 280. */
|
|
13
|
+
listMinSize?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The width of the list when the view opens, in pixels. Default 352. Give the width that
|
|
16
|
+
* {@link SplitViewProps.onListSizeChange} reported last to open the view as the user left it.
|
|
17
|
+
*/
|
|
18
|
+
listDefaultSize?: number;
|
|
19
|
+
/** The narrowest width of the detail, in pixels. Default 360. */
|
|
20
|
+
detailMinSize?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Called with the new list width, in whole pixels, when the user stops a resize with the pointer or the keyboard.
|
|
23
|
+
* It is not called when the view opens or when the window changes size.
|
|
24
|
+
*/
|
|
25
|
+
onListSizeChange?: (size: number) => void;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The master-detail pattern of an app page: a list and a detail side by side, with a handle between them to change
|
|
30
|
+
* the width. Each pane scrolls on its own, with its own padding, and the page header stays in place.
|
|
31
|
+
*
|
|
32
|
+
* Put it as the only child of an {@link AppShellBody}. The body then stops its own scroll and padding, and the view
|
|
33
|
+
* fills the space under the {@link AppShellHeader}. A loading or empty state in the same body keeps the padding.
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <AppShellHeader><PageHeader title='Situations' actions={<CheckNow />} /></AppShellHeader>
|
|
37
|
+
* <AppShellBody>
|
|
38
|
+
* <SplitView listLabel='Situations' detailLabel='Situation' list={…} detail={…}
|
|
39
|
+
* listDefaultSize={saved ?? 352} onListSizeChange={save} />
|
|
40
|
+
* </AppShellBody>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @param props - The two panes, their names, the sizes and the resize callback.
|
|
44
|
+
* @returns The split view.
|
|
45
|
+
*/
|
|
46
|
+
export declare function SplitView({ list, detail, listLabel, detailLabel, listMinSize, listDefaultSize, detailMinSize, onListSizeChange, className }: SplitViewProps): import("react").JSX.Element;
|