@alexgorbatchev/shadcn 0.0.30 → 0.0.32

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.
Files changed (93) hide show
  1. package/README.md +26 -22
  2. package/THIRD_PARTY_NOTICES.md +10 -0
  3. package/dist/{chunk-0ewzb2ax.js → chunk-0kyfh857.js} +1 -1
  4. package/dist/chunk-1xncv9gb.js +19 -0
  5. package/dist/chunk-2dxa9enk.js +98 -0
  6. package/dist/{chunk-8wfy03bp.js → chunk-6kwf9644.js} +1 -1
  7. package/dist/{chunk-82e7fbmq.js → chunk-9vyg3854.js} +2 -1
  8. package/dist/chunk-c6g2rbhv.js +3940 -0
  9. package/dist/chunk-dzvsjw59.js +200 -0
  10. package/dist/{chunk-g238nezp.js → chunk-pg9rhbgm.js} +4 -2
  11. package/dist/{chunk-5da3rzn5.js → chunk-s0typ7hv.js} +1 -1
  12. package/dist/chunk-tch86q2w.js +6050 -0
  13. package/dist/{chunk-eehfrrdz.js → chunk-tnnf8ydf.js} +1 -15
  14. package/dist/chunk-yfr9syen.js +363 -0
  15. package/dist/{chunk-53q730zs.js → chunk-zdt8xxzy.js} +3 -0
  16. package/dist/components/Alert.d.ts +1 -1
  17. package/dist/components/Table.d.ts +1 -0
  18. package/dist/components/assistant-ui/elements/Chart.js +2 -2
  19. package/dist/components/assistant-ui/elements/GuardrailNotice.js +2 -2
  20. package/dist/components/assistant-ui/elements/OptionList.js +3 -2
  21. package/dist/components/assistant-ui/elements/QuestionFlow.js +4 -3
  22. package/dist/components/assistant-ui/index.js +8 -7
  23. package/dist/components/assistant-ui/native/Sources.d.ts +1 -1
  24. package/dist/components/carousel/index.js +15 -204
  25. package/dist/components/chart/AnalyticsChart.d.ts +3 -2
  26. package/dist/components/chart/Chart.d.ts +1 -1
  27. package/dist/components/chart/index.js +24 -10
  28. package/dist/components/chart/types.d.ts +1 -0
  29. package/dist/components/data-grid/DataGrid.d.ts +48 -9
  30. package/dist/components/data-grid/DataGridColumnOptions.d.ts +14 -0
  31. package/dist/components/data-grid/DataGridColumnResizer.d.ts +13 -0
  32. package/dist/components/data-grid/getDataGridColumnSizeVariables.d.ts +6 -0
  33. package/dist/components/data-grid/hooks/useDataGridColumnSizes.d.ts +8 -0
  34. package/dist/components/data-grid/index.d.ts +3 -2
  35. package/dist/components/data-grid/index.js +124 -199
  36. package/dist/components/data-grid/moveDataGridColumn.d.ts +5 -0
  37. package/dist/components/event-calendar/index.js +4 -2
  38. package/dist/components/json-render/JsonAccordion.d.ts +3 -0
  39. package/dist/components/json-render/JsonAlert.d.ts +3 -0
  40. package/dist/components/json-render/JsonAvatar.d.ts +3 -0
  41. package/dist/components/json-render/JsonBadge.d.ts +3 -0
  42. package/dist/components/json-render/JsonButton.d.ts +3 -0
  43. package/dist/components/json-render/JsonButtonGroup.d.ts +3 -0
  44. package/dist/components/json-render/JsonCard.d.ts +3 -0
  45. package/dist/components/json-render/JsonCarousel.d.ts +3 -0
  46. package/dist/components/json-render/JsonCheckbox.d.ts +3 -0
  47. package/dist/components/json-render/JsonCollapsible.d.ts +3 -0
  48. package/dist/components/json-render/JsonDialog.d.ts +3 -0
  49. package/dist/components/json-render/JsonDrawer.d.ts +3 -0
  50. package/dist/components/json-render/JsonDropdownMenu.d.ts +3 -0
  51. package/dist/components/json-render/JsonGrid.d.ts +3 -0
  52. package/dist/components/json-render/JsonHeading.d.ts +3 -0
  53. package/dist/components/json-render/JsonImage.d.ts +3 -0
  54. package/dist/components/json-render/JsonInput.d.ts +3 -0
  55. package/dist/components/json-render/JsonLink.d.ts +3 -0
  56. package/dist/components/json-render/JsonPagination.d.ts +3 -0
  57. package/dist/components/json-render/JsonPopover.d.ts +3 -0
  58. package/dist/components/json-render/JsonProgress.d.ts +3 -0
  59. package/dist/components/json-render/JsonRadio.d.ts +3 -0
  60. package/dist/components/json-render/JsonSelect.d.ts +3 -0
  61. package/dist/components/json-render/JsonSeparator.d.ts +3 -0
  62. package/dist/components/json-render/JsonSkeleton.d.ts +3 -0
  63. package/dist/components/json-render/JsonSlider.d.ts +3 -0
  64. package/dist/components/json-render/JsonSpinner.d.ts +3 -0
  65. package/dist/components/json-render/JsonStack.d.ts +3 -0
  66. package/dist/components/json-render/JsonSwitch.d.ts +3 -0
  67. package/dist/components/json-render/JsonTable.d.ts +3 -0
  68. package/dist/components/json-render/JsonTabs.d.ts +3 -0
  69. package/dist/components/json-render/JsonText.d.ts +3 -0
  70. package/dist/components/json-render/JsonTextarea.d.ts +3 -0
  71. package/dist/components/json-render/JsonToggle.d.ts +3 -0
  72. package/dist/components/json-render/JsonToggleGroup.d.ts +3 -0
  73. package/dist/components/json-render/JsonTooltip.d.ts +3 -0
  74. package/dist/components/json-render/catalog.d.ts +548 -0
  75. package/dist/components/json-render/catalog.js +6 -0
  76. package/dist/components/json-render/getPaginationRange.d.ts +1 -0
  77. package/dist/components/json-render/index.d.ts +39 -0
  78. package/dist/components/json-render/index.js +1254 -0
  79. package/dist/components/virtual-data-grid/VirtualDataGrid.d.ts +26 -0
  80. package/dist/components/virtual-data-grid/index.d.ts +2 -0
  81. package/dist/components/virtual-data-grid/index.js +88 -0
  82. package/dist/components/virtual-table/index.js +4 -96
  83. package/dist/index.d.ts +1 -0
  84. package/dist/index.js +569 -4189
  85. package/licenses/json-render-APACHE-2.0.txt +201 -0
  86. package/llms/components/data-display/AnalyticsChart.md +34 -0
  87. package/llms/components/data-display/DataGridColumnOptions.md +22 -0
  88. package/llms/components/data-display/JsonRender.md +476 -0
  89. package/llms/components/data-display/VirtualDataGrid.md +71 -0
  90. package/llms/components/feedback/Alert.md +20 -4
  91. package/llms/setup.md +26 -22
  92. package/llms.txt +3 -0
  93. package/package.json +24 -2
@@ -1,207 +1,18 @@
1
1
  import {
2
- cn2
3
- } from "../../chunk-cp2m7y7v.js";
4
- import {
5
- Button2
6
- } from "../../chunk-q7p28b89.js";
7
-
8
- // src/components/carousel/Carousel.tsx
9
- import { useCallback, useEffect, useState } from "react";
10
- import useEmblaCarousel from "embla-carousel-react";
11
- import { useDirection } from "@base-ui/react/direction-provider";
12
- import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from "lucide-react";
13
-
14
- // src/components/carousel/CarouselContext.ts
15
- import { createContext } from "react";
16
- var CarouselContext = createContext(null);
17
-
18
- // src/components/carousel/hooks/useCarousel.ts
19
- import { useContext } from "react";
20
- function useCarousel() {
21
- const context = useContext(CarouselContext);
22
- if (!context)
23
- throw new Error("useCarousel must be used within Carousel.");
24
- return context;
25
- }
26
-
27
- // src/components/carousel/Carousel.tsx
28
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
29
- function Carousel({
30
- density,
31
- orientation = "horizontal",
32
- opts,
33
- setApi,
34
- plugins,
35
- className,
36
- children,
37
- onKeyDown,
38
- ...props
39
- }) {
40
- const inheritedDirection = useDirection();
41
- const direction = opts?.direction ?? inheritedDirection;
42
- const [carouselRef, api] = useEmblaCarousel({
43
- ...opts,
44
- direction,
45
- axis: orientation === "horizontal" ? "x" : "y",
46
- breakpoints: {
47
- ...opts?.breakpoints,
48
- "(prefers-reduced-motion: reduce)": {
49
- ...opts?.breakpoints?.["(prefers-reduced-motion: reduce)"],
50
- duration: 0
51
- }
52
- }
53
- }, plugins);
54
- const [canScrollPrev, setCanScrollPrev] = useState(false);
55
- const [canScrollNext, setCanScrollNext] = useState(false);
56
- const scrollPrev = useCallback(() => api?.scrollPrev(), [api]);
57
- const scrollNext = useCallback(() => api?.scrollNext(), [api]);
58
- useEffect(() => {
59
- if (!api)
60
- return;
61
- const update = () => {
62
- setCanScrollPrev(api.canScrollPrev());
63
- setCanScrollNext(api.canScrollNext());
64
- };
65
- update();
66
- api.on("reInit", update);
67
- api.on("select", update);
68
- return () => {
69
- api.off("reInit", update);
70
- api.off("select", update);
71
- };
72
- }, [api]);
73
- useEffect(() => {
74
- if (api)
75
- setApi?.(api);
76
- }, [api, setApi]);
77
- const handleKeyDown = (event) => {
78
- onKeyDown?.(event);
79
- if (event.defaultPrevented || event.target !== event.currentTarget)
80
- return;
81
- const previousKey = orientation === "vertical" ? "ArrowUp" : direction === "rtl" ? "ArrowRight" : "ArrowLeft";
82
- const nextKey = orientation === "vertical" ? "ArrowDown" : direction === "rtl" ? "ArrowLeft" : "ArrowRight";
83
- if (event.key === previousKey) {
84
- event.preventDefault();
85
- scrollPrev();
86
- }
87
- if (event.key === nextKey) {
88
- event.preventDefault();
89
- scrollNext();
90
- }
91
- };
92
- return /* @__PURE__ */ jsx(CarouselContext.Provider, {
93
- value: { carouselRef, api, orientation, direction, scrollPrev, scrollNext, canScrollPrev, canScrollNext },
94
- children: /* @__PURE__ */ jsx("div", {
95
- "data-slot": "carousel",
96
- "data-density": density,
97
- dir: direction,
98
- role: "region",
99
- "aria-roledescription": "carousel",
100
- tabIndex: 0,
101
- className: cn2("relative outline-none focus-visible:ring-1 focus-visible:ring-ring", className),
102
- ...props,
103
- onKeyDown: handleKeyDown,
104
- children
105
- })
106
- });
107
- }
108
- function CarouselContent({ className, ...props }) {
109
- const { carouselRef, orientation } = useCarousel();
110
- return /* @__PURE__ */ jsx("div", {
111
- ref: carouselRef,
112
- "data-slot": "carousel-content",
113
- className: "overflow-hidden",
114
- children: /* @__PURE__ */ jsx("div", {
115
- className: cn2("flex", orientation === "horizontal" ? "-ms-panel touch-pan-y touch-pinch-zoom" : "-mt-panel flex-col touch-pan-x touch-pinch-zoom", className),
116
- ...props
117
- })
118
- });
119
- }
120
- function CarouselItem({ className, ...props }) {
121
- const { orientation } = useCarousel();
122
- return /* @__PURE__ */ jsx("div", {
123
- role: "group",
124
- "aria-roledescription": "slide",
125
- "data-slot": "carousel-item",
126
- className: cn2("min-h-0 min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "ps-panel" : "pt-panel", className),
127
- ...props
128
- });
129
- }
130
- function CarouselPrevious({
131
- className,
132
- variant = "outline",
133
- size = "icon-sm",
134
- disabled,
135
- onClick,
136
- children,
137
- ...props
138
- }) {
139
- const { orientation, scrollPrev, canScrollPrev } = useCarousel();
140
- return /* @__PURE__ */ jsx(Button2, {
141
- "data-slot": "carousel-previous",
142
- variant,
143
- size,
144
- className: (state) => cn2("absolute touch-manipulation", orientation === "horizontal" ? "inset-y-0 -start-10 my-auto" : "-top-10 left-1/2 -translate-x-1/2", typeof className === "function" ? className(state) : className),
145
- disabled: disabled || !canScrollPrev,
146
- onClick: (event) => {
147
- onClick?.(event);
148
- if (!event.defaultPrevented)
149
- scrollPrev();
150
- },
151
- ...props,
152
- children: children ?? /* @__PURE__ */ jsxs(Fragment, {
153
- children: [
154
- orientation === "horizontal" ? /* @__PURE__ */ jsx(ChevronLeftIcon, {
155
- className: "rtl:rotate-180"
156
- }) : /* @__PURE__ */ jsx(ChevronUpIcon, {}),
157
- /* @__PURE__ */ jsx("span", {
158
- className: "sr-only",
159
- children: "Previous slide"
160
- })
161
- ]
162
- })
163
- });
164
- }
165
- function CarouselNext({
166
- className,
167
- variant = "outline",
168
- size = "icon-sm",
169
- disabled,
170
- onClick,
171
- children,
172
- ...props
173
- }) {
174
- const { orientation, scrollNext, canScrollNext } = useCarousel();
175
- return /* @__PURE__ */ jsx(Button2, {
176
- "data-slot": "carousel-next",
177
- variant,
178
- size,
179
- className: (state) => cn2("absolute touch-manipulation", orientation === "horizontal" ? "inset-y-0 -end-10 my-auto" : "-bottom-10 left-1/2 -translate-x-1/2", typeof className === "function" ? className(state) : className),
180
- disabled: disabled || !canScrollNext,
181
- onClick: (event) => {
182
- onClick?.(event);
183
- if (!event.defaultPrevented)
184
- scrollNext();
185
- },
186
- ...props,
187
- children: children ?? /* @__PURE__ */ jsxs(Fragment, {
188
- children: [
189
- orientation === "horizontal" ? /* @__PURE__ */ jsx(ChevronRightIcon, {
190
- className: "rtl:rotate-180"
191
- }) : /* @__PURE__ */ jsx(ChevronDownIcon, {}),
192
- /* @__PURE__ */ jsx("span", {
193
- className: "sr-only",
194
- children: "Next slide"
195
- })
196
- ]
197
- })
198
- });
199
- }
2
+ useCarousel2,
3
+ Carousel2,
4
+ CarouselContent2,
5
+ CarouselItem2,
6
+ CarouselPrevious2,
7
+ CarouselNext2
8
+ } from "../../chunk-dzvsjw59.js";
9
+ import"../../chunk-q7p28b89.js";
10
+ import"../../chunk-cp2m7y7v.js";
200
11
  export {
201
- Carousel,
202
- CarouselContent,
203
- CarouselItem,
204
- CarouselNext,
205
- CarouselPrevious,
206
- useCarousel
12
+ Carousel2 as Carousel,
13
+ CarouselContent2 as CarouselContent,
14
+ CarouselItem2 as CarouselItem,
15
+ CarouselNext2 as CarouselNext,
16
+ CarouselPrevious2 as CarouselPrevious,
17
+ useCarousel2 as useCarousel
207
18
  };
@@ -8,12 +8,13 @@ type AnalyticsSeries = {
8
8
  };
9
9
  type AnalyticsChartProps = IDensityProps & {
10
10
  label: string;
11
- data: Record<string, string | number>[];
11
+ data: Record<string, string | number | null>[];
12
+ showDots?: boolean;
12
13
  index: string;
13
14
  series: readonly AnalyticsSeries[];
14
15
  valueFormatter?: (value: number) => string;
15
16
  };
16
- declare function AnalyticsChart({ label, data, index, series, valueFormatter, density }: AnalyticsChartProps): ReactElement;
17
+ declare function AnalyticsChart({ label, data, index, series, valueFormatter, showDots, density, }: AnalyticsChartProps): ReactElement;
17
18
  type SparklineProps = IDensityProps & {
18
19
  label: string;
19
20
  values: readonly number[];
@@ -3,7 +3,7 @@ import type { ChartProps, ChartTooltipContentProps, ChartLegendContentProps } fr
3
3
  import { Tooltip } from "recharts";
4
4
  import { ChartStyle } from "./ChartStyle.js";
5
5
  declare function Chart({ id, dir, density, className, children, config, initialDimension, ...props }: ChartProps): ReactElement;
6
- declare function ChartTooltipContent({ density, active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, htmlProps, contentStyle, itemStyle, labelStyle, wrapperClassName, itemSorter, }: ChartTooltipContentProps): ReactElement | null;
6
+ declare function ChartTooltipContent({ density, active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, valueFormatter, labelClassName, formatter, color, nameKey, labelKey, htmlProps, contentStyle, itemStyle, labelStyle, wrapperClassName, itemSorter, }: ChartTooltipContentProps): ReactElement | null;
7
7
  declare function ChartLegendContent({ density, className, hideIcon, payload, verticalAlign, nameKey, onClick, onMouseEnter, onMouseLeave, formatter, htmlProps, labelStyle, inactiveColor, }: ChartLegendContentProps): ReactElement | null;
8
8
  declare const ChartTooltip: typeof Tooltip;
9
9
  declare const ChartLegend: import("react").MemoExoticComponent<(outsideProps: import("recharts").LegendProps) => React.ReactPortal | null>;
@@ -6,16 +6,25 @@ import {
6
6
  ChartLegendContent2,
7
7
  ChartTooltip2,
8
8
  ChartLegend2
9
- } from "../../chunk-82e7fbmq.js";
9
+ } from "../../chunk-9vyg3854.js";
10
10
  import"../../chunk-e6hk39ev.js";
11
11
  import"../../chunk-cp2m7y7v.js";
12
12
  import"../../chunk-jpvw9xqy.js";
13
13
  // src/components/chart/AnalyticsChart.tsx
14
14
  import { Area, Bar, CartesianGrid, ComposedChart, Line, XAxis, YAxis } from "recharts";
15
15
  import { jsx, jsxs } from "react/jsx-runtime";
16
- function AnalyticsChart({ label, data, index, series, valueFormatter, density }) {
17
- const config = Object.fromEntries(series.map((item, i) => [item.key, { label: item.label, color: `var(--chart-${i % 5 + 1})` }]));
16
+ function AnalyticsChart({
17
+ label,
18
+ data,
19
+ index,
20
+ series,
21
+ valueFormatter,
22
+ showDots = false,
23
+ density
24
+ }) {
25
+ const config = Object.fromEntries(series.map((item) => [item.key, { label: item.label }]));
18
26
  return /* @__PURE__ */ jsx(Chart3, {
27
+ role: "region",
19
28
  "aria-label": label,
20
29
  density,
21
30
  config,
@@ -38,27 +47,32 @@ function AnalyticsChart({ label, data, index, series, valueFormatter, density })
38
47
  tickFormatter: valueFormatter
39
48
  }),
40
49
  /* @__PURE__ */ jsx(ChartTooltip2, {
41
- content: /* @__PURE__ */ jsx(ChartTooltipContent2, {})
50
+ content: /* @__PURE__ */ jsx(ChartTooltipContent2, {
51
+ valueFormatter
52
+ })
42
53
  }),
43
54
  /* @__PURE__ */ jsx(ChartLegend2, {
44
55
  content: /* @__PURE__ */ jsx(ChartLegendContent2, {})
45
56
  }),
46
- series.map((item) => item.type === "bar" ? /* @__PURE__ */ jsx(Bar, {
57
+ series.map((item, i) => item.type === "bar" ? /* @__PURE__ */ jsx(Bar, {
47
58
  dataKey: item.key,
48
- fill: config[item.key]?.color,
59
+ fill: `var(--chart-${i % 5 + 1})`,
49
60
  stackId: item.stackId,
50
61
  isAnimationActive: false
51
62
  }, item.key) : item.type === "area" ? /* @__PURE__ */ jsx(Area, {
52
63
  dataKey: item.key,
53
- stroke: config[item.key]?.color,
54
- fill: config[item.key]?.color,
64
+ stroke: `var(--chart-${i % 5 + 1})`,
65
+ fill: `var(--chart-${i % 5 + 1})`,
55
66
  fillOpacity: 0.15,
67
+ dot: showDots,
68
+ connectNulls: false,
56
69
  stackId: item.stackId,
57
70
  isAnimationActive: false
58
71
  }, item.key) : /* @__PURE__ */ jsx(Line, {
59
72
  dataKey: item.key,
60
- stroke: config[item.key]?.color,
61
- dot: false,
73
+ stroke: `var(--chart-${i % 5 + 1})`,
74
+ dot: showDots,
75
+ connectNulls: false,
62
76
  isAnimationActive: false
63
77
  }, item.key))
64
78
  ]
@@ -35,6 +35,7 @@ export type ChartTooltipContentProps = Omit<DefaultTooltipContentProps<TooltipVa
35
35
  className?: string;
36
36
  htmlProps?: ComponentProps<"div">;
37
37
  active?: boolean;
38
+ valueFormatter?: (value: number) => string;
38
39
  hideLabel?: boolean;
39
40
  hideIndicator?: boolean;
40
41
  indicator?: "line" | "dot" | "dashed";
@@ -1,15 +1,31 @@
1
- import { type ReactTable, type RowData, type Column, type CellData } from "@tanstack/react-table";
2
- import type { ReactElement, ReactNode } from "react";
1
+ import { type CellData, type Column, type ReactTable, type Row, type RowData, type Table as CoreTable, type TableState } from "@tanstack/react-table";
2
+ import { type ReactElement, type ReactNode } from "react";
3
3
  import type { IDensityProps } from "../../density/types.js";
4
+ import { type TableTextAlign, type TableVisibility } from "../Table.js";
5
+ /** Presentation settings a column definition carries in its `meta`. */
6
+ interface IDataGridColumnMeta {
7
+ /** Name in the column picker and resize handle; defaults to a string header, then the column ID. */
8
+ label?: string;
9
+ textAlign?: TableTextAlign;
10
+ truncate?: boolean;
11
+ /** Hides the column below this viewport or container width, together with its header and cells. */
12
+ visibleFrom?: TableVisibility;
13
+ /** Takes the width the sized columns leave, so it has no fixed size of its own. */
14
+ fill?: boolean;
15
+ }
4
16
  declare const dataGridFeatures: {
5
17
  columnFilteringFeature: import("@tanstack/react-table").TableFeature;
18
+ columnOrderingFeature: import("@tanstack/react-table").TableFeature;
19
+ columnSizingFeature: import("@tanstack/react-table").TableFeature;
20
+ columnResizingFeature: import("@tanstack/react-table").TableFeature;
6
21
  columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
22
+ globalFilteringFeature: import("@tanstack/react-table").TableFeature;
7
23
  rowPaginationFeature: import("@tanstack/react-table").TableFeature;
8
24
  rowSelectionFeature: import("@tanstack/react-table").TableFeature;
9
25
  rowSortingFeature: import("@tanstack/react-table").TableFeature;
10
- filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
11
- sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
12
- paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
26
+ filteredRowModel: (table: CoreTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
27
+ sortedRowModel: (table: CoreTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
28
+ paginatedRowModel: (table: CoreTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
13
29
  filterFns: {
14
30
  includesString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
15
31
  };
@@ -17,8 +33,31 @@ declare const dataGridFeatures: {
17
33
  alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
18
34
  basic: import("@tanstack/react-table").CreatedSortFn<any, any>;
19
35
  };
36
+ columnMeta: IDataGridColumnMeta;
20
37
  };
21
- type DataGridTable<T extends RowData> = ReactTable<typeof dataGridFeatures, T>;
38
+ type DataGridFeatures = typeof dataGridFeatures;
39
+ /** A table built with `dataGridFeatures`; `TSelected` is the state its `useTable` selector returns. */
40
+ type DataGridTable<T extends RowData, TSelected = TableState<DataGridFeatures>> = ReactTable<DataGridFeatures, T, TSelected>;
41
+ type DataGridRow<T extends RowData> = Row<DataGridFeatures, T>;
42
+ type DataGridColumn<T extends RowData> = Column<DataGridFeatures, T, CellData>;
43
+ declare function getDataGridColumnLabel<T extends RowData>(column: DataGridColumn<T>): string;
44
+ interface IDataGridHeaderRowsProps<T extends RowData> {
45
+ table: CoreTable<DataGridFeatures, T>;
46
+ /** Adds a resize handle to each resizable column; only fixed-layout grids honor column sizes. */
47
+ isResizable?: boolean;
48
+ }
49
+ /** Header rows with sort state, column layout, and optional resize handles. */
50
+ declare function DataGridHeaderRows<T extends RowData>({ table, isResizable, }: IDataGridHeaderRowsProps<T>): ReactElement;
51
+ interface IDataGridCellsProps<T extends RowData> {
52
+ row: DataGridRow<T>;
53
+ }
54
+ /** A row's visible cells, laid out by their column `meta`; render them inside a custom `TableRow`. */
55
+ declare function DataGridCells<T extends RowData>({ row }: IDataGridCellsProps<T>): ReactElement;
56
+ interface IDataGridColumnsProps<T extends RowData> {
57
+ table: CoreTable<DataGridFeatures, T>;
58
+ }
59
+ /** Column widths for a fixed-layout grid; sizes resolve through the variables `useDataGridColumnSizes` writes. */
60
+ declare function DataGridColumns<T extends RowData>({ table }: IDataGridColumnsProps<T>): ReactElement;
22
61
  type DataGridProps<T extends RowData> = IDensityProps & {
23
62
  table: DataGridTable<T>;
24
63
  label: string;
@@ -29,7 +68,7 @@ type DataGridProps<T extends RowData> = IDensityProps & {
29
68
  };
30
69
  declare function DataGrid<T extends RowData>({ table, label, toolbar, empty, loading, pagination, density, }: DataGridProps<T>): ReactElement;
31
70
  declare function DataGridColumnHeader<T extends RowData, V extends CellData>({ column, children, }: {
32
- column: Column<typeof dataGridFeatures, T, V>;
71
+ column: Column<DataGridFeatures, T, V>;
33
72
  children: ReactNode;
34
73
  }): ReactElement;
35
74
  declare function DataGridFilter<T extends RowData>({ table, columnId, label, }: {
@@ -40,5 +79,5 @@ declare function DataGridFilter<T extends RowData>({ table, columnId, label, }:
40
79
  declare function DataGridPagination<T extends RowData>({ table }: {
41
80
  table: DataGridTable<T>;
42
81
  }): ReactElement;
43
- export { DataGrid, DataGridColumnHeader, DataGridFilter, DataGridPagination, dataGridFeatures };
44
- export type { DataGridProps, DataGridTable };
82
+ export { DataGrid, DataGridCells, DataGridColumnHeader, DataGridColumns, DataGridFilter, DataGridHeaderRows, DataGridPagination, dataGridFeatures, getDataGridColumnLabel, };
83
+ export type { DataGridColumn, DataGridFeatures, DataGridProps, DataGridRow, DataGridTable, IDataGridColumnMeta };
@@ -0,0 +1,14 @@
1
+ import { type RowData, type Table } from "@tanstack/react-table";
2
+ import type { ReactElement } from "react";
3
+ import { type DataGridFeatures } from "./DataGrid.js";
4
+ interface IDataGridColumnOptionsProps<T extends RowData> {
5
+ table: Table<DataGridFeatures, T>;
6
+ /** Trigger and popover title. */
7
+ label?: string;
8
+ }
9
+ /**
10
+ * Shows, hides, and reorders the columns that allow hiding. Columns with `enableHiding: false` keep their positions.
11
+ * Reset restores the table's initial visibility, order, and sizes.
12
+ */
13
+ export declare function DataGridColumnOptions<T extends RowData>({ table, label, }: IDataGridColumnOptionsProps<T>): ReactElement;
14
+ export {};
@@ -0,0 +1,13 @@
1
+ import { type CellData, type Header, type RowData } from "@tanstack/react-table";
2
+ import type { ReactElement } from "react";
3
+ import type { DataGridFeatures } from "./DataGrid.js";
4
+ interface IDataGridColumnResizerProps<T extends RowData> {
5
+ header: Header<DataGridFeatures, T, CellData>;
6
+ label: string;
7
+ }
8
+ /**
9
+ * A window-splitter handle at a header's trailing edge: drag it, use the arrow keys, Home, or End, or double-click it
10
+ * to restore the default width.
11
+ */
12
+ export declare function DataGridColumnResizer<T extends RowData>({ header, label, }: IDataGridColumnResizerProps<T>): ReactElement;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { RowData, Table, TableFeatures } from "@tanstack/react-table";
2
+ /**
3
+ * Maps each leaf column ID to the CSS variable holding its width. Variables follow definition order, so reordering or
4
+ * hiding columns never moves a width to another column.
5
+ */
6
+ export declare function getDataGridColumnSizeVariables<TFeatures extends TableFeatures, T extends RowData>(table: Table<TFeatures, T>): Map<string, string>;
@@ -0,0 +1,8 @@
1
+ import type { RowData, Table } from "@tanstack/react-table";
2
+ import { type RefObject } from "react";
3
+ import type { DataGridFeatures } from "../DataGrid.js";
4
+ /**
5
+ * Writes every column's size to its CSS variable on `scope` whenever column sizing changes, so resizing updates widths
6
+ * without rendering the grid again.
7
+ */
8
+ export declare function useDataGridColumnSizes<T extends RowData>(table: Table<DataGridFeatures, T>, scope: RefObject<HTMLElement | null>): void;
@@ -1,2 +1,3 @@
1
- export { DataGrid, DataGridColumnHeader, DataGridFilter, DataGridPagination, dataGridFeatures } from "./DataGrid.js";
2
- export type { DataGridProps, DataGridTable } from "./DataGrid.js";
1
+ export { DataGrid, DataGridCells, DataGridColumnHeader, DataGridFilter, DataGridPagination, dataGridFeatures, } from "./DataGrid.js";
2
+ export type { DataGridColumn, DataGridFeatures, DataGridProps, DataGridRow, DataGridTable, IDataGridColumnMeta, } from "./DataGrid.js";
3
+ export { DataGridColumnOptions } from "./DataGridColumnOptions.js";