@underverse-ui/underverse 1.0.162 → 1.0.163

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "1.0.162",
3
+ "version": "1.0.163",
4
4
  "sourceEntry": "src/index.ts",
5
5
  "totalExports": 232,
6
6
  "exports": [
package/dist/index.cjs CHANGED
@@ -23149,6 +23149,16 @@ function getHeaderBgColor(colorTag) {
23149
23149
  if (!rgb) return colorTag;
23150
23150
  return toRgba(rgb[0], rgb[1], rgb[2], 1);
23151
23151
  }
23152
+ function getReadableForeground(colorTag) {
23153
+ const rgb = parseColor(colorTag);
23154
+ if (!rgb) return void 0;
23155
+ const toLinear = (c) => {
23156
+ const s = c / 255;
23157
+ return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
23158
+ };
23159
+ const L = 0.2126 * toLinear(rgb[0]) + 0.7152 * toLinear(rgb[1]) + 0.0722 * toLinear(rgb[2]);
23160
+ return L > 0.5 ? "rgba(15, 23, 42, 0.92)" : "rgba(255, 255, 255, 0.95)";
23161
+ }
23152
23162
  function groupColumnsByColorTag(leafCols, colorGroups) {
23153
23163
  const groupsMap = /* @__PURE__ */ new Map();
23154
23164
  const ungrouped = [];
@@ -23210,7 +23220,8 @@ function DataTableHeader({
23210
23220
  getStickyHeaderClass,
23211
23221
  getStickyHeaderCellStyle,
23212
23222
  sortByLabel,
23213
- t
23223
+ t,
23224
+ columnColorGroups
23214
23225
  }) {
23215
23226
  const gi18n = useGlobalI18n();
23216
23227
  const renderFilterControl = import_react30.default.useCallback(
@@ -23359,7 +23370,7 @@ function DataTableHeader({
23359
23370
  title: gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}`,
23360
23371
  className: cn(
23361
23372
  "p-1.5 rounded-lg transition-all duration-200 hover:bg-accent",
23362
- filters[col.key] ? "bg-accent text-primary" : "text-muted-foreground"
23373
+ filters[col.key] ? "bg-accent opacity-100" : "opacity-60 hover:opacity-100"
23363
23374
  ),
23364
23375
  "aria-label": gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}`,
23365
23376
  children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react36.Filter, { className: "w-4 h-4" })
@@ -23428,6 +23439,7 @@ function DataTableHeader({
23428
23439
  const showBorderLeft = columnDividers && cellIndex > 0 && !isAfterFixedLeft && !col.fixed;
23429
23440
  const isLastCell = cellIndex === row.length - 1;
23430
23441
  const headerBackgroundColor = isLeaf && col.colorTag ? getHeaderBgColor(col.colorTag) : "var(--muted)";
23442
+ const headerColor = isLeaf && col.colorTag ? columnColorGroups?.[col.colorTag]?.headerTextColor ?? getReadableForeground(col.colorTag) : void 0;
23431
23443
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
23432
23444
  TableHead,
23433
23445
  {
@@ -23437,6 +23449,7 @@ function DataTableHeader({
23437
23449
  style: {
23438
23450
  width: col.width,
23439
23451
  backgroundColor: headerBackgroundColor,
23452
+ color: headerColor,
23440
23453
  ...getStickyHeaderCellStyle(headerCell)
23441
23454
  },
23442
23455
  className: cn(
@@ -24484,7 +24497,8 @@ function DataTable({
24484
24497
  getStickyHeaderClass,
24485
24498
  getStickyHeaderCellStyle,
24486
24499
  sortByLabel: labels?.sortBy,
24487
- t
24500
+ t,
24501
+ columnColorGroups
24488
24502
  }
24489
24503
  ) }),
24490
24504
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(