@krak-stack/registry 0.10.1 → 0.10.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @krak-stack/registry
2
2
 
3
+ ## 0.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 91114c4: Expose optional grouped DataTable styling hooks, including portalled menus, submenus, filter selects, page-size popups, feedback and gallery layouts. Add AppBrand part classes and stable slots, Pagination root/popup classes, and select-field popup classes. Preserve existing defaults and interaction/data behavior.
8
+
3
9
  ## 0.10.1
4
10
 
5
11
  ### Patch Changes
@@ -1,10 +1,12 @@
1
1
  import { type LinkProps } from "@tanstack/react-router";
2
2
  import type { ComponentProps } from "react";
3
3
  import type { LucideIcon } from "lucide-react";
4
+ export type AppBrandClassNames = Partial<Record<"visual" | "image" | "icon" | "content" | "label" | "subtitle", string>>;
4
5
  type AppBrandContentProps = {
5
6
  label: string;
6
7
  subtitle: string;
7
8
  className?: string;
9
+ classNames?: AppBrandClassNames;
8
10
  variant?: "default" | "sidebar";
9
11
  };
10
12
  type AppBrandVisualProps = {
@@ -1,11 +1,17 @@
1
1
  // ../../src/components/ui/app-brand.tsx
2
2
  import { Link } from "@tanstack/react-router";
3
+
4
+ // ../../src/lib/utils.ts
5
+ import { cn } from "cn";
6
+
7
+ // ../../src/components/ui/app-brand.tsx
3
8
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
4
9
  var isStaticBrand = (props) => props.to === null;
5
10
  var isAnchorBrand = (props) => props.href !== undefined;
6
11
  function AppBrand(brandProps) {
7
12
  const {
8
13
  className,
14
+ classNames,
9
15
  label,
10
16
  subtitle,
11
17
  icon: Icon,
@@ -18,28 +24,31 @@ function AppBrand(brandProps) {
18
24
  const content = /* @__PURE__ */ jsxs(Fragment, {
19
25
  children: [
20
26
  /* @__PURE__ */ jsx("div", {
21
- className: [
22
- "flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md",
23
- imageSrc ? "border bg-background" : iconClassName
24
- ].join(" "),
27
+ "data-slot": "app-brand-visual",
28
+ className: cn("flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md", imageSrc ? "bg-background border" : iconClassName, classNames?.visual),
25
29
  children: imageSrc ? /* @__PURE__ */ jsx("img", {
30
+ "data-slot": "app-brand-image",
26
31
  src: imageSrc,
27
32
  alt: label,
28
- className: "size-full object-cover"
33
+ className: cn("size-full object-cover", classNames?.image)
29
34
  }) : Icon ? /* @__PURE__ */ jsx(Icon, {
30
- className: "size-4",
35
+ "data-slot": "app-brand-icon",
36
+ className: cn("size-4", classNames?.icon),
31
37
  color: iconColor
32
38
  }) : null
33
39
  }),
34
40
  /* @__PURE__ */ jsxs("div", {
35
- className: ["flex min-w-0 flex-col leading-tight", contentClassName].filter(Boolean).join(" "),
41
+ "data-slot": "app-brand-content",
42
+ className: cn("flex min-w-0 flex-col leading-tight", contentClassName, classNames?.content),
36
43
  children: [
37
44
  /* @__PURE__ */ jsx("span", {
38
- className: "truncate font-semibold tracking-tight",
45
+ "data-slot": "app-brand-label",
46
+ className: cn("truncate font-semibold tracking-tight", classNames?.label),
39
47
  children: label
40
48
  }),
41
49
  subtitle ? /* @__PURE__ */ jsx("span", {
42
- className: "text-muted-foreground truncate text-xs",
50
+ "data-slot": "app-brand-subtitle",
51
+ className: cn("text-muted-foreground truncate text-xs", classNames?.subtitle),
43
52
  children: subtitle
44
53
  }) : null
45
54
  ]
@@ -54,6 +63,7 @@ function AppBrand(brandProps) {
54
63
  if (isStaticBrand(brandProps)) {
55
64
  const {
56
65
  className: _className,
66
+ classNames: _classNames,
57
67
  label: _label,
58
68
  subtitle: _subtitle,
59
69
  icon: _icon,
@@ -64,6 +74,7 @@ function AppBrand(brandProps) {
64
74
  ...props
65
75
  } = brandProps;
66
76
  return /* @__PURE__ */ jsx("div", {
77
+ "data-slot": "app-brand",
67
78
  className: brandClassName,
68
79
  ...props,
69
80
  children: content
@@ -72,6 +83,7 @@ function AppBrand(brandProps) {
72
83
  if (isAnchorBrand(brandProps)) {
73
84
  const {
74
85
  className: _className,
86
+ classNames: _classNames,
75
87
  label: _label,
76
88
  subtitle: _subtitle,
77
89
  icon: _icon,
@@ -82,6 +94,7 @@ function AppBrand(brandProps) {
82
94
  ...props
83
95
  } = brandProps;
84
96
  return /* @__PURE__ */ jsx("a", {
97
+ "data-slot": "app-brand",
85
98
  className: brandClassName,
86
99
  href,
87
100
  ...props,
@@ -90,6 +103,7 @@ function AppBrand(brandProps) {
90
103
  }
91
104
  const {
92
105
  className: _className,
106
+ classNames: _classNames,
93
107
  label: _label,
94
108
  subtitle: _subtitle,
95
109
  icon: _icon,
@@ -100,6 +114,7 @@ function AppBrand(brandProps) {
100
114
  ...props
101
115
  } = brandProps;
102
116
  return /* @__PURE__ */ jsx(Link, {
117
+ "data-slot": "app-brand",
103
118
  to: to ?? "/",
104
119
  className: brandClassName,
105
120
  ...props,
@@ -1,6 +1,16 @@
1
1
  import { type ReactElement, type ReactNode } from "react";
2
2
  import { type PaginationMessages } from "./pagination.js";
3
3
  import { ColumnFilter, type QueryType } from "../../lib/query.js";
4
+ /** Presentation only. Popup classes are applied inside portals, not to their triggers. */
5
+ export type DataTableClassNames = {
6
+ table?: Partial<Record<"content" | "header" | "body" | "row" | "head" | "cell", string>>;
7
+ toolbar?: Partial<Record<"content" | "search" | "trigger", string>>;
8
+ menu?: Partial<Record<"content" | "subContent" | "label" | "item" | "separator" | "subTrigger", string>>;
9
+ popup?: Partial<Record<"select" | "tooltip", string>>;
10
+ pagination?: string;
11
+ gallery?: string;
12
+ feedback?: Partial<Record<"loading" | "empty" | "error", string>>;
13
+ };
4
14
  type RowData = object;
5
15
  export type DataTableView = "table" | "gallery";
6
16
  export type DataTablePublicState = QueryType;
@@ -471,6 +481,8 @@ export declare const dataTableMessages: (locale?: string, translations?: DataTab
471
481
  selected: string;
472
482
  };
473
483
  export interface DataTableProps<TData extends RowData> {
484
+ className?: string;
485
+ classNames?: DataTableClassNames;
474
486
  rowData: readonly TData[];
475
487
  columnDefs: readonly DataTableColDef<TData>[];
476
488
  getRowId?: (row: TData) => string;