@zentauri-ui/zentauri-components 0.0.7 → 0.0.9
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 +134 -0
- package/dist/ui/accordion.cjs +311 -0
- package/dist/ui/accordion.cjs.map +1 -0
- package/dist/ui/accordion.d.cts +70 -0
- package/dist/ui/accordion.d.ts +70 -0
- package/dist/ui/accordion.js +286 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert.cjs +257 -0
- package/dist/ui/alert.cjs.map +1 -0
- package/dist/ui/alert.d.cts +66 -0
- package/dist/ui/alert.d.ts +66 -0
- package/dist/ui/alert.js +224 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/badge.cjs +192 -0
- package/dist/ui/badge.cjs.map +1 -0
- package/dist/ui/badge.d.cts +37 -0
- package/dist/ui/badge.d.ts +37 -0
- package/dist/ui/badge.js +165 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/buttons.cjs +202 -0
- package/dist/ui/buttons.cjs.map +1 -0
- package/dist/ui/buttons.d.cts +27 -0
- package/dist/ui/buttons.d.ts +27 -0
- package/dist/ui/buttons.js +176 -0
- package/dist/ui/buttons.js.map +1 -0
- package/dist/ui/card.cjs +293 -0
- package/dist/ui/card.cjs.map +1 -0
- package/dist/ui/card.d.cts +77 -0
- package/dist/ui/card.d.ts +77 -0
- package/dist/ui/card.js +258 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/divider.cjs +229 -0
- package/dist/ui/divider.cjs.map +1 -0
- package/dist/ui/divider.d.cts +39 -0
- package/dist/ui/divider.d.ts +39 -0
- package/dist/ui/divider.js +200 -0
- package/dist/ui/divider.js.map +1 -0
- package/dist/ui/drawer.cjs +408 -0
- package/dist/ui/drawer.cjs.map +1 -0
- package/dist/ui/drawer.d.cts +81 -0
- package/dist/ui/drawer.d.ts +81 -0
- package/dist/ui/drawer.js +383 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown.cjs +302 -0
- package/dist/ui/dropdown.cjs.map +1 -0
- package/dist/ui/dropdown.d.cts +50 -0
- package/dist/ui/dropdown.d.ts +50 -0
- package/dist/ui/dropdown.js +278 -0
- package/dist/ui/dropdown.js.map +1 -0
- package/dist/ui/empty-state.cjs +186 -0
- package/dist/ui/empty-state.cjs.map +1 -0
- package/dist/ui/empty-state.d.cts +55 -0
- package/dist/ui/empty-state.d.ts +55 -0
- package/dist/ui/empty-state.js +154 -0
- package/dist/ui/empty-state.js.map +1 -0
- package/dist/ui/index.d.cts +27 -1164
- package/dist/ui/index.d.ts +27 -1164
- package/dist/ui/inputs.cjs +458 -0
- package/dist/ui/inputs.cjs.map +1 -0
- package/dist/ui/inputs.d.cts +35 -0
- package/dist/ui/inputs.d.ts +35 -0
- package/dist/ui/inputs.js +432 -0
- package/dist/ui/inputs.js.map +1 -0
- package/dist/ui/modal.cjs +406 -0
- package/dist/ui/modal.cjs.map +1 -0
- package/dist/ui/modal.d.cts +84 -0
- package/dist/ui/modal.d.ts +84 -0
- package/dist/ui/modal.js +384 -0
- package/dist/ui/modal.js.map +1 -0
- package/dist/ui/pagination.cjs +523 -0
- package/dist/ui/pagination.cjs.map +1 -0
- package/dist/ui/pagination.d.cts +114 -0
- package/dist/ui/pagination.d.ts +114 -0
- package/dist/ui/pagination.js +494 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/progress.cjs +268 -0
- package/dist/ui/progress.cjs.map +1 -0
- package/dist/ui/progress.d.cts +61 -0
- package/dist/ui/progress.d.ts +61 -0
- package/dist/ui/progress.js +237 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/select.cjs +360 -0
- package/dist/ui/select.cjs.map +1 -0
- package/dist/ui/select.d.cts +73 -0
- package/dist/ui/select.d.ts +73 -0
- package/dist/ui/select.js +327 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/skeleton.cjs +576 -0
- package/dist/ui/skeleton.cjs.map +1 -0
- package/dist/ui/skeleton.d.cts +90 -0
- package/dist/ui/skeleton.d.ts +90 -0
- package/dist/ui/skeleton.js +544 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/spinner.cjs +219 -0
- package/dist/ui/spinner.cjs.map +1 -0
- package/dist/ui/spinner.d.cts +27 -0
- package/dist/ui/spinner.d.ts +27 -0
- package/dist/ui/spinner.js +193 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/table.cjs +328 -0
- package/dist/ui/table.cjs.map +1 -0
- package/dist/ui/table.d.cts +81 -0
- package/dist/ui/table.d.ts +81 -0
- package/dist/ui/table.js +293 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.cjs +300 -0
- package/dist/ui/tabs.cjs.map +1 -0
- package/dist/ui/tabs.d.cts +58 -0
- package/dist/ui/tabs.d.ts +58 -0
- package/dist/ui/tabs.js +274 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/toast.cjs +285 -0
- package/dist/ui/toast.cjs.map +1 -0
- package/dist/ui/toast.d.cts +86 -0
- package/dist/ui/toast.d.ts +86 -0
- package/dist/ui/toast.js +258 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toggle.cjs +185 -0
- package/dist/ui/toggle.cjs.map +1 -0
- package/dist/ui/toggle.d.cts +37 -0
- package/dist/ui/toggle.d.ts +37 -0
- package/dist/ui/toggle.js +158 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.cjs +242 -0
- package/dist/ui/tooltip.cjs.map +1 -0
- package/dist/ui/tooltip.d.cts +46 -0
- package/dist/ui/tooltip.d.ts +46 -0
- package/dist/ui/tooltip.js +214 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/variants-1Bx3BEeS.d.cts +8 -0
- package/dist/variants-1Bx3BEeS.d.ts +8 -0
- package/package.json +7 -3
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ui/table/index.ts
|
|
21
|
+
var table_exports = {};
|
|
22
|
+
__export(table_exports, {
|
|
23
|
+
Table: () => Table,
|
|
24
|
+
TableBody: () => TableBody,
|
|
25
|
+
TableCaption: () => TableCaption,
|
|
26
|
+
TableCell: () => TableCell,
|
|
27
|
+
TableFooter: () => TableFooter,
|
|
28
|
+
TableHead: () => TableHead,
|
|
29
|
+
TableHeader: () => TableHeader,
|
|
30
|
+
TableRow: () => TableRow,
|
|
31
|
+
tableAnimationPresets: () => tableAnimationPresets,
|
|
32
|
+
tableCellVariants: () => tableCellVariants,
|
|
33
|
+
tableRowVariants: () => tableRowVariants,
|
|
34
|
+
tableVariants: () => tableVariants
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(table_exports);
|
|
37
|
+
|
|
38
|
+
// src/ui/table/table.tsx
|
|
39
|
+
var import_react = require("react");
|
|
40
|
+
var import_framer_motion = require("framer-motion");
|
|
41
|
+
|
|
42
|
+
// src/lib/utils.ts
|
|
43
|
+
var import_clsx = require("clsx");
|
|
44
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
45
|
+
function cn(...inputs) {
|
|
46
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/ui/table/animations.ts
|
|
50
|
+
var tableAnimationPresets = {
|
|
51
|
+
none: {},
|
|
52
|
+
hover: {
|
|
53
|
+
whileHover: { backgroundColor: "rgba(255,255,255,0.05)" },
|
|
54
|
+
transition: { duration: 0.15 }
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// src/ui/table/variants.ts
|
|
59
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
60
|
+
var tableVariants = (0, import_class_variance_authority.cva)(
|
|
61
|
+
"w-full table-auto border-collapse caption-bottom text-sm text-slate-200 md:table-fixed",
|
|
62
|
+
{
|
|
63
|
+
variants: {
|
|
64
|
+
appearance: {
|
|
65
|
+
default: "",
|
|
66
|
+
striped: "",
|
|
67
|
+
bordered: "border border-white/10",
|
|
68
|
+
ghost: "",
|
|
69
|
+
sky: "border border-sky-600",
|
|
70
|
+
rose: "border border-rose-600",
|
|
71
|
+
purple: "border border-purple-600",
|
|
72
|
+
pink: "border border-pink-600",
|
|
73
|
+
orange: "border border-orange-600",
|
|
74
|
+
yellow: "border border-yellow-600",
|
|
75
|
+
teal: "border border-teal-600",
|
|
76
|
+
indigo: "border border-indigo-600",
|
|
77
|
+
emerald: "border border-emerald-600",
|
|
78
|
+
gray: "border border-gray-600",
|
|
79
|
+
amber: "border border-amber-600",
|
|
80
|
+
violet: "border border-violet-600"
|
|
81
|
+
},
|
|
82
|
+
size: {
|
|
83
|
+
sm: "text-xs",
|
|
84
|
+
md: "text-sm",
|
|
85
|
+
lg: "text-base"
|
|
86
|
+
},
|
|
87
|
+
stickyHeader: {
|
|
88
|
+
true: "",
|
|
89
|
+
false: ""
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
appearance: "default",
|
|
94
|
+
size: "md",
|
|
95
|
+
stickyHeader: false
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
var tableRowVariants = (0, import_class_variance_authority.cva)(
|
|
100
|
+
"border-b border-white/5 transition-colors data-[state=selected]:bg-white/[0.06]",
|
|
101
|
+
{
|
|
102
|
+
variants: {
|
|
103
|
+
appearance: {
|
|
104
|
+
default: "",
|
|
105
|
+
striped: "odd:bg-white/[0.03]",
|
|
106
|
+
bordered: "",
|
|
107
|
+
ghost: "border-transparent hover:bg-white/[0.03]",
|
|
108
|
+
sky: "border-sky-600 hover:bg-sky-600",
|
|
109
|
+
rose: "border-rose-600 hover:bg-rose-900",
|
|
110
|
+
purple: "border-purple-600 hover:bg-purple-900",
|
|
111
|
+
pink: "border-pink-600 hover:bg-pink-900",
|
|
112
|
+
orange: "border-orange-600 hover:bg-orange-900",
|
|
113
|
+
yellow: "border-yellow-600 hover:bg-yellow-900",
|
|
114
|
+
teal: "border-teal-600 hover:bg-teal-900",
|
|
115
|
+
indigo: "border-indigo-600 hover:bg-indigo-900",
|
|
116
|
+
emerald: "border-emerald-600 hover:bg-emerald-900",
|
|
117
|
+
gray: "border-gray-600 hover:bg-gray-900",
|
|
118
|
+
amber: "border-amber-600 hover:bg-amber-900",
|
|
119
|
+
violet: "border-violet-600 hover:bg-violet-900"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
defaultVariants: { appearance: "default" }
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
var tableCellVariants = (0, import_class_variance_authority.cva)("min-w-0 border p-3 align-middle break-words", {
|
|
126
|
+
variants: {
|
|
127
|
+
appearance: {
|
|
128
|
+
default: "border-white/10",
|
|
129
|
+
striped: "border-white/10",
|
|
130
|
+
bordered: "border-white/10",
|
|
131
|
+
ghost: "border-white/10",
|
|
132
|
+
sky: "border-sky-600",
|
|
133
|
+
rose: "border-rose-600",
|
|
134
|
+
purple: "border-purple-600",
|
|
135
|
+
pink: "border-pink-600",
|
|
136
|
+
orange: "border-orange-600",
|
|
137
|
+
yellow: "border-yellow-600",
|
|
138
|
+
teal: "border-teal-600",
|
|
139
|
+
indigo: "border-indigo-600",
|
|
140
|
+
emerald: "border-emerald-600",
|
|
141
|
+
gray: "border-gray-600",
|
|
142
|
+
amber: "border-amber-600",
|
|
143
|
+
violet: "border-violet-600"
|
|
144
|
+
},
|
|
145
|
+
size: {
|
|
146
|
+
sm: "p-2",
|
|
147
|
+
md: "p-3",
|
|
148
|
+
lg: "p-4"
|
|
149
|
+
},
|
|
150
|
+
textAlign: {
|
|
151
|
+
left: "text-left",
|
|
152
|
+
center: "text-center",
|
|
153
|
+
right: "text-right"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
defaultVariants: { appearance: "default", size: "md" }
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// src/ui/table/table.tsx
|
|
160
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
161
|
+
var TableContext = (0, import_react.createContext)(null);
|
|
162
|
+
function useTableContext(component) {
|
|
163
|
+
const ctx = (0, import_react.useContext)(TableContext);
|
|
164
|
+
if (!ctx) {
|
|
165
|
+
throw new Error(`${component} must be used within <Table>`);
|
|
166
|
+
}
|
|
167
|
+
return ctx;
|
|
168
|
+
}
|
|
169
|
+
function Table(props) {
|
|
170
|
+
const {
|
|
171
|
+
className,
|
|
172
|
+
appearance = "default",
|
|
173
|
+
size = "md",
|
|
174
|
+
textAlign = "left",
|
|
175
|
+
stickyHeader = false,
|
|
176
|
+
rowAnimation = "none",
|
|
177
|
+
children,
|
|
178
|
+
ref,
|
|
179
|
+
...rest
|
|
180
|
+
} = props;
|
|
181
|
+
const ctx = (0, import_react.useMemo)(
|
|
182
|
+
() => ({
|
|
183
|
+
appearance: appearance ?? "default",
|
|
184
|
+
size: size ?? "md",
|
|
185
|
+
stickyHeader: Boolean(stickyHeader),
|
|
186
|
+
rowAnimation,
|
|
187
|
+
textAlign
|
|
188
|
+
}),
|
|
189
|
+
[appearance, rowAnimation, size, stickyHeader, textAlign]
|
|
190
|
+
);
|
|
191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "table-scroll", className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
192
|
+
"table",
|
|
193
|
+
{
|
|
194
|
+
ref,
|
|
195
|
+
"data-slot": "table",
|
|
196
|
+
role: "table",
|
|
197
|
+
className: cn(
|
|
198
|
+
tableVariants({ appearance, size, stickyHeader }),
|
|
199
|
+
"w-full min-w-0 table",
|
|
200
|
+
className
|
|
201
|
+
),
|
|
202
|
+
...rest,
|
|
203
|
+
children
|
|
204
|
+
}
|
|
205
|
+
) }) });
|
|
206
|
+
}
|
|
207
|
+
Table.displayName = "Table";
|
|
208
|
+
function TableHeader({ className, children }) {
|
|
209
|
+
const { stickyHeader } = useTableContext("TableHeader");
|
|
210
|
+
const stickyClass = stickyHeader ? "sticky top-0 z-10 bg-slate-950/95 backdrop-blur" : "";
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { "data-slot": "table-header", className: cn(stickyClass, className), children });
|
|
212
|
+
}
|
|
213
|
+
TableHeader.displayName = "TableHeader";
|
|
214
|
+
function TableBody({ className, children }) {
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { "data-slot": "table-body", className: cn(className), children });
|
|
216
|
+
}
|
|
217
|
+
TableBody.displayName = "TableBody";
|
|
218
|
+
function TableFooter({ className, children }) {
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
220
|
+
"tfoot",
|
|
221
|
+
{
|
|
222
|
+
"data-slot": "table-footer",
|
|
223
|
+
className: cn(
|
|
224
|
+
"border-t border-white/10 bg-white/3 font-medium",
|
|
225
|
+
className
|
|
226
|
+
),
|
|
227
|
+
children
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
TableFooter.displayName = "TableFooter";
|
|
232
|
+
function TableRow({
|
|
233
|
+
className,
|
|
234
|
+
children,
|
|
235
|
+
ref,
|
|
236
|
+
...rest
|
|
237
|
+
}) {
|
|
238
|
+
const { appearance, rowAnimation } = useTableContext("TableRow");
|
|
239
|
+
const motionProps = tableAnimationPresets[rowAnimation];
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
241
|
+
import_framer_motion.motion.tr,
|
|
242
|
+
{
|
|
243
|
+
ref,
|
|
244
|
+
"data-slot": "table-row",
|
|
245
|
+
className: cn(tableRowVariants({ appearance }), className),
|
|
246
|
+
initial: false,
|
|
247
|
+
...motionProps,
|
|
248
|
+
...rest,
|
|
249
|
+
children
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
TableRow.displayName = "TableRow";
|
|
254
|
+
function TableHead({
|
|
255
|
+
className,
|
|
256
|
+
children,
|
|
257
|
+
scope = "col",
|
|
258
|
+
sortDirection,
|
|
259
|
+
ref,
|
|
260
|
+
...rest
|
|
261
|
+
}) {
|
|
262
|
+
const { appearance, size, textAlign } = useTableContext("TableHead");
|
|
263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
264
|
+
"th",
|
|
265
|
+
{
|
|
266
|
+
ref,
|
|
267
|
+
"data-slot": "table-head",
|
|
268
|
+
scope,
|
|
269
|
+
"aria-sort": sortDirection,
|
|
270
|
+
className: cn(
|
|
271
|
+
tableCellVariants({ appearance, size, textAlign }),
|
|
272
|
+
className
|
|
273
|
+
),
|
|
274
|
+
...rest,
|
|
275
|
+
children
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
TableHead.displayName = "TableHead";
|
|
280
|
+
function TableCell({
|
|
281
|
+
className,
|
|
282
|
+
children,
|
|
283
|
+
ref,
|
|
284
|
+
...rest
|
|
285
|
+
}) {
|
|
286
|
+
const { appearance, size, textAlign } = useTableContext("TableCell");
|
|
287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
288
|
+
"td",
|
|
289
|
+
{
|
|
290
|
+
ref,
|
|
291
|
+
"data-slot": "table-cell",
|
|
292
|
+
className: cn(
|
|
293
|
+
tableCellVariants({ appearance, size, textAlign }),
|
|
294
|
+
className
|
|
295
|
+
),
|
|
296
|
+
...rest,
|
|
297
|
+
children
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
TableCell.displayName = "TableCell";
|
|
302
|
+
function TableCaption({ className, children }) {
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
304
|
+
"caption",
|
|
305
|
+
{
|
|
306
|
+
"data-slot": "table-caption",
|
|
307
|
+
className: cn("mt-3 text-left text-xs text-slate-500", className),
|
|
308
|
+
children
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
TableCaption.displayName = "TableCaption";
|
|
313
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
314
|
+
0 && (module.exports = {
|
|
315
|
+
Table,
|
|
316
|
+
TableBody,
|
|
317
|
+
TableCaption,
|
|
318
|
+
TableCell,
|
|
319
|
+
TableFooter,
|
|
320
|
+
TableHead,
|
|
321
|
+
TableHeader,
|
|
322
|
+
TableRow,
|
|
323
|
+
tableAnimationPresets,
|
|
324
|
+
tableCellVariants,
|
|
325
|
+
tableRowVariants,
|
|
326
|
+
tableVariants
|
|
327
|
+
});
|
|
328
|
+
//# sourceMappingURL=table.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/table/index.ts","../../src/ui/table/table.tsx","../../src/lib/utils.ts","../../src/ui/table/animations.ts","../../src/ui/table/variants.ts"],"sourcesContent":["export {\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n} from \"./table\";\nexport type {\n TableAnimation,\n TableCellProps,\n TableHeadCellProps,\n TableProps,\n TableSectionProps,\n} from \"./types\";\nexport { tableAnimationPresets } from \"./animations\";\nexport { tableVariants, tableRowVariants, tableCellVariants } from \"./variants\";\n","\"use client\";\n\nimport { createContext, useContext, useMemo } from \"react\";\nimport { motion } from \"framer-motion\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport { tableAnimationPresets } from \"./animations\";\nimport type {\n TableCellProps,\n TableHeadCellProps,\n TableProps,\n TableSectionProps,\n} from \"./types\";\nimport { tableCellVariants, tableRowVariants, tableVariants } from \"./variants\";\n\ntype TableCtx = {\n appearance: NonNullable<TableProps[\"appearance\"]>;\n size: NonNullable<TableProps[\"size\"]>;\n stickyHeader: boolean;\n rowAnimation: NonNullable<TableProps[\"rowAnimation\"]>;\n textAlign: NonNullable<TableCellProps[\"textAlign\"]>;\n};\n\nconst TableContext = createContext<TableCtx | null>(null);\n\nfunction useTableContext(component: string): TableCtx {\n const ctx = useContext(TableContext);\n if (!ctx) {\n throw new Error(`${component} must be used within <Table>`);\n }\n return ctx;\n}\n\nexport function Table(props: TableProps) {\n const {\n className,\n appearance = \"default\",\n size = \"md\",\n textAlign = \"left\",\n stickyHeader = false,\n rowAnimation = \"none\",\n children,\n ref,\n ...rest\n } = props;\n const ctx = useMemo(\n () => ({\n appearance: appearance ?? \"default\",\n size: size ?? \"md\",\n stickyHeader: Boolean(stickyHeader),\n rowAnimation,\n textAlign,\n }),\n [appearance, rowAnimation, size, stickyHeader, textAlign],\n );\n\n return (\n <TableContext.Provider value={ctx}>\n <div data-slot=\"table-scroll\" className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n data-slot=\"table\"\n role=\"table\"\n className={cn(\n tableVariants({ appearance, size, stickyHeader }),\n \"w-full min-w-0 table\",\n className,\n )}\n {...rest}\n >\n {children}\n </table>\n </div>\n </TableContext.Provider>\n );\n}\n\nTable.displayName = \"Table\";\n\nexport function TableHeader({ className, children }: TableSectionProps) {\n const { stickyHeader } = useTableContext(\"TableHeader\");\n const stickyClass = stickyHeader ? \"sticky top-0 z-10 bg-slate-950/95 backdrop-blur\" : \"\";\n return (\n <thead data-slot=\"table-header\" className={cn(stickyClass, className)}>\n {children}\n </thead>\n );\n}\n\nTableHeader.displayName = \"TableHeader\";\n\nexport function TableBody({ className, children }: TableSectionProps) {\n return (\n <tbody data-slot=\"table-body\" className={cn(className)}>\n {children}\n </tbody>\n );\n}\n\nTableBody.displayName = \"TableBody\";\n\nexport function TableFooter({ className, children }: TableSectionProps) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"border-t border-white/10 bg-white/3 font-medium\",\n className,\n )}\n >\n {children}\n </tfoot>\n );\n}\n\nTableFooter.displayName = \"TableFooter\";\n\nexport function TableRow({\n className,\n children,\n ref,\n ...rest\n}: TableSectionProps & { ref?: React.Ref<HTMLTableRowElement> }) {\n const { appearance, rowAnimation } = useTableContext(\"TableRow\");\n const motionProps = tableAnimationPresets[rowAnimation];\n\n return (\n <motion.tr\n ref={ref}\n data-slot=\"table-row\"\n className={cn(tableRowVariants({ appearance }), className)}\n initial={false}\n {...motionProps}\n {...rest}\n >\n {children}\n </motion.tr>\n );\n}\n\nTableRow.displayName = \"TableRow\";\n\nexport function TableHead({\n className,\n children,\n scope = \"col\",\n sortDirection,\n ref,\n ...rest\n}: TableHeadCellProps) {\n const { appearance, size, textAlign } = useTableContext(\"TableHead\");\n return (\n <th\n ref={ref}\n data-slot=\"table-head\"\n scope={scope}\n aria-sort={sortDirection}\n className={cn(\n tableCellVariants({ appearance, size, textAlign }),\n className,\n )}\n {...rest}\n >\n {children}\n </th>\n );\n}\n\nTableHead.displayName = \"TableHead\";\n\nexport function TableCell({\n className,\n children,\n ref,\n ...rest\n}: TableCellProps) {\n const { appearance, size, textAlign } = useTableContext(\"TableCell\");\n return (\n <td\n ref={ref}\n data-slot=\"table-cell\"\n className={cn(\n tableCellVariants({ appearance, size, textAlign }),\n className,\n )}\n {...rest}\n >\n {children}\n </td>\n );\n}\n\nTableCell.displayName = \"TableCell\";\n\nexport function TableCaption({ className, children }: TableSectionProps) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"mt-3 text-left text-xs text-slate-500\", className)}\n >\n {children}\n </caption>\n );\n}\n\nTableCaption.displayName = \"TableCaption\";\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","import type { HTMLMotionProps } from \"framer-motion\";\n\nimport type { TableAnimation } from \"./types\";\n\ntype TablePresetMotionProps = Pick<HTMLMotionProps<\"tr\">, \"whileHover\" | \"transition\">;\n\nexport type TableAnimationPresets = Record<TableAnimation, TablePresetMotionProps>;\n\nexport const tableAnimationPresets: TableAnimationPresets = {\n none: {},\n hover: {\n whileHover: { backgroundColor: \"rgba(255,255,255,0.05)\" },\n transition: { duration: 0.15 },\n },\n};\n","import { cva } from \"class-variance-authority\";\n\nexport const tableVariants = cva(\n \"w-full table-auto border-collapse caption-bottom text-sm text-slate-200 md:table-fixed\",\n {\n variants: {\n appearance: {\n default: \"\",\n striped: \"\",\n bordered: \"border border-white/10\",\n ghost: \"\",\n sky:'border border-sky-600',\n rose:'border border-rose-600',\n purple:'border border-purple-600',\n pink:'border border-pink-600',\n orange:'border border-orange-600',\n yellow:'border border-yellow-600',\n teal:'border border-teal-600',\n indigo:'border border-indigo-600',\n emerald:'border border-emerald-600',\n gray:'border border-gray-600',\n amber:'border border-amber-600',\n violet:'border border-violet-600',\n },\n size: {\n sm: \"text-xs\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n stickyHeader: {\n true: \"\",\n false: \"\",\n },\n },\n defaultVariants: {\n appearance: \"default\",\n size: \"md\",\n stickyHeader: false,\n },\n },\n);\n\nexport const tableRowVariants = cva(\n \"border-b border-white/5 transition-colors data-[state=selected]:bg-white/[0.06]\",\n {\n variants: {\n appearance: {\n default: \"\",\n striped: \"odd:bg-white/[0.03]\",\n bordered: \"\",\n ghost: \"border-transparent hover:bg-white/[0.03]\",\n sky:'border-sky-600 hover:bg-sky-600',\n rose:'border-rose-600 hover:bg-rose-900',\n purple:'border-purple-600 hover:bg-purple-900',\n pink:'border-pink-600 hover:bg-pink-900',\n orange:'border-orange-600 hover:bg-orange-900',\n yellow:'border-yellow-600 hover:bg-yellow-900',\n teal:'border-teal-600 hover:bg-teal-900',\n indigo:'border-indigo-600 hover:bg-indigo-900',\n emerald:'border-emerald-600 hover:bg-emerald-900',\n gray:'border-gray-600 hover:bg-gray-900',\n amber:'border-amber-600 hover:bg-amber-900',\n violet:'border-violet-600 hover:bg-violet-900',\n },\n },\n defaultVariants: { appearance: \"default\" },\n },\n);\n\nexport const tableCellVariants = cva(\"min-w-0 border p-3 align-middle break-words\", {\n variants: {\n appearance: {\n default: \"border-white/10\",\n striped: \"border-white/10\",\n bordered: \"border-white/10\",\n ghost: \"border-white/10\",\n sky: \"border-sky-600\",\n rose: \"border-rose-600\",\n purple: \"border-purple-600\",\n pink: \"border-pink-600\",\n orange: \"border-orange-600\",\n yellow: \"border-yellow-600\",\n teal: \"border-teal-600\",\n indigo: \"border-indigo-600\",\n emerald: \"border-emerald-600\",\n gray: \"border-gray-600\",\n amber: \"border-amber-600\",\n violet: \"border-violet-600\",\n },\n size: {\n sm: \"p-2\",\n md: \"p-3\",\n lg: \"p-4\",\n },\n textAlign: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n },\n },\n defaultVariants: { appearance: \"default\", size: \"md\" },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAAmD;AACnD,2BAAuB;;;ACHvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AC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UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAuB;AACrB,QAAM,EAAE,YAAY,MAAM,UAAU,IAAI,gBAAgB,WAAW;AACnE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV;AAAA,MACA,aAAW;AAAA,MACX,WAAW;AAAA,QACT,kBAAkB,EAAE,YAAY,MAAM,UAAU,CAAC;AAAA,QACjD;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,UAAU,cAAc;AAEjB,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAmB;AACjB,QAAM,EAAE,YAAY,MAAM,UAAU,IAAI,gBAAgB,WAAW;AACnE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACT,kBAAkB,EAAE,YAAY,MAAM,UAAU,CAAC;AAAA,QACjD;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,UAAU,cAAc;AAEjB,SAAS,aAAa,EAAE,WAAW,SAAS,GAAsB;AACvE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,yCAAyC,SAAS;AAAA,MAE/D;AAAA;AAAA,EACH;AAEJ;AAEA,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { HTMLAttributes, ReactNode, Ref, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
4
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
6
|
+
|
|
7
|
+
declare const tableVariants: (props?: ({
|
|
8
|
+
appearance?: "default" | "ghost" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gray" | "violet" | "amber" | "striped" | "bordered" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
stickyHeader?: boolean | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
declare const tableRowVariants: (props?: ({
|
|
13
|
+
appearance?: "default" | "ghost" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gray" | "violet" | "amber" | "striped" | "bordered" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
declare const tableCellVariants: (props?: ({
|
|
16
|
+
appearance?: "default" | "ghost" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gray" | "violet" | "amber" | "striped" | "bordered" | null | undefined;
|
|
17
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
18
|
+
textAlign?: "left" | "right" | "center" | null | undefined;
|
|
19
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
|
+
|
|
21
|
+
type TableAnimation = "none" | "hover";
|
|
22
|
+
type TableVariantProps = VariantProps<typeof tableVariants>;
|
|
23
|
+
type TableProps = TableVariantProps & Omit<HTMLAttributes<HTMLTableElement>, "children"> & {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
rowAnimation?: TableAnimation;
|
|
26
|
+
ref?: Ref<HTMLTableElement>;
|
|
27
|
+
textAlign?: "left" | "center" | "right";
|
|
28
|
+
};
|
|
29
|
+
type TableSectionProps = {
|
|
30
|
+
className?: string;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
type TableHeadCellProps = ThHTMLAttributes<HTMLTableCellElement> & {
|
|
34
|
+
sortDirection?: "ascending" | "descending" | "none";
|
|
35
|
+
ref?: Ref<HTMLTableCellElement>;
|
|
36
|
+
};
|
|
37
|
+
type TableCellProps = TdHTMLAttributes<HTMLTableCellElement> & {
|
|
38
|
+
ref?: Ref<HTMLTableCellElement>;
|
|
39
|
+
textAlign?: "left" | "center" | "right";
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
declare namespace Table {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
declare function TableHeader({ className, children }: TableSectionProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare namespace TableHeader {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
declare function TableBody({ className, children }: TableSectionProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare namespace TableBody {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
54
|
+
declare function TableFooter({ className, children }: TableSectionProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare namespace TableFooter {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
58
|
+
declare function TableRow({ className, children, ref, ...rest }: TableSectionProps & {
|
|
59
|
+
ref?: React.Ref<HTMLTableRowElement>;
|
|
60
|
+
}): react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare namespace TableRow {
|
|
62
|
+
var displayName: string;
|
|
63
|
+
}
|
|
64
|
+
declare function TableHead({ className, children, scope, sortDirection, ref, ...rest }: TableHeadCellProps): react_jsx_runtime.JSX.Element;
|
|
65
|
+
declare namespace TableHead {
|
|
66
|
+
var displayName: string;
|
|
67
|
+
}
|
|
68
|
+
declare function TableCell({ className, children, ref, ...rest }: TableCellProps): react_jsx_runtime.JSX.Element;
|
|
69
|
+
declare namespace TableCell {
|
|
70
|
+
var displayName: string;
|
|
71
|
+
}
|
|
72
|
+
declare function TableCaption({ className, children }: TableSectionProps): react_jsx_runtime.JSX.Element;
|
|
73
|
+
declare namespace TableCaption {
|
|
74
|
+
var displayName: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type TablePresetMotionProps = Pick<HTMLMotionProps<"tr">, "whileHover" | "transition">;
|
|
78
|
+
type TableAnimationPresets = Record<TableAnimation, TablePresetMotionProps>;
|
|
79
|
+
declare const tableAnimationPresets: TableAnimationPresets;
|
|
80
|
+
|
|
81
|
+
export { Table, type TableAnimation, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableHead, type TableHeadCellProps, TableHeader, type TableProps, TableRow, type TableSectionProps, tableAnimationPresets, tableCellVariants, tableRowVariants, tableVariants };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { HTMLAttributes, ReactNode, Ref, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
4
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
6
|
+
|
|
7
|
+
declare const tableVariants: (props?: ({
|
|
8
|
+
appearance?: "default" | "ghost" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gray" | "violet" | "amber" | "striped" | "bordered" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
stickyHeader?: boolean | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
declare const tableRowVariants: (props?: ({
|
|
13
|
+
appearance?: "default" | "ghost" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gray" | "violet" | "amber" | "striped" | "bordered" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
declare const tableCellVariants: (props?: ({
|
|
16
|
+
appearance?: "default" | "ghost" | "sky" | "rose" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gray" | "violet" | "amber" | "striped" | "bordered" | null | undefined;
|
|
17
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
18
|
+
textAlign?: "left" | "right" | "center" | null | undefined;
|
|
19
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
|
+
|
|
21
|
+
type TableAnimation = "none" | "hover";
|
|
22
|
+
type TableVariantProps = VariantProps<typeof tableVariants>;
|
|
23
|
+
type TableProps = TableVariantProps & Omit<HTMLAttributes<HTMLTableElement>, "children"> & {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
rowAnimation?: TableAnimation;
|
|
26
|
+
ref?: Ref<HTMLTableElement>;
|
|
27
|
+
textAlign?: "left" | "center" | "right";
|
|
28
|
+
};
|
|
29
|
+
type TableSectionProps = {
|
|
30
|
+
className?: string;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
type TableHeadCellProps = ThHTMLAttributes<HTMLTableCellElement> & {
|
|
34
|
+
sortDirection?: "ascending" | "descending" | "none";
|
|
35
|
+
ref?: Ref<HTMLTableCellElement>;
|
|
36
|
+
};
|
|
37
|
+
type TableCellProps = TdHTMLAttributes<HTMLTableCellElement> & {
|
|
38
|
+
ref?: Ref<HTMLTableCellElement>;
|
|
39
|
+
textAlign?: "left" | "center" | "right";
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
declare namespace Table {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
declare function TableHeader({ className, children }: TableSectionProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare namespace TableHeader {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
declare function TableBody({ className, children }: TableSectionProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare namespace TableBody {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
54
|
+
declare function TableFooter({ className, children }: TableSectionProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare namespace TableFooter {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
58
|
+
declare function TableRow({ className, children, ref, ...rest }: TableSectionProps & {
|
|
59
|
+
ref?: React.Ref<HTMLTableRowElement>;
|
|
60
|
+
}): react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare namespace TableRow {
|
|
62
|
+
var displayName: string;
|
|
63
|
+
}
|
|
64
|
+
declare function TableHead({ className, children, scope, sortDirection, ref, ...rest }: TableHeadCellProps): react_jsx_runtime.JSX.Element;
|
|
65
|
+
declare namespace TableHead {
|
|
66
|
+
var displayName: string;
|
|
67
|
+
}
|
|
68
|
+
declare function TableCell({ className, children, ref, ...rest }: TableCellProps): react_jsx_runtime.JSX.Element;
|
|
69
|
+
declare namespace TableCell {
|
|
70
|
+
var displayName: string;
|
|
71
|
+
}
|
|
72
|
+
declare function TableCaption({ className, children }: TableSectionProps): react_jsx_runtime.JSX.Element;
|
|
73
|
+
declare namespace TableCaption {
|
|
74
|
+
var displayName: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type TablePresetMotionProps = Pick<HTMLMotionProps<"tr">, "whileHover" | "transition">;
|
|
78
|
+
type TableAnimationPresets = Record<TableAnimation, TablePresetMotionProps>;
|
|
79
|
+
declare const tableAnimationPresets: TableAnimationPresets;
|
|
80
|
+
|
|
81
|
+
export { Table, type TableAnimation, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableHead, type TableHeadCellProps, TableHeader, type TableProps, TableRow, type TableSectionProps, tableAnimationPresets, tableCellVariants, tableRowVariants, tableVariants };
|