@talogic/react 0.0.0-stage → 0.6.2

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.
Files changed (130) hide show
  1. package/README.md +106 -2
  2. package/app/app-shell.component.d.ts +66 -0
  3. package/app/command-shortcut.hook.d.ts +21 -0
  4. package/app/filter-bar.component.d.ts +38 -0
  5. package/app/form-section.component.d.ts +21 -0
  6. package/app/index.d.ts +14 -0
  7. package/app/page-header.component.d.ts +20 -0
  8. package/app/records-table.component.d.ts +38 -0
  9. package/app/sparkline.algorithm.d.ts +11 -0
  10. package/app/stat-card.component.d.ts +28 -0
  11. package/class-names/class-names.algorithm.d.ts +8 -0
  12. package/class-names/index.d.ts +1 -0
  13. package/desktop/flow-node.component.d.ts +25 -0
  14. package/desktop/index.d.ts +12 -0
  15. package/desktop/inspector.component.d.ts +29 -0
  16. package/desktop/status-bar.component.d.ts +17 -0
  17. package/desktop/timeline-lanes.component.d.ts +43 -0
  18. package/desktop/timeline.algorithm.d.ts +22 -0
  19. package/desktop/title-bar.component.d.ts +24 -0
  20. package/fonts.css +4 -0
  21. package/index.d.ts +17 -0
  22. package/index.js +3495 -0
  23. package/index.js.map +1 -0
  24. package/mobile/bottom-nav.component.d.ts +23 -0
  25. package/mobile/capture-frame.component.d.ts +30 -0
  26. package/mobile/index.d.ts +6 -0
  27. package/mobile/record-button.component.d.ts +24 -0
  28. package/package.json +63 -4
  29. package/product/index.d.ts +8 -0
  30. package/product/product-catalogue.content.d.ts +16 -0
  31. package/product/product-logo.component.d.ts +17 -0
  32. package/product/product-switcher.component.d.ts +21 -0
  33. package/product/sidebar-brand.component.d.ts +18 -0
  34. package/status/index.d.ts +6 -0
  35. package/status/run-status.contract.d.ts +7 -0
  36. package/status/run-status.mapper.d.ts +18 -0
  37. package/status/status-badge.component.d.ts +14 -0
  38. package/talogic-react.css +2 -0
  39. package/timecode/index.d.ts +1 -0
  40. package/timecode/timecode.mapper.d.ts +17 -0
  41. package/tokens/apca-contrast.algorithm.d.ts +23 -0
  42. package/tokens/hue-fill.style.d.ts +6 -0
  43. package/tokens/index.d.ts +12 -0
  44. package/tokens/logo-color.algorithm.d.ts +21 -0
  45. package/tokens/palette.style.d.ts +6 -0
  46. package/tokens/product-hue.policy.d.ts +15 -0
  47. package/tokens/theme-attributes.mapper.d.ts +18 -0
  48. package/tokens/theme-root.component.d.ts +15 -0
  49. package/tokens/theme.contract.d.ts +34 -0
  50. package/tokens.css +949 -0
  51. package/ui/active-indicator/active-indicator.hook.d.ts +11 -0
  52. package/ui/active-indicator/active-indicator.recipe.d.ts +5 -0
  53. package/ui/active-indicator/index.d.ts +2 -0
  54. package/ui/avatar/avatar.component.d.ts +23 -0
  55. package/ui/avatar/index.d.ts +1 -0
  56. package/ui/badge/badge.component.d.ts +14 -0
  57. package/ui/badge/badge.recipe.d.ts +12 -0
  58. package/ui/badge/index.d.ts +4 -0
  59. package/ui/button/button.component.d.ts +16 -0
  60. package/ui/button/button.recipe.d.ts +11 -0
  61. package/ui/button/index.d.ts +4 -0
  62. package/ui/choice/checkbox.component.d.ts +11 -0
  63. package/ui/choice/index.d.ts +5 -0
  64. package/ui/choice/radio-group.component.d.ts +17 -0
  65. package/ui/choice/slider.component.d.ts +10 -0
  66. package/ui/choice/switch.component.d.ts +9 -0
  67. package/ui/choice/toggle-group.component.d.ts +17 -0
  68. package/ui/feedback/alert.component.d.ts +41 -0
  69. package/ui/feedback/empty-state.component.d.ts +19 -0
  70. package/ui/feedback/index.d.ts +8 -0
  71. package/ui/feedback/progress.component.d.ts +9 -0
  72. package/ui/feedback/skeleton.component.d.ts +8 -0
  73. package/ui/feedback/spinner.component.d.ts +10 -0
  74. package/ui/feedback/toaster.component.d.ts +10 -0
  75. package/ui/field/control.recipe.d.ts +5 -0
  76. package/ui/field/field-control.hook.d.ts +26 -0
  77. package/ui/field/field.component.d.ts +22 -0
  78. package/ui/field/index.d.ts +10 -0
  79. package/ui/field/input.component.d.ts +13 -0
  80. package/ui/field/label.component.d.ts +9 -0
  81. package/ui/field/select.component.d.ts +43 -0
  82. package/ui/field/textarea.component.d.ts +8 -0
  83. package/ui/index.d.ts +11 -0
  84. package/ui/layout/accordion.component.d.ts +30 -0
  85. package/ui/layout/card.component.d.ts +43 -0
  86. package/ui/layout/index.d.ts +7 -0
  87. package/ui/layout/kbd.component.d.ts +8 -0
  88. package/ui/layout/resizable.component.d.ts +23 -0
  89. package/ui/layout/scroll-area.component.d.ts +16 -0
  90. package/ui/layout/separator.component.d.ts +9 -0
  91. package/ui/layout/table.component.d.ts +50 -0
  92. package/ui/menu/command.component.d.ts +72 -0
  93. package/ui/menu/context-menu.component.d.ts +39 -0
  94. package/ui/menu/dropdown-menu.component.d.ts +57 -0
  95. package/ui/menu/index.d.ts +6 -0
  96. package/ui/menu/menu.recipe.d.ts +13 -0
  97. package/ui/navigation/breadcrumb.component.d.ts +45 -0
  98. package/ui/navigation/index.d.ts +11 -0
  99. package/ui/navigation/menu-icon.component.d.ts +18 -0
  100. package/ui/navigation/menubar.component.d.ts +48 -0
  101. package/ui/navigation/navigation-menu.component.d.ts +39 -0
  102. package/ui/navigation/pagination.component.d.ts +20 -0
  103. package/ui/navigation/stepper.component.d.ts +28 -0
  104. package/ui/navigation/tabs.component.d.ts +39 -0
  105. package/ui/overlay/alert-dialog.component.d.ts +42 -0
  106. package/ui/overlay/dialog.component.d.ts +48 -0
  107. package/ui/overlay/drawer.component.d.ts +29 -0
  108. package/ui/overlay/index.d.ts +9 -0
  109. package/ui/overlay/overlay.recipe.d.ts +18 -0
  110. package/ui/overlay/popover.component.d.ts +15 -0
  111. package/ui/overlay/sheet.component.d.ts +31 -0
  112. package/ui/overlay/tooltip.component.d.ts +20 -0
  113. package/ui/sidebar/index.d.ts +11 -0
  114. package/ui/sidebar/sidebar-context.hook.d.ts +29 -0
  115. package/ui/sidebar/sidebar-group.component.d.ts +26 -0
  116. package/ui/sidebar/sidebar-item.component.d.ts +35 -0
  117. package/ui/sidebar/sidebar-sheet.component.d.ts +25 -0
  118. package/ui/sidebar/sidebar.component.d.ts +80 -0
  119. package/ui/sidebar/sidebar.recipe.d.ts +8 -0
  120. package/web/cta-band.component.d.ts +20 -0
  121. package/web/faq.component.d.ts +19 -0
  122. package/web/feature-grid.component.d.ts +22 -0
  123. package/web/hero.component.d.ts +20 -0
  124. package/web/how-it-works.component.d.ts +22 -0
  125. package/web/index.d.ts +20 -0
  126. package/web/mobile-menu.component.d.ts +25 -0
  127. package/web/pricing-table.component.d.ts +37 -0
  128. package/web/product-card.component.d.ts +20 -0
  129. package/web/site-footer.component.d.ts +25 -0
  130. package/web/site-header.component.d.ts +32 -0
package/README.md CHANGED
@@ -1,3 +1,107 @@
1
- # Temporary Holding Version
1
+ # @talogic/react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Talogic design system in React: design tokens for Tailwind CSS v4 and shadcn/ui, the shadcn/ui primitives
4
+ drawn with those tokens, and patterns for each surface of the product family. The source design is the approved
5
+ "Talogic Component System" canvas.
6
+
7
+ **[Read the usage guide](docs/usage.md)** for the install, the setup of a product, and how to
8
+ replace Chakra UI. The Storybook, with every component, is at https://talogic-automation.github.io/talogic/.
9
+
10
+ ## Install and set up
11
+
12
+ The package is public on the npm registry:
13
+
14
+ ```sh
15
+ npm install @talogic/react
16
+ ```
17
+
18
+ Until the first release, link a sibling checkout with `"@talogic/react": "file:../talogic/packages/react"`.
19
+
20
+ ## Releases
21
+
22
+ Nobody sets a version or a tag by hand. On every merge to `main`, the CI pipeline that MonoSmith generates
23
+ (`.github/workflows/ci.yml`) runs `smith ci release`: it reads the conventional commits since the last release
24
+ (`feat:` gives a minor version, `fix:` a patch, a breaking change a major), sets the version, builds, publishes to
25
+ npm, pushes the tag and writes the GitHub Release. A pull request shows the release it will make in a
26
+ comment. Squash-merge with a `feat:` or `fix:` title when the change must release; a `chore:` or `docs:` title
27
+ releases nothing. The same merge also deploys the Storybook to GitHub Pages (`.github/workflows/deploy-pages.yml`).
28
+
29
+ With Tailwind CSS v4 in the consuming app:
30
+
31
+ ```css
32
+ @import "tailwindcss";
33
+ @import "@talogic/react/tokens.css";
34
+ @import "@talogic/react/fonts.css";
35
+ @source "../node_modules/@talogic/react";
36
+ ```
37
+
38
+ Without Tailwind, import the compiled stylesheet and the fonts:
39
+
40
+ ```ts
41
+ import '@talogic/react/styles.css'
42
+ import '@talogic/react/fonts.css'
43
+ ```
44
+
45
+ ## Theme switches
46
+
47
+ Every switch is an attribute or a class, on `<html>` for a whole app or on any element for a region.
48
+ `ThemeRoot` sets them for you.
49
+
50
+ | Switch | Values | Effect |
51
+ |---|---|---|
52
+ | `data-product` | `talogic`, `pargic`, `daygic`, `ingic`, `loregic`, `loomgic` | The product accent: `--brand`, `--primary`, `--ring`, `--brand-text`, `--brand-soft` |
53
+ | `data-hue` | the 12 family hues | An accent for a product with no name yet. It wins over `data-product` on the same element |
54
+ | `.dark` | present or not | The dark theme |
55
+ | `.d-web`, `.d-app`, `.d-desk`, `.d-mob` | one per surface | Control height 44, 36, 28 or 48 px, read by every component recipe |
56
+
57
+ ```tsx
58
+ <ThemeRoot product='daygic' density='mob' scheme='dark'>…</ThemeRoot>
59
+ ```
60
+
61
+ Menus, dialogs and toasts render in a portal under `<body>`, so they follow the switches on `<html>`.
62
+
63
+ Tokens use the shadcn/ui variable names (`--background`, `--primary`, `--muted-foreground`, `--sidebar-*`,
64
+ `--chart-1` to `--chart-5`) plus Talogic roles (`--brand`, `--brand-text`, `--brand-soft`, `--canvas`, the status
65
+ colours and their `-soft` backgrounds). The family palette replaces the default Tailwind colours, so `bg-pink-500`
66
+ and `text-orange-700` are family steps. Fonts: DM Sans for headlines (`font-display`, `type-display`, `type-h1`,
67
+ `type-h2`), Inter for content (`font-sans`), Fira Code for code (`font-mono`).
68
+
69
+ Labels on fills are never a fixed colour. The APCA contrast method (the WCAG 3 draft) picks, for every family
70
+ colour, the ink or white label that reads best on it. `npm run tokens:labels -w packages/react` writes the result
71
+ to `tokens.css` as `--color-on-<hue>-<step>` (so `bg-violet-500 text-on-violet-500` works), and a test fails when
72
+ the file and the rule disagree. `--primary-foreground`, `--sidebar-primary-foreground` and
73
+ `--destructive-foreground` point at these tokens. For a colour known only at run time, call `readableLabel(hex)`.
74
+
75
+ ## What is in the package
76
+
77
+ | Slice | Contents |
78
+ |---|---|
79
+ | `tokens` | `tokens.css`, `fonts.css`, `ThemeRoot`, `themeAttributes`, product and hue lists, `PRODUCT_HUES`, `FAMILY_PALETTE`, `HUE_FILL` |
80
+ | `ui` | shadcn/ui primitives: button, badge, avatar, field (label, input, textarea, select), choice (checkbox, radio group, switch, slider, toggle group), navigation (tabs, breadcrumb, pagination, stepper, navigation menu, menubar), overlay (dialog, alert dialog, sheet, drawer, popover, tooltip), menu (dropdown menu, context menu, command), feedback (alert, toaster, progress, skeleton, spinner, empty state), layout (card, separator, scroll area, resizable, accordion, table, kbd) |
81
+ | `product` | `ProductLogo`, `ProductSwitcher`, `PRODUCT_CATALOGUE` |
82
+ | `status` | `StatusBadge` and the run statuses, with the same word and colour in every product |
83
+ | `web` | `SiteHeader`, `Hero`, `ProductCard`, `FeatureGrid`, `HowItWorks`, `PricingTable`, `Faq`, `CtaBand`, `SiteFooter` |
84
+ | `app` | `AppShell` (with the ⌘K palette), `PageHeader`, `StatCard`, `FilterBar`, `FilterChip`, `RecordsTable`, `FormSection` |
85
+ | `desktop` | `TitleBar` (Tauri drag region), `Inspector`, `FlowNode`, `TimelineLanes`, `StatusBar` |
86
+ | `mobile` | `BottomNav`, `RecordButton`, `CaptureFrame` |
87
+ | `class-names`, `timecode` | `cn` and `formatTimecode` |
88
+
89
+ ## Work on the package
90
+
91
+ The repository is a MonoSmith workspace with two projects: the package in `packages/react` and the Storybook app
92
+ in `apps/storybook`, whose stories import the package's public API.
93
+
94
+ ```sh
95
+ npm install
96
+ smith dev -p storybook # http://localhost:6006, with Product, Hue, Theme and Density in the toolbar
97
+ smith verify # what CI runs: deps check, lint, typecheck, tests and build of both projects
98
+ smith test -p react # Jest and Testing Library, in jsdom
99
+ npm run format -w packages/react # @monosmith/eslint-config, which also formats (eslint --fix)
100
+ smith release --dry-run # the release the next merge to main makes
101
+ ```
102
+
103
+ The package source follows vertical feature slices: each folder under `packages/react/src` is a slice with flat,
104
+ role-suffixed files (`.component.tsx`, `.recipe.ts`, `.hook.ts`, `.mapper.ts`, `.algorithm.ts`, `.policy.ts`,
105
+ `.contract.ts`, `.content.ts`, `.style.ts`) and an `index.ts` that is its only entry point. Tests sit beside the
106
+ code. Stories live in `apps/storybook/stories`, in folders that mirror the slices, because MonoSmith's dependency
107
+ check treats every file under the package's `src` as published code. `src/index.ts` re-exports the slices.
@@ -0,0 +1,66 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Product } from '../tokens';
3
+ /** An entry of the app sidebar. */
4
+ export interface AppNavItem {
5
+ label: string;
6
+ href: string;
7
+ /** A 16 px lucide icon. */
8
+ icon: ReactNode;
9
+ /** A count badge, such as the number of recipes. */
10
+ count?: number;
11
+ /** True for the page the user is on. */
12
+ current?: boolean;
13
+ }
14
+ /** A command of the palette. */
15
+ export interface AppCommand {
16
+ label: string;
17
+ group: string;
18
+ onSelect: () => void;
19
+ }
20
+ /** Props of {@link AppShell}. */
21
+ export interface AppShellProps {
22
+ /** The product, for the switcher or the brand. Theme the accent with ThemeRoot or `<html data-product>`. */
23
+ product: Product;
24
+ /**
25
+ * The top of the sidebar: `switcher` (default) is the product switcher of a portal; `logo` is the product's
26
+ * symbol and name, for a single-product app. With `logo` the symbol is the collapse button, and a collapsed
27
+ * sidebar shows the symbol only.
28
+ */
29
+ brand?: 'switcher' | 'logo';
30
+ workspace?: string;
31
+ onProductChange?: (product: Product) => void;
32
+ /** The main sidebar entries. */
33
+ nav: readonly AppNavItem[];
34
+ /** A titled second group, such as Workspace settings. */
35
+ secondaryNav?: {
36
+ title: string;
37
+ items: readonly AppNavItem[];
38
+ };
39
+ /** A card at the bottom of the sidebar, such as plan usage. */
40
+ sidebarFooter?: ReactNode;
41
+ /** The signed-in user. */
42
+ user?: {
43
+ name: string;
44
+ role?: string;
45
+ initials: string;
46
+ };
47
+ /** The breadcrumb at the start of the top bar. */
48
+ breadcrumb?: ReactNode;
49
+ /** Icon buttons at the end of the top bar. */
50
+ topActions?: ReactNode;
51
+ /** The commands of the palette, opened with ⌘K or Ctrl+K. Without commands, the search button and shortcut are hidden. */
52
+ commands?: readonly AppCommand[];
53
+ /** The page. */
54
+ children: ReactNode;
55
+ className?: string;
56
+ }
57
+ /**
58
+ * The AppShell pattern of a web portal: the `nav` Sidebar with the product switcher (or, with `brand='logo'`, the
59
+ * product's symbol as the collapse button), search, navigation, a footer
60
+ * card and the user, beside a top bar and the page. The sidebar collapses to its icons; on a phone it opens in a
61
+ * sheet from the top bar. ⌘K or Ctrl+K opens the command palette; the search shows the one for the user's system.
62
+ *
63
+ * @param props - Product, navigation, user, top bar, commands and the page.
64
+ * @returns The shell.
65
+ */
66
+ export declare function AppShell({ product, brand, workspace, onProductChange, nav, secondaryNav, sidebarFooter, user, breadcrumb, topActions, commands, children, className }: AppShellProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Calls `onTrigger` when the user presses ⌘K on macOS or Ctrl K elsewhere, to open the command palette.
3
+ *
4
+ * @param onTrigger - Called on the shortcut. The default browser action is cancelled.
5
+ * @param enabled - Turns the shortcut off, for example while another dialog is open. Default true.
6
+ */
7
+ export declare function useCommandShortcut(onTrigger: () => void, enabled?: boolean): void;
8
+ /**
9
+ * Names the command palette shortcut for a platform: ⌘K on Apple systems, Ctrl+K on Windows, Linux and the rest.
10
+ *
11
+ * @param platform - The platform name, such as `navigator.userAgentData.platform` or `navigator.platform`.
12
+ * @returns The shortcut label.
13
+ */
14
+ export declare function commandShortcutLabel(platform: string): string;
15
+ /**
16
+ * Gives the command palette shortcut label for the user's system: ⌘K on Apple systems, Ctrl+K elsewhere. Server
17
+ * rendering shows Ctrl+K.
18
+ *
19
+ * @returns The shortcut label.
20
+ */
21
+ export declare function useCommandShortcutLabel(): string;
@@ -0,0 +1,38 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ /** Props of {@link FilterBar}. */
3
+ export interface FilterBarProps {
4
+ /** The search text. */
5
+ query: string;
6
+ /** Called with the new search text. */
7
+ onQueryChange: (query: string) => void;
8
+ /** The search field's accessible label and placeholder. Default "Search". */
9
+ searchLabel?: string;
10
+ /** Filter chips, such as {@link FilterChip}s. */
11
+ filters?: ReactNode;
12
+ /** A view switch at the end, such as a ToggleGroup. */
13
+ views?: ReactNode;
14
+ className?: string;
15
+ }
16
+ /**
17
+ * The FilterBar pattern above a table: search, filter chips and a view switch.
18
+ *
19
+ * @param props - Search state, filters and views.
20
+ * @returns The bar.
21
+ */
22
+ export declare function FilterBar({ query, onQueryChange, searchLabel, filters, views, className }: FilterBarProps): import("react").JSX.Element;
23
+ /** Props of {@link FilterChip}. */
24
+ export interface FilterChipProps extends ComponentProps<'button'> {
25
+ /** The filter's name, such as "Status". */
26
+ label: string;
27
+ /** How many values the filter has picked. Zero shows no count. */
28
+ count?: number;
29
+ /** Replaces the plus icon. */
30
+ icon?: ReactNode;
31
+ }
32
+ /**
33
+ * A filter button with a dashed border and the count of picked values. Open a popover or menu from it.
34
+ *
35
+ * @param props - Label, count, icon and any `button` props.
36
+ * @returns The chip.
37
+ */
38
+ export declare function FilterChip({ label, count, icon, className, ...props }: FilterChipProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Props of {@link FormSection}. */
3
+ export interface FormSectionProps {
4
+ /** The section title. */
5
+ title: ReactNode;
6
+ /** What the settings in the section change. */
7
+ description?: ReactNode;
8
+ /** The fields. */
9
+ children: ReactNode;
10
+ /** Buttons under the fields, such as Save. */
11
+ actions?: ReactNode;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * The FormSection pattern of a settings page: a title and description beside a card of fields. The two
16
+ * columns stack below 768 px.
17
+ *
18
+ * @param props - Title, description, fields and actions.
19
+ * @returns The section.
20
+ */
21
+ export declare function FormSection({ title, description, children, actions, className }: FormSectionProps): import("react").JSX.Element;
package/app/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export { AppShell } from './app-shell.component';
2
+ export type { AppCommand, AppNavItem, AppShellProps } from './app-shell.component';
3
+ export { commandShortcutLabel, useCommandShortcut, useCommandShortcutLabel } from './command-shortcut.hook';
4
+ export { FilterBar, FilterChip } from './filter-bar.component';
5
+ export type { FilterBarProps, FilterChipProps } from './filter-bar.component';
6
+ export { FormSection } from './form-section.component';
7
+ export type { FormSectionProps } from './form-section.component';
8
+ export { PageHeader } from './page-header.component';
9
+ export type { PageHeaderProps } from './page-header.component';
10
+ export { RecordsTable } from './records-table.component';
11
+ export type { RecordsColumn, RecordsTableProps } from './records-table.component';
12
+ export { sparklinePath } from './sparkline.algorithm';
13
+ export { StatCard } from './stat-card.component';
14
+ export type { StatCardProps } from './stat-card.component';
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Props of {@link PageHeader}. */
3
+ export interface PageHeaderProps {
4
+ /** The page title: 22 px, semibold. */
5
+ title: ReactNode;
6
+ /** One line under the title. */
7
+ description?: ReactNode;
8
+ /** Actions at the end, with at most one primary button. */
9
+ actions?: ReactNode;
10
+ /** Underline tabs under the title, for the sections of the page. */
11
+ tabs?: ReactNode;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * The PageHeader pattern of an app page: title, description, actions and optional section tabs.
16
+ *
17
+ * @param props - Title, description, actions and tabs.
18
+ * @returns The header.
19
+ */
20
+ export declare function PageHeader({ title, description, actions, tabs, className }: PageHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import type { ReactNode } from 'react';
2
+ /** A column of a {@link RecordsTable}. */
3
+ export interface RecordsColumn<Row> {
4
+ /** A stable key for the column. */
5
+ key: string;
6
+ /** The heading. */
7
+ header: ReactNode;
8
+ /** Draws the cell of a row. */
9
+ cell: (row: Row) => ReactNode;
10
+ /** `end` for numbers, so digits line up. */
11
+ align?: 'start' | 'end';
12
+ className?: string;
13
+ }
14
+ /** Props of {@link RecordsTable}. */
15
+ export interface RecordsTableProps<Row> {
16
+ /** The rows to show. */
17
+ rows: readonly Row[];
18
+ columns: readonly RecordsColumn<Row>[];
19
+ /** A stable id of a row. */
20
+ getRowId: (row: Row) => string;
21
+ /** The ids of the selected rows. Selection is on when this is given. */
22
+ selected?: ReadonlySet<string>;
23
+ /** Called with the new selection. */
24
+ onSelectedChange?: (selected: Set<string>) => void;
25
+ /** The items of a row's actions menu. */
26
+ rowActions?: (row: Row) => ReactNode;
27
+ /** The accessible name of the table. */
28
+ label: string;
29
+ className?: string;
30
+ }
31
+ /**
32
+ * The RecordsTable pattern: a data table with row selection, a select-all box and a row actions menu.
33
+ * Sorting and virtualisation stay with the caller, which passes the rows to show.
34
+ *
35
+ * @param props - Rows, columns, row ids, selection and row actions.
36
+ * @returns The table.
37
+ */
38
+ export declare function RecordsTable<Row>({ rows, columns, getRowId, selected, onSelectedChange, rowActions, label, className }: RecordsTableProps<Row>): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Builds the SVG path of a sparkline. The series is scaled to fill the box, with the lowest value at the bottom
3
+ * and the highest at the top; a flat series draws a line through the middle.
4
+ *
5
+ * @param values - The series, oldest first. Fewer than two values draws nothing.
6
+ * @param width - The width of the drawing box.
7
+ * @param height - The height of the drawing box.
8
+ * @param inset - Space kept at the top and bottom, so a stroke is not clipped. Default 2.
9
+ * @returns The `d` attribute of a polyline path, or an empty string.
10
+ */
11
+ export declare function sparklinePath(values: readonly number[], width: number, height: number, inset?: number): string;
@@ -0,0 +1,28 @@
1
+ import type { ReactNode } from 'react';
2
+ declare const toneClassName: {
3
+ readonly positive: "text-success";
4
+ readonly negative: "text-destructive";
5
+ readonly neutral: "text-muted-foreground";
6
+ };
7
+ /** Props of {@link StatCard}. */
8
+ export interface StatCardProps {
9
+ /** What the number counts, such as "Runs, 7 days". */
10
+ label: ReactNode;
11
+ /** The number, already formatted. */
12
+ value: ReactNode;
13
+ /** The change, already formatted, such as "+8.2%". */
14
+ delta?: ReactNode;
15
+ /** Whether the change is good, bad or neither. Default neutral. */
16
+ tone?: keyof typeof toneClassName;
17
+ /** A short series for the brand sparkline, oldest first. */
18
+ series?: readonly number[];
19
+ className?: string;
20
+ }
21
+ /**
22
+ * The StatCard pattern: a label, a tabular number, a sparkline in the brand colour, and the change.
23
+ *
24
+ * @param props - Label, value, delta, tone and series.
25
+ * @returns The card.
26
+ */
27
+ export declare function StatCard({ label, value, delta, tone, series, className }: StatCardProps): import("react").JSX.Element;
28
+ export {};
@@ -0,0 +1,8 @@
1
+ import { type ClassValue } from 'clsx';
2
+ /**
3
+ * Joins class names and resolves Tailwind conflicts, so a caller's class wins over a recipe default.
4
+ *
5
+ * @param inputs - Class names, arrays or condition maps, as `clsx` accepts them.
6
+ * @returns One class string in which the last conflicting Tailwind utility wins.
7
+ */
8
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1 @@
1
+ export { cn } from './class-names.algorithm';
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type RunStatus } from '../status';
3
+ import { type Hue } from '../tokens';
4
+ /** Props of {@link FlowNode}. */
5
+ export interface FlowNodeProps {
6
+ /** The node's name, such as a plugin or input. */
7
+ title: string;
8
+ /** One line on what the node does. */
9
+ description: ReactNode;
10
+ status: RunStatus;
11
+ /** The family hue of the node's lane. Default none, for inputs. */
12
+ hue?: Hue;
13
+ /** Draws the brand border of the selected node. */
14
+ selected?: boolean;
15
+ onSelect?: () => void;
16
+ className?: string;
17
+ }
18
+ /**
19
+ * A node on a desktop flow canvas: a 200 px card with the lane dot, the name, the status and one line.
20
+ * Place it absolutely on the canvas; wrap it in a ContextMenuTrigger for its right-click menu.
21
+ *
22
+ * @param props - Title, description, status, hue, selection and select handler.
23
+ * @returns The node.
24
+ */
25
+ export declare function FlowNode({ title, description, status, hue, selected, onSelect, className }: FlowNodeProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export { FlowNode } from './flow-node.component';
2
+ export type { FlowNodeProps } from './flow-node.component';
3
+ export { Inspector } from './inspector.component';
4
+ export type { InspectorProps, InspectorTab } from './inspector.component';
5
+ export { StatusBar } from './status-bar.component';
6
+ export type { StatusBarProps } from './status-bar.component';
7
+ export { timelineBox, timelineTicks } from './timeline.algorithm';
8
+ export type { TimelineBox } from './timeline.algorithm';
9
+ export { TimelineLanes } from './timeline-lanes.component';
10
+ export type { TimelineLane, TimelineLanesProps, TimelineSegment } from './timeline-lanes.component';
11
+ export { TitleBar } from './title-bar.component';
12
+ export type { TitleBarProps } from './title-bar.component';
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type Hue } from '../tokens';
3
+ /** One tab of an {@link Inspector}. */
4
+ export interface InspectorTab {
5
+ value: string;
6
+ label: string;
7
+ content: ReactNode;
8
+ }
9
+ /** Props of {@link Inspector}. */
10
+ export interface InspectorProps {
11
+ /** The selected item, such as a plugin. */
12
+ title: ReactNode;
13
+ /** One line beside the title, such as the version and what it does. */
14
+ subtitle?: ReactNode;
15
+ /** The family hue of the item's dot. */
16
+ hue?: Hue;
17
+ tabs: readonly InspectorTab[];
18
+ /** A panel pinned to the bottom, such as the progress of the running item. */
19
+ footer?: ReactNode;
20
+ className?: string;
21
+ }
22
+ /**
23
+ * The Inspector pattern of a desktop app: the selected item's header, underline tabs, and its settings.
24
+ * Put it in a ResizablePanel so the user can widen it.
25
+ *
26
+ * @param props - Title, subtitle, hue, tabs and footer.
27
+ * @returns The inspector.
28
+ */
29
+ export declare function Inspector({ title, subtitle, hue, tabs, footer, className }: InspectorProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Props of {@link StatusBar}. */
3
+ export interface StatusBarProps {
4
+ /** Items at the start, such as the engine state. */
5
+ start?: ReactNode;
6
+ /** Items at the end, such as the playhead. */
7
+ end?: ReactNode;
8
+ className?: string;
9
+ }
10
+ /**
11
+ * The StatusBar pattern at the foot of a desktop window: 24 px, 12 px muted text, items at both ends.
12
+ * Its content is announced politely when it changes.
13
+ *
14
+ * @param props - Start and end items.
15
+ * @returns The status bar.
16
+ */
17
+ export declare function StatusBar({ start, end, className }: StatusBarProps): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { type Hue } from '../tokens';
2
+ /** A span on a lane. */
3
+ export interface TimelineSegment {
4
+ /** Start, in seconds. */
5
+ start: number;
6
+ /** End, in seconds. */
7
+ end: number;
8
+ /** Shown in a tooltip, such as a speaker or an object. */
9
+ label?: string;
10
+ /** Draws the span faded, for low confidence or a pending result. */
11
+ faint?: boolean;
12
+ }
13
+ /** One lane of {@link TimelineLanes}. */
14
+ export interface TimelineLane {
15
+ name: string;
16
+ /** The family hue of the lane. */
17
+ hue: Hue;
18
+ segments: readonly TimelineSegment[];
19
+ }
20
+ /** Props of {@link TimelineLanes}. */
21
+ export interface TimelineLanesProps {
22
+ /** The length of the media, in seconds. */
23
+ duration: number;
24
+ lanes: readonly TimelineLane[];
25
+ /** The playhead, in seconds. */
26
+ playhead?: number;
27
+ /** How many ruler ticks. Default 8. */
28
+ tickCount?: number;
29
+ /**
30
+ * The clock time at second zero, such as the start of a recording. With it, the ruler and the span names show
31
+ * clock times, such as 09:30. Without it, they show the media time from 00:00.
32
+ */
33
+ startsAt?: Date;
34
+ className?: string;
35
+ }
36
+ /**
37
+ * The Timeline lanes pattern of a desktop media app: a ruler, one lane per result kind with coloured spans,
38
+ * and a playhead. The ruler shows media time, or clock time with `startsAt`.
39
+ *
40
+ * @param props - Duration, lanes, playhead, tick count and the clock start.
41
+ * @returns The timeline.
42
+ */
43
+ export declare function TimelineLanes({ duration, lanes, playhead, tickCount, startsAt, className }: TimelineLanesProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ /** Where a span sits on a timeline, in percent of its width. */
2
+ export interface TimelineBox {
3
+ left: number;
4
+ width: number;
5
+ }
6
+ /**
7
+ * Places a time span on a timeline. The span is clipped to the timeline, so a span past the end stops at 100 %.
8
+ *
9
+ * @param start - The start of the span, in seconds.
10
+ * @param end - The end of the span, in seconds.
11
+ * @param duration - The length of the timeline, in seconds. Zero or less places nothing.
12
+ * @returns The left edge and width, in percent.
13
+ */
14
+ export declare function timelineBox(start: number, end: number, duration: number): TimelineBox;
15
+ /**
16
+ * Gives evenly spaced tick times for a timeline ruler, from zero to the duration.
17
+ *
18
+ * @param duration - The length of the timeline, in seconds.
19
+ * @param count - How many ticks, both ends included. At least two.
20
+ * @returns The tick times, in seconds, rounded to whole seconds.
21
+ */
22
+ export declare function timelineTicks(duration: number, count: number): number[];
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { Product } from '../tokens';
3
+ /** Props of {@link TitleBar}. */
4
+ export interface TitleBarProps {
5
+ /** The product, for the logo. */
6
+ product: Product;
7
+ /** The menus: MenubarMenu elements. */
8
+ menus?: ReactNode;
9
+ /** The window title, such as the open file. */
10
+ title?: ReactNode;
11
+ /** Window controls. Leave them out on macOS, where the system draws them. */
12
+ onMinimise?: () => void;
13
+ onMaximise?: () => void;
14
+ onClose?: () => void;
15
+ className?: string;
16
+ }
17
+ /**
18
+ * The TitleBar pattern of a desktop app (Tauri): the logo, the menubar, the title, and the window controls.
19
+ * The bar is a drag region (`data-tauri-drag-region`), so the user moves the window by it.
20
+ *
21
+ * @param props - Product, menus, title and window control handlers.
22
+ * @returns The title bar.
23
+ */
24
+ export declare function TitleBar({ product, menus, title, onMinimise, onMaximise, onClose, className }: TitleBarProps): import("react").JSX.Element;
package/fonts.css ADDED
@@ -0,0 +1,4 @@
1
+ /* The three Talogic fonts, self-hosted from Fontsource: DM Sans for headlines, Inter for content, Fira Code for code. */
2
+ @import "@fontsource-variable/inter";
3
+ @import "@fontsource-variable/dm-sans";
4
+ @import "@fontsource-variable/fira-code";
package/index.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @talogic/react: the Talogic design system.
3
+ *
4
+ * Tokens and theme switches, shadcn/ui primitives, and patterns for each surface: the website, the web portals,
5
+ * the desktop apps and the mobile apps. Import the styles once: `@talogic/react/tokens.css` after Tailwind, or
6
+ * the compiled `@talogic/react/styles.css` without it.
7
+ */
8
+ export * from './app';
9
+ export * from './desktop';
10
+ export * from './mobile';
11
+ export * from './web';
12
+ export * from './product';
13
+ export * from './status';
14
+ export * from './class-names';
15
+ export * from './timecode';
16
+ export * from './tokens';
17
+ export * from './ui';