@talogic/react 0.10.0 → 0.12.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 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.
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;