@axzydev/axzy_ui_system 1.3.2 → 1.3.3

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "packageManager": "pnpm@10.34.0",
5
5
  "private": false,
6
6
  "license": "MIT",
7
- "version": "1.3.2",
7
+ "version": "1.3.3",
8
8
  "type": "module",
9
9
  "sideEffects": [
10
10
  "*.css"
@@ -21,6 +21,7 @@ import {
21
21
  tableActionsCell,
22
22
  tableBody,
23
23
  tableCardClickable,
24
+ tableCardHover,
24
25
  tableCell,
25
26
  tableCellText,
26
27
  tableContainer,
@@ -441,7 +442,7 @@ export default function ITTable<T extends Record<string, unknown>>({
441
442
  currentData.map((row, i) => (
442
443
  <div
443
444
  key={i}
444
- className={clsx(onRowClick && tableCardClickable)}
445
+ className={clsx(tableCardHover, onRowClick && tableCardClickable)}
445
446
  role={onRowClick ? "button" : undefined}
446
447
  tabIndex={onRowClick ? 0 : undefined}
447
448
  onClick={onRowClick ? handleRowClick(row) : undefined}
@@ -17,6 +17,7 @@ import {
17
17
  tableActionsCell,
18
18
  tableBody,
19
19
  tableCardClickable,
20
+ tableCardHover,
20
21
  tableCell,
21
22
  tableCellText,
22
23
  tableContainer,
@@ -551,7 +552,7 @@ export default function ITDataTable<T extends Record<string, unknown>>({
551
552
  data.map((row, i) => (
552
553
  <div
553
554
  key={i}
554
- className={clsx(onRowClick && !isLoading && tableCardClickable)}
555
+ className={clsx(tableCardHover, onRowClick && !isLoading && tableCardClickable)}
555
556
  role={onRowClick && !isLoading ? "button" : undefined}
556
557
  tabIndex={onRowClick && !isLoading ? 0 : undefined}
557
558
  onClick={onRowClick && !isLoading ? handleRowClick(row) : undefined}
@@ -21,6 +21,7 @@ export const DEFAULT_PALETTE: ITThemePalette = {
21
21
  headerText: "#334155", // Slate-700
22
22
  rowBg: "#ffffff", // White
23
23
  rowText: "#1e293b", // Slate-800
24
+ rowHover: "#f1f5f9", // Slate-100
24
25
  },
25
26
  };
26
27
 
@@ -48,6 +49,7 @@ export const PRESETS: { name: string; colors: ITThemePalette }[] = [
48
49
  headerText: "#334155",
49
50
  rowBg: "#ffffff",
50
51
  rowText: "#0f172a",
52
+ rowHover: "#1e293b",
51
53
  },
52
54
  },
53
55
  },
@@ -73,6 +75,7 @@ export const PRESETS: { name: string; colors: ITThemePalette }[] = [
73
75
  headerText: "#881337",
74
76
  rowBg: "#ffffff",
75
77
  rowText: "#1c1212",
78
+ rowHover: "#fff1f2",
76
79
  },
77
80
  },
78
81
  },
@@ -98,6 +101,7 @@ export const PRESETS: { name: string; colors: ITThemePalette }[] = [
98
101
  headerText: "#115e59",
99
102
  rowBg: "#ffffff",
100
103
  rowText: "#042f2e",
104
+ rowHover: "#f0fdfa",
101
105
  },
102
106
  },
103
107
  },
@@ -123,6 +127,7 @@ export const PRESETS: { name: string; colors: ITThemePalette }[] = [
123
127
  headerText: "#713f12",
124
128
  rowBg: "#ffffff",
125
129
  rowText: "#292524",
130
+ rowHover: "#fefce8",
126
131
  },
127
132
  },
128
133
  },
@@ -148,6 +153,7 @@ export const PRESETS: { name: string; colors: ITThemePalette }[] = [
148
153
  headerText: "#166534",
149
154
  rowBg: "#ffffff",
150
155
  rowText: "#052e16",
156
+ rowHover: "#f0fdf4",
151
157
  },
152
158
  },
153
159
  },
@@ -38,6 +38,7 @@ Root theme context that injects CSS custom properties into the entire component
38
38
  | `table.headerText` | `string` | Table header text color. |
39
39
  | `table.rowBg` | `string` | Table row background color. |
40
40
  | `table.rowText` | `string` | Table row text color. |
41
+ | `table.rowHover` | `string` | Table row background color while hovering a row. |
41
42
 
42
43
  ## Usage
43
44
 
@@ -36,6 +36,8 @@ export interface ITThemePalette {
36
36
  rowBg: string;
37
37
  /** Text color of table body rows. @default "#1e293b" */
38
38
  rowText: string;
39
+ /** Background color applied to a table body row while the pointer is over it (hex). @default "#f1f5f9" */
40
+ rowHover: string;
39
41
  };
40
42
  }
41
43
 
@@ -364,6 +364,7 @@ export default function ITThemeProvider({
364
364
  let tableRowText = palette.table.rowText;
365
365
  let tableHeaderBg = palette.table.headerBg;
366
366
  let tableHeaderText = palette.table.headerText;
367
+ let tableRowHover = palette.table.rowHover;
367
368
  let navbarBg = palette.layout.navbarBg;
368
369
  let navbarText = palette.layout.navbarText;
369
370
  let sidebarBg = palette.layout.sidebarBg;
@@ -382,6 +383,9 @@ export default function ITThemeProvider({
382
383
  if (!isLightColor(tableHeaderText)) {
383
384
  tableHeaderText = `color-mix(in srgb, ${palette.table.headerText} 20%, #f9fafb)`;
384
385
  }
386
+ if (isLightColor(tableRowHover)) {
387
+ tableRowHover = `color-mix(in srgb, ${palette.table.rowHover} 12%, #1f2937)`;
388
+ }
385
389
  if (isLightColor(navbarBg)) {
386
390
  navbarBg = `color-mix(in srgb, ${palette.layout.navbarBg} 8%, #111827)`;
387
391
  }
@@ -419,10 +423,15 @@ export default function ITThemeProvider({
419
423
  tableHeaderText = `color-mix(in srgb, ${palette.table.headerText} 30%, #334155)`;
420
424
  } else if (
421
425
  !isLightColor(tableHeaderText) &&
422
- isVeryDarkColor(palette.table.headerText)
426
+ isVeryDarkColor(tableHeaderText)
423
427
  ) {
424
428
  // Dark header text is fine for light mode
425
429
  }
430
+ if (!isLightColor(tableRowHover)) {
431
+ tableRowHover = isVeryDarkColor(palette.table.rowHover)
432
+ ? "#f1f5f9"
433
+ : `color-mix(in srgb, ${palette.table.rowHover} 12%, #f8fafc)`;
434
+ }
426
435
  if (!isLightColor(navbarBg)) {
427
436
  navbarBg = isVeryDarkColor(palette.layout.navbarBg)
428
437
  ? "#ffffff"
@@ -637,6 +646,7 @@ export default function ITThemeProvider({
637
646
  --color-table-headerText: ${tableHeaderText} !important;
638
647
  --color-table-rowBg: ${tableRowBg} !important;
639
648
  --color-table-rowText: ${tableRowText} !important;
649
+ --color-table-rowHover: ${tableRowHover} !important;
640
650
 
641
651
  /* Native library variables integration */
642
652
  --it-sidebar-bg: var(--color-sidebarBg);
@@ -980,7 +990,7 @@ export default function ITThemeProvider({
980
990
  color: var(--color-table-rowText) !important;
981
991
  }
982
992
  tbody tr:hover {
983
- background-color: color-mix(in srgb, var(--color-primary) 8%, var(--color-table-rowBg)) !important;
993
+ background-color: var(--color-table-rowHover) !important;
984
994
  }
985
995
 
986
996
  /* Animation for Saved Indicator */
@@ -1781,6 +1791,7 @@ export default function ITThemeProvider({
1781
1791
  "table.headerText",
1782
1792
  "table.rowBg",
1783
1793
  "table.rowText",
1794
+ "table.rowHover",
1784
1795
  ].map((key) => (
1785
1796
  <ColorRow key={key} colorKey={key} />
1786
1797
  ))}