@nubitio/ui 0.5.23 → 0.5.24

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.cjs CHANGED
@@ -1315,6 +1315,25 @@ const StatCard = ({ title, headerExtra, menuVisible = true, menuItems = [{ label
1315
1315
  })]
1316
1316
  });
1317
1317
  //#endregion
1318
+ //#region packages/ui/KpiMetricRow.tsx
1319
+ function KpiMetricRow({ items, className = "" }) {
1320
+ if (items.length === 0) return null;
1321
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1322
+ className: `nb-kpi-metric-row${className ? ` ${className}` : ""}`,
1323
+ role: "group",
1324
+ children: items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1325
+ className: `nb-kpi-metric-card nb-kpi-metric-card--${item.tone ?? "default"}`,
1326
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1327
+ className: "nb-kpi-metric-card__label",
1328
+ children: item.label
1329
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1330
+ className: "nb-kpi-metric-card__value",
1331
+ children: item.value
1332
+ })]
1333
+ }, item.label))
1334
+ });
1335
+ }
1336
+ //#endregion
1318
1337
  //#region packages/ui/CollapsibleSection.tsx
1319
1338
  /**
1320
1339
  * Accessible collapsible section with a labelled header trigger.
@@ -2687,6 +2706,7 @@ exports.FeatureGate = FeatureGate;
2687
2706
  exports.FileDropzone = FileDropzone;
2688
2707
  exports.FormField = FormField;
2689
2708
  exports.IconButton = IconButton;
2709
+ exports.KpiMetricRow = KpiMetricRow;
2690
2710
  exports.Popover = Popover;
2691
2711
  exports.SelectField = SelectField;
2692
2712
  exports.SettingsPanel = SettingsPanel;
package/dist/index.d.cts CHANGED
@@ -604,6 +604,22 @@ declare const StatCard: ({
604
604
  children
605
605
  }: StatCardProps) => React$1.JSX.Element;
606
606
  //#endregion
607
+ //#region packages/ui/KpiMetricRow.d.ts
608
+ type KpiMetricTone = 'default' | 'success' | 'warning' | 'danger';
609
+ interface KpiMetricItem {
610
+ label: string;
611
+ value: ReactNode;
612
+ tone?: KpiMetricTone;
613
+ }
614
+ interface KpiMetricRowProps {
615
+ items: KpiMetricItem[];
616
+ className?: string;
617
+ }
618
+ declare function KpiMetricRow({
619
+ items,
620
+ className
621
+ }: KpiMetricRowProps): import("react").JSX.Element | null;
622
+ //#endregion
607
623
  //#region packages/ui/CollapsibleSection.d.ts
608
624
  interface CollapsibleSectionProps {
609
625
  /** Section heading text. */
@@ -901,4 +917,4 @@ interface UiStringsProviderProps {
901
917
  declare const UiStringsProvider: React$1.FC<UiStringsProviderProps>;
902
918
  declare const useUiStrings: () => UiStrings;
903
919
  //#endregion
904
- export { ACCENT_PRESETS, type AccentPreset, AppDialog, type AppDialogProps, AppDropdown, type AppDropdownOption, type AppDropdownProps, type AppDropdownVariant, AppToolbar, type AppToolbarProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Chip, type ChipProps, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, type ContextMenuItem, type ContextMenuProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type Density, DensityContext, type DensityContextValue, DensityProvider, Drawer, type DrawerProps, type DrawerSide, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, type EmptyStateProps, FeatureGate, type FeatureGateProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, type FileDropzoneValue, FormField, type FormFieldProps, IconButton, type IconButtonProps, Popover, type PopoverAlign, type PopoverProps, SelectField, type SelectFieldProps, SettingsPanel, type SettingsPanelProps, Skeleton, type SkeletonProps, StatCard, type StatCardProps, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type Theme, ThemeContext, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeSwitcher, type ThemeSwitcherProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineItemStatus, type TimelineItemTone, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toggle, type ToggleProps, type UiStrings, UiStringsProvider, type UiStringsProviderProps, type UseFloatingPanelOptions, type UseFloatingPanelResult, getAvatarHue, getAvatarInitials, useAccentColor, useDensity, useFloatingPanel, useTheme, useUiStrings };
920
+ export { ACCENT_PRESETS, type AccentPreset, AppDialog, type AppDialogProps, AppDropdown, type AppDropdownOption, type AppDropdownProps, type AppDropdownVariant, AppToolbar, type AppToolbarProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Chip, type ChipProps, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, type ContextMenuItem, type ContextMenuProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type Density, DensityContext, type DensityContextValue, DensityProvider, Drawer, type DrawerProps, type DrawerSide, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, type EmptyStateProps, FeatureGate, type FeatureGateProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, type FileDropzoneValue, FormField, type FormFieldProps, IconButton, type IconButtonProps, type KpiMetricItem, KpiMetricRow, type KpiMetricRowProps, type KpiMetricTone, Popover, type PopoverAlign, type PopoverProps, SelectField, type SelectFieldProps, SettingsPanel, type SettingsPanelProps, Skeleton, type SkeletonProps, StatCard, type StatCardProps, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type Theme, ThemeContext, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeSwitcher, type ThemeSwitcherProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineItemStatus, type TimelineItemTone, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toggle, type ToggleProps, type UiStrings, UiStringsProvider, type UiStringsProviderProps, type UseFloatingPanelOptions, type UseFloatingPanelResult, getAvatarHue, getAvatarInitials, useAccentColor, useDensity, useFloatingPanel, useTheme, useUiStrings };
package/dist/index.d.mts CHANGED
@@ -604,6 +604,22 @@ declare const StatCard: ({
604
604
  children
605
605
  }: StatCardProps) => React$1.JSX.Element;
606
606
  //#endregion
607
+ //#region packages/ui/KpiMetricRow.d.ts
608
+ type KpiMetricTone = 'default' | 'success' | 'warning' | 'danger';
609
+ interface KpiMetricItem {
610
+ label: string;
611
+ value: ReactNode;
612
+ tone?: KpiMetricTone;
613
+ }
614
+ interface KpiMetricRowProps {
615
+ items: KpiMetricItem[];
616
+ className?: string;
617
+ }
618
+ declare function KpiMetricRow({
619
+ items,
620
+ className
621
+ }: KpiMetricRowProps): import("react").JSX.Element | null;
622
+ //#endregion
607
623
  //#region packages/ui/CollapsibleSection.d.ts
608
624
  interface CollapsibleSectionProps {
609
625
  /** Section heading text. */
@@ -901,4 +917,4 @@ interface UiStringsProviderProps {
901
917
  declare const UiStringsProvider: React$1.FC<UiStringsProviderProps>;
902
918
  declare const useUiStrings: () => UiStrings;
903
919
  //#endregion
904
- export { ACCENT_PRESETS, type AccentPreset, AppDialog, type AppDialogProps, AppDropdown, type AppDropdownOption, type AppDropdownProps, type AppDropdownVariant, AppToolbar, type AppToolbarProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Chip, type ChipProps, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, type ContextMenuItem, type ContextMenuProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type Density, DensityContext, type DensityContextValue, DensityProvider, Drawer, type DrawerProps, type DrawerSide, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, type EmptyStateProps, FeatureGate, type FeatureGateProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, type FileDropzoneValue, FormField, type FormFieldProps, IconButton, type IconButtonProps, Popover, type PopoverAlign, type PopoverProps, SelectField, type SelectFieldProps, SettingsPanel, type SettingsPanelProps, Skeleton, type SkeletonProps, StatCard, type StatCardProps, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type Theme, ThemeContext, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeSwitcher, type ThemeSwitcherProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineItemStatus, type TimelineItemTone, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toggle, type ToggleProps, type UiStrings, UiStringsProvider, type UiStringsProviderProps, type UseFloatingPanelOptions, type UseFloatingPanelResult, getAvatarHue, getAvatarInitials, useAccentColor, useDensity, useFloatingPanel, useTheme, useUiStrings };
920
+ export { ACCENT_PRESETS, type AccentPreset, AppDialog, type AppDialogProps, AppDropdown, type AppDropdownOption, type AppDropdownProps, type AppDropdownVariant, AppToolbar, type AppToolbarProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Chip, type ChipProps, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, type ContextMenuItem, type ContextMenuProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type Density, DensityContext, type DensityContextValue, DensityProvider, Drawer, type DrawerProps, type DrawerSide, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, type EmptyStateProps, FeatureGate, type FeatureGateProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, type FileDropzoneValue, FormField, type FormFieldProps, IconButton, type IconButtonProps, type KpiMetricItem, KpiMetricRow, type KpiMetricRowProps, type KpiMetricTone, Popover, type PopoverAlign, type PopoverProps, SelectField, type SelectFieldProps, SettingsPanel, type SettingsPanelProps, Skeleton, type SkeletonProps, StatCard, type StatCardProps, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type Theme, ThemeContext, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeSwitcher, type ThemeSwitcherProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineItemStatus, type TimelineItemTone, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toggle, type ToggleProps, type UiStrings, UiStringsProvider, type UiStringsProviderProps, type UseFloatingPanelOptions, type UseFloatingPanelResult, getAvatarHue, getAvatarInitials, useAccentColor, useDensity, useFloatingPanel, useTheme, useUiStrings };
package/dist/index.mjs CHANGED
@@ -1291,6 +1291,25 @@ const StatCard = ({ title, headerExtra, menuVisible = true, menuItems = [{ label
1291
1291
  })]
1292
1292
  });
1293
1293
  //#endregion
1294
+ //#region packages/ui/KpiMetricRow.tsx
1295
+ function KpiMetricRow({ items, className = "" }) {
1296
+ if (items.length === 0) return null;
1297
+ return /* @__PURE__ */ jsx("div", {
1298
+ className: `nb-kpi-metric-row${className ? ` ${className}` : ""}`,
1299
+ role: "group",
1300
+ children: items.map((item) => /* @__PURE__ */ jsxs("div", {
1301
+ className: `nb-kpi-metric-card nb-kpi-metric-card--${item.tone ?? "default"}`,
1302
+ children: [/* @__PURE__ */ jsx("span", {
1303
+ className: "nb-kpi-metric-card__label",
1304
+ children: item.label
1305
+ }), /* @__PURE__ */ jsx("span", {
1306
+ className: "nb-kpi-metric-card__value",
1307
+ children: item.value
1308
+ })]
1309
+ }, item.label))
1310
+ });
1311
+ }
1312
+ //#endregion
1294
1313
  //#region packages/ui/CollapsibleSection.tsx
1295
1314
  /**
1296
1315
  * Accessible collapsible section with a labelled header trigger.
@@ -2639,4 +2658,4 @@ function Timeline({ variant = "stepper", orientation = "vertical", title, descri
2639
2658
  });
2640
2659
  }
2641
2660
  //#endregion
2642
- export { ACCENT_PRESETS, AppDialog, AppDropdown, AppToolbar, Avatar, Badge, Button, Card, Chip, CollapsibleSection, ConfirmDialog, ContextMenu, DatePicker, DateRangePicker, DensityContext, DensityProvider, Drawer, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, FeatureGate, FileDropzone, FormField, IconButton, Popover, SelectField, SettingsPanel, Skeleton, StatCard, TextAreaField, TextField, ThemeContext, ThemeProvider, ThemeSwitcher, Timeline, TimelineItem, Toggle, UiStringsProvider, getAvatarHue, getAvatarInitials, useAccentColor, useDensity, useFloatingPanel, useTheme, useUiStrings };
2661
+ export { ACCENT_PRESETS, AppDialog, AppDropdown, AppToolbar, Avatar, Badge, Button, Card, Chip, CollapsibleSection, ConfirmDialog, ContextMenu, DatePicker, DateRangePicker, DensityContext, DensityProvider, Drawer, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, FeatureGate, FileDropzone, FormField, IconButton, KpiMetricRow, Popover, SelectField, SettingsPanel, Skeleton, StatCard, TextAreaField, TextField, ThemeContext, ThemeProvider, ThemeSwitcher, Timeline, TimelineItem, Toggle, UiStringsProvider, getAvatarHue, getAvatarInitials, useAccentColor, useDensity, useFloatingPanel, useTheme, useUiStrings };
package/dist/style.css CHANGED
@@ -1871,6 +1871,51 @@ html[data-density=compact] .nb-context-menu__item {
1871
1871
  .nb-stat-card--accented-danger {
1872
1872
  border-left: 3px solid var(--error-color);
1873
1873
  }
1874
+ .nb-kpi-metric-row {
1875
+ display: grid;
1876
+ gap: var(--space-3);
1877
+ grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
1878
+ width: 100%;
1879
+ }
1880
+
1881
+ .nb-kpi-metric-card {
1882
+ background: var(--surface-1);
1883
+ border: 1px solid var(--border-subtle);
1884
+ border-radius: var(--radius-lg);
1885
+ display: flex;
1886
+ flex-direction: column;
1887
+ gap: var(--space-1);
1888
+ min-width: 0;
1889
+ padding: var(--space-3) var(--space-4);
1890
+ }
1891
+
1892
+ .nb-kpi-metric-card__label {
1893
+ color: var(--text-secondary);
1894
+ font-size: 0.72rem;
1895
+ font-weight: 600;
1896
+ letter-spacing: 0.04em;
1897
+ text-transform: uppercase;
1898
+ }
1899
+
1900
+ .nb-kpi-metric-card__value {
1901
+ color: var(--text-primary);
1902
+ font-size: 1.35rem;
1903
+ font-variant-numeric: tabular-nums;
1904
+ font-weight: 700;
1905
+ line-height: 1.2;
1906
+ }
1907
+
1908
+ .nb-kpi-metric-card--success .nb-kpi-metric-card__value {
1909
+ color: var(--color-success, #16a34a);
1910
+ }
1911
+
1912
+ .nb-kpi-metric-card--warning .nb-kpi-metric-card__value {
1913
+ color: var(--color-warning, #d97706);
1914
+ }
1915
+
1916
+ .nb-kpi-metric-card--danger .nb-kpi-metric-card__value {
1917
+ color: var(--color-error, #dc2626);
1918
+ }
1874
1919
  .nb-collapsible__header {
1875
1920
  display: flex;
1876
1921
  align-items: stretch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nubitio/ui",
3
- "version": "0.5.23",
3
+ "version": "0.5.24",
4
4
  "type": "module",
5
5
  "description": "Visual primitives and theme system for the Nubit admin stack (dialogs, cards, toolbar, light/dark theme).",
6
6
  "license": "MIT",