@kilnonedre/foundation 0.0.25 → 0.0.26
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/dist/index.js +59 -70
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3263,25 +3263,7 @@ var FormTimePicker = (props) => {
|
|
|
3263
3263
|
// src/components/media-uploader/index.tsx
|
|
3264
3264
|
import { useCallback as useCallback2, useEffect as useEffect3, useRef as useRef2, useState as useState8 } from "react";
|
|
3265
3265
|
import { Eye as Eye2, Loader2, Plus, Trash2 } from "lucide-react";
|
|
3266
|
-
|
|
3267
|
-
// src/shadcn/components/card.tsx
|
|
3268
|
-
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3269
|
-
function Card({ className, ...props }) {
|
|
3270
|
-
return /* @__PURE__ */ jsx46(
|
|
3271
|
-
"div",
|
|
3272
|
-
{
|
|
3273
|
-
"data-slot": "card",
|
|
3274
|
-
className: cn(
|
|
3275
|
-
"flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",
|
|
3276
|
-
className
|
|
3277
|
-
),
|
|
3278
|
-
...props
|
|
3279
|
-
}
|
|
3280
|
-
);
|
|
3281
|
-
}
|
|
3282
|
-
|
|
3283
|
-
// src/components/media-uploader/index.tsx
|
|
3284
|
-
import { jsx as jsx47, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3266
|
+
import { jsx as jsx46, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3285
3267
|
var MediaUploader = ({ value = [], ...props }) => {
|
|
3286
3268
|
const inputRef = useRef2(null);
|
|
3287
3269
|
const [items, setItems] = useState8([]);
|
|
@@ -3408,7 +3390,7 @@ var MediaUploader = ({ value = [], ...props }) => {
|
|
|
3408
3390
|
};
|
|
3409
3391
|
const showUploadButton = canEdit && (!props.multiple && items.length === 0 || props.multiple);
|
|
3410
3392
|
return /* @__PURE__ */ jsxs28("div", { className: cn2("space-y-3", props.className), children: [
|
|
3411
|
-
/* @__PURE__ */
|
|
3393
|
+
/* @__PURE__ */ jsx46(
|
|
3412
3394
|
"input",
|
|
3413
3395
|
{
|
|
3414
3396
|
ref: inputRef,
|
|
@@ -3425,56 +3407,63 @@ var MediaUploader = ({ value = [], ...props }) => {
|
|
|
3425
3407
|
}
|
|
3426
3408
|
}
|
|
3427
3409
|
),
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
items.map((it, index) => /* @__PURE__ */
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
{
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3410
|
+
/* @__PURE__ */ jsx46(ScrollArea, { className: "rounded-lg border", children: /* @__PURE__ */ jsxs28("div", { className: "grid grid-cols-2 gap-3 p-3 sm:grid-cols-3 lg:grid-cols-4", children: [
|
|
3411
|
+
items.map((it, index) => /* @__PURE__ */ jsx46(
|
|
3412
|
+
"div",
|
|
3413
|
+
{
|
|
3414
|
+
className: "rounded-xl border bg-card text-card-foreground shadow group overflow-hidden",
|
|
3415
|
+
children: /* @__PURE__ */ jsxs28("div", { className: "relative aspect-square bg-muted", children: [
|
|
3416
|
+
it.url || it.localUrl ? /* @__PURE__ */ jsx46(
|
|
3417
|
+
"img",
|
|
3418
|
+
{
|
|
3419
|
+
src: it.url ?? it.localUrl,
|
|
3420
|
+
alt: "",
|
|
3421
|
+
className: "h-full w-full object-cover"
|
|
3422
|
+
}
|
|
3423
|
+
) : /* @__PURE__ */ jsx46("div", { className: "h-full w-full" }),
|
|
3424
|
+
it.uploading && /* @__PURE__ */ jsx46("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40", children: /* @__PURE__ */ jsx46(Loader2, { className: "h-6 w-6 animate-spin text-white" }) }),
|
|
3425
|
+
!it.uploading && (it.url || it.localUrl) && /* @__PURE__ */ jsxs28("div", { className: "absolute inset-0 flex items-start justify-end gap-2 p-2 opacity-0 transition group-hover:opacity-100", children: [
|
|
3426
|
+
/* @__PURE__ */ jsx46(
|
|
3427
|
+
Button,
|
|
3428
|
+
{
|
|
3429
|
+
size: "icon",
|
|
3430
|
+
variant: "secondary",
|
|
3431
|
+
className: "h-8 w-8",
|
|
3432
|
+
onClick: () => setPreview(it),
|
|
3433
|
+
type: "button",
|
|
3434
|
+
children: /* @__PURE__ */ jsx46(Eye2, { className: "h-4 w-4" })
|
|
3435
|
+
}
|
|
3436
|
+
),
|
|
3437
|
+
canEdit && /* @__PURE__ */ jsx46(
|
|
3438
|
+
Button,
|
|
3439
|
+
{
|
|
3440
|
+
size: "icon",
|
|
3441
|
+
variant: "destructive",
|
|
3442
|
+
className: "h-8 w-8",
|
|
3443
|
+
onClick: () => remove(it.id),
|
|
3444
|
+
type: "button",
|
|
3445
|
+
children: /* @__PURE__ */ jsx46(Trash2, { className: "h-4 w-4" })
|
|
3446
|
+
}
|
|
3447
|
+
)
|
|
3448
|
+
] })
|
|
3449
|
+
] })
|
|
3450
|
+
},
|
|
3451
|
+
it.id + index
|
|
3452
|
+
)),
|
|
3453
|
+
showUploadButton && /* @__PURE__ */ jsx46(
|
|
3454
|
+
"div",
|
|
3466
3455
|
{
|
|
3467
|
-
className: "flex aspect-square cursor-pointer items-center justify-center hover:bg-muted/50",
|
|
3456
|
+
className: "rounded-xl border bg-card text-card-foreground shadow flex aspect-square cursor-pointer items-center justify-center hover:bg-muted/50",
|
|
3468
3457
|
onClick: () => {
|
|
3469
3458
|
inputRef.current?.click();
|
|
3470
3459
|
},
|
|
3471
|
-
children: /* @__PURE__ */
|
|
3460
|
+
children: /* @__PURE__ */ jsx46(Plus, { className: "h-6 w-6 text-muted-foreground" })
|
|
3472
3461
|
}
|
|
3473
3462
|
)
|
|
3474
3463
|
] }) }),
|
|
3475
|
-
/* @__PURE__ */
|
|
3476
|
-
/* @__PURE__ */
|
|
3477
|
-
preview && /* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ jsx46(Dialog, { open: !!preview, onOpenChange: () => setPreview(null), children: /* @__PURE__ */ jsxs28(DialogContent, { className: "max-w-3xl", children: [
|
|
3465
|
+
/* @__PURE__ */ jsx46(DialogHeader, { children: /* @__PURE__ */ jsx46(DialogTitle, { children: "\u9884\u89C8" }) }),
|
|
3466
|
+
preview && /* @__PURE__ */ jsx46("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx46(
|
|
3478
3467
|
"img",
|
|
3479
3468
|
{
|
|
3480
3469
|
src: preview.url ?? preview.localUrl ?? "",
|
|
@@ -3487,27 +3476,27 @@ var MediaUploader = ({ value = [], ...props }) => {
|
|
|
3487
3476
|
};
|
|
3488
3477
|
|
|
3489
3478
|
// src/components/provider/index.tsx
|
|
3490
|
-
import { jsx as
|
|
3479
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3491
3480
|
var Provider = ({ children }) => {
|
|
3492
|
-
return /* @__PURE__ */
|
|
3481
|
+
return /* @__PURE__ */ jsx47(TooltipProvider, { children });
|
|
3493
3482
|
};
|
|
3494
3483
|
|
|
3495
3484
|
// src/components/title/index.tsx
|
|
3496
|
-
import { jsx as
|
|
3485
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3497
3486
|
var Title = (props) => {
|
|
3498
|
-
return /* @__PURE__ */
|
|
3487
|
+
return /* @__PURE__ */ jsx48("div", { className: cn2("text-lg font-bold", props.className), children: props.children });
|
|
3499
3488
|
};
|
|
3500
3489
|
|
|
3501
3490
|
// src/render/column/build-column/index.tsx
|
|
3502
|
-
import { jsx as
|
|
3491
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3503
3492
|
var buildColumn = () => (props) => {
|
|
3504
3493
|
const { key, label, render } = props;
|
|
3505
3494
|
return {
|
|
3506
3495
|
accessorKey: key,
|
|
3507
|
-
header: () => /* @__PURE__ */
|
|
3496
|
+
header: () => /* @__PURE__ */ jsx49(TableHeaderText, { text: label }),
|
|
3508
3497
|
cell: ({ row }) => {
|
|
3509
3498
|
const value = row.original[key];
|
|
3510
|
-
return render ? render(value, row.original) : /* @__PURE__ */
|
|
3499
|
+
return render ? render(value, row.original) : /* @__PURE__ */ jsx49(TableText, { text: String(value ?? "") });
|
|
3511
3500
|
},
|
|
3512
3501
|
meta: {
|
|
3513
3502
|
label
|