@nimbus-ds/patterns 1.39.1 → 1.40.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.ts CHANGED
@@ -1864,6 +1864,13 @@ export interface SummaryStatsItemProperties {
1864
1864
  * Brief text that identifies the metric.
1865
1865
  */
1866
1866
  description: string;
1867
+ /**
1868
+ * Whether this stat is expandable (interactive). When unset, the stat
1869
+ * inherits the `expandable` value of the SummaryStats container. An explicit
1870
+ * `true` or `false` overrides the container value. Ignored in the "grid"
1871
+ * layout. Set it to `false` on stats without children so they stay static.
1872
+ */
1873
+ expandable?: boolean;
1867
1874
  /**
1868
1875
  * Trend indicator showing the change direction.
1869
1876
  */
@@ -1925,6 +1932,8 @@ export interface SummaryStatsProperties {
1925
1932
  layout?: SummaryStatsLayout;
1926
1933
  /**
1927
1934
  * Enables expandable mode where stats can be clicked to show additional content.
1935
+ * This is the default for every SummaryStats.Item; an item can override it with
1936
+ * its own `expandable` prop. Ignored in the "grid" layout.
1928
1937
  * @default false
1929
1938
  */
1930
1939
  expandable?: boolean;
@@ -1935,8 +1944,10 @@ export interface SummaryStatsProperties {
1935
1944
  */
1936
1945
  activeStatId?: string | null;
1937
1946
  /**
1938
- * Callback fired when the active stat changes (controlled mode).
1939
- * Receives the new active stat id, or `null` when the active stat is deselected.
1947
+ * Callback fired when the user toggles a stat, in both controlled and
1948
+ * uncontrolled modes. Receives the new active stat id, or `null` when the
1949
+ * active stat is deselected. It is not fired when the active stat unmounts,
1950
+ * loses its children, or becomes static.
1940
1951
  */
1941
1952
  onActiveStatIdChange?: (activeStatId: string | null) => void;
1942
1953
  }
@@ -1953,6 +1964,9 @@ export type SummaryStatsProps = SummaryStatsProperties & Omit<HTMLAttributes<HTM
1953
1964
  * Layout can be horizontal (single row, optionally with scroll/expand) or grid
1954
1965
  * (2-column). When layout is "horizontal" and expandable is true, clicking a
1955
1966
  * stat toggles an expanded area below showing that stat's extra content.
1967
+ * Each SummaryStats.Item can override the container value with its own
1968
+ * `expandable` prop, so static and interactive stats can share a row. Arrow
1969
+ * keys move focus between the interactive stats of the same row.
1956
1970
  *
1957
1971
  * @param props - See SummaryStatsProps
1958
1972
  * @param props.className - Optional CSS class for the root element