@undevy-org/tablewright 0.7.3 → 0.7.4

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
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { ChevronDown, SunMoon, LogOut } from "lucide-react";
3
- import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from "../ui/dropdown-menu.js";
3
+ import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from "../ui/dropdown-menu.js";
4
4
  import { ThemeSwitch } from "../ui/theme-switch.js";
5
5
  import { cn } from "../../lib/utils.js";
6
6
  import { useAppShell } from "./app-shell-context.js";
@@ -57,37 +57,51 @@ function SidebarAccountMenu({
57
57
  sideOffset: 6,
58
58
  className: "min-w-[220px]",
59
59
  children: [
60
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5 px-2 py-2", children: [
61
- avatarUrl ? /* @__PURE__ */ jsx(
62
- "img",
60
+ /* @__PURE__ */ jsxs(
61
+ DropdownMenuItem,
62
+ {
63
+ disabled: true,
64
+ className: "gap-2.5 px-2 py-2 opacity-100 focus:bg-transparent data-[disabled]:opacity-100",
65
+ children: [
66
+ avatarUrl ? /* @__PURE__ */ jsx(
67
+ "img",
68
+ {
69
+ src: avatarUrl,
70
+ alt: "",
71
+ className: "h-8 w-8 shrink-0 rounded-full object-cover"
72
+ }
73
+ ) : /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--bg-tertiary)] text-[11px] font-semibold text-[var(--text-secondary)]", children: getInitials(name) }),
74
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
75
+ /* @__PURE__ */ jsx("div", { className: "truncate text-[13px] font-medium text-[var(--text-primary)]", children: name }),
76
+ role && /* @__PURE__ */ jsx("div", { className: "truncate text-[12px] text-[var(--text-secondary)]", children: role })
77
+ ] })
78
+ ]
79
+ }
80
+ ),
81
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
82
+ showTheme && /* @__PURE__ */ jsxs(Fragment, { children: [
83
+ /* @__PURE__ */ jsxs(
84
+ DropdownMenuItem,
63
85
  {
64
- src: avatarUrl,
65
- alt: "",
66
- className: "h-8 w-8 shrink-0 rounded-full object-cover"
86
+ className: "flex items-center justify-between px-3 py-2 focus:bg-transparent",
87
+ onSelect: (event) => event.preventDefault(),
88
+ children: [
89
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
90
+ /* @__PURE__ */ jsx(SunMoon, { className: "h-4 w-4" }),
91
+ /* @__PURE__ */ jsx("span", { className: "text-[13px]", children: "Theme" })
92
+ ] }),
93
+ /* @__PURE__ */ jsx(
94
+ ThemeSwitch,
95
+ {
96
+ variant: "icon",
97
+ value: theme,
98
+ onValueChange: onThemeChange
99
+ }
100
+ )
101
+ ]
67
102
  }
68
- ) : /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--bg-tertiary)] text-[11px] font-semibold text-[var(--text-secondary)]", children: getInitials(name) }),
69
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
70
- /* @__PURE__ */ jsx("div", { className: "truncate text-[13px] font-medium text-[var(--text-primary)]", children: name }),
71
- role && /* @__PURE__ */ jsx("div", { className: "truncate text-[12px] text-[var(--text-secondary)]", children: role })
72
- ] })
73
- ] }),
74
- /* @__PURE__ */ jsx("div", { className: "my-1 border-t border-[var(--border-subtle)]" }),
75
- showTheme && /* @__PURE__ */ jsxs(Fragment, { children: [
76
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
77
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
78
- /* @__PURE__ */ jsx(SunMoon, { className: "h-4 w-4" }),
79
- /* @__PURE__ */ jsx("span", { className: "text-[13px]", children: "Theme" })
80
- ] }),
81
- /* @__PURE__ */ jsx(
82
- ThemeSwitch,
83
- {
84
- variant: "icon",
85
- value: theme,
86
- onValueChange: onThemeChange
87
- }
88
- )
89
- ] }),
90
- hasItemsBelow && /* @__PURE__ */ jsx("div", { className: "my-1 border-t border-[var(--border-subtle)]" })
103
+ ),
104
+ hasItemsBelow && /* @__PURE__ */ jsx(DropdownMenuSeparator, {})
91
105
  ] }),
92
106
  menuItems && menuItems.map((item) => {
93
107
  const Icon = item.icon;
@@ -107,7 +121,7 @@ function SidebarAccountMenu({
107
121
  item.key
108
122
  );
109
123
  }),
110
- menuItems && menuItems.length > 0 && onSignOut && /* @__PURE__ */ jsx("div", { className: "my-1 border-t border-[var(--border-subtle)]" }),
124
+ menuItems && menuItems.length > 0 && onSignOut && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
111
125
  onSignOut && /* @__PURE__ */ jsxs(
112
126
  DropdownMenuItem,
113
127
  {
@@ -55,12 +55,36 @@ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checke
55
55
  }
56
56
  ));
57
57
  DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
58
+ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
59
+ DropdownMenuPrimitive.Label,
60
+ {
61
+ ref,
62
+ className: cn(
63
+ "px-2 py-1.5 text-[13px] font-semibold text-[var(--text-primary)]",
64
+ inset && "pl-8",
65
+ className
66
+ ),
67
+ ...props
68
+ }
69
+ ));
70
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
71
+ const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
72
+ DropdownMenuPrimitive.Separator,
73
+ {
74
+ ref,
75
+ className: cn("-mx-1 my-1 h-px bg-[var(--border-subtle)]", className),
76
+ ...props
77
+ }
78
+ ));
79
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
58
80
  export {
59
81
  DropdownMenu,
60
82
  DropdownMenuCheckboxItem,
61
83
  DropdownMenuContent,
62
84
  DropdownMenuGroup,
63
85
  DropdownMenuItem,
86
+ DropdownMenuLabel,
64
87
  DropdownMenuPortal,
88
+ DropdownMenuSeparator,
65
89
  DropdownMenuTrigger
66
90
  };
package/dist/es/index.js CHANGED
@@ -2,7 +2,7 @@ import { Badge, badgeVariants } from "./components/ui/badge.js";
2
2
  import { Button, buttonVariants } from "./components/ui/button.js";
3
3
  import { Checkbox } from "./components/ui/checkbox.js";
4
4
  import { Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/ui/dialog.js";
5
- import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
5
+ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
6
6
  import { Input } from "./components/ui/input.js";
7
7
  import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "./components/ui/popover.js";
8
8
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./components/ui/select.js";
@@ -121,7 +121,9 @@ export {
121
121
  DropdownMenuContent,
122
122
  DropdownMenuGroup,
123
123
  DropdownMenuItem,
124
+ DropdownMenuLabel,
124
125
  DropdownMenuPortal,
126
+ DropdownMenuSeparator,
125
127
  DropdownMenuTrigger,
126
128
  DualLineCell,
127
129
  EmptyState,
package/dist/styles.css CHANGED
@@ -472,6 +472,10 @@
472
472
  .col-span-full {
473
473
  grid-column: 1 / -1
474
474
  }
475
+ .-mx-1 {
476
+ margin-left: -0.25rem;
477
+ margin-right: -0.25rem
478
+ }
475
479
  .mx-3 {
476
480
  margin-left: 0.75rem;
477
481
  margin-right: 0.75rem
@@ -607,6 +611,9 @@
607
611
  .h-full {
608
612
  height: 100%
609
613
  }
614
+ .h-px {
615
+ height: 1px
616
+ }
610
617
  .max-h-\[280px\] {
611
618
  max-height: 280px
612
619
  }
@@ -1551,6 +1558,9 @@
1551
1558
  .focus\:border-\[var\(--border-focus\)\]:focus {
1552
1559
  border-color: var(--border-focus)
1553
1560
  }
1561
+ .focus\:bg-transparent:focus {
1562
+ background-color: transparent
1563
+ }
1554
1564
  .focus\:outline-none:focus {
1555
1565
  outline: 2px solid transparent;
1556
1566
  outline-offset: 2px
@@ -1670,6 +1680,9 @@
1670
1680
  .data-\[disabled\=true\]\:opacity-50[data-disabled="true"] {
1671
1681
  opacity: 0.5
1672
1682
  }
1683
+ .data-\[disabled\]\:opacity-100[data-disabled] {
1684
+ opacity: 1
1685
+ }
1673
1686
  .data-\[state\=open\]\:opacity-100[data-state="open"] {
1674
1687
  opacity: 1
1675
1688
  }
@@ -235,6 +235,28 @@ const DropdownMenuCheckboxItem = React__namespace.forwardRef(({ className, child
235
235
  }
236
236
  ));
237
237
  DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
238
+ const DropdownMenuLabel = React__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
239
+ DropdownMenuPrimitive__namespace.Label,
240
+ {
241
+ ref,
242
+ className: cn(
243
+ "px-2 py-1.5 text-[13px] font-semibold text-[var(--text-primary)]",
244
+ inset && "pl-8",
245
+ className
246
+ ),
247
+ ...props
248
+ }
249
+ ));
250
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
251
+ const DropdownMenuSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
252
+ DropdownMenuPrimitive__namespace.Separator,
253
+ {
254
+ ref,
255
+ className: cn("-mx-1 my-1 h-px bg-[var(--border-subtle)]", className),
256
+ ...props
257
+ }
258
+ ));
259
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
238
260
  const Input = React__namespace.forwardRef(
239
261
  ({ className, type, error, ...props }, ref) => {
240
262
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -2237,37 +2259,51 @@ function SidebarAccountMenu({
2237
2259
  sideOffset: 6,
2238
2260
  className: "min-w-[220px]",
2239
2261
  children: [
2240
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5 px-2 py-2", children: [
2241
- avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(
2242
- "img",
2262
+ /* @__PURE__ */ jsxRuntime.jsxs(
2263
+ DropdownMenuItem,
2264
+ {
2265
+ disabled: true,
2266
+ className: "gap-2.5 px-2 py-2 opacity-100 focus:bg-transparent data-[disabled]:opacity-100",
2267
+ children: [
2268
+ avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(
2269
+ "img",
2270
+ {
2271
+ src: avatarUrl,
2272
+ alt: "",
2273
+ className: "h-8 w-8 shrink-0 rounded-full object-cover"
2274
+ }
2275
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--bg-tertiary)] text-[11px] font-semibold text-[var(--text-secondary)]", children: getInitials(name) }),
2276
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
2277
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-[13px] font-medium text-[var(--text-primary)]", children: name }),
2278
+ role && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-[12px] text-[var(--text-secondary)]", children: role })
2279
+ ] })
2280
+ ]
2281
+ }
2282
+ ),
2283
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
2284
+ showTheme && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2285
+ /* @__PURE__ */ jsxRuntime.jsxs(
2286
+ DropdownMenuItem,
2243
2287
  {
2244
- src: avatarUrl,
2245
- alt: "",
2246
- className: "h-8 w-8 shrink-0 rounded-full object-cover"
2288
+ className: "flex items-center justify-between px-3 py-2 focus:bg-transparent",
2289
+ onSelect: (event) => event.preventDefault(),
2290
+ children: [
2291
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2292
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SunMoon, { className: "h-4 w-4" }),
2293
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px]", children: "Theme" })
2294
+ ] }),
2295
+ /* @__PURE__ */ jsxRuntime.jsx(
2296
+ ThemeSwitch,
2297
+ {
2298
+ variant: "icon",
2299
+ value: theme,
2300
+ onValueChange: onThemeChange
2301
+ }
2302
+ )
2303
+ ]
2247
2304
  }
2248
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--bg-tertiary)] text-[11px] font-semibold text-[var(--text-secondary)]", children: getInitials(name) }),
2249
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
2250
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-[13px] font-medium text-[var(--text-primary)]", children: name }),
2251
- role && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-[12px] text-[var(--text-secondary)]", children: role })
2252
- ] })
2253
- ] }),
2254
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-[var(--border-subtle)]" }),
2255
- showTheme && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2256
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
2257
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2258
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SunMoon, { className: "h-4 w-4" }),
2259
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px]", children: "Theme" })
2260
- ] }),
2261
- /* @__PURE__ */ jsxRuntime.jsx(
2262
- ThemeSwitch,
2263
- {
2264
- variant: "icon",
2265
- value: theme,
2266
- onValueChange: onThemeChange
2267
- }
2268
- )
2269
- ] }),
2270
- hasItemsBelow && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-[var(--border-subtle)]" })
2305
+ ),
2306
+ hasItemsBelow && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {})
2271
2307
  ] }),
2272
2308
  menuItems && menuItems.map((item) => {
2273
2309
  const Icon = item.icon;
@@ -2287,7 +2323,7 @@ function SidebarAccountMenu({
2287
2323
  item.key
2288
2324
  );
2289
2325
  }),
2290
- menuItems && menuItems.length > 0 && onSignOut && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-[var(--border-subtle)]" }),
2326
+ menuItems && menuItems.length > 0 && onSignOut && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
2291
2327
  onSignOut && /* @__PURE__ */ jsxRuntime.jsxs(
2292
2328
  DropdownMenuItem,
2293
2329
  {
@@ -5839,7 +5875,9 @@ exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
5839
5875
  exports.DropdownMenuContent = DropdownMenuContent;
5840
5876
  exports.DropdownMenuGroup = DropdownMenuGroup;
5841
5877
  exports.DropdownMenuItem = DropdownMenuItem;
5878
+ exports.DropdownMenuLabel = DropdownMenuLabel;
5842
5879
  exports.DropdownMenuPortal = DropdownMenuPortal;
5880
+ exports.DropdownMenuSeparator = DropdownMenuSeparator;
5843
5881
  exports.DropdownMenuTrigger = DropdownMenuTrigger;
5844
5882
  exports.DualLineCell = DualLineCell;
5845
5883
  exports.EmptyState = EmptyState;
@@ -320,6 +320,10 @@
320
320
  .col-span-full {
321
321
  grid-column: 1 / -1
322
322
  }
323
+ .-mx-1 {
324
+ margin-left: -0.25rem;
325
+ margin-right: -0.25rem
326
+ }
323
327
  .mx-3 {
324
328
  margin-left: 0.75rem;
325
329
  margin-right: 0.75rem
@@ -455,6 +459,9 @@
455
459
  .h-full {
456
460
  height: 100%
457
461
  }
462
+ .h-px {
463
+ height: 1px
464
+ }
458
465
  .max-h-\[280px\] {
459
466
  max-height: 280px
460
467
  }
@@ -1399,6 +1406,9 @@
1399
1406
  .focus\:border-\[var\(--border-focus\)\]:focus {
1400
1407
  border-color: var(--border-focus)
1401
1408
  }
1409
+ .focus\:bg-transparent:focus {
1410
+ background-color: transparent
1411
+ }
1402
1412
  .focus\:outline-none:focus {
1403
1413
  outline: 2px solid transparent;
1404
1414
  outline-offset: 2px
@@ -1518,6 +1528,9 @@
1518
1528
  .data-\[disabled\=true\]\:opacity-50[data-disabled="true"] {
1519
1529
  opacity: 0.5
1520
1530
  }
1531
+ .data-\[disabled\]\:opacity-100[data-disabled] {
1532
+ opacity: 1
1533
+ }
1521
1534
  .data-\[state\=open\]\:opacity-100[data-state="open"] {
1522
1535
  opacity: 1
1523
1536
  }
@@ -7,4 +7,8 @@ declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPor
7
7
  declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
9
  declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
- export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuTrigger, };
10
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
11
+ inset?: boolean;
12
+ } & React.RefAttributes<HTMLDivElement>>;
13
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undevy-org/tablewright",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "React data-table and application-shell components: filters, drawers, row controls, sortable and resizable columns, built on Radix UI and TanStack Table.",
5
5
  "license": "MIT",
6
6
  "repository": {