@payglocal_ui/flux-ui 0.2.5 → 0.2.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payglocal_ui/flux-ui",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Flux UI primitives — inputs, fields, dialog, data table, charts, calendar, and more (Tailwind v4 + Radix).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -239,6 +239,16 @@ export function DataTable<T>({
239
239
  return seen === 0 ? base : `${base}__${seen}`;
240
240
  });
241
241
 
242
+ /**
243
+ * No rows to show. The width hints are dropped in this state: a grid whose
244
+ * columns carry minimums (via `colgroup` in fixed layout, or `cellClassName`
245
+ * in the others) would otherwise have its HEADER row alone force the table
246
+ * past the container and raise a horizontal scrollbar — over an empty region
247
+ * with nothing to scroll to. Headers still render, at their natural width, so
248
+ * the shape of the missing data is still legible.
249
+ */
250
+ const isEmpty = !isLoading && paginated.length === 0;
251
+
242
252
  const comfortable = density === "comfortable";
243
253
  const compact = density === "compact";
244
254
  const compactCellPad = compact
@@ -331,7 +341,7 @@ export function DataTable<T>({
331
341
  width: "100%",
332
342
  }}
333
343
  >
334
- {tableLayout === "fixed" && (
344
+ {tableLayout === "fixed" && !isEmpty && (
335
345
  <colgroup>
336
346
  {hasExpand ? <col style={{ width: 40 }} /> : null}
337
347
  {columns.map((col) => (
@@ -376,7 +386,8 @@ export function DataTable<T>({
376
386
  : col.align === "center"
377
387
  ? "text-center"
378
388
  : "text-left",
379
- col.cellClassName
389
+ // Width hints live in `cellClassName`; see `isEmpty`.
390
+ !isEmpty && col.cellClassName
380
391
  )}
381
392
  >
382
393
  {col.header}
@@ -19,7 +19,9 @@ const DropdownMenuSubTrigger = React.forwardRef<
19
19
  <DropdownMenuPrimitive.SubTrigger
20
20
  ref={ref}
21
21
  className={cn(
22
- "flex cursor-default select-none items-center gap-2 rounded-lg px-3 py-2.5 text-[15px] outline-none",
22
+ // Matches DropdownMenuItem: a submenu row sits in the same list as the
23
+ // plain rows, so it cannot be a different size from them.
24
+ "flex cursor-default select-none items-center gap-2 rounded-lg px-2.5 py-1.5 text-[13px] outline-none",
23
25
  "focus:bg-muted data-[state=open]:bg-muted",
24
26
  inset && "pl-8",
25
27
  className
@@ -94,7 +96,9 @@ const DropdownMenuCheckboxItem = React.forwardRef<
94
96
  <DropdownMenuPrimitive.CheckboxItem
95
97
  ref={ref}
96
98
  className={cn(
97
- "relative flex cursor-default select-none items-center rounded-lg py-2 pl-8 pr-2 text-sm outline-none transition-colors",
99
+ // Matches DropdownMenuItem. `pl-8` stays: that gutter is the check /
100
+ // dot indicator's, not padding.
101
+ "relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2.5 text-[13px] outline-none transition-colors",
98
102
  "focus:bg-muted focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
99
103
  className
100
104
  )}
@@ -118,7 +122,9 @@ const DropdownMenuRadioItem = React.forwardRef<
118
122
  <DropdownMenuPrimitive.RadioItem
119
123
  ref={ref}
120
124
  className={cn(
121
- "relative flex cursor-default select-none items-center rounded-lg py-2 pl-8 pr-2 text-sm outline-none transition-colors",
125
+ // Matches DropdownMenuItem. `pl-8` stays: that gutter is the check /
126
+ // dot indicator's, not padding.
127
+ "relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2.5 text-[13px] outline-none transition-colors",
122
128
  "focus:bg-muted focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
123
129
  className
124
130
  )}