@nimbus-ds/patterns 1.32.0 → 1.33.1

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.ts CHANGED
@@ -1477,6 +1477,129 @@ export interface ChatInputProperties {
1477
1477
  }
1478
1478
  export type ChatInputProps = ChatInputProperties & Omit<BoxProperties, "children" | "display"> & HTMLAttributes<HTMLElement>;
1479
1479
  export declare const ChatInput: React.FC<ChatInputProps> & ChatInputComponents;
1480
+ /** Trend direction for the indicator (up, down, or neutral). */
1481
+ export type TrendDirection = "up" | "down" | "neutral";
1482
+ /**
1483
+ * Props for the SummaryStatsItem component.
1484
+ *
1485
+ * Defines the props used to render a single stat: a primary value, description,
1486
+ * optional trend indicator, optional tooltip, and optional expandable content
1487
+ * (children). Used by the SummaryStatsItem component to display one metric in
1488
+ * a summary stats row.
1489
+ *
1490
+ * @see SummaryStatsItem - Component that consumes these props.
1491
+ * @property children - Optional ReactNode rendered in the expandable area when this stat is active.
1492
+ */
1493
+ export interface SummaryStatsItemProperties {
1494
+ /**
1495
+ * The main value to display (e.g., "$0.00", "156").
1496
+ */
1497
+ value: string;
1498
+ /**
1499
+ * Brief text that identifies the metric.
1500
+ */
1501
+ description: string;
1502
+ /**
1503
+ * Trend indicator showing the change direction.
1504
+ */
1505
+ trend?: TrendDirection;
1506
+ /**
1507
+ * Text describing the trend or change (e.g., "+15%", "-5%", "0%").
1508
+ */
1509
+ trendText?: string;
1510
+ /**
1511
+ * Tooltip content for the info icon. If provided, displays an info icon.
1512
+ */
1513
+ infoTooltip?: string;
1514
+ /**
1515
+ * Content to display when this stat is active (for expandable variant).
1516
+ * This content will be rendered in the expandable area below the stats row.
1517
+ * @TJS-type React.ReactNode
1518
+ */
1519
+ children?: ReactNode;
1520
+ }
1521
+ export type SummaryStatsItemProps = SummaryStatsItemProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
1522
+ declare const SummaryStatsItem: React.FC<SummaryStatsItemProps>;
1523
+ /**
1524
+ * Layout variant for the SummaryStats container.
1525
+ * - "horizontal": single row (optionally with scroll/expand).
1526
+ * - "grid": 2-column grid.
1527
+ */
1528
+ export type SummaryStatsLayout = "horizontal" | "grid";
1529
+ /**
1530
+ * Subcomponents exposed on SummaryStats (e.g. SummaryStats.Item).
1531
+ * Use {@link SummaryStatsItem} for the Item subcomponent type and API.
1532
+ */
1533
+ export interface SummaryStatsComponents {
1534
+ Item: typeof SummaryStatsItem;
1535
+ }
1536
+ /**
1537
+ * Props specific to SummaryStats. Children should be {@link SummaryStatsItem}
1538
+ * nodes (SummaryStats.Item). Layout is "horizontal" (default) or "grid".
1539
+ * Defaults: layout "horizontal", expandable false.
1540
+ *
1541
+ * Supports both controlled and uncontrolled modes for the active stat:
1542
+ * - **Uncontrolled** (default): omit `activeStatId` and the component manages
1543
+ * active state internally.
1544
+ * - **Controlled**: pass `activeStatId` and `onActiveStatIdChange` to manage
1545
+ * the active stat externally (e.g. for routing, analytics, or persistence).
1546
+ */
1547
+ export interface SummaryStatsProperties {
1548
+ /**
1549
+ * Content to be rendered inside the SummaryStats component.
1550
+ * Composed of SummaryStats.Item subcomponents.
1551
+ * @TJS-type React.ReactNode
1552
+ */
1553
+ children: ReactNode;
1554
+ /**
1555
+ * Layout variant for the stats container.
1556
+ * - "horizontal": Items in a single row (2-6 items recommended).
1557
+ * - "grid": Items in a 2-column grid layout (2 or 4 items recommended).
1558
+ * @default "horizontal"
1559
+ */
1560
+ layout?: SummaryStatsLayout;
1561
+ /**
1562
+ * Enables expandable mode where stats can be clicked to show additional content.
1563
+ * @default false
1564
+ */
1565
+ expandable?: boolean;
1566
+ /**
1567
+ * The id of the currently active stat (controlled mode).
1568
+ * When provided, the component becomes controlled and `onActiveStatIdChange`
1569
+ * should be used to handle state changes. Pass `null` for no active stat.
1570
+ */
1571
+ activeStatId?: string | null;
1572
+ /**
1573
+ * Callback fired when the active stat changes (controlled mode).
1574
+ * Receives the new active stat id, or `null` when the active stat is deselected.
1575
+ */
1576
+ onActiveStatIdChange?: (activeStatId: string | null) => void;
1577
+ }
1578
+ /**
1579
+ * Full props for SummaryStats: {@link SummaryStatsProperties} plus HTML element
1580
+ * attributes (excluding color). Use for the root SummaryStats component.
1581
+ */
1582
+ export type SummaryStatsProps = SummaryStatsProperties & Omit<HTMLAttributes<HTMLElement>, "color">;
1583
+ /**
1584
+ * SummaryStats displays a set of stat blocks in a configurable layout. Use
1585
+ * {@link SummaryStatsProps} for the full props type and {@link SummaryStatsComponents}
1586
+ * for the compound component API (e.g. SummaryStats.Item).
1587
+ *
1588
+ * Layout can be horizontal (single row, optionally with scroll/expand) or grid
1589
+ * (2-column). When layout is "horizontal" and expandable is true, clicking a
1590
+ * stat toggles an expanded area below showing that stat's extra content.
1591
+ *
1592
+ * @param props - See SummaryStatsProps
1593
+ * @param props.className - Optional CSS class for the root element
1594
+ * @param props.style - Optional inline styles for the root element
1595
+ * @param props.children - Stat items, typically SummaryStats.Item components
1596
+ * @param props.layout - "horizontal" (default) or "grid"; controls row vs grid layout
1597
+ * @param props.expandable - When true and layout is horizontal, stats are expandable
1598
+ * @param props.activeStatId - Optional. Controlled active stat id. Pass `null` for none.
1599
+ * @param props.onActiveStatIdChange - Optional. Callback when active stat changes.
1600
+ * @param props.rest - Remaining HTML element attributes (spread to root Box)
1601
+ */
1602
+ export declare const SummaryStats: React.FC<SummaryStatsProps> & SummaryStatsComponents;
1480
1603
  export interface MenuExpandContextValue {
1481
1604
  /** True when the menu is expanded; false when collapsed. */
1482
1605
  expanded: boolean;