@grupor5/raya 0.2.1 → 0.2.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.
Files changed (180) hide show
  1. package/README.md +47 -4
  2. package/dist/atoms/avatar/index.d.mts +12 -0
  3. package/dist/atoms/avatar/index.d.ts +12 -0
  4. package/dist/atoms/avatar/index.js +99 -0
  5. package/dist/atoms/avatar/index.mjs +76 -0
  6. package/dist/atoms/badge/index.d.mts +16 -0
  7. package/dist/atoms/badge/index.d.ts +16 -0
  8. package/dist/atoms/badge/index.js +149 -0
  9. package/dist/atoms/badge/index.mjs +146 -0
  10. package/dist/atoms/button/index.d.mts +11 -0
  11. package/dist/atoms/button/index.d.ts +11 -0
  12. package/dist/atoms/button/index.js +307 -0
  13. package/dist/atoms/button/index.mjs +301 -0
  14. package/dist/atoms/checkbox/index.d.mts +6 -0
  15. package/dist/atoms/checkbox/index.d.ts +6 -0
  16. package/dist/atoms/checkbox/index.js +98 -0
  17. package/dist/atoms/checkbox/index.mjs +75 -0
  18. package/dist/atoms/input/index.d.mts +12 -0
  19. package/dist/atoms/input/index.d.ts +12 -0
  20. package/dist/atoms/input/index.js +104 -0
  21. package/dist/atoms/input/index.mjs +82 -0
  22. package/dist/atoms/label/index.d.mts +8 -0
  23. package/dist/atoms/label/index.d.ts +8 -0
  24. package/dist/atoms/label/index.js +77 -0
  25. package/dist/atoms/label/index.mjs +54 -0
  26. package/dist/atoms/radio/index.d.mts +7 -0
  27. package/dist/atoms/radio/index.d.ts +7 -0
  28. package/dist/atoms/radio/index.js +97 -0
  29. package/dist/atoms/radio/index.mjs +73 -0
  30. package/dist/atoms/switch/index.d.mts +6 -0
  31. package/dist/atoms/switch/index.d.ts +6 -0
  32. package/dist/atoms/switch/index.js +97 -0
  33. package/dist/atoms/switch/index.mjs +74 -0
  34. package/dist/atoms/tag/index.d.mts +14 -0
  35. package/dist/atoms/tag/index.d.ts +14 -0
  36. package/dist/atoms/tag/index.js +128 -0
  37. package/dist/atoms/tag/index.mjs +122 -0
  38. package/dist/atoms/textarea/index.d.mts +11 -0
  39. package/dist/atoms/textarea/index.d.ts +11 -0
  40. package/dist/atoms/textarea/index.js +125 -0
  41. package/dist/atoms/textarea/index.mjs +103 -0
  42. package/dist/atoms/typography/index.d.mts +20 -0
  43. package/dist/atoms/typography/index.d.ts +20 -0
  44. package/dist/atoms/typography/index.js +140 -0
  45. package/dist/atoms/typography/index.mjs +115 -0
  46. package/dist/hooks/index.d.mts +1 -0
  47. package/dist/hooks/index.d.ts +1 -0
  48. package/dist/hooks/index.js +17 -0
  49. package/dist/hooks/index.mjs +15 -0
  50. package/dist/hooks/use-pagination.d.mts +10 -0
  51. package/dist/hooks/use-pagination.d.ts +10 -0
  52. package/dist/hooks/use-pagination.js +54 -0
  53. package/dist/hooks/use-pagination.mjs +51 -0
  54. package/dist/hooks/use-toast.d.mts +2 -0
  55. package/dist/hooks/use-toast.d.ts +2 -0
  56. package/dist/hooks/use-toast.js +2 -0
  57. package/dist/hooks/use-toast.mjs +1 -0
  58. package/dist/hooks/useModal.d.mts +7 -0
  59. package/dist/hooks/useModal.d.ts +7 -0
  60. package/dist/hooks/useModal.js +17 -0
  61. package/dist/hooks/useModal.mjs +15 -0
  62. package/dist/index.d.mts +50 -1298
  63. package/dist/index.d.ts +50 -1298
  64. package/dist/molecules/accordion/index.d.mts +17 -0
  65. package/dist/molecules/accordion/index.d.ts +17 -0
  66. package/dist/molecules/accordion/index.js +154 -0
  67. package/dist/molecules/accordion/index.mjs +128 -0
  68. package/dist/molecules/alert/index.d.mts +14 -0
  69. package/dist/molecules/alert/index.d.ts +14 -0
  70. package/dist/molecules/alert/index.js +425 -0
  71. package/dist/molecules/alert/index.mjs +402 -0
  72. package/dist/molecules/card/index.d.mts +10 -0
  73. package/dist/molecules/card/index.d.ts +10 -0
  74. package/dist/molecules/card/index.js +128 -0
  75. package/dist/molecules/card/index.mjs +101 -0
  76. package/dist/molecules/chart/index.d.mts +80 -0
  77. package/dist/molecules/chart/index.d.ts +80 -0
  78. package/dist/molecules/chart/index.js +300 -0
  79. package/dist/molecules/chart/index.mjs +272 -0
  80. package/dist/molecules/data-table/index.d.mts +57 -0
  81. package/dist/molecules/data-table/index.d.ts +57 -0
  82. package/dist/molecules/data-table/index.js +1456 -0
  83. package/dist/molecules/data-table/index.mjs +1430 -0
  84. package/dist/molecules/date-picker/index.d.mts +12 -0
  85. package/dist/molecules/date-picker/index.d.ts +12 -0
  86. package/dist/molecules/date-picker/index.js +756 -0
  87. package/dist/molecules/date-picker/index.mjs +734 -0
  88. package/dist/molecules/dropdown/index.d.mts +21 -0
  89. package/dist/molecules/dropdown/index.d.ts +21 -0
  90. package/dist/molecules/dropdown/index.js +221 -0
  91. package/dist/molecules/dropdown/index.mjs +198 -0
  92. package/dist/molecules/form/index.d.mts +19 -0
  93. package/dist/molecules/form/index.d.ts +19 -0
  94. package/dist/molecules/form/index.js +139 -0
  95. package/dist/molecules/form/index.mjs +114 -0
  96. package/dist/molecules/pagination/index.d.mts +15 -0
  97. package/dist/molecules/pagination/index.d.ts +15 -0
  98. package/dist/molecules/pagination/index.js +605 -0
  99. package/dist/molecules/pagination/index.mjs +583 -0
  100. package/dist/molecules/progress-bar/index.d.mts +15 -0
  101. package/dist/molecules/progress-bar/index.d.ts +15 -0
  102. package/dist/molecules/progress-bar/index.js +166 -0
  103. package/dist/molecules/progress-bar/index.mjs +144 -0
  104. package/dist/molecules/select/index.d.mts +15 -0
  105. package/dist/molecules/select/index.d.ts +15 -0
  106. package/dist/molecules/select/index.js +201 -0
  107. package/dist/molecules/select/index.mjs +169 -0
  108. package/dist/molecules/stepper/index.d.mts +67 -0
  109. package/dist/molecules/stepper/index.d.ts +67 -0
  110. package/dist/molecules/stepper/index.js +287 -0
  111. package/dist/molecules/stepper/index.mjs +260 -0
  112. package/dist/molecules/tabs/index.d.mts +9 -0
  113. package/dist/molecules/tabs/index.d.ts +9 -0
  114. package/dist/molecules/tabs/index.js +112 -0
  115. package/dist/molecules/tabs/index.mjs +86 -0
  116. package/dist/tokens/badge.d.mts +39 -0
  117. package/dist/tokens/badge.d.ts +39 -0
  118. package/dist/tokens/badge.js +61 -0
  119. package/dist/tokens/badge.mjs +59 -0
  120. package/dist/tokens/buttons.d.mts +277 -0
  121. package/dist/tokens/buttons.d.ts +277 -0
  122. package/dist/tokens/buttons.js +191 -0
  123. package/dist/tokens/buttons.mjs +173 -0
  124. package/dist/tokens/colors.d.mts +65 -0
  125. package/dist/tokens/colors.d.ts +65 -0
  126. package/dist/tokens/colors.js +68 -0
  127. package/dist/tokens/colors.mjs +66 -0
  128. package/dist/tokens/effects.d.mts +124 -0
  129. package/dist/tokens/effects.d.ts +124 -0
  130. package/dist/tokens/effects.js +130 -0
  131. package/dist/tokens/effects.mjs +115 -0
  132. package/dist/tokens/grids.d.mts +331 -0
  133. package/dist/tokens/grids.d.ts +331 -0
  134. package/dist/tokens/grids.js +305 -0
  135. package/dist/tokens/grids.mjs +292 -0
  136. package/dist/tokens/icons.d.mts +134 -0
  137. package/dist/tokens/icons.d.ts +134 -0
  138. package/dist/tokens/icons.js +108 -0
  139. package/dist/tokens/icons.mjs +97 -0
  140. package/dist/tokens/index.d.mts +6 -0
  141. package/dist/tokens/index.d.ts +6 -0
  142. package/dist/tokens/index.js +775 -0
  143. package/dist/tokens/index.mjs +743 -0
  144. package/dist/tokens/progress-bar.d.mts +31 -0
  145. package/dist/tokens/progress-bar.d.ts +31 -0
  146. package/dist/tokens/progress-bar.js +70 -0
  147. package/dist/tokens/progress-bar.mjs +68 -0
  148. package/dist/tokens/spacing.d.mts +90 -0
  149. package/dist/tokens/spacing.d.ts +90 -0
  150. package/dist/tokens/spacing.js +120 -0
  151. package/dist/tokens/spacing.mjs +109 -0
  152. package/dist/tokens/stroke.d.mts +292 -0
  153. package/dist/tokens/stroke.d.ts +292 -0
  154. package/dist/tokens/stroke.js +202 -0
  155. package/dist/tokens/stroke.mjs +186 -0
  156. package/dist/tokens/tab.d.mts +31 -0
  157. package/dist/tokens/tab.d.ts +31 -0
  158. package/dist/tokens/tab.js +48 -0
  159. package/dist/tokens/tab.mjs +46 -0
  160. package/dist/tokens/tag.d.mts +53 -0
  161. package/dist/tokens/tag.d.ts +53 -0
  162. package/dist/tokens/tag.js +80 -0
  163. package/dist/tokens/tag.mjs +78 -0
  164. package/dist/tokens/typography.d.mts +394 -0
  165. package/dist/tokens/typography.d.ts +394 -0
  166. package/dist/tokens/typography.js +302 -0
  167. package/dist/tokens/typography.mjs +292 -0
  168. package/dist/utils/classNames.d.mts +3 -0
  169. package/dist/utils/classNames.d.ts +3 -0
  170. package/dist/utils/classNames.js +8 -0
  171. package/dist/utils/classNames.mjs +6 -0
  172. package/dist/utils/cn.d.mts +5 -0
  173. package/dist/utils/cn.d.ts +5 -0
  174. package/dist/utils/cn.js +11 -0
  175. package/dist/utils/cn.mjs +9 -0
  176. package/dist/utils/index.d.mts +3 -0
  177. package/dist/utils/index.d.ts +3 -0
  178. package/dist/utils/index.js +15 -0
  179. package/dist/utils/index.mjs +12 -0
  180. package/package.json +34 -1
@@ -0,0 +1,272 @@
1
+ import * as React from 'react';
2
+ import * as RechartsPrimitive from 'recharts';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __defProps = Object.defineProperties;
9
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
10
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
+ var __spreadValues = (a, b) => {
15
+ for (var prop in b || (b = {}))
16
+ if (__hasOwnProp.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ if (__getOwnPropSymbols)
19
+ for (var prop of __getOwnPropSymbols(b)) {
20
+ if (__propIsEnum.call(b, prop))
21
+ __defNormalProp(a, prop, b[prop]);
22
+ }
23
+ return a;
24
+ };
25
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
+ var __objRest = (source, exclude) => {
27
+ var target = {};
28
+ for (var prop in source)
29
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
+ target[prop] = source[prop];
31
+ if (source != null && __getOwnPropSymbols)
32
+ for (var prop of __getOwnPropSymbols(source)) {
33
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
+ target[prop] = source[prop];
35
+ }
36
+ return target;
37
+ };
38
+ function cn(...inputs) {
39
+ return twMerge(clsx(inputs));
40
+ }
41
+ var THEMES = { light: "", dark: ".dark" };
42
+ var ChartContext = React.createContext(null);
43
+ function useChart() {
44
+ const context = React.useContext(ChartContext);
45
+ if (!context) {
46
+ throw new Error("useChart must be used within a <ChartContainer />");
47
+ }
48
+ return context;
49
+ }
50
+ var ChartContainer = React.forwardRef((_a, ref) => {
51
+ var _b = _a, { id, className, children, config } = _b, props = __objRest(_b, ["id", "className", "children", "config"]);
52
+ const uniqueId = React.useId();
53
+ const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
54
+ return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
55
+ "div",
56
+ __spreadProps(__spreadValues({
57
+ "data-chart": chartId,
58
+ ref,
59
+ className: cn(
60
+ "flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
61
+ className
62
+ )
63
+ }, props), {
64
+ children: [
65
+ /* @__PURE__ */ jsx(ChartStyle, { id: chartId, config }),
66
+ /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, { children })
67
+ ]
68
+ })
69
+ ) });
70
+ });
71
+ ChartContainer.displayName = "Chart";
72
+ var ChartStyle = ({ id, config }) => {
73
+ const colorConfig = Object.entries(config).filter(
74
+ ([, config2]) => config2.theme || config2.color
75
+ );
76
+ if (!colorConfig.length) {
77
+ return null;
78
+ }
79
+ return /* @__PURE__ */ jsx(
80
+ "style",
81
+ {
82
+ dangerouslySetInnerHTML: {
83
+ __html: Object.entries(THEMES).map(
84
+ ([theme, prefix]) => `
85
+ ${prefix} [data-chart=${id}] {
86
+ ${colorConfig.map(([key, itemConfig]) => {
87
+ var _a;
88
+ const color = ((_a = itemConfig.theme) == null ? void 0 : _a[theme]) || itemConfig.color;
89
+ return color ? ` --color-${key}: ${color};` : null;
90
+ }).join("\n")}
91
+ }
92
+ `
93
+ ).join("\n")
94
+ }
95
+ }
96
+ );
97
+ };
98
+ var ChartTooltip = RechartsPrimitive.Tooltip;
99
+ var ChartTooltipContent = React.forwardRef(
100
+ ({
101
+ active,
102
+ payload,
103
+ className,
104
+ indicator = "dot",
105
+ hideLabel = false,
106
+ hideIndicator = false,
107
+ label,
108
+ labelFormatter,
109
+ labelClassName,
110
+ formatter,
111
+ color,
112
+ nameKey,
113
+ labelKey
114
+ }, ref) => {
115
+ const { config } = useChart();
116
+ const tooltipLabel = React.useMemo(() => {
117
+ var _a;
118
+ if (hideLabel || !(payload == null ? void 0 : payload.length)) {
119
+ return null;
120
+ }
121
+ const [item] = payload;
122
+ const key = `${labelKey || (item == null ? void 0 : item.dataKey) || (item == null ? void 0 : item.name) || "value"}`;
123
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
124
+ const value = !labelKey && typeof label === "string" ? ((_a = config[label]) == null ? void 0 : _a.label) || label : itemConfig == null ? void 0 : itemConfig.label;
125
+ if (labelFormatter) {
126
+ return /* @__PURE__ */ jsx("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
127
+ }
128
+ if (!value) {
129
+ return null;
130
+ }
131
+ return /* @__PURE__ */ jsx("div", { className: cn("font-medium", labelClassName), children: value });
132
+ }, [
133
+ label,
134
+ labelFormatter,
135
+ payload,
136
+ hideLabel,
137
+ labelClassName,
138
+ config,
139
+ labelKey
140
+ ]);
141
+ if (!active || !(payload == null ? void 0 : payload.length)) {
142
+ return null;
143
+ }
144
+ const nestLabel = payload.length === 1 && indicator !== "dot";
145
+ return /* @__PURE__ */ jsxs(
146
+ "div",
147
+ {
148
+ ref,
149
+ className: cn(
150
+ "grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
151
+ className
152
+ ),
153
+ children: [
154
+ !nestLabel ? tooltipLabel : null,
155
+ /* @__PURE__ */ jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
156
+ const key = `${nameKey || item.name || item.dataKey || "value"}`;
157
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
158
+ const indicatorColor = color || item.payload.fill || item.color;
159
+ return /* @__PURE__ */ jsx(
160
+ "div",
161
+ {
162
+ className: cn(
163
+ "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
164
+ indicator === "dot" && "items-center"
165
+ ),
166
+ children: formatter && (item == null ? void 0 : item.value) !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs(Fragment, { children: [
167
+ (itemConfig == null ? void 0 : itemConfig.icon) ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx(
168
+ "div",
169
+ {
170
+ className: cn(
171
+ "shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",
172
+ {
173
+ "h-2.5 w-2.5": indicator === "dot",
174
+ "w-1": indicator === "line",
175
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
176
+ "my-0.5": nestLabel && indicator === "dashed"
177
+ }
178
+ ),
179
+ style: {
180
+ "--color-bg": indicatorColor,
181
+ "--color-border": indicatorColor
182
+ }
183
+ }
184
+ ),
185
+ /* @__PURE__ */ jsxs(
186
+ "div",
187
+ {
188
+ className: cn(
189
+ "flex flex-1 justify-between leading-none",
190
+ nestLabel ? "items-end" : "items-center"
191
+ ),
192
+ children: [
193
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-1.5", children: [
194
+ nestLabel ? tooltipLabel : null,
195
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: (itemConfig == null ? void 0 : itemConfig.label) || item.name })
196
+ ] }),
197
+ item.value && /* @__PURE__ */ jsx("span", { className: "font-mono font-medium tabular-nums text-foreground", children: item.value.toLocaleString() })
198
+ ]
199
+ }
200
+ )
201
+ ] })
202
+ },
203
+ item.dataKey
204
+ );
205
+ }) })
206
+ ]
207
+ }
208
+ );
209
+ }
210
+ );
211
+ ChartTooltipContent.displayName = "ChartTooltip";
212
+ var ChartLegend = RechartsPrimitive.Legend;
213
+ var ChartLegendContent = React.forwardRef(
214
+ ({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
215
+ const { config } = useChart();
216
+ if (!(payload == null ? void 0 : payload.length)) {
217
+ return null;
218
+ }
219
+ return /* @__PURE__ */ jsx(
220
+ "div",
221
+ {
222
+ ref,
223
+ className: cn(
224
+ "flex items-center justify-center gap-4",
225
+ verticalAlign === "top" ? "pb-3" : "pt-3",
226
+ className
227
+ ),
228
+ children: payload.map((item) => {
229
+ const key = `${nameKey || item.dataKey || "value"}`;
230
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
231
+ return /* @__PURE__ */ jsxs(
232
+ "div",
233
+ {
234
+ className: cn(
235
+ "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
236
+ ),
237
+ children: [
238
+ (itemConfig == null ? void 0 : itemConfig.icon) && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx(
239
+ "div",
240
+ {
241
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
242
+ style: {
243
+ backgroundColor: item.color
244
+ }
245
+ }
246
+ ),
247
+ itemConfig == null ? void 0 : itemConfig.label
248
+ ]
249
+ },
250
+ item.value
251
+ );
252
+ })
253
+ }
254
+ );
255
+ }
256
+ );
257
+ ChartLegendContent.displayName = "ChartLegend";
258
+ function getPayloadConfigFromPayload(config, payload, key) {
259
+ if (typeof payload !== "object" || payload === null) {
260
+ return void 0;
261
+ }
262
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
263
+ let configLabelKey = key;
264
+ if (key in payload && typeof payload[key] === "string") {
265
+ configLabelKey = payload[key];
266
+ } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
267
+ configLabelKey = payloadPayload[key];
268
+ }
269
+ return configLabelKey in config ? config[configLabelKey] : config[key];
270
+ }
271
+
272
+ export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { ColumnDef, Table } from '@tanstack/react-table';
4
+
5
+ interface DataTableToolbarProps {
6
+ category?: string;
7
+ title?: string;
8
+ description?: string;
9
+ showSearch?: boolean;
10
+ searchValue?: string;
11
+ onSearchChange?: (value: string) => void;
12
+ searchPlaceholder?: string;
13
+ actions?: React.ReactNode;
14
+ }
15
+
16
+ declare module "@tanstack/react-table" {
17
+ interface ColumnMeta<TData extends unknown, TValue extends unknown> {
18
+ skeleton: React.ComponentType;
19
+ }
20
+ }
21
+ interface DataTableProps<TData, TValue> extends Omit<DataTableToolbarProps, "onSearchChange" | "searchValue"> {
22
+ columns: ColumnDef<TData, TValue>[];
23
+ data: TData[];
24
+ isLoading?: boolean;
25
+ searchKey?: string;
26
+ }
27
+ declare function DataTable<TData, TValue>({ columns, data, isLoading, searchKey, ...toolbarProps }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
28
+
29
+ type Payment = {
30
+ id: string;
31
+ amount: number;
32
+ status: "pending" | "processing" | "success" | "failed";
33
+ email: string;
34
+ firstName: string;
35
+ lastName: string;
36
+ jobTitle: string;
37
+ company: string;
38
+ city: string;
39
+ country: string;
40
+ phone: string;
41
+ website: string;
42
+ bio: string;
43
+ streetAddress: string;
44
+ zipCode: string;
45
+ secondaryAddress: string;
46
+ state: string;
47
+ username: string;
48
+ favoriteColor: string;
49
+ };
50
+ declare const columns: ColumnDef<Payment>[];
51
+
52
+ interface DataTablePaginationProps<TData> {
53
+ table: Table<TData>;
54
+ }
55
+ declare function DataTablePagination<TData>({ table, }: DataTablePaginationProps<TData>): react_jsx_runtime.JSX.Element;
56
+
57
+ export { DataTable, DataTablePagination, type DataTableProps, type Payment, columns };
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { ColumnDef, Table } from '@tanstack/react-table';
4
+
5
+ interface DataTableToolbarProps {
6
+ category?: string;
7
+ title?: string;
8
+ description?: string;
9
+ showSearch?: boolean;
10
+ searchValue?: string;
11
+ onSearchChange?: (value: string) => void;
12
+ searchPlaceholder?: string;
13
+ actions?: React.ReactNode;
14
+ }
15
+
16
+ declare module "@tanstack/react-table" {
17
+ interface ColumnMeta<TData extends unknown, TValue extends unknown> {
18
+ skeleton: React.ComponentType;
19
+ }
20
+ }
21
+ interface DataTableProps<TData, TValue> extends Omit<DataTableToolbarProps, "onSearchChange" | "searchValue"> {
22
+ columns: ColumnDef<TData, TValue>[];
23
+ data: TData[];
24
+ isLoading?: boolean;
25
+ searchKey?: string;
26
+ }
27
+ declare function DataTable<TData, TValue>({ columns, data, isLoading, searchKey, ...toolbarProps }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
28
+
29
+ type Payment = {
30
+ id: string;
31
+ amount: number;
32
+ status: "pending" | "processing" | "success" | "failed";
33
+ email: string;
34
+ firstName: string;
35
+ lastName: string;
36
+ jobTitle: string;
37
+ company: string;
38
+ city: string;
39
+ country: string;
40
+ phone: string;
41
+ website: string;
42
+ bio: string;
43
+ streetAddress: string;
44
+ zipCode: string;
45
+ secondaryAddress: string;
46
+ state: string;
47
+ username: string;
48
+ favoriteColor: string;
49
+ };
50
+ declare const columns: ColumnDef<Payment>[];
51
+
52
+ interface DataTablePaginationProps<TData> {
53
+ table: Table<TData>;
54
+ }
55
+ declare function DataTablePagination<TData>({ table, }: DataTablePaginationProps<TData>): react_jsx_runtime.JSX.Element;
56
+
57
+ export { DataTable, DataTablePagination, type DataTableProps, type Payment, columns };