@mesob/ui 0.3.5 → 0.4.0
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/components.d.ts +115 -2
- package/dist/components.js +1802 -432
- package/dist/components.js.map +1 -1
- package/package.json +1 -1
- package/src/styles/lyra/button.css +28 -0
- package/src/styles/maia/button.css +28 -0
- package/src/styles/mira/button.css +28 -0
- package/src/styles/style-nova.css +28 -0
- package/src/styles/style-vega.css +28 -0
package/dist/components.js
CHANGED
|
@@ -1692,7 +1692,7 @@ function AppHeaderActions({
|
|
|
1692
1692
|
}
|
|
1693
1693
|
const initials = user?.fullName?.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) || "U";
|
|
1694
1694
|
const displayName = user?.fullName ?? "Account";
|
|
1695
|
-
const displaySubtext = user?.email ?? user?.phone ??
|
|
1695
|
+
const displaySubtext = user?.email ?? user?.phone ?? "";
|
|
1696
1696
|
return /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
1697
1697
|
/* @__PURE__ */ jsx16(SpotlightSearch, { groups: searchGroups }),
|
|
1698
1698
|
actions,
|
|
@@ -13287,6 +13287,1182 @@ function DataTableViewOptions({
|
|
|
13287
13287
|
] });
|
|
13288
13288
|
}
|
|
13289
13289
|
|
|
13290
|
+
// src/components/ui/date-time/datetime-picker.tsx
|
|
13291
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
13292
|
+
|
|
13293
|
+
// src/components/ui/date-time/constants.ts
|
|
13294
|
+
var MONTHS = [
|
|
13295
|
+
"January",
|
|
13296
|
+
"February",
|
|
13297
|
+
"March",
|
|
13298
|
+
"April",
|
|
13299
|
+
"May",
|
|
13300
|
+
"June",
|
|
13301
|
+
"July",
|
|
13302
|
+
"August",
|
|
13303
|
+
"September",
|
|
13304
|
+
"October",
|
|
13305
|
+
"November",
|
|
13306
|
+
"December"
|
|
13307
|
+
];
|
|
13308
|
+
var MONTHS_SHORT = [
|
|
13309
|
+
"Jan",
|
|
13310
|
+
"Feb",
|
|
13311
|
+
"Mar",
|
|
13312
|
+
"Apr",
|
|
13313
|
+
"May",
|
|
13314
|
+
"Jun",
|
|
13315
|
+
"Jul",
|
|
13316
|
+
"Aug",
|
|
13317
|
+
"Sep",
|
|
13318
|
+
"Oct",
|
|
13319
|
+
"Nov",
|
|
13320
|
+
"Dec"
|
|
13321
|
+
];
|
|
13322
|
+
var WEEKDAYS = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
|
|
13323
|
+
var EC_MONTHS = [
|
|
13324
|
+
"Meskerem",
|
|
13325
|
+
"Tikimt",
|
|
13326
|
+
"Hidar",
|
|
13327
|
+
"Tahsas",
|
|
13328
|
+
"Tir",
|
|
13329
|
+
"Yekatit",
|
|
13330
|
+
"Megabit",
|
|
13331
|
+
"Miyazia",
|
|
13332
|
+
"Ginbot",
|
|
13333
|
+
"Sene",
|
|
13334
|
+
"Hamle",
|
|
13335
|
+
"Nehase",
|
|
13336
|
+
"Pagume"
|
|
13337
|
+
];
|
|
13338
|
+
var EC_MONTHS_SHORT = [
|
|
13339
|
+
"Mes",
|
|
13340
|
+
"Tik",
|
|
13341
|
+
"Hid",
|
|
13342
|
+
"Tah",
|
|
13343
|
+
"Tir",
|
|
13344
|
+
"Yek",
|
|
13345
|
+
"Meg",
|
|
13346
|
+
"Miy",
|
|
13347
|
+
"Gin",
|
|
13348
|
+
"Sen",
|
|
13349
|
+
"Ham",
|
|
13350
|
+
"Neh",
|
|
13351
|
+
"Pag"
|
|
13352
|
+
];
|
|
13353
|
+
var JD_EPOCH_OFFSET_AMETE_MIHRET = 1723856;
|
|
13354
|
+
var TRIGGER_SIZE_CLASSES = {
|
|
13355
|
+
sm: "h-8 px-3 py-1.5 pr-8 text-xs",
|
|
13356
|
+
md: "h-10 px-3.5 py-2 pr-10 text-sm",
|
|
13357
|
+
lg: "h-11 px-4 py-2.5 pr-11 text-sm",
|
|
13358
|
+
xl: "h-12 px-4 py-3 pr-12 text-base"
|
|
13359
|
+
};
|
|
13360
|
+
var TRIGGER_RADIUS_CLASSES = {
|
|
13361
|
+
sm: "rounded",
|
|
13362
|
+
md: "rounded-md",
|
|
13363
|
+
lg: "rounded-lg",
|
|
13364
|
+
xl: "rounded-xl"
|
|
13365
|
+
};
|
|
13366
|
+
|
|
13367
|
+
// src/components/ui/date-time/date-utils.ts
|
|
13368
|
+
function gregorianToJDN(year, month, day) {
|
|
13369
|
+
const a = Math.floor((14 - month) / 12);
|
|
13370
|
+
const y = year + 4800 - a;
|
|
13371
|
+
const m = month + 12 * a - 3;
|
|
13372
|
+
return day + Math.floor((153 * m + 2) / 5) + 365 * y + Math.floor(y / 4) - Math.floor(y / 100) + Math.floor(y / 400) - 32045;
|
|
13373
|
+
}
|
|
13374
|
+
function jdnToGregorian(jdn) {
|
|
13375
|
+
const j = jdn + 32044;
|
|
13376
|
+
const g = Math.floor(j / 146097);
|
|
13377
|
+
const dg = j % 146097;
|
|
13378
|
+
const c = Math.floor((Math.floor(dg / 36524) + 1) * 3 / 4);
|
|
13379
|
+
const dc = dg - c * 36524;
|
|
13380
|
+
const b = Math.floor(dc / 1461);
|
|
13381
|
+
const db = dc % 1461;
|
|
13382
|
+
const a = Math.floor((Math.floor(db / 365) + 1) * 3 / 4);
|
|
13383
|
+
const da = db - a * 365;
|
|
13384
|
+
const y = g * 400 + c * 100 + b * 4 + a;
|
|
13385
|
+
const m = Math.floor((da * 5 + 308) / 153) - 2;
|
|
13386
|
+
const d = da - Math.floor((m + 4) * 153 / 5) + 122;
|
|
13387
|
+
const year = y - 4800 + Math.floor((m + 2) / 12);
|
|
13388
|
+
const month = (m + 2) % 12 + 1;
|
|
13389
|
+
const day = d + 1;
|
|
13390
|
+
return [year, month, day];
|
|
13391
|
+
}
|
|
13392
|
+
function ethiopicToJDN(year, month, day) {
|
|
13393
|
+
return JD_EPOCH_OFFSET_AMETE_MIHRET + 365 + 365 * (year - 1) + Math.floor(year / 4) + 30 * month + day - 31;
|
|
13394
|
+
}
|
|
13395
|
+
function jdnToEthiopic(jdn) {
|
|
13396
|
+
const offset = jdn - JD_EPOCH_OFFSET_AMETE_MIHRET;
|
|
13397
|
+
const r = (offset % 1461 + 1461) % 1461;
|
|
13398
|
+
const n = r % 365 + 365 * Math.floor(r / 1460);
|
|
13399
|
+
const year = 4 * Math.floor(offset / 1461) + Math.floor(r / 365) - Math.floor(r / 1460);
|
|
13400
|
+
const month = Math.floor(n / 30) + 1;
|
|
13401
|
+
const day = n % 30 + 1;
|
|
13402
|
+
return [year, month, day];
|
|
13403
|
+
}
|
|
13404
|
+
function toEC(gcYear, gcMonth, gcDay) {
|
|
13405
|
+
return jdnToEthiopic(gregorianToJDN(gcYear, gcMonth, gcDay));
|
|
13406
|
+
}
|
|
13407
|
+
function toGC(ecYear, ecMonth, ecDay) {
|
|
13408
|
+
return jdnToGregorian(ethiopicToJDN(ecYear, ecMonth, ecDay));
|
|
13409
|
+
}
|
|
13410
|
+
function isEthLeapYear(year) {
|
|
13411
|
+
return year % 4 === 3;
|
|
13412
|
+
}
|
|
13413
|
+
function ecDaysInMonth(ecYear, ecMonth) {
|
|
13414
|
+
if (ecMonth !== 13) {
|
|
13415
|
+
return 30;
|
|
13416
|
+
}
|
|
13417
|
+
return isEthLeapYear(ecYear) ? 6 : 5;
|
|
13418
|
+
}
|
|
13419
|
+
function getDaysInMonth(year, month) {
|
|
13420
|
+
return new Date(year, month + 1, 0).getDate();
|
|
13421
|
+
}
|
|
13422
|
+
function getStartDay(year, month) {
|
|
13423
|
+
const d = new Date(year, month, 1).getDay();
|
|
13424
|
+
return d === 0 ? 6 : d - 1;
|
|
13425
|
+
}
|
|
13426
|
+
function pad2(n) {
|
|
13427
|
+
return String(n).padStart(2, "0");
|
|
13428
|
+
}
|
|
13429
|
+
|
|
13430
|
+
// src/components/ui/date-time/dropdown-content.tsx
|
|
13431
|
+
import { Fragment as Fragment22, jsx as jsx128, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
13432
|
+
var ChevronLeft = /* @__PURE__ */ jsx128(
|
|
13433
|
+
"svg",
|
|
13434
|
+
{
|
|
13435
|
+
className: "size-4",
|
|
13436
|
+
fill: "none",
|
|
13437
|
+
viewBox: "0 0 24 24",
|
|
13438
|
+
stroke: "currentColor",
|
|
13439
|
+
strokeWidth: 2,
|
|
13440
|
+
children: /* @__PURE__ */ jsx128("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" })
|
|
13441
|
+
}
|
|
13442
|
+
);
|
|
13443
|
+
var ChevronRight = /* @__PURE__ */ jsx128(
|
|
13444
|
+
"svg",
|
|
13445
|
+
{
|
|
13446
|
+
className: "size-4",
|
|
13447
|
+
fill: "none",
|
|
13448
|
+
viewBox: "0 0 24 24",
|
|
13449
|
+
stroke: "currentColor",
|
|
13450
|
+
strokeWidth: 2,
|
|
13451
|
+
children: /* @__PURE__ */ jsx128("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
|
|
13452
|
+
}
|
|
13453
|
+
);
|
|
13454
|
+
var CheckIcon = /* @__PURE__ */ jsx128(
|
|
13455
|
+
"svg",
|
|
13456
|
+
{
|
|
13457
|
+
className: "size-4",
|
|
13458
|
+
fill: "none",
|
|
13459
|
+
viewBox: "0 0 24 24",
|
|
13460
|
+
stroke: "currentColor",
|
|
13461
|
+
strokeWidth: 2.5,
|
|
13462
|
+
children: /* @__PURE__ */ jsx128("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
13463
|
+
}
|
|
13464
|
+
);
|
|
13465
|
+
function DateTimeDropdownContent({
|
|
13466
|
+
presets,
|
|
13467
|
+
onPresetClick,
|
|
13468
|
+
view,
|
|
13469
|
+
calendarType,
|
|
13470
|
+
value,
|
|
13471
|
+
headerLabel,
|
|
13472
|
+
cells,
|
|
13473
|
+
years,
|
|
13474
|
+
decadeStart,
|
|
13475
|
+
ecViewYear,
|
|
13476
|
+
gcViewYear,
|
|
13477
|
+
onPrev,
|
|
13478
|
+
onNext,
|
|
13479
|
+
onHeaderClick,
|
|
13480
|
+
onDayClick,
|
|
13481
|
+
onMonthSelect,
|
|
13482
|
+
onYearSelect,
|
|
13483
|
+
onCalendarTypeChange,
|
|
13484
|
+
timeH,
|
|
13485
|
+
timeM,
|
|
13486
|
+
timeS,
|
|
13487
|
+
timeFocus,
|
|
13488
|
+
withSeconds,
|
|
13489
|
+
onTimeFocus,
|
|
13490
|
+
onTimeBlur,
|
|
13491
|
+
onTimeHChange,
|
|
13492
|
+
onTimeMChange,
|
|
13493
|
+
onTimeSChange,
|
|
13494
|
+
onConfirm,
|
|
13495
|
+
hasPresets
|
|
13496
|
+
}) {
|
|
13497
|
+
const monthShortList = calendarType === "EC" ? EC_MONTHS_SHORT : MONTHS_SHORT;
|
|
13498
|
+
return /* @__PURE__ */ jsxs80("div", { className: "flex", children: [
|
|
13499
|
+
hasPresets && presets?.length ? /* @__PURE__ */ jsx128("div", { className: "flex flex-col gap-0.5 border-r border-border py-2 pl-2 pr-1", children: presets.map((preset) => /* @__PURE__ */ jsx128(
|
|
13500
|
+
"button",
|
|
13501
|
+
{
|
|
13502
|
+
type: "button",
|
|
13503
|
+
onClick: () => onPresetClick?.(preset),
|
|
13504
|
+
className: "rounded-md px-2.5 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-muted",
|
|
13505
|
+
children: preset.label
|
|
13506
|
+
},
|
|
13507
|
+
preset.label
|
|
13508
|
+
)) }) : null,
|
|
13509
|
+
/* @__PURE__ */ jsxs80(
|
|
13510
|
+
"div",
|
|
13511
|
+
{
|
|
13512
|
+
className: cn("p-3", hasPresets && presets?.length && "min-w-0 flex-1"),
|
|
13513
|
+
children: [
|
|
13514
|
+
/* @__PURE__ */ jsxs80("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
13515
|
+
/* @__PURE__ */ jsx128(
|
|
13516
|
+
"button",
|
|
13517
|
+
{
|
|
13518
|
+
type: "button",
|
|
13519
|
+
onClick: onPrev,
|
|
13520
|
+
className: "flex size-7 items-center justify-center rounded text-muted-foreground hover:bg-muted",
|
|
13521
|
+
children: ChevronLeft
|
|
13522
|
+
}
|
|
13523
|
+
),
|
|
13524
|
+
/* @__PURE__ */ jsx128(
|
|
13525
|
+
"button",
|
|
13526
|
+
{
|
|
13527
|
+
type: "button",
|
|
13528
|
+
onClick: onHeaderClick,
|
|
13529
|
+
className: "rounded px-3 py-1 text-sm font-semibold text-foreground transition-colors hover:bg-muted",
|
|
13530
|
+
children: headerLabel
|
|
13531
|
+
}
|
|
13532
|
+
),
|
|
13533
|
+
/* @__PURE__ */ jsx128(
|
|
13534
|
+
"button",
|
|
13535
|
+
{
|
|
13536
|
+
type: "button",
|
|
13537
|
+
onClick: onNext,
|
|
13538
|
+
className: "flex size-7 items-center justify-center rounded text-muted-foreground hover:bg-muted",
|
|
13539
|
+
children: ChevronRight
|
|
13540
|
+
}
|
|
13541
|
+
)
|
|
13542
|
+
] }),
|
|
13543
|
+
view === "days" && /* @__PURE__ */ jsxs80(Fragment22, { children: [
|
|
13544
|
+
/* @__PURE__ */ jsx128("div", { className: "mb-0.5 grid grid-cols-7", children: WEEKDAYS.map((wd, i) => /* @__PURE__ */ jsx128(
|
|
13545
|
+
"div",
|
|
13546
|
+
{
|
|
13547
|
+
className: cn(
|
|
13548
|
+
"select-none py-1.5 text-center text-xs font-medium",
|
|
13549
|
+
i >= 5 ? "text-destructive/80" : "text-muted-foreground"
|
|
13550
|
+
),
|
|
13551
|
+
children: wd
|
|
13552
|
+
},
|
|
13553
|
+
wd
|
|
13554
|
+
)) }),
|
|
13555
|
+
/* @__PURE__ */ jsx128("div", { className: "grid grid-cols-7", children: cells.map((cell) => /* @__PURE__ */ jsx128(
|
|
13556
|
+
"button",
|
|
13557
|
+
{
|
|
13558
|
+
type: "button",
|
|
13559
|
+
onClick: () => onDayClick(cell),
|
|
13560
|
+
className: cn(
|
|
13561
|
+
"flex size-9 items-center justify-center rounded-full text-sm transition-colors",
|
|
13562
|
+
cell.isSelected && "bg-primary font-medium text-primary-foreground ring-2 ring-primary/30",
|
|
13563
|
+
!cell.isSelected && cell.isToday && !value && "bg-primary font-semibold text-primary-foreground",
|
|
13564
|
+
!cell.isSelected && cell.isToday && !!value && "font-semibold text-foreground",
|
|
13565
|
+
!(cell.isSelected || cell.isToday) && cell.current && cell.weekend && "text-destructive/80 hover:bg-muted",
|
|
13566
|
+
!(cell.isSelected || cell.isToday) && cell.current && !cell.weekend && "text-foreground hover:bg-muted",
|
|
13567
|
+
!(cell.isSelected || cell.current) && "text-muted-foreground hover:bg-muted/50"
|
|
13568
|
+
),
|
|
13569
|
+
children: cell.day
|
|
13570
|
+
},
|
|
13571
|
+
`${cell.gcDate.getTime()}-${cell.day}-${cell.month}-${cell.year}`
|
|
13572
|
+
)) })
|
|
13573
|
+
] }),
|
|
13574
|
+
view === "months" && /* @__PURE__ */ jsx128("div", { className: "grid grid-cols-3 gap-1 py-2", children: monthShortList.map((m, i) => {
|
|
13575
|
+
const sel = calendarType === "EC" ? (() => {
|
|
13576
|
+
if (!value) {
|
|
13577
|
+
return false;
|
|
13578
|
+
}
|
|
13579
|
+
const [ecYear, ecMonth] = toEC(
|
|
13580
|
+
value.getFullYear(),
|
|
13581
|
+
value.getMonth() + 1,
|
|
13582
|
+
value.getDate()
|
|
13583
|
+
);
|
|
13584
|
+
return ecMonth === i + 1 && ecYear === ecViewYear;
|
|
13585
|
+
})() : !!(value && value.getMonth() === i && value.getFullYear() === gcViewYear);
|
|
13586
|
+
return /* @__PURE__ */ jsx128(
|
|
13587
|
+
"button",
|
|
13588
|
+
{
|
|
13589
|
+
type: "button",
|
|
13590
|
+
onClick: () => onMonthSelect(i),
|
|
13591
|
+
className: cn(
|
|
13592
|
+
"rounded py-3 text-sm transition-colors",
|
|
13593
|
+
sel ? "bg-primary font-medium text-primary-foreground" : "text-foreground hover:bg-muted"
|
|
13594
|
+
),
|
|
13595
|
+
children: m
|
|
13596
|
+
},
|
|
13597
|
+
m
|
|
13598
|
+
);
|
|
13599
|
+
}) }),
|
|
13600
|
+
view === "years" && /* @__PURE__ */ jsx128("div", { className: "grid grid-cols-3 gap-1 py-2", children: years.map((y) => {
|
|
13601
|
+
const inRange = y >= decadeStart && y <= decadeStart + 9;
|
|
13602
|
+
const sel = calendarType === "EC" ? (() => {
|
|
13603
|
+
if (!value) {
|
|
13604
|
+
return false;
|
|
13605
|
+
}
|
|
13606
|
+
const [ecYear] = toEC(
|
|
13607
|
+
value.getFullYear(),
|
|
13608
|
+
value.getMonth() + 1,
|
|
13609
|
+
value.getDate()
|
|
13610
|
+
);
|
|
13611
|
+
return ecYear === y;
|
|
13612
|
+
})() : !!(value && value.getFullYear() === y);
|
|
13613
|
+
return /* @__PURE__ */ jsx128(
|
|
13614
|
+
"button",
|
|
13615
|
+
{
|
|
13616
|
+
type: "button",
|
|
13617
|
+
onClick: () => onYearSelect(y),
|
|
13618
|
+
className: cn(
|
|
13619
|
+
"rounded py-3 text-sm transition-colors",
|
|
13620
|
+
sel && "bg-primary font-medium text-primary-foreground",
|
|
13621
|
+
!sel && inRange && "text-foreground hover:bg-muted",
|
|
13622
|
+
!(sel || inRange) && "text-muted-foreground hover:bg-muted/50"
|
|
13623
|
+
),
|
|
13624
|
+
children: y
|
|
13625
|
+
},
|
|
13626
|
+
y
|
|
13627
|
+
);
|
|
13628
|
+
}) }),
|
|
13629
|
+
/* @__PURE__ */ jsxs80("div", { className: "mt-2 flex items-center gap-2 border-t border-border pt-2", children: [
|
|
13630
|
+
/* @__PURE__ */ jsxs80("div", { className: "flex flex-1 items-center gap-0.5 rounded border border-input bg-background px-2.5 py-0", children: [
|
|
13631
|
+
/* @__PURE__ */ jsx128(
|
|
13632
|
+
"input",
|
|
13633
|
+
{
|
|
13634
|
+
type: "text",
|
|
13635
|
+
inputMode: "numeric",
|
|
13636
|
+
value: timeFocus === "h" ? timeH : timeH || "--",
|
|
13637
|
+
onFocus: (e) => {
|
|
13638
|
+
onTimeFocus("h");
|
|
13639
|
+
e.target.select();
|
|
13640
|
+
},
|
|
13641
|
+
onBlur: () => onTimeBlur("h"),
|
|
13642
|
+
onChange: (e) => onTimeHChange(e.target.value.replace(/\D/g, "").slice(0, 2)),
|
|
13643
|
+
className: "w-6 shrink-0 border-0 bg-transparent text-center text-sm text-foreground outline-none"
|
|
13644
|
+
}
|
|
13645
|
+
),
|
|
13646
|
+
/* @__PURE__ */ jsx128("span", { className: "select-none px-1 text-sm text-muted-foreground", children: ":" }),
|
|
13647
|
+
/* @__PURE__ */ jsx128(
|
|
13648
|
+
"input",
|
|
13649
|
+
{
|
|
13650
|
+
type: "text",
|
|
13651
|
+
inputMode: "numeric",
|
|
13652
|
+
value: timeFocus === "m" ? timeM : timeM || "--",
|
|
13653
|
+
onFocus: (e) => {
|
|
13654
|
+
onTimeFocus("m");
|
|
13655
|
+
e.target.select();
|
|
13656
|
+
},
|
|
13657
|
+
onBlur: () => onTimeBlur("m"),
|
|
13658
|
+
onChange: (e) => onTimeMChange(e.target.value.replace(/\D/g, "").slice(0, 2)),
|
|
13659
|
+
className: "w-6 shrink-0 border-0 bg-transparent text-center text-sm text-foreground outline-none"
|
|
13660
|
+
}
|
|
13661
|
+
),
|
|
13662
|
+
withSeconds && /* @__PURE__ */ jsxs80(Fragment22, { children: [
|
|
13663
|
+
/* @__PURE__ */ jsx128("span", { className: "select-none px-1 text-sm text-muted-foreground", children: ":" }),
|
|
13664
|
+
/* @__PURE__ */ jsx128(
|
|
13665
|
+
"input",
|
|
13666
|
+
{
|
|
13667
|
+
type: "text",
|
|
13668
|
+
inputMode: "numeric",
|
|
13669
|
+
value: timeFocus === "s" ? timeS : timeS || "--",
|
|
13670
|
+
onFocus: (e) => {
|
|
13671
|
+
onTimeFocus("s");
|
|
13672
|
+
e.target.select();
|
|
13673
|
+
},
|
|
13674
|
+
onBlur: () => onTimeBlur("s"),
|
|
13675
|
+
onChange: (e) => onTimeSChange(e.target.value.replace(/\D/g, "").slice(0, 2)),
|
|
13676
|
+
className: "w-6 shrink-0 border-0 bg-transparent text-center text-sm text-foreground outline-none"
|
|
13677
|
+
}
|
|
13678
|
+
)
|
|
13679
|
+
] })
|
|
13680
|
+
] }),
|
|
13681
|
+
/* @__PURE__ */ jsx128(
|
|
13682
|
+
"button",
|
|
13683
|
+
{
|
|
13684
|
+
type: "button",
|
|
13685
|
+
onClick: onConfirm,
|
|
13686
|
+
className: "flex size-8 shrink-0 items-center justify-center rounded border border-border text-muted-foreground transition-colors hover:bg-muted",
|
|
13687
|
+
children: CheckIcon
|
|
13688
|
+
}
|
|
13689
|
+
)
|
|
13690
|
+
] }),
|
|
13691
|
+
/* @__PURE__ */ jsxs80("div", { className: "mt-2 flex items-center justify-end gap-1 border-t border-border pt-2", children: [
|
|
13692
|
+
/* @__PURE__ */ jsx128(
|
|
13693
|
+
"button",
|
|
13694
|
+
{
|
|
13695
|
+
type: "button",
|
|
13696
|
+
onClick: () => onCalendarTypeChange("GC"),
|
|
13697
|
+
className: cn(
|
|
13698
|
+
"rounded px-2.5 py-1 text-xs font-medium transition-colors",
|
|
13699
|
+
calendarType === "GC" ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
13700
|
+
),
|
|
13701
|
+
children: "GC"
|
|
13702
|
+
}
|
|
13703
|
+
),
|
|
13704
|
+
/* @__PURE__ */ jsx128(
|
|
13705
|
+
"button",
|
|
13706
|
+
{
|
|
13707
|
+
type: "button",
|
|
13708
|
+
onClick: () => onCalendarTypeChange("EC"),
|
|
13709
|
+
className: cn(
|
|
13710
|
+
"rounded px-2.5 py-1 text-xs font-medium transition-colors",
|
|
13711
|
+
calendarType === "EC" ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
13712
|
+
),
|
|
13713
|
+
children: "EC"
|
|
13714
|
+
}
|
|
13715
|
+
)
|
|
13716
|
+
] })
|
|
13717
|
+
]
|
|
13718
|
+
}
|
|
13719
|
+
)
|
|
13720
|
+
] });
|
|
13721
|
+
}
|
|
13722
|
+
|
|
13723
|
+
// src/components/ui/date-time/trigger-button.tsx
|
|
13724
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
13725
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
13726
|
+
var DateTimeTriggerButton = forwardRef5(function DateTimeTriggerButton2({
|
|
13727
|
+
value,
|
|
13728
|
+
placeholder,
|
|
13729
|
+
valueFormat,
|
|
13730
|
+
formatDisplay,
|
|
13731
|
+
disabled,
|
|
13732
|
+
error,
|
|
13733
|
+
open,
|
|
13734
|
+
size,
|
|
13735
|
+
radius,
|
|
13736
|
+
"aria-label": ariaLabel
|
|
13737
|
+
}, ref) {
|
|
13738
|
+
return /* @__PURE__ */ jsx129(
|
|
13739
|
+
"button",
|
|
13740
|
+
{
|
|
13741
|
+
ref,
|
|
13742
|
+
type: "button",
|
|
13743
|
+
disabled,
|
|
13744
|
+
"aria-label": ariaLabel,
|
|
13745
|
+
"aria-invalid": !!error || void 0,
|
|
13746
|
+
className: cn(
|
|
13747
|
+
"w-full border pr-10 text-left transition-colors focus:outline-none",
|
|
13748
|
+
TRIGGER_SIZE_CLASSES[size],
|
|
13749
|
+
TRIGGER_RADIUS_CLASSES[radius],
|
|
13750
|
+
disabled && "cursor-not-allowed border-border bg-muted/50 text-muted-foreground",
|
|
13751
|
+
!(disabled || error) && "cursor-pointer border-input bg-background text-foreground hover:border-primary/50",
|
|
13752
|
+
!disabled && error && "cursor-pointer border-destructive bg-background text-foreground ring-1 ring-destructive/20",
|
|
13753
|
+
open && !disabled && !error && "border-primary ring-1 ring-primary/20"
|
|
13754
|
+
),
|
|
13755
|
+
children: value ? /* @__PURE__ */ jsx129("span", { className: "text-foreground", children: valueFormat ? valueFormat(value) : formatDisplay(value) }) : /* @__PURE__ */ jsx129("span", { className: error ? "text-destructive" : "text-muted-foreground", children: placeholder })
|
|
13756
|
+
}
|
|
13757
|
+
);
|
|
13758
|
+
});
|
|
13759
|
+
|
|
13760
|
+
// src/components/ui/date-time/use-datetime-picker.ts
|
|
13761
|
+
import { useCallback as useCallback10, useEffect as useEffect15, useRef as useRef15, useState as useState33 } from "react";
|
|
13762
|
+
|
|
13763
|
+
// src/components/ui/date-time/calendar-cells.ts
|
|
13764
|
+
function buildGCCells({
|
|
13765
|
+
gcViewYear,
|
|
13766
|
+
gcViewMonth,
|
|
13767
|
+
value,
|
|
13768
|
+
now
|
|
13769
|
+
}) {
|
|
13770
|
+
const daysInCur = getDaysInMonth(gcViewYear, gcViewMonth);
|
|
13771
|
+
const startDay = getStartDay(gcViewYear, gcViewMonth);
|
|
13772
|
+
const prevMo = gcViewMonth === 0 ? 11 : gcViewMonth - 1;
|
|
13773
|
+
const prevYr = gcViewMonth === 0 ? gcViewYear - 1 : gcViewYear;
|
|
13774
|
+
const daysInPrev = getDaysInMonth(prevYr, prevMo);
|
|
13775
|
+
const nextMo = gcViewMonth === 11 ? 0 : gcViewMonth + 1;
|
|
13776
|
+
const nextYr = gcViewMonth === 11 ? gcViewYear + 1 : gcViewYear;
|
|
13777
|
+
const cells = [];
|
|
13778
|
+
for (let i = startDay - 1; i >= 0; i--) {
|
|
13779
|
+
const day = daysInPrev - i;
|
|
13780
|
+
const date = new Date(prevYr, prevMo, day);
|
|
13781
|
+
const col = cells.length % 7;
|
|
13782
|
+
cells.push({
|
|
13783
|
+
gcDate: date,
|
|
13784
|
+
day,
|
|
13785
|
+
month: prevMo,
|
|
13786
|
+
year: prevYr,
|
|
13787
|
+
current: false,
|
|
13788
|
+
weekend: col >= 5,
|
|
13789
|
+
isToday: false,
|
|
13790
|
+
isSelected: false
|
|
13791
|
+
});
|
|
13792
|
+
}
|
|
13793
|
+
for (let day = 1; day <= daysInCur; day++) {
|
|
13794
|
+
const date = new Date(gcViewYear, gcViewMonth, day);
|
|
13795
|
+
const col = cells.length % 7;
|
|
13796
|
+
cells.push({
|
|
13797
|
+
gcDate: date,
|
|
13798
|
+
day,
|
|
13799
|
+
month: gcViewMonth,
|
|
13800
|
+
year: gcViewYear,
|
|
13801
|
+
current: true,
|
|
13802
|
+
weekend: col >= 5,
|
|
13803
|
+
isToday: day === now.getDate() && gcViewMonth === now.getMonth() && gcViewYear === now.getFullYear(),
|
|
13804
|
+
isSelected: !!(value && day === value.getDate() && gcViewMonth === value.getMonth() && gcViewYear === value.getFullYear())
|
|
13805
|
+
});
|
|
13806
|
+
}
|
|
13807
|
+
const totalNeeded = Math.ceil(cells.length / 7) * 7;
|
|
13808
|
+
let nd = 1;
|
|
13809
|
+
while (cells.length < totalNeeded) {
|
|
13810
|
+
const date = new Date(nextYr, nextMo, nd);
|
|
13811
|
+
const col = cells.length % 7;
|
|
13812
|
+
cells.push({
|
|
13813
|
+
gcDate: date,
|
|
13814
|
+
day: nd,
|
|
13815
|
+
month: nextMo,
|
|
13816
|
+
year: nextYr,
|
|
13817
|
+
current: false,
|
|
13818
|
+
weekend: col >= 5,
|
|
13819
|
+
isToday: false,
|
|
13820
|
+
isSelected: false
|
|
13821
|
+
});
|
|
13822
|
+
nd++;
|
|
13823
|
+
}
|
|
13824
|
+
return cells;
|
|
13825
|
+
}
|
|
13826
|
+
function buildECCells({
|
|
13827
|
+
ecViewYear,
|
|
13828
|
+
ecViewMonth,
|
|
13829
|
+
value,
|
|
13830
|
+
now
|
|
13831
|
+
}) {
|
|
13832
|
+
const daysInCur = ecDaysInMonth(ecViewYear, ecViewMonth);
|
|
13833
|
+
const [gcy, gcm] = toGC(ecViewYear, ecViewMonth, 1);
|
|
13834
|
+
const startDay = getStartDay(gcy, gcm - 1);
|
|
13835
|
+
const prevMo = ecViewMonth === 1 ? 13 : ecViewMonth - 1;
|
|
13836
|
+
const prevYr = ecViewMonth === 1 ? ecViewYear - 1 : ecViewYear;
|
|
13837
|
+
const daysInPrev = ecDaysInMonth(prevYr, prevMo);
|
|
13838
|
+
const nextMo = ecViewMonth === 13 ? 1 : ecViewMonth + 1;
|
|
13839
|
+
const nextYr = ecViewMonth === 13 ? ecViewYear + 1 : ecViewYear;
|
|
13840
|
+
const cells = [];
|
|
13841
|
+
for (let i = startDay - 1; i >= 0; i--) {
|
|
13842
|
+
const day = daysInPrev - i;
|
|
13843
|
+
const [yy, mm, dd] = toGC(prevYr, prevMo, day);
|
|
13844
|
+
const date = new Date(yy, mm - 1, dd);
|
|
13845
|
+
const col = cells.length % 7;
|
|
13846
|
+
cells.push({
|
|
13847
|
+
gcDate: date,
|
|
13848
|
+
day,
|
|
13849
|
+
month: prevMo,
|
|
13850
|
+
year: prevYr,
|
|
13851
|
+
current: false,
|
|
13852
|
+
weekend: col >= 5,
|
|
13853
|
+
isToday: false,
|
|
13854
|
+
isSelected: false
|
|
13855
|
+
});
|
|
13856
|
+
}
|
|
13857
|
+
for (let day = 1; day <= daysInCur; day++) {
|
|
13858
|
+
const [yy, mm, dd] = toGC(ecViewYear, ecViewMonth, day);
|
|
13859
|
+
const date = new Date(yy, mm - 1, dd);
|
|
13860
|
+
const col = cells.length % 7;
|
|
13861
|
+
const [todayY, todayM, todayD] = toEC(
|
|
13862
|
+
now.getFullYear(),
|
|
13863
|
+
now.getMonth() + 1,
|
|
13864
|
+
now.getDate()
|
|
13865
|
+
);
|
|
13866
|
+
const [selY, selM, selD] = value ? toEC(value.getFullYear(), value.getMonth() + 1, value.getDate()) : [0, 0, 0];
|
|
13867
|
+
cells.push({
|
|
13868
|
+
gcDate: date,
|
|
13869
|
+
day,
|
|
13870
|
+
month: ecViewMonth,
|
|
13871
|
+
year: ecViewYear,
|
|
13872
|
+
current: true,
|
|
13873
|
+
weekend: col >= 5,
|
|
13874
|
+
isToday: day === todayD && ecViewMonth === todayM && ecViewYear === todayY,
|
|
13875
|
+
isSelected: !!value && day === selD && ecViewMonth === selM && ecViewYear === selY
|
|
13876
|
+
});
|
|
13877
|
+
}
|
|
13878
|
+
const totalNeeded = Math.ceil(cells.length / 7) * 7;
|
|
13879
|
+
let nd = 1;
|
|
13880
|
+
while (cells.length < totalNeeded) {
|
|
13881
|
+
const [yy, mm, dd] = toGC(nextYr, nextMo, nd);
|
|
13882
|
+
const date = new Date(yy, mm - 1, dd);
|
|
13883
|
+
const col = cells.length % 7;
|
|
13884
|
+
cells.push({
|
|
13885
|
+
gcDate: date,
|
|
13886
|
+
day: nd,
|
|
13887
|
+
month: nextMo,
|
|
13888
|
+
year: nextYr,
|
|
13889
|
+
current: false,
|
|
13890
|
+
weekend: col >= 5,
|
|
13891
|
+
isToday: false,
|
|
13892
|
+
isSelected: false
|
|
13893
|
+
});
|
|
13894
|
+
nd++;
|
|
13895
|
+
}
|
|
13896
|
+
return cells;
|
|
13897
|
+
}
|
|
13898
|
+
function buildCells(calendarType, gcParams, ecParams) {
|
|
13899
|
+
return calendarType === "EC" ? buildECCells(ecParams) : buildGCCells(gcParams);
|
|
13900
|
+
}
|
|
13901
|
+
function buildYears(activeViewYear) {
|
|
13902
|
+
const start = Math.floor(activeViewYear / 10) * 10;
|
|
13903
|
+
return Array.from({ length: 12 }, (_, i) => start - 1 + i);
|
|
13904
|
+
}
|
|
13905
|
+
function getDecadeStart(activeViewYear) {
|
|
13906
|
+
return Math.floor(activeViewYear / 10) * 10;
|
|
13907
|
+
}
|
|
13908
|
+
|
|
13909
|
+
// src/components/ui/date-time/format-display.ts
|
|
13910
|
+
function formatDateTimeDisplay(d, calendarType, withSeconds) {
|
|
13911
|
+
const [ecYear, ecMonth, ecDay] = toEC(
|
|
13912
|
+
d.getFullYear(),
|
|
13913
|
+
d.getMonth() + 1,
|
|
13914
|
+
d.getDate()
|
|
13915
|
+
);
|
|
13916
|
+
const dd = calendarType === "EC" ? pad2(ecDay) : pad2(d.getDate());
|
|
13917
|
+
const mm = calendarType === "EC" ? pad2(ecMonth) : pad2(d.getMonth() + 1);
|
|
13918
|
+
const yyyy = calendarType === "EC" ? ecYear : d.getFullYear();
|
|
13919
|
+
const hh = pad2(d.getHours());
|
|
13920
|
+
const min = pad2(d.getMinutes());
|
|
13921
|
+
const sec = pad2(d.getSeconds());
|
|
13922
|
+
return `${dd}/${mm}/${yyyy} ${hh}:${min}${withSeconds ? `:${sec}` : ""}`;
|
|
13923
|
+
}
|
|
13924
|
+
|
|
13925
|
+
// src/components/ui/date-time/time-utils.ts
|
|
13926
|
+
function clampAndPad(raw, max) {
|
|
13927
|
+
if (!raw) {
|
|
13928
|
+
return "";
|
|
13929
|
+
}
|
|
13930
|
+
let n = Number.parseInt(raw, 10) || 0;
|
|
13931
|
+
n = Math.max(0, Math.min(n, max));
|
|
13932
|
+
return pad2(n);
|
|
13933
|
+
}
|
|
13934
|
+
|
|
13935
|
+
// src/components/ui/date-time/use-datetime-picker.ts
|
|
13936
|
+
function useDateTimePicker(props) {
|
|
13937
|
+
const {
|
|
13938
|
+
value: controlledValue,
|
|
13939
|
+
defaultValue = null,
|
|
13940
|
+
onChange,
|
|
13941
|
+
withSeconds = false
|
|
13942
|
+
} = props;
|
|
13943
|
+
const isControlled = controlledValue !== void 0;
|
|
13944
|
+
const [internalValue, setInternalValue] = useState33(defaultValue);
|
|
13945
|
+
const value = isControlled ? controlledValue : internalValue;
|
|
13946
|
+
const [open, setOpen] = useState33(false);
|
|
13947
|
+
const [view, setView] = useState33("days");
|
|
13948
|
+
const [calendarType, setCalendarType] = useState33("GC");
|
|
13949
|
+
const now = /* @__PURE__ */ new Date();
|
|
13950
|
+
const [gcViewYear, setGcViewYear] = useState33(
|
|
13951
|
+
value?.getFullYear() ?? now.getFullYear()
|
|
13952
|
+
);
|
|
13953
|
+
const [gcViewMonth, setGcViewMonth] = useState33(
|
|
13954
|
+
value?.getMonth() ?? now.getMonth()
|
|
13955
|
+
);
|
|
13956
|
+
const initialEC = toEC(now.getFullYear(), now.getMonth() + 1, now.getDate());
|
|
13957
|
+
const [ecViewYear, setEcViewYear] = useState33(initialEC[0]);
|
|
13958
|
+
const [ecViewMonth, setEcViewMonth] = useState33(initialEC[1]);
|
|
13959
|
+
const [timeH, setTimeH] = useState33(value ? pad2(value.getHours()) : "");
|
|
13960
|
+
const [timeM, setTimeM] = useState33(value ? pad2(value.getMinutes()) : "");
|
|
13961
|
+
const [timeS, setTimeS] = useState33(value ? pad2(value.getSeconds()) : "");
|
|
13962
|
+
const [timeFocus, setTimeFocus] = useState33(null);
|
|
13963
|
+
const triggerRef = useRef15(null);
|
|
13964
|
+
const [contentSide, setContentSide] = useState33("bottom");
|
|
13965
|
+
const updatePreferredSide = useCallback10(() => {
|
|
13966
|
+
if (!triggerRef.current) {
|
|
13967
|
+
return;
|
|
13968
|
+
}
|
|
13969
|
+
const rect = triggerRef.current.getBoundingClientRect();
|
|
13970
|
+
setContentSide(rect.top > window.innerHeight / 2 ? "top" : "bottom");
|
|
13971
|
+
}, []);
|
|
13972
|
+
useEffect15(() => {
|
|
13973
|
+
if (!value) {
|
|
13974
|
+
return;
|
|
13975
|
+
}
|
|
13976
|
+
setGcViewYear(value.getFullYear());
|
|
13977
|
+
setGcViewMonth(value.getMonth());
|
|
13978
|
+
const [ecYear, ecMonth] = toEC(
|
|
13979
|
+
value.getFullYear(),
|
|
13980
|
+
value.getMonth() + 1,
|
|
13981
|
+
value.getDate()
|
|
13982
|
+
);
|
|
13983
|
+
setEcViewYear(ecYear);
|
|
13984
|
+
setEcViewMonth(ecMonth);
|
|
13985
|
+
}, [value]);
|
|
13986
|
+
const updateValue = useCallback10(
|
|
13987
|
+
(date) => {
|
|
13988
|
+
if (!isControlled) {
|
|
13989
|
+
setInternalValue(date);
|
|
13990
|
+
}
|
|
13991
|
+
onChange?.(date);
|
|
13992
|
+
},
|
|
13993
|
+
[isControlled, onChange]
|
|
13994
|
+
);
|
|
13995
|
+
const activeViewYear = calendarType === "EC" ? ecViewYear : gcViewYear;
|
|
13996
|
+
const decadeStart = getDecadeStart(activeViewYear);
|
|
13997
|
+
const gcParams = { gcViewYear, gcViewMonth, value, now };
|
|
13998
|
+
const ecParams = { ecViewYear, ecViewMonth, value, now };
|
|
13999
|
+
const cells = buildCells(calendarType, gcParams, ecParams);
|
|
14000
|
+
const years = buildYears(activeViewYear);
|
|
14001
|
+
const headerLabel = () => {
|
|
14002
|
+
const monthLabel = calendarType === "EC" ? EC_MONTHS[ecViewMonth - 1] : MONTHS[gcViewMonth];
|
|
14003
|
+
if (view === "days") {
|
|
14004
|
+
return `${monthLabel} ${activeViewYear}`;
|
|
14005
|
+
}
|
|
14006
|
+
if (view === "months") {
|
|
14007
|
+
return String(activeViewYear);
|
|
14008
|
+
}
|
|
14009
|
+
return `${decadeStart} \u2013 ${decadeStart + 9}`;
|
|
14010
|
+
};
|
|
14011
|
+
const formatDisplay = useCallback10(
|
|
14012
|
+
(d) => formatDateTimeDisplay(d, calendarType, withSeconds),
|
|
14013
|
+
[calendarType, withSeconds]
|
|
14014
|
+
);
|
|
14015
|
+
function handleDayClick(cell) {
|
|
14016
|
+
const h = timeH ? Math.min(Number.parseInt(timeH, 10) || 0, 23) : 0;
|
|
14017
|
+
const m = timeM ? Math.min(Number.parseInt(timeM, 10) || 0, 59) : 0;
|
|
14018
|
+
const s = withSeconds && timeS ? Math.min(Number.parseInt(timeS, 10) || 0, 59) : 0;
|
|
14019
|
+
const selected = new Date(
|
|
14020
|
+
cell.gcDate.getFullYear(),
|
|
14021
|
+
cell.gcDate.getMonth(),
|
|
14022
|
+
cell.gcDate.getDate(),
|
|
14023
|
+
h,
|
|
14024
|
+
m,
|
|
14025
|
+
s
|
|
14026
|
+
);
|
|
14027
|
+
updateValue(selected);
|
|
14028
|
+
setGcViewMonth(selected.getMonth());
|
|
14029
|
+
setGcViewYear(selected.getFullYear());
|
|
14030
|
+
const [ecYear, ecMonth] = toEC(
|
|
14031
|
+
selected.getFullYear(),
|
|
14032
|
+
selected.getMonth() + 1,
|
|
14033
|
+
selected.getDate()
|
|
14034
|
+
);
|
|
14035
|
+
setEcViewYear(ecYear);
|
|
14036
|
+
setEcViewMonth(ecMonth);
|
|
14037
|
+
if (!timeH) {
|
|
14038
|
+
setTimeH("00");
|
|
14039
|
+
}
|
|
14040
|
+
if (!timeM) {
|
|
14041
|
+
setTimeM("00");
|
|
14042
|
+
}
|
|
14043
|
+
if (withSeconds && !timeS) {
|
|
14044
|
+
setTimeS("00");
|
|
14045
|
+
}
|
|
14046
|
+
}
|
|
14047
|
+
function handleMonthSelect(i) {
|
|
14048
|
+
if (calendarType === "EC") {
|
|
14049
|
+
setEcViewMonth(i + 1);
|
|
14050
|
+
} else {
|
|
14051
|
+
setGcViewMonth(i);
|
|
14052
|
+
}
|
|
14053
|
+
setView("days");
|
|
14054
|
+
}
|
|
14055
|
+
function handleYearSelect(y) {
|
|
14056
|
+
if (calendarType === "EC") {
|
|
14057
|
+
setEcViewYear(y);
|
|
14058
|
+
} else {
|
|
14059
|
+
setGcViewYear(y);
|
|
14060
|
+
}
|
|
14061
|
+
setView("months");
|
|
14062
|
+
}
|
|
14063
|
+
function handlePrev() {
|
|
14064
|
+
if (view === "days") {
|
|
14065
|
+
if (calendarType === "EC") {
|
|
14066
|
+
if (ecViewMonth === 1) {
|
|
14067
|
+
setEcViewMonth(13);
|
|
14068
|
+
setEcViewYear((y) => y - 1);
|
|
14069
|
+
} else {
|
|
14070
|
+
setEcViewMonth((m) => m - 1);
|
|
14071
|
+
}
|
|
14072
|
+
} else if (gcViewMonth === 0) {
|
|
14073
|
+
setGcViewMonth(11);
|
|
14074
|
+
setGcViewYear((y) => y - 1);
|
|
14075
|
+
} else {
|
|
14076
|
+
setGcViewMonth((m) => m - 1);
|
|
14077
|
+
}
|
|
14078
|
+
} else if (view === "months") {
|
|
14079
|
+
if (calendarType === "EC") {
|
|
14080
|
+
setEcViewYear((y) => y - 1);
|
|
14081
|
+
} else {
|
|
14082
|
+
setGcViewYear((y) => y - 1);
|
|
14083
|
+
}
|
|
14084
|
+
} else if (calendarType === "EC") {
|
|
14085
|
+
setEcViewYear((y) => y - 10);
|
|
14086
|
+
} else {
|
|
14087
|
+
setGcViewYear((y) => y - 10);
|
|
14088
|
+
}
|
|
14089
|
+
}
|
|
14090
|
+
function handleNext() {
|
|
14091
|
+
if (view === "days") {
|
|
14092
|
+
if (calendarType === "EC") {
|
|
14093
|
+
if (ecViewMonth === 13) {
|
|
14094
|
+
setEcViewMonth(1);
|
|
14095
|
+
setEcViewYear((y) => y + 1);
|
|
14096
|
+
} else {
|
|
14097
|
+
setEcViewMonth((m) => m + 1);
|
|
14098
|
+
}
|
|
14099
|
+
} else if (gcViewMonth === 11) {
|
|
14100
|
+
setGcViewMonth(0);
|
|
14101
|
+
setGcViewYear((y) => y + 1);
|
|
14102
|
+
} else {
|
|
14103
|
+
setGcViewMonth((m) => m + 1);
|
|
14104
|
+
}
|
|
14105
|
+
} else if (view === "months") {
|
|
14106
|
+
if (calendarType === "EC") {
|
|
14107
|
+
setEcViewYear((y) => y + 1);
|
|
14108
|
+
} else {
|
|
14109
|
+
setGcViewYear((y) => y + 1);
|
|
14110
|
+
}
|
|
14111
|
+
} else if (calendarType === "EC") {
|
|
14112
|
+
setEcViewYear((y) => y + 10);
|
|
14113
|
+
} else {
|
|
14114
|
+
setGcViewYear((y) => y + 10);
|
|
14115
|
+
}
|
|
14116
|
+
}
|
|
14117
|
+
function handleHeaderClick() {
|
|
14118
|
+
if (view === "days") {
|
|
14119
|
+
setView("months");
|
|
14120
|
+
} else if (view === "months") {
|
|
14121
|
+
setView("years");
|
|
14122
|
+
}
|
|
14123
|
+
}
|
|
14124
|
+
function handleCalendarTypeChange(nextType) {
|
|
14125
|
+
if (nextType === calendarType) {
|
|
14126
|
+
return;
|
|
14127
|
+
}
|
|
14128
|
+
if (nextType === "EC") {
|
|
14129
|
+
const source = value ?? new Date(gcViewYear, gcViewMonth, 1);
|
|
14130
|
+
const [year, month] = toEC(
|
|
14131
|
+
source.getFullYear(),
|
|
14132
|
+
source.getMonth() + 1,
|
|
14133
|
+
source.getDate()
|
|
14134
|
+
);
|
|
14135
|
+
setEcViewYear(year);
|
|
14136
|
+
setEcViewMonth(month);
|
|
14137
|
+
} else {
|
|
14138
|
+
const source = value ?? (() => {
|
|
14139
|
+
const [year, month, day] = toGC(ecViewYear, ecViewMonth, 1);
|
|
14140
|
+
return new Date(year, month - 1, day);
|
|
14141
|
+
})();
|
|
14142
|
+
setGcViewYear(source.getFullYear());
|
|
14143
|
+
setGcViewMonth(source.getMonth());
|
|
14144
|
+
}
|
|
14145
|
+
setCalendarType(nextType);
|
|
14146
|
+
setView("days");
|
|
14147
|
+
}
|
|
14148
|
+
function handleTimeBlur(field) {
|
|
14149
|
+
setTimeFocus(null);
|
|
14150
|
+
const raw = { h: timeH, m: timeM, s: timeS }[field];
|
|
14151
|
+
const max = field === "h" ? 23 : 59;
|
|
14152
|
+
const padded = clampAndPad(raw, max);
|
|
14153
|
+
if (field === "h") {
|
|
14154
|
+
setTimeH(padded);
|
|
14155
|
+
} else if (field === "m") {
|
|
14156
|
+
setTimeM(padded);
|
|
14157
|
+
} else {
|
|
14158
|
+
setTimeS(padded);
|
|
14159
|
+
}
|
|
14160
|
+
if (value && padded) {
|
|
14161
|
+
const d = new Date(value);
|
|
14162
|
+
if (field === "h") {
|
|
14163
|
+
d.setHours(Number.parseInt(padded, 10));
|
|
14164
|
+
} else if (field === "m") {
|
|
14165
|
+
d.setMinutes(Number.parseInt(padded, 10));
|
|
14166
|
+
} else {
|
|
14167
|
+
d.setSeconds(Number.parseInt(padded, 10));
|
|
14168
|
+
}
|
|
14169
|
+
updateValue(d);
|
|
14170
|
+
}
|
|
14171
|
+
}
|
|
14172
|
+
function handleConfirm() {
|
|
14173
|
+
if (value) {
|
|
14174
|
+
const h = clampAndPad(timeH, 23);
|
|
14175
|
+
const m = clampAndPad(timeM, 59);
|
|
14176
|
+
const s = clampAndPad(timeS, 59);
|
|
14177
|
+
if (h) {
|
|
14178
|
+
setTimeH(h);
|
|
14179
|
+
}
|
|
14180
|
+
if (m) {
|
|
14181
|
+
setTimeM(m);
|
|
14182
|
+
}
|
|
14183
|
+
if (withSeconds && s) {
|
|
14184
|
+
setTimeS(s);
|
|
14185
|
+
}
|
|
14186
|
+
const d = new Date(value);
|
|
14187
|
+
const secNum = withSeconds && s ? Number.parseInt(s, 10) : 0;
|
|
14188
|
+
d.setHours(
|
|
14189
|
+
h ? Number.parseInt(h, 10) : 0,
|
|
14190
|
+
m ? Number.parseInt(m, 10) : 0,
|
|
14191
|
+
withSeconds ? secNum : 0,
|
|
14192
|
+
0
|
|
14193
|
+
);
|
|
14194
|
+
updateValue(d);
|
|
14195
|
+
}
|
|
14196
|
+
setOpen(false);
|
|
14197
|
+
setView("days");
|
|
14198
|
+
setTimeFocus(null);
|
|
14199
|
+
}
|
|
14200
|
+
const handleOpenChange = useCallback10(
|
|
14201
|
+
(nextOpen) => {
|
|
14202
|
+
if (nextOpen) {
|
|
14203
|
+
const source = value ?? now;
|
|
14204
|
+
setGcViewYear(source.getFullYear());
|
|
14205
|
+
setGcViewMonth(source.getMonth());
|
|
14206
|
+
const [ecYear, ecMonth] = toEC(
|
|
14207
|
+
source.getFullYear(),
|
|
14208
|
+
source.getMonth() + 1,
|
|
14209
|
+
source.getDate()
|
|
14210
|
+
);
|
|
14211
|
+
setEcViewYear(ecYear);
|
|
14212
|
+
setEcViewMonth(ecMonth);
|
|
14213
|
+
setView("days");
|
|
14214
|
+
updatePreferredSide();
|
|
14215
|
+
} else {
|
|
14216
|
+
setView("days");
|
|
14217
|
+
setTimeFocus(null);
|
|
14218
|
+
}
|
|
14219
|
+
setOpen(nextOpen);
|
|
14220
|
+
},
|
|
14221
|
+
[now, updatePreferredSide, value]
|
|
14222
|
+
);
|
|
14223
|
+
function handlePresetClick(preset) {
|
|
14224
|
+
const d = preset.value;
|
|
14225
|
+
updateValue(d);
|
|
14226
|
+
setTimeH(pad2(d.getHours()));
|
|
14227
|
+
setTimeM(pad2(d.getMinutes()));
|
|
14228
|
+
setTimeS(pad2(d.getSeconds()));
|
|
14229
|
+
setGcViewYear(d.getFullYear());
|
|
14230
|
+
setGcViewMonth(d.getMonth());
|
|
14231
|
+
const [ecY, ecM] = toEC(d.getFullYear(), d.getMonth() + 1, d.getDate());
|
|
14232
|
+
setEcViewYear(ecY);
|
|
14233
|
+
setEcViewMonth(ecM);
|
|
14234
|
+
setView("days");
|
|
14235
|
+
}
|
|
14236
|
+
function handleClear() {
|
|
14237
|
+
updateValue(null);
|
|
14238
|
+
setTimeH("");
|
|
14239
|
+
setTimeM("");
|
|
14240
|
+
setTimeS("");
|
|
14241
|
+
}
|
|
14242
|
+
return {
|
|
14243
|
+
value,
|
|
14244
|
+
open,
|
|
14245
|
+
view,
|
|
14246
|
+
calendarType,
|
|
14247
|
+
gcViewYear,
|
|
14248
|
+
gcViewMonth,
|
|
14249
|
+
ecViewYear,
|
|
14250
|
+
ecViewMonth,
|
|
14251
|
+
timeH,
|
|
14252
|
+
timeM,
|
|
14253
|
+
timeS,
|
|
14254
|
+
timeFocus,
|
|
14255
|
+
contentSide,
|
|
14256
|
+
triggerRef,
|
|
14257
|
+
updateValue,
|
|
14258
|
+
formatDisplay,
|
|
14259
|
+
cells,
|
|
14260
|
+
years,
|
|
14261
|
+
decadeStart,
|
|
14262
|
+
activeViewYear,
|
|
14263
|
+
headerLabel,
|
|
14264
|
+
handleDayClick,
|
|
14265
|
+
handleMonthSelect,
|
|
14266
|
+
handleYearSelect,
|
|
14267
|
+
handlePrev,
|
|
14268
|
+
handleNext,
|
|
14269
|
+
handleHeaderClick,
|
|
14270
|
+
handleCalendarTypeChange,
|
|
14271
|
+
handleTimeBlur,
|
|
14272
|
+
handleConfirm,
|
|
14273
|
+
handleOpenChange,
|
|
14274
|
+
handlePresetClick,
|
|
14275
|
+
handleClear,
|
|
14276
|
+
setTimeFocus,
|
|
14277
|
+
setTimeH,
|
|
14278
|
+
setTimeM,
|
|
14279
|
+
setTimeS
|
|
14280
|
+
};
|
|
14281
|
+
}
|
|
14282
|
+
|
|
14283
|
+
// src/components/ui/date-time/datetime-picker.tsx
|
|
14284
|
+
import { jsx as jsx130, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
14285
|
+
var DateTimePicker = forwardRef6(function DateTimePicker2(props, ref) {
|
|
14286
|
+
const {
|
|
14287
|
+
label,
|
|
14288
|
+
placeholder = "Pick date and time",
|
|
14289
|
+
disabled = false,
|
|
14290
|
+
clearable = false,
|
|
14291
|
+
withSeconds = false,
|
|
14292
|
+
presets,
|
|
14293
|
+
valueFormat,
|
|
14294
|
+
description,
|
|
14295
|
+
error,
|
|
14296
|
+
required = false,
|
|
14297
|
+
size = "md",
|
|
14298
|
+
radius = "md",
|
|
14299
|
+
dropdownType = "popover",
|
|
14300
|
+
"aria-label": ariaLabel,
|
|
14301
|
+
className
|
|
14302
|
+
} = props;
|
|
14303
|
+
const state = useDateTimePicker(props);
|
|
14304
|
+
const {
|
|
14305
|
+
value,
|
|
14306
|
+
open,
|
|
14307
|
+
view,
|
|
14308
|
+
calendarType,
|
|
14309
|
+
timeH,
|
|
14310
|
+
timeM,
|
|
14311
|
+
timeS,
|
|
14312
|
+
timeFocus,
|
|
14313
|
+
contentSide,
|
|
14314
|
+
triggerRef,
|
|
14315
|
+
formatDisplay,
|
|
14316
|
+
cells,
|
|
14317
|
+
years,
|
|
14318
|
+
decadeStart,
|
|
14319
|
+
ecViewYear,
|
|
14320
|
+
gcViewYear,
|
|
14321
|
+
headerLabel,
|
|
14322
|
+
handleDayClick,
|
|
14323
|
+
handleMonthSelect,
|
|
14324
|
+
handleYearSelect,
|
|
14325
|
+
handlePrev,
|
|
14326
|
+
handleNext,
|
|
14327
|
+
handleHeaderClick,
|
|
14328
|
+
handleCalendarTypeChange,
|
|
14329
|
+
handleTimeBlur,
|
|
14330
|
+
handleConfirm,
|
|
14331
|
+
handleOpenChange,
|
|
14332
|
+
handlePresetClick,
|
|
14333
|
+
handleClear,
|
|
14334
|
+
setTimeFocus,
|
|
14335
|
+
setTimeH,
|
|
14336
|
+
setTimeM,
|
|
14337
|
+
setTimeS
|
|
14338
|
+
} = state;
|
|
14339
|
+
const dropdownContent = /* @__PURE__ */ jsx130(
|
|
14340
|
+
DateTimeDropdownContent,
|
|
14341
|
+
{
|
|
14342
|
+
hasPresets: Boolean(presets?.length),
|
|
14343
|
+
presets,
|
|
14344
|
+
onPresetClick: handlePresetClick,
|
|
14345
|
+
view,
|
|
14346
|
+
calendarType,
|
|
14347
|
+
value,
|
|
14348
|
+
headerLabel: headerLabel(),
|
|
14349
|
+
cells,
|
|
14350
|
+
years,
|
|
14351
|
+
decadeStart,
|
|
14352
|
+
ecViewYear,
|
|
14353
|
+
gcViewYear,
|
|
14354
|
+
onPrev: handlePrev,
|
|
14355
|
+
onNext: handleNext,
|
|
14356
|
+
onHeaderClick: handleHeaderClick,
|
|
14357
|
+
onDayClick: handleDayClick,
|
|
14358
|
+
onMonthSelect: handleMonthSelect,
|
|
14359
|
+
onYearSelect: handleYearSelect,
|
|
14360
|
+
onCalendarTypeChange: handleCalendarTypeChange,
|
|
14361
|
+
timeH,
|
|
14362
|
+
timeM,
|
|
14363
|
+
timeS,
|
|
14364
|
+
timeFocus,
|
|
14365
|
+
withSeconds,
|
|
14366
|
+
onTimeFocus: setTimeFocus,
|
|
14367
|
+
onTimeBlur: handleTimeBlur,
|
|
14368
|
+
onTimeHChange: setTimeH,
|
|
14369
|
+
onTimeMChange: setTimeM,
|
|
14370
|
+
onTimeSChange: setTimeS,
|
|
14371
|
+
onConfirm: handleConfirm
|
|
14372
|
+
}
|
|
14373
|
+
);
|
|
14374
|
+
const triggerButton = /* @__PURE__ */ jsx130(
|
|
14375
|
+
DateTimeTriggerButton,
|
|
14376
|
+
{
|
|
14377
|
+
ref,
|
|
14378
|
+
value,
|
|
14379
|
+
placeholder,
|
|
14380
|
+
valueFormat,
|
|
14381
|
+
formatDisplay,
|
|
14382
|
+
disabled,
|
|
14383
|
+
error,
|
|
14384
|
+
open,
|
|
14385
|
+
size,
|
|
14386
|
+
radius,
|
|
14387
|
+
"aria-label": ariaLabel
|
|
14388
|
+
}
|
|
14389
|
+
);
|
|
14390
|
+
const wrapper = /* @__PURE__ */ jsxs81("div", { className: cn("relative inline-block w-full", className), children: [
|
|
14391
|
+
label ? /* @__PURE__ */ jsxs81("label", { className: "mb-1.5 block text-sm font-semibold text-foreground", children: [
|
|
14392
|
+
label,
|
|
14393
|
+
required ? /* @__PURE__ */ jsx130("span", { className: "ml-0.5 text-destructive", "aria-hidden": true, children: "*" }) : null
|
|
14394
|
+
] }) : null,
|
|
14395
|
+
description ? /* @__PURE__ */ jsx130("p", { className: "mb-1.5 text-xs text-muted-foreground", children: description }) : null,
|
|
14396
|
+
/* @__PURE__ */ jsxs81("div", { ref: triggerRef, className: "relative", children: [
|
|
14397
|
+
dropdownType === "modal" ? /* @__PURE__ */ jsx130(DialogTrigger, { children: triggerButton }) : /* @__PURE__ */ jsx130(PopoverTrigger, { className: "block w-full", children: triggerButton }),
|
|
14398
|
+
clearable && value && !disabled && /* @__PURE__ */ jsx130(
|
|
14399
|
+
"button",
|
|
14400
|
+
{
|
|
14401
|
+
type: "button",
|
|
14402
|
+
onClick: (e) => {
|
|
14403
|
+
e.stopPropagation();
|
|
14404
|
+
handleClear();
|
|
14405
|
+
},
|
|
14406
|
+
className: "absolute right-2.5 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground hover:text-foreground",
|
|
14407
|
+
"aria-label": "Clear",
|
|
14408
|
+
children: /* @__PURE__ */ jsxs81(
|
|
14409
|
+
"svg",
|
|
14410
|
+
{
|
|
14411
|
+
className: "size-3.5",
|
|
14412
|
+
fill: "none",
|
|
14413
|
+
viewBox: "0 0 24 24",
|
|
14414
|
+
stroke: "currentColor",
|
|
14415
|
+
strokeWidth: 2,
|
|
14416
|
+
"aria-hidden": true,
|
|
14417
|
+
children: [
|
|
14418
|
+
/* @__PURE__ */ jsx130("title", { children: "Clear" }),
|
|
14419
|
+
/* @__PURE__ */ jsx130(
|
|
14420
|
+
"path",
|
|
14421
|
+
{
|
|
14422
|
+
strokeLinecap: "round",
|
|
14423
|
+
strokeLinejoin: "round",
|
|
14424
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
14425
|
+
}
|
|
14426
|
+
)
|
|
14427
|
+
]
|
|
14428
|
+
}
|
|
14429
|
+
)
|
|
14430
|
+
}
|
|
14431
|
+
)
|
|
14432
|
+
] }),
|
|
14433
|
+
error ? /* @__PURE__ */ jsx130("p", { className: "mt-1.5 text-xs text-destructive", children: error }) : null,
|
|
14434
|
+
dropdownType === "modal" ? /* @__PURE__ */ jsxs81(
|
|
14435
|
+
DialogContent,
|
|
14436
|
+
{
|
|
14437
|
+
className: cn(
|
|
14438
|
+
"max-w-[calc(100vw-1rem)] rounded-md border border-border bg-background p-0 shadow-xl",
|
|
14439
|
+
presets?.length ? "flex w-[460px]" : "w-[340px]"
|
|
14440
|
+
),
|
|
14441
|
+
showCloseButton: true,
|
|
14442
|
+
children: [
|
|
14443
|
+
/* @__PURE__ */ jsx130(DialogTitle, { className: "sr-only", children: label || placeholder }),
|
|
14444
|
+
dropdownContent
|
|
14445
|
+
]
|
|
14446
|
+
}
|
|
14447
|
+
) : /* @__PURE__ */ jsx130(
|
|
14448
|
+
PopoverContent,
|
|
14449
|
+
{
|
|
14450
|
+
anchor: triggerRef,
|
|
14451
|
+
side: contentSide,
|
|
14452
|
+
sideOffset: 8,
|
|
14453
|
+
align: "center",
|
|
14454
|
+
alignOffset: 0,
|
|
14455
|
+
className: cn(
|
|
14456
|
+
"max-w-[calc(100vw-1rem)] rounded-md border border-border bg-background p-0 shadow-xl",
|
|
14457
|
+
presets?.length ? "flex w-[460px]" : "w-[340px]"
|
|
14458
|
+
),
|
|
14459
|
+
children: dropdownContent
|
|
14460
|
+
}
|
|
14461
|
+
)
|
|
14462
|
+
] });
|
|
14463
|
+
return dropdownType === "modal" ? /* @__PURE__ */ jsx130(Dialog, { open, onOpenChange: handleOpenChange, children: wrapper }) : /* @__PURE__ */ jsx130(Popover, { open, onOpenChange: handleOpenChange, children: wrapper });
|
|
14464
|
+
});
|
|
14465
|
+
|
|
13290
14466
|
// src/components/ui/direction.tsx
|
|
13291
14467
|
import {
|
|
13292
14468
|
DirectionProvider,
|
|
@@ -13295,32 +14471,32 @@ import {
|
|
|
13295
14471
|
|
|
13296
14472
|
// src/components/ui/drawer.tsx
|
|
13297
14473
|
import { Dialog as DrawerPrimitive } from "@base-ui/react/dialog";
|
|
13298
|
-
import { jsx as
|
|
14474
|
+
import { jsx as jsx131, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
13299
14475
|
function Drawer({
|
|
13300
14476
|
...props
|
|
13301
14477
|
}) {
|
|
13302
|
-
return /* @__PURE__ */
|
|
14478
|
+
return /* @__PURE__ */ jsx131(DrawerPrimitive.Root, { "data-slot": "drawer", ...props });
|
|
13303
14479
|
}
|
|
13304
14480
|
function DrawerTrigger({
|
|
13305
14481
|
...props
|
|
13306
14482
|
}) {
|
|
13307
|
-
return /* @__PURE__ */
|
|
14483
|
+
return /* @__PURE__ */ jsx131(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
13308
14484
|
}
|
|
13309
14485
|
function DrawerPortal({
|
|
13310
14486
|
...props
|
|
13311
14487
|
}) {
|
|
13312
|
-
return /* @__PURE__ */
|
|
14488
|
+
return /* @__PURE__ */ jsx131(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
|
|
13313
14489
|
}
|
|
13314
14490
|
function DrawerClose({
|
|
13315
14491
|
...props
|
|
13316
14492
|
}) {
|
|
13317
|
-
return /* @__PURE__ */
|
|
14493
|
+
return /* @__PURE__ */ jsx131(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
13318
14494
|
}
|
|
13319
14495
|
function DrawerOverlay({
|
|
13320
14496
|
className,
|
|
13321
14497
|
...props
|
|
13322
14498
|
}) {
|
|
13323
|
-
return /* @__PURE__ */
|
|
14499
|
+
return /* @__PURE__ */ jsx131(
|
|
13324
14500
|
DrawerPrimitive.Backdrop,
|
|
13325
14501
|
{
|
|
13326
14502
|
"data-slot": "drawer-overlay",
|
|
@@ -13335,9 +14511,9 @@ function DrawerContent({
|
|
|
13335
14511
|
side = "bottom",
|
|
13336
14512
|
...props
|
|
13337
14513
|
}) {
|
|
13338
|
-
return /* @__PURE__ */
|
|
13339
|
-
/* @__PURE__ */
|
|
13340
|
-
/* @__PURE__ */
|
|
14514
|
+
return /* @__PURE__ */ jsxs82(DrawerPortal, { "data-slot": "drawer-portal", keepMounted: true, children: [
|
|
14515
|
+
/* @__PURE__ */ jsx131(DrawerOverlay, {}),
|
|
14516
|
+
/* @__PURE__ */ jsxs82(
|
|
13341
14517
|
DrawerPrimitive.Popup,
|
|
13342
14518
|
{
|
|
13343
14519
|
"data-slot": "drawer-content",
|
|
@@ -13348,7 +14524,7 @@ function DrawerContent({
|
|
|
13348
14524
|
),
|
|
13349
14525
|
...props,
|
|
13350
14526
|
children: [
|
|
13351
|
-
/* @__PURE__ */
|
|
14527
|
+
/* @__PURE__ */ jsx131("div", { className: "cn-drawer-handle" }),
|
|
13352
14528
|
children
|
|
13353
14529
|
]
|
|
13354
14530
|
}
|
|
@@ -13356,7 +14532,7 @@ function DrawerContent({
|
|
|
13356
14532
|
] });
|
|
13357
14533
|
}
|
|
13358
14534
|
function DrawerHeader({ className, ...props }) {
|
|
13359
|
-
return /* @__PURE__ */
|
|
14535
|
+
return /* @__PURE__ */ jsx131(
|
|
13360
14536
|
"div",
|
|
13361
14537
|
{
|
|
13362
14538
|
"data-slot": "drawer-header",
|
|
@@ -13366,7 +14542,7 @@ function DrawerHeader({ className, ...props }) {
|
|
|
13366
14542
|
);
|
|
13367
14543
|
}
|
|
13368
14544
|
function DrawerFooter({ className, ...props }) {
|
|
13369
|
-
return /* @__PURE__ */
|
|
14545
|
+
return /* @__PURE__ */ jsx131(
|
|
13370
14546
|
"div",
|
|
13371
14547
|
{
|
|
13372
14548
|
"data-slot": "drawer-footer",
|
|
@@ -13379,7 +14555,7 @@ function DrawerTitle({
|
|
|
13379
14555
|
className,
|
|
13380
14556
|
...props
|
|
13381
14557
|
}) {
|
|
13382
|
-
return /* @__PURE__ */
|
|
14558
|
+
return /* @__PURE__ */ jsx131(
|
|
13383
14559
|
DrawerPrimitive.Title,
|
|
13384
14560
|
{
|
|
13385
14561
|
"data-slot": "drawer-title",
|
|
@@ -13392,7 +14568,7 @@ function DrawerDescription({
|
|
|
13392
14568
|
className,
|
|
13393
14569
|
...props
|
|
13394
14570
|
}) {
|
|
13395
|
-
return /* @__PURE__ */
|
|
14571
|
+
return /* @__PURE__ */ jsx131(
|
|
13396
14572
|
DrawerPrimitive.Description,
|
|
13397
14573
|
{
|
|
13398
14574
|
"data-slot": "drawer-description",
|
|
@@ -13402,9 +14578,201 @@ function DrawerDescription({
|
|
|
13402
14578
|
);
|
|
13403
14579
|
}
|
|
13404
14580
|
|
|
14581
|
+
// src/components/ui/dropdown-button.tsx
|
|
14582
|
+
import { IconChevronDown as IconChevronDown10 } from "@tabler/icons-react";
|
|
14583
|
+
import { Fragment as Fragment23, jsx as jsx132, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
14584
|
+
var DROPDOWN_BUTTON_TRIGGER_SIZE_CN = {
|
|
14585
|
+
xs: "px-1.5",
|
|
14586
|
+
sm: "px-2",
|
|
14587
|
+
md: "px-2.5",
|
|
14588
|
+
lg: "px-2.5",
|
|
14589
|
+
xl: "px-3"
|
|
14590
|
+
};
|
|
14591
|
+
function getButtonVariant(variant) {
|
|
14592
|
+
if (variant === "danger") {
|
|
14593
|
+
return "default";
|
|
14594
|
+
}
|
|
14595
|
+
return variant;
|
|
14596
|
+
}
|
|
14597
|
+
function renderItemContent(item) {
|
|
14598
|
+
return /* @__PURE__ */ jsxs83(Fragment23, { children: [
|
|
14599
|
+
item.icon,
|
|
14600
|
+
/* @__PURE__ */ jsx132("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
14601
|
+
item.shortcut ? /* @__PURE__ */ jsx132(DropdownMenuShortcut, { children: item.shortcut }) : null
|
|
14602
|
+
] });
|
|
14603
|
+
}
|
|
14604
|
+
function renderActionItem(item, key) {
|
|
14605
|
+
if (item.items?.length) {
|
|
14606
|
+
return /* @__PURE__ */ jsxs83(DropdownMenuSub, { children: [
|
|
14607
|
+
/* @__PURE__ */ jsx132(DropdownMenuSubTrigger, { inset: item.inset, children: renderItemContent(item) }),
|
|
14608
|
+
/* @__PURE__ */ jsx132(DropdownMenuSubContent, { children: renderDropdownButtonItems(item.items) })
|
|
14609
|
+
] }, key);
|
|
14610
|
+
}
|
|
14611
|
+
return /* @__PURE__ */ jsx132(
|
|
14612
|
+
DropdownMenuItem,
|
|
14613
|
+
{
|
|
14614
|
+
disabled: item.disabled,
|
|
14615
|
+
inset: item.inset,
|
|
14616
|
+
variant: item.variant,
|
|
14617
|
+
onClick: item.onSelect,
|
|
14618
|
+
children: renderItemContent(item)
|
|
14619
|
+
},
|
|
14620
|
+
key
|
|
14621
|
+
);
|
|
14622
|
+
}
|
|
14623
|
+
function collectGroupChildren(items, startIndex) {
|
|
14624
|
+
const item = items[startIndex];
|
|
14625
|
+
if (item.type !== "label") {
|
|
14626
|
+
return { children: [], lastIndex: startIndex };
|
|
14627
|
+
}
|
|
14628
|
+
const key = item.key ?? `item-${startIndex}`;
|
|
14629
|
+
const children = [
|
|
14630
|
+
/* @__PURE__ */ jsx132(DropdownMenuLabel, { inset: item.inset, children: item.label }, `${key}-label`)
|
|
14631
|
+
];
|
|
14632
|
+
let lastIndex = startIndex;
|
|
14633
|
+
for (let nextIndex = startIndex + 1; nextIndex < items.length; nextIndex += 1) {
|
|
14634
|
+
const nextItem = items[nextIndex];
|
|
14635
|
+
if (nextItem.type === "separator" || nextItem.type === "label") {
|
|
14636
|
+
break;
|
|
14637
|
+
}
|
|
14638
|
+
const nextKey = nextItem.key ?? `item-${nextIndex}`;
|
|
14639
|
+
children.push(renderActionItem(nextItem, nextKey));
|
|
14640
|
+
lastIndex = nextIndex;
|
|
14641
|
+
}
|
|
14642
|
+
return { children, lastIndex };
|
|
14643
|
+
}
|
|
14644
|
+
function renderDropdownButtonItems(items) {
|
|
14645
|
+
const nodes = [];
|
|
14646
|
+
for (let index = 0; index < items.length; index += 1) {
|
|
14647
|
+
const item = items[index];
|
|
14648
|
+
const key = item.key ?? `item-${index}`;
|
|
14649
|
+
if (item.type === "separator") {
|
|
14650
|
+
nodes.push(/* @__PURE__ */ jsx132(DropdownMenuSeparator, {}, key));
|
|
14651
|
+
continue;
|
|
14652
|
+
}
|
|
14653
|
+
if (item.type === "label") {
|
|
14654
|
+
const group = collectGroupChildren(items, index);
|
|
14655
|
+
nodes.push(
|
|
14656
|
+
/* @__PURE__ */ jsx132(DropdownMenuGroup, { children: group.children }, key)
|
|
14657
|
+
);
|
|
14658
|
+
index = group.lastIndex;
|
|
14659
|
+
continue;
|
|
14660
|
+
}
|
|
14661
|
+
nodes.push(renderActionItem(item, key));
|
|
14662
|
+
}
|
|
14663
|
+
return nodes;
|
|
14664
|
+
}
|
|
14665
|
+
function DropdownButton({
|
|
14666
|
+
children,
|
|
14667
|
+
items,
|
|
14668
|
+
split = true,
|
|
14669
|
+
variant = "default",
|
|
14670
|
+
size = "md",
|
|
14671
|
+
color,
|
|
14672
|
+
radius,
|
|
14673
|
+
triggerIcon = /* @__PURE__ */ jsx132(IconChevronDown10, { className: "size-4" }),
|
|
14674
|
+
triggerLabel = "Open menu",
|
|
14675
|
+
mainButtonClassName,
|
|
14676
|
+
triggerClassName,
|
|
14677
|
+
contentClassName,
|
|
14678
|
+
positionerProps,
|
|
14679
|
+
contentProps,
|
|
14680
|
+
className,
|
|
14681
|
+
...buttonProps
|
|
14682
|
+
}) {
|
|
14683
|
+
const buttonVariant = getButtonVariant(variant);
|
|
14684
|
+
const variantClass = variant === "danger" ? "cn-dropdown-button-variant-danger" : "";
|
|
14685
|
+
const isDisabled = buttonProps.disabled || buttonProps.loading || items.length === 0;
|
|
14686
|
+
if (!split) {
|
|
14687
|
+
return /* @__PURE__ */ jsxs83(DropdownMenu, { children: [
|
|
14688
|
+
/* @__PURE__ */ jsx132(
|
|
14689
|
+
DropdownMenuTrigger,
|
|
14690
|
+
{
|
|
14691
|
+
render: /* @__PURE__ */ jsx132(
|
|
14692
|
+
Button,
|
|
14693
|
+
{
|
|
14694
|
+
...buttonProps,
|
|
14695
|
+
"data-size": size,
|
|
14696
|
+
className: cn(variantClass, className),
|
|
14697
|
+
color,
|
|
14698
|
+
disabled: isDisabled,
|
|
14699
|
+
radius,
|
|
14700
|
+
rightSection: triggerIcon,
|
|
14701
|
+
size,
|
|
14702
|
+
variant: buttonVariant
|
|
14703
|
+
}
|
|
14704
|
+
),
|
|
14705
|
+
children
|
|
14706
|
+
}
|
|
14707
|
+
),
|
|
14708
|
+
/* @__PURE__ */ jsx132(DropdownMenuPositioner, { ...positionerProps, children: /* @__PURE__ */ jsx132(
|
|
14709
|
+
DropdownMenuContent,
|
|
14710
|
+
{
|
|
14711
|
+
...contentProps,
|
|
14712
|
+
className: cn("!w-auto min-w-48", contentClassName),
|
|
14713
|
+
children: renderDropdownButtonItems(items)
|
|
14714
|
+
}
|
|
14715
|
+
) })
|
|
14716
|
+
] });
|
|
14717
|
+
}
|
|
14718
|
+
return /* @__PURE__ */ jsxs83(DropdownMenu, { children: [
|
|
14719
|
+
/* @__PURE__ */ jsxs83("div", { className: cn("cn-dropdown-button-shell", className), children: [
|
|
14720
|
+
/* @__PURE__ */ jsx132(
|
|
14721
|
+
Button,
|
|
14722
|
+
{
|
|
14723
|
+
...buttonProps,
|
|
14724
|
+
"data-size": size,
|
|
14725
|
+
className: cn(
|
|
14726
|
+
"cn-dropdown-button-main",
|
|
14727
|
+
variantClass,
|
|
14728
|
+
mainButtonClassName
|
|
14729
|
+
),
|
|
14730
|
+
color,
|
|
14731
|
+
radius,
|
|
14732
|
+
size,
|
|
14733
|
+
variant: buttonVariant,
|
|
14734
|
+
children
|
|
14735
|
+
}
|
|
14736
|
+
),
|
|
14737
|
+
/* @__PURE__ */ jsx132(
|
|
14738
|
+
DropdownMenuTrigger,
|
|
14739
|
+
{
|
|
14740
|
+
render: /* @__PURE__ */ jsx132(
|
|
14741
|
+
Button,
|
|
14742
|
+
{
|
|
14743
|
+
"aria-label": triggerLabel,
|
|
14744
|
+
"data-size": size,
|
|
14745
|
+
className: cn(
|
|
14746
|
+
"cn-dropdown-button-trigger",
|
|
14747
|
+
DROPDOWN_BUTTON_TRIGGER_SIZE_CN[size],
|
|
14748
|
+
variantClass,
|
|
14749
|
+
triggerClassName
|
|
14750
|
+
),
|
|
14751
|
+
color,
|
|
14752
|
+
disabled: isDisabled,
|
|
14753
|
+
radius,
|
|
14754
|
+
size,
|
|
14755
|
+
variant: buttonVariant
|
|
14756
|
+
}
|
|
14757
|
+
),
|
|
14758
|
+
children: triggerIcon
|
|
14759
|
+
}
|
|
14760
|
+
)
|
|
14761
|
+
] }),
|
|
14762
|
+
/* @__PURE__ */ jsx132(DropdownMenuPositioner, { ...positionerProps, children: /* @__PURE__ */ jsx132(
|
|
14763
|
+
DropdownMenuContent,
|
|
14764
|
+
{
|
|
14765
|
+
...contentProps,
|
|
14766
|
+
className: cn("!w-auto min-w-48", contentClassName),
|
|
14767
|
+
children: renderDropdownButtonItems(items)
|
|
14768
|
+
}
|
|
14769
|
+
) })
|
|
14770
|
+
] });
|
|
14771
|
+
}
|
|
14772
|
+
|
|
13405
14773
|
// src/components/ui/file-button.tsx
|
|
13406
|
-
import { useRef as
|
|
13407
|
-
import { Fragment as
|
|
14774
|
+
import { useRef as useRef16 } from "react";
|
|
14775
|
+
import { Fragment as Fragment24, jsx as jsx133, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
13408
14776
|
function FileButton({
|
|
13409
14777
|
onChange,
|
|
13410
14778
|
accept,
|
|
@@ -13415,15 +14783,15 @@ function FileButton({
|
|
|
13415
14783
|
className,
|
|
13416
14784
|
...props
|
|
13417
14785
|
}) {
|
|
13418
|
-
const inputRef =
|
|
14786
|
+
const inputRef = useRef16(null);
|
|
13419
14787
|
const handleClick = () => {
|
|
13420
14788
|
inputRef.current?.click();
|
|
13421
14789
|
};
|
|
13422
14790
|
const handleChange = (e) => {
|
|
13423
14791
|
onChange(e.target.files);
|
|
13424
14792
|
};
|
|
13425
|
-
return /* @__PURE__ */
|
|
13426
|
-
/* @__PURE__ */
|
|
14793
|
+
return /* @__PURE__ */ jsxs84(Fragment24, { children: [
|
|
14794
|
+
/* @__PURE__ */ jsx133(
|
|
13427
14795
|
"input",
|
|
13428
14796
|
{
|
|
13429
14797
|
ref: inputRef,
|
|
@@ -13436,7 +14804,7 @@ function FileButton({
|
|
|
13436
14804
|
disabled
|
|
13437
14805
|
}
|
|
13438
14806
|
),
|
|
13439
|
-
/* @__PURE__ */
|
|
14807
|
+
/* @__PURE__ */ jsx133(
|
|
13440
14808
|
Button,
|
|
13441
14809
|
{
|
|
13442
14810
|
"data-slot": "file-button",
|
|
@@ -13452,7 +14820,7 @@ function FileButton({
|
|
|
13452
14820
|
|
|
13453
14821
|
// src/components/ui/file-drop-input.tsx
|
|
13454
14822
|
import { IconPencil as IconPencil2, IconPhoto as IconPhoto4, IconTrash as IconTrash6 } from "@tabler/icons-react";
|
|
13455
|
-
import { useId as useId5, useRef as
|
|
14823
|
+
import { useId as useId5, useRef as useRef17, useState as useState35 } from "react";
|
|
13456
14824
|
|
|
13457
14825
|
// src/components/files/file-preview.tsx
|
|
13458
14826
|
import {
|
|
@@ -13462,8 +14830,8 @@ import {
|
|
|
13462
14830
|
IconPhoto as IconPhoto3,
|
|
13463
14831
|
IconVideo as IconVideo2
|
|
13464
14832
|
} from "@tabler/icons-react";
|
|
13465
|
-
import { useEffect as
|
|
13466
|
-
import { jsx as
|
|
14833
|
+
import { useEffect as useEffect16, useMemo as useMemo15, useState as useState34 } from "react";
|
|
14834
|
+
import { jsx as jsx134 } from "react/jsx-runtime";
|
|
13467
14835
|
function formatBytes2(size) {
|
|
13468
14836
|
if (!size) {
|
|
13469
14837
|
return null;
|
|
@@ -13498,12 +14866,12 @@ function buildPreviewKey(item) {
|
|
|
13498
14866
|
return item.id ?? `${item.source}-${item.name}-${item.fileIndex ?? item.url}`;
|
|
13499
14867
|
}
|
|
13500
14868
|
function useResolvedPreviewItems(files, previewItems = []) {
|
|
13501
|
-
const [localItems, setLocalItems] =
|
|
14869
|
+
const [localItems, setLocalItems] = useState34([]);
|
|
13502
14870
|
const remoteItems = useMemo15(
|
|
13503
14871
|
() => previewItems.map((item) => ({ ...item, source: "remote" })),
|
|
13504
14872
|
[previewItems]
|
|
13505
14873
|
);
|
|
13506
|
-
|
|
14874
|
+
useEffect16(() => {
|
|
13507
14875
|
let active = true;
|
|
13508
14876
|
const objectUrls = [];
|
|
13509
14877
|
async function resolveFiles() {
|
|
@@ -13550,7 +14918,7 @@ function FilePreviewSurface({
|
|
|
13550
14918
|
className
|
|
13551
14919
|
}) {
|
|
13552
14920
|
if (item.url && item.type.startsWith("image/")) {
|
|
13553
|
-
return /* @__PURE__ */
|
|
14921
|
+
return /* @__PURE__ */ jsx134("div", { className, children: /* @__PURE__ */ jsx134(
|
|
13554
14922
|
Image,
|
|
13555
14923
|
{
|
|
13556
14924
|
src: item.url,
|
|
@@ -13560,7 +14928,7 @@ function FilePreviewSurface({
|
|
|
13560
14928
|
) });
|
|
13561
14929
|
}
|
|
13562
14930
|
if (item.url && item.type.includes("pdf")) {
|
|
13563
|
-
return /* @__PURE__ */
|
|
14931
|
+
return /* @__PURE__ */ jsx134("div", { className, children: /* @__PURE__ */ jsx134(
|
|
13564
14932
|
"iframe",
|
|
13565
14933
|
{
|
|
13566
14934
|
src: item.url,
|
|
@@ -13571,7 +14939,7 @@ function FilePreviewSurface({
|
|
|
13571
14939
|
) });
|
|
13572
14940
|
}
|
|
13573
14941
|
if (item.url && item.type.startsWith("video/")) {
|
|
13574
|
-
return /* @__PURE__ */
|
|
14942
|
+
return /* @__PURE__ */ jsx134("div", { className, children: /* @__PURE__ */ jsx134(
|
|
13575
14943
|
"video",
|
|
13576
14944
|
{
|
|
13577
14945
|
src: item.url,
|
|
@@ -13583,14 +14951,14 @@ function FilePreviewSurface({
|
|
|
13583
14951
|
) });
|
|
13584
14952
|
}
|
|
13585
14953
|
if (item.textPreview) {
|
|
13586
|
-
return /* @__PURE__ */
|
|
14954
|
+
return /* @__PURE__ */ jsx134("div", { className, children: /* @__PURE__ */ jsx134("pre", { className: "text-muted-foreground line-clamp-8 size-full overflow-hidden px-3 py-2 text-xs whitespace-pre-wrap", children: item.textPreview }) });
|
|
13587
14955
|
}
|
|
13588
14956
|
const FileIcon = getFileIcon2(item.type);
|
|
13589
|
-
return /* @__PURE__ */
|
|
14957
|
+
return /* @__PURE__ */ jsx134("div", { className, children: /* @__PURE__ */ jsx134(FileIcon, { className: "text-muted-foreground size-8" }) });
|
|
13590
14958
|
}
|
|
13591
14959
|
|
|
13592
14960
|
// src/components/ui/file-drop-input.tsx
|
|
13593
|
-
import { Fragment as
|
|
14961
|
+
import { Fragment as Fragment25, jsx as jsx135, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
13594
14962
|
function FileDropInput({
|
|
13595
14963
|
className,
|
|
13596
14964
|
onFilesChange,
|
|
@@ -13617,11 +14985,11 @@ function FileDropInput({
|
|
|
13617
14985
|
...props
|
|
13618
14986
|
}) {
|
|
13619
14987
|
const inputId = useId5();
|
|
13620
|
-
const inputRef =
|
|
13621
|
-
const [internalFiles, setInternalFiles] =
|
|
13622
|
-
const [dragging, setDragging] =
|
|
13623
|
-
const [pendingCropFile, setPendingCropFile] =
|
|
13624
|
-
const [cropOpen, setCropOpen] =
|
|
14988
|
+
const inputRef = useRef17(null);
|
|
14989
|
+
const [internalFiles, setInternalFiles] = useState35(defaultFiles);
|
|
14990
|
+
const [dragging, setDragging] = useState35(false);
|
|
14991
|
+
const [pendingCropFile, setPendingCropFile] = useState35(null);
|
|
14992
|
+
const [cropOpen, setCropOpen] = useState35(false);
|
|
13625
14993
|
const files = filesProp ?? internalFiles;
|
|
13626
14994
|
const items = useResolvedPreviewItems(files, previewItems);
|
|
13627
14995
|
const singleItem = !multiple && items.length === 1 ? items[0] : null;
|
|
@@ -13667,14 +15035,14 @@ function FileDropInput({
|
|
|
13667
15035
|
}
|
|
13668
15036
|
setFiles(nextFiles);
|
|
13669
15037
|
};
|
|
13670
|
-
const fileDropInputElement = /* @__PURE__ */
|
|
13671
|
-
/* @__PURE__ */
|
|
15038
|
+
const fileDropInputElement = /* @__PURE__ */ jsxs85(Fragment25, { children: [
|
|
15039
|
+
/* @__PURE__ */ jsxs85(
|
|
13672
15040
|
"div",
|
|
13673
15041
|
{
|
|
13674
15042
|
"data-slot": "file-drop-input-wrapper",
|
|
13675
15043
|
className: cn("cn-file-drop-input-wrapper", className),
|
|
13676
15044
|
children: [
|
|
13677
|
-
/* @__PURE__ */
|
|
15045
|
+
/* @__PURE__ */ jsxs85(
|
|
13678
15046
|
"label",
|
|
13679
15047
|
{
|
|
13680
15048
|
htmlFor: inputId,
|
|
@@ -13690,7 +15058,7 @@ function FileDropInput({
|
|
|
13690
15058
|
onDragLeave: () => setDragging(false),
|
|
13691
15059
|
onDrop: handleDrop,
|
|
13692
15060
|
children: [
|
|
13693
|
-
/* @__PURE__ */
|
|
15061
|
+
/* @__PURE__ */ jsx135(
|
|
13694
15062
|
"input",
|
|
13695
15063
|
{
|
|
13696
15064
|
ref: inputRef,
|
|
@@ -13704,18 +15072,18 @@ function FileDropInput({
|
|
|
13704
15072
|
...props
|
|
13705
15073
|
}
|
|
13706
15074
|
),
|
|
13707
|
-
singleItem ? /* @__PURE__ */
|
|
15075
|
+
singleItem ? /* @__PURE__ */ jsxs85(
|
|
13708
15076
|
"div",
|
|
13709
15077
|
{
|
|
13710
15078
|
"data-slot": "file-drop-input-single-preview",
|
|
13711
15079
|
className: "cn-file-drop-input-single-preview",
|
|
13712
15080
|
children: [
|
|
13713
|
-
/* @__PURE__ */
|
|
15081
|
+
/* @__PURE__ */ jsx135(
|
|
13714
15082
|
"div",
|
|
13715
15083
|
{
|
|
13716
15084
|
"data-slot": "file-drop-input-preview",
|
|
13717
15085
|
className: "cn-file-drop-input-preview",
|
|
13718
|
-
children: /* @__PURE__ */
|
|
15086
|
+
children: /* @__PURE__ */ jsx135(
|
|
13719
15087
|
FilePreviewSurface,
|
|
13720
15088
|
{
|
|
13721
15089
|
item: singleItem,
|
|
@@ -13724,13 +15092,13 @@ function FileDropInput({
|
|
|
13724
15092
|
)
|
|
13725
15093
|
}
|
|
13726
15094
|
),
|
|
13727
|
-
/* @__PURE__ */
|
|
15095
|
+
/* @__PURE__ */ jsxs85(
|
|
13728
15096
|
"div",
|
|
13729
15097
|
{
|
|
13730
15098
|
"data-slot": "file-drop-input-preview-actions",
|
|
13731
15099
|
className: "cn-file-drop-input-preview-actions",
|
|
13732
15100
|
children: [
|
|
13733
|
-
singleItem.source === "local" && singleItem.type.startsWith("image/") ? /* @__PURE__ */
|
|
15101
|
+
singleItem.source === "local" && singleItem.type.startsWith("image/") ? /* @__PURE__ */ jsx135(
|
|
13734
15102
|
Button,
|
|
13735
15103
|
{
|
|
13736
15104
|
type: "button",
|
|
@@ -13744,11 +15112,11 @@ function FileDropInput({
|
|
|
13744
15112
|
);
|
|
13745
15113
|
setCropOpen(true);
|
|
13746
15114
|
},
|
|
13747
|
-
leftSection: /* @__PURE__ */
|
|
15115
|
+
leftSection: /* @__PURE__ */ jsx135(IconPencil2, { className: "size-4" }),
|
|
13748
15116
|
children: "Edit"
|
|
13749
15117
|
}
|
|
13750
15118
|
) : null,
|
|
13751
|
-
singleItem.source === "local" ? /* @__PURE__ */
|
|
15119
|
+
singleItem.source === "local" ? /* @__PURE__ */ jsx135(
|
|
13752
15120
|
Button,
|
|
13753
15121
|
{
|
|
13754
15122
|
type: "button",
|
|
@@ -13762,7 +15130,7 @@ function FileDropInput({
|
|
|
13762
15130
|
inputRef.current.value = "";
|
|
13763
15131
|
}
|
|
13764
15132
|
},
|
|
13765
|
-
leftSection: /* @__PURE__ */
|
|
15133
|
+
leftSection: /* @__PURE__ */ jsx135(IconTrash6, { className: "size-4" }),
|
|
13766
15134
|
children: "Remove"
|
|
13767
15135
|
}
|
|
13768
15136
|
) : null
|
|
@@ -13771,16 +15139,16 @@ function FileDropInput({
|
|
|
13771
15139
|
)
|
|
13772
15140
|
]
|
|
13773
15141
|
}
|
|
13774
|
-
) : /* @__PURE__ */
|
|
15142
|
+
) : /* @__PURE__ */ jsxs85(
|
|
13775
15143
|
"div",
|
|
13776
15144
|
{
|
|
13777
15145
|
"data-slot": "file-drop-input-prompt",
|
|
13778
15146
|
className: "cn-file-drop-input-prompt",
|
|
13779
15147
|
children: [
|
|
13780
|
-
/* @__PURE__ */
|
|
13781
|
-
/* @__PURE__ */
|
|
13782
|
-
/* @__PURE__ */
|
|
13783
|
-
/* @__PURE__ */
|
|
15148
|
+
/* @__PURE__ */ jsx135(IconPhoto4, { className: "cn-file-drop-input-icon" }),
|
|
15149
|
+
/* @__PURE__ */ jsxs85("div", { children: [
|
|
15150
|
+
/* @__PURE__ */ jsx135("div", { className: "cn-file-drop-input-title", children: dropLabel }),
|
|
15151
|
+
/* @__PURE__ */ jsx135("div", { className: "cn-file-drop-input-description", children: dropDescription })
|
|
13784
15152
|
] })
|
|
13785
15153
|
]
|
|
13786
15154
|
}
|
|
@@ -13788,25 +15156,25 @@ function FileDropInput({
|
|
|
13788
15156
|
]
|
|
13789
15157
|
}
|
|
13790
15158
|
),
|
|
13791
|
-
!singleItem && items.length > 0 ? /* @__PURE__ */
|
|
15159
|
+
!singleItem && items.length > 0 ? /* @__PURE__ */ jsx135(
|
|
13792
15160
|
"div",
|
|
13793
15161
|
{
|
|
13794
15162
|
"data-slot": "file-drop-input-list",
|
|
13795
15163
|
className: "cn-file-drop-input-list",
|
|
13796
15164
|
children: items.map((item) => {
|
|
13797
15165
|
const ItemIcon = getFileIcon2(item.type);
|
|
13798
|
-
return /* @__PURE__ */
|
|
15166
|
+
return /* @__PURE__ */ jsxs85(
|
|
13799
15167
|
"div",
|
|
13800
15168
|
{
|
|
13801
15169
|
"data-slot": "file-drop-input-item",
|
|
13802
15170
|
className: "cn-file-drop-input-item",
|
|
13803
15171
|
children: [
|
|
13804
|
-
/* @__PURE__ */
|
|
13805
|
-
/* @__PURE__ */
|
|
13806
|
-
/* @__PURE__ */
|
|
13807
|
-
formatBytes2(item.size) ? /* @__PURE__ */
|
|
15172
|
+
/* @__PURE__ */ jsxs85("div", { className: "cn-file-drop-input-item-left", children: [
|
|
15173
|
+
/* @__PURE__ */ jsx135(ItemIcon, { className: "cn-file-drop-input-item-icon" }),
|
|
15174
|
+
/* @__PURE__ */ jsx135("span", { className: "cn-file-drop-input-item-name", children: item.name }),
|
|
15175
|
+
formatBytes2(item.size) ? /* @__PURE__ */ jsx135("span", { className: "cn-file-drop-input-item-size", children: formatBytes2(item.size) }) : null
|
|
13808
15176
|
] }),
|
|
13809
|
-
item.source === "local" ? /* @__PURE__ */
|
|
15177
|
+
item.source === "local" ? /* @__PURE__ */ jsx135(
|
|
13810
15178
|
Button,
|
|
13811
15179
|
{
|
|
13812
15180
|
type: "button",
|
|
@@ -13818,7 +15186,7 @@ function FileDropInput({
|
|
|
13818
15186
|
);
|
|
13819
15187
|
setFiles(nextFiles);
|
|
13820
15188
|
},
|
|
13821
|
-
children: /* @__PURE__ */
|
|
15189
|
+
children: /* @__PURE__ */ jsx135(IconTrash6, { className: "size-4" })
|
|
13822
15190
|
}
|
|
13823
15191
|
) : null
|
|
13824
15192
|
]
|
|
@@ -13831,7 +15199,7 @@ function FileDropInput({
|
|
|
13831
15199
|
]
|
|
13832
15200
|
}
|
|
13833
15201
|
),
|
|
13834
|
-
/* @__PURE__ */
|
|
15202
|
+
/* @__PURE__ */ jsx135(
|
|
13835
15203
|
ImageCropDialog,
|
|
13836
15204
|
{
|
|
13837
15205
|
open: cropOpen,
|
|
@@ -13855,7 +15223,7 @@ function FileDropInput({
|
|
|
13855
15223
|
if (!hasWrapper) {
|
|
13856
15224
|
return fileDropInputElement;
|
|
13857
15225
|
}
|
|
13858
|
-
return /* @__PURE__ */
|
|
15226
|
+
return /* @__PURE__ */ jsx135(
|
|
13859
15227
|
InputWrapper,
|
|
13860
15228
|
{
|
|
13861
15229
|
label,
|
|
@@ -13881,8 +15249,8 @@ import {
|
|
|
13881
15249
|
IconUpload as IconUpload2,
|
|
13882
15250
|
IconX as IconX11
|
|
13883
15251
|
} from "@tabler/icons-react";
|
|
13884
|
-
import { useId as useId6, useRef as
|
|
13885
|
-
import { Fragment as
|
|
15252
|
+
import { useId as useId6, useRef as useRef18, useState as useState36 } from "react";
|
|
15253
|
+
import { Fragment as Fragment26, jsx as jsx136, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
13886
15254
|
function FileInput({
|
|
13887
15255
|
className,
|
|
13888
15256
|
onFilesChange,
|
|
@@ -13909,11 +15277,11 @@ function FileInput({
|
|
|
13909
15277
|
disabled,
|
|
13910
15278
|
...props
|
|
13911
15279
|
}) {
|
|
13912
|
-
const inputRef =
|
|
15280
|
+
const inputRef = useRef18(null);
|
|
13913
15281
|
const inputId = useId6();
|
|
13914
|
-
const [internalFiles, setInternalFiles] =
|
|
13915
|
-
const [pendingCropFile, setPendingCropFile] =
|
|
13916
|
-
const [cropOpen, setCropOpen] =
|
|
15282
|
+
const [internalFiles, setInternalFiles] = useState36(defaultFiles);
|
|
15283
|
+
const [pendingCropFile, setPendingCropFile] = useState36(null);
|
|
15284
|
+
const [cropOpen, setCropOpen] = useState36(false);
|
|
13917
15285
|
const files = filesProp ?? internalFiles;
|
|
13918
15286
|
const items = useResolvedPreviewItems(files, previewItems);
|
|
13919
15287
|
const singleItem = !multiple && items.length === 1 ? items[0] : null;
|
|
@@ -13963,25 +15331,25 @@ function FileInput({
|
|
|
13963
15331
|
const RootIcon = singleItem ? getFileIcon2(singleItem.type) : IconPaperclip;
|
|
13964
15332
|
let metaContent = null;
|
|
13965
15333
|
if (items.length > 1) {
|
|
13966
|
-
metaContent = /* @__PURE__ */
|
|
15334
|
+
metaContent = /* @__PURE__ */ jsxs86("div", { "data-slot": "file-input-meta", className: "cn-file-input-meta", children: [
|
|
13967
15335
|
items.length,
|
|
13968
15336
|
" files selected"
|
|
13969
15337
|
] });
|
|
13970
15338
|
} else if (props.accept) {
|
|
13971
|
-
metaContent = /* @__PURE__ */
|
|
15339
|
+
metaContent = /* @__PURE__ */ jsxs86("div", { "data-slot": "file-input-meta", className: "cn-file-input-meta", children: [
|
|
13972
15340
|
"Accepts ",
|
|
13973
15341
|
props.accept
|
|
13974
15342
|
] });
|
|
13975
15343
|
}
|
|
13976
|
-
const fileInputElement = /* @__PURE__ */
|
|
13977
|
-
/* @__PURE__ */
|
|
15344
|
+
const fileInputElement = /* @__PURE__ */ jsxs86(Fragment26, { children: [
|
|
15345
|
+
/* @__PURE__ */ jsxs86(
|
|
13978
15346
|
"div",
|
|
13979
15347
|
{
|
|
13980
15348
|
"data-slot": "file-input-wrapper",
|
|
13981
15349
|
"data-disabled": disabled || void 0,
|
|
13982
15350
|
className: cn("cn-file-input-wrapper", className),
|
|
13983
15351
|
children: [
|
|
13984
|
-
/* @__PURE__ */
|
|
15352
|
+
/* @__PURE__ */ jsx136(
|
|
13985
15353
|
"input",
|
|
13986
15354
|
{
|
|
13987
15355
|
ref: inputRef,
|
|
@@ -13995,7 +15363,7 @@ function FileInput({
|
|
|
13995
15363
|
...props
|
|
13996
15364
|
}
|
|
13997
15365
|
),
|
|
13998
|
-
/* @__PURE__ */
|
|
15366
|
+
/* @__PURE__ */ jsx136(
|
|
13999
15367
|
"button",
|
|
14000
15368
|
{
|
|
14001
15369
|
type: "button",
|
|
@@ -14003,13 +15371,13 @@ function FileInput({
|
|
|
14003
15371
|
className: "cn-file-input-root",
|
|
14004
15372
|
onClick: () => inputRef.current?.click(),
|
|
14005
15373
|
disabled,
|
|
14006
|
-
children: singleItem ? /* @__PURE__ */
|
|
14007
|
-
/* @__PURE__ */
|
|
15374
|
+
children: singleItem ? /* @__PURE__ */ jsxs86(Fragment26, { children: [
|
|
15375
|
+
/* @__PURE__ */ jsx136(
|
|
14008
15376
|
"div",
|
|
14009
15377
|
{
|
|
14010
15378
|
"data-slot": "file-input-preview",
|
|
14011
15379
|
className: "cn-file-input-preview",
|
|
14012
|
-
children: /* @__PURE__ */
|
|
15380
|
+
children: /* @__PURE__ */ jsx136(
|
|
14013
15381
|
FilePreviewSurface,
|
|
14014
15382
|
{
|
|
14015
15383
|
item: singleItem,
|
|
@@ -14018,8 +15386,8 @@ function FileInput({
|
|
|
14018
15386
|
)
|
|
14019
15387
|
}
|
|
14020
15388
|
),
|
|
14021
|
-
/* @__PURE__ */
|
|
14022
|
-
/* @__PURE__ */
|
|
15389
|
+
/* @__PURE__ */ jsxs86("div", { "data-slot": "file-input-body", className: "cn-file-input-body", children: [
|
|
15390
|
+
/* @__PURE__ */ jsx136(
|
|
14023
15391
|
"div",
|
|
14024
15392
|
{
|
|
14025
15393
|
"data-slot": "file-input-value",
|
|
@@ -14027,15 +15395,15 @@ function FileInput({
|
|
|
14027
15395
|
children: singleItem.name
|
|
14028
15396
|
}
|
|
14029
15397
|
),
|
|
14030
|
-
/* @__PURE__ */
|
|
15398
|
+
/* @__PURE__ */ jsx136("div", { "data-slot": "file-input-meta", className: "cn-file-input-meta", children: formatBytes2(singleItem.size) ?? "uploaded file" })
|
|
14031
15399
|
] }),
|
|
14032
|
-
/* @__PURE__ */
|
|
15400
|
+
/* @__PURE__ */ jsxs86(
|
|
14033
15401
|
"div",
|
|
14034
15402
|
{
|
|
14035
15403
|
"data-slot": "file-input-actions",
|
|
14036
15404
|
className: "cn-file-input-actions",
|
|
14037
15405
|
children: [
|
|
14038
|
-
singleItem.source === "local" && singleItem.type.startsWith("image/") ? /* @__PURE__ */
|
|
15406
|
+
singleItem.source === "local" && singleItem.type.startsWith("image/") ? /* @__PURE__ */ jsx136(
|
|
14039
15407
|
Button,
|
|
14040
15408
|
{
|
|
14041
15409
|
type: "button",
|
|
@@ -14047,10 +15415,10 @@ function FileInput({
|
|
|
14047
15415
|
},
|
|
14048
15416
|
"aria-label": "Edit image",
|
|
14049
15417
|
disabled,
|
|
14050
|
-
children: /* @__PURE__ */
|
|
15418
|
+
children: /* @__PURE__ */ jsx136(IconPencil3, { className: "size-4" })
|
|
14051
15419
|
}
|
|
14052
15420
|
) : null,
|
|
14053
|
-
clearable && singleItem.source === "local" ? /* @__PURE__ */
|
|
15421
|
+
clearable && singleItem.source === "local" ? /* @__PURE__ */ jsx136(
|
|
14054
15422
|
Button,
|
|
14055
15423
|
{
|
|
14056
15424
|
type: "button",
|
|
@@ -14062,23 +15430,23 @@ function FileInput({
|
|
|
14062
15430
|
},
|
|
14063
15431
|
"aria-label": "Remove file",
|
|
14064
15432
|
disabled,
|
|
14065
|
-
children: /* @__PURE__ */
|
|
15433
|
+
children: /* @__PURE__ */ jsx136(IconX11, { className: "size-4" })
|
|
14066
15434
|
}
|
|
14067
15435
|
) : null
|
|
14068
15436
|
]
|
|
14069
15437
|
}
|
|
14070
15438
|
)
|
|
14071
|
-
] }) : /* @__PURE__ */
|
|
14072
|
-
/* @__PURE__ */
|
|
15439
|
+
] }) : /* @__PURE__ */ jsxs86(Fragment26, { children: [
|
|
15440
|
+
/* @__PURE__ */ jsx136(
|
|
14073
15441
|
"div",
|
|
14074
15442
|
{
|
|
14075
15443
|
"data-slot": "file-input-section",
|
|
14076
15444
|
className: "cn-file-input-section",
|
|
14077
|
-
children: leftSection ?? /* @__PURE__ */
|
|
15445
|
+
children: leftSection ?? /* @__PURE__ */ jsx136(RootIcon, { className: "size-4" })
|
|
14078
15446
|
}
|
|
14079
15447
|
),
|
|
14080
|
-
/* @__PURE__ */
|
|
14081
|
-
/* @__PURE__ */
|
|
15448
|
+
/* @__PURE__ */ jsxs86("div", { "data-slot": "file-input-body", className: "cn-file-input-body", children: [
|
|
15449
|
+
/* @__PURE__ */ jsx136(
|
|
14082
15450
|
"div",
|
|
14083
15451
|
{
|
|
14084
15452
|
"data-slot": "file-input-placeholder",
|
|
@@ -14088,31 +15456,31 @@ function FileInput({
|
|
|
14088
15456
|
),
|
|
14089
15457
|
metaContent
|
|
14090
15458
|
] }),
|
|
14091
|
-
/* @__PURE__ */
|
|
15459
|
+
/* @__PURE__ */ jsx136(
|
|
14092
15460
|
"div",
|
|
14093
15461
|
{
|
|
14094
15462
|
"data-slot": "file-input-actions",
|
|
14095
15463
|
className: "cn-file-input-actions",
|
|
14096
|
-
children: /* @__PURE__ */
|
|
15464
|
+
children: /* @__PURE__ */ jsx136("div", { className: "cn-file-input-trigger", children: /* @__PURE__ */ jsx136(IconUpload2, { className: "size-4" }) })
|
|
14097
15465
|
}
|
|
14098
15466
|
)
|
|
14099
15467
|
] })
|
|
14100
15468
|
}
|
|
14101
15469
|
),
|
|
14102
|
-
!singleItem && items.length > 1 ? /* @__PURE__ */
|
|
15470
|
+
!singleItem && items.length > 1 ? /* @__PURE__ */ jsx136("div", { "data-slot": "file-input-list", className: "cn-file-input-list", children: items.map((item) => {
|
|
14103
15471
|
const ItemIcon = getFileIcon2(item.type);
|
|
14104
|
-
return /* @__PURE__ */
|
|
15472
|
+
return /* @__PURE__ */ jsxs86(
|
|
14105
15473
|
"div",
|
|
14106
15474
|
{
|
|
14107
15475
|
"data-slot": "file-input-item",
|
|
14108
15476
|
className: "cn-file-input-item",
|
|
14109
15477
|
children: [
|
|
14110
|
-
/* @__PURE__ */
|
|
14111
|
-
/* @__PURE__ */
|
|
14112
|
-
/* @__PURE__ */
|
|
14113
|
-
formatBytes2(item.size) ? /* @__PURE__ */
|
|
15478
|
+
/* @__PURE__ */ jsxs86("div", { className: "cn-file-input-item-left", children: [
|
|
15479
|
+
/* @__PURE__ */ jsx136(ItemIcon, { className: "cn-file-input-item-icon" }),
|
|
15480
|
+
/* @__PURE__ */ jsx136("span", { className: "cn-file-input-item-name", children: item.name }),
|
|
15481
|
+
formatBytes2(item.size) ? /* @__PURE__ */ jsx136("span", { className: "cn-file-input-item-size", children: formatBytes2(item.size) }) : null
|
|
14114
15482
|
] }),
|
|
14115
|
-
clearable && item.source === "local" ? /* @__PURE__ */
|
|
15483
|
+
clearable && item.source === "local" ? /* @__PURE__ */ jsx136(
|
|
14116
15484
|
Button,
|
|
14117
15485
|
{
|
|
14118
15486
|
type: "button",
|
|
@@ -14125,7 +15493,7 @@ function FileInput({
|
|
|
14125
15493
|
setFiles(nextFiles);
|
|
14126
15494
|
},
|
|
14127
15495
|
"aria-label": `Remove ${item.name}`,
|
|
14128
|
-
children: /* @__PURE__ */
|
|
15496
|
+
children: /* @__PURE__ */ jsx136(IconX11, { className: "size-4" })
|
|
14129
15497
|
}
|
|
14130
15498
|
) : null
|
|
14131
15499
|
]
|
|
@@ -14136,7 +15504,7 @@ function FileInput({
|
|
|
14136
15504
|
]
|
|
14137
15505
|
}
|
|
14138
15506
|
),
|
|
14139
|
-
/* @__PURE__ */
|
|
15507
|
+
/* @__PURE__ */ jsx136(
|
|
14140
15508
|
ImageCropDialog,
|
|
14141
15509
|
{
|
|
14142
15510
|
open: cropOpen,
|
|
@@ -14159,7 +15527,7 @@ function FileInput({
|
|
|
14159
15527
|
if (!hasWrapper) {
|
|
14160
15528
|
return fileInputElement;
|
|
14161
15529
|
}
|
|
14162
|
-
return /* @__PURE__ */
|
|
15530
|
+
return /* @__PURE__ */ jsx136(
|
|
14163
15531
|
InputWrapper,
|
|
14164
15532
|
{
|
|
14165
15533
|
label,
|
|
@@ -14179,7 +15547,7 @@ function FileInput({
|
|
|
14179
15547
|
}
|
|
14180
15548
|
|
|
14181
15549
|
// src/components/ui/flex.tsx
|
|
14182
|
-
import { jsx as
|
|
15550
|
+
import { jsx as jsx137 } from "react/jsx-runtime";
|
|
14183
15551
|
var gapClasses = {
|
|
14184
15552
|
xs: "gap-1.5",
|
|
14185
15553
|
sm: "gap-2",
|
|
@@ -14261,7 +15629,7 @@ function Flex({
|
|
|
14261
15629
|
if (columnGap != null && typeof columnGap !== "number") {
|
|
14262
15630
|
colGapClass = colGapClasses[columnGap];
|
|
14263
15631
|
}
|
|
14264
|
-
return /* @__PURE__ */
|
|
15632
|
+
return /* @__PURE__ */ jsx137(
|
|
14265
15633
|
"div",
|
|
14266
15634
|
{
|
|
14267
15635
|
"data-slot": "flex",
|
|
@@ -14283,8 +15651,8 @@ function Flex({
|
|
|
14283
15651
|
}
|
|
14284
15652
|
|
|
14285
15653
|
// src/components/ui/floating-indicator.tsx
|
|
14286
|
-
import { useEffect as
|
|
14287
|
-
import { jsx as
|
|
15654
|
+
import { useEffect as useEffect17, useState as useState37 } from "react";
|
|
15655
|
+
import { jsx as jsx138 } from "react/jsx-runtime";
|
|
14288
15656
|
function FloatingIndicator({
|
|
14289
15657
|
className,
|
|
14290
15658
|
target,
|
|
@@ -14294,9 +15662,9 @@ function FloatingIndicator({
|
|
|
14294
15662
|
style,
|
|
14295
15663
|
...props
|
|
14296
15664
|
}) {
|
|
14297
|
-
const [position, setPosition] =
|
|
14298
|
-
const [isVisible, setIsVisible] =
|
|
14299
|
-
|
|
15665
|
+
const [position, setPosition] = useState37({ x: 0, y: 0, width: 0, height: 0 });
|
|
15666
|
+
const [isVisible, setIsVisible] = useState37(!displayAfterTransitionEnd);
|
|
15667
|
+
useEffect17(() => {
|
|
14300
15668
|
const hasTargetAndParent2 = target && parent;
|
|
14301
15669
|
if (!hasTargetAndParent2) {
|
|
14302
15670
|
return;
|
|
@@ -14330,7 +15698,7 @@ function FloatingIndicator({
|
|
|
14330
15698
|
if (!hasTargetAndParent || shouldHideAfterTransition) {
|
|
14331
15699
|
return null;
|
|
14332
15700
|
}
|
|
14333
|
-
return /* @__PURE__ */
|
|
15701
|
+
return /* @__PURE__ */ jsx138(
|
|
14334
15702
|
"div",
|
|
14335
15703
|
{
|
|
14336
15704
|
"data-slot": "floating-indicator",
|
|
@@ -14351,8 +15719,8 @@ function FloatingIndicator({
|
|
|
14351
15719
|
}
|
|
14352
15720
|
|
|
14353
15721
|
// src/components/ui/focus-trap.tsx
|
|
14354
|
-
import { cloneElement as cloneElement2, useEffect as
|
|
14355
|
-
import { jsx as
|
|
15722
|
+
import { cloneElement as cloneElement2, useEffect as useEffect18, useRef as useRef19 } from "react";
|
|
15723
|
+
import { jsx as jsx139 } from "react/jsx-runtime";
|
|
14356
15724
|
var FOCUSABLE = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
14357
15725
|
function getFocusableElements(container) {
|
|
14358
15726
|
return Array.from(container.querySelectorAll(FOCUSABLE)).filter(
|
|
@@ -14360,8 +15728,8 @@ function getFocusableElements(container) {
|
|
|
14360
15728
|
);
|
|
14361
15729
|
}
|
|
14362
15730
|
function useFocusTrap(active) {
|
|
14363
|
-
const ref =
|
|
14364
|
-
|
|
15731
|
+
const ref = useRef19(null);
|
|
15732
|
+
useEffect18(() => {
|
|
14365
15733
|
if (!active) {
|
|
14366
15734
|
return;
|
|
14367
15735
|
}
|
|
@@ -14415,7 +15783,7 @@ function FocusTrap({
|
|
|
14415
15783
|
return child;
|
|
14416
15784
|
}
|
|
14417
15785
|
function FocusTrapInitialFocus(props) {
|
|
14418
|
-
return /* @__PURE__ */
|
|
15786
|
+
return /* @__PURE__ */ jsx139(
|
|
14419
15787
|
"span",
|
|
14420
15788
|
{
|
|
14421
15789
|
tabIndex: -1,
|
|
@@ -14429,7 +15797,7 @@ FocusTrap.InitialFocus = FocusTrapInitialFocus;
|
|
|
14429
15797
|
|
|
14430
15798
|
// src/components/ui/grid.tsx
|
|
14431
15799
|
import { cva as cva16 } from "class-variance-authority";
|
|
14432
|
-
import { jsx as
|
|
15800
|
+
import { jsx as jsx140 } from "react/jsx-runtime";
|
|
14433
15801
|
var gridVariants = cva16("grid w-full grid-cols-12", {
|
|
14434
15802
|
variants: {
|
|
14435
15803
|
gutter: {
|
|
@@ -14509,7 +15877,7 @@ var gridColVariants = cva16("", {
|
|
|
14509
15877
|
}
|
|
14510
15878
|
});
|
|
14511
15879
|
function Grid({ className, gutter, children, ...props }) {
|
|
14512
|
-
return /* @__PURE__ */
|
|
15880
|
+
return /* @__PURE__ */ jsx140(
|
|
14513
15881
|
"div",
|
|
14514
15882
|
{
|
|
14515
15883
|
"data-slot": "grid",
|
|
@@ -14530,7 +15898,7 @@ function GridCol({
|
|
|
14530
15898
|
children,
|
|
14531
15899
|
...props
|
|
14532
15900
|
}) {
|
|
14533
|
-
return /* @__PURE__ */
|
|
15901
|
+
return /* @__PURE__ */ jsx140(
|
|
14534
15902
|
"div",
|
|
14535
15903
|
{
|
|
14536
15904
|
"data-slot": "grid-col",
|
|
@@ -14547,7 +15915,7 @@ function GridCol({
|
|
|
14547
15915
|
Grid.Col = GridCol;
|
|
14548
15916
|
|
|
14549
15917
|
// src/components/ui/group.tsx
|
|
14550
|
-
import { jsx as
|
|
15918
|
+
import { jsx as jsx141 } from "react/jsx-runtime";
|
|
14551
15919
|
function Group({
|
|
14552
15920
|
className,
|
|
14553
15921
|
gap = "md",
|
|
@@ -14578,7 +15946,7 @@ function Group({
|
|
|
14578
15946
|
between: "justify-between",
|
|
14579
15947
|
around: "justify-around"
|
|
14580
15948
|
};
|
|
14581
|
-
return /* @__PURE__ */
|
|
15949
|
+
return /* @__PURE__ */ jsx141(
|
|
14582
15950
|
"div",
|
|
14583
15951
|
{
|
|
14584
15952
|
"data-slot": "group",
|
|
@@ -14598,7 +15966,7 @@ function Group({
|
|
|
14598
15966
|
}
|
|
14599
15967
|
|
|
14600
15968
|
// src/components/ui/highlight.tsx
|
|
14601
|
-
import { jsx as
|
|
15969
|
+
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
14602
15970
|
function Highlight2({
|
|
14603
15971
|
children,
|
|
14604
15972
|
highlight,
|
|
@@ -14607,44 +15975,44 @@ function Highlight2({
|
|
|
14607
15975
|
...props
|
|
14608
15976
|
}) {
|
|
14609
15977
|
if (!(children && highlight)) {
|
|
14610
|
-
return /* @__PURE__ */
|
|
15978
|
+
return /* @__PURE__ */ jsx142("span", { className, ...props, children });
|
|
14611
15979
|
}
|
|
14612
15980
|
const highlights = Array.isArray(highlight) ? highlight : [highlight];
|
|
14613
15981
|
const pattern = highlights.filter(Boolean).map((term) => term.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
14614
15982
|
if (!pattern) {
|
|
14615
|
-
return /* @__PURE__ */
|
|
15983
|
+
return /* @__PURE__ */ jsx142("span", { className, ...props, children });
|
|
14616
15984
|
}
|
|
14617
15985
|
const regex = new RegExp(`(${pattern})`, "gi");
|
|
14618
15986
|
const parts = children.split(regex);
|
|
14619
|
-
return /* @__PURE__ */
|
|
15987
|
+
return /* @__PURE__ */ jsx142("span", { "data-slot": "highlight", className, ...props, children: parts.map((part, i) => {
|
|
14620
15988
|
const isMatch = highlights.some(
|
|
14621
15989
|
(term) => term.toLowerCase() === part.toLowerCase()
|
|
14622
15990
|
);
|
|
14623
15991
|
const key = `${part}-${i}`;
|
|
14624
|
-
return isMatch ? /* @__PURE__ */
|
|
15992
|
+
return isMatch ? /* @__PURE__ */ jsx142(
|
|
14625
15993
|
"mark",
|
|
14626
15994
|
{
|
|
14627
15995
|
className: cn("cn-highlight-mark", highlightClassName),
|
|
14628
15996
|
children: part
|
|
14629
15997
|
},
|
|
14630
15998
|
key
|
|
14631
|
-
) : /* @__PURE__ */
|
|
15999
|
+
) : /* @__PURE__ */ jsx142("span", { children: part }, key);
|
|
14632
16000
|
}) });
|
|
14633
16001
|
}
|
|
14634
16002
|
|
|
14635
16003
|
// src/components/ui/hover-card.tsx
|
|
14636
16004
|
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
14637
|
-
import { jsx as
|
|
16005
|
+
import { jsx as jsx143 } from "react/jsx-runtime";
|
|
14638
16006
|
var HOVER_CARD_POSITIONER_CN = "isolate z-50";
|
|
14639
16007
|
function HoverCard({
|
|
14640
16008
|
...props
|
|
14641
16009
|
}) {
|
|
14642
|
-
return /* @__PURE__ */
|
|
16010
|
+
return /* @__PURE__ */ jsx143(PreviewCardPrimitive.Root, { "data-slot": "hover-card", ...props });
|
|
14643
16011
|
}
|
|
14644
16012
|
function HoverCardTrigger({
|
|
14645
16013
|
...props
|
|
14646
16014
|
}) {
|
|
14647
|
-
return /* @__PURE__ */
|
|
16015
|
+
return /* @__PURE__ */ jsx143(PreviewCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
|
|
14648
16016
|
}
|
|
14649
16017
|
function HoverCardContent({
|
|
14650
16018
|
className,
|
|
@@ -14654,7 +16022,7 @@ function HoverCardContent({
|
|
|
14654
16022
|
sideOffset = 4,
|
|
14655
16023
|
...props
|
|
14656
16024
|
}) {
|
|
14657
|
-
return /* @__PURE__ */
|
|
16025
|
+
return /* @__PURE__ */ jsx143(PreviewCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx143(
|
|
14658
16026
|
PreviewCardPrimitive.Positioner,
|
|
14659
16027
|
{
|
|
14660
16028
|
align,
|
|
@@ -14662,7 +16030,7 @@ function HoverCardContent({
|
|
|
14662
16030
|
side,
|
|
14663
16031
|
sideOffset,
|
|
14664
16032
|
className: HOVER_CARD_POSITIONER_CN,
|
|
14665
|
-
children: /* @__PURE__ */
|
|
16033
|
+
children: /* @__PURE__ */ jsx143(
|
|
14666
16034
|
PreviewCardPrimitive.Popup,
|
|
14667
16035
|
{
|
|
14668
16036
|
"data-slot": "hover-card-content",
|
|
@@ -14679,7 +16047,7 @@ function HoverCardContent({
|
|
|
14679
16047
|
|
|
14680
16048
|
// src/components/ui/indicator.tsx
|
|
14681
16049
|
import { cva as cva17 } from "class-variance-authority";
|
|
14682
|
-
import { jsx as
|
|
16050
|
+
import { jsx as jsx144, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
14683
16051
|
var indicatorVariants = cva17(
|
|
14684
16052
|
"cn-indicator absolute flex items-center justify-center rounded-full text-xs font-medium transition-colors",
|
|
14685
16053
|
{
|
|
@@ -14740,16 +16108,16 @@ function Indicator({
|
|
|
14740
16108
|
...props
|
|
14741
16109
|
}) {
|
|
14742
16110
|
if (disabled) {
|
|
14743
|
-
return /* @__PURE__ */
|
|
16111
|
+
return /* @__PURE__ */ jsx144("div", { className: cn(inline && "inline-block"), children });
|
|
14744
16112
|
}
|
|
14745
|
-
return /* @__PURE__ */
|
|
16113
|
+
return /* @__PURE__ */ jsxs87(
|
|
14746
16114
|
"div",
|
|
14747
16115
|
{
|
|
14748
16116
|
"data-slot": "indicator-wrapper",
|
|
14749
16117
|
className: cn("relative", inline && "inline-block"),
|
|
14750
16118
|
children: [
|
|
14751
16119
|
children,
|
|
14752
|
-
/* @__PURE__ */
|
|
16120
|
+
/* @__PURE__ */ jsx144(
|
|
14753
16121
|
"span",
|
|
14754
16122
|
{
|
|
14755
16123
|
"data-slot": "indicator",
|
|
@@ -14773,9 +16141,9 @@ function Indicator({
|
|
|
14773
16141
|
// src/components/ui/item.tsx
|
|
14774
16142
|
import { useRender as useRender8 } from "@base-ui/react/use-render";
|
|
14775
16143
|
import { cva as cva18 } from "class-variance-authority";
|
|
14776
|
-
import { jsx as
|
|
16144
|
+
import { jsx as jsx145 } from "react/jsx-runtime";
|
|
14777
16145
|
function ItemGroup({ className, ...props }) {
|
|
14778
|
-
return /* @__PURE__ */
|
|
16146
|
+
return /* @__PURE__ */ jsx145(
|
|
14779
16147
|
"ul",
|
|
14780
16148
|
{
|
|
14781
16149
|
"data-slot": "item-group",
|
|
@@ -14791,7 +16159,7 @@ function ItemSeparator({
|
|
|
14791
16159
|
className,
|
|
14792
16160
|
...props
|
|
14793
16161
|
}) {
|
|
14794
|
-
return /* @__PURE__ */
|
|
16162
|
+
return /* @__PURE__ */ jsx145(
|
|
14795
16163
|
Separator,
|
|
14796
16164
|
{
|
|
14797
16165
|
"data-slot": "item-separator",
|
|
@@ -14826,7 +16194,7 @@ function Item({
|
|
|
14826
16194
|
className,
|
|
14827
16195
|
variant = "default",
|
|
14828
16196
|
size = "default",
|
|
14829
|
-
render = /* @__PURE__ */
|
|
16197
|
+
render = /* @__PURE__ */ jsx145("div", {}),
|
|
14830
16198
|
...props
|
|
14831
16199
|
}) {
|
|
14832
16200
|
return useRender8({
|
|
@@ -14861,7 +16229,7 @@ function ItemMedia({
|
|
|
14861
16229
|
variant = "default",
|
|
14862
16230
|
...props
|
|
14863
16231
|
}) {
|
|
14864
|
-
return /* @__PURE__ */
|
|
16232
|
+
return /* @__PURE__ */ jsx145(
|
|
14865
16233
|
"div",
|
|
14866
16234
|
{
|
|
14867
16235
|
"data-slot": "item-media",
|
|
@@ -14872,7 +16240,7 @@ function ItemMedia({
|
|
|
14872
16240
|
);
|
|
14873
16241
|
}
|
|
14874
16242
|
function ItemContent({ className, ...props }) {
|
|
14875
|
-
return /* @__PURE__ */
|
|
16243
|
+
return /* @__PURE__ */ jsx145(
|
|
14876
16244
|
"div",
|
|
14877
16245
|
{
|
|
14878
16246
|
"data-slot": "item-content",
|
|
@@ -14885,7 +16253,7 @@ function ItemContent({ className, ...props }) {
|
|
|
14885
16253
|
);
|
|
14886
16254
|
}
|
|
14887
16255
|
function ItemTitle({ className, ...props }) {
|
|
14888
|
-
return /* @__PURE__ */
|
|
16256
|
+
return /* @__PURE__ */ jsx145(
|
|
14889
16257
|
"div",
|
|
14890
16258
|
{
|
|
14891
16259
|
"data-slot": "item-title",
|
|
@@ -14898,7 +16266,7 @@ function ItemTitle({ className, ...props }) {
|
|
|
14898
16266
|
);
|
|
14899
16267
|
}
|
|
14900
16268
|
function ItemDescription({ className, ...props }) {
|
|
14901
|
-
return /* @__PURE__ */
|
|
16269
|
+
return /* @__PURE__ */ jsx145(
|
|
14902
16270
|
"p",
|
|
14903
16271
|
{
|
|
14904
16272
|
"data-slot": "item-description",
|
|
@@ -14912,7 +16280,7 @@ function ItemDescription({ className, ...props }) {
|
|
|
14912
16280
|
);
|
|
14913
16281
|
}
|
|
14914
16282
|
function ItemActions({ className, ...props }) {
|
|
14915
|
-
return /* @__PURE__ */
|
|
16283
|
+
return /* @__PURE__ */ jsx145(
|
|
14916
16284
|
"div",
|
|
14917
16285
|
{
|
|
14918
16286
|
"data-slot": "item-actions",
|
|
@@ -14922,7 +16290,7 @@ function ItemActions({ className, ...props }) {
|
|
|
14922
16290
|
);
|
|
14923
16291
|
}
|
|
14924
16292
|
function ItemHeader({ className, ...props }) {
|
|
14925
|
-
return /* @__PURE__ */
|
|
16293
|
+
return /* @__PURE__ */ jsx145(
|
|
14926
16294
|
"div",
|
|
14927
16295
|
{
|
|
14928
16296
|
"data-slot": "item-header",
|
|
@@ -14935,7 +16303,7 @@ function ItemHeader({ className, ...props }) {
|
|
|
14935
16303
|
);
|
|
14936
16304
|
}
|
|
14937
16305
|
function ItemFooter({ className, ...props }) {
|
|
14938
|
-
return /* @__PURE__ */
|
|
16306
|
+
return /* @__PURE__ */ jsx145(
|
|
14939
16307
|
"div",
|
|
14940
16308
|
{
|
|
14941
16309
|
"data-slot": "item-footer",
|
|
@@ -14949,8 +16317,8 @@ function ItemFooter({ className, ...props }) {
|
|
|
14949
16317
|
}
|
|
14950
16318
|
|
|
14951
16319
|
// src/components/ui/json-input.tsx
|
|
14952
|
-
import { useState as
|
|
14953
|
-
import { jsx as
|
|
16320
|
+
import { useState as useState38 } from "react";
|
|
16321
|
+
import { jsx as jsx146, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
14954
16322
|
function JsonInput({
|
|
14955
16323
|
className,
|
|
14956
16324
|
value,
|
|
@@ -14971,10 +16339,10 @@ function JsonInput({
|
|
|
14971
16339
|
}
|
|
14972
16340
|
return "";
|
|
14973
16341
|
};
|
|
14974
|
-
const [internalValue, setInternalValue] =
|
|
16342
|
+
const [internalValue, setInternalValue] = useState38(
|
|
14975
16343
|
stringifyValue(defaultValue) || "{}"
|
|
14976
16344
|
);
|
|
14977
|
-
const [error, setError] =
|
|
16345
|
+
const [error, setError] = useState38(null);
|
|
14978
16346
|
const currentValue = value !== void 0 ? stringifyValue(value) : internalValue;
|
|
14979
16347
|
const handleChange = (e) => {
|
|
14980
16348
|
const newValue = e.target.value;
|
|
@@ -15003,8 +16371,8 @@ function JsonInput({
|
|
|
15003
16371
|
onBlur?.(e);
|
|
15004
16372
|
};
|
|
15005
16373
|
const errorMessage = validationError || error;
|
|
15006
|
-
return /* @__PURE__ */
|
|
15007
|
-
/* @__PURE__ */
|
|
16374
|
+
return /* @__PURE__ */ jsxs88("div", { "data-slot": "json-input", className: "cn-json-input relative w-full", children: [
|
|
16375
|
+
/* @__PURE__ */ jsx146(
|
|
15008
16376
|
Textarea,
|
|
15009
16377
|
{
|
|
15010
16378
|
value: currentValue,
|
|
@@ -15016,14 +16384,14 @@ function JsonInput({
|
|
|
15016
16384
|
...props
|
|
15017
16385
|
}
|
|
15018
16386
|
),
|
|
15019
|
-
errorMessage && /* @__PURE__ */
|
|
16387
|
+
errorMessage && /* @__PURE__ */ jsx146("p", { "data-slot": "json-input-error", className: "cn-json-input-error", children: errorMessage })
|
|
15020
16388
|
] });
|
|
15021
16389
|
}
|
|
15022
16390
|
|
|
15023
16391
|
// src/components/ui/kbd.tsx
|
|
15024
|
-
import { jsx as
|
|
16392
|
+
import { jsx as jsx147 } from "react/jsx-runtime";
|
|
15025
16393
|
function Kbd({ className, ...props }) {
|
|
15026
|
-
return /* @__PURE__ */
|
|
16394
|
+
return /* @__PURE__ */ jsx147(
|
|
15027
16395
|
"kbd",
|
|
15028
16396
|
{
|
|
15029
16397
|
"data-slot": "kbd",
|
|
@@ -15036,7 +16404,7 @@ function Kbd({ className, ...props }) {
|
|
|
15036
16404
|
);
|
|
15037
16405
|
}
|
|
15038
16406
|
function KbdGroup({ className, ...props }) {
|
|
15039
|
-
return /* @__PURE__ */
|
|
16407
|
+
return /* @__PURE__ */ jsx147(
|
|
15040
16408
|
"kbd",
|
|
15041
16409
|
{
|
|
15042
16410
|
"data-slot": "kbd-group",
|
|
@@ -15048,7 +16416,7 @@ function KbdGroup({ className, ...props }) {
|
|
|
15048
16416
|
|
|
15049
16417
|
// src/components/ui/list.tsx
|
|
15050
16418
|
import { cva as cva19 } from "class-variance-authority";
|
|
15051
|
-
import { jsx as
|
|
16419
|
+
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
15052
16420
|
var listVariants = cva19("space-y-2", {
|
|
15053
16421
|
variants: {
|
|
15054
16422
|
listStyle: {
|
|
@@ -15083,7 +16451,7 @@ function List({
|
|
|
15083
16451
|
className
|
|
15084
16452
|
);
|
|
15085
16453
|
if (ordered) {
|
|
15086
|
-
return /* @__PURE__ */
|
|
16454
|
+
return /* @__PURE__ */ jsx148(
|
|
15087
16455
|
"ol",
|
|
15088
16456
|
{
|
|
15089
16457
|
"data-slot": "list",
|
|
@@ -15092,7 +16460,7 @@ function List({
|
|
|
15092
16460
|
}
|
|
15093
16461
|
);
|
|
15094
16462
|
}
|
|
15095
|
-
return /* @__PURE__ */
|
|
16463
|
+
return /* @__PURE__ */ jsx148(
|
|
15096
16464
|
"ul",
|
|
15097
16465
|
{
|
|
15098
16466
|
"data-slot": "list",
|
|
@@ -15102,7 +16470,7 @@ function List({
|
|
|
15102
16470
|
);
|
|
15103
16471
|
}
|
|
15104
16472
|
function ListItem({ className, ...props }) {
|
|
15105
|
-
return /* @__PURE__ */
|
|
16473
|
+
return /* @__PURE__ */ jsx148(
|
|
15106
16474
|
"li",
|
|
15107
16475
|
{
|
|
15108
16476
|
"data-slot": "list-item",
|
|
@@ -15113,12 +16481,12 @@ function ListItem({ className, ...props }) {
|
|
|
15113
16481
|
}
|
|
15114
16482
|
|
|
15115
16483
|
// src/components/ui/mark.tsx
|
|
15116
|
-
import { jsx as
|
|
16484
|
+
import { jsx as jsx149 } from "react/jsx-runtime";
|
|
15117
16485
|
function Mark({ className, color, ...props }) {
|
|
15118
16486
|
const colorStyle = color ? {
|
|
15119
16487
|
"--mark-color": `var(--${color})`
|
|
15120
16488
|
} : void 0;
|
|
15121
|
-
return /* @__PURE__ */
|
|
16489
|
+
return /* @__PURE__ */ jsx149(
|
|
15122
16490
|
"mark",
|
|
15123
16491
|
{
|
|
15124
16492
|
"data-slot": "mark",
|
|
@@ -15137,7 +16505,7 @@ function Mark({ className, color, ...props }) {
|
|
|
15137
16505
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
15138
16506
|
import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar";
|
|
15139
16507
|
import { IconCheck as IconCheck7, IconChevronRight as IconChevronRight9 } from "@tabler/icons-react";
|
|
15140
|
-
import { jsx as
|
|
16508
|
+
import { jsx as jsx150, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
15141
16509
|
var MENUBAR_POSITIONER_CN = "isolate z-50 outline-none";
|
|
15142
16510
|
var MENUBAR_CONTENT_CN = cn(
|
|
15143
16511
|
"cn-menubar-content cn-menubar-content-logical cn-menu-target",
|
|
@@ -15159,7 +16527,7 @@ function Menubar({
|
|
|
15159
16527
|
className,
|
|
15160
16528
|
...props
|
|
15161
16529
|
}) {
|
|
15162
|
-
return /* @__PURE__ */
|
|
16530
|
+
return /* @__PURE__ */ jsx150(
|
|
15163
16531
|
MenubarPrimitive,
|
|
15164
16532
|
{
|
|
15165
16533
|
"data-slot": "menubar",
|
|
@@ -15171,28 +16539,28 @@ function Menubar({
|
|
|
15171
16539
|
function MenubarMenu({
|
|
15172
16540
|
...props
|
|
15173
16541
|
}) {
|
|
15174
|
-
return /* @__PURE__ */
|
|
16542
|
+
return /* @__PURE__ */ jsx150(MenuPrimitive.Root, { "data-slot": "menubar-menu", ...props });
|
|
15175
16543
|
}
|
|
15176
16544
|
function MenubarGroup({
|
|
15177
16545
|
...props
|
|
15178
16546
|
}) {
|
|
15179
|
-
return /* @__PURE__ */
|
|
16547
|
+
return /* @__PURE__ */ jsx150(MenuPrimitive.Group, { "data-slot": "menubar-group", ...props });
|
|
15180
16548
|
}
|
|
15181
16549
|
function MenubarPortal({
|
|
15182
16550
|
...props
|
|
15183
16551
|
}) {
|
|
15184
|
-
return /* @__PURE__ */
|
|
16552
|
+
return /* @__PURE__ */ jsx150(MenuPrimitive.Portal, { "data-slot": "menubar-portal", ...props });
|
|
15185
16553
|
}
|
|
15186
16554
|
function MenubarRadioGroup({
|
|
15187
16555
|
...props
|
|
15188
16556
|
}) {
|
|
15189
|
-
return /* @__PURE__ */
|
|
16557
|
+
return /* @__PURE__ */ jsx150(MenuPrimitive.RadioGroup, { "data-slot": "menubar-radio-group", ...props });
|
|
15190
16558
|
}
|
|
15191
16559
|
function MenubarTrigger({
|
|
15192
16560
|
className,
|
|
15193
16561
|
...props
|
|
15194
16562
|
}) {
|
|
15195
|
-
return /* @__PURE__ */
|
|
16563
|
+
return /* @__PURE__ */ jsx150(
|
|
15196
16564
|
MenuPrimitive.Trigger,
|
|
15197
16565
|
{
|
|
15198
16566
|
"data-slot": "menubar-trigger",
|
|
@@ -15208,7 +16576,7 @@ function MenubarContent({
|
|
|
15208
16576
|
className,
|
|
15209
16577
|
...props
|
|
15210
16578
|
}) {
|
|
15211
|
-
return /* @__PURE__ */
|
|
16579
|
+
return /* @__PURE__ */ jsx150(
|
|
15212
16580
|
MenuPrimitive.Popup,
|
|
15213
16581
|
{
|
|
15214
16582
|
"data-slot": "menubar-content",
|
|
@@ -15225,7 +16593,7 @@ function MenubarPositioner({
|
|
|
15225
16593
|
className,
|
|
15226
16594
|
...props
|
|
15227
16595
|
}) {
|
|
15228
|
-
return /* @__PURE__ */
|
|
16596
|
+
return /* @__PURE__ */ jsx150(MenuPrimitive.Portal, { children: /* @__PURE__ */ jsx150(
|
|
15229
16597
|
MenuPrimitive.Positioner,
|
|
15230
16598
|
{
|
|
15231
16599
|
"data-slot": "menubar-positioner",
|
|
@@ -15244,7 +16612,7 @@ function MenubarItem({
|
|
|
15244
16612
|
variant = "default",
|
|
15245
16613
|
...props
|
|
15246
16614
|
}) {
|
|
15247
|
-
return /* @__PURE__ */
|
|
16615
|
+
return /* @__PURE__ */ jsx150(
|
|
15248
16616
|
MenuPrimitive.Item,
|
|
15249
16617
|
{
|
|
15250
16618
|
"data-slot": "menubar-item",
|
|
@@ -15262,7 +16630,7 @@ function MenubarCheckboxItem({
|
|
|
15262
16630
|
inset,
|
|
15263
16631
|
...props
|
|
15264
16632
|
}) {
|
|
15265
|
-
return /* @__PURE__ */
|
|
16633
|
+
return /* @__PURE__ */ jsxs89(
|
|
15266
16634
|
MenuPrimitive.CheckboxItem,
|
|
15267
16635
|
{
|
|
15268
16636
|
"data-slot": "menubar-checkbox-item",
|
|
@@ -15275,7 +16643,7 @@ function MenubarCheckboxItem({
|
|
|
15275
16643
|
checked,
|
|
15276
16644
|
...props,
|
|
15277
16645
|
children: [
|
|
15278
|
-
/* @__PURE__ */
|
|
16646
|
+
/* @__PURE__ */ jsx150("span", { className: "cn-menubar-checkbox-item-indicator pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx150(MenuPrimitive.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx150(IconCheck7, { className: "size-4" }) }) }),
|
|
15279
16647
|
children
|
|
15280
16648
|
]
|
|
15281
16649
|
}
|
|
@@ -15287,7 +16655,7 @@ function MenubarRadioItem({
|
|
|
15287
16655
|
inset,
|
|
15288
16656
|
...props
|
|
15289
16657
|
}) {
|
|
15290
|
-
return /* @__PURE__ */
|
|
16658
|
+
return /* @__PURE__ */ jsxs89(
|
|
15291
16659
|
MenuPrimitive.RadioItem,
|
|
15292
16660
|
{
|
|
15293
16661
|
"data-slot": "menubar-radio-item",
|
|
@@ -15295,7 +16663,7 @@ function MenubarRadioItem({
|
|
|
15295
16663
|
"data-inset": inset,
|
|
15296
16664
|
...props,
|
|
15297
16665
|
children: [
|
|
15298
|
-
/* @__PURE__ */
|
|
16666
|
+
/* @__PURE__ */ jsx150("span", { className: "cn-menubar-radio-item-indicator pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx150(MenuPrimitive.RadioItemIndicator, { children: /* @__PURE__ */ jsx150(IconCheck7, { className: "size-4" }) }) }),
|
|
15299
16667
|
children
|
|
15300
16668
|
]
|
|
15301
16669
|
}
|
|
@@ -15306,7 +16674,7 @@ function MenubarLabel({
|
|
|
15306
16674
|
inset,
|
|
15307
16675
|
...props
|
|
15308
16676
|
}) {
|
|
15309
|
-
return /* @__PURE__ */
|
|
16677
|
+
return /* @__PURE__ */ jsx150(
|
|
15310
16678
|
MenuPrimitive.GroupLabel,
|
|
15311
16679
|
{
|
|
15312
16680
|
"data-slot": "menubar-label",
|
|
@@ -15320,7 +16688,7 @@ function MenubarSeparator({
|
|
|
15320
16688
|
className,
|
|
15321
16689
|
...props
|
|
15322
16690
|
}) {
|
|
15323
|
-
return /* @__PURE__ */
|
|
16691
|
+
return /* @__PURE__ */ jsx150(
|
|
15324
16692
|
MenuPrimitive.Separator,
|
|
15325
16693
|
{
|
|
15326
16694
|
"data-slot": "menubar-separator",
|
|
@@ -15333,7 +16701,7 @@ function MenubarShortcut({
|
|
|
15333
16701
|
className,
|
|
15334
16702
|
...props
|
|
15335
16703
|
}) {
|
|
15336
|
-
return /* @__PURE__ */
|
|
16704
|
+
return /* @__PURE__ */ jsx150(
|
|
15337
16705
|
"span",
|
|
15338
16706
|
{
|
|
15339
16707
|
"data-slot": "menubar-shortcut",
|
|
@@ -15345,7 +16713,7 @@ function MenubarShortcut({
|
|
|
15345
16713
|
function MenubarSub({
|
|
15346
16714
|
...props
|
|
15347
16715
|
}) {
|
|
15348
|
-
return /* @__PURE__ */
|
|
16716
|
+
return /* @__PURE__ */ jsx150(MenuPrimitive.SubmenuRoot, { "data-slot": "menubar-sub", ...props });
|
|
15349
16717
|
}
|
|
15350
16718
|
function MenubarSubTrigger({
|
|
15351
16719
|
className,
|
|
@@ -15353,7 +16721,7 @@ function MenubarSubTrigger({
|
|
|
15353
16721
|
children,
|
|
15354
16722
|
...props
|
|
15355
16723
|
}) {
|
|
15356
|
-
return /* @__PURE__ */
|
|
16724
|
+
return /* @__PURE__ */ jsxs89(
|
|
15357
16725
|
MenuPrimitive.SubmenuTrigger,
|
|
15358
16726
|
{
|
|
15359
16727
|
"data-slot": "menubar-sub-trigger",
|
|
@@ -15366,7 +16734,7 @@ function MenubarSubTrigger({
|
|
|
15366
16734
|
...props,
|
|
15367
16735
|
children: [
|
|
15368
16736
|
children,
|
|
15369
|
-
/* @__PURE__ */
|
|
16737
|
+
/* @__PURE__ */ jsx150(IconChevronRight9, { className: "ml-auto h-4 w-4" })
|
|
15370
16738
|
]
|
|
15371
16739
|
}
|
|
15372
16740
|
);
|
|
@@ -15379,7 +16747,7 @@ function MenubarSubContent({
|
|
|
15379
16747
|
sideOffset = 0,
|
|
15380
16748
|
...props
|
|
15381
16749
|
}) {
|
|
15382
|
-
return /* @__PURE__ */
|
|
16750
|
+
return /* @__PURE__ */ jsx150(MenuPrimitive.Portal, { children: /* @__PURE__ */ jsx150(
|
|
15383
16751
|
MenuPrimitive.Positioner,
|
|
15384
16752
|
{
|
|
15385
16753
|
className: MENUBAR_POSITIONER_CN,
|
|
@@ -15387,7 +16755,7 @@ function MenubarSubContent({
|
|
|
15387
16755
|
alignOffset,
|
|
15388
16756
|
side,
|
|
15389
16757
|
sideOffset,
|
|
15390
|
-
children: /* @__PURE__ */
|
|
16758
|
+
children: /* @__PURE__ */ jsx150(
|
|
15391
16759
|
MenuPrimitive.Popup,
|
|
15392
16760
|
{
|
|
15393
16761
|
"data-slot": "menubar-sub-content",
|
|
@@ -15405,8 +16773,8 @@ function MenubarSubContent({
|
|
|
15405
16773
|
}
|
|
15406
16774
|
|
|
15407
16775
|
// src/components/ui/money-input.tsx
|
|
15408
|
-
import { forwardRef as
|
|
15409
|
-
import { jsx as
|
|
16776
|
+
import { forwardRef as forwardRef7, useCallback as useCallback11, useState as useState39 } from "react";
|
|
16777
|
+
import { jsx as jsx151, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
15410
16778
|
var defaultCurrencies = [
|
|
15411
16779
|
{ label: "ETB", value: "etb", symbol: "Br" },
|
|
15412
16780
|
{ label: "USD", value: "usd", symbol: "$" },
|
|
@@ -15441,7 +16809,7 @@ var sizeClasses4 = {
|
|
|
15441
16809
|
select: "w-[90px] text-base"
|
|
15442
16810
|
}
|
|
15443
16811
|
};
|
|
15444
|
-
var MoneyInput =
|
|
16812
|
+
var MoneyInput = forwardRef7(
|
|
15445
16813
|
({
|
|
15446
16814
|
value = 0,
|
|
15447
16815
|
currency = "etb",
|
|
@@ -15455,9 +16823,9 @@ var MoneyInput = forwardRef5(
|
|
|
15455
16823
|
id
|
|
15456
16824
|
}, ref) => {
|
|
15457
16825
|
const placeholder = placeholderProp ?? (fractionDigits > 0 ? `0.${"0".repeat(fractionDigits)}` : "0");
|
|
15458
|
-
const [internalValue, setInternalValue] =
|
|
15459
|
-
const [internalCurrency, setInternalCurrency] =
|
|
15460
|
-
const [displayValue, setDisplayValue] =
|
|
16826
|
+
const [internalValue, setInternalValue] = useState39(value);
|
|
16827
|
+
const [internalCurrency, setInternalCurrency] = useState39(currency);
|
|
16828
|
+
const [displayValue, setDisplayValue] = useState39(
|
|
15461
16829
|
() => formatNumber(value, fractionDigits)
|
|
15462
16830
|
);
|
|
15463
16831
|
const currentCurrency = currencies.find(
|
|
@@ -15465,7 +16833,7 @@ var MoneyInput = forwardRef5(
|
|
|
15465
16833
|
);
|
|
15466
16834
|
const currencySymbol = currentCurrency?.symbol || currentCurrency?.label || "";
|
|
15467
16835
|
const sizes = sizeClasses4[size];
|
|
15468
|
-
const handleInputChange =
|
|
16836
|
+
const handleInputChange = useCallback11(
|
|
15469
16837
|
(e) => {
|
|
15470
16838
|
const rawValue = e.target.value;
|
|
15471
16839
|
setDisplayValue(rawValue);
|
|
@@ -15474,31 +16842,31 @@ var MoneyInput = forwardRef5(
|
|
|
15474
16842
|
},
|
|
15475
16843
|
[]
|
|
15476
16844
|
);
|
|
15477
|
-
const handleBlur =
|
|
16845
|
+
const handleBlur = useCallback11(() => {
|
|
15478
16846
|
const formatted = formatNumber(internalValue, fractionDigits);
|
|
15479
16847
|
setDisplayValue(formatted);
|
|
15480
16848
|
onValueChange?.(internalValue, internalCurrency);
|
|
15481
16849
|
}, [internalValue, internalCurrency, onValueChange, fractionDigits]);
|
|
15482
|
-
const handleFocus =
|
|
16850
|
+
const handleFocus = useCallback11(() => {
|
|
15483
16851
|
setDisplayValue(
|
|
15484
16852
|
internalValue % 1 === 0 ? internalValue.toString() : internalValue.toFixed(fractionDigits)
|
|
15485
16853
|
);
|
|
15486
16854
|
}, [internalValue, fractionDigits]);
|
|
15487
|
-
const handleCurrencyChange =
|
|
16855
|
+
const handleCurrencyChange = useCallback11(
|
|
15488
16856
|
(newCurrency) => {
|
|
15489
16857
|
setInternalCurrency(newCurrency);
|
|
15490
16858
|
onValueChange?.(internalValue, newCurrency);
|
|
15491
16859
|
},
|
|
15492
16860
|
[internalValue, onValueChange]
|
|
15493
16861
|
);
|
|
15494
|
-
return /* @__PURE__ */
|
|
16862
|
+
return /* @__PURE__ */ jsx151(
|
|
15495
16863
|
"div",
|
|
15496
16864
|
{
|
|
15497
16865
|
ref,
|
|
15498
16866
|
"data-slot": "money-input",
|
|
15499
16867
|
className: cn("w-full", className),
|
|
15500
|
-
children: /* @__PURE__ */
|
|
15501
|
-
/* @__PURE__ */
|
|
16868
|
+
children: /* @__PURE__ */ jsxs90(InputGroup, { disabled, className: cn(sizes.group), children: [
|
|
16869
|
+
/* @__PURE__ */ jsx151(
|
|
15502
16870
|
InputGroupAddon,
|
|
15503
16871
|
{
|
|
15504
16872
|
align: "inline-start",
|
|
@@ -15506,7 +16874,7 @@ var MoneyInput = forwardRef5(
|
|
|
15506
16874
|
children: currencySymbol
|
|
15507
16875
|
}
|
|
15508
16876
|
),
|
|
15509
|
-
/* @__PURE__ */
|
|
16877
|
+
/* @__PURE__ */ jsx151(
|
|
15510
16878
|
InputGroupInput,
|
|
15511
16879
|
{
|
|
15512
16880
|
id,
|
|
@@ -15520,24 +16888,24 @@ var MoneyInput = forwardRef5(
|
|
|
15520
16888
|
className: "tabular-nums !pl-2"
|
|
15521
16889
|
}
|
|
15522
16890
|
),
|
|
15523
|
-
/* @__PURE__ */
|
|
16891
|
+
/* @__PURE__ */ jsx151(InputGroupAddon, { align: "inline-end", className: "py-0 pr-0", children: /* @__PURE__ */ jsx151("div", { className: "cn-money-input-currency-divider flex h-full items-center", children: /* @__PURE__ */ jsxs90(
|
|
15524
16892
|
Select,
|
|
15525
16893
|
{
|
|
15526
16894
|
value: internalCurrency,
|
|
15527
16895
|
onValueChange: (v) => handleCurrencyChange(v),
|
|
15528
16896
|
disabled,
|
|
15529
16897
|
children: [
|
|
15530
|
-
/* @__PURE__ */
|
|
16898
|
+
/* @__PURE__ */ jsx151(
|
|
15531
16899
|
SelectTrigger,
|
|
15532
16900
|
{
|
|
15533
16901
|
className: cn(
|
|
15534
16902
|
"cn-money-input-currency-trigger h-full min-h-0 w-auto uppercase",
|
|
15535
16903
|
sizes.select
|
|
15536
16904
|
),
|
|
15537
|
-
children: /* @__PURE__ */
|
|
16905
|
+
children: /* @__PURE__ */ jsx151(SelectValue, { className: "uppercase" })
|
|
15538
16906
|
}
|
|
15539
16907
|
),
|
|
15540
|
-
/* @__PURE__ */
|
|
16908
|
+
/* @__PURE__ */ jsx151(SelectContent, { children: currencies.map((curr) => /* @__PURE__ */ jsx151(SelectItem, { value: curr.value, children: curr.label.toUpperCase() }, curr.value)) })
|
|
15541
16909
|
]
|
|
15542
16910
|
}
|
|
15543
16911
|
) }) })
|
|
@@ -15550,9 +16918,9 @@ MoneyInput.displayName = "MoneyInput";
|
|
|
15550
16918
|
|
|
15551
16919
|
// src/components/ui/multi-select.tsx
|
|
15552
16920
|
import { Autocomplete as AutocompletePrimitive2 } from "@base-ui/react/autocomplete";
|
|
15553
|
-
import { IconCheck as IconCheck8, IconChevronDown as
|
|
15554
|
-
import { useState as
|
|
15555
|
-
import { jsx as
|
|
16921
|
+
import { IconCheck as IconCheck8, IconChevronDown as IconChevronDown11, IconX as IconX12 } from "@tabler/icons-react";
|
|
16922
|
+
import { useState as useState40 } from "react";
|
|
16923
|
+
import { jsx as jsx152, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
15556
16924
|
function MultiSelect({
|
|
15557
16925
|
options,
|
|
15558
16926
|
value = [],
|
|
@@ -15563,8 +16931,8 @@ function MultiSelect({
|
|
|
15563
16931
|
disabled,
|
|
15564
16932
|
...props
|
|
15565
16933
|
}) {
|
|
15566
|
-
const [open, setOpen] =
|
|
15567
|
-
const [inputValue, setInputValue] =
|
|
16934
|
+
const [open, setOpen] = useState40(false);
|
|
16935
|
+
const [inputValue, setInputValue] = useState40("");
|
|
15568
16936
|
const selectedOptions = options.filter((opt) => value.includes(opt.value));
|
|
15569
16937
|
const filteredOptions = inputValue === "" ? options : options.filter(
|
|
15570
16938
|
(option) => option.label.toLowerCase().includes(inputValue.toLowerCase())
|
|
@@ -15576,7 +16944,7 @@ function MultiSelect({
|
|
|
15576
16944
|
const handleRemove = (optionValue) => {
|
|
15577
16945
|
onValueChange?.(value.filter((v) => v !== optionValue));
|
|
15578
16946
|
};
|
|
15579
|
-
return /* @__PURE__ */
|
|
16947
|
+
return /* @__PURE__ */ jsx152(
|
|
15580
16948
|
"div",
|
|
15581
16949
|
{
|
|
15582
16950
|
"data-slot": "multi-select",
|
|
@@ -15585,7 +16953,7 @@ function MultiSelect({
|
|
|
15585
16953
|
"relative w-full data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
15586
16954
|
className
|
|
15587
16955
|
),
|
|
15588
|
-
children: /* @__PURE__ */
|
|
16956
|
+
children: /* @__PURE__ */ jsxs91(
|
|
15589
16957
|
AutocompletePrimitive2.Root,
|
|
15590
16958
|
{
|
|
15591
16959
|
open: disabled ? false : open,
|
|
@@ -15602,16 +16970,16 @@ function MultiSelect({
|
|
|
15602
16970
|
inline: true,
|
|
15603
16971
|
...props,
|
|
15604
16972
|
children: [
|
|
15605
|
-
/* @__PURE__ */
|
|
15606
|
-
/* @__PURE__ */
|
|
15607
|
-
selectedOptions.map((option) => /* @__PURE__ */
|
|
16973
|
+
/* @__PURE__ */ jsxs91("div", { className: "relative", children: [
|
|
16974
|
+
/* @__PURE__ */ jsx152("div", { className: "cn-combobox-chips", children: /* @__PURE__ */ jsxs91("div", { className: "flex flex-wrap gap-1", children: [
|
|
16975
|
+
selectedOptions.map((option) => /* @__PURE__ */ jsxs91(
|
|
15608
16976
|
"span",
|
|
15609
16977
|
{
|
|
15610
16978
|
"data-slot": "multi-select-chip",
|
|
15611
16979
|
className: "cn-combobox-chip",
|
|
15612
16980
|
children: [
|
|
15613
|
-
/* @__PURE__ */
|
|
15614
|
-
/* @__PURE__ */
|
|
16981
|
+
/* @__PURE__ */ jsx152("span", { className: "flex-1", children: option.label }),
|
|
16982
|
+
/* @__PURE__ */ jsxs91(
|
|
15615
16983
|
"button",
|
|
15616
16984
|
{
|
|
15617
16985
|
type: "button",
|
|
@@ -15622,8 +16990,8 @@ function MultiSelect({
|
|
|
15622
16990
|
},
|
|
15623
16991
|
className: "cn-combobox-chip-remove",
|
|
15624
16992
|
children: [
|
|
15625
|
-
/* @__PURE__ */
|
|
15626
|
-
/* @__PURE__ */
|
|
16993
|
+
/* @__PURE__ */ jsx152("span", { className: "sr-only", children: "Remove" }),
|
|
16994
|
+
/* @__PURE__ */ jsx152(IconX12, { className: "size-3" })
|
|
15627
16995
|
]
|
|
15628
16996
|
}
|
|
15629
16997
|
)
|
|
@@ -15631,7 +16999,7 @@ function MultiSelect({
|
|
|
15631
16999
|
},
|
|
15632
17000
|
option.value
|
|
15633
17001
|
)),
|
|
15634
|
-
/* @__PURE__ */
|
|
17002
|
+
/* @__PURE__ */ jsx152(
|
|
15635
17003
|
AutocompletePrimitive2.Input,
|
|
15636
17004
|
{
|
|
15637
17005
|
"data-slot": "multi-select-input",
|
|
@@ -15644,14 +17012,14 @@ function MultiSelect({
|
|
|
15644
17012
|
}
|
|
15645
17013
|
)
|
|
15646
17014
|
] }) }),
|
|
15647
|
-
/* @__PURE__ */
|
|
17015
|
+
/* @__PURE__ */ jsx152(IconChevronDown11, { className: "cn-multi-select-trigger-icon" })
|
|
15648
17016
|
] }),
|
|
15649
|
-
open && /* @__PURE__ */
|
|
17017
|
+
open && /* @__PURE__ */ jsx152(
|
|
15650
17018
|
AutocompletePrimitive2.List,
|
|
15651
17019
|
{
|
|
15652
17020
|
"data-slot": "multi-select-content",
|
|
15653
17021
|
className: cn("cn-multi-select-content cn-combobox-content"),
|
|
15654
|
-
children: filteredOptions.length === 0 ? /* @__PURE__ */
|
|
17022
|
+
children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx152("div", { className: "cn-multi-select-empty", children: emptyText }) : filteredOptions.map((option) => /* @__PURE__ */ jsxs91(
|
|
15655
17023
|
AutocompletePrimitive2.Item,
|
|
15656
17024
|
{
|
|
15657
17025
|
value: option.value,
|
|
@@ -15664,8 +17032,8 @@ function MultiSelect({
|
|
|
15664
17032
|
"cn-combobox-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50"
|
|
15665
17033
|
),
|
|
15666
17034
|
children: [
|
|
15667
|
-
/* @__PURE__ */
|
|
15668
|
-
value.includes(option.value) && /* @__PURE__ */
|
|
17035
|
+
/* @__PURE__ */ jsx152("span", { className: "flex-1", children: option.label }),
|
|
17036
|
+
value.includes(option.value) && /* @__PURE__ */ jsx152("span", { className: "cn-combobox-item-indicator", children: /* @__PURE__ */ jsx152(IconCheck8, { className: "size-4" }) })
|
|
15669
17037
|
]
|
|
15670
17038
|
},
|
|
15671
17039
|
option.value
|
|
@@ -15680,9 +17048,9 @@ function MultiSelect({
|
|
|
15680
17048
|
}
|
|
15681
17049
|
|
|
15682
17050
|
// src/components/ui/native-select.tsx
|
|
15683
|
-
import { IconChevronDown as
|
|
15684
|
-
import { forwardRef as
|
|
15685
|
-
import { jsx as
|
|
17051
|
+
import { IconChevronDown as IconChevronDown12 } from "@tabler/icons-react";
|
|
17052
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
17053
|
+
import { jsx as jsx153, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
15686
17054
|
function mapNativeSelectSize(size) {
|
|
15687
17055
|
return size === "xs" || size === "sm" ? "sm" : "default";
|
|
15688
17056
|
}
|
|
@@ -15691,11 +17059,11 @@ function parseOptions(data) {
|
|
|
15691
17059
|
(item) => typeof item === "string" ? { value: item, label: item } : item
|
|
15692
17060
|
);
|
|
15693
17061
|
}
|
|
15694
|
-
var NativeSelectBase =
|
|
17062
|
+
var NativeSelectBase = forwardRef8(
|
|
15695
17063
|
({ className, size = "md", data, children, rightSection, ...props }, ref) => {
|
|
15696
17064
|
const options = data ? parseOptions(data) : null;
|
|
15697
17065
|
const mappedSize = mapNativeSelectSize(size);
|
|
15698
|
-
return /* @__PURE__ */
|
|
17066
|
+
return /* @__PURE__ */ jsxs92(
|
|
15699
17067
|
"div",
|
|
15700
17068
|
{
|
|
15701
17069
|
"data-slot": "native-select-wrapper",
|
|
@@ -15705,7 +17073,7 @@ var NativeSelectBase = forwardRef6(
|
|
|
15705
17073
|
className
|
|
15706
17074
|
),
|
|
15707
17075
|
children: [
|
|
15708
|
-
/* @__PURE__ */
|
|
17076
|
+
/* @__PURE__ */ jsx153(
|
|
15709
17077
|
"select",
|
|
15710
17078
|
{
|
|
15711
17079
|
ref,
|
|
@@ -15715,16 +17083,16 @@ var NativeSelectBase = forwardRef6(
|
|
|
15715
17083
|
"cn-native-select outline-none disabled:pointer-events-none disabled:cursor-not-allowed"
|
|
15716
17084
|
),
|
|
15717
17085
|
...props,
|
|
15718
|
-
children: options ? options.map((opt) => /* @__PURE__ */
|
|
17086
|
+
children: options ? options.map((opt) => /* @__PURE__ */ jsx153("option", { value: opt.value, children: opt.label }, opt.value)) : children
|
|
15719
17087
|
}
|
|
15720
17088
|
),
|
|
15721
|
-
/* @__PURE__ */
|
|
17089
|
+
/* @__PURE__ */ jsx153(
|
|
15722
17090
|
"span",
|
|
15723
17091
|
{
|
|
15724
17092
|
"data-slot": "native-select-icon",
|
|
15725
17093
|
"aria-hidden": "true",
|
|
15726
17094
|
className: "cn-native-select-icon pointer-events-none absolute select-none",
|
|
15727
|
-
children: rightSection ?? /* @__PURE__ */
|
|
17095
|
+
children: rightSection ?? /* @__PURE__ */ jsx153(IconChevronDown12, { className: "size-4" })
|
|
15728
17096
|
}
|
|
15729
17097
|
)
|
|
15730
17098
|
]
|
|
@@ -15733,7 +17101,7 @@ var NativeSelectBase = forwardRef6(
|
|
|
15733
17101
|
}
|
|
15734
17102
|
);
|
|
15735
17103
|
NativeSelectBase.displayName = "NativeSelectBase";
|
|
15736
|
-
var NativeSelect =
|
|
17104
|
+
var NativeSelect = forwardRef8(
|
|
15737
17105
|
({
|
|
15738
17106
|
label,
|
|
15739
17107
|
description,
|
|
@@ -15749,11 +17117,11 @@ var NativeSelect = forwardRef6(
|
|
|
15749
17117
|
...selectProps
|
|
15750
17118
|
}, ref) => {
|
|
15751
17119
|
const hasWrapper = label || description || error || required || withAsterisk;
|
|
15752
|
-
const select = /* @__PURE__ */
|
|
17120
|
+
const select = /* @__PURE__ */ jsx153(NativeSelectBase, { ref, disabled, ...selectProps });
|
|
15753
17121
|
if (!hasWrapper) {
|
|
15754
17122
|
return select;
|
|
15755
17123
|
}
|
|
15756
|
-
return /* @__PURE__ */
|
|
17124
|
+
return /* @__PURE__ */ jsx153(
|
|
15757
17125
|
InputWrapper,
|
|
15758
17126
|
{
|
|
15759
17127
|
label,
|
|
@@ -15777,7 +17145,7 @@ NativeSelect.displayName = "NativeSelect";
|
|
|
15777
17145
|
// src/components/ui/nav-link.tsx
|
|
15778
17146
|
import { useMesob as useMesob9 } from "@mesob/ui/providers";
|
|
15779
17147
|
import { cva as cva20 } from "class-variance-authority";
|
|
15780
|
-
import { jsx as
|
|
17148
|
+
import { jsx as jsx154, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
15781
17149
|
var isExternal3 = (href) => !href || href.startsWith("http") || href.startsWith("//") || href.startsWith("mailto:") || href.startsWith("tel:");
|
|
15782
17150
|
var navLinkVariants = cva20(
|
|
15783
17151
|
"cn-nav-link flex items-center gap-3 px-3 py-2 text-sm font-medium transition-colors cursor-pointer",
|
|
@@ -15816,7 +17184,7 @@ function NavLink({
|
|
|
15816
17184
|
const useLink = href && !isExternal3(href) && Link2;
|
|
15817
17185
|
const Comp = useLink ? Link2 : "a";
|
|
15818
17186
|
const linkProps = useLink ? { ...props, href, ...locale && { locale } } : { ...props, href };
|
|
15819
|
-
return /* @__PURE__ */
|
|
17187
|
+
return /* @__PURE__ */ jsxs93(
|
|
15820
17188
|
Comp,
|
|
15821
17189
|
{
|
|
15822
17190
|
"data-slot": "nav-link",
|
|
@@ -15830,9 +17198,9 @@ function NavLink({
|
|
|
15830
17198
|
"aria-current": active ? "page" : void 0,
|
|
15831
17199
|
...linkProps,
|
|
15832
17200
|
children: [
|
|
15833
|
-
icon && /* @__PURE__ */
|
|
15834
|
-
/* @__PURE__ */
|
|
15835
|
-
rightSection && /* @__PURE__ */
|
|
17201
|
+
icon && /* @__PURE__ */ jsx154("span", { className: "shrink-0 [&>svg]:size-5", "data-slot": "nav-link-icon", children: icon }),
|
|
17202
|
+
/* @__PURE__ */ jsx154("span", { className: "flex-1", "data-slot": "nav-link-label", children: label }),
|
|
17203
|
+
rightSection && /* @__PURE__ */ jsx154(
|
|
15836
17204
|
"span",
|
|
15837
17205
|
{
|
|
15838
17206
|
className: "shrink-0 text-muted-foreground",
|
|
@@ -15848,16 +17216,16 @@ function NavLink({
|
|
|
15848
17216
|
|
|
15849
17217
|
// src/components/ui/navigation-menu.tsx
|
|
15850
17218
|
import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu";
|
|
15851
|
-
import { IconChevronDown as
|
|
17219
|
+
import { IconChevronDown as IconChevronDown13 } from "@tabler/icons-react";
|
|
15852
17220
|
import { cva as cva21 } from "class-variance-authority";
|
|
15853
|
-
import { jsx as
|
|
17221
|
+
import { jsx as jsx155, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
15854
17222
|
function NavigationMenu({
|
|
15855
17223
|
className,
|
|
15856
17224
|
children,
|
|
15857
17225
|
viewport = true,
|
|
15858
17226
|
...props
|
|
15859
17227
|
}) {
|
|
15860
|
-
return /* @__PURE__ */
|
|
17228
|
+
return /* @__PURE__ */ jsxs94(
|
|
15861
17229
|
NavigationMenuPrimitive.Root,
|
|
15862
17230
|
{
|
|
15863
17231
|
"data-slot": "navigation-menu",
|
|
@@ -15869,17 +17237,17 @@ function NavigationMenu({
|
|
|
15869
17237
|
...props,
|
|
15870
17238
|
children: [
|
|
15871
17239
|
children,
|
|
15872
|
-
viewport && /* @__PURE__ */
|
|
17240
|
+
viewport && /* @__PURE__ */ jsx155(NavigationMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx155(
|
|
15873
17241
|
NavigationMenuPrimitive.Positioner,
|
|
15874
17242
|
{
|
|
15875
17243
|
"data-slot": "navigation-menu-positioner",
|
|
15876
17244
|
className: "cn-navigation-menu-positioner isolate z-50",
|
|
15877
|
-
children: /* @__PURE__ */
|
|
17245
|
+
children: /* @__PURE__ */ jsx155(
|
|
15878
17246
|
NavigationMenuPrimitive.Popup,
|
|
15879
17247
|
{
|
|
15880
17248
|
"data-slot": "navigation-menu-popup",
|
|
15881
17249
|
className: "cn-navigation-menu-popup outline-none",
|
|
15882
|
-
children: /* @__PURE__ */
|
|
17250
|
+
children: /* @__PURE__ */ jsx155(NavigationMenuViewport, {})
|
|
15883
17251
|
}
|
|
15884
17252
|
)
|
|
15885
17253
|
}
|
|
@@ -15892,7 +17260,7 @@ function NavigationMenuList({
|
|
|
15892
17260
|
className,
|
|
15893
17261
|
...props
|
|
15894
17262
|
}) {
|
|
15895
|
-
return /* @__PURE__ */
|
|
17263
|
+
return /* @__PURE__ */ jsx155(
|
|
15896
17264
|
NavigationMenuPrimitive.List,
|
|
15897
17265
|
{
|
|
15898
17266
|
"data-slot": "navigation-menu-list",
|
|
@@ -15908,7 +17276,7 @@ function NavigationMenuItem({
|
|
|
15908
17276
|
className,
|
|
15909
17277
|
...props
|
|
15910
17278
|
}) {
|
|
15911
|
-
return /* @__PURE__ */
|
|
17279
|
+
return /* @__PURE__ */ jsx155(
|
|
15912
17280
|
NavigationMenuPrimitive.Item,
|
|
15913
17281
|
{
|
|
15914
17282
|
"data-slot": "navigation-menu-item",
|
|
@@ -15923,7 +17291,7 @@ function NavigationMenuTrigger({
|
|
|
15923
17291
|
children,
|
|
15924
17292
|
...props
|
|
15925
17293
|
}) {
|
|
15926
|
-
return /* @__PURE__ */
|
|
17294
|
+
return /* @__PURE__ */ jsxs94(
|
|
15927
17295
|
NavigationMenuPrimitive.Trigger,
|
|
15928
17296
|
{
|
|
15929
17297
|
"data-slot": "navigation-menu-trigger",
|
|
@@ -15935,8 +17303,8 @@ function NavigationMenuTrigger({
|
|
|
15935
17303
|
...props,
|
|
15936
17304
|
children: [
|
|
15937
17305
|
children,
|
|
15938
|
-
/* @__PURE__ */
|
|
15939
|
-
|
|
17306
|
+
/* @__PURE__ */ jsx155(
|
|
17307
|
+
IconChevronDown13,
|
|
15940
17308
|
{
|
|
15941
17309
|
className: "cn-navigation-menu-trigger-icon",
|
|
15942
17310
|
"aria-hidden": "true"
|
|
@@ -15950,7 +17318,7 @@ function NavigationMenuContent({
|
|
|
15950
17318
|
className,
|
|
15951
17319
|
...props
|
|
15952
17320
|
}) {
|
|
15953
|
-
return /* @__PURE__ */
|
|
17321
|
+
return /* @__PURE__ */ jsx155(
|
|
15954
17322
|
NavigationMenuPrimitive.Content,
|
|
15955
17323
|
{
|
|
15956
17324
|
"data-slot": "navigation-menu-content",
|
|
@@ -15966,7 +17334,7 @@ function NavigationMenuViewport({
|
|
|
15966
17334
|
className,
|
|
15967
17335
|
...props
|
|
15968
17336
|
}) {
|
|
15969
|
-
return /* @__PURE__ */
|
|
17337
|
+
return /* @__PURE__ */ jsx155("div", { className: "absolute top-full left-0 flex justify-center", children: /* @__PURE__ */ jsx155(
|
|
15970
17338
|
NavigationMenuPrimitive.Viewport,
|
|
15971
17339
|
{
|
|
15972
17340
|
"data-slot": "navigation-menu-viewport",
|
|
@@ -15982,7 +17350,7 @@ function NavigationMenuLink({
|
|
|
15982
17350
|
className,
|
|
15983
17351
|
...props
|
|
15984
17352
|
}) {
|
|
15985
|
-
return /* @__PURE__ */
|
|
17353
|
+
return /* @__PURE__ */ jsx155(
|
|
15986
17354
|
NavigationMenuPrimitive.Link,
|
|
15987
17355
|
{
|
|
15988
17356
|
"data-slot": "navigation-menu-link",
|
|
@@ -15995,7 +17363,7 @@ function NavigationMenuIndicator({
|
|
|
15995
17363
|
className,
|
|
15996
17364
|
...props
|
|
15997
17365
|
}) {
|
|
15998
|
-
return /* @__PURE__ */
|
|
17366
|
+
return /* @__PURE__ */ jsx155(
|
|
15999
17367
|
"div",
|
|
16000
17368
|
{
|
|
16001
17369
|
"data-slot": "navigation-menu-indicator",
|
|
@@ -16004,13 +17372,13 @@ function NavigationMenuIndicator({
|
|
|
16004
17372
|
className
|
|
16005
17373
|
),
|
|
16006
17374
|
...props,
|
|
16007
|
-
children: /* @__PURE__ */
|
|
17375
|
+
children: /* @__PURE__ */ jsx155("div", { className: "cn-navigation-menu-indicator-arrow" })
|
|
16008
17376
|
}
|
|
16009
17377
|
);
|
|
16010
17378
|
}
|
|
16011
17379
|
|
|
16012
17380
|
// src/components/ui/number-formatter.tsx
|
|
16013
|
-
import { jsx as
|
|
17381
|
+
import { jsx as jsx156 } from "react/jsx-runtime";
|
|
16014
17382
|
function NumberFormatter({
|
|
16015
17383
|
className,
|
|
16016
17384
|
value,
|
|
@@ -16041,7 +17409,7 @@ function NumberFormatter({
|
|
|
16041
17409
|
}
|
|
16042
17410
|
return `${prefix}${result}${suffix}`;
|
|
16043
17411
|
};
|
|
16044
|
-
return /* @__PURE__ */
|
|
17412
|
+
return /* @__PURE__ */ jsx156(
|
|
16045
17413
|
"span",
|
|
16046
17414
|
{
|
|
16047
17415
|
"data-slot": "number-formatter",
|
|
@@ -16053,15 +17421,15 @@ function NumberFormatter({
|
|
|
16053
17421
|
}
|
|
16054
17422
|
|
|
16055
17423
|
// src/components/ui/number-input.tsx
|
|
16056
|
-
import { IconChevronDown as
|
|
16057
|
-
import { forwardRef as
|
|
17424
|
+
import { IconChevronDown as IconChevronDown14, IconChevronUp as IconChevronUp4 } from "@tabler/icons-react";
|
|
17425
|
+
import { forwardRef as forwardRef9, useCallback as useCallback12 } from "react";
|
|
16058
17426
|
|
|
16059
17427
|
// src/components/ui/unstyled-button.tsx
|
|
16060
17428
|
import { useRender as useRender9 } from "@base-ui/react/use-render";
|
|
16061
|
-
import { jsx as
|
|
17429
|
+
import { jsx as jsx157 } from "react/jsx-runtime";
|
|
16062
17430
|
function UnstyledButton({
|
|
16063
17431
|
className,
|
|
16064
|
-
render = /* @__PURE__ */
|
|
17432
|
+
render = /* @__PURE__ */ jsx157("button", { type: "button" }),
|
|
16065
17433
|
...props
|
|
16066
17434
|
}) {
|
|
16067
17435
|
return useRender9({
|
|
@@ -16079,7 +17447,7 @@ function UnstyledButton({
|
|
|
16079
17447
|
}
|
|
16080
17448
|
|
|
16081
17449
|
// src/components/ui/number-input.tsx
|
|
16082
|
-
import { jsx as
|
|
17450
|
+
import { jsx as jsx158, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
16083
17451
|
var sizeClasses5 = {
|
|
16084
17452
|
xs: "h-7",
|
|
16085
17453
|
sm: "h-8",
|
|
@@ -16111,7 +17479,7 @@ function getDisplayValue({
|
|
|
16111
17479
|
}
|
|
16112
17480
|
return "";
|
|
16113
17481
|
}
|
|
16114
|
-
var NumberInput =
|
|
17482
|
+
var NumberInput = forwardRef9(
|
|
16115
17483
|
({
|
|
16116
17484
|
value,
|
|
16117
17485
|
defaultValue,
|
|
@@ -16139,7 +17507,7 @@ var NumberInput = forwardRef7(
|
|
|
16139
17507
|
}, ref) => {
|
|
16140
17508
|
const numValue = getNumberValue(value);
|
|
16141
17509
|
const displayValue = getDisplayValue({ value, defaultValue });
|
|
16142
|
-
const clamp =
|
|
17510
|
+
const clamp = useCallback12(
|
|
16143
17511
|
(n) => {
|
|
16144
17512
|
let v = n;
|
|
16145
17513
|
if (min !== void 0 && v < min) {
|
|
@@ -16152,7 +17520,7 @@ var NumberInput = forwardRef7(
|
|
|
16152
17520
|
},
|
|
16153
17521
|
[min, max]
|
|
16154
17522
|
);
|
|
16155
|
-
const handleStep =
|
|
17523
|
+
const handleStep = useCallback12(
|
|
16156
17524
|
(delta) => {
|
|
16157
17525
|
let current;
|
|
16158
17526
|
if (numValue !== void 0) {
|
|
@@ -16182,13 +17550,13 @@ var NumberInput = forwardRef7(
|
|
|
16182
17550
|
};
|
|
16183
17551
|
const hasWrapper = label || description || error || required || withAsterisk;
|
|
16184
17552
|
const showControls = controls && !disabled;
|
|
16185
|
-
const controlsEl = showControls ? /* @__PURE__ */
|
|
17553
|
+
const controlsEl = showControls ? /* @__PURE__ */ jsxs95(
|
|
16186
17554
|
"div",
|
|
16187
17555
|
{
|
|
16188
17556
|
"data-slot": "number-input-controls",
|
|
16189
17557
|
className: "cn-number-input-controls",
|
|
16190
17558
|
children: [
|
|
16191
|
-
/* @__PURE__ */
|
|
17559
|
+
/* @__PURE__ */ jsx158(
|
|
16192
17560
|
UnstyledButton,
|
|
16193
17561
|
{
|
|
16194
17562
|
type: "button",
|
|
@@ -16201,10 +17569,10 @@ var NumberInput = forwardRef7(
|
|
|
16201
17569
|
e.preventDefault();
|
|
16202
17570
|
handleStep(step ?? 1);
|
|
16203
17571
|
},
|
|
16204
|
-
children: /* @__PURE__ */
|
|
17572
|
+
children: /* @__PURE__ */ jsx158(IconChevronUp4, { className: "size-4" })
|
|
16205
17573
|
}
|
|
16206
17574
|
),
|
|
16207
|
-
/* @__PURE__ */
|
|
17575
|
+
/* @__PURE__ */ jsx158(
|
|
16208
17576
|
UnstyledButton,
|
|
16209
17577
|
{
|
|
16210
17578
|
type: "button",
|
|
@@ -16217,15 +17585,15 @@ var NumberInput = forwardRef7(
|
|
|
16217
17585
|
e.preventDefault();
|
|
16218
17586
|
handleStep(-(step ?? 1));
|
|
16219
17587
|
},
|
|
16220
|
-
children: /* @__PURE__ */
|
|
17588
|
+
children: /* @__PURE__ */ jsx158(IconChevronDown14, { className: "size-4" })
|
|
16221
17589
|
}
|
|
16222
17590
|
)
|
|
16223
17591
|
]
|
|
16224
17592
|
}
|
|
16225
17593
|
) : null;
|
|
16226
|
-
const inputEl = /* @__PURE__ */
|
|
16227
|
-
leftSection && /* @__PURE__ */
|
|
16228
|
-
/* @__PURE__ */
|
|
17594
|
+
const inputEl = /* @__PURE__ */ jsxs95(InputGroup, { disabled, className: cn(sizeClasses5[size]), children: [
|
|
17595
|
+
leftSection && /* @__PURE__ */ jsx158(InputGroupAddon, { align: "inline-start", className: "pointer-events-none", children: leftSection }),
|
|
17596
|
+
/* @__PURE__ */ jsx158(
|
|
16229
17597
|
InputGroupInput,
|
|
16230
17598
|
{
|
|
16231
17599
|
ref,
|
|
@@ -16243,8 +17611,8 @@ var NumberInput = forwardRef7(
|
|
|
16243
17611
|
...inputProps
|
|
16244
17612
|
}
|
|
16245
17613
|
),
|
|
16246
|
-
rightSection && !showControls && /* @__PURE__ */
|
|
16247
|
-
showControls && /* @__PURE__ */
|
|
17614
|
+
rightSection && !showControls && /* @__PURE__ */ jsx158(InputGroupAddon, { align: "inline-end", children: rightSection }),
|
|
17615
|
+
showControls && /* @__PURE__ */ jsx158(
|
|
16248
17616
|
InputGroupAddon,
|
|
16249
17617
|
{
|
|
16250
17618
|
align: "inline-end",
|
|
@@ -16256,7 +17624,7 @@ var NumberInput = forwardRef7(
|
|
|
16256
17624
|
if (!hasWrapper) {
|
|
16257
17625
|
return inputEl;
|
|
16258
17626
|
}
|
|
16259
|
-
return /* @__PURE__ */
|
|
17627
|
+
return /* @__PURE__ */ jsx158(
|
|
16260
17628
|
InputWrapper,
|
|
16261
17629
|
{
|
|
16262
17630
|
label,
|
|
@@ -16283,9 +17651,9 @@ import {
|
|
|
16283
17651
|
IconChevronRight as IconChevronRight10,
|
|
16284
17652
|
IconDots as IconDots2
|
|
16285
17653
|
} from "@tabler/icons-react";
|
|
16286
|
-
import { jsx as
|
|
17654
|
+
import { jsx as jsx159, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
16287
17655
|
function Pagination({ className, ...props }) {
|
|
16288
|
-
return /* @__PURE__ */
|
|
17656
|
+
return /* @__PURE__ */ jsx159(
|
|
16289
17657
|
"nav",
|
|
16290
17658
|
{
|
|
16291
17659
|
"aria-label": "pagination",
|
|
@@ -16299,7 +17667,7 @@ function PaginationContent({
|
|
|
16299
17667
|
className,
|
|
16300
17668
|
...props
|
|
16301
17669
|
}) {
|
|
16302
|
-
return /* @__PURE__ */
|
|
17670
|
+
return /* @__PURE__ */ jsx159(
|
|
16303
17671
|
"ul",
|
|
16304
17672
|
{
|
|
16305
17673
|
"data-slot": "pagination-content",
|
|
@@ -16309,7 +17677,7 @@ function PaginationContent({
|
|
|
16309
17677
|
);
|
|
16310
17678
|
}
|
|
16311
17679
|
function PaginationItem({ ...props }) {
|
|
16312
|
-
return /* @__PURE__ */
|
|
17680
|
+
return /* @__PURE__ */ jsx159("li", { "data-slot": "pagination-item", ...props });
|
|
16313
17681
|
}
|
|
16314
17682
|
function PaginationLink({
|
|
16315
17683
|
className,
|
|
@@ -16317,7 +17685,7 @@ function PaginationLink({
|
|
|
16317
17685
|
size = "icon",
|
|
16318
17686
|
...props
|
|
16319
17687
|
}) {
|
|
16320
|
-
return /* @__PURE__ */
|
|
17688
|
+
return /* @__PURE__ */ jsx159(
|
|
16321
17689
|
"a",
|
|
16322
17690
|
{
|
|
16323
17691
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -16339,7 +17707,7 @@ function PaginationPrevious({
|
|
|
16339
17707
|
className,
|
|
16340
17708
|
...props
|
|
16341
17709
|
}) {
|
|
16342
|
-
return /* @__PURE__ */
|
|
17710
|
+
return /* @__PURE__ */ jsxs96(
|
|
16343
17711
|
PaginationLink,
|
|
16344
17712
|
{
|
|
16345
17713
|
"aria-label": "Go to previous page",
|
|
@@ -16347,8 +17715,8 @@ function PaginationPrevious({
|
|
|
16347
17715
|
className: cn("cn-pagination-previous gap-1", className),
|
|
16348
17716
|
...props,
|
|
16349
17717
|
children: [
|
|
16350
|
-
/* @__PURE__ */
|
|
16351
|
-
/* @__PURE__ */
|
|
17718
|
+
/* @__PURE__ */ jsx159(IconChevronLeft4, {}),
|
|
17719
|
+
/* @__PURE__ */ jsx159("span", { className: "hidden sm:block", children: "Previous" })
|
|
16352
17720
|
]
|
|
16353
17721
|
}
|
|
16354
17722
|
);
|
|
@@ -16357,7 +17725,7 @@ function PaginationNext({
|
|
|
16357
17725
|
className,
|
|
16358
17726
|
...props
|
|
16359
17727
|
}) {
|
|
16360
|
-
return /* @__PURE__ */
|
|
17728
|
+
return /* @__PURE__ */ jsxs96(
|
|
16361
17729
|
PaginationLink,
|
|
16362
17730
|
{
|
|
16363
17731
|
"aria-label": "Go to next page",
|
|
@@ -16365,8 +17733,8 @@ function PaginationNext({
|
|
|
16365
17733
|
className: cn("cn-pagination-next gap-1", className),
|
|
16366
17734
|
...props,
|
|
16367
17735
|
children: [
|
|
16368
|
-
/* @__PURE__ */
|
|
16369
|
-
/* @__PURE__ */
|
|
17736
|
+
/* @__PURE__ */ jsx159("span", { className: "hidden sm:block", children: "Next" }),
|
|
17737
|
+
/* @__PURE__ */ jsx159(IconChevronRight10, {})
|
|
16370
17738
|
]
|
|
16371
17739
|
}
|
|
16372
17740
|
);
|
|
@@ -16375,7 +17743,7 @@ function PaginationEllipsis({
|
|
|
16375
17743
|
className,
|
|
16376
17744
|
...props
|
|
16377
17745
|
}) {
|
|
16378
|
-
return /* @__PURE__ */
|
|
17746
|
+
return /* @__PURE__ */ jsxs96(
|
|
16379
17747
|
"span",
|
|
16380
17748
|
{
|
|
16381
17749
|
"aria-hidden": true,
|
|
@@ -16383,15 +17751,15 @@ function PaginationEllipsis({
|
|
|
16383
17751
|
className: cn("cn-pagination-ellipsis flex", className),
|
|
16384
17752
|
...props,
|
|
16385
17753
|
children: [
|
|
16386
|
-
/* @__PURE__ */
|
|
16387
|
-
/* @__PURE__ */
|
|
17754
|
+
/* @__PURE__ */ jsx159(IconDots2, { className: "size-4" }),
|
|
17755
|
+
/* @__PURE__ */ jsx159("span", { className: "sr-only", children: "More pages" })
|
|
16388
17756
|
]
|
|
16389
17757
|
}
|
|
16390
17758
|
);
|
|
16391
17759
|
}
|
|
16392
17760
|
|
|
16393
17761
|
// src/components/ui/paper.tsx
|
|
16394
|
-
import { jsx as
|
|
17762
|
+
import { jsx as jsx160 } from "react/jsx-runtime";
|
|
16395
17763
|
function Paper({
|
|
16396
17764
|
className,
|
|
16397
17765
|
padding = "md",
|
|
@@ -16424,7 +17792,7 @@ function Paper({
|
|
|
16424
17792
|
lg: "shadow-lg",
|
|
16425
17793
|
xl: "shadow-xl"
|
|
16426
17794
|
};
|
|
16427
|
-
return /* @__PURE__ */
|
|
17795
|
+
return /* @__PURE__ */ jsx160(
|
|
16428
17796
|
"div",
|
|
16429
17797
|
{
|
|
16430
17798
|
"data-slot": "paper",
|
|
@@ -16443,11 +17811,11 @@ function Paper({
|
|
|
16443
17811
|
|
|
16444
17812
|
// src/components/ui/password-input.tsx
|
|
16445
17813
|
import { IconEye, IconEyeOff } from "@tabler/icons-react";
|
|
16446
|
-
import { forwardRef as
|
|
16447
|
-
import { jsx as
|
|
16448
|
-
var PasswordInput =
|
|
17814
|
+
import { forwardRef as forwardRef10, useState as useState41 } from "react";
|
|
17815
|
+
import { jsx as jsx161, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
17816
|
+
var PasswordInput = forwardRef10(
|
|
16449
17817
|
({ className, showToggle = true, size, ...props }, ref) => {
|
|
16450
|
-
const [showPassword, setShowPassword] =
|
|
17818
|
+
const [showPassword, setShowPassword] = useState41(false);
|
|
16451
17819
|
const groupSizeClasses = {
|
|
16452
17820
|
xs: "h-7",
|
|
16453
17821
|
sm: "h-8",
|
|
@@ -16456,13 +17824,13 @@ var PasswordInput = forwardRef8(
|
|
|
16456
17824
|
xl: "h-12"
|
|
16457
17825
|
};
|
|
16458
17826
|
const iconButtonSize = size === "xs" || size === "sm" ? "icon-xs" : "icon-sm";
|
|
16459
|
-
return /* @__PURE__ */
|
|
17827
|
+
return /* @__PURE__ */ jsxs97(
|
|
16460
17828
|
InputGroup,
|
|
16461
17829
|
{
|
|
16462
17830
|
disabled: props.disabled,
|
|
16463
17831
|
className: cn(size && groupSizeClasses[size]),
|
|
16464
17832
|
children: [
|
|
16465
|
-
/* @__PURE__ */
|
|
17833
|
+
/* @__PURE__ */ jsx161(
|
|
16466
17834
|
InputGroupInput,
|
|
16467
17835
|
{
|
|
16468
17836
|
ref,
|
|
@@ -16471,7 +17839,7 @@ var PasswordInput = forwardRef8(
|
|
|
16471
17839
|
...props
|
|
16472
17840
|
}
|
|
16473
17841
|
),
|
|
16474
|
-
showToggle && /* @__PURE__ */
|
|
17842
|
+
showToggle && /* @__PURE__ */ jsx161(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx161(
|
|
16475
17843
|
InputGroupButton,
|
|
16476
17844
|
{
|
|
16477
17845
|
type: "button",
|
|
@@ -16482,7 +17850,7 @@ var PasswordInput = forwardRef8(
|
|
|
16482
17850
|
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
16483
17851
|
tabIndex: -1,
|
|
16484
17852
|
disabled: props.disabled,
|
|
16485
|
-
children: showPassword ? /* @__PURE__ */
|
|
17853
|
+
children: showPassword ? /* @__PURE__ */ jsx161(IconEyeOff, { className: "size-4" }) : /* @__PURE__ */ jsx161(IconEye, { className: "size-4" })
|
|
16486
17854
|
}
|
|
16487
17855
|
) })
|
|
16488
17856
|
]
|
|
@@ -16491,7 +17859,7 @@ var PasswordInput = forwardRef8(
|
|
|
16491
17859
|
}
|
|
16492
17860
|
);
|
|
16493
17861
|
PasswordInput.displayName = "PasswordInput";
|
|
16494
|
-
var PasswordInputWithWrapper =
|
|
17862
|
+
var PasswordInputWithWrapper = forwardRef10(
|
|
16495
17863
|
({
|
|
16496
17864
|
label,
|
|
16497
17865
|
description,
|
|
@@ -16507,11 +17875,11 @@ var PasswordInputWithWrapper = forwardRef8(
|
|
|
16507
17875
|
...passwordInputProps
|
|
16508
17876
|
}, ref) => {
|
|
16509
17877
|
const hasWrapper = label || description || error || required || withAsterisk;
|
|
16510
|
-
const passwordInput = /* @__PURE__ */
|
|
17878
|
+
const passwordInput = /* @__PURE__ */ jsx161(PasswordInput, { ref, disabled, ...passwordInputProps });
|
|
16511
17879
|
if (!hasWrapper) {
|
|
16512
17880
|
return passwordInput;
|
|
16513
17881
|
}
|
|
16514
|
-
return /* @__PURE__ */
|
|
17882
|
+
return /* @__PURE__ */ jsx161(
|
|
16515
17883
|
InputWrapper,
|
|
16516
17884
|
{
|
|
16517
17885
|
label,
|
|
@@ -16534,7 +17902,7 @@ PasswordInputWithWrapper.displayName = "PasswordInputWithWrapper";
|
|
|
16534
17902
|
|
|
16535
17903
|
// src/components/ui/pill.tsx
|
|
16536
17904
|
import { cva as cva22 } from "class-variance-authority";
|
|
16537
|
-
import { jsx as
|
|
17905
|
+
import { jsx as jsx162, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
16538
17906
|
var pillVariants = cva22(
|
|
16539
17907
|
"cn-pill inline-flex items-center gap-1 font-medium shrink-0 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-100",
|
|
16540
17908
|
{
|
|
@@ -16578,7 +17946,7 @@ function Pill({
|
|
|
16578
17946
|
disabled,
|
|
16579
17947
|
...props
|
|
16580
17948
|
}) {
|
|
16581
|
-
return /* @__PURE__ */
|
|
17949
|
+
return /* @__PURE__ */ jsxs98(
|
|
16582
17950
|
"span",
|
|
16583
17951
|
{
|
|
16584
17952
|
"data-slot": "pill",
|
|
@@ -16591,8 +17959,8 @@ function Pill({
|
|
|
16591
17959
|
),
|
|
16592
17960
|
...props,
|
|
16593
17961
|
children: [
|
|
16594
|
-
/* @__PURE__ */
|
|
16595
|
-
withRemoveButton && !disabled && /* @__PURE__ */
|
|
17962
|
+
/* @__PURE__ */ jsx162("span", { className: "truncate", children }),
|
|
17963
|
+
withRemoveButton && !disabled && /* @__PURE__ */ jsx162(
|
|
16596
17964
|
CloseButton,
|
|
16597
17965
|
{
|
|
16598
17966
|
size: "icon-xs",
|
|
@@ -16619,7 +17987,7 @@ function Pill({
|
|
|
16619
17987
|
|
|
16620
17988
|
// src/components/ui/progress.tsx
|
|
16621
17989
|
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
16622
|
-
import { jsx as
|
|
17990
|
+
import { jsx as jsx163 } from "react/jsx-runtime";
|
|
16623
17991
|
function Progress({
|
|
16624
17992
|
className,
|
|
16625
17993
|
value,
|
|
@@ -16636,7 +18004,7 @@ function Progress({
|
|
|
16636
18004
|
xl: "rounded-[var(--radius-xl)]",
|
|
16637
18005
|
full: "rounded-full"
|
|
16638
18006
|
};
|
|
16639
|
-
return /* @__PURE__ */
|
|
18007
|
+
return /* @__PURE__ */ jsx163(
|
|
16640
18008
|
ProgressPrimitive.Root,
|
|
16641
18009
|
{
|
|
16642
18010
|
"data-slot": "progress",
|
|
@@ -16648,7 +18016,7 @@ function Progress({
|
|
|
16648
18016
|
className
|
|
16649
18017
|
),
|
|
16650
18018
|
...props,
|
|
16651
|
-
children: /* @__PURE__ */
|
|
18019
|
+
children: /* @__PURE__ */ jsx163(
|
|
16652
18020
|
ProgressPrimitive.Track,
|
|
16653
18021
|
{
|
|
16654
18022
|
"data-slot": "progress-track",
|
|
@@ -16657,7 +18025,7 @@ function Progress({
|
|
|
16657
18025
|
"cn-progress-track h-full w-full",
|
|
16658
18026
|
radius && radiusClasses2[radius]
|
|
16659
18027
|
),
|
|
16660
|
-
children: /* @__PURE__ */
|
|
18028
|
+
children: /* @__PURE__ */ jsx163(
|
|
16661
18029
|
ProgressPrimitive.Indicator,
|
|
16662
18030
|
{
|
|
16663
18031
|
"data-slot": "progress-indicator",
|
|
@@ -16677,8 +18045,8 @@ import {
|
|
|
16677
18045
|
IconStarFilled,
|
|
16678
18046
|
IconStarHalfFilled
|
|
16679
18047
|
} from "@tabler/icons-react";
|
|
16680
|
-
import { useState as
|
|
16681
|
-
import { jsx as
|
|
18048
|
+
import { useState as useState42 } from "react";
|
|
18049
|
+
import { jsx as jsx164 } from "react/jsx-runtime";
|
|
16682
18050
|
function Rating({
|
|
16683
18051
|
count = 5,
|
|
16684
18052
|
value = 0,
|
|
@@ -16691,7 +18059,7 @@ function Rating({
|
|
|
16691
18059
|
className,
|
|
16692
18060
|
...props
|
|
16693
18061
|
}) {
|
|
16694
|
-
const [hoverValue, setHoverValue] =
|
|
18062
|
+
const [hoverValue, setHoverValue] = useState42(null);
|
|
16695
18063
|
const isDisabled = readOnly || disabled;
|
|
16696
18064
|
const sizeClasses6 = {
|
|
16697
18065
|
sm: "size-4",
|
|
@@ -16715,16 +18083,16 @@ function Rating({
|
|
|
16715
18083
|
};
|
|
16716
18084
|
const renderIcon = (filled, half) => {
|
|
16717
18085
|
if (filled) {
|
|
16718
|
-
return /* @__PURE__ */
|
|
18086
|
+
return /* @__PURE__ */ jsx164(IconStarFilled, { className: cn(sizeClasses6[size], color) });
|
|
16719
18087
|
}
|
|
16720
18088
|
if (half) {
|
|
16721
|
-
return /* @__PURE__ */
|
|
18089
|
+
return /* @__PURE__ */ jsx164(IconStarHalfFilled, { className: cn(sizeClasses6[size], color) });
|
|
16722
18090
|
}
|
|
16723
|
-
return /* @__PURE__ */
|
|
18091
|
+
return /* @__PURE__ */ jsx164(IconStar, { className: cn(sizeClasses6[size], "text-muted-foreground") });
|
|
16724
18092
|
};
|
|
16725
18093
|
return (
|
|
16726
18094
|
// biome-ignore lint/a11y/useSemanticElements: fieldset would affect layout
|
|
16727
|
-
/* @__PURE__ */
|
|
18095
|
+
/* @__PURE__ */ jsx164(
|
|
16728
18096
|
"div",
|
|
16729
18097
|
{
|
|
16730
18098
|
"data-slot": "rating",
|
|
@@ -16743,7 +18111,7 @@ function Rating({
|
|
|
16743
18111
|
const isFilled = displayValue >= index + 1;
|
|
16744
18112
|
const isHalf = displayValue >= index + 0.5 && displayValue < index + 1;
|
|
16745
18113
|
const StarWrapper = isDisabled ? "div" : "button";
|
|
16746
|
-
return /* @__PURE__ */
|
|
18114
|
+
return /* @__PURE__ */ jsx164(
|
|
16747
18115
|
StarWrapper,
|
|
16748
18116
|
{
|
|
16749
18117
|
type: isDisabled ? void 0 : "button",
|
|
@@ -16783,12 +18151,12 @@ function Rating({
|
|
|
16783
18151
|
|
|
16784
18152
|
// src/components/ui/resizable.tsx
|
|
16785
18153
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
16786
|
-
import { jsx as
|
|
18154
|
+
import { jsx as jsx165 } from "react/jsx-runtime";
|
|
16787
18155
|
function ResizablePanelGroup({
|
|
16788
18156
|
className,
|
|
16789
18157
|
...props
|
|
16790
18158
|
}) {
|
|
16791
|
-
return /* @__PURE__ */
|
|
18159
|
+
return /* @__PURE__ */ jsx165(
|
|
16792
18160
|
ResizablePrimitive.PanelGroup,
|
|
16793
18161
|
{
|
|
16794
18162
|
"data-slot": "resizable-panel-group",
|
|
@@ -16803,26 +18171,26 @@ function ResizablePanelGroup({
|
|
|
16803
18171
|
function ResizablePanel({
|
|
16804
18172
|
...props
|
|
16805
18173
|
}) {
|
|
16806
|
-
return /* @__PURE__ */
|
|
18174
|
+
return /* @__PURE__ */ jsx165(ResizablePrimitive.Panel, { "data-slot": "resizable-panel", ...props });
|
|
16807
18175
|
}
|
|
16808
18176
|
function ResizableHandle({
|
|
16809
18177
|
withHandle,
|
|
16810
18178
|
className,
|
|
16811
18179
|
...props
|
|
16812
18180
|
}) {
|
|
16813
|
-
return /* @__PURE__ */
|
|
18181
|
+
return /* @__PURE__ */ jsx165(
|
|
16814
18182
|
ResizablePrimitive.PanelResizeHandle,
|
|
16815
18183
|
{
|
|
16816
18184
|
"data-slot": "resizable-handle",
|
|
16817
18185
|
className: cn("cn-resizable-handle", className),
|
|
16818
18186
|
...props,
|
|
16819
|
-
children: withHandle && /* @__PURE__ */
|
|
18187
|
+
children: withHandle && /* @__PURE__ */ jsx165("div", { "aria-hidden": true, className: "cn-resizable-handle-icon" })
|
|
16820
18188
|
}
|
|
16821
18189
|
);
|
|
16822
18190
|
}
|
|
16823
18191
|
|
|
16824
18192
|
// src/components/ui/ring-progress.tsx
|
|
16825
|
-
import { jsx as
|
|
18193
|
+
import { jsx as jsx166, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
16826
18194
|
function RingProgress({
|
|
16827
18195
|
value,
|
|
16828
18196
|
size = 120,
|
|
@@ -16836,7 +18204,7 @@ function RingProgress({
|
|
|
16836
18204
|
const radius = (size - thickness) / 2;
|
|
16837
18205
|
const circumference = 2 * Math.PI * radius;
|
|
16838
18206
|
const offset = circumference - normalizedValue / 100 * circumference;
|
|
16839
|
-
return /* @__PURE__ */
|
|
18207
|
+
return /* @__PURE__ */ jsxs99(
|
|
16840
18208
|
"div",
|
|
16841
18209
|
{
|
|
16842
18210
|
"data-slot": "ring-progress",
|
|
@@ -16847,13 +18215,13 @@ function RingProgress({
|
|
|
16847
18215
|
style: { width: size, height: size },
|
|
16848
18216
|
...props,
|
|
16849
18217
|
children: [
|
|
16850
|
-
/* @__PURE__ */
|
|
16851
|
-
/* @__PURE__ */
|
|
18218
|
+
/* @__PURE__ */ jsxs99("svg", { width: size, height: size, className: "-rotate-90", "aria-hidden": "true", children: [
|
|
18219
|
+
/* @__PURE__ */ jsxs99("title", { children: [
|
|
16852
18220
|
"Progress: ",
|
|
16853
18221
|
normalizedValue,
|
|
16854
18222
|
"%"
|
|
16855
18223
|
] }),
|
|
16856
|
-
/* @__PURE__ */
|
|
18224
|
+
/* @__PURE__ */ jsx166(
|
|
16857
18225
|
"circle",
|
|
16858
18226
|
{
|
|
16859
18227
|
cx: size / 2,
|
|
@@ -16865,7 +18233,7 @@ function RingProgress({
|
|
|
16865
18233
|
className: "text-muted/40"
|
|
16866
18234
|
}
|
|
16867
18235
|
),
|
|
16868
|
-
/* @__PURE__ */
|
|
18236
|
+
/* @__PURE__ */ jsx166(
|
|
16869
18237
|
"circle",
|
|
16870
18238
|
{
|
|
16871
18239
|
cx: size / 2,
|
|
@@ -16881,14 +18249,14 @@ function RingProgress({
|
|
|
16881
18249
|
}
|
|
16882
18250
|
)
|
|
16883
18251
|
] }),
|
|
16884
|
-
label && /* @__PURE__ */
|
|
18252
|
+
label && /* @__PURE__ */ jsx166("div", { className: "absolute inset-0 flex items-center justify-center", children: typeof label === "string" ? /* @__PURE__ */ jsx166("span", { className: "text-foreground text-sm font-semibold", children: label }) : label })
|
|
16885
18253
|
]
|
|
16886
18254
|
}
|
|
16887
18255
|
);
|
|
16888
18256
|
}
|
|
16889
18257
|
|
|
16890
18258
|
// src/components/ui/semi-circle-progress.tsx
|
|
16891
|
-
import { jsx as
|
|
18259
|
+
import { jsx as jsx167, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
16892
18260
|
function SemiCircleProgress({
|
|
16893
18261
|
className,
|
|
16894
18262
|
value,
|
|
@@ -16902,7 +18270,7 @@ function SemiCircleProgress({
|
|
|
16902
18270
|
const radius = (size - thickness) / 2;
|
|
16903
18271
|
const circumference = Math.PI * radius;
|
|
16904
18272
|
const strokeDashoffset = circumference - normalizedValue / 100 * circumference;
|
|
16905
|
-
return /* @__PURE__ */
|
|
18273
|
+
return /* @__PURE__ */ jsxs100(
|
|
16906
18274
|
"div",
|
|
16907
18275
|
{
|
|
16908
18276
|
"data-slot": "semi-circle-progress",
|
|
@@ -16912,7 +18280,7 @@ function SemiCircleProgress({
|
|
|
16912
18280
|
),
|
|
16913
18281
|
...props,
|
|
16914
18282
|
children: [
|
|
16915
|
-
/* @__PURE__ */
|
|
18283
|
+
/* @__PURE__ */ jsxs100(
|
|
16916
18284
|
"svg",
|
|
16917
18285
|
{
|
|
16918
18286
|
width: size,
|
|
@@ -16922,12 +18290,12 @@ function SemiCircleProgress({
|
|
|
16922
18290
|
role: "img",
|
|
16923
18291
|
"aria-label": `Progress: ${Math.round(normalizedValue)}%`,
|
|
16924
18292
|
children: [
|
|
16925
|
-
/* @__PURE__ */
|
|
18293
|
+
/* @__PURE__ */ jsxs100("title", { children: [
|
|
16926
18294
|
"Progress: ",
|
|
16927
18295
|
Math.round(normalizedValue),
|
|
16928
18296
|
"%"
|
|
16929
18297
|
] }),
|
|
16930
|
-
/* @__PURE__ */
|
|
18298
|
+
/* @__PURE__ */ jsx167(
|
|
16931
18299
|
"path",
|
|
16932
18300
|
{
|
|
16933
18301
|
d: `M ${thickness / 2},${size / 2} A ${radius},${radius} 0 0,1 ${size - thickness / 2},${size / 2}`,
|
|
@@ -16937,7 +18305,7 @@ function SemiCircleProgress({
|
|
|
16937
18305
|
strokeLinecap: "round"
|
|
16938
18306
|
}
|
|
16939
18307
|
),
|
|
16940
|
-
/* @__PURE__ */
|
|
18308
|
+
/* @__PURE__ */ jsx167(
|
|
16941
18309
|
"path",
|
|
16942
18310
|
{
|
|
16943
18311
|
d: `M ${thickness / 2},${size / 2} A ${radius},${radius} 0 0,1 ${size - thickness / 2},${size / 2}`,
|
|
@@ -16955,7 +18323,7 @@ function SemiCircleProgress({
|
|
|
16955
18323
|
]
|
|
16956
18324
|
}
|
|
16957
18325
|
),
|
|
16958
|
-
label && /* @__PURE__ */
|
|
18326
|
+
label && /* @__PURE__ */ jsx167("div", { className: "cn-semi-circle-progress-label text-center", children: label })
|
|
16959
18327
|
]
|
|
16960
18328
|
}
|
|
16961
18329
|
);
|
|
@@ -16963,7 +18331,7 @@ function SemiCircleProgress({
|
|
|
16963
18331
|
|
|
16964
18332
|
// src/components/ui/simple-grid.tsx
|
|
16965
18333
|
import { cva as cva23 } from "class-variance-authority";
|
|
16966
|
-
import { jsx as
|
|
18334
|
+
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
16967
18335
|
var simpleGridVariants = cva23("grid w-full", {
|
|
16968
18336
|
variants: {
|
|
16969
18337
|
cols: {
|
|
@@ -17010,7 +18378,7 @@ function SimpleGrid({
|
|
|
17010
18378
|
"2xl": "2.5rem"
|
|
17011
18379
|
}[verticalSpacing] : void 0;
|
|
17012
18380
|
const gridTemplateColumns = minChildWidth ? `repeat(auto-fit, minmax(${typeof minChildWidth === "number" ? `${minChildWidth}px` : minChildWidth}, 1fr))` : void 0;
|
|
17013
|
-
return /* @__PURE__ */
|
|
18381
|
+
return /* @__PURE__ */ jsx168(
|
|
17014
18382
|
"div",
|
|
17015
18383
|
{
|
|
17016
18384
|
"data-slot": "simple-grid",
|
|
@@ -17031,7 +18399,7 @@ function SimpleGrid({
|
|
|
17031
18399
|
}
|
|
17032
18400
|
|
|
17033
18401
|
// src/components/ui/space.tsx
|
|
17034
|
-
import { jsx as
|
|
18402
|
+
import { jsx as jsx169 } from "react/jsx-runtime";
|
|
17035
18403
|
var sizeToRem = {
|
|
17036
18404
|
xs: "0.25rem",
|
|
17037
18405
|
sm: "0.5rem",
|
|
@@ -17063,7 +18431,7 @@ function Space({ className, h, w, style, ...props }) {
|
|
|
17063
18431
|
styleOut.width = wVal;
|
|
17064
18432
|
styleOut.minWidth = styleOut.minWidth ?? wVal;
|
|
17065
18433
|
}
|
|
17066
|
-
return /* @__PURE__ */
|
|
18434
|
+
return /* @__PURE__ */ jsx169(
|
|
17067
18435
|
"div",
|
|
17068
18436
|
{
|
|
17069
18437
|
"data-slot": "space",
|
|
@@ -17075,9 +18443,9 @@ function Space({ className, h, w, style, ...props }) {
|
|
|
17075
18443
|
}
|
|
17076
18444
|
|
|
17077
18445
|
// src/components/ui/spoiler.tsx
|
|
17078
|
-
import { IconChevronDown as
|
|
17079
|
-
import { useEffect as
|
|
17080
|
-
import { jsx as
|
|
18446
|
+
import { IconChevronDown as IconChevronDown15 } from "@tabler/icons-react";
|
|
18447
|
+
import { useEffect as useEffect19, useRef as useRef20, useState as useState43 } from "react";
|
|
18448
|
+
import { jsx as jsx170, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
17081
18449
|
function Spoiler({
|
|
17082
18450
|
maxHeight = 100,
|
|
17083
18451
|
showLabel = "Show more",
|
|
@@ -17087,10 +18455,10 @@ function Spoiler({
|
|
|
17087
18455
|
className,
|
|
17088
18456
|
...props
|
|
17089
18457
|
}) {
|
|
17090
|
-
const [isExpanded, setIsExpanded] =
|
|
17091
|
-
const [shouldShowButton, setShouldShowButton] =
|
|
17092
|
-
const contentRef =
|
|
17093
|
-
|
|
18458
|
+
const [isExpanded, setIsExpanded] = useState43(initialState);
|
|
18459
|
+
const [shouldShowButton, setShouldShowButton] = useState43(false);
|
|
18460
|
+
const contentRef = useRef20(null);
|
|
18461
|
+
useEffect19(() => {
|
|
17094
18462
|
const el = contentRef.current;
|
|
17095
18463
|
if (!el) {
|
|
17096
18464
|
return;
|
|
@@ -17107,14 +18475,14 @@ function Spoiler({
|
|
|
17107
18475
|
window.removeEventListener("resize", update);
|
|
17108
18476
|
};
|
|
17109
18477
|
}, [maxHeight]);
|
|
17110
|
-
return /* @__PURE__ */
|
|
18478
|
+
return /* @__PURE__ */ jsxs101(
|
|
17111
18479
|
"div",
|
|
17112
18480
|
{
|
|
17113
18481
|
"data-slot": "spoiler",
|
|
17114
18482
|
className: cn("cn-spoiler relative", className),
|
|
17115
18483
|
...props,
|
|
17116
18484
|
children: [
|
|
17117
|
-
/* @__PURE__ */
|
|
18485
|
+
/* @__PURE__ */ jsx170(
|
|
17118
18486
|
"div",
|
|
17119
18487
|
{
|
|
17120
18488
|
ref: contentRef,
|
|
@@ -17126,14 +18494,14 @@ function Spoiler({
|
|
|
17126
18494
|
children
|
|
17127
18495
|
}
|
|
17128
18496
|
),
|
|
17129
|
-
!isExpanded && shouldShowButton && /* @__PURE__ */
|
|
18497
|
+
!isExpanded && shouldShowButton && /* @__PURE__ */ jsx170(
|
|
17130
18498
|
"div",
|
|
17131
18499
|
{
|
|
17132
18500
|
"data-slot": "spoiler-fade",
|
|
17133
18501
|
className: "cn-spoiler-fade pointer-events-none absolute inset-x-0 bottom-0"
|
|
17134
18502
|
}
|
|
17135
18503
|
),
|
|
17136
|
-
shouldShowButton && /* @__PURE__ */
|
|
18504
|
+
shouldShowButton && /* @__PURE__ */ jsxs101(
|
|
17137
18505
|
Button,
|
|
17138
18506
|
{
|
|
17139
18507
|
variant: "ghost",
|
|
@@ -17142,8 +18510,8 @@ function Spoiler({
|
|
|
17142
18510
|
className: "mt-2 transition-colors",
|
|
17143
18511
|
children: [
|
|
17144
18512
|
isExpanded ? hideLabel : showLabel,
|
|
17145
|
-
/* @__PURE__ */
|
|
17146
|
-
|
|
18513
|
+
/* @__PURE__ */ jsx170(
|
|
18514
|
+
IconChevronDown15,
|
|
17147
18515
|
{
|
|
17148
18516
|
className: cn(
|
|
17149
18517
|
"size-4 transition-transform",
|
|
@@ -17160,7 +18528,7 @@ function Spoiler({
|
|
|
17160
18528
|
}
|
|
17161
18529
|
|
|
17162
18530
|
// src/components/ui/stack.tsx
|
|
17163
|
-
import { jsx as
|
|
18531
|
+
import { jsx as jsx171 } from "react/jsx-runtime";
|
|
17164
18532
|
function Stack({
|
|
17165
18533
|
className,
|
|
17166
18534
|
gap = "md",
|
|
@@ -17189,7 +18557,7 @@ function Stack({
|
|
|
17189
18557
|
between: "justify-between",
|
|
17190
18558
|
around: "justify-around"
|
|
17191
18559
|
};
|
|
17192
|
-
return /* @__PURE__ */
|
|
18560
|
+
return /* @__PURE__ */ jsx171(
|
|
17193
18561
|
"div",
|
|
17194
18562
|
{
|
|
17195
18563
|
"data-slot": "stack",
|
|
@@ -17209,7 +18577,7 @@ function Stack({
|
|
|
17209
18577
|
// src/components/ui/stepper.tsx
|
|
17210
18578
|
import { IconCheck as IconCheck9 } from "@tabler/icons-react";
|
|
17211
18579
|
import { createContext as createContext8, useContext as useContext9 } from "react";
|
|
17212
|
-
import { jsx as
|
|
18580
|
+
import { jsx as jsx172, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
17213
18581
|
var StepperContext = createContext8({
|
|
17214
18582
|
activeStep: 0,
|
|
17215
18583
|
orientation: "horizontal"
|
|
@@ -17222,7 +18590,7 @@ function Stepper({
|
|
|
17222
18590
|
children,
|
|
17223
18591
|
...props
|
|
17224
18592
|
}) {
|
|
17225
|
-
return /* @__PURE__ */
|
|
18593
|
+
return /* @__PURE__ */ jsx172(StepperContext.Provider, { value: { activeStep, orientation }, children: /* @__PURE__ */ jsx172(
|
|
17226
18594
|
"div",
|
|
17227
18595
|
{
|
|
17228
18596
|
"data-slot": "stepper",
|
|
@@ -17254,7 +18622,7 @@ function Step({
|
|
|
17254
18622
|
} else if (isActive) {
|
|
17255
18623
|
state = "active";
|
|
17256
18624
|
}
|
|
17257
|
-
return /* @__PURE__ */
|
|
18625
|
+
return /* @__PURE__ */ jsxs102(
|
|
17258
18626
|
"div",
|
|
17259
18627
|
{
|
|
17260
18628
|
"data-slot": "step",
|
|
@@ -17266,7 +18634,7 @@ function Step({
|
|
|
17266
18634
|
),
|
|
17267
18635
|
...props,
|
|
17268
18636
|
children: [
|
|
17269
|
-
/* @__PURE__ */
|
|
18637
|
+
/* @__PURE__ */ jsxs102(
|
|
17270
18638
|
"div",
|
|
17271
18639
|
{
|
|
17272
18640
|
className: cn(
|
|
@@ -17274,16 +18642,16 @@ function Step({
|
|
|
17274
18642
|
orientation === "horizontal" && "flex-col gap-2"
|
|
17275
18643
|
),
|
|
17276
18644
|
children: [
|
|
17277
|
-
/* @__PURE__ */
|
|
18645
|
+
/* @__PURE__ */ jsx172(
|
|
17278
18646
|
"div",
|
|
17279
18647
|
{
|
|
17280
18648
|
"data-slot": "step-indicator",
|
|
17281
18649
|
"data-state": state,
|
|
17282
18650
|
className: cn("cn-step-indicator"),
|
|
17283
|
-
children: isCompleted ? /* @__PURE__ */
|
|
18651
|
+
children: isCompleted ? /* @__PURE__ */ jsx172(IconCheck9, { className: "size-5" }) : /* @__PURE__ */ jsx172("span", { children: index + 1 })
|
|
17284
18652
|
}
|
|
17285
18653
|
),
|
|
17286
|
-
(label || description) && /* @__PURE__ */
|
|
18654
|
+
(label || description) && /* @__PURE__ */ jsxs102(
|
|
17287
18655
|
"div",
|
|
17288
18656
|
{
|
|
17289
18657
|
className: cn(
|
|
@@ -17291,15 +18659,15 @@ function Step({
|
|
|
17291
18659
|
orientation === "vertical" && "text-left"
|
|
17292
18660
|
),
|
|
17293
18661
|
children: [
|
|
17294
|
-
label && /* @__PURE__ */
|
|
17295
|
-
description && /* @__PURE__ */
|
|
18662
|
+
label && /* @__PURE__ */ jsx172("div", { className: cn("cn-step-label"), children: label }),
|
|
18663
|
+
description && /* @__PURE__ */ jsx172("div", { className: "cn-step-description", children: description })
|
|
17296
18664
|
]
|
|
17297
18665
|
}
|
|
17298
18666
|
)
|
|
17299
18667
|
]
|
|
17300
18668
|
}
|
|
17301
18669
|
),
|
|
17302
|
-
orientation === "horizontal" && !isLast && /* @__PURE__ */
|
|
18670
|
+
orientation === "horizontal" && !isLast && /* @__PURE__ */ jsx172(
|
|
17303
18671
|
"div",
|
|
17304
18672
|
{
|
|
17305
18673
|
"data-slot": "step-connector",
|
|
@@ -17307,7 +18675,7 @@ function Step({
|
|
|
17307
18675
|
className: cn("cn-step-connector")
|
|
17308
18676
|
}
|
|
17309
18677
|
),
|
|
17310
|
-
orientation === "vertical" && /* @__PURE__ */
|
|
18678
|
+
orientation === "vertical" && /* @__PURE__ */ jsx172("div", { className: "flex flex-1 flex-col gap-2", children })
|
|
17311
18679
|
]
|
|
17312
18680
|
}
|
|
17313
18681
|
);
|
|
@@ -17315,7 +18683,7 @@ function Step({
|
|
|
17315
18683
|
|
|
17316
18684
|
// src/components/ui/switch.tsx
|
|
17317
18685
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
17318
|
-
import { jsx as
|
|
18686
|
+
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
17319
18687
|
function mapSwitchSize(size) {
|
|
17320
18688
|
return size === "xs" || size === "sm" ? "sm" : "default";
|
|
17321
18689
|
}
|
|
@@ -17326,7 +18694,7 @@ function Switch({
|
|
|
17326
18694
|
...props
|
|
17327
18695
|
}) {
|
|
17328
18696
|
const mappedSize = mapSwitchSize(size);
|
|
17329
|
-
return /* @__PURE__ */
|
|
18697
|
+
return /* @__PURE__ */ jsx173(
|
|
17330
18698
|
SwitchPrimitive.Root,
|
|
17331
18699
|
{
|
|
17332
18700
|
"data-slot": "switch",
|
|
@@ -17338,7 +18706,7 @@ function Switch({
|
|
|
17338
18706
|
className
|
|
17339
18707
|
),
|
|
17340
18708
|
...props,
|
|
17341
|
-
children: /* @__PURE__ */
|
|
18709
|
+
children: /* @__PURE__ */ jsx173(
|
|
17342
18710
|
SwitchPrimitive.Thumb,
|
|
17343
18711
|
{
|
|
17344
18712
|
"data-slot": "switch-thumb",
|
|
@@ -17350,7 +18718,7 @@ function Switch({
|
|
|
17350
18718
|
}
|
|
17351
18719
|
|
|
17352
18720
|
// src/components/ui/table-of-contents.tsx
|
|
17353
|
-
import { jsx as
|
|
18721
|
+
import { jsx as jsx174 } from "react/jsx-runtime";
|
|
17354
18722
|
function TableOfContents({
|
|
17355
18723
|
className,
|
|
17356
18724
|
items,
|
|
@@ -17361,7 +18729,7 @@ function TableOfContents({
|
|
|
17361
18729
|
minDepth = 1,
|
|
17362
18730
|
...props
|
|
17363
18731
|
}) {
|
|
17364
|
-
return /* @__PURE__ */
|
|
18732
|
+
return /* @__PURE__ */ jsx174(
|
|
17365
18733
|
"nav",
|
|
17366
18734
|
{
|
|
17367
18735
|
"data-slot": "table-of-contents",
|
|
@@ -17372,7 +18740,7 @@ function TableOfContents({
|
|
|
17372
18740
|
const depth = item.depth ?? 1;
|
|
17373
18741
|
const paddingLeft = Math.max(0, depth - minDepth) * depthOffset;
|
|
17374
18742
|
const isActive = activeId === item.id;
|
|
17375
|
-
return /* @__PURE__ */
|
|
18743
|
+
return /* @__PURE__ */ jsx174(
|
|
17376
18744
|
UnstyledButton,
|
|
17377
18745
|
{
|
|
17378
18746
|
type: "button",
|
|
@@ -17394,8 +18762,8 @@ function TableOfContents({
|
|
|
17394
18762
|
|
|
17395
18763
|
// src/components/ui/tags-input.tsx
|
|
17396
18764
|
import { IconX as IconX13 } from "@tabler/icons-react";
|
|
17397
|
-
import { useState as
|
|
17398
|
-
import { jsx as
|
|
18765
|
+
import { useState as useState44 } from "react";
|
|
18766
|
+
import { jsx as jsx175, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
17399
18767
|
function TagsInput({
|
|
17400
18768
|
className,
|
|
17401
18769
|
value,
|
|
@@ -17408,8 +18776,8 @@ function TagsInput({
|
|
|
17408
18776
|
disabled = false,
|
|
17409
18777
|
...props
|
|
17410
18778
|
}) {
|
|
17411
|
-
const [internalValue, setInternalValue] =
|
|
17412
|
-
const [inputValue, setInputValue] =
|
|
18779
|
+
const [internalValue, setInternalValue] = useState44(defaultValue);
|
|
18780
|
+
const [inputValue, setInputValue] = useState44("");
|
|
17413
18781
|
const tags = value ?? internalValue;
|
|
17414
18782
|
const addTag = (tag) => {
|
|
17415
18783
|
const trimmed = tag.trim();
|
|
@@ -17453,21 +18821,21 @@ function TagsInput({
|
|
|
17453
18821
|
}
|
|
17454
18822
|
setInputValue(newValue);
|
|
17455
18823
|
};
|
|
17456
|
-
return /* @__PURE__ */
|
|
18824
|
+
return /* @__PURE__ */ jsxs103(
|
|
17457
18825
|
"div",
|
|
17458
18826
|
{
|
|
17459
18827
|
"data-slot": "tags-input",
|
|
17460
18828
|
className: cn("cn-tags-input cn-combobox-chips", className),
|
|
17461
18829
|
...props,
|
|
17462
18830
|
children: [
|
|
17463
|
-
tags.map((tag, index) => /* @__PURE__ */
|
|
18831
|
+
tags.map((tag, index) => /* @__PURE__ */ jsxs103(
|
|
17464
18832
|
"span",
|
|
17465
18833
|
{
|
|
17466
18834
|
"data-slot": "tags-input-tag",
|
|
17467
18835
|
className: "cn-combobox-chip",
|
|
17468
18836
|
children: [
|
|
17469
18837
|
tag,
|
|
17470
|
-
/* @__PURE__ */
|
|
18838
|
+
/* @__PURE__ */ jsxs103(
|
|
17471
18839
|
"button",
|
|
17472
18840
|
{
|
|
17473
18841
|
type: "button",
|
|
@@ -17476,8 +18844,8 @@ function TagsInput({
|
|
|
17476
18844
|
disabled,
|
|
17477
18845
|
className: "cn-combobox-chip-remove",
|
|
17478
18846
|
children: [
|
|
17479
|
-
/* @__PURE__ */
|
|
17480
|
-
/* @__PURE__ */
|
|
18847
|
+
/* @__PURE__ */ jsx175("span", { className: "sr-only", children: "Remove" }),
|
|
18848
|
+
/* @__PURE__ */ jsx175(IconX13, { className: "size-3" })
|
|
17481
18849
|
]
|
|
17482
18850
|
}
|
|
17483
18851
|
)
|
|
@@ -17485,7 +18853,7 @@ function TagsInput({
|
|
|
17485
18853
|
},
|
|
17486
18854
|
allowDuplicates ? `${tag}-${index}` : tag
|
|
17487
18855
|
)),
|
|
17488
|
-
/* @__PURE__ */
|
|
18856
|
+
/* @__PURE__ */ jsx175(
|
|
17489
18857
|
"input",
|
|
17490
18858
|
{
|
|
17491
18859
|
type: "text",
|
|
@@ -17503,9 +18871,9 @@ function TagsInput({
|
|
|
17503
18871
|
}
|
|
17504
18872
|
|
|
17505
18873
|
// src/components/ui/text-input.tsx
|
|
17506
|
-
import { forwardRef as
|
|
17507
|
-
import { jsx as
|
|
17508
|
-
var TextInput =
|
|
18874
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
18875
|
+
import { jsx as jsx176, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
18876
|
+
var TextInput = forwardRef11(
|
|
17509
18877
|
({
|
|
17510
18878
|
label,
|
|
17511
18879
|
description,
|
|
@@ -17533,14 +18901,14 @@ var TextInput = forwardRef9(
|
|
|
17533
18901
|
xl: "h-12"
|
|
17534
18902
|
};
|
|
17535
18903
|
const hasWrapper = label || description || error || required || withAsterisk;
|
|
17536
|
-
const inputElement = /* @__PURE__ */
|
|
18904
|
+
const inputElement = /* @__PURE__ */ jsxs104(
|
|
17537
18905
|
InputGroup,
|
|
17538
18906
|
{
|
|
17539
18907
|
disabled,
|
|
17540
18908
|
className: cn(size && groupSizeClasses[size]),
|
|
17541
18909
|
children: [
|
|
17542
|
-
leftSection && /* @__PURE__ */
|
|
17543
|
-
/* @__PURE__ */
|
|
18910
|
+
leftSection && /* @__PURE__ */ jsx176(InputGroupAddon, { align: "inline-start", className: "pointer-events-none", children: leftSection }),
|
|
18911
|
+
/* @__PURE__ */ jsx176(
|
|
17544
18912
|
InputGroupInput,
|
|
17545
18913
|
{
|
|
17546
18914
|
ref,
|
|
@@ -17551,7 +18919,7 @@ var TextInput = forwardRef9(
|
|
|
17551
18919
|
...inputProps
|
|
17552
18920
|
}
|
|
17553
18921
|
),
|
|
17554
|
-
rightSection && /* @__PURE__ */
|
|
18922
|
+
rightSection && /* @__PURE__ */ jsx176(
|
|
17555
18923
|
InputGroupAddon,
|
|
17556
18924
|
{
|
|
17557
18925
|
align: "inline-end",
|
|
@@ -17567,7 +18935,7 @@ var TextInput = forwardRef9(
|
|
|
17567
18935
|
if (!hasWrapper) {
|
|
17568
18936
|
return inputElement;
|
|
17569
18937
|
}
|
|
17570
|
-
return /* @__PURE__ */
|
|
18938
|
+
return /* @__PURE__ */ jsx176(
|
|
17571
18939
|
InputWrapper,
|
|
17572
18940
|
{
|
|
17573
18941
|
label,
|
|
@@ -17590,7 +18958,7 @@ TextInput.displayName = "TextInput";
|
|
|
17590
18958
|
|
|
17591
18959
|
// src/components/ui/theme-icon.tsx
|
|
17592
18960
|
import { cva as cva24 } from "class-variance-authority";
|
|
17593
|
-
import { jsx as
|
|
18961
|
+
import { jsx as jsx177 } from "react/jsx-runtime";
|
|
17594
18962
|
var themeIconVariants = cva24(
|
|
17595
18963
|
"cn-theme-icon inline-flex items-center justify-center shrink-0 transition-colors",
|
|
17596
18964
|
{
|
|
@@ -17723,7 +19091,7 @@ function ThemeIcon({
|
|
|
17723
19091
|
children,
|
|
17724
19092
|
...props
|
|
17725
19093
|
}) {
|
|
17726
|
-
return /* @__PURE__ */
|
|
19094
|
+
return /* @__PURE__ */ jsx177(
|
|
17727
19095
|
"div",
|
|
17728
19096
|
{
|
|
17729
19097
|
"data-slot": "theme-icon",
|
|
@@ -17738,9 +19106,9 @@ function ThemeIcon({
|
|
|
17738
19106
|
}
|
|
17739
19107
|
|
|
17740
19108
|
// src/components/ui/timeline.tsx
|
|
17741
|
-
import { jsx as
|
|
19109
|
+
import { jsx as jsx178 } from "react/jsx-runtime";
|
|
17742
19110
|
function Timeline({ className, ...props }) {
|
|
17743
|
-
return /* @__PURE__ */
|
|
19111
|
+
return /* @__PURE__ */ jsx178(
|
|
17744
19112
|
"ol",
|
|
17745
19113
|
{
|
|
17746
19114
|
"data-slot": "timeline",
|
|
@@ -17750,7 +19118,7 @@ function Timeline({ className, ...props }) {
|
|
|
17750
19118
|
);
|
|
17751
19119
|
}
|
|
17752
19120
|
function TimelineItem({ className, ...props }) {
|
|
17753
|
-
return /* @__PURE__ */
|
|
19121
|
+
return /* @__PURE__ */ jsx178(
|
|
17754
19122
|
"li",
|
|
17755
19123
|
{
|
|
17756
19124
|
"data-slot": "timeline-item",
|
|
@@ -17764,7 +19132,7 @@ function TimelineDot({
|
|
|
17764
19132
|
variant = "default",
|
|
17765
19133
|
...props
|
|
17766
19134
|
}) {
|
|
17767
|
-
return /* @__PURE__ */
|
|
19135
|
+
return /* @__PURE__ */ jsx178(
|
|
17768
19136
|
"div",
|
|
17769
19137
|
{
|
|
17770
19138
|
"data-slot": "timeline-dot",
|
|
@@ -17775,7 +19143,7 @@ function TimelineDot({
|
|
|
17775
19143
|
);
|
|
17776
19144
|
}
|
|
17777
19145
|
function TimelineContent({ className, ...props }) {
|
|
17778
|
-
return /* @__PURE__ */
|
|
19146
|
+
return /* @__PURE__ */ jsx178(
|
|
17779
19147
|
"div",
|
|
17780
19148
|
{
|
|
17781
19149
|
"data-slot": "timeline-content",
|
|
@@ -17789,13 +19157,13 @@ function TimelineTitle({
|
|
|
17789
19157
|
children,
|
|
17790
19158
|
...props
|
|
17791
19159
|
}) {
|
|
17792
|
-
return /* @__PURE__ */
|
|
19160
|
+
return /* @__PURE__ */ jsx178(
|
|
17793
19161
|
"h3",
|
|
17794
19162
|
{
|
|
17795
19163
|
"data-slot": "timeline-title",
|
|
17796
19164
|
className: cn("cn-timeline-title", className),
|
|
17797
19165
|
...props,
|
|
17798
|
-
children: children ?? /* @__PURE__ */
|
|
19166
|
+
children: children ?? /* @__PURE__ */ jsx178("span", { className: "sr-only", children: "Timeline item" })
|
|
17799
19167
|
}
|
|
17800
19168
|
);
|
|
17801
19169
|
}
|
|
@@ -17803,7 +19171,7 @@ function TimelineDescription({
|
|
|
17803
19171
|
className,
|
|
17804
19172
|
...props
|
|
17805
19173
|
}) {
|
|
17806
|
-
return /* @__PURE__ */
|
|
19174
|
+
return /* @__PURE__ */ jsx178(
|
|
17807
19175
|
"p",
|
|
17808
19176
|
{
|
|
17809
19177
|
"data-slot": "timeline-description",
|
|
@@ -17813,7 +19181,7 @@ function TimelineDescription({
|
|
|
17813
19181
|
);
|
|
17814
19182
|
}
|
|
17815
19183
|
function TimelineTime({ className, ...props }) {
|
|
17816
|
-
return /* @__PURE__ */
|
|
19184
|
+
return /* @__PURE__ */ jsx178(
|
|
17817
19185
|
"time",
|
|
17818
19186
|
{
|
|
17819
19187
|
"data-slot": "timeline-time",
|
|
@@ -17825,7 +19193,7 @@ function TimelineTime({ className, ...props }) {
|
|
|
17825
19193
|
|
|
17826
19194
|
// src/components/ui/title.tsx
|
|
17827
19195
|
import { cva as cva25 } from "class-variance-authority";
|
|
17828
|
-
import { jsx as
|
|
19196
|
+
import { jsx as jsx179 } from "react/jsx-runtime";
|
|
17829
19197
|
var titleVariants = cva25("font-semibold tracking-tight text-pretty", {
|
|
17830
19198
|
variants: {
|
|
17831
19199
|
order: {
|
|
@@ -17876,7 +19244,7 @@ function Title({
|
|
|
17876
19244
|
...props
|
|
17877
19245
|
}) {
|
|
17878
19246
|
const Component = `h${order}`;
|
|
17879
|
-
return /* @__PURE__ */
|
|
19247
|
+
return /* @__PURE__ */ jsx179(
|
|
17880
19248
|
Component,
|
|
17881
19249
|
{
|
|
17882
19250
|
"data-slot": "title",
|
|
@@ -17893,7 +19261,7 @@ function Title({
|
|
|
17893
19261
|
// src/components/ui/toggle.tsx
|
|
17894
19262
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
17895
19263
|
import { cva as cva26 } from "class-variance-authority";
|
|
17896
|
-
import { jsx as
|
|
19264
|
+
import { jsx as jsx180 } from "react/jsx-runtime";
|
|
17897
19265
|
var toggleVariants = cva26(
|
|
17898
19266
|
'cn-toggle inline-flex items-center justify-center gap-2 whitespace-nowrap border border-transparent outline-none transition-colors [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 [&_svg]:shrink-0',
|
|
17899
19267
|
{
|
|
@@ -17920,7 +19288,7 @@ function Toggle({
|
|
|
17920
19288
|
size,
|
|
17921
19289
|
...props
|
|
17922
19290
|
}) {
|
|
17923
|
-
return /* @__PURE__ */
|
|
19291
|
+
return /* @__PURE__ */ jsx180(
|
|
17924
19292
|
TogglePrimitive,
|
|
17925
19293
|
{
|
|
17926
19294
|
"data-slot": "toggle",
|
|
@@ -17934,7 +19302,7 @@ function Toggle({
|
|
|
17934
19302
|
import { Toggle as TogglePrimitive2 } from "@base-ui/react/toggle";
|
|
17935
19303
|
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
|
|
17936
19304
|
import * as React17 from "react";
|
|
17937
|
-
import { jsx as
|
|
19305
|
+
import { jsx as jsx181 } from "react/jsx-runtime";
|
|
17938
19306
|
var ToggleGroupContext = React17.createContext({
|
|
17939
19307
|
size: "default",
|
|
17940
19308
|
variant: "default",
|
|
@@ -17948,7 +19316,7 @@ function ToggleGroup({
|
|
|
17948
19316
|
children,
|
|
17949
19317
|
...props
|
|
17950
19318
|
}) {
|
|
17951
|
-
return /* @__PURE__ */
|
|
19319
|
+
return /* @__PURE__ */ jsx181(
|
|
17952
19320
|
ToggleGroupPrimitive,
|
|
17953
19321
|
{
|
|
17954
19322
|
"data-slot": "toggle-group",
|
|
@@ -17961,7 +19329,7 @@ function ToggleGroup({
|
|
|
17961
19329
|
className
|
|
17962
19330
|
),
|
|
17963
19331
|
...props,
|
|
17964
|
-
children: /* @__PURE__ */
|
|
19332
|
+
children: /* @__PURE__ */ jsx181(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children })
|
|
17965
19333
|
}
|
|
17966
19334
|
);
|
|
17967
19335
|
}
|
|
@@ -17973,7 +19341,7 @@ function ToggleGroupItem({
|
|
|
17973
19341
|
...props
|
|
17974
19342
|
}) {
|
|
17975
19343
|
const context = React17.useContext(ToggleGroupContext);
|
|
17976
|
-
return /* @__PURE__ */
|
|
19344
|
+
return /* @__PURE__ */ jsx181(
|
|
17977
19345
|
TogglePrimitive2,
|
|
17978
19346
|
{
|
|
17979
19347
|
"data-slot": "toggle-group-item",
|
|
@@ -17995,8 +19363,8 @@ function ToggleGroupItem({
|
|
|
17995
19363
|
}
|
|
17996
19364
|
|
|
17997
19365
|
// src/components/ui/transition.tsx
|
|
17998
|
-
import { useEffect as
|
|
17999
|
-
import { Fragment as
|
|
19366
|
+
import { useEffect as useEffect20, useState as useState45 } from "react";
|
|
19367
|
+
import { Fragment as Fragment27, jsx as jsx182 } from "react/jsx-runtime";
|
|
18000
19368
|
var TRANSITIONS = {
|
|
18001
19369
|
fade: {
|
|
18002
19370
|
in: { opacity: 1 },
|
|
@@ -18050,11 +19418,11 @@ var TRANSITIONS = {
|
|
|
18050
19418
|
}
|
|
18051
19419
|
};
|
|
18052
19420
|
function useTransitionState(mounted, duration, exitDuration, timingFunction, onEnter, onEntered, onExit, onExited, enterDelay, exitDelay) {
|
|
18053
|
-
const [status, setStatus] =
|
|
19421
|
+
const [status, setStatus] = useState45(
|
|
18054
19422
|
mounted ? "entered" : "exited"
|
|
18055
19423
|
);
|
|
18056
|
-
const [displayDuration, setDisplayDuration] =
|
|
18057
|
-
|
|
19424
|
+
const [displayDuration, setDisplayDuration] = useState45(duration);
|
|
19425
|
+
useEffect20(() => {
|
|
18058
19426
|
if (mounted) {
|
|
18059
19427
|
setDisplayDuration(duration);
|
|
18060
19428
|
const t12 = setTimeout(() => {
|
|
@@ -18136,7 +19504,7 @@ function Transition({
|
|
|
18136
19504
|
const t = TRANSITIONS[transition];
|
|
18137
19505
|
if (!t) {
|
|
18138
19506
|
if (mounted) {
|
|
18139
|
-
return /* @__PURE__ */
|
|
19507
|
+
return /* @__PURE__ */ jsx182(Fragment27, { children: children({}) });
|
|
18140
19508
|
}
|
|
18141
19509
|
if (keepMounted) {
|
|
18142
19510
|
return children({ display: "none" });
|
|
@@ -18162,13 +19530,13 @@ function Transition({
|
|
|
18162
19530
|
transitionDuration: `${d}ms`,
|
|
18163
19531
|
transitionTimingFunction: tf
|
|
18164
19532
|
};
|
|
18165
|
-
return /* @__PURE__ */
|
|
19533
|
+
return /* @__PURE__ */ jsx182(Fragment27, { children: children(styles) });
|
|
18166
19534
|
}
|
|
18167
19535
|
|
|
18168
19536
|
// src/components/ui/tree.tsx
|
|
18169
19537
|
import { IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
18170
|
-
import { useState as
|
|
18171
|
-
import { jsx as
|
|
19538
|
+
import { useState as useState46 } from "react";
|
|
19539
|
+
import { jsx as jsx183, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
18172
19540
|
function Tree({
|
|
18173
19541
|
className,
|
|
18174
19542
|
data,
|
|
@@ -18182,7 +19550,7 @@ function Tree({
|
|
|
18182
19550
|
renderNode,
|
|
18183
19551
|
...props
|
|
18184
19552
|
}) {
|
|
18185
|
-
const [internalExpanded, setInternalExpanded] =
|
|
19553
|
+
const [internalExpanded, setInternalExpanded] = useState46(
|
|
18186
19554
|
/* @__PURE__ */ new Set()
|
|
18187
19555
|
);
|
|
18188
19556
|
const expanded = expandedProp !== void 0 ? expandedProp : internalExpanded;
|
|
@@ -18204,14 +19572,14 @@ function Tree({
|
|
|
18204
19572
|
onSelectedValueChange?.(node.value);
|
|
18205
19573
|
}
|
|
18206
19574
|
};
|
|
18207
|
-
return /* @__PURE__ */
|
|
19575
|
+
return /* @__PURE__ */ jsx183(
|
|
18208
19576
|
"div",
|
|
18209
19577
|
{
|
|
18210
19578
|
"data-slot": "tree",
|
|
18211
19579
|
role: "tree",
|
|
18212
19580
|
className: cn("cn-tree", className),
|
|
18213
19581
|
...props,
|
|
18214
|
-
children: data.map((node) => /* @__PURE__ */
|
|
19582
|
+
children: data.map((node) => /* @__PURE__ */ jsx183(
|
|
18215
19583
|
TreeNode,
|
|
18216
19584
|
{
|
|
18217
19585
|
node,
|
|
@@ -18249,14 +19617,14 @@ function TreeNode({
|
|
|
18249
19617
|
hasChildren,
|
|
18250
19618
|
selected
|
|
18251
19619
|
}) ?? node.label;
|
|
18252
|
-
return /* @__PURE__ */
|
|
19620
|
+
return /* @__PURE__ */ jsxs105(
|
|
18253
19621
|
"div",
|
|
18254
19622
|
{
|
|
18255
19623
|
role: "treeitem",
|
|
18256
19624
|
tabIndex: 0,
|
|
18257
19625
|
"aria-expanded": hasChildren ? expanded : void 0,
|
|
18258
19626
|
children: [
|
|
18259
|
-
/* @__PURE__ */
|
|
19627
|
+
/* @__PURE__ */ jsxs105(
|
|
18260
19628
|
UnstyledButton,
|
|
18261
19629
|
{
|
|
18262
19630
|
type: "button",
|
|
@@ -18265,21 +19633,21 @@ function TreeNode({
|
|
|
18265
19633
|
style: { paddingLeft: `${level * levelOffset + 4}px` },
|
|
18266
19634
|
onClick: () => handleNodeClick(node, hasChildren),
|
|
18267
19635
|
children: [
|
|
18268
|
-
hasChildren ? /* @__PURE__ */
|
|
19636
|
+
hasChildren ? /* @__PURE__ */ jsx183(
|
|
18269
19637
|
"span",
|
|
18270
19638
|
{
|
|
18271
19639
|
className: cn(
|
|
18272
19640
|
"cn-tree-node-chevron text-muted-foreground flex shrink-0 transition-transform",
|
|
18273
19641
|
expanded && "rotate-90"
|
|
18274
19642
|
),
|
|
18275
|
-
children: /* @__PURE__ */
|
|
19643
|
+
children: /* @__PURE__ */ jsx183(IconChevronRight11, { className: "size-4" })
|
|
18276
19644
|
}
|
|
18277
|
-
) : /* @__PURE__ */
|
|
18278
|
-
/* @__PURE__ */
|
|
19645
|
+
) : /* @__PURE__ */ jsx183("span", { "aria-hidden": true, className: "cn-tree-node-spacer w-4 shrink-0" }),
|
|
19646
|
+
/* @__PURE__ */ jsx183("span", { className: "cn-tree-node-label min-w-0 flex-1 truncate", children: label })
|
|
18279
19647
|
]
|
|
18280
19648
|
}
|
|
18281
19649
|
),
|
|
18282
|
-
hasChildren && expanded && node.children && /* @__PURE__ */
|
|
19650
|
+
hasChildren && expanded && node.children && /* @__PURE__ */ jsx183("fieldset", { className: "cn-tree-node-children list-none border-0 p-0 m-0 min-w-0", children: node.children.map((child) => /* @__PURE__ */ jsx183(
|
|
18283
19651
|
TreeNode,
|
|
18284
19652
|
{
|
|
18285
19653
|
node: child,
|
|
@@ -18412,6 +19780,7 @@ export {
|
|
|
18412
19780
|
DataTableColumnHeader,
|
|
18413
19781
|
DataTablePagination,
|
|
18414
19782
|
DataTableViewOptions,
|
|
19783
|
+
DateTimePicker,
|
|
18415
19784
|
DeleteConfirmButton,
|
|
18416
19785
|
Dialog,
|
|
18417
19786
|
DialogClose,
|
|
@@ -18435,6 +19804,7 @@ export {
|
|
|
18435
19804
|
DrawerPortal,
|
|
18436
19805
|
DrawerTitle,
|
|
18437
19806
|
DrawerTrigger,
|
|
19807
|
+
DropdownButton,
|
|
18438
19808
|
DropdownMenu,
|
|
18439
19809
|
DropdownMenuCheckboxItem,
|
|
18440
19810
|
DropdownMenuContent,
|