@tensor_1/react 2.19.1 → 2.20.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
@@ -544,8 +544,14 @@ interface TabsProps {
544
544
  onChange?: (value: string) => void;
545
545
  children?: ReactNode;
546
546
  className?: string;
547
+ /**
548
+ * What happens when the tabs don't fit. `'wrap'` (default) keeps today's layout.
549
+ * `'scroll'` keeps one row that scrolls sideways, with pointer-only edge buttons
550
+ * shown on the side that has hidden tabs. The selected tab is always scrolled into view.
551
+ */
552
+ overflow?: 'wrap' | 'scroll';
547
553
  }
548
- declare function Tabs({ variant, value, onChange, children, className }: TabsProps): react.JSX.Element;
554
+ declare function Tabs({ variant, value, onChange, children, className, overflow }: TabsProps): react.JSX.Element;
549
555
  interface TabProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange'> {
550
556
  value: string;
551
557
  children?: ReactNode;
@@ -664,6 +670,28 @@ interface StarButtonProps {
664
670
  */
665
671
  declare function StarButton({ pinned, label, addLabel, onToggle, className, }: StarButtonProps): react.JSX.Element;
666
672
 
673
+ interface CopyButtonProps {
674
+ /** The text written to the clipboard. */
675
+ value: string;
676
+ /** Accessible name of the button, e.g. "Copy email". */
677
+ label: string;
678
+ /** Announced through a polite status region after a successful copy, e.g. "Copied". */
679
+ copiedLabel: string;
680
+ /**
681
+ * Announced when the copy fails (no clipboard, or the write was refused), e.g.
682
+ * "Could not copy — select the text instead". Without it a failure is silent: nothing
683
+ * false is shown, but the person is left guessing why nothing happened.
684
+ */
685
+ failedLabel?: string;
686
+ className?: string;
687
+ }
688
+ /**
689
+ * Icon-only ghost button that copies `value`. On success it shows a check for 1.5 s and
690
+ * announces `copiedLabel`. On failure (no clipboard, or the write was refused) it shows no
691
+ * check and announces `failedLabel` when one is given.
692
+ */
693
+ declare function CopyButton({ value, label, copiedLabel, failedLabel, className }: CopyButtonProps): react.JSX.Element;
694
+
667
695
  interface NavFavouriteItem {
668
696
  /** Stable identity used for reorder + remove (consumers typically pass the href). */
669
697
  readonly id: string;
@@ -878,7 +906,7 @@ interface StatTrend {
878
906
  direction: 'up' | 'down';
879
907
  label: ReactNode;
880
908
  }
881
- interface StatProps extends HTMLAttributes<HTMLDivElement> {
909
+ interface StatProps extends HTMLAttributes<HTMLElement> {
882
910
  label: ReactNode;
883
911
  value: ReactNode;
884
912
  /** Optional icon shown at the trailing edge of the label row. */
@@ -887,9 +915,25 @@ interface StatProps extends HTMLAttributes<HTMLDivElement> {
887
915
  meta?: ReactNode;
888
916
  /** Trend chip rendered before the meta text. */
889
917
  trend?: StatTrend;
918
+ /** Outline and value colour. `neutral` (default) is today's tile. */
919
+ tone?: 'neutral' | 'warning' | 'danger';
920
+ /** `hero` (default) is today's KPI size; `compact` is for dense fact bands. */
921
+ size?: 'hero' | 'compact';
922
+ /**
923
+ * Makes the whole tile a `<button>` that opens an editor (a popover or dialog). It gets
924
+ * `aria-haspopup="dialog"` and a trailing chevron.
925
+ */
926
+ onActivate?: () => void;
927
+ /** Action word appended to the accessible name, e.g. "change" → "Priority: P1, change". */
928
+ activateLabel?: string;
929
+ /** Whether the editor this tile opens is currently open (`aria-expanded`). */
930
+ expanded?: boolean;
890
931
  }
891
- /** KPI / stat tile over `.uix-stat`. */
892
- declare function Stat({ label, value, icon, meta, trend, className, ...props }: StatProps): react.JSX.Element;
932
+ /**
933
+ * KPI / stat tile over `.uix-stat`. With `onActivate` the tile is a button; the forwarded
934
+ * ref then points at that button, so a popover can anchor to it.
935
+ */
936
+ declare const Stat: react.ForwardRefExoticComponent<StatProps & react.RefAttributes<HTMLElement>>;
893
937
 
894
938
  interface TooltipProps extends HTMLAttributes<HTMLSpanElement> {
895
939
  /** Tooltip text. */
@@ -2321,4 +2365,4 @@ declare function hsvToHex(value: HsvColor): string;
2321
2365
  declare function contrastRatio(background: string, foreground: string): number | undefined;
2322
2366
  declare function meetsContrast(background: string, foreground: string, minimum?: number): boolean;
2323
2367
 
2324
- export { type AccessStateProps, Alert, type AlertProps, type AlertTone, AppShell, type AppShellProps, type AppliedBrandProfileSnapshot, type AsyncOperationState, AsyncOperationStatus, type AsyncOperationStatusProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type BoundedRelationshipGraph, type BrandProfile, BrandProfileEditor, type BrandProfileEditorProps, type BrandProfileLogo, type BrandProfileTypography, BrandProfiles, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BuilderCanvas, type BuilderCanvasItem, type BuilderCanvasProps, type BuilderPaletteItem, BulkBar, type BulkBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CalendarDay, Card, CardLink, type CardLinkProps, type CardProps, CellStrong, CellSub, Checkbox, type CheckboxProps, CollapsibleSection, type CollapsibleSectionProps, ColorPicker, type ColorPickerProps, type ColumnFilter, Combobox, type ComboboxOption, type ComboboxProps, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, Comment, type CommentProps, Comments, type CommentsProps, Composer, ComposerBar, type ComposerBarProps, type ComposerProps, ConfirmDialog, type ConfirmDialogProps, ContentList, ContentListItem, type ContentListItemProps, type ContentListProps, DEFAULT_RELATIONSHIP_GRAPH_LABELS, DEFAULT_SAVE_STATUS_LABELS, DateRangePicker, type DateRangePickerProps, type DateRangeValue, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListItem, type DescriptionListProps, DetailLayout, type DetailLayoutProps, DetailPage, type DetailPageMetric, type DetailPageProps, type DetailPageTab, type DiffEntry, type DiffKind, type DiffResolution, type DiffSummary, DiffViewer, type DiffViewerProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, EventRow, type EventRowProps, ExpandToggle, type ExpandToggleProps, FeaturedRundown, FeaturedRundownItem, type FeaturedRundownItemProps, type FeaturedRundownProps, FeaturedStage, type FeaturedStageProps, Field, type FieldProps, type FilterKind, type FilterOp, type FilterOption, FilterPopover, type FilterPopoverProps, FilteredEmptyState, type FlatNode, Flow, FlowNode, type FlowNodeProps, type FlowNodeState, type FlowProps, type FlowVariant, ForbiddenState, Highlighted, type HighlightedProps, type HsvColor, Inbox, InboxDetail, type InboxDetailProps, InboxItem, type InboxItemProps, InboxList, type InboxListProps, type InboxProps, Input, InputGroup, type InputGroupProps, type InputProps, type JsonPrimitive, type JsonValue, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, type KanbanMoveDirection, type KanbanProps, Label, type LabelProps, type LayeredColumn, type LayeredEdgeClassification, type LayeredEdgeKind, type LayeredItem, type LayeredLayout, type LayeredLayoutOptions, type LayeredNavigationKey, LicensePositionBar, type LicensePositionBarProps, List, ListItem, type ListItemProps, type ListProps, LoadingState, type LoadingStateProps, Mark, type MarkProps, type MatchBulkResult, MatchReview, type MatchReviewAction, type MatchReviewCandidate, type MatchReviewField, type MatchReviewProps, Meter, type MeterProps, type MeterTone, MetricInput, type MetricInputProps, Modal, type ModalProps, type NavFavouriteItem, NavFavourites, type NavFavouritesLabels, type NavFavouritesProps, NavGroup, type NavGroupProps, NavItem, type NavItemProps, NewsLead, type NewsLeadProps, NotFoundState, Note, type NoteProps, type NoteTone, NoticeQueue, type NoticeQueueProps, PageHeader, type PageHeaderProps, PageIntro, type PageIntroProps, Pagination, type PaginationProps, Peek, type PeekProps, type PillTone, type PillTreatment, Pipeline, type PipelineProps, PipelineStage, type PipelineStageProps, type PipelineStageState, Placement, Popover, type PopoverProps, type PositionedRelationshipNode, type Primitive, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Prose, type ProseProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RelatedLinkItem, RelatedLinks, type RelatedLinksProps, RelationshipGraph, type RelationshipGraphArrow, type RelationshipGraphCluster, type RelationshipGraphEdge, type RelationshipGraphLabels, type RelationshipGraphLegendItem, type RelationshipGraphNode, type RelationshipGraphProps, RelativeTime, type RelativeTimeFormatContext, type RelativeTimeProps, type RelativeTimeUnit, type RelativeTimeValue, ResourceGrid, type ResourceGridProps, type RgbColor, type RoutedEdge, type Row, RowAction, type RowActionProps, RowActions, type RowActionsProps, type RuleAction, type RuleActionDefinition, RuleBuilder, type RuleBuilderProps, type RuleCondition, type RuleDefinition, type RuleFieldDefinition, type RuleGroup, type RuleOperatorDefinition, type RuleValidationIssue, type RuleValueEditorProps, SaveStatus, type SaveStatusLabels, type SaveStatusProps, type SaveStatusState, type SavedViewItem, SavedViewMenu, type SavedViewMenuProps, SchedulingCalendar, type SchedulingCalendarEntry, type SchedulingCalendarOverlay, type SchedulingCalendarProps, type SchedulingCalendarView, type SchedulingEntryState, type SchedulingOverlayKind, SectionHead, type SectionHeadProps, type Segment, Segmented, SegmentedOption, type SegmentedOptionProps, type SegmentedProps, Select, type SelectAllState, type SelectProps, type ShellNav, Sidebar, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SortDir, type SortDirection, type SortKey, Spinner, type SpinnerProps, StarButton, type StarButtonProps, Stat, StatLine, type StatLineItem, type StatLineProps, type StatProps, type StatTrend, type StateVariant, StatusPill, type StatusPillProps, StatusRow, type StatusRowProps, SubNavItem, type SubNavItemProps, Switch, type SwitchProps, Tab, TabPanel, type TabPanelProps, 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, ToggleRow, type ToggleRowProps, Tooltip, type TooltipProps, Tr, type TrProps, Tree, type TreeLike, type TreeNavAction, type TreeNodeData, type TreeNodeProps, type TreeProps, type UseAnchoredPositionOptions, type UseTableOptions, type UseTableResult, type UseVirtualRowsOptions, type UseVirtualRowsResult, UserChip, type UserChipProps, ViewMenu, type ViewMenuColumn, type ViewMenuProps, type ViewState, type VirtualWindow, type ZonedDateSpan, addCalendarDays, addCalendarMonths, appendRuleNode, applyBrandProfile, applyFilters, boundRelationshipGraph, buildMonthGrid, buildThreeWayDiff, clampMetricValue, clampWidth, classifyLayeredEdges, clusterIdFor, contrastRatio, cx, enumerateDateSpan, filterComboboxOptions, findRuleNodeDepth, flattenTree, hexToRgb, highlightSegments, hsvToHex, hsvToRgb, isDateInRange, isDateUnavailable, isRuleGroup, layeredNeighbor, layoutLayeredGraph, layoutRelationshipGraph, mapRuleGroup, matchFilter, meetsContrast, mergePinned, moveRuleNode, multiSort, nextSortDir, normalizeHex, parseDateValue, parseMetricValue, parseView, relationshipNeighbors, relativeTimeValue, removeRuleNode, reorder, restoreBrandProfile, rgbToHex, rgbToHsv, ruleDepth, searchRows, selectAllState, selectRangeDate, serializeView, shouldVirtualize, startOfMonth, stepMetricValue, summarizeDiff, summarizeRule, toDateKey, toggleId, togglePage, toggleSort, traverseRelationshipNode, treeNav, useAnchoredPosition, useDialog, useTable, useVirtualRows, validateRuleDefinition, virtualWindow, wrapEdgeLabel, zonedDateKey, zonedDateSpan };
2368
+ export { type AccessStateProps, Alert, type AlertProps, type AlertTone, AppShell, type AppShellProps, type AppliedBrandProfileSnapshot, type AsyncOperationState, AsyncOperationStatus, type AsyncOperationStatusProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type BoundedRelationshipGraph, type BrandProfile, BrandProfileEditor, type BrandProfileEditorProps, type BrandProfileLogo, type BrandProfileTypography, BrandProfiles, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BuilderCanvas, type BuilderCanvasItem, type BuilderCanvasProps, type BuilderPaletteItem, BulkBar, type BulkBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CalendarDay, Card, CardLink, type CardLinkProps, type CardProps, CellStrong, CellSub, Checkbox, type CheckboxProps, CollapsibleSection, type CollapsibleSectionProps, ColorPicker, type ColorPickerProps, type ColumnFilter, Combobox, type ComboboxOption, type ComboboxProps, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, Comment, type CommentProps, Comments, type CommentsProps, Composer, ComposerBar, type ComposerBarProps, type ComposerProps, ConfirmDialog, type ConfirmDialogProps, ContentList, ContentListItem, type ContentListItemProps, type ContentListProps, CopyButton, type CopyButtonProps, DEFAULT_RELATIONSHIP_GRAPH_LABELS, DEFAULT_SAVE_STATUS_LABELS, DateRangePicker, type DateRangePickerProps, type DateRangeValue, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListItem, type DescriptionListProps, DetailLayout, type DetailLayoutProps, DetailPage, type DetailPageMetric, type DetailPageProps, type DetailPageTab, type DiffEntry, type DiffKind, type DiffResolution, type DiffSummary, DiffViewer, type DiffViewerProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, EventRow, type EventRowProps, ExpandToggle, type ExpandToggleProps, FeaturedRundown, FeaturedRundownItem, type FeaturedRundownItemProps, type FeaturedRundownProps, FeaturedStage, type FeaturedStageProps, Field, type FieldProps, type FilterKind, type FilterOp, type FilterOption, FilterPopover, type FilterPopoverProps, FilteredEmptyState, type FlatNode, Flow, FlowNode, type FlowNodeProps, type FlowNodeState, type FlowProps, type FlowVariant, ForbiddenState, Highlighted, type HighlightedProps, type HsvColor, Inbox, InboxDetail, type InboxDetailProps, InboxItem, type InboxItemProps, InboxList, type InboxListProps, type InboxProps, Input, InputGroup, type InputGroupProps, type InputProps, type JsonPrimitive, type JsonValue, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, type KanbanMoveDirection, type KanbanProps, Label, type LabelProps, type LayeredColumn, type LayeredEdgeClassification, type LayeredEdgeKind, type LayeredItem, type LayeredLayout, type LayeredLayoutOptions, type LayeredNavigationKey, LicensePositionBar, type LicensePositionBarProps, List, ListItem, type ListItemProps, type ListProps, LoadingState, type LoadingStateProps, Mark, type MarkProps, type MatchBulkResult, MatchReview, type MatchReviewAction, type MatchReviewCandidate, type MatchReviewField, type MatchReviewProps, Meter, type MeterProps, type MeterTone, MetricInput, type MetricInputProps, Modal, type ModalProps, type NavFavouriteItem, NavFavourites, type NavFavouritesLabels, type NavFavouritesProps, NavGroup, type NavGroupProps, NavItem, type NavItemProps, NewsLead, type NewsLeadProps, NotFoundState, Note, type NoteProps, type NoteTone, NoticeQueue, type NoticeQueueProps, PageHeader, type PageHeaderProps, PageIntro, type PageIntroProps, Pagination, type PaginationProps, Peek, type PeekProps, type PillTone, type PillTreatment, Pipeline, type PipelineProps, PipelineStage, type PipelineStageProps, type PipelineStageState, Placement, Popover, type PopoverProps, type PositionedRelationshipNode, type Primitive, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Prose, type ProseProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RelatedLinkItem, RelatedLinks, type RelatedLinksProps, RelationshipGraph, type RelationshipGraphArrow, type RelationshipGraphCluster, type RelationshipGraphEdge, type RelationshipGraphLabels, type RelationshipGraphLegendItem, type RelationshipGraphNode, type RelationshipGraphProps, RelativeTime, type RelativeTimeFormatContext, type RelativeTimeProps, type RelativeTimeUnit, type RelativeTimeValue, ResourceGrid, type ResourceGridProps, type RgbColor, type RoutedEdge, type Row, RowAction, type RowActionProps, RowActions, type RowActionsProps, type RuleAction, type RuleActionDefinition, RuleBuilder, type RuleBuilderProps, type RuleCondition, type RuleDefinition, type RuleFieldDefinition, type RuleGroup, type RuleOperatorDefinition, type RuleValidationIssue, type RuleValueEditorProps, SaveStatus, type SaveStatusLabels, type SaveStatusProps, type SaveStatusState, type SavedViewItem, SavedViewMenu, type SavedViewMenuProps, SchedulingCalendar, type SchedulingCalendarEntry, type SchedulingCalendarOverlay, type SchedulingCalendarProps, type SchedulingCalendarView, type SchedulingEntryState, type SchedulingOverlayKind, SectionHead, type SectionHeadProps, type Segment, Segmented, SegmentedOption, type SegmentedOptionProps, type SegmentedProps, Select, type SelectAllState, type SelectProps, type ShellNav, Sidebar, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SortDir, type SortDirection, type SortKey, Spinner, type SpinnerProps, StarButton, type StarButtonProps, Stat, StatLine, type StatLineItem, type StatLineProps, type StatProps, type StatTrend, type StateVariant, StatusPill, type StatusPillProps, StatusRow, type StatusRowProps, SubNavItem, type SubNavItemProps, Switch, type SwitchProps, Tab, TabPanel, type TabPanelProps, 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, ToggleRow, type ToggleRowProps, Tooltip, type TooltipProps, Tr, type TrProps, Tree, type TreeLike, type TreeNavAction, type TreeNodeData, type TreeNodeProps, type TreeProps, type UseAnchoredPositionOptions, type UseTableOptions, type UseTableResult, type UseVirtualRowsOptions, type UseVirtualRowsResult, UserChip, type UserChipProps, ViewMenu, type ViewMenuColumn, type ViewMenuProps, type ViewState, type VirtualWindow, type ZonedDateSpan, addCalendarDays, addCalendarMonths, appendRuleNode, applyBrandProfile, applyFilters, boundRelationshipGraph, buildMonthGrid, buildThreeWayDiff, clampMetricValue, clampWidth, classifyLayeredEdges, clusterIdFor, contrastRatio, cx, enumerateDateSpan, filterComboboxOptions, findRuleNodeDepth, flattenTree, hexToRgb, highlightSegments, hsvToHex, hsvToRgb, isDateInRange, isDateUnavailable, isRuleGroup, layeredNeighbor, layoutLayeredGraph, layoutRelationshipGraph, mapRuleGroup, matchFilter, meetsContrast, mergePinned, moveRuleNode, multiSort, nextSortDir, normalizeHex, parseDateValue, parseMetricValue, parseView, relationshipNeighbors, relativeTimeValue, removeRuleNode, reorder, restoreBrandProfile, rgbToHex, rgbToHsv, ruleDepth, searchRows, selectAllState, selectRangeDate, serializeView, shouldVirtualize, startOfMonth, stepMetricValue, summarizeDiff, summarizeRule, toDateKey, toggleId, togglePage, toggleSort, traverseRelationshipNode, treeNav, useAnchoredPosition, useDialog, useTable, useVirtualRows, validateRuleDefinition, virtualWindow, wrapEdgeLabel, zonedDateKey, zonedDateSpan };
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export { Tab, TabPanel, TabPanelProps, TabProps, Tabs, TabsProps } from './compo
32
32
  export { AppShell, AppShellProps, ShellNav } from './components/AppShell.js';
33
33
  export { NavGroup, NavGroupProps, NavItem, NavItemProps, Sidebar, SidebarProps, SidebarSection, SidebarSectionProps, SubNavItem, SubNavItemProps } from './components/Sidebar.js';
34
34
  export { StarButton, StarButtonProps } from './components/StarButton.js';
35
+ export { CopyButton, CopyButtonProps } from './components/CopyButton.js';
35
36
  export { NavFavouriteItem, NavFavourites, NavFavouritesLabels, NavFavouritesProps } from './components/NavFavourites.js';
36
37
  export { Alert, AlertProps, AlertTone } from './components/Alert.js';
37
38
  export { Spinner, SpinnerProps } from './components/Spinner.js';
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ import { Tabs, Tab, TabPanel } from "./components/Tabs.js";
32
32
  import { AppShell } from "./components/AppShell.js";
33
33
  import { Sidebar, SidebarSection, NavItem, NavGroup, SubNavItem } from "./components/Sidebar.js";
34
34
  import { StarButton } from "./components/StarButton.js";
35
+ import { CopyButton } from "./components/CopyButton.js";
35
36
  import { NavFavourites } from "./components/NavFavourites.js";
36
37
  import { Alert } from "./components/Alert.js";
37
38
  import { Spinner } from "./components/Spinner.js";
@@ -164,6 +165,7 @@ export {
164
165
  ConfirmDialog,
165
166
  ContentList,
166
167
  ContentListItem,
168
+ CopyButton,
167
169
  DEFAULT_RELATIONSHIP_GRAPH_LABELS,
168
170
  DEFAULT_SAVE_STATUS_LABELS,
169
171
  DateRangePicker,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tensor_1/react",
3
- "version": "2.19.1",
3
+ "version": "2.20.0",
4
4
  "description": "Thin React wrappers over the UIx v2 CSS component library.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",