@tensor_1/react 2.3.0 → 2.5.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/dist/index.d.cts CHANGED
@@ -262,6 +262,91 @@ interface SubNavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
262
262
  }
263
263
  declare function SubNavItem({ active, as: Tag, children, className, ...props }: SubNavItemProps): react.JSX.Element;
264
264
 
265
+ interface StarButtonProps {
266
+ /** Pinned state — drives the filled, warning-toned, always-visible look via `data-on`. */
267
+ pinned: boolean;
268
+ /** Item label, interpolated into the accessible name. */
269
+ label: string;
270
+ /**
271
+ * Accessible-name template carrying a `{label}` placeholder. ONE state model:
272
+ * a STATIC name ("Add {label} to favourites") plus `aria-pressed` reflecting
273
+ * the pinned state — never a dynamic Pin/Remove name AND `aria-pressed` (that
274
+ * double-encodes the state). Defaults to `Add {label} to favourites`.
275
+ */
276
+ addLabel?: string;
277
+ /** Called with the next pinned state when the control is activated. */
278
+ onToggle: (next: boolean) => void;
279
+ /** Extra classes — e.g. consumer-owned reveal triggers when the row is not a `.uix-navitem`. */
280
+ className?: string;
281
+ }
282
+ /**
283
+ * Controlled pin/unpin star for a nav item. UIx owns the look (the
284
+ * `.uix-navitem__star` contract: reveal-on-hover inside a `.uix-navitem`,
285
+ * warning-toned fill when pinned); the consumer owns the pinned state.
286
+ *
287
+ * Reveal-on-hover is opacity-only (zeroed under `prefers-reduced-motion`).
288
+ * When the star lives outside a `.uix-navitem` row, pass reveal triggers via
289
+ * `className`.
290
+ */
291
+ declare function StarButton({ pinned, label, addLabel, onToggle, className, }: StarButtonProps): react.JSX.Element;
292
+
293
+ interface NavFavouriteItem {
294
+ /** Stable identity used for reorder + remove (consumers typically pass the href). */
295
+ readonly id: string;
296
+ /** Display label, interpolated into the per-row remove / options accessible names. */
297
+ readonly label: string;
298
+ /** The destination control, rendered by the consumer so routing + link styling stay app-owned. */
299
+ readonly link: ReactNode;
300
+ }
301
+ interface NavFavouritesLabels {
302
+ /** Disclosure header, e.g. "Favourites". */
303
+ readonly heading: string;
304
+ /** Shown when there are no favourites. */
305
+ readonly empty: string;
306
+ readonly moveUp: string;
307
+ readonly moveDown: string;
308
+ /** Per-row remove action template with a `{label}` placeholder, e.g. "Remove {label} from favourites". */
309
+ readonly remove: string;
310
+ /** Per-row overflow-trigger accessible-name template with `{label}`. Defaults to "{label} favourite options". */
311
+ readonly options?: string;
312
+ }
313
+ interface NavFavouritesProps {
314
+ /** The already-resolved favourites, in display order. */
315
+ items: ReadonlyArray<NavFavouriteItem>;
316
+ collapsed?: boolean;
317
+ onToggleCollapsed?: () => void;
318
+ /** Called with the id of the favourite to unpin. */
319
+ onRemove: (id: string) => void;
320
+ /** Called with the full new id order after a move. */
321
+ onReorder: (orderedIds: string[]) => void;
322
+ labels: NavFavouritesLabels;
323
+ /** Optional telemetry hook emitted as `data-empty-reason` on the empty-state node. */
324
+ emptyReason?: string;
325
+ className?: string;
326
+ }
327
+ /**
328
+ * Controlled Favourites disclosure for a sidebar nav (UIx owns the look + the
329
+ * APG interaction contract; the consumer owns the favourites list + persistence).
330
+ *
331
+ * An ARIA disclosure exactly like a collapsible nav group: a header button with
332
+ * `aria-expanded`/`aria-controls`, the region always rendered with a stable id
333
+ * and toggled via `hidden`, focus pulled to the header before collapse.
334
+ *
335
+ * Each row carries the consumer-rendered destination link plus:
336
+ * - an overflow menu (APG menu-button: button + `aria-haspopup="menu"` +
337
+ * `aria-expanded`; Up/Down roving focus; Escape returns focus to the
338
+ * trigger) with Move up / Move down / Remove,
339
+ * - Alt+ArrowUp / Alt+ArrowDown accelerators on the focused row so moves
340
+ * chain without re-opening the menu.
341
+ *
342
+ * Focus management:
343
+ * - after Remove, focus moves to the adjacent favourite, or to the header
344
+ * when the list empties,
345
+ * - after Move up/down, focus stays on the moved row's control in its new
346
+ * position.
347
+ */
348
+ declare function NavFavourites({ items, collapsed, onToggleCollapsed, onRemove, onReorder, labels, emptyReason, className, }: NavFavouritesProps): react.JSX.Element;
349
+
265
350
  type AlertTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
266
351
  interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
267
352
  tone?: AlertTone;
@@ -329,7 +414,7 @@ interface PaginationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange
329
414
  }
330
415
  declare function Pagination({ page, pageCount, onChange, className, ...props }: PaginationProps): react.JSX.Element;
331
416
 
332
- type PillTone = 'neutral' | 'success' | 'info' | 'warning' | 'danger' | 'critical' | 'muted';
417
+ type PillTone = 'neutral' | 'success' | 'info' | 'warning' | 'danger' | 'critical' | 'muted' | 'attention' | 'overdue' | 'sla-ok' | 'sla-at-risk' | 'sla-breached' | 'p1' | 'p2' | 'p3' | 'p4' | 'p5';
333
418
  type PillTreatment = 'filled' | 'outline';
334
419
  interface StatusPillProps extends HTMLAttributes<HTMLSpanElement> {
335
420
  tone?: PillTone;
@@ -350,6 +435,17 @@ interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
350
435
  }
351
436
  declare function Progress({ value, max, indeterminate, className, ...props }: ProgressProps): react.JSX.Element;
352
437
 
438
+ /** Fill color tone for the meter bar. Defaults to `success` (green). */
439
+ type MeterTone = 'success' | 'warning' | 'danger' | 'attention' | 'overdue';
440
+ interface MeterProps extends HTMLAttributes<HTMLDivElement> {
441
+ /** Fill level 0–100. Clamped to this range. */
442
+ value?: number;
443
+ /** Threshold tone applied via `data-tone` on the fill element. `success` is the implicit default (no attribute). */
444
+ tone?: MeterTone;
445
+ }
446
+ /** Horizontal utilization / threshold bar backed by `.uix-meter`. */
447
+ declare function Meter({ value, tone, className, ...props }: MeterProps): react.JSX.Element;
448
+
353
449
  interface StatTrend {
354
450
  direction: 'up' | 'down';
355
451
  label: ReactNode;
@@ -532,6 +628,37 @@ interface CommandItemProps extends HTMLAttributes<HTMLDivElement> {
532
628
  /** A single command row over `.uix-cmdk__item`. */
533
629
  declare function CommandItem({ icon, shortcut, active, children, className, ...props }: CommandItemProps): react.JSX.Element;
534
630
 
631
+ interface InboxProps extends HTMLAttributes<HTMLDivElement> {
632
+ children?: ReactNode;
633
+ }
634
+ /** Two-pane inbox master-detail container backed by `.uix-inbox`. Place `<InboxList>` and `<InboxDetail>` as children. */
635
+ declare function Inbox({ children, className, ...props }: InboxProps): react.JSX.Element;
636
+ interface InboxListProps extends HTMLAttributes<HTMLDivElement> {
637
+ children?: ReactNode;
638
+ }
639
+ /** Left-pane item list. Place `<InboxItem>` children here. */
640
+ declare function InboxList({ children, className, ...props }: InboxListProps): react.JSX.Element;
641
+ interface InboxItemProps extends HTMLAttributes<HTMLDivElement> {
642
+ /** Primary subject / title line. */
643
+ subject?: ReactNode;
644
+ /** Secondary preview excerpt (truncated). */
645
+ preview?: ReactNode;
646
+ /** Leading slot — avatar, icon, or priority indicator. */
647
+ leading?: ReactNode;
648
+ /** When true sets `data-unread` → bolds the subject line. */
649
+ unread?: boolean;
650
+ /** When true sets `aria-selected` → renders the accent left-border stripe. */
651
+ selected?: boolean;
652
+ children?: ReactNode;
653
+ }
654
+ /** A single inbox row with subject, preview excerpt, optional leading slot, and unread/selected states. */
655
+ declare function InboxItem({ subject, preview, leading, unread, selected, children, className, ...props }: InboxItemProps): react.JSX.Element;
656
+ interface InboxDetailProps extends HTMLAttributes<HTMLDivElement> {
657
+ children?: ReactNode;
658
+ }
659
+ /** Right-pane detail area — renders the full content of the selected item. */
660
+ declare function InboxDetail({ children, className, ...props }: InboxDetailProps): react.JSX.Element;
661
+
535
662
  interface KanbanProps extends HTMLAttributes<HTMLDivElement> {
536
663
  children?: ReactNode;
537
664
  }
@@ -573,4 +700,4 @@ interface TreeProps extends Omit<HTMLAttributes<HTMLUListElement>, 'onSelect' |
573
700
  }
574
701
  declare function Tree({ nodes, expanded: controlledExpanded, defaultExpanded, selected, onToggle, onSelect, className, ...props }: TreeProps): react.JSX.Element;
575
702
 
576
- export { Alert, type AlertProps, type AlertTone, AppShell, type AppShellProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, Comment, type CommentProps, Comments, type CommentsProps, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListItem, type DescriptionListProps, DetailLayout, type DetailLayoutProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, Field, type FieldProps, Input, InputGroup, type InputGroupProps, type InputProps, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, type KanbanProps, Label, type LabelProps, List, ListItem, type ListItemProps, type ListProps, LoadingState, type LoadingStateProps, Modal, type ModalProps, NavGroup, type NavGroupProps, NavItem, type NavItemProps, Note, type NoteProps, type NoteTone, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Peek, type PeekProps, type PillTone, type PillTreatment, Popover, type PopoverProps, Progress, type ProgressProps, Prose, type ProseProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, type SelectProps, Sidebar, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SortDirection, Spinner, type SpinnerProps, Stat, type StatProps, type StatTrend, StatusPill, type StatusPillProps, SubNavItem, type SubNavItemProps, Switch, type SwitchProps, Tab, type TabProps, Table, type TableDensity, type TableProps, TableWrap, type TableWrapProps, Tabs, type TabsProps, Td, type TdProps, Textarea, type TextareaProps, Th, type ThProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineProps, Toast, type ToastProps, type ToastTone, Toaster, type ToasterProps, Tooltip, type TooltipProps, Tr, type TrProps, Tree, type TreeNodeData, type TreeNodeProps, type TreeProps, UserChip, type UserChipProps, cx, useDialog };
703
+ export { Alert, type AlertProps, type AlertTone, AppShell, type AppShellProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, Comment, type CommentProps, Comments, type CommentsProps, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListItem, type DescriptionListProps, DetailLayout, type DetailLayoutProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, Field, type FieldProps, Inbox, InboxDetail, type InboxDetailProps, InboxItem, type InboxItemProps, InboxList, type InboxListProps, type InboxProps, Input, InputGroup, type InputGroupProps, type InputProps, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, type KanbanProps, Label, type LabelProps, List, ListItem, type ListItemProps, type ListProps, LoadingState, type LoadingStateProps, Meter, type MeterProps, type MeterTone, Modal, type ModalProps, type NavFavouriteItem, NavFavourites, type NavFavouritesLabels, type NavFavouritesProps, NavGroup, type NavGroupProps, NavItem, type NavItemProps, Note, type NoteProps, type NoteTone, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Peek, type PeekProps, type PillTone, type PillTreatment, Popover, type PopoverProps, Progress, type ProgressProps, Prose, type ProseProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, type SelectProps, Sidebar, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SortDirection, Spinner, type SpinnerProps, StarButton, type StarButtonProps, Stat, type StatProps, type StatTrend, StatusPill, type StatusPillProps, SubNavItem, type SubNavItemProps, Switch, type SwitchProps, Tab, type TabProps, Table, type TableDensity, type TableProps, TableWrap, type TableWrapProps, Tabs, type TabsProps, Td, type TdProps, Textarea, type TextareaProps, Th, type ThProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineProps, Toast, type ToastProps, type ToastTone, Toaster, type ToasterProps, Tooltip, type TooltipProps, Tr, type TrProps, Tree, type TreeNodeData, type TreeNodeProps, type TreeProps, UserChip, type UserChipProps, cx, useDialog };
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ export { DescriptionItem, DescriptionItemProps, DescriptionList, DescriptionList
19
19
  export { Tab, TabProps, Tabs, TabsProps } from './components/Tabs.js';
20
20
  export { AppShell, AppShellProps } from './components/AppShell.js';
21
21
  export { NavGroup, NavGroupProps, NavItem, NavItemProps, Sidebar, SidebarProps, SidebarSection, SidebarSectionProps, SubNavItem, SubNavItemProps } from './components/Sidebar.js';
22
+ export { StarButton, StarButtonProps } from './components/StarButton.js';
23
+ export { NavFavouriteItem, NavFavourites, NavFavouritesLabels, NavFavouritesProps } from './components/NavFavourites.js';
22
24
  export { Alert, AlertProps, AlertTone } from './components/Alert.js';
23
25
  export { Spinner, SpinnerProps } from './components/Spinner.js';
24
26
  export { Toast, ToastProps, ToastTone, Toaster, ToasterProps } from './components/Toast.js';
@@ -26,6 +28,7 @@ export { SortDirection, Table, TableDensity, TableProps, TableWrap, TableWrapPro
26
28
  export { Pagination, PaginationProps } from './components/Pagination.js';
27
29
  export { PillTone, PillTreatment, StatusPill, StatusPillProps } from './components/StatusPill.js';
28
30
  export { Progress, ProgressProps } from './components/Progress.js';
31
+ export { Meter, MeterProps, MeterTone } from './components/Meter.js';
29
32
  export { Stat, StatProps, StatTrend } from './components/Stat.js';
30
33
  export { Tooltip, TooltipProps } from './components/Tooltip.js';
31
34
  export { EmptyState, EmptyStateProps, ErrorState, ErrorStateProps, LoadingState, LoadingStateProps, Skeleton, SkeletonProps } from './components/States.js';
@@ -36,6 +39,7 @@ export { Timeline, TimelineItem, TimelineItemProps, TimelineProps } from './comp
36
39
  export { Note, NoteProps, NoteTone, Prose, ProseProps } from './components/Prose.js';
37
40
  export { Popover, PopoverProps } from './components/Popover.js';
38
41
  export { CommandGroup, CommandGroupProps, CommandItem, CommandItemProps, CommandPalette, CommandPaletteProps } from './components/CommandPalette.js';
42
+ export { Inbox, InboxDetail, InboxDetailProps, InboxItem, InboxItemProps, InboxList, InboxListProps, InboxProps } from './components/Inbox.js';
39
43
  export { Kanban, KanbanCard, KanbanCardProps, KanbanColumn, KanbanColumnProps, KanbanProps } from './components/Kanban.js';
40
44
  export { Tree, TreeNodeData, TreeNodeProps, TreeProps } from './components/Tree.js';
41
45
  import 'react';
package/dist/index.js CHANGED
@@ -19,6 +19,8 @@ import { DescriptionList, DescriptionItem } from "./components/DescriptionList.j
19
19
  import { Tabs, Tab } from "./components/Tabs.js";
20
20
  import { AppShell } from "./components/AppShell.js";
21
21
  import { Sidebar, SidebarSection, NavItem, NavGroup, SubNavItem } from "./components/Sidebar.js";
22
+ import { StarButton } from "./components/StarButton.js";
23
+ import { NavFavourites } from "./components/NavFavourites.js";
22
24
  import { Alert } from "./components/Alert.js";
23
25
  import { Spinner } from "./components/Spinner.js";
24
26
  import { Toast, Toaster } from "./components/Toast.js";
@@ -26,6 +28,7 @@ import { TableWrap, Table, Th, Td, Tr } from "./components/Table.js";
26
28
  import { Pagination } from "./components/Pagination.js";
27
29
  import { StatusPill } from "./components/StatusPill.js";
28
30
  import { Progress } from "./components/Progress.js";
31
+ import { Meter } from "./components/Meter.js";
29
32
  import { Stat } from "./components/Stat.js";
30
33
  import { Tooltip } from "./components/Tooltip.js";
31
34
  import { EmptyState, ErrorState, Skeleton, LoadingState } from "./components/States.js";
@@ -36,6 +39,7 @@ import { Timeline, TimelineItem } from "./components/Timeline.js";
36
39
  import { Prose, Note } from "./components/Prose.js";
37
40
  import { Popover } from "./components/Popover.js";
38
41
  import { CommandPalette, CommandGroup, CommandItem } from "./components/CommandPalette.js";
42
+ import { Inbox, InboxList, InboxItem, InboxDetail } from "./components/Inbox.js";
39
43
  import { Kanban, KanbanColumn, KanbanCard } from "./components/Kanban.js";
40
44
  import { Tree } from "./components/Tree.js";
41
45
  export {
@@ -59,6 +63,10 @@ export {
59
63
  EmptyState,
60
64
  ErrorState,
61
65
  Field,
66
+ Inbox,
67
+ InboxDetail,
68
+ InboxItem,
69
+ InboxList,
62
70
  Input,
63
71
  InputGroup,
64
72
  Kanban,
@@ -68,7 +76,9 @@ export {
68
76
  List,
69
77
  ListItem,
70
78
  LoadingState,
79
+ Meter,
71
80
  Modal,
81
+ NavFavourites,
72
82
  NavGroup,
73
83
  NavItem,
74
84
  Note,
@@ -85,6 +95,7 @@ export {
85
95
  SidebarSection,
86
96
  Skeleton,
87
97
  Spinner,
98
+ StarButton,
88
99
  Stat,
89
100
  StatusPill,
90
101
  SubNavItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tensor_1/react",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Thin React wrappers over the UIx v2 CSS component library.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",