shadcn-ui-react 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -31
- package/dist/index.cjs +565 -181
- package/dist/index.d.cts +77 -42
- package/dist/index.d.ts +77 -42
- package/dist/index.js +565 -186
- package/dist/style.css +145 -46
- package/package.json +18 -18
package/dist/index.js
CHANGED
|
@@ -3638,6 +3638,148 @@ function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false)
|
|
|
3638
3638
|
});
|
|
3639
3639
|
}
|
|
3640
3640
|
|
|
3641
|
+
// node_modules/react-day-picker/dist/esm/noonDateLib.js
|
|
3642
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
3643
|
+
var _a, _b;
|
|
3644
|
+
const { weekStartsOn, locale } = options;
|
|
3645
|
+
const fallbackWeekStartsOn = (_b = weekStartsOn != null ? weekStartsOn : (_a = locale == null ? void 0 : locale.options) == null ? void 0 : _a.weekStartsOn) != null ? _b : 0;
|
|
3646
|
+
const toNoonTZDate = (date) => {
|
|
3647
|
+
const normalizedDate = typeof date === "number" || typeof date === "string" ? new Date(date) : date;
|
|
3648
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
3649
|
+
};
|
|
3650
|
+
const toCalendarDate = (date) => {
|
|
3651
|
+
const zoned = toNoonTZDate(date);
|
|
3652
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
3653
|
+
};
|
|
3654
|
+
return {
|
|
3655
|
+
today: () => {
|
|
3656
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
3657
|
+
},
|
|
3658
|
+
newDate: (year, monthIndex, date) => {
|
|
3659
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
3660
|
+
},
|
|
3661
|
+
startOfDay: (date) => {
|
|
3662
|
+
return toNoonTZDate(date);
|
|
3663
|
+
},
|
|
3664
|
+
startOfWeek: (date, options2) => {
|
|
3665
|
+
var _a2;
|
|
3666
|
+
const base = toNoonTZDate(date);
|
|
3667
|
+
const weekStartsOnValue = (_a2 = options2 == null ? void 0 : options2.weekStartsOn) != null ? _a2 : fallbackWeekStartsOn;
|
|
3668
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
3669
|
+
base.setDate(base.getDate() - diff);
|
|
3670
|
+
return base;
|
|
3671
|
+
},
|
|
3672
|
+
startOfISOWeek: (date) => {
|
|
3673
|
+
const base = toNoonTZDate(date);
|
|
3674
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
3675
|
+
base.setDate(base.getDate() - diff);
|
|
3676
|
+
return base;
|
|
3677
|
+
},
|
|
3678
|
+
startOfMonth: (date) => {
|
|
3679
|
+
const base = toNoonTZDate(date);
|
|
3680
|
+
base.setDate(1);
|
|
3681
|
+
return base;
|
|
3682
|
+
},
|
|
3683
|
+
startOfYear: (date) => {
|
|
3684
|
+
const base = toNoonTZDate(date);
|
|
3685
|
+
base.setMonth(0, 1);
|
|
3686
|
+
return base;
|
|
3687
|
+
},
|
|
3688
|
+
endOfWeek: (date, options2) => {
|
|
3689
|
+
var _a2;
|
|
3690
|
+
const base = toNoonTZDate(date);
|
|
3691
|
+
const weekStartsOnValue = (_a2 = options2 == null ? void 0 : options2.weekStartsOn) != null ? _a2 : fallbackWeekStartsOn;
|
|
3692
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
3693
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
3694
|
+
base.setDate(base.getDate() + diff);
|
|
3695
|
+
return base;
|
|
3696
|
+
},
|
|
3697
|
+
endOfISOWeek: (date) => {
|
|
3698
|
+
const base = toNoonTZDate(date);
|
|
3699
|
+
const diff = (7 - base.getDay()) % 7;
|
|
3700
|
+
base.setDate(base.getDate() + diff);
|
|
3701
|
+
return base;
|
|
3702
|
+
},
|
|
3703
|
+
endOfMonth: (date) => {
|
|
3704
|
+
const base = toNoonTZDate(date);
|
|
3705
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
3706
|
+
return base;
|
|
3707
|
+
},
|
|
3708
|
+
endOfYear: (date) => {
|
|
3709
|
+
const base = toNoonTZDate(date);
|
|
3710
|
+
base.setMonth(11, 31);
|
|
3711
|
+
return base;
|
|
3712
|
+
},
|
|
3713
|
+
eachMonthOfInterval: (interval) => {
|
|
3714
|
+
const start = toNoonTZDate(interval.start);
|
|
3715
|
+
const end = toNoonTZDate(interval.end);
|
|
3716
|
+
const result = [];
|
|
3717
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
3718
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
3719
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
3720
|
+
result.push(new TZDate(cursor, timeZone));
|
|
3721
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
3722
|
+
}
|
|
3723
|
+
return result;
|
|
3724
|
+
},
|
|
3725
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
3726
|
+
// mutate the same TZDate, and return it.
|
|
3727
|
+
addDays: (date, amount) => {
|
|
3728
|
+
const base = toNoonTZDate(date);
|
|
3729
|
+
base.setDate(base.getDate() + amount);
|
|
3730
|
+
return base;
|
|
3731
|
+
},
|
|
3732
|
+
addWeeks: (date, amount) => {
|
|
3733
|
+
const base = toNoonTZDate(date);
|
|
3734
|
+
base.setDate(base.getDate() + amount * 7);
|
|
3735
|
+
return base;
|
|
3736
|
+
},
|
|
3737
|
+
addMonths: (date, amount) => {
|
|
3738
|
+
const base = toNoonTZDate(date);
|
|
3739
|
+
base.setMonth(base.getMonth() + amount);
|
|
3740
|
+
return base;
|
|
3741
|
+
},
|
|
3742
|
+
addYears: (date, amount) => {
|
|
3743
|
+
const base = toNoonTZDate(date);
|
|
3744
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
3745
|
+
return base;
|
|
3746
|
+
},
|
|
3747
|
+
eachYearOfInterval: (interval) => {
|
|
3748
|
+
const start = toNoonTZDate(interval.start);
|
|
3749
|
+
const end = toNoonTZDate(interval.end);
|
|
3750
|
+
const years = [];
|
|
3751
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
3752
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
3753
|
+
years.push(new TZDate(cursor, timeZone));
|
|
3754
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
3755
|
+
}
|
|
3756
|
+
return years;
|
|
3757
|
+
},
|
|
3758
|
+
getWeek: (date, options2) => {
|
|
3759
|
+
var _a2, _b2, _c, _d;
|
|
3760
|
+
const base = toCalendarDate(date);
|
|
3761
|
+
return getWeek(base, {
|
|
3762
|
+
weekStartsOn: (_a2 = options2 == null ? void 0 : options2.weekStartsOn) != null ? _a2 : fallbackWeekStartsOn,
|
|
3763
|
+
firstWeekContainsDate: (_d = (_c = options2 == null ? void 0 : options2.firstWeekContainsDate) != null ? _c : (_b2 = locale == null ? void 0 : locale.options) == null ? void 0 : _b2.firstWeekContainsDate) != null ? _d : 1
|
|
3764
|
+
});
|
|
3765
|
+
},
|
|
3766
|
+
getISOWeek: (date) => {
|
|
3767
|
+
const base = toCalendarDate(date);
|
|
3768
|
+
return getISOWeek(base);
|
|
3769
|
+
},
|
|
3770
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
3771
|
+
const left = toCalendarDate(dateLeft);
|
|
3772
|
+
const right = toCalendarDate(dateRight);
|
|
3773
|
+
return differenceInCalendarDays(left, right);
|
|
3774
|
+
},
|
|
3775
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
3776
|
+
const left = toCalendarDate(dateLeft);
|
|
3777
|
+
const right = toCalendarDate(dateRight);
|
|
3778
|
+
return differenceInCalendarMonths(left, right);
|
|
3779
|
+
}
|
|
3780
|
+
};
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3641
3783
|
// node_modules/react-day-picker/dist/esm/useAnimation.js
|
|
3642
3784
|
import { useLayoutEffect, useRef } from "react";
|
|
3643
3785
|
var asHtmlElement = (element) => {
|
|
@@ -4431,15 +4573,22 @@ function toTimeZone(date, timeZone) {
|
|
|
4431
4573
|
}
|
|
4432
4574
|
|
|
4433
4575
|
// node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js
|
|
4434
|
-
function
|
|
4576
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
4577
|
+
if (!noonSafe)
|
|
4578
|
+
return toTimeZone(date, timeZone);
|
|
4579
|
+
const zoned = toTimeZone(date, timeZone);
|
|
4580
|
+
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
4581
|
+
return new Date(noonZoned.getTime());
|
|
4582
|
+
}
|
|
4583
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
4435
4584
|
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
4436
4585
|
return matcher;
|
|
4437
4586
|
}
|
|
4438
4587
|
if (matcher instanceof Date) {
|
|
4439
|
-
return
|
|
4588
|
+
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
4440
4589
|
}
|
|
4441
4590
|
if (Array.isArray(matcher)) {
|
|
4442
|
-
return matcher.map((value) => value instanceof Date ?
|
|
4591
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
4443
4592
|
}
|
|
4444
4593
|
if (isDateRange(matcher)) {
|
|
4445
4594
|
return __spreadProps(__spreadValues({}, matcher), {
|
|
@@ -4449,30 +4598,30 @@ function convertMatcher(matcher, timeZone) {
|
|
|
4449
4598
|
}
|
|
4450
4599
|
if (isDateInterval(matcher)) {
|
|
4451
4600
|
return {
|
|
4452
|
-
before:
|
|
4453
|
-
after:
|
|
4601
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
4602
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe)
|
|
4454
4603
|
};
|
|
4455
4604
|
}
|
|
4456
4605
|
if (isDateAfterType(matcher)) {
|
|
4457
4606
|
return {
|
|
4458
|
-
after:
|
|
4607
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe)
|
|
4459
4608
|
};
|
|
4460
4609
|
}
|
|
4461
4610
|
if (isDateBeforeType(matcher)) {
|
|
4462
4611
|
return {
|
|
4463
|
-
before:
|
|
4612
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe)
|
|
4464
4613
|
};
|
|
4465
4614
|
}
|
|
4466
4615
|
return matcher;
|
|
4467
4616
|
}
|
|
4468
|
-
function convertMatchersToTimeZone(matchers, timeZone) {
|
|
4617
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
4469
4618
|
if (!matchers) {
|
|
4470
4619
|
return matchers;
|
|
4471
4620
|
}
|
|
4472
4621
|
if (Array.isArray(matchers)) {
|
|
4473
|
-
return matchers.map((matcher) => convertMatcher(matcher, timeZone));
|
|
4622
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
4474
4623
|
}
|
|
4475
|
-
return convertMatcher(matchers, timeZone);
|
|
4624
|
+
return convertMatcher(matchers, timeZone, noonSafe);
|
|
4476
4625
|
}
|
|
4477
4626
|
|
|
4478
4627
|
// node_modules/react-day-picker/dist/esm/DayPicker.js
|
|
@@ -4525,16 +4674,23 @@ function DayPicker(initialProps) {
|
|
|
4525
4674
|
}
|
|
4526
4675
|
}
|
|
4527
4676
|
const { components, formatters: formatters2, labels, dateLib, locale, classNames } = useMemo2(() => {
|
|
4677
|
+
var _a2;
|
|
4528
4678
|
const locale2 = __spreadValues(__spreadValues({}, enUS2), props.locale);
|
|
4679
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
4680
|
+
const noonOverrides = props.noonSafe && props.timeZone ? createNoonOverrides(props.timeZone, {
|
|
4681
|
+
weekStartsOn,
|
|
4682
|
+
locale: locale2
|
|
4683
|
+
}) : void 0;
|
|
4684
|
+
const overrides = props.dateLib && noonOverrides ? __spreadValues(__spreadValues({}, noonOverrides), props.dateLib) : (_a2 = props.dateLib) != null ? _a2 : noonOverrides;
|
|
4529
4685
|
const dateLib2 = new DateLib({
|
|
4530
4686
|
locale: locale2,
|
|
4531
|
-
weekStartsOn
|
|
4687
|
+
weekStartsOn,
|
|
4532
4688
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
4533
4689
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
4534
4690
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
4535
4691
|
timeZone: props.timeZone,
|
|
4536
4692
|
numerals: props.numerals
|
|
4537
|
-
},
|
|
4693
|
+
}, overrides);
|
|
4538
4694
|
return {
|
|
4539
4695
|
dateLib: dateLib2,
|
|
4540
4696
|
components: getComponents(props.components),
|
|
@@ -4553,6 +4709,7 @@ function DayPicker(initialProps) {
|
|
|
4553
4709
|
props.timeZone,
|
|
4554
4710
|
props.numerals,
|
|
4555
4711
|
props.dateLib,
|
|
4712
|
+
props.noonSafe,
|
|
4556
4713
|
props.components,
|
|
4557
4714
|
props.formatters,
|
|
4558
4715
|
props.labels,
|
|
@@ -5825,7 +5982,7 @@ var Input = React41.forwardRef(
|
|
|
5825
5982
|
]);
|
|
5826
5983
|
const base = "block w-full bg-transparent text-foreground placeholder:text-muted-foreground outline-none transition disabled:opacity-50 disabled:cursor-not-allowed";
|
|
5827
5984
|
const sizeCls = size === "sm" ? "h-9 px-3 text-sm" : size === "lg" ? "h-12 px-5 text-base" : "h-11 px-4 text-sm";
|
|
5828
|
-
const
|
|
5985
|
+
const variants4 = {
|
|
5829
5986
|
outline: "rounded-md border border-input bg-input backdrop-blur-sm shadow-sm hover:border-primary/60 focus:border-primary focus:ring-2 focus:ring-primary/20",
|
|
5830
5987
|
soft: "rounded-md border border-transparent bg-muted/60 hover:bg-muted shadow-sm focus:bg-input/80 focus:ring-2 focus:ring-primary/20",
|
|
5831
5988
|
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
@@ -5868,7 +6025,7 @@ var Input = React41.forwardRef(
|
|
|
5868
6025
|
disabled,
|
|
5869
6026
|
className: classNameDefault ? cn(
|
|
5870
6027
|
base,
|
|
5871
|
-
|
|
6028
|
+
variants4[variant],
|
|
5872
6029
|
variant === "flushed" ? specialSizeForFlushed : variant === "link" ? specialSizeForLink : sizeCls,
|
|
5873
6030
|
errorCls,
|
|
5874
6031
|
iconPadLeft,
|
|
@@ -5975,7 +6132,7 @@ var FormField = (_a) => {
|
|
|
5975
6132
|
Asterisk,
|
|
5976
6133
|
{
|
|
5977
6134
|
className: cn(
|
|
5978
|
-
"ml-
|
|
6135
|
+
"ml-px h-3 w-3 text-red-500",
|
|
5979
6136
|
requiredLabelClassName
|
|
5980
6137
|
)
|
|
5981
6138
|
}
|
|
@@ -6179,7 +6336,7 @@ var FormSelect = ({
|
|
|
6179
6336
|
Asterisk,
|
|
6180
6337
|
{
|
|
6181
6338
|
className: cn(
|
|
6182
|
-
"ml-
|
|
6339
|
+
"ml-1 h-3 w-3 text-red-500",
|
|
6183
6340
|
requiredLabelClassName
|
|
6184
6341
|
)
|
|
6185
6342
|
}
|
|
@@ -7014,12 +7171,9 @@ var ResizablePanelGroup = (_a) => {
|
|
|
7014
7171
|
"className"
|
|
7015
7172
|
]);
|
|
7016
7173
|
return /* @__PURE__ */ jsx29(
|
|
7017
|
-
ResizablePrimitive.
|
|
7174
|
+
ResizablePrimitive.Group,
|
|
7018
7175
|
__spreadValues({
|
|
7019
|
-
className: cn(
|
|
7020
|
-
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
7021
|
-
className
|
|
7022
|
-
)
|
|
7176
|
+
className: cn("flex h-full w-full aria-[orientation=vertical]:flex-col", className)
|
|
7023
7177
|
}, props)
|
|
7024
7178
|
);
|
|
7025
7179
|
};
|
|
@@ -7033,7 +7187,7 @@ var ResizableHandle = (_a) => {
|
|
|
7033
7187
|
"className"
|
|
7034
7188
|
]);
|
|
7035
7189
|
return /* @__PURE__ */ jsx29(
|
|
7036
|
-
ResizablePrimitive.
|
|
7190
|
+
ResizablePrimitive.Separator,
|
|
7037
7191
|
__spreadProps(__spreadValues({
|
|
7038
7192
|
className: cn(
|
|
7039
7193
|
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
@@ -7192,7 +7346,7 @@ var SelectContent = React54.forwardRef((_a, ref) => {
|
|
|
7192
7346
|
__spreadProps(__spreadValues({
|
|
7193
7347
|
ref,
|
|
7194
7348
|
className: cn(
|
|
7195
|
-
"relative z-50 max-h-96 min-w-
|
|
7349
|
+
"relative z-50 max-h-96 min-w-32 overflow-hidden bg-popover border border-border text-popover-foreground rounded-md shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
7196
7350
|
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
7197
7351
|
className
|
|
7198
7352
|
),
|
|
@@ -7205,7 +7359,7 @@ var SelectContent = React54.forwardRef((_a, ref) => {
|
|
|
7205
7359
|
{
|
|
7206
7360
|
className: cn(
|
|
7207
7361
|
"p-1",
|
|
7208
|
-
position === "popper" && "h-
|
|
7362
|
+
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
|
7209
7363
|
),
|
|
7210
7364
|
children
|
|
7211
7365
|
}
|
|
@@ -7234,7 +7388,7 @@ var SelectItem = React54.forwardRef((_a, ref) => {
|
|
|
7234
7388
|
__spreadProps(__spreadValues({
|
|
7235
7389
|
ref,
|
|
7236
7390
|
className: cn(
|
|
7237
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-
|
|
7391
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
7238
7392
|
className
|
|
7239
7393
|
)
|
|
7240
7394
|
}, props), {
|
|
@@ -7262,7 +7416,7 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
7262
7416
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
7263
7417
|
import * as React55 from "react";
|
|
7264
7418
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
7265
|
-
var
|
|
7419
|
+
var Separator6 = React55.forwardRef(
|
|
7266
7420
|
(_a, ref) => {
|
|
7267
7421
|
var _b = _a, { className, orientation = "horizontal", decorative = true } = _b, props = __objRest(_b, ["className", "orientation", "decorative"]);
|
|
7268
7422
|
return /* @__PURE__ */ jsx33(
|
|
@@ -7280,7 +7434,7 @@ var Separator5 = React55.forwardRef(
|
|
|
7280
7434
|
);
|
|
7281
7435
|
}
|
|
7282
7436
|
);
|
|
7283
|
-
|
|
7437
|
+
Separator6.displayName = SeparatorPrimitive.Root.displayName;
|
|
7284
7438
|
|
|
7285
7439
|
// src/components/sheet.tsx
|
|
7286
7440
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
@@ -7497,16 +7651,18 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
|
7497
7651
|
// src/components/table.tsx
|
|
7498
7652
|
import * as React59 from "react";
|
|
7499
7653
|
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
7500
|
-
var Table = React59.forwardRef(
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
"
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
});
|
|
7654
|
+
var Table = React59.forwardRef(
|
|
7655
|
+
(_a, ref) => {
|
|
7656
|
+
var _b = _a, { className, containerClassName } = _b, props = __objRest(_b, ["className", "containerClassName"]);
|
|
7657
|
+
return /* @__PURE__ */ jsx39("div", { className: cn("relative w-full overflow-auto", containerClassName), children: /* @__PURE__ */ jsx39(
|
|
7658
|
+
"table",
|
|
7659
|
+
__spreadValues({
|
|
7660
|
+
ref,
|
|
7661
|
+
className: cn("w-full caption-bottom text-sm", className)
|
|
7662
|
+
}, props)
|
|
7663
|
+
) });
|
|
7664
|
+
}
|
|
7665
|
+
);
|
|
7510
7666
|
Table.displayName = "Table";
|
|
7511
7667
|
var TableHeader = React59.forwardRef((_a, ref) => {
|
|
7512
7668
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
@@ -7559,7 +7715,7 @@ var TableHead = React59.forwardRef((_a, ref) => {
|
|
|
7559
7715
|
__spreadValues({
|
|
7560
7716
|
ref,
|
|
7561
7717
|
className: cn(
|
|
7562
|
-
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [
|
|
7718
|
+
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5",
|
|
7563
7719
|
className
|
|
7564
7720
|
)
|
|
7565
7721
|
}, props)
|
|
@@ -7573,7 +7729,7 @@ var TableCell = React59.forwardRef((_a, ref) => {
|
|
|
7573
7729
|
__spreadValues({
|
|
7574
7730
|
ref,
|
|
7575
7731
|
className: cn(
|
|
7576
|
-
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [
|
|
7732
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5",
|
|
7577
7733
|
className
|
|
7578
7734
|
)
|
|
7579
7735
|
}, props)
|
|
@@ -8026,11 +8182,9 @@ function Breadcrumbs({ items, className, classNameList }) {
|
|
|
8026
8182
|
}
|
|
8027
8183
|
|
|
8028
8184
|
// src/shared/data-table.tsx
|
|
8029
|
-
import React67, { useEffect as useEffect4 } from "react";
|
|
8030
|
-
import {
|
|
8031
|
-
|
|
8032
|
-
DoubleArrowRightIcon
|
|
8033
|
-
} from "@radix-ui/react-icons";
|
|
8185
|
+
import React67, { useEffect as useEffect4, useMemo as useMemo3 } from "react";
|
|
8186
|
+
import { AnimatePresence, motion as motion2 } from "framer-motion";
|
|
8187
|
+
import { DoubleArrowLeftIcon, DoubleArrowRightIcon } from "@radix-ui/react-icons";
|
|
8034
8188
|
import {
|
|
8035
8189
|
flexRender,
|
|
8036
8190
|
getCoreRowModel,
|
|
@@ -8062,16 +8216,36 @@ function DataTable({
|
|
|
8062
8216
|
tableClassName,
|
|
8063
8217
|
onPageChange,
|
|
8064
8218
|
onClick,
|
|
8065
|
-
onPageSizeChange
|
|
8219
|
+
onPageSizeChange,
|
|
8220
|
+
animate = true,
|
|
8221
|
+
stickyHeader = true,
|
|
8222
|
+
heightClassName = "h-[clamp(22rem,80vh,44rem)] supports-[height:100dvh]:h-[clamp(22rem,80dvh,44rem)]"
|
|
8066
8223
|
}) {
|
|
8224
|
+
const safePageCount = Math.max(pageCount != null ? pageCount : 1, 1);
|
|
8067
8225
|
const [pagination, setPagination] = React67.useState({
|
|
8068
8226
|
pageIndex: Math.max(page - 1, 0),
|
|
8069
8227
|
pageSize: perPage
|
|
8070
8228
|
});
|
|
8229
|
+
useEffect4(() => {
|
|
8230
|
+
setPagination((prev) => {
|
|
8231
|
+
const nextIndex = Math.max(page - 1, 0);
|
|
8232
|
+
const nextSize = perPage;
|
|
8233
|
+
if (prev.pageIndex === nextIndex && prev.pageSize === nextSize) return prev;
|
|
8234
|
+
return { pageIndex: nextIndex, pageSize: nextSize };
|
|
8235
|
+
});
|
|
8236
|
+
}, [page, perPage]);
|
|
8237
|
+
useEffect4(() => {
|
|
8238
|
+
setPagination((prev) => {
|
|
8239
|
+
const maxIndex = Math.max(safePageCount - 1, 0);
|
|
8240
|
+
const clamped = Math.min(prev.pageIndex, maxIndex);
|
|
8241
|
+
if (clamped === prev.pageIndex) return prev;
|
|
8242
|
+
return __spreadProps(__spreadValues({}, prev), { pageIndex: clamped });
|
|
8243
|
+
});
|
|
8244
|
+
}, [safePageCount]);
|
|
8071
8245
|
const table = useReactTable({
|
|
8072
8246
|
data,
|
|
8073
8247
|
columns,
|
|
8074
|
-
pageCount,
|
|
8248
|
+
pageCount: safePageCount,
|
|
8075
8249
|
getCoreRowModel: getCoreRowModel(),
|
|
8076
8250
|
getFilteredRowModel: getFilteredRowModel(),
|
|
8077
8251
|
state: { pagination },
|
|
@@ -8080,147 +8254,190 @@ function DataTable({
|
|
|
8080
8254
|
manualPagination: true,
|
|
8081
8255
|
manualFiltering: true
|
|
8082
8256
|
});
|
|
8083
|
-
const
|
|
8084
|
-
if (onClick) {
|
|
8085
|
-
onClick(row);
|
|
8086
|
-
}
|
|
8087
|
-
};
|
|
8257
|
+
const clickable = !!onClick;
|
|
8088
8258
|
useEffect4(() => {
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cellClassName, children: flexRender(
|
|
8107
|
-
cell.column.columnDef.cell,
|
|
8108
|
-
cell.getContext()
|
|
8109
|
-
) }, cell.id))
|
|
8110
|
-
},
|
|
8111
|
-
row.id
|
|
8112
|
-
)) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(
|
|
8113
|
-
TableCell,
|
|
8114
|
-
{
|
|
8115
|
-
colSpan: columns.length,
|
|
8116
|
-
className: "h-24 text-center",
|
|
8117
|
-
children: "No results."
|
|
8118
|
-
}
|
|
8119
|
-
) }) })
|
|
8120
|
-
] }),
|
|
8121
|
-
/* @__PURE__ */ jsx48(ScrollBar, { orientation: "horizontal" })
|
|
8122
|
-
] }),
|
|
8123
|
-
/* @__PURE__ */ jsxs23("div", { className: "border-t px-4 py-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
8124
|
-
/* @__PURE__ */ jsxs23("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
|
|
8125
|
-
isRowsSelected && /* @__PURE__ */ jsxs23("div", { className: "text-muted-foreground text-sm", children: [
|
|
8126
|
-
table.getFilteredSelectedRowModel().rows.length,
|
|
8127
|
-
" ",
|
|
8128
|
-
ofLabel,
|
|
8129
|
-
" ",
|
|
8130
|
-
table.getFilteredRowModel().rows.length,
|
|
8131
|
-
" ",
|
|
8132
|
-
rowsSelectedLabel
|
|
8133
|
-
] }),
|
|
8134
|
-
totalRows ? /* @__PURE__ */ jsxs23("div", { className: "text-sm text-muted-foreground", children: [
|
|
8135
|
-
"Total: ",
|
|
8136
|
-
totalRows,
|
|
8137
|
-
" registros"
|
|
8138
|
-
] }) : null
|
|
8139
|
-
] }),
|
|
8140
|
-
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-end", children: [
|
|
8141
|
-
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
|
|
8142
|
-
/* @__PURE__ */ jsx48("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
|
|
8259
|
+
onPageChange == null ? void 0 : onPageChange(pagination.pageIndex + 1);
|
|
8260
|
+
}, [pagination.pageIndex, onPageChange]);
|
|
8261
|
+
const pageKey = useMemo3(
|
|
8262
|
+
() => `${pagination.pageIndex}-${pagination.pageSize}-${data.length}`,
|
|
8263
|
+
[pagination.pageIndex, pagination.pageSize, data.length]
|
|
8264
|
+
);
|
|
8265
|
+
return /* @__PURE__ */ jsxs23(
|
|
8266
|
+
"div",
|
|
8267
|
+
{
|
|
8268
|
+
className: cn(
|
|
8269
|
+
"relative w-full overflow-hidden rounded-xl border bg-background/60 backdrop-blur supports-backdrop-filter:bg-background/40 shadow-sm",
|
|
8270
|
+
"flex flex-col",
|
|
8271
|
+
heightClassName,
|
|
8272
|
+
className
|
|
8273
|
+
),
|
|
8274
|
+
children: [
|
|
8275
|
+
/* @__PURE__ */ jsx48("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs23(ScrollArea, { className: "h-full", children: [
|
|
8143
8276
|
/* @__PURE__ */ jsxs23(
|
|
8144
|
-
|
|
8277
|
+
Table,
|
|
8145
8278
|
{
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
const newSize = Number(value);
|
|
8149
|
-
setPagination(__spreadProps(__spreadValues({}, pagination), {
|
|
8150
|
-
pageSize: newSize,
|
|
8151
|
-
pageIndex: 0
|
|
8152
|
-
}));
|
|
8153
|
-
if (onPageSizeChange) onPageSizeChange(newSize);
|
|
8154
|
-
},
|
|
8279
|
+
containerClassName: "overflow-visible",
|
|
8280
|
+
className: cn("w-full", tableClassName),
|
|
8155
8281
|
children: [
|
|
8156
|
-
/* @__PURE__ */ jsx48(
|
|
8157
|
-
|
|
8282
|
+
/* @__PURE__ */ jsx48(
|
|
8283
|
+
TableHeader,
|
|
8284
|
+
{
|
|
8285
|
+
className: cn(
|
|
8286
|
+
headerClassName,
|
|
8287
|
+
stickyHeader ? "sticky top-0 z-10 bg-background/80 backdrop-blur border-b" : ""
|
|
8288
|
+
),
|
|
8289
|
+
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx48(TableRow, { className: cn("hover:bg-transparent", rowClassName), children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx48(TableHead, { className: cn("whitespace-nowrap", headerClassName), children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }, headerGroup.id))
|
|
8290
|
+
}
|
|
8291
|
+
),
|
|
8292
|
+
animate ? /* @__PURE__ */ jsx48(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx48(
|
|
8293
|
+
motion2.tbody,
|
|
8294
|
+
{
|
|
8295
|
+
className: cn("[&_tr:last-child]:border-0", bodyClassName),
|
|
8296
|
+
initial: { opacity: 0, y: 6 },
|
|
8297
|
+
animate: { opacity: 1, y: 0 },
|
|
8298
|
+
exit: { opacity: 0, y: -6 },
|
|
8299
|
+
transition: { duration: 0.18 },
|
|
8300
|
+
children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx48(
|
|
8301
|
+
TableRow,
|
|
8302
|
+
{
|
|
8303
|
+
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
8304
|
+
onClick: () => onClick == null ? void 0 : onClick(row.original),
|
|
8305
|
+
className: cn(
|
|
8306
|
+
rowClassName,
|
|
8307
|
+
clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
|
|
8308
|
+
),
|
|
8309
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cellClassName, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
8310
|
+
},
|
|
8311
|
+
row.id
|
|
8312
|
+
)) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(TableCell, { colSpan: columns.length, className: "h-28 text-center text-muted-foreground", children: "No results." }) })
|
|
8313
|
+
},
|
|
8314
|
+
pageKey
|
|
8315
|
+
) }) : /* @__PURE__ */ jsx48(TableBody, { className: bodyClassName, children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx48(
|
|
8316
|
+
TableRow,
|
|
8317
|
+
{
|
|
8318
|
+
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
8319
|
+
onClick: () => onClick == null ? void 0 : onClick(row.original),
|
|
8320
|
+
className: cn(
|
|
8321
|
+
rowClassName,
|
|
8322
|
+
clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
|
|
8323
|
+
),
|
|
8324
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cn(cellClassName), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
8325
|
+
},
|
|
8326
|
+
row.id
|
|
8327
|
+
)) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(TableCell, { colSpan: columns.length, className: "h-28 text-center text-muted-foreground", children: "No results." }) }) })
|
|
8158
8328
|
]
|
|
8159
8329
|
}
|
|
8160
|
-
)
|
|
8161
|
-
] }),
|
|
8162
|
-
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
|
|
8163
|
-
/* @__PURE__ */ jsxs23("div", { className: "flex w-[110px] items-center justify-center text-sm font-medium", children: [
|
|
8164
|
-
pageLabel,
|
|
8165
|
-
" ",
|
|
8166
|
-
pagination.pageIndex + 1,
|
|
8167
|
-
" ",
|
|
8168
|
-
ofLabel,
|
|
8169
|
-
" ",
|
|
8170
|
-
pageCount
|
|
8171
|
-
] }),
|
|
8172
|
-
/* @__PURE__ */ jsx48(
|
|
8173
|
-
Button,
|
|
8174
|
-
{
|
|
8175
|
-
"aria-label": "Go to first page",
|
|
8176
|
-
variant: "outline",
|
|
8177
|
-
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
8178
|
-
onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), { pageIndex: 0 })),
|
|
8179
|
-
disabled: pagination.pageIndex === 0,
|
|
8180
|
-
children: /* @__PURE__ */ jsx48(DoubleArrowLeftIcon, { className: "h-4 w-4" })
|
|
8181
|
-
}
|
|
8182
|
-
),
|
|
8183
|
-
/* @__PURE__ */ jsx48(
|
|
8184
|
-
Button,
|
|
8185
|
-
{
|
|
8186
|
-
"aria-label": "Go to previous page",
|
|
8187
|
-
variant: "outline",
|
|
8188
|
-
className: "h-8 w-8 p-0",
|
|
8189
|
-
onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), {
|
|
8190
|
-
pageIndex: pagination.pageIndex - 1
|
|
8191
|
-
})),
|
|
8192
|
-
disabled: pagination.pageIndex === 0,
|
|
8193
|
-
children: /* @__PURE__ */ jsx48(ChevronLeftIcon2, { className: "h-4 w-4" })
|
|
8194
|
-
}
|
|
8195
|
-
),
|
|
8196
|
-
/* @__PURE__ */ jsx48(
|
|
8197
|
-
Button,
|
|
8198
|
-
{
|
|
8199
|
-
"aria-label": "Go to next page",
|
|
8200
|
-
variant: "outline",
|
|
8201
|
-
className: "h-8 w-8 p-0",
|
|
8202
|
-
onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), {
|
|
8203
|
-
pageIndex: pagination.pageIndex + 1
|
|
8204
|
-
})),
|
|
8205
|
-
disabled: pagination.pageIndex + 1 >= pageCount,
|
|
8206
|
-
children: /* @__PURE__ */ jsx48(ChevronRightIcon6, { className: "h-4 w-4" })
|
|
8207
|
-
}
|
|
8208
8330
|
),
|
|
8209
|
-
/* @__PURE__ */ jsx48(
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8331
|
+
/* @__PURE__ */ jsx48(ScrollBar, { orientation: "horizontal" })
|
|
8332
|
+
] }) }),
|
|
8333
|
+
/* @__PURE__ */ jsx48("div", { className: "border-t bg-background/70 backdrop-blur supports-backdrop-filter:bg-background/50", children: /* @__PURE__ */ jsx48("div", { className: "px-4 py-3", children: /* @__PURE__ */ jsxs23("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-[1fr_auto] sm:items-center", children: [
|
|
8334
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
|
|
8335
|
+
isRowsSelected && /* @__PURE__ */ jsxs23("div", { className: "text-muted-foreground text-sm", children: [
|
|
8336
|
+
table.getFilteredSelectedRowModel().rows.length,
|
|
8337
|
+
" ",
|
|
8338
|
+
ofLabel,
|
|
8339
|
+
" ",
|
|
8340
|
+
table.getFilteredRowModel().rows.length,
|
|
8341
|
+
" ",
|
|
8342
|
+
rowsSelectedLabel
|
|
8343
|
+
] }),
|
|
8344
|
+
typeof totalRows === "number" && /* @__PURE__ */ jsxs23("div", { className: "text-sm text-muted-foreground", children: [
|
|
8345
|
+
"Total: ",
|
|
8346
|
+
totalRows,
|
|
8347
|
+
" registros"
|
|
8348
|
+
] })
|
|
8349
|
+
] }),
|
|
8350
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:justify-end", children: [
|
|
8351
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
|
|
8352
|
+
/* @__PURE__ */ jsx48("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
|
|
8353
|
+
/* @__PURE__ */ jsxs23(
|
|
8354
|
+
Select2,
|
|
8355
|
+
{
|
|
8356
|
+
value: `${pagination.pageSize}`,
|
|
8357
|
+
onValueChange: (value) => {
|
|
8358
|
+
const newSize = Number(value);
|
|
8359
|
+
setPagination((p) => __spreadProps(__spreadValues({}, p), { pageSize: newSize, pageIndex: 0 }));
|
|
8360
|
+
onPageSizeChange == null ? void 0 : onPageSizeChange(newSize);
|
|
8361
|
+
onPageChange == null ? void 0 : onPageChange(1);
|
|
8362
|
+
},
|
|
8363
|
+
children: [
|
|
8364
|
+
/* @__PURE__ */ jsx48(SelectTrigger, { className: "h-8 w-21", children: /* @__PURE__ */ jsx48(SelectValue, { placeholder: pagination.pageSize }) }),
|
|
8365
|
+
/* @__PURE__ */ jsx48(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx48(SelectItem, { value: `${size}`, children: size }, size)) })
|
|
8366
|
+
]
|
|
8367
|
+
}
|
|
8368
|
+
)
|
|
8369
|
+
] }),
|
|
8370
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
|
|
8371
|
+
/* @__PURE__ */ jsxs23("div", { className: "hidden sm:flex min-w-35 items-center justify-center text-sm font-medium", children: [
|
|
8372
|
+
pageLabel,
|
|
8373
|
+
" ",
|
|
8374
|
+
pagination.pageIndex + 1,
|
|
8375
|
+
" ",
|
|
8376
|
+
ofLabel,
|
|
8377
|
+
" ",
|
|
8378
|
+
safePageCount
|
|
8379
|
+
] }),
|
|
8380
|
+
/* @__PURE__ */ jsx48(
|
|
8381
|
+
Button,
|
|
8382
|
+
{
|
|
8383
|
+
"aria-label": "Go to first page",
|
|
8384
|
+
variant: "outline",
|
|
8385
|
+
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
8386
|
+
onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: 0 })),
|
|
8387
|
+
disabled: pagination.pageIndex === 0,
|
|
8388
|
+
children: /* @__PURE__ */ jsx48(DoubleArrowLeftIcon, { className: "h-4 w-4" })
|
|
8389
|
+
}
|
|
8390
|
+
),
|
|
8391
|
+
/* @__PURE__ */ jsx48(
|
|
8392
|
+
Button,
|
|
8393
|
+
{
|
|
8394
|
+
"aria-label": "Go to previous page",
|
|
8395
|
+
variant: "outline",
|
|
8396
|
+
className: "h-8 w-8 p-0",
|
|
8397
|
+
onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: Math.max(p.pageIndex - 1, 0) })),
|
|
8398
|
+
disabled: pagination.pageIndex === 0,
|
|
8399
|
+
children: /* @__PURE__ */ jsx48(ChevronLeftIcon2, { className: "h-4 w-4" })
|
|
8400
|
+
}
|
|
8401
|
+
),
|
|
8402
|
+
/* @__PURE__ */ jsx48(
|
|
8403
|
+
Button,
|
|
8404
|
+
{
|
|
8405
|
+
"aria-label": "Go to next page",
|
|
8406
|
+
variant: "outline",
|
|
8407
|
+
className: "h-8 w-8 p-0",
|
|
8408
|
+
onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), {
|
|
8409
|
+
pageIndex: Math.min(p.pageIndex + 1, safePageCount - 1)
|
|
8410
|
+
})),
|
|
8411
|
+
disabled: pagination.pageIndex + 1 >= safePageCount,
|
|
8412
|
+
children: /* @__PURE__ */ jsx48(ChevronRightIcon6, { className: "h-4 w-4" })
|
|
8413
|
+
}
|
|
8414
|
+
),
|
|
8415
|
+
/* @__PURE__ */ jsx48(
|
|
8416
|
+
Button,
|
|
8417
|
+
{
|
|
8418
|
+
"aria-label": "Go to last page",
|
|
8419
|
+
variant: "outline",
|
|
8420
|
+
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
8421
|
+
onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: safePageCount - 1 })),
|
|
8422
|
+
disabled: pagination.pageIndex + 1 >= safePageCount,
|
|
8423
|
+
children: /* @__PURE__ */ jsx48(DoubleArrowRightIcon, { className: "h-4 w-4" })
|
|
8424
|
+
}
|
|
8425
|
+
)
|
|
8426
|
+
] }),
|
|
8427
|
+
/* @__PURE__ */ jsxs23("div", { className: "sm:hidden w-full text-center text-xs text-muted-foreground", children: [
|
|
8428
|
+
pageLabel,
|
|
8429
|
+
" ",
|
|
8430
|
+
pagination.pageIndex + 1,
|
|
8431
|
+
" ",
|
|
8432
|
+
ofLabel,
|
|
8433
|
+
" ",
|
|
8434
|
+
safePageCount
|
|
8435
|
+
] })
|
|
8436
|
+
] })
|
|
8437
|
+
] }) }) })
|
|
8438
|
+
]
|
|
8439
|
+
}
|
|
8440
|
+
);
|
|
8224
8441
|
}
|
|
8225
8442
|
|
|
8226
8443
|
// src/shared/data-table-skeleton.tsx
|
|
@@ -8235,10 +8452,10 @@ function DataTableSkeleton({
|
|
|
8235
8452
|
return /* @__PURE__ */ jsxs24("div", { className: "w-full space-y-3 overflow-auto", children: [
|
|
8236
8453
|
/* @__PURE__ */ jsxs24("div", { className: "flex w-full items-center justify-between space-x-2 overflow-auto p-1", children: [
|
|
8237
8454
|
/* @__PURE__ */ jsxs24("div", { className: "flex flex-1 items-center space-x-2 space-y-4", children: [
|
|
8238
|
-
searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-
|
|
8239
|
-
filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-
|
|
8455
|
+
searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-37.5 lg:w-62.5" }, i)) : null,
|
|
8456
|
+
filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-17.5 border-dashed" }, i)) : null
|
|
8240
8457
|
] }),
|
|
8241
|
-
showViewOptions ? /* @__PURE__ */ jsx49(Skeleton, { className: "ml-auto hidden h-7 w-
|
|
8458
|
+
showViewOptions ? /* @__PURE__ */ jsx49(Skeleton, { className: "ml-auto hidden h-7 w-17.5 lg:flex" }) : null
|
|
8242
8459
|
] }),
|
|
8243
8460
|
/* @__PURE__ */ jsx49("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs24(Table, { children: [
|
|
8244
8461
|
/* @__PURE__ */ jsx49(TableHeader, { children: Array.from({ length: 1 }).map((_, i) => /* @__PURE__ */ jsx49(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columnCount }).map((_2, i2) => /* @__PURE__ */ jsx49(TableHead, { children: /* @__PURE__ */ jsx49(Skeleton, { className: "h-6 w-full" }) }, i2)) }, i)) }),
|
|
@@ -8249,9 +8466,9 @@ function DataTableSkeleton({
|
|
|
8249
8466
|
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8", children: [
|
|
8250
8467
|
/* @__PURE__ */ jsxs24("div", { className: "flex items-center space-x-2", children: [
|
|
8251
8468
|
/* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-24" }),
|
|
8252
|
-
/* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-
|
|
8469
|
+
/* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-17.5" })
|
|
8253
8470
|
] }),
|
|
8254
|
-
/* @__PURE__ */ jsx49("div", { className: "flex w-
|
|
8471
|
+
/* @__PURE__ */ jsx49("div", { className: "flex w-25 items-center justify-center text-sm font-medium", children: /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-20" }) }),
|
|
8255
8472
|
/* @__PURE__ */ jsxs24("div", { className: "flex items-center space-x-2", children: [
|
|
8256
8473
|
/* @__PURE__ */ jsx49(Skeleton, { className: "hidden size-8 lg:block" }),
|
|
8257
8474
|
/* @__PURE__ */ jsx49(Skeleton, { className: "size-8" }),
|
|
@@ -8477,6 +8694,166 @@ function Dropzone({
|
|
|
8477
8694
|
] }, idx)) })
|
|
8478
8695
|
] });
|
|
8479
8696
|
}
|
|
8697
|
+
|
|
8698
|
+
// src/types/select.ts
|
|
8699
|
+
var inputVariants2 = {
|
|
8700
|
+
outline: "rounded-md border border-input bg-input backdrop-blur-sm shadow-sm hover:border-primary/60 focus:border-primary focus:ring-2 focus:ring-primary/20",
|
|
8701
|
+
soft: "rounded-md border border-transparent bg-muted/60 hover:bg-muted shadow-sm focus:bg-input/80 focus:ring-2 focus:ring-primary/20",
|
|
8702
|
+
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
8703
|
+
filled: "rounded-md border border-input bg-muted/70 hover:bg-muted shadow-inner focus:bg-input/70 focus:ring-2 focus:ring-primary/20",
|
|
8704
|
+
// sin bordes laterales/superior, solo inferior; sin sombras ni radios
|
|
8705
|
+
flushed: "rounded-none border-0 border-b border-input px-0 shadow-none focus:border-b-2 focus:border-primary focus:ring-0",
|
|
8706
|
+
// sin estilos, útil para inputs embebidos o controles muy custom
|
|
8707
|
+
unstyled: "border-0 shadow-none focus:ring-0",
|
|
8708
|
+
// aspecto tipo enlace: inline height-auto, sin paddings ni borde
|
|
8709
|
+
link: "border-0 p-0 h-auto shadow-none bg-transparent text-primary underline-offset-4 focus:underline focus:ring-0"
|
|
8710
|
+
};
|
|
8711
|
+
var variants2 = inputVariants2;
|
|
8712
|
+
|
|
8713
|
+
// src/components/ui/select.tsx
|
|
8714
|
+
import { jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
8715
|
+
function UiSelect({
|
|
8716
|
+
ref,
|
|
8717
|
+
label,
|
|
8718
|
+
placeholder,
|
|
8719
|
+
value,
|
|
8720
|
+
onChange,
|
|
8721
|
+
items,
|
|
8722
|
+
children,
|
|
8723
|
+
className,
|
|
8724
|
+
selectClassName,
|
|
8725
|
+
labelClassName,
|
|
8726
|
+
contentClassName,
|
|
8727
|
+
size = "md",
|
|
8728
|
+
variant = "outline",
|
|
8729
|
+
errorMessage,
|
|
8730
|
+
htmlFormItemId: formItemId
|
|
8731
|
+
}) {
|
|
8732
|
+
const triggerBase = "relative inline-flex w-full items-center justify-between outline-none transition disabled:opacity-50 disabled:cursor-not-allowed text-foreground placeholder:text-muted-foreground ring-offset-background";
|
|
8733
|
+
const sizeTrigger = {
|
|
8734
|
+
sm: "h-9 px-3 text-sm",
|
|
8735
|
+
md: "h-11 px-4 text-sm",
|
|
8736
|
+
lg: "h-12 px-5 text-base"
|
|
8737
|
+
};
|
|
8738
|
+
const specialFlushed = variant === "flushed" ? size === "sm" ? "h-9 text-sm" : size === "lg" ? "h-12 text-base" : "h-11 text-sm" : "";
|
|
8739
|
+
const specialLink = variant === "link" ? "text-sm" : "";
|
|
8740
|
+
const contentBase = "bg-popover text-popover-foreground border border-border rounded-md shadow-md";
|
|
8741
|
+
const itemSize = {
|
|
8742
|
+
sm: "h-8 text-sm",
|
|
8743
|
+
md: "h-9 text-sm",
|
|
8744
|
+
lg: "h-10 text-base"
|
|
8745
|
+
};
|
|
8746
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("w-full", selectClassName), children: [
|
|
8747
|
+
label ? /* @__PURE__ */ jsx55(
|
|
8748
|
+
Label3,
|
|
8749
|
+
{
|
|
8750
|
+
ref,
|
|
8751
|
+
className: cn(errorMessage && "text-destructive", labelClassName),
|
|
8752
|
+
htmlFor: formItemId,
|
|
8753
|
+
children: label
|
|
8754
|
+
}
|
|
8755
|
+
) : null,
|
|
8756
|
+
/* @__PURE__ */ jsxs30(Select2, { value, onValueChange: onChange, children: [
|
|
8757
|
+
/* @__PURE__ */ jsx55(
|
|
8758
|
+
SelectTrigger,
|
|
8759
|
+
{
|
|
8760
|
+
className: cn(
|
|
8761
|
+
triggerBase,
|
|
8762
|
+
variants2[variant],
|
|
8763
|
+
variant === "flushed" ? specialFlushed : variant === "link" ? specialLink : sizeTrigger[size],
|
|
8764
|
+
errorMessage && "ring-destructive focus:ring-destructive/40 border-destructive",
|
|
8765
|
+
className,
|
|
8766
|
+
label ? "mt-1" : ""
|
|
8767
|
+
),
|
|
8768
|
+
children: /* @__PURE__ */ jsx55(SelectValue, { placeholder })
|
|
8769
|
+
}
|
|
8770
|
+
),
|
|
8771
|
+
/* @__PURE__ */ jsx55(SelectContent, { className: cn(contentBase, contentClassName), children: children ? children : items ? items == null ? void 0 : items.map((item) => /* @__PURE__ */ jsx55(
|
|
8772
|
+
SelectItem,
|
|
8773
|
+
{
|
|
8774
|
+
value: item.value,
|
|
8775
|
+
className: cn(itemSize[size]),
|
|
8776
|
+
children: item.label
|
|
8777
|
+
},
|
|
8778
|
+
item.value
|
|
8779
|
+
)) : null })
|
|
8780
|
+
] }),
|
|
8781
|
+
errorMessage ? /* @__PURE__ */ jsx55("p", { className: "text-sm text-destructive mt-1 ", children: errorMessage }) : null
|
|
8782
|
+
] });
|
|
8783
|
+
}
|
|
8784
|
+
|
|
8785
|
+
// src/types/input.ts
|
|
8786
|
+
var inputVariants3 = {
|
|
8787
|
+
outline: "rounded-md border border-input bg-input backdrop-blur-sm shadow-sm hover:border-primary/60 focus:border-primary focus:ring-2 focus:ring-primary/20",
|
|
8788
|
+
// default variant
|
|
8789
|
+
soft: "rounded-md border border-transparent bg-muted/60 hover:bg-muted shadow-sm focus:bg-input/80 focus:ring-2 focus:ring-primary/20",
|
|
8790
|
+
// similar to 'filled' but lighter
|
|
8791
|
+
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
8792
|
+
// no background, just hover/focus effect
|
|
8793
|
+
filled: "rounded-md border border-input bg-muted/70 hover:bg-muted shadow-inner focus:bg-input/70 focus:ring-2 focus:ring-primary/20",
|
|
8794
|
+
// solid background, inset shadow
|
|
8795
|
+
flushed: "rounded-none border-0 border-b border-input px-0 shadow-none focus:border-b-2 focus:border-primary focus:ring-0",
|
|
8796
|
+
// no lateral/top borders, only bottom; no shadows or rounding
|
|
8797
|
+
unstyled: "border-0 shadow-none focus:ring-0",
|
|
8798
|
+
// no styles, useful for embedded inputs or very custom controls
|
|
8799
|
+
link: "border-0 p-0 h-auto shadow-none bg-transparent text-primary underline-offset-4 focus:underline focus:ring-0"
|
|
8800
|
+
};
|
|
8801
|
+
var variants3 = inputVariants3;
|
|
8802
|
+
|
|
8803
|
+
// src/components/ui/input.tsx
|
|
8804
|
+
import { jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
8805
|
+
function UiInput(_a) {
|
|
8806
|
+
var _b = _a, {
|
|
8807
|
+
ref,
|
|
8808
|
+
label,
|
|
8809
|
+
placeholder,
|
|
8810
|
+
onChange,
|
|
8811
|
+
className,
|
|
8812
|
+
classNameDefault,
|
|
8813
|
+
labelClassName,
|
|
8814
|
+
inputClassName,
|
|
8815
|
+
variant = "outline",
|
|
8816
|
+
errorMessage,
|
|
8817
|
+
htmlFormItemId: formItemId
|
|
8818
|
+
} = _b, inputProps = __objRest(_b, [
|
|
8819
|
+
"ref",
|
|
8820
|
+
"label",
|
|
8821
|
+
"placeholder",
|
|
8822
|
+
"onChange",
|
|
8823
|
+
"className",
|
|
8824
|
+
"classNameDefault",
|
|
8825
|
+
"labelClassName",
|
|
8826
|
+
"inputClassName",
|
|
8827
|
+
"variant",
|
|
8828
|
+
"errorMessage",
|
|
8829
|
+
"htmlFormItemId"
|
|
8830
|
+
]);
|
|
8831
|
+
return /* @__PURE__ */ jsxs31("div", { className: cn("w-full", inputClassName), children: [
|
|
8832
|
+
label ? /* @__PURE__ */ jsx56(
|
|
8833
|
+
Label3,
|
|
8834
|
+
{
|
|
8835
|
+
ref,
|
|
8836
|
+
className: cn(errorMessage && "text-destructive", labelClassName),
|
|
8837
|
+
htmlFor: formItemId,
|
|
8838
|
+
children: label
|
|
8839
|
+
}
|
|
8840
|
+
) : null,
|
|
8841
|
+
/* @__PURE__ */ jsx56(
|
|
8842
|
+
Input,
|
|
8843
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
8844
|
+
onChange,
|
|
8845
|
+
placeholder,
|
|
8846
|
+
className: cn(
|
|
8847
|
+
"bg-input px-[0.9rem] py-5",
|
|
8848
|
+
className,
|
|
8849
|
+
variants3[variant]
|
|
8850
|
+
),
|
|
8851
|
+
classNameDefault
|
|
8852
|
+
})
|
|
8853
|
+
),
|
|
8854
|
+
errorMessage ? /* @__PURE__ */ jsx56("p", { className: "text-sm text-destructive mt-1 ", children: errorMessage }) : null
|
|
8855
|
+
] });
|
|
8856
|
+
}
|
|
8480
8857
|
export {
|
|
8481
8858
|
Accordion,
|
|
8482
8859
|
AccordionContent,
|
|
@@ -8658,7 +9035,7 @@ export {
|
|
|
8658
9035
|
SelectSeparator,
|
|
8659
9036
|
SelectTrigger,
|
|
8660
9037
|
SelectValue,
|
|
8661
|
-
|
|
9038
|
+
Separator6 as Separator,
|
|
8662
9039
|
Sheet,
|
|
8663
9040
|
SheetClose,
|
|
8664
9041
|
SheetContent,
|
|
@@ -8700,6 +9077,8 @@ export {
|
|
|
8700
9077
|
TooltipContent,
|
|
8701
9078
|
TooltipProvider,
|
|
8702
9079
|
TooltipTrigger,
|
|
9080
|
+
UiInput,
|
|
9081
|
+
UiSelect,
|
|
8703
9082
|
badgeVariants,
|
|
8704
9083
|
buttonVariants,
|
|
8705
9084
|
cn,
|