@nubitio/ui 0.5.23 → 0.5.26

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
@@ -760,7 +760,13 @@ function setThemeToDOM(href) {
760
760
  link.setAttribute("data-theme-href", href);
761
761
  document.head.appendChild(link);
762
762
  }
763
- link.onload = () => resolve();
763
+ const timer = setTimeout(resolve, 5e3);
764
+ const settle = () => {
765
+ clearTimeout(timer);
766
+ resolve();
767
+ };
768
+ link.onload = settle;
769
+ link.onerror = settle;
764
770
  });
765
771
  }
766
772
  function applyThemeAttributes(theme, themePrefix) {
@@ -1315,6 +1321,25 @@ const StatCard = ({ title, headerExtra, menuVisible = true, menuItems = [{ label
1315
1321
  })]
1316
1322
  });
1317
1323
  //#endregion
1324
+ //#region packages/ui/KpiMetricRow.tsx
1325
+ function KpiMetricRow({ items, className = "" }) {
1326
+ if (items.length === 0) return null;
1327
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1328
+ className: `nb-kpi-metric-row${className ? ` ${className}` : ""}`,
1329
+ role: "group",
1330
+ children: items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1331
+ className: `nb-kpi-metric-card nb-kpi-metric-card--${item.tone ?? "default"}`,
1332
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1333
+ className: "nb-kpi-metric-card__label",
1334
+ children: item.label
1335
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1336
+ className: "nb-kpi-metric-card__value",
1337
+ children: item.value
1338
+ })]
1339
+ }, item.label))
1340
+ });
1341
+ }
1342
+ //#endregion
1318
1343
  //#region packages/ui/CollapsibleSection.tsx
1319
1344
  /**
1320
1345
  * Accessible collapsible section with a labelled header trigger.
@@ -2687,6 +2712,7 @@ exports.FeatureGate = FeatureGate;
2687
2712
  exports.FileDropzone = FileDropzone;
2688
2713
  exports.FormField = FormField;
2689
2714
  exports.IconButton = IconButton;
2715
+ exports.KpiMetricRow = KpiMetricRow;
2690
2716
  exports.Popover = Popover;
2691
2717
  exports.SelectField = SelectField;
2692
2718
  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
@@ -736,7 +736,13 @@ function setThemeToDOM(href) {
736
736
  link.setAttribute("data-theme-href", href);
737
737
  document.head.appendChild(link);
738
738
  }
739
- link.onload = () => resolve();
739
+ const timer = setTimeout(resolve, 5e3);
740
+ const settle = () => {
741
+ clearTimeout(timer);
742
+ resolve();
743
+ };
744
+ link.onload = settle;
745
+ link.onerror = settle;
740
746
  });
741
747
  }
742
748
  function applyThemeAttributes(theme, themePrefix) {
@@ -1291,6 +1297,25 @@ const StatCard = ({ title, headerExtra, menuVisible = true, menuItems = [{ label
1291
1297
  })]
1292
1298
  });
1293
1299
  //#endregion
1300
+ //#region packages/ui/KpiMetricRow.tsx
1301
+ function KpiMetricRow({ items, className = "" }) {
1302
+ if (items.length === 0) return null;
1303
+ return /* @__PURE__ */ jsx("div", {
1304
+ className: `nb-kpi-metric-row${className ? ` ${className}` : ""}`,
1305
+ role: "group",
1306
+ children: items.map((item) => /* @__PURE__ */ jsxs("div", {
1307
+ className: `nb-kpi-metric-card nb-kpi-metric-card--${item.tone ?? "default"}`,
1308
+ children: [/* @__PURE__ */ jsx("span", {
1309
+ className: "nb-kpi-metric-card__label",
1310
+ children: item.label
1311
+ }), /* @__PURE__ */ jsx("span", {
1312
+ className: "nb-kpi-metric-card__value",
1313
+ children: item.value
1314
+ })]
1315
+ }, item.label))
1316
+ });
1317
+ }
1318
+ //#endregion
1294
1319
  //#region packages/ui/CollapsibleSection.tsx
1295
1320
  /**
1296
1321
  * Accessible collapsible section with a labelled header trigger.
@@ -2639,4 +2664,4 @@ function Timeline({ variant = "stepper", orientation = "vertical", title, descri
2639
2664
  });
2640
2665
  }
2641
2666
  //#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 };
2667
+ 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.26",
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",