@grupor5/raya 0.2.1 → 0.2.3
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/README.md +68 -4
- package/dist/atoms/avatar/index.d.mts +12 -0
- package/dist/atoms/avatar/index.d.ts +12 -0
- package/dist/atoms/avatar/index.js +99 -0
- package/dist/atoms/avatar/index.mjs +76 -0
- package/dist/atoms/badge/index.d.mts +16 -0
- package/dist/atoms/badge/index.d.ts +16 -0
- package/dist/atoms/badge/index.js +149 -0
- package/dist/atoms/badge/index.mjs +146 -0
- package/dist/atoms/button/index.d.mts +11 -0
- package/dist/atoms/button/index.d.ts +11 -0
- package/dist/atoms/button/index.js +307 -0
- package/dist/atoms/button/index.mjs +301 -0
- package/dist/atoms/checkbox/index.d.mts +6 -0
- package/dist/atoms/checkbox/index.d.ts +6 -0
- package/dist/atoms/checkbox/index.js +98 -0
- package/dist/atoms/checkbox/index.mjs +75 -0
- package/dist/atoms/input/index.d.mts +12 -0
- package/dist/atoms/input/index.d.ts +12 -0
- package/dist/atoms/input/index.js +104 -0
- package/dist/atoms/input/index.mjs +82 -0
- package/dist/atoms/label/index.d.mts +8 -0
- package/dist/atoms/label/index.d.ts +8 -0
- package/dist/atoms/label/index.js +77 -0
- package/dist/atoms/label/index.mjs +54 -0
- package/dist/atoms/radio/index.d.mts +7 -0
- package/dist/atoms/radio/index.d.ts +7 -0
- package/dist/atoms/radio/index.js +97 -0
- package/dist/atoms/radio/index.mjs +73 -0
- package/dist/atoms/switch/index.d.mts +6 -0
- package/dist/atoms/switch/index.d.ts +6 -0
- package/dist/atoms/switch/index.js +97 -0
- package/dist/atoms/switch/index.mjs +74 -0
- package/dist/atoms/tag/index.d.mts +14 -0
- package/dist/atoms/tag/index.d.ts +14 -0
- package/dist/atoms/tag/index.js +128 -0
- package/dist/atoms/tag/index.mjs +122 -0
- package/dist/atoms/textarea/index.d.mts +11 -0
- package/dist/atoms/textarea/index.d.ts +11 -0
- package/dist/atoms/textarea/index.js +125 -0
- package/dist/atoms/textarea/index.mjs +103 -0
- package/dist/atoms/typography/index.d.mts +20 -0
- package/dist/atoms/typography/index.d.ts +20 -0
- package/dist/atoms/typography/index.js +140 -0
- package/dist/atoms/typography/index.mjs +115 -0
- package/dist/hooks/index.d.mts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +17 -0
- package/dist/hooks/index.mjs +15 -0
- package/dist/hooks/use-pagination.d.mts +10 -0
- package/dist/hooks/use-pagination.d.ts +10 -0
- package/dist/hooks/use-pagination.js +54 -0
- package/dist/hooks/use-pagination.mjs +51 -0
- package/dist/hooks/use-toast.d.mts +2 -0
- package/dist/hooks/use-toast.d.ts +2 -0
- package/dist/hooks/use-toast.js +2 -0
- package/dist/hooks/use-toast.mjs +1 -0
- package/dist/hooks/useModal.d.mts +7 -0
- package/dist/hooks/useModal.d.ts +7 -0
- package/dist/hooks/useModal.js +17 -0
- package/dist/hooks/useModal.mjs +15 -0
- package/dist/index.d.mts +50 -1298
- package/dist/index.d.ts +50 -1298
- package/dist/molecules/accordion/index.d.mts +17 -0
- package/dist/molecules/accordion/index.d.ts +17 -0
- package/dist/molecules/accordion/index.js +154 -0
- package/dist/molecules/accordion/index.mjs +128 -0
- package/dist/molecules/alert/index.d.mts +14 -0
- package/dist/molecules/alert/index.d.ts +14 -0
- package/dist/molecules/alert/index.js +425 -0
- package/dist/molecules/alert/index.mjs +402 -0
- package/dist/molecules/card/index.d.mts +10 -0
- package/dist/molecules/card/index.d.ts +10 -0
- package/dist/molecules/card/index.js +128 -0
- package/dist/molecules/card/index.mjs +101 -0
- package/dist/molecules/chart/index.d.mts +80 -0
- package/dist/molecules/chart/index.d.ts +80 -0
- package/dist/molecules/chart/index.js +300 -0
- package/dist/molecules/chart/index.mjs +272 -0
- package/dist/molecules/data-table/index.d.mts +57 -0
- package/dist/molecules/data-table/index.d.ts +57 -0
- package/dist/molecules/data-table/index.js +1456 -0
- package/dist/molecules/data-table/index.mjs +1430 -0
- package/dist/molecules/date-picker/index.d.mts +12 -0
- package/dist/molecules/date-picker/index.d.ts +12 -0
- package/dist/molecules/date-picker/index.js +756 -0
- package/dist/molecules/date-picker/index.mjs +734 -0
- package/dist/molecules/dropdown/index.d.mts +21 -0
- package/dist/molecules/dropdown/index.d.ts +21 -0
- package/dist/molecules/dropdown/index.js +221 -0
- package/dist/molecules/dropdown/index.mjs +198 -0
- package/dist/molecules/form/index.d.mts +19 -0
- package/dist/molecules/form/index.d.ts +19 -0
- package/dist/molecules/form/index.js +139 -0
- package/dist/molecules/form/index.mjs +114 -0
- package/dist/molecules/pagination/index.d.mts +15 -0
- package/dist/molecules/pagination/index.d.ts +15 -0
- package/dist/molecules/pagination/index.js +605 -0
- package/dist/molecules/pagination/index.mjs +583 -0
- package/dist/molecules/progress-bar/index.d.mts +15 -0
- package/dist/molecules/progress-bar/index.d.ts +15 -0
- package/dist/molecules/progress-bar/index.js +166 -0
- package/dist/molecules/progress-bar/index.mjs +144 -0
- package/dist/molecules/select/index.d.mts +15 -0
- package/dist/molecules/select/index.d.ts +15 -0
- package/dist/molecules/select/index.js +201 -0
- package/dist/molecules/select/index.mjs +169 -0
- package/dist/molecules/stepper/index.d.mts +67 -0
- package/dist/molecules/stepper/index.d.ts +67 -0
- package/dist/molecules/stepper/index.js +287 -0
- package/dist/molecules/stepper/index.mjs +260 -0
- package/dist/molecules/tabs/index.d.mts +9 -0
- package/dist/molecules/tabs/index.d.ts +9 -0
- package/dist/molecules/tabs/index.js +112 -0
- package/dist/molecules/tabs/index.mjs +86 -0
- package/dist/tokens/badge.d.mts +39 -0
- package/dist/tokens/badge.d.ts +39 -0
- package/dist/tokens/badge.js +61 -0
- package/dist/tokens/badge.mjs +59 -0
- package/dist/tokens/buttons.d.mts +277 -0
- package/dist/tokens/buttons.d.ts +277 -0
- package/dist/tokens/buttons.js +191 -0
- package/dist/tokens/buttons.mjs +173 -0
- package/dist/tokens/colors.d.mts +65 -0
- package/dist/tokens/colors.d.ts +65 -0
- package/dist/tokens/colors.js +68 -0
- package/dist/tokens/colors.mjs +66 -0
- package/dist/tokens/effects.d.mts +124 -0
- package/dist/tokens/effects.d.ts +124 -0
- package/dist/tokens/effects.js +130 -0
- package/dist/tokens/effects.mjs +115 -0
- package/dist/tokens/grids.d.mts +331 -0
- package/dist/tokens/grids.d.ts +331 -0
- package/dist/tokens/grids.js +305 -0
- package/dist/tokens/grids.mjs +292 -0
- package/dist/tokens/icons.d.mts +134 -0
- package/dist/tokens/icons.d.ts +134 -0
- package/dist/tokens/icons.js +108 -0
- package/dist/tokens/icons.mjs +97 -0
- package/dist/tokens/index.d.mts +6 -0
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.js +775 -0
- package/dist/tokens/index.mjs +743 -0
- package/dist/tokens/progress-bar.d.mts +31 -0
- package/dist/tokens/progress-bar.d.ts +31 -0
- package/dist/tokens/progress-bar.js +70 -0
- package/dist/tokens/progress-bar.mjs +68 -0
- package/dist/tokens/spacing.d.mts +90 -0
- package/dist/tokens/spacing.d.ts +90 -0
- package/dist/tokens/spacing.js +120 -0
- package/dist/tokens/spacing.mjs +109 -0
- package/dist/tokens/stroke.d.mts +292 -0
- package/dist/tokens/stroke.d.ts +292 -0
- package/dist/tokens/stroke.js +202 -0
- package/dist/tokens/stroke.mjs +186 -0
- package/dist/tokens/tab.d.mts +31 -0
- package/dist/tokens/tab.d.ts +31 -0
- package/dist/tokens/tab.js +48 -0
- package/dist/tokens/tab.mjs +46 -0
- package/dist/tokens/tag.d.mts +53 -0
- package/dist/tokens/tag.d.ts +53 -0
- package/dist/tokens/tag.js +80 -0
- package/dist/tokens/tag.mjs +78 -0
- package/dist/tokens/typography.d.mts +394 -0
- package/dist/tokens/typography.d.ts +394 -0
- package/dist/tokens/typography.js +302 -0
- package/dist/tokens/typography.mjs +292 -0
- package/dist/utils/classNames.d.mts +3 -0
- package/dist/utils/classNames.d.ts +3 -0
- package/dist/utils/classNames.js +8 -0
- package/dist/utils/classNames.mjs +6 -0
- package/dist/utils/cn.d.mts +5 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.js +11 -0
- package/dist/utils/cn.mjs +9 -0
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.mjs +12 -0
- package/package.json +34 -1
|
@@ -0,0 +1,1456 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React2 = require('react');
|
|
4
|
+
var reactTable = require('@tanstack/react-table');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var tailwindMerge = require('tailwind-merge');
|
|
7
|
+
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
var lucideReact = require('lucide-react');
|
|
10
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
11
|
+
var SelectPrimitive = require('@radix-ui/react-select');
|
|
12
|
+
var reactIcons = require('@radix-ui/react-icons');
|
|
13
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
14
|
+
var rayaIcons = require('@grupor5/raya-icons');
|
|
15
|
+
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
16
|
+
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule) return e;
|
|
19
|
+
var n = Object.create(null);
|
|
20
|
+
if (e) {
|
|
21
|
+
Object.keys(e).forEach(function (k) {
|
|
22
|
+
if (k !== 'default') {
|
|
23
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return e[k]; }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
n.default = e;
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
36
|
+
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
|
|
37
|
+
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
38
|
+
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
39
|
+
|
|
40
|
+
var __defProp = Object.defineProperty;
|
|
41
|
+
var __defProps = Object.defineProperties;
|
|
42
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
43
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
44
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
45
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
46
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
47
|
+
var __spreadValues = (a, b) => {
|
|
48
|
+
for (var prop in b || (b = {}))
|
|
49
|
+
if (__hasOwnProp.call(b, prop))
|
|
50
|
+
__defNormalProp(a, prop, b[prop]);
|
|
51
|
+
if (__getOwnPropSymbols)
|
|
52
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
53
|
+
if (__propIsEnum.call(b, prop))
|
|
54
|
+
__defNormalProp(a, prop, b[prop]);
|
|
55
|
+
}
|
|
56
|
+
return a;
|
|
57
|
+
};
|
|
58
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
59
|
+
var __objRest = (source, exclude) => {
|
|
60
|
+
var target = {};
|
|
61
|
+
for (var prop in source)
|
|
62
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
63
|
+
target[prop] = source[prop];
|
|
64
|
+
if (source != null && __getOwnPropSymbols)
|
|
65
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
66
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
67
|
+
target[prop] = source[prop];
|
|
68
|
+
}
|
|
69
|
+
return target;
|
|
70
|
+
};
|
|
71
|
+
function cn(...inputs) {
|
|
72
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
73
|
+
}
|
|
74
|
+
var ScrollArea = React2__namespace.forwardRef((_a, ref) => {
|
|
75
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
76
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
77
|
+
ScrollAreaPrimitive__namespace.Root,
|
|
78
|
+
__spreadProps(__spreadValues({
|
|
79
|
+
ref,
|
|
80
|
+
className: cn("relative overflow-hidden", className)
|
|
81
|
+
}, props), {
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
|
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
|
|
86
|
+
]
|
|
87
|
+
})
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
91
|
+
var ScrollBar = React2__namespace.forwardRef((_a, ref) => {
|
|
92
|
+
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
93
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
+
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
95
|
+
__spreadProps(__spreadValues({
|
|
96
|
+
ref,
|
|
97
|
+
orientation,
|
|
98
|
+
className: cn(
|
|
99
|
+
"group flex touch-none select-none transition-colors",
|
|
100
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
101
|
+
orientation === "horizontal" && "h-2.5 rounded-full border-t border-t-transparent p-[1px] bg-scrollbar-track",
|
|
102
|
+
className
|
|
103
|
+
)
|
|
104
|
+
}, props), {
|
|
105
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
+
ScrollAreaPrimitive__namespace.Thumb,
|
|
107
|
+
{
|
|
108
|
+
className: cn(
|
|
109
|
+
"relative rounded-full bg-scrollbar-thumb transition-all duration-200",
|
|
110
|
+
// Altura por defecto y en hover
|
|
111
|
+
"h-1 group-hover:h-2",
|
|
112
|
+
// "Handles" en los extremos que aparecen en hover
|
|
113
|
+
"group-hover:before:absolute group-hover:before:left-1 group-hover:before:top-1/2 group-hover:before:h-1 group-hover:before:w-1 group-hover:before:-translate-y-1/2 group-hover:before:rounded-full group-hover:before:bg-white group-hover:before:content-['']",
|
|
114
|
+
"group-hover:after:absolute group-hover:after:right-1 group-hover:after:top-1/2 group-hover:after:h-1 group-hover:after:w-1 group-hover:after:-translate-y-1/2 group-hover:after:rounded-full group-hover:after:bg-white group-hover:after:content-['']"
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
})
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displayName;
|
|
122
|
+
var Table = React2__namespace.forwardRef((_a, ref) => {
|
|
123
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
124
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ScrollArea, { className: "relative w-full", children: [
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
126
|
+
"table",
|
|
127
|
+
__spreadValues({
|
|
128
|
+
ref,
|
|
129
|
+
className: cn("w-full caption-bottom text-sm", className)
|
|
130
|
+
}, props)
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "horizontal" })
|
|
133
|
+
] });
|
|
134
|
+
});
|
|
135
|
+
Table.displayName = "Table";
|
|
136
|
+
var TableHeader = React2__namespace.forwardRef((_a, ref) => {
|
|
137
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
138
|
+
return /* @__PURE__ */ jsxRuntime.jsx("thead", __spreadValues({ ref, className: cn("[&_tr]:border-b", className) }, props));
|
|
139
|
+
});
|
|
140
|
+
TableHeader.displayName = "TableHeader";
|
|
141
|
+
var TableBody = React2__namespace.forwardRef((_a, ref) => {
|
|
142
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
143
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
144
|
+
"tbody",
|
|
145
|
+
__spreadValues({
|
|
146
|
+
ref,
|
|
147
|
+
className: cn("[&_tr:last-child]:border-0", className)
|
|
148
|
+
}, props)
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
TableBody.displayName = "TableBody";
|
|
152
|
+
var TableFooter = React2__namespace.forwardRef((_a, ref) => {
|
|
153
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
154
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
155
|
+
"tfoot",
|
|
156
|
+
__spreadValues({
|
|
157
|
+
ref,
|
|
158
|
+
className: cn(
|
|
159
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
160
|
+
className
|
|
161
|
+
)
|
|
162
|
+
}, props)
|
|
163
|
+
);
|
|
164
|
+
});
|
|
165
|
+
TableFooter.displayName = "TableFooter";
|
|
166
|
+
var TableRow = React2__namespace.forwardRef((_a, ref) => {
|
|
167
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
168
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
169
|
+
"tr",
|
|
170
|
+
__spreadValues({
|
|
171
|
+
ref,
|
|
172
|
+
className: cn(
|
|
173
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
174
|
+
className
|
|
175
|
+
)
|
|
176
|
+
}, props)
|
|
177
|
+
);
|
|
178
|
+
});
|
|
179
|
+
TableRow.displayName = "TableRow";
|
|
180
|
+
var TableHead = React2__namespace.forwardRef((_a, ref) => {
|
|
181
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
182
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
183
|
+
"th",
|
|
184
|
+
__spreadValues({
|
|
185
|
+
ref,
|
|
186
|
+
className: cn(
|
|
187
|
+
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
188
|
+
className
|
|
189
|
+
)
|
|
190
|
+
}, props)
|
|
191
|
+
);
|
|
192
|
+
});
|
|
193
|
+
TableHead.displayName = "TableHead";
|
|
194
|
+
var TableCell = React2__namespace.forwardRef((_a, ref) => {
|
|
195
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
196
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
"td",
|
|
198
|
+
__spreadValues({
|
|
199
|
+
ref,
|
|
200
|
+
className: cn(
|
|
201
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
202
|
+
className
|
|
203
|
+
)
|
|
204
|
+
}, props)
|
|
205
|
+
);
|
|
206
|
+
});
|
|
207
|
+
TableCell.displayName = "TableCell";
|
|
208
|
+
var TableCaption = React2__namespace.forwardRef((_a, ref) => {
|
|
209
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
210
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
211
|
+
"caption",
|
|
212
|
+
__spreadValues({
|
|
213
|
+
ref,
|
|
214
|
+
className: cn("mt-4 text-sm text-muted-foreground", className)
|
|
215
|
+
}, props)
|
|
216
|
+
);
|
|
217
|
+
});
|
|
218
|
+
TableCaption.displayName = "TableCaption";
|
|
219
|
+
var DOTS = "...";
|
|
220
|
+
var range = (start, end) => {
|
|
221
|
+
const length = end - start + 1;
|
|
222
|
+
return Array.from({ length }, (_, idx) => idx + start);
|
|
223
|
+
};
|
|
224
|
+
var usePagination = ({
|
|
225
|
+
totalCount,
|
|
226
|
+
pageSize,
|
|
227
|
+
siblingCount = 1,
|
|
228
|
+
currentPage
|
|
229
|
+
}) => {
|
|
230
|
+
const paginationRange = React2.useMemo(() => {
|
|
231
|
+
const totalPageCount = Math.ceil(totalCount / pageSize);
|
|
232
|
+
if (totalPageCount <= 10) {
|
|
233
|
+
return range(1, totalPageCount);
|
|
234
|
+
}
|
|
235
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
236
|
+
const rightSiblingIndex = Math.min(
|
|
237
|
+
currentPage + siblingCount,
|
|
238
|
+
totalPageCount
|
|
239
|
+
);
|
|
240
|
+
const shouldShowLeftDots = leftSiblingIndex > 2;
|
|
241
|
+
const shouldShowRightDots = rightSiblingIndex < totalPageCount - 2;
|
|
242
|
+
const firstPageIndex = 1;
|
|
243
|
+
const lastPageIndex = totalPageCount;
|
|
244
|
+
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
245
|
+
const leftItemCount = 3 + 2 * siblingCount;
|
|
246
|
+
const leftRange = range(1, leftItemCount);
|
|
247
|
+
return [...leftRange, DOTS, totalPageCount];
|
|
248
|
+
}
|
|
249
|
+
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
250
|
+
const rightItemCount = 3 + 2 * siblingCount;
|
|
251
|
+
const rightRange = range(
|
|
252
|
+
totalPageCount - rightItemCount + 1,
|
|
253
|
+
totalPageCount
|
|
254
|
+
);
|
|
255
|
+
return [firstPageIndex, DOTS, ...rightRange];
|
|
256
|
+
}
|
|
257
|
+
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
258
|
+
const middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
259
|
+
return [firstPageIndex, DOTS, ...middleRange, DOTS, lastPageIndex];
|
|
260
|
+
}
|
|
261
|
+
return range(1, totalPageCount);
|
|
262
|
+
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
263
|
+
return paginationRange;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// src/tokens/buttons.ts
|
|
267
|
+
var buttonSizeClasses = {
|
|
268
|
+
sm: {
|
|
269
|
+
base: "h-8 px-2 py-1 text-sm rounded-[10px]",
|
|
270
|
+
icon: "h-8 w-8 rounded-[10px]",
|
|
271
|
+
iconSize: "w-4 h-4"
|
|
272
|
+
},
|
|
273
|
+
md: {
|
|
274
|
+
base: "h-10 px-4 py-2 text-base rounded-xl",
|
|
275
|
+
icon: "h-10 w-10 rounded-xl",
|
|
276
|
+
iconSize: "w-5 h-5"
|
|
277
|
+
},
|
|
278
|
+
lg: {
|
|
279
|
+
base: "h-12 px-6 py-3 text-lg rounded-2xl",
|
|
280
|
+
icon: "h-12 w-12 rounded-2xl",
|
|
281
|
+
iconSize: "w-[22px] h-[22px]"
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
var buttonVariantClasses = {
|
|
285
|
+
// Primary variants
|
|
286
|
+
primary: {
|
|
287
|
+
primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-[hsl(var(--primary-pressed))] disabled:bg-neutral-300 disabled:text-neutral-500",
|
|
288
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90 active:bg-secondary/80 disabled:bg-neutral-300 disabled:text-neutral-500",
|
|
289
|
+
success: "bg-emerald-600 text-white shadow-sm hover:bg-emerald-700 active:bg-emerald-800 disabled:bg-neutral-300 disabled:text-neutral-500",
|
|
290
|
+
warning: "bg-amber-600 text-white shadow-sm hover:bg-amber-700 active:bg-amber-800 disabled:bg-neutral-300 disabled:text-neutral-500",
|
|
291
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80 disabled:bg-neutral-300 disabled:text-neutral-500",
|
|
292
|
+
neutral: "bg-neutral-700 text-white shadow-sm hover:bg-neutral-800 active:bg-neutral-900 disabled:bg-neutral-300 disabled:text-neutral-500"
|
|
293
|
+
},
|
|
294
|
+
// Secondary variants (outlined)
|
|
295
|
+
secondary: {
|
|
296
|
+
primary: "border border-primary text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
|
|
297
|
+
secondary: "border border-secondary text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
|
|
298
|
+
success: "border border-emerald-600 text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
|
|
299
|
+
warning: "border border-amber-600 text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
|
|
300
|
+
destructive: "border border-destructive text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent",
|
|
301
|
+
neutral: "border border-neutral-700 text-neutral-700 bg-transparent hover:bg-neutral-50 active:bg-neutral-100 disabled:border-neutral-300 disabled:text-neutral-500 disabled:bg-transparent"
|
|
302
|
+
},
|
|
303
|
+
// Ghost variants (text only)
|
|
304
|
+
ghost: {
|
|
305
|
+
primary: "text-primary bg-transparent hover:bg-primary/10 active:bg-primary/20 disabled:text-neutral-500 disabled:bg-transparent",
|
|
306
|
+
secondary: "text-secondary bg-transparent hover:bg-secondary/10 active:bg-secondary/20 disabled:text-neutral-500 disabled:bg-transparent",
|
|
307
|
+
success: "text-emerald-600 bg-transparent hover:bg-emerald-50 active:bg-emerald-100 disabled:text-neutral-500 disabled:bg-transparent",
|
|
308
|
+
warning: "text-amber-600 bg-transparent hover:bg-amber-50 active:bg-amber-100 disabled:text-neutral-500 disabled:bg-transparent",
|
|
309
|
+
destructive: "text-destructive bg-transparent hover:bg-destructive/10 active:bg-destructive/20 disabled:text-neutral-500 disabled:bg-transparent",
|
|
310
|
+
neutral: "text-neutral-700 bg-transparent hover:bg-neutral-100 active:bg-neutral-200 disabled:text-neutral-500 disabled:bg-transparent"
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
var buttonBaseClasses = "inline-flex items-center justify-center gap-2 whitespace-nowrap font-regular transition-all duration-200 focus-visible:outline-none disabled:pointer-events-none disabled:cursor-not-allowed focus-visible:border-2 focus-visible:border-[--stroke-color-focus-border]";
|
|
314
|
+
var buttonLoadingClasses = {
|
|
315
|
+
spinner: "animate-spin",
|
|
316
|
+
container: "flex items-center justify-center gap-2",
|
|
317
|
+
text: "opacity-70"
|
|
318
|
+
};
|
|
319
|
+
var getButtonSizeClasses = (size, isIcon) => {
|
|
320
|
+
return isIcon ? buttonSizeClasses[size].icon : buttonSizeClasses[size].base;
|
|
321
|
+
};
|
|
322
|
+
var getButtonVariantClasses = (variant, color) => {
|
|
323
|
+
var _a;
|
|
324
|
+
if (variant === "icon") {
|
|
325
|
+
return buttonVariantClasses.ghost[color];
|
|
326
|
+
}
|
|
327
|
+
return ((_a = buttonVariantClasses[variant]) == null ? void 0 : _a[color]) || "";
|
|
328
|
+
};
|
|
329
|
+
var getButtonIconSize = (size) => {
|
|
330
|
+
return buttonSizeClasses[size].iconSize;
|
|
331
|
+
};
|
|
332
|
+
var defaultButtonConfig = {
|
|
333
|
+
variant: "primary",
|
|
334
|
+
size: "md",
|
|
335
|
+
color: "primary",
|
|
336
|
+
type: "button"
|
|
337
|
+
};
|
|
338
|
+
var LoadingSpinner = ({
|
|
339
|
+
size,
|
|
340
|
+
className
|
|
341
|
+
}) => {
|
|
342
|
+
const sizeClasses = {
|
|
343
|
+
sm: "w-4 h-4",
|
|
344
|
+
md: "w-5 h-5",
|
|
345
|
+
lg: "w-6 h-6"
|
|
346
|
+
};
|
|
347
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(buttonLoadingClasses.spinner, sizeClasses[size], className), children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { fill: "none", viewBox: "0 0 24 24", className: "w-full h-full", children: [
|
|
348
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
349
|
+
"circle",
|
|
350
|
+
{
|
|
351
|
+
className: "opacity-25",
|
|
352
|
+
cx: "12",
|
|
353
|
+
cy: "12",
|
|
354
|
+
r: "10",
|
|
355
|
+
stroke: "currentColor"
|
|
356
|
+
}
|
|
357
|
+
),
|
|
358
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
359
|
+
"path",
|
|
360
|
+
{
|
|
361
|
+
className: "opacity-75",
|
|
362
|
+
fill: "currentColor",
|
|
363
|
+
d: "m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
] }) });
|
|
367
|
+
};
|
|
368
|
+
var Button = React2.forwardRef((_a, ref) => {
|
|
369
|
+
var _b = _a, {
|
|
370
|
+
variant = defaultButtonConfig.variant,
|
|
371
|
+
size = defaultButtonConfig.size,
|
|
372
|
+
color = defaultButtonConfig.color,
|
|
373
|
+
disabled = false,
|
|
374
|
+
loading = false,
|
|
375
|
+
loadingText,
|
|
376
|
+
icon,
|
|
377
|
+
iconLeft,
|
|
378
|
+
iconRight,
|
|
379
|
+
className,
|
|
380
|
+
children,
|
|
381
|
+
type = defaultButtonConfig.type,
|
|
382
|
+
"aria-label": ariaLabel,
|
|
383
|
+
"aria-describedby": ariaDescribedBy,
|
|
384
|
+
asChild = false,
|
|
385
|
+
onClick
|
|
386
|
+
} = _b, props = __objRest(_b, [
|
|
387
|
+
"variant",
|
|
388
|
+
"size",
|
|
389
|
+
"color",
|
|
390
|
+
"disabled",
|
|
391
|
+
"loading",
|
|
392
|
+
"loadingText",
|
|
393
|
+
"icon",
|
|
394
|
+
"iconLeft",
|
|
395
|
+
"iconRight",
|
|
396
|
+
"className",
|
|
397
|
+
"children",
|
|
398
|
+
"type",
|
|
399
|
+
"aria-label",
|
|
400
|
+
"aria-describedby",
|
|
401
|
+
"asChild",
|
|
402
|
+
"onClick"
|
|
403
|
+
]);
|
|
404
|
+
const isIconOnly = variant === "icon" || !!(!children && (icon || iconLeft || iconRight));
|
|
405
|
+
const buttonClasses = React2.useMemo(() => {
|
|
406
|
+
const sizeClasses = getButtonSizeClasses(size, isIconOnly);
|
|
407
|
+
const variantClasses = getButtonVariantClasses(variant, color);
|
|
408
|
+
return cn(
|
|
409
|
+
buttonBaseClasses,
|
|
410
|
+
sizeClasses,
|
|
411
|
+
variantClasses,
|
|
412
|
+
className
|
|
413
|
+
);
|
|
414
|
+
}, [variant, size, color, isIconOnly, className]);
|
|
415
|
+
const buttonContent = React2.useMemo(() => {
|
|
416
|
+
if (loading) {
|
|
417
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: buttonLoadingClasses.container, children: [
|
|
418
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner, { size }),
|
|
419
|
+
loadingText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: buttonLoadingClasses.text, children: loadingText })
|
|
420
|
+
] });
|
|
421
|
+
}
|
|
422
|
+
const iconSizeClass = getButtonIconSize(size);
|
|
423
|
+
const renderIcon = (iconNode) => {
|
|
424
|
+
if (React2__namespace.default.isValidElement(iconNode)) {
|
|
425
|
+
return React2__namespace.default.cloneElement(iconNode, {
|
|
426
|
+
className: cn(iconSizeClass, iconNode.props.className),
|
|
427
|
+
"aria-hidden": true
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
return iconNode;
|
|
431
|
+
};
|
|
432
|
+
if (isIconOnly) {
|
|
433
|
+
return renderIcon(icon || iconLeft || iconRight);
|
|
434
|
+
}
|
|
435
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center justify-center gap-2", children: [
|
|
436
|
+
iconLeft && renderIcon(iconLeft),
|
|
437
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
|
|
438
|
+
iconRight && renderIcon(iconRight)
|
|
439
|
+
] });
|
|
440
|
+
}, [loading, loadingText, isIconOnly, icon, iconLeft, iconRight, children, size]);
|
|
441
|
+
const accessibilityProps = React2.useMemo(() => {
|
|
442
|
+
const props2 = {};
|
|
443
|
+
if (isIconOnly && !ariaLabel) {
|
|
444
|
+
console.warn("Icon-only buttons should have an aria-label for accessibility");
|
|
445
|
+
}
|
|
446
|
+
if (ariaLabel) {
|
|
447
|
+
props2["aria-label"] = ariaLabel;
|
|
448
|
+
}
|
|
449
|
+
if (ariaDescribedBy) {
|
|
450
|
+
props2["aria-describedby"] = ariaDescribedBy;
|
|
451
|
+
}
|
|
452
|
+
if (loading) {
|
|
453
|
+
props2["aria-busy"] = true;
|
|
454
|
+
props2["aria-disabled"] = true;
|
|
455
|
+
}
|
|
456
|
+
if (disabled || loading) {
|
|
457
|
+
props2["aria-disabled"] = true;
|
|
458
|
+
}
|
|
459
|
+
return props2;
|
|
460
|
+
}, [isIconOnly, ariaLabel, ariaDescribedBy, loading, disabled]);
|
|
461
|
+
const handleClick = (event) => {
|
|
462
|
+
if (disabled || loading) {
|
|
463
|
+
event.preventDefault();
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
onClick == null ? void 0 : onClick(event);
|
|
467
|
+
};
|
|
468
|
+
if (asChild) {
|
|
469
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
470
|
+
reactSlot.Slot,
|
|
471
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
472
|
+
ref,
|
|
473
|
+
className: buttonClasses
|
|
474
|
+
}, accessibilityProps), props), {
|
|
475
|
+
children
|
|
476
|
+
})
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
480
|
+
"button",
|
|
481
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
482
|
+
ref,
|
|
483
|
+
type,
|
|
484
|
+
className: buttonClasses,
|
|
485
|
+
disabled: disabled || loading,
|
|
486
|
+
onClick: handleClick
|
|
487
|
+
}, accessibilityProps), props), {
|
|
488
|
+
children: [
|
|
489
|
+
loading && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
490
|
+
"svg",
|
|
491
|
+
{
|
|
492
|
+
className: "animate-spin -ml-1 mr-3 h-5 w-5 text-white",
|
|
493
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
494
|
+
fill: "none",
|
|
495
|
+
viewBox: "0 0 24 24",
|
|
496
|
+
children: [
|
|
497
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
498
|
+
"circle",
|
|
499
|
+
{
|
|
500
|
+
className: "opacity-25",
|
|
501
|
+
cx: "12",
|
|
502
|
+
cy: "12",
|
|
503
|
+
r: "10",
|
|
504
|
+
stroke: "currentColor"
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
508
|
+
"path",
|
|
509
|
+
{
|
|
510
|
+
className: "opacity-75",
|
|
511
|
+
fill: "currentColor",
|
|
512
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
513
|
+
}
|
|
514
|
+
)
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
loading && loadingText ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: buttonLoadingClasses.text, children: loadingText }) : buttonContent
|
|
519
|
+
]
|
|
520
|
+
})
|
|
521
|
+
);
|
|
522
|
+
});
|
|
523
|
+
Button.displayName = "Button";
|
|
524
|
+
var Select = SelectPrimitive__namespace.Root;
|
|
525
|
+
var SelectValue = SelectPrimitive__namespace.Value;
|
|
526
|
+
var SelectTrigger = React2__namespace.forwardRef((_a, ref) => {
|
|
527
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
528
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
529
|
+
SelectPrimitive__namespace.Trigger,
|
|
530
|
+
__spreadProps(__spreadValues({
|
|
531
|
+
ref,
|
|
532
|
+
className: cn(
|
|
533
|
+
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
534
|
+
className
|
|
535
|
+
)
|
|
536
|
+
}, props), {
|
|
537
|
+
children: [
|
|
538
|
+
children,
|
|
539
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronDownIcon, { className: "h-4 w-4 opacity-50" }) })
|
|
540
|
+
]
|
|
541
|
+
})
|
|
542
|
+
);
|
|
543
|
+
});
|
|
544
|
+
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
545
|
+
var SelectScrollUpButton = React2__namespace.forwardRef((_a, ref) => {
|
|
546
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
547
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
548
|
+
SelectPrimitive__namespace.ScrollUpButton,
|
|
549
|
+
__spreadProps(__spreadValues({
|
|
550
|
+
ref,
|
|
551
|
+
className: cn(
|
|
552
|
+
"flex cursor-default items-center justify-center py-1",
|
|
553
|
+
className
|
|
554
|
+
)
|
|
555
|
+
}, props), {
|
|
556
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronUpIcon, { className: "h-4 w-4" })
|
|
557
|
+
})
|
|
558
|
+
);
|
|
559
|
+
});
|
|
560
|
+
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
561
|
+
var SelectScrollDownButton = React2__namespace.forwardRef((_a, ref) => {
|
|
562
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
563
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
564
|
+
SelectPrimitive__namespace.ScrollDownButton,
|
|
565
|
+
__spreadProps(__spreadValues({
|
|
566
|
+
ref,
|
|
567
|
+
className: cn(
|
|
568
|
+
"flex cursor-default items-center justify-center py-1",
|
|
569
|
+
className
|
|
570
|
+
)
|
|
571
|
+
}, props), {
|
|
572
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronDownIcon, { className: "h-4 w-4" })
|
|
573
|
+
})
|
|
574
|
+
);
|
|
575
|
+
});
|
|
576
|
+
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
577
|
+
var SelectContent = React2__namespace.forwardRef((_a, ref) => {
|
|
578
|
+
var _b = _a, { className, children, position = "popper" } = _b, props = __objRest(_b, ["className", "children", "position"]);
|
|
579
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
580
|
+
SelectPrimitive__namespace.Content,
|
|
581
|
+
__spreadProps(__spreadValues({
|
|
582
|
+
ref,
|
|
583
|
+
className: cn(
|
|
584
|
+
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
|
|
585
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
586
|
+
className
|
|
587
|
+
),
|
|
588
|
+
position
|
|
589
|
+
}, props), {
|
|
590
|
+
children: [
|
|
591
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
|
|
592
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
593
|
+
SelectPrimitive__namespace.Viewport,
|
|
594
|
+
{
|
|
595
|
+
className: cn(
|
|
596
|
+
"p-1",
|
|
597
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
598
|
+
),
|
|
599
|
+
children
|
|
600
|
+
}
|
|
601
|
+
),
|
|
602
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
|
|
603
|
+
]
|
|
604
|
+
})
|
|
605
|
+
) });
|
|
606
|
+
});
|
|
607
|
+
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
608
|
+
var SelectLabel = React2__namespace.forwardRef((_a, ref) => {
|
|
609
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
610
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
611
|
+
SelectPrimitive__namespace.Label,
|
|
612
|
+
__spreadValues({
|
|
613
|
+
ref,
|
|
614
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", className)
|
|
615
|
+
}, props)
|
|
616
|
+
);
|
|
617
|
+
});
|
|
618
|
+
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
619
|
+
var SelectItem = React2__namespace.forwardRef((_a, ref) => {
|
|
620
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
621
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
622
|
+
SelectPrimitive__namespace.Item,
|
|
623
|
+
__spreadProps(__spreadValues({
|
|
624
|
+
ref,
|
|
625
|
+
className: cn(
|
|
626
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
627
|
+
className
|
|
628
|
+
)
|
|
629
|
+
}, props), {
|
|
630
|
+
children: [
|
|
631
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
632
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
633
|
+
]
|
|
634
|
+
})
|
|
635
|
+
);
|
|
636
|
+
});
|
|
637
|
+
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
638
|
+
var SelectSeparator = React2__namespace.forwardRef((_a, ref) => {
|
|
639
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
640
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
641
|
+
SelectPrimitive__namespace.Separator,
|
|
642
|
+
__spreadValues({
|
|
643
|
+
ref,
|
|
644
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
645
|
+
}, props)
|
|
646
|
+
);
|
|
647
|
+
});
|
|
648
|
+
SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
|
|
649
|
+
function Pagination(_a) {
|
|
650
|
+
var _b = _a, {
|
|
651
|
+
totalCount,
|
|
652
|
+
pageSize,
|
|
653
|
+
currentPage,
|
|
654
|
+
onPageChange,
|
|
655
|
+
onPageSizeChange,
|
|
656
|
+
siblingCount = 1,
|
|
657
|
+
pageSizes = [10, 20, 30, 40, 50],
|
|
658
|
+
className
|
|
659
|
+
} = _b, props = __objRest(_b, [
|
|
660
|
+
"totalCount",
|
|
661
|
+
"pageSize",
|
|
662
|
+
"currentPage",
|
|
663
|
+
"onPageChange",
|
|
664
|
+
"onPageSizeChange",
|
|
665
|
+
"siblingCount",
|
|
666
|
+
"pageSizes",
|
|
667
|
+
"className"
|
|
668
|
+
]);
|
|
669
|
+
const paginationRange = usePagination({
|
|
670
|
+
currentPage,
|
|
671
|
+
totalCount,
|
|
672
|
+
pageSize,
|
|
673
|
+
siblingCount
|
|
674
|
+
});
|
|
675
|
+
if (currentPage === 0 || paginationRange && paginationRange.length < 2) {
|
|
676
|
+
return null;
|
|
677
|
+
}
|
|
678
|
+
const onNext = () => {
|
|
679
|
+
onPageChange(currentPage + 1);
|
|
680
|
+
};
|
|
681
|
+
const onPrevious = () => {
|
|
682
|
+
onPageChange(currentPage - 1);
|
|
683
|
+
};
|
|
684
|
+
const lastPage = paginationRange ? paginationRange[paginationRange.length - 1] : 0;
|
|
685
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
686
|
+
"div",
|
|
687
|
+
__spreadProps(__spreadValues({
|
|
688
|
+
className: cn("flex items-center justify-end space-x-6 px-2", className)
|
|
689
|
+
}, props), {
|
|
690
|
+
children: [
|
|
691
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
692
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
693
|
+
Button,
|
|
694
|
+
{
|
|
695
|
+
variant: "ghost",
|
|
696
|
+
className: "h-9 w-9 p-0",
|
|
697
|
+
onClick: onPrevious,
|
|
698
|
+
disabled: currentPage === 1,
|
|
699
|
+
children: [
|
|
700
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Go to previous page" }),
|
|
701
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { className: "h-5 w-5" })
|
|
702
|
+
]
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
paginationRange == null ? void 0 : paginationRange.map((pageNumber, index) => {
|
|
706
|
+
if (pageNumber === DOTS) {
|
|
707
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1 text-muted-foreground", children: "\u2026" }, index);
|
|
708
|
+
}
|
|
709
|
+
const isCurrent = currentPage === pageNumber;
|
|
710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
711
|
+
Button,
|
|
712
|
+
{
|
|
713
|
+
variant: "ghost",
|
|
714
|
+
className: cn(
|
|
715
|
+
"h-9 w-9 rounded-md p-0 text-sm font-medium",
|
|
716
|
+
isCurrent && "bg-pagination-current text-white hover:bg-pagination-current/90",
|
|
717
|
+
!isCurrent && "text-primary hover:bg-pagination-hover"
|
|
718
|
+
),
|
|
719
|
+
onClick: () => onPageChange(Number(pageNumber)),
|
|
720
|
+
children: pageNumber
|
|
721
|
+
},
|
|
722
|
+
index
|
|
723
|
+
);
|
|
724
|
+
}),
|
|
725
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
726
|
+
Button,
|
|
727
|
+
{
|
|
728
|
+
variant: "ghost",
|
|
729
|
+
className: "h-9 w-9 p-0",
|
|
730
|
+
onClick: onNext,
|
|
731
|
+
disabled: currentPage === lastPage,
|
|
732
|
+
children: [
|
|
733
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Go to next page" }),
|
|
734
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "h-5 w-5" })
|
|
735
|
+
]
|
|
736
|
+
}
|
|
737
|
+
)
|
|
738
|
+
] }),
|
|
739
|
+
onPageSizeChange && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
740
|
+
Select,
|
|
741
|
+
{
|
|
742
|
+
value: `${pageSize}`,
|
|
743
|
+
onValueChange: (value) => {
|
|
744
|
+
onPageSizeChange(Number(value));
|
|
745
|
+
},
|
|
746
|
+
children: [
|
|
747
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "h-9 w-auto min-w-[180px]", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: "Resultados por p\xE1gina" }) }),
|
|
748
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { side: "top", children: pageSizes.map((size) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: `${size}`, children: size }, size)) })
|
|
749
|
+
]
|
|
750
|
+
}
|
|
751
|
+
) })
|
|
752
|
+
]
|
|
753
|
+
})
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
function DataTablePagination({
|
|
757
|
+
table
|
|
758
|
+
}) {
|
|
759
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
760
|
+
Pagination,
|
|
761
|
+
{
|
|
762
|
+
currentPage: table.getState().pagination.pageIndex + 1,
|
|
763
|
+
totalCount: table.getFilteredRowModel().rows.length,
|
|
764
|
+
pageSize: table.getState().pagination.pageSize,
|
|
765
|
+
onPageChange: (page) => table.setPageIndex(page - 1),
|
|
766
|
+
onPageSizeChange: (size) => table.setPageSize(size)
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
var typographyVariants = classVarianceAuthority.cva("font-primary", {
|
|
771
|
+
variants: {
|
|
772
|
+
variant: {
|
|
773
|
+
"display-l": "text-display-l",
|
|
774
|
+
"heading-xl": "text-heading-xl",
|
|
775
|
+
"heading-lg": "text-heading-lg",
|
|
776
|
+
"heading-md": "text-heading-md",
|
|
777
|
+
"heading-sm": "text-heading-sm",
|
|
778
|
+
"subheading-lg": "text-subheading-lg",
|
|
779
|
+
"subheading-md": "text-subheading-md",
|
|
780
|
+
"subheading-sm": "text-subheading-sm",
|
|
781
|
+
"body-bold-lg": "text-body-bold-lg",
|
|
782
|
+
"body-bold-md": "text-body-bold-md",
|
|
783
|
+
"body-bold-sm": "text-body-bold-sm",
|
|
784
|
+
"body-bold-xs": "text-body-bold-xs",
|
|
785
|
+
"body-lg": "text-body-lg",
|
|
786
|
+
"body-md": "text-body-md",
|
|
787
|
+
"body-sm": "text-body-sm",
|
|
788
|
+
"body-xs": "text-body-xs",
|
|
789
|
+
"caption-c1": "text-caption-c1"
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
defaultVariants: {
|
|
793
|
+
variant: "body-md"
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
var Typography = React2__namespace.forwardRef(
|
|
797
|
+
(_a, ref) => {
|
|
798
|
+
var _b = _a, { className, variant, as: Component = "p" } = _b, props = __objRest(_b, ["className", "variant", "as"]);
|
|
799
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
800
|
+
Component,
|
|
801
|
+
__spreadValues({
|
|
802
|
+
className: cn(typographyVariants({ variant, className })),
|
|
803
|
+
ref
|
|
804
|
+
}, props)
|
|
805
|
+
);
|
|
806
|
+
}
|
|
807
|
+
);
|
|
808
|
+
Typography.displayName = "Typography";
|
|
809
|
+
var levelMapping = {
|
|
810
|
+
1: { as: "h1", variant: "display-l" },
|
|
811
|
+
2: { as: "h2", variant: "heading-xl" },
|
|
812
|
+
3: { as: "h3", variant: "heading-lg" },
|
|
813
|
+
4: { as: "h4", variant: "heading-md" },
|
|
814
|
+
5: { as: "h5", variant: "heading-sm" },
|
|
815
|
+
6: { as: "h6", variant: "subheading-lg" }
|
|
816
|
+
};
|
|
817
|
+
var Title = React2__namespace.forwardRef(
|
|
818
|
+
(_a, ref) => {
|
|
819
|
+
var _b = _a, { level, variant } = _b, props = __objRest(_b, ["level", "variant"]);
|
|
820
|
+
const { as, variant: defaultVariant } = levelMapping[level];
|
|
821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
822
|
+
Typography,
|
|
823
|
+
__spreadValues({
|
|
824
|
+
ref,
|
|
825
|
+
as,
|
|
826
|
+
variant: variant || defaultVariant
|
|
827
|
+
}, props)
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
Title.displayName = "Title";
|
|
832
|
+
var Paragraph = React2__namespace.forwardRef(
|
|
833
|
+
(_a, ref) => {
|
|
834
|
+
var _b = _a, { variant = "body-md" } = _b, props = __objRest(_b, ["variant"]);
|
|
835
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
836
|
+
Typography,
|
|
837
|
+
__spreadValues({
|
|
838
|
+
ref,
|
|
839
|
+
as: "p",
|
|
840
|
+
variant
|
|
841
|
+
}, props)
|
|
842
|
+
);
|
|
843
|
+
}
|
|
844
|
+
);
|
|
845
|
+
Paragraph.displayName = "Paragraph";
|
|
846
|
+
var Input = React2__namespace.forwardRef(
|
|
847
|
+
(_a, ref) => {
|
|
848
|
+
var _b = _a, { className, type, error, helperText, label, required, id, icon } = _b, props = __objRest(_b, ["className", "type", "error", "helperText", "label", "required", "id", "icon"]);
|
|
849
|
+
const inputId = id || `input-${React2__namespace.useId()}`;
|
|
850
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
851
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
852
|
+
"label",
|
|
853
|
+
{
|
|
854
|
+
htmlFor: inputId,
|
|
855
|
+
className: cn(
|
|
856
|
+
"text-body-xs font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
857
|
+
required && "after:content-['*'] after:text-destructive after:ml-1"
|
|
858
|
+
),
|
|
859
|
+
children: label
|
|
860
|
+
}
|
|
861
|
+
),
|
|
862
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
863
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3", children: icon }),
|
|
864
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
865
|
+
"input",
|
|
866
|
+
__spreadValues({
|
|
867
|
+
id: inputId,
|
|
868
|
+
type,
|
|
869
|
+
className: cn(
|
|
870
|
+
"flex h-10 w-full rounded-lg border border-primary-300 bg-background py-2 pr-3",
|
|
871
|
+
"text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
872
|
+
"placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
873
|
+
"focus-visible:shadow-focus active:shadow-pressed",
|
|
874
|
+
error && "border-destructive focus-visible:shadow-destructive",
|
|
875
|
+
icon ? "pl-10" : "pl-3",
|
|
876
|
+
className
|
|
877
|
+
),
|
|
878
|
+
ref,
|
|
879
|
+
"aria-invalid": error ? "true" : "false",
|
|
880
|
+
"aria-describedby": error ? `${inputId}-error` : helperText ? `${inputId}-helper` : void 0
|
|
881
|
+
}, props)
|
|
882
|
+
)
|
|
883
|
+
] }),
|
|
884
|
+
helperText && !error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${inputId}-helper`, className: "text-body-xs text-muted-foreground", children: helperText }),
|
|
885
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${inputId}-error`, className: "text-body-xs text-destructive", children: typeof error === "string" ? error : "Este campo tiene errores" })
|
|
886
|
+
] });
|
|
887
|
+
}
|
|
888
|
+
);
|
|
889
|
+
Input.displayName = "Input";
|
|
890
|
+
function DataTableToolbar({
|
|
891
|
+
category,
|
|
892
|
+
title,
|
|
893
|
+
description,
|
|
894
|
+
showSearch = true,
|
|
895
|
+
searchValue,
|
|
896
|
+
onSearchChange,
|
|
897
|
+
searchPlaceholder = "Search...",
|
|
898
|
+
actions
|
|
899
|
+
}) {
|
|
900
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end justify-between border-b border-primary-300 pb-4", children: [
|
|
901
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
902
|
+
category && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-normal uppercase tracking-wider text-primary-700", children: category }),
|
|
903
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(Title, { level: 4, children: title }),
|
|
904
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(Paragraph, { className: "text-primary-700", children: description })
|
|
905
|
+
] }),
|
|
906
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
907
|
+
showSearch && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-64", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
908
|
+
Input,
|
|
909
|
+
{
|
|
910
|
+
placeholder: searchPlaceholder,
|
|
911
|
+
value: searchValue,
|
|
912
|
+
onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
|
|
913
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(rayaIcons.SearchNormalIcon, { className: "h-4 w-4 text-primary-600" })
|
|
914
|
+
}
|
|
915
|
+
) }),
|
|
916
|
+
actions
|
|
917
|
+
] })
|
|
918
|
+
] });
|
|
919
|
+
}
|
|
920
|
+
function DataTable(_a) {
|
|
921
|
+
var _b = _a, {
|
|
922
|
+
columns: columns2,
|
|
923
|
+
data,
|
|
924
|
+
isLoading = false,
|
|
925
|
+
searchKey = "email"
|
|
926
|
+
} = _b, toolbarProps = __objRest(_b, [
|
|
927
|
+
"columns",
|
|
928
|
+
"data",
|
|
929
|
+
"isLoading",
|
|
930
|
+
"searchKey"
|
|
931
|
+
]);
|
|
932
|
+
var _a2, _b2, _c;
|
|
933
|
+
const [sorting, setSorting] = React2__namespace.useState([]);
|
|
934
|
+
const [columnFilters, setColumnFilters] = React2__namespace.useState(
|
|
935
|
+
[]
|
|
936
|
+
);
|
|
937
|
+
const [columnVisibility, setColumnVisibility] = React2__namespace.useState({});
|
|
938
|
+
const [rowSelection, setRowSelection] = React2__namespace.useState({});
|
|
939
|
+
const table = reactTable.useReactTable({
|
|
940
|
+
data,
|
|
941
|
+
columns: columns2,
|
|
942
|
+
onSortingChange: setSorting,
|
|
943
|
+
onColumnFiltersChange: setColumnFilters,
|
|
944
|
+
getCoreRowModel: reactTable.getCoreRowModel(),
|
|
945
|
+
getPaginationRowModel: reactTable.getPaginationRowModel(),
|
|
946
|
+
getSortedRowModel: reactTable.getSortedRowModel(),
|
|
947
|
+
getFilteredRowModel: reactTable.getFilteredRowModel(),
|
|
948
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
949
|
+
onRowSelectionChange: setRowSelection,
|
|
950
|
+
state: {
|
|
951
|
+
sorting,
|
|
952
|
+
columnFilters,
|
|
953
|
+
columnVisibility,
|
|
954
|
+
rowSelection
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
const { showSearch = true, actions } = toolbarProps;
|
|
958
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
959
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
960
|
+
DataTableToolbar,
|
|
961
|
+
__spreadProps(__spreadValues({}, toolbarProps), {
|
|
962
|
+
showSearch,
|
|
963
|
+
searchValue: (_b2 = (_a2 = table.getColumn(searchKey)) == null ? void 0 : _a2.getFilterValue()) != null ? _b2 : "",
|
|
964
|
+
onSearchChange: (value) => {
|
|
965
|
+
var _a3;
|
|
966
|
+
return (_a3 = table.getColumn(searchKey)) == null ? void 0 : _a3.setFilterValue(value);
|
|
967
|
+
},
|
|
968
|
+
actions
|
|
969
|
+
})
|
|
970
|
+
),
|
|
971
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border mt-4 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
|
|
972
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: "bg-header", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header, index) => {
|
|
973
|
+
const isFirst = index === 0;
|
|
974
|
+
const isLast = index === headerGroup.headers.length - 1;
|
|
975
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
976
|
+
TableHead,
|
|
977
|
+
{
|
|
978
|
+
className: cn("text-primary-1200", {
|
|
979
|
+
"text-left": isFirst,
|
|
980
|
+
"text-right": isLast,
|
|
981
|
+
"rounded-tl-md": isFirst,
|
|
982
|
+
"rounded-tr-md": isLast
|
|
983
|
+
}),
|
|
984
|
+
children: header.isPlaceholder ? null : reactTable.flexRender(
|
|
985
|
+
header.column.columnDef.header,
|
|
986
|
+
header.getContext()
|
|
987
|
+
)
|
|
988
|
+
},
|
|
989
|
+
header.id
|
|
990
|
+
);
|
|
991
|
+
}) }, headerGroup.id)) }),
|
|
992
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: isLoading ? Array.from({
|
|
993
|
+
length: table.getState().pagination.pageSize
|
|
994
|
+
}).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: table.getVisibleLeafColumns().map((column, index) => {
|
|
995
|
+
var _a3;
|
|
996
|
+
const isLast = index === table.getVisibleLeafColumns().length - 1;
|
|
997
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
998
|
+
TableCell,
|
|
999
|
+
{
|
|
1000
|
+
className: cn({ "text-right": isLast }),
|
|
1001
|
+
children: ((_a3 = column.columnDef.meta) == null ? void 0 : _a3.skeleton) ? React2__namespace.createElement(
|
|
1002
|
+
column.columnDef.meta.skeleton
|
|
1003
|
+
) : null
|
|
1004
|
+
},
|
|
1005
|
+
`skeleton-cell-${column.id}`
|
|
1006
|
+
);
|
|
1007
|
+
}) }, `skeleton-row-${i}`)) : ((_c = table.getRowModel().rows) == null ? void 0 : _c.length) ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1008
|
+
TableRow,
|
|
1009
|
+
{
|
|
1010
|
+
"data-state": row.getIsSelected() && "selected",
|
|
1011
|
+
children: row.getVisibleCells().map((cell, index) => {
|
|
1012
|
+
const isLast = index === row.getVisibleCells().length - 1;
|
|
1013
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1014
|
+
TableCell,
|
|
1015
|
+
{
|
|
1016
|
+
className: cn({ "text-right": isLast }),
|
|
1017
|
+
children: reactTable.flexRender(
|
|
1018
|
+
cell.column.columnDef.cell,
|
|
1019
|
+
cell.getContext()
|
|
1020
|
+
)
|
|
1021
|
+
},
|
|
1022
|
+
cell.id
|
|
1023
|
+
);
|
|
1024
|
+
})
|
|
1025
|
+
},
|
|
1026
|
+
row.id
|
|
1027
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1028
|
+
TableCell,
|
|
1029
|
+
{
|
|
1030
|
+
colSpan: columns2.length,
|
|
1031
|
+
className: "h-24 text-center",
|
|
1032
|
+
children: "No results."
|
|
1033
|
+
}
|
|
1034
|
+
) }) })
|
|
1035
|
+
] }) }),
|
|
1036
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-4", children: /* @__PURE__ */ jsxRuntime.jsx(DataTablePagination, { table }) })
|
|
1037
|
+
] });
|
|
1038
|
+
}
|
|
1039
|
+
var Checkbox = React2__namespace.forwardRef((_a, ref) => {
|
|
1040
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1041
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1042
|
+
CheckboxPrimitive__namespace.Root,
|
|
1043
|
+
__spreadProps(__spreadValues({
|
|
1044
|
+
ref,
|
|
1045
|
+
className: cn(
|
|
1046
|
+
"peer h-5 w-5 shrink-0 rounded border-2 mx-s",
|
|
1047
|
+
"focus-visible:outline-none focus-visible:shadow-focus",
|
|
1048
|
+
// Unchecked
|
|
1049
|
+
"border-primary-1200",
|
|
1050
|
+
// Checked & Indeterminate
|
|
1051
|
+
"data-[state=checked]:bg-primary-1200 data-[state=checked]:text-neutral-10 data-[state=checked]:border-primary-1200",
|
|
1052
|
+
"data-[state=indeterminate]:bg-primary-1200 data-[state=indeterminate]:text-neutral-10 data-[state=indeterminate]:border-primary-1200",
|
|
1053
|
+
// Pressed states
|
|
1054
|
+
"data-[state=checked]:active:bg-primary-900 data-[state=indeterminate]:active:bg-primary-900",
|
|
1055
|
+
// Disabled states
|
|
1056
|
+
"disabled:cursor-not-allowed disabled:opacity-40",
|
|
1057
|
+
className
|
|
1058
|
+
)
|
|
1059
|
+
}, props), {
|
|
1060
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1061
|
+
CheckboxPrimitive__namespace.Indicator,
|
|
1062
|
+
{
|
|
1063
|
+
className: cn("flex items-center justify-center text-current"),
|
|
1064
|
+
children: props.checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" })
|
|
1065
|
+
}
|
|
1066
|
+
)
|
|
1067
|
+
})
|
|
1068
|
+
);
|
|
1069
|
+
});
|
|
1070
|
+
Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
1071
|
+
var badgeVariants = classVarianceAuthority.cva(
|
|
1072
|
+
"inline-flex items-center justify-center rounded-badge border px-badge-x py-badge-y text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
1073
|
+
{
|
|
1074
|
+
variants: {
|
|
1075
|
+
variant: {
|
|
1076
|
+
default: "border-transparent",
|
|
1077
|
+
success: "border-transparent",
|
|
1078
|
+
danger: "border-transparent",
|
|
1079
|
+
pending: "border-transparent",
|
|
1080
|
+
"in-progress": "border-transparent"
|
|
1081
|
+
},
|
|
1082
|
+
shape: {
|
|
1083
|
+
rounded: "",
|
|
1084
|
+
circular: "rounded-full !px-0"
|
|
1085
|
+
},
|
|
1086
|
+
size: {
|
|
1087
|
+
sm: "text-badge-sm",
|
|
1088
|
+
md: "text-badge-md",
|
|
1089
|
+
lg: "text-badge-lg"
|
|
1090
|
+
},
|
|
1091
|
+
visual: {
|
|
1092
|
+
solid: "",
|
|
1093
|
+
dot: "bg-transparent"
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
compoundVariants: [
|
|
1097
|
+
// Default
|
|
1098
|
+
{
|
|
1099
|
+
variant: "default",
|
|
1100
|
+
visual: "solid",
|
|
1101
|
+
className: "bg-badge-default-background text-badge-default-text-on-solid"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
variant: "default",
|
|
1105
|
+
visual: "dot",
|
|
1106
|
+
className: "text-badge-default-text"
|
|
1107
|
+
},
|
|
1108
|
+
// In Progress
|
|
1109
|
+
{
|
|
1110
|
+
variant: "in-progress",
|
|
1111
|
+
visual: "solid",
|
|
1112
|
+
className: "bg-badge-in-progress-background text-badge-in-progress-text"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
variant: "in-progress",
|
|
1116
|
+
visual: "dot",
|
|
1117
|
+
className: "text-badge-in-progress-text"
|
|
1118
|
+
},
|
|
1119
|
+
// Success
|
|
1120
|
+
{
|
|
1121
|
+
variant: "success",
|
|
1122
|
+
visual: "solid",
|
|
1123
|
+
className: "bg-badge-success-background text-badge-success-text"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
variant: "success",
|
|
1127
|
+
visual: "dot",
|
|
1128
|
+
className: "text-badge-success-text"
|
|
1129
|
+
},
|
|
1130
|
+
// Pending
|
|
1131
|
+
{
|
|
1132
|
+
variant: "pending",
|
|
1133
|
+
visual: "solid",
|
|
1134
|
+
className: "bg-badge-pending-background text-badge-pending-text"
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
variant: "pending",
|
|
1138
|
+
visual: "dot",
|
|
1139
|
+
className: "text-badge-pending-text"
|
|
1140
|
+
},
|
|
1141
|
+
// Danger
|
|
1142
|
+
{
|
|
1143
|
+
variant: "danger",
|
|
1144
|
+
visual: "solid",
|
|
1145
|
+
className: "bg-badge-danger-background text-badge-danger-text"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
variant: "danger",
|
|
1149
|
+
visual: "dot",
|
|
1150
|
+
className: "text-badge-danger-text"
|
|
1151
|
+
}
|
|
1152
|
+
],
|
|
1153
|
+
defaultVariants: {
|
|
1154
|
+
variant: "default",
|
|
1155
|
+
size: "md",
|
|
1156
|
+
visual: "solid",
|
|
1157
|
+
shape: "rounded"
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
);
|
|
1161
|
+
function Badge(_a) {
|
|
1162
|
+
var _b = _a, { className, variant, size, visual, shape } = _b, props = __objRest(_b, ["className", "variant", "size", "visual", "shape"]);
|
|
1163
|
+
const iconSize = size === "sm" ? 8 : size === "lg" ? 12 : 10;
|
|
1164
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", __spreadProps(__spreadValues({ className: cn(badgeVariants({ variant, size, visual, shape }), className) }, props), { children: [
|
|
1165
|
+
visual === "dot" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1166
|
+
rayaIcons.DotIcon,
|
|
1167
|
+
{
|
|
1168
|
+
size: iconSize,
|
|
1169
|
+
className: cn("flex-shrink-0", { "mr-1.5": !!props.children })
|
|
1170
|
+
}
|
|
1171
|
+
),
|
|
1172
|
+
props.children
|
|
1173
|
+
] }));
|
|
1174
|
+
}
|
|
1175
|
+
var statusVariantMap = {
|
|
1176
|
+
success: "success",
|
|
1177
|
+
processing: "in-progress",
|
|
1178
|
+
pending: "pending",
|
|
1179
|
+
failed: "danger"
|
|
1180
|
+
};
|
|
1181
|
+
var statusTextMap = {
|
|
1182
|
+
success: "Success",
|
|
1183
|
+
processing: "In Progress",
|
|
1184
|
+
pending: "Pending",
|
|
1185
|
+
failed: "Failed"
|
|
1186
|
+
};
|
|
1187
|
+
function BadgeCell({ status }) {
|
|
1188
|
+
const variant = statusVariantMap[status] || "default";
|
|
1189
|
+
const text = statusTextMap[status] || "Unknown";
|
|
1190
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant, children: text });
|
|
1191
|
+
}
|
|
1192
|
+
function BadgeCellSkeleton() {
|
|
1193
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-6 w-24 animate-pulse rounded-md bg-neutral-200" }) });
|
|
1194
|
+
}
|
|
1195
|
+
function TextCell({ primary, secondary }) {
|
|
1196
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
1197
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: primary }),
|
|
1198
|
+
secondary && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: secondary })
|
|
1199
|
+
] });
|
|
1200
|
+
}
|
|
1201
|
+
function TextCellSkeleton() {
|
|
1202
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col space-y-2", children: [
|
|
1203
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-40 animate-pulse rounded-md bg-neutral-200" }),
|
|
1204
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-24 animate-pulse rounded-md bg-neutral-200" })
|
|
1205
|
+
] });
|
|
1206
|
+
}
|
|
1207
|
+
function getInitials(name) {
|
|
1208
|
+
const [firstName, lastName] = name.split(" ");
|
|
1209
|
+
if (firstName && lastName) {
|
|
1210
|
+
return `${firstName[0]}${lastName[0]}`.toUpperCase();
|
|
1211
|
+
}
|
|
1212
|
+
return firstName ? `${firstName.substring(0, 2)}`.toUpperCase() : "N/A";
|
|
1213
|
+
}
|
|
1214
|
+
var Avatar = React2__namespace.forwardRef(
|
|
1215
|
+
(_a, ref) => {
|
|
1216
|
+
var _b = _a, { src, name, className } = _b, props = __objRest(_b, ["src", "name", "className"]);
|
|
1217
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1218
|
+
"div",
|
|
1219
|
+
__spreadProps(__spreadValues({
|
|
1220
|
+
ref,
|
|
1221
|
+
className: cn(
|
|
1222
|
+
"relative flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-neutral-200 text-sm font-semibold text-primary",
|
|
1223
|
+
className
|
|
1224
|
+
)
|
|
1225
|
+
}, props), {
|
|
1226
|
+
children: src ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1227
|
+
"img",
|
|
1228
|
+
{
|
|
1229
|
+
src,
|
|
1230
|
+
alt: name,
|
|
1231
|
+
className: "h-full w-full rounded-full object-cover"
|
|
1232
|
+
}
|
|
1233
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: getInitials(name) })
|
|
1234
|
+
})
|
|
1235
|
+
);
|
|
1236
|
+
}
|
|
1237
|
+
);
|
|
1238
|
+
Avatar.displayName = "Avatar";
|
|
1239
|
+
function AvatarSkeleton() {
|
|
1240
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-10 w-10 shrink-0 animate-pulse rounded-full bg-neutral-200" });
|
|
1241
|
+
}
|
|
1242
|
+
function UserCell({ avatarUrl, name, email }) {
|
|
1243
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
1244
|
+
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: avatarUrl, name }),
|
|
1245
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextCell, { primary: name, secondary: email })
|
|
1246
|
+
] });
|
|
1247
|
+
}
|
|
1248
|
+
function UserCellSkeleton() {
|
|
1249
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
1250
|
+
/* @__PURE__ */ jsxRuntime.jsx(AvatarSkeleton, {}),
|
|
1251
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextCellSkeleton, {})
|
|
1252
|
+
] });
|
|
1253
|
+
}
|
|
1254
|
+
function ActionsCell() {
|
|
1255
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end space-x-1", children: [
|
|
1256
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: [
|
|
1257
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Open menu" }),
|
|
1258
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" })
|
|
1259
|
+
] }),
|
|
1260
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: [
|
|
1261
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit" }),
|
|
1262
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "h-4 w-4" })
|
|
1263
|
+
] }),
|
|
1264
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: [
|
|
1265
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Delete" }),
|
|
1266
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
|
|
1267
|
+
] })
|
|
1268
|
+
] });
|
|
1269
|
+
}
|
|
1270
|
+
function ActionsCellSkeleton() {
|
|
1271
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-1", children: [
|
|
1272
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-pulse rounded-md bg-neutral-200" }),
|
|
1273
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-pulse rounded-md bg-neutral-200" }),
|
|
1274
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-pulse rounded-md bg-neutral-200" })
|
|
1275
|
+
] });
|
|
1276
|
+
}
|
|
1277
|
+
var SortableHeader = ({
|
|
1278
|
+
column,
|
|
1279
|
+
children,
|
|
1280
|
+
className
|
|
1281
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1282
|
+
"div",
|
|
1283
|
+
{
|
|
1284
|
+
className: cn("flex w-full items-center cursor-pointer", className),
|
|
1285
|
+
onClick: () => column.toggleSorting(column.getIsSorted() === "asc"),
|
|
1286
|
+
children: [
|
|
1287
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children }),
|
|
1288
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: "ml-auto h-4 w-4" })
|
|
1289
|
+
]
|
|
1290
|
+
}
|
|
1291
|
+
);
|
|
1292
|
+
var columns = [
|
|
1293
|
+
{
|
|
1294
|
+
id: "select",
|
|
1295
|
+
header: ({ table }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1296
|
+
Checkbox,
|
|
1297
|
+
{
|
|
1298
|
+
checked: table.getIsAllPageRowsSelected() || table.getIsSomePageRowsSelected() && "indeterminate",
|
|
1299
|
+
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
|
|
1300
|
+
"aria-label": "Select all"
|
|
1301
|
+
}
|
|
1302
|
+
),
|
|
1303
|
+
cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1304
|
+
Checkbox,
|
|
1305
|
+
{
|
|
1306
|
+
checked: row.getIsSelected(),
|
|
1307
|
+
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
1308
|
+
"aria-label": "Select row"
|
|
1309
|
+
}
|
|
1310
|
+
),
|
|
1311
|
+
enableSorting: false,
|
|
1312
|
+
enableHiding: false,
|
|
1313
|
+
meta: {
|
|
1314
|
+
skeleton: ActionsCellSkeleton
|
|
1315
|
+
// Un checkbox skeleton sería ideal, pero usamos este por ahora
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
accessorKey: "email",
|
|
1320
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "User" }),
|
|
1321
|
+
cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1322
|
+
UserCell,
|
|
1323
|
+
{
|
|
1324
|
+
name: `${row.original.firstName} ${row.original.lastName}`,
|
|
1325
|
+
email: row.getValue("email")
|
|
1326
|
+
}
|
|
1327
|
+
),
|
|
1328
|
+
meta: {
|
|
1329
|
+
skeleton: UserCellSkeleton
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
accessorKey: "status",
|
|
1334
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Status" }),
|
|
1335
|
+
cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(BadgeCell, { status: row.getValue("status") }),
|
|
1336
|
+
meta: {
|
|
1337
|
+
skeleton: BadgeCellSkeleton
|
|
1338
|
+
}
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
accessorKey: "amount",
|
|
1342
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, className: "justify-end", children: "Amount" }),
|
|
1343
|
+
cell: ({ row }) => {
|
|
1344
|
+
const amount = parseFloat(row.getValue("amount"));
|
|
1345
|
+
const formatted = new Intl.NumberFormat("en-US", {
|
|
1346
|
+
style: "currency",
|
|
1347
|
+
currency: "USD"
|
|
1348
|
+
}).format(amount);
|
|
1349
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-right font-medium", children: formatted });
|
|
1350
|
+
},
|
|
1351
|
+
meta: {
|
|
1352
|
+
skeleton: TextCellSkeleton
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
accessorKey: "jobTitle",
|
|
1357
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Job Title" }),
|
|
1358
|
+
cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1359
|
+
TextCell,
|
|
1360
|
+
{
|
|
1361
|
+
primary: row.getValue("jobTitle"),
|
|
1362
|
+
secondary: row.original.company
|
|
1363
|
+
}
|
|
1364
|
+
),
|
|
1365
|
+
meta: {
|
|
1366
|
+
skeleton: TextCellSkeleton
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
accessorKey: "company",
|
|
1371
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Company" }),
|
|
1372
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1373
|
+
},
|
|
1374
|
+
{
|
|
1375
|
+
accessorKey: "city",
|
|
1376
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "City" }),
|
|
1377
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
accessorKey: "country",
|
|
1381
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Country" }),
|
|
1382
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
accessorKey: "phone",
|
|
1386
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Phone" }),
|
|
1387
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
accessorKey: "website",
|
|
1391
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Website" }),
|
|
1392
|
+
cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1393
|
+
"a",
|
|
1394
|
+
{
|
|
1395
|
+
href: row.getValue("website"),
|
|
1396
|
+
target: "_blank",
|
|
1397
|
+
rel: "noopener noreferrer",
|
|
1398
|
+
className: "text-blue-600 hover:underline",
|
|
1399
|
+
children: "View"
|
|
1400
|
+
}
|
|
1401
|
+
),
|
|
1402
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
accessorKey: "bio",
|
|
1406
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Bio" }),
|
|
1407
|
+
cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-48 truncate", children: row.getValue("bio") }),
|
|
1408
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
accessorKey: "streetAddress",
|
|
1412
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Street Address" }),
|
|
1413
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
accessorKey: "zipCode",
|
|
1417
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Zip Code" }),
|
|
1418
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
accessorKey: "state",
|
|
1422
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "State" }),
|
|
1423
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1424
|
+
},
|
|
1425
|
+
{
|
|
1426
|
+
accessorKey: "username",
|
|
1427
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Username" }),
|
|
1428
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
accessorKey: "favoriteColor",
|
|
1432
|
+
header: ({ column }) => /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { column, children: "Favorite Color" }),
|
|
1433
|
+
cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1434
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1435
|
+
"div",
|
|
1436
|
+
{
|
|
1437
|
+
className: "h-4 w-4 rounded-full border",
|
|
1438
|
+
style: { backgroundColor: row.getValue("favoriteColor") }
|
|
1439
|
+
}
|
|
1440
|
+
),
|
|
1441
|
+
row.getValue("favoriteColor")
|
|
1442
|
+
] }),
|
|
1443
|
+
meta: { skeleton: TextCellSkeleton }
|
|
1444
|
+
},
|
|
1445
|
+
{
|
|
1446
|
+
id: "actions",
|
|
1447
|
+
cell: () => /* @__PURE__ */ jsxRuntime.jsx(ActionsCell, {}),
|
|
1448
|
+
meta: {
|
|
1449
|
+
skeleton: ActionsCellSkeleton
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
];
|
|
1453
|
+
|
|
1454
|
+
exports.DataTable = DataTable;
|
|
1455
|
+
exports.DataTablePagination = DataTablePagination;
|
|
1456
|
+
exports.columns = columns;
|