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.cjs
CHANGED
|
@@ -239,7 +239,7 @@ __export(index_exports, {
|
|
|
239
239
|
SelectSeparator: () => SelectSeparator,
|
|
240
240
|
SelectTrigger: () => SelectTrigger,
|
|
241
241
|
SelectValue: () => SelectValue,
|
|
242
|
-
Separator: () =>
|
|
242
|
+
Separator: () => Separator6,
|
|
243
243
|
Sheet: () => Sheet,
|
|
244
244
|
SheetClose: () => SheetClose,
|
|
245
245
|
SheetContent: () => SheetContent,
|
|
@@ -281,6 +281,8 @@ __export(index_exports, {
|
|
|
281
281
|
TooltipContent: () => TooltipContent,
|
|
282
282
|
TooltipProvider: () => TooltipProvider,
|
|
283
283
|
TooltipTrigger: () => TooltipTrigger,
|
|
284
|
+
UiInput: () => UiInput,
|
|
285
|
+
UiSelect: () => UiSelect,
|
|
284
286
|
badgeVariants: () => badgeVariants,
|
|
285
287
|
buttonVariants: () => buttonVariants,
|
|
286
288
|
cn: () => cn,
|
|
@@ -3899,6 +3901,148 @@ function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false)
|
|
|
3899
3901
|
});
|
|
3900
3902
|
}
|
|
3901
3903
|
|
|
3904
|
+
// node_modules/react-day-picker/dist/esm/noonDateLib.js
|
|
3905
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
3906
|
+
var _a, _b;
|
|
3907
|
+
const { weekStartsOn, locale } = options;
|
|
3908
|
+
const fallbackWeekStartsOn = (_b = weekStartsOn != null ? weekStartsOn : (_a = locale == null ? void 0 : locale.options) == null ? void 0 : _a.weekStartsOn) != null ? _b : 0;
|
|
3909
|
+
const toNoonTZDate = (date) => {
|
|
3910
|
+
const normalizedDate = typeof date === "number" || typeof date === "string" ? new Date(date) : date;
|
|
3911
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
3912
|
+
};
|
|
3913
|
+
const toCalendarDate = (date) => {
|
|
3914
|
+
const zoned = toNoonTZDate(date);
|
|
3915
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
3916
|
+
};
|
|
3917
|
+
return {
|
|
3918
|
+
today: () => {
|
|
3919
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
3920
|
+
},
|
|
3921
|
+
newDate: (year, monthIndex, date) => {
|
|
3922
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
3923
|
+
},
|
|
3924
|
+
startOfDay: (date) => {
|
|
3925
|
+
return toNoonTZDate(date);
|
|
3926
|
+
},
|
|
3927
|
+
startOfWeek: (date, options2) => {
|
|
3928
|
+
var _a2;
|
|
3929
|
+
const base = toNoonTZDate(date);
|
|
3930
|
+
const weekStartsOnValue = (_a2 = options2 == null ? void 0 : options2.weekStartsOn) != null ? _a2 : fallbackWeekStartsOn;
|
|
3931
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
3932
|
+
base.setDate(base.getDate() - diff);
|
|
3933
|
+
return base;
|
|
3934
|
+
},
|
|
3935
|
+
startOfISOWeek: (date) => {
|
|
3936
|
+
const base = toNoonTZDate(date);
|
|
3937
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
3938
|
+
base.setDate(base.getDate() - diff);
|
|
3939
|
+
return base;
|
|
3940
|
+
},
|
|
3941
|
+
startOfMonth: (date) => {
|
|
3942
|
+
const base = toNoonTZDate(date);
|
|
3943
|
+
base.setDate(1);
|
|
3944
|
+
return base;
|
|
3945
|
+
},
|
|
3946
|
+
startOfYear: (date) => {
|
|
3947
|
+
const base = toNoonTZDate(date);
|
|
3948
|
+
base.setMonth(0, 1);
|
|
3949
|
+
return base;
|
|
3950
|
+
},
|
|
3951
|
+
endOfWeek: (date, options2) => {
|
|
3952
|
+
var _a2;
|
|
3953
|
+
const base = toNoonTZDate(date);
|
|
3954
|
+
const weekStartsOnValue = (_a2 = options2 == null ? void 0 : options2.weekStartsOn) != null ? _a2 : fallbackWeekStartsOn;
|
|
3955
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
3956
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
3957
|
+
base.setDate(base.getDate() + diff);
|
|
3958
|
+
return base;
|
|
3959
|
+
},
|
|
3960
|
+
endOfISOWeek: (date) => {
|
|
3961
|
+
const base = toNoonTZDate(date);
|
|
3962
|
+
const diff = (7 - base.getDay()) % 7;
|
|
3963
|
+
base.setDate(base.getDate() + diff);
|
|
3964
|
+
return base;
|
|
3965
|
+
},
|
|
3966
|
+
endOfMonth: (date) => {
|
|
3967
|
+
const base = toNoonTZDate(date);
|
|
3968
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
3969
|
+
return base;
|
|
3970
|
+
},
|
|
3971
|
+
endOfYear: (date) => {
|
|
3972
|
+
const base = toNoonTZDate(date);
|
|
3973
|
+
base.setMonth(11, 31);
|
|
3974
|
+
return base;
|
|
3975
|
+
},
|
|
3976
|
+
eachMonthOfInterval: (interval) => {
|
|
3977
|
+
const start = toNoonTZDate(interval.start);
|
|
3978
|
+
const end = toNoonTZDate(interval.end);
|
|
3979
|
+
const result = [];
|
|
3980
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
3981
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
3982
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
3983
|
+
result.push(new TZDate(cursor, timeZone));
|
|
3984
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
3985
|
+
}
|
|
3986
|
+
return result;
|
|
3987
|
+
},
|
|
3988
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
3989
|
+
// mutate the same TZDate, and return it.
|
|
3990
|
+
addDays: (date, amount) => {
|
|
3991
|
+
const base = toNoonTZDate(date);
|
|
3992
|
+
base.setDate(base.getDate() + amount);
|
|
3993
|
+
return base;
|
|
3994
|
+
},
|
|
3995
|
+
addWeeks: (date, amount) => {
|
|
3996
|
+
const base = toNoonTZDate(date);
|
|
3997
|
+
base.setDate(base.getDate() + amount * 7);
|
|
3998
|
+
return base;
|
|
3999
|
+
},
|
|
4000
|
+
addMonths: (date, amount) => {
|
|
4001
|
+
const base = toNoonTZDate(date);
|
|
4002
|
+
base.setMonth(base.getMonth() + amount);
|
|
4003
|
+
return base;
|
|
4004
|
+
},
|
|
4005
|
+
addYears: (date, amount) => {
|
|
4006
|
+
const base = toNoonTZDate(date);
|
|
4007
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
4008
|
+
return base;
|
|
4009
|
+
},
|
|
4010
|
+
eachYearOfInterval: (interval) => {
|
|
4011
|
+
const start = toNoonTZDate(interval.start);
|
|
4012
|
+
const end = toNoonTZDate(interval.end);
|
|
4013
|
+
const years = [];
|
|
4014
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
4015
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
4016
|
+
years.push(new TZDate(cursor, timeZone));
|
|
4017
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
4018
|
+
}
|
|
4019
|
+
return years;
|
|
4020
|
+
},
|
|
4021
|
+
getWeek: (date, options2) => {
|
|
4022
|
+
var _a2, _b2, _c, _d;
|
|
4023
|
+
const base = toCalendarDate(date);
|
|
4024
|
+
return getWeek(base, {
|
|
4025
|
+
weekStartsOn: (_a2 = options2 == null ? void 0 : options2.weekStartsOn) != null ? _a2 : fallbackWeekStartsOn,
|
|
4026
|
+
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
|
|
4027
|
+
});
|
|
4028
|
+
},
|
|
4029
|
+
getISOWeek: (date) => {
|
|
4030
|
+
const base = toCalendarDate(date);
|
|
4031
|
+
return getISOWeek(base);
|
|
4032
|
+
},
|
|
4033
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
4034
|
+
const left = toCalendarDate(dateLeft);
|
|
4035
|
+
const right = toCalendarDate(dateRight);
|
|
4036
|
+
return differenceInCalendarDays(left, right);
|
|
4037
|
+
},
|
|
4038
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
4039
|
+
const left = toCalendarDate(dateLeft);
|
|
4040
|
+
const right = toCalendarDate(dateRight);
|
|
4041
|
+
return differenceInCalendarMonths(left, right);
|
|
4042
|
+
}
|
|
4043
|
+
};
|
|
4044
|
+
}
|
|
4045
|
+
|
|
3902
4046
|
// node_modules/react-day-picker/dist/esm/useAnimation.js
|
|
3903
4047
|
var import_react28 = require("react");
|
|
3904
4048
|
var asHtmlElement = (element) => {
|
|
@@ -4692,15 +4836,22 @@ function toTimeZone(date, timeZone) {
|
|
|
4692
4836
|
}
|
|
4693
4837
|
|
|
4694
4838
|
// node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js
|
|
4695
|
-
function
|
|
4839
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
4840
|
+
if (!noonSafe)
|
|
4841
|
+
return toTimeZone(date, timeZone);
|
|
4842
|
+
const zoned = toTimeZone(date, timeZone);
|
|
4843
|
+
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
4844
|
+
return new Date(noonZoned.getTime());
|
|
4845
|
+
}
|
|
4846
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
4696
4847
|
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
4697
4848
|
return matcher;
|
|
4698
4849
|
}
|
|
4699
4850
|
if (matcher instanceof Date) {
|
|
4700
|
-
return
|
|
4851
|
+
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
4701
4852
|
}
|
|
4702
4853
|
if (Array.isArray(matcher)) {
|
|
4703
|
-
return matcher.map((value) => value instanceof Date ?
|
|
4854
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
4704
4855
|
}
|
|
4705
4856
|
if (isDateRange(matcher)) {
|
|
4706
4857
|
return __spreadProps(__spreadValues({}, matcher), {
|
|
@@ -4710,30 +4861,30 @@ function convertMatcher(matcher, timeZone) {
|
|
|
4710
4861
|
}
|
|
4711
4862
|
if (isDateInterval(matcher)) {
|
|
4712
4863
|
return {
|
|
4713
|
-
before:
|
|
4714
|
-
after:
|
|
4864
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
4865
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe)
|
|
4715
4866
|
};
|
|
4716
4867
|
}
|
|
4717
4868
|
if (isDateAfterType(matcher)) {
|
|
4718
4869
|
return {
|
|
4719
|
-
after:
|
|
4870
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe)
|
|
4720
4871
|
};
|
|
4721
4872
|
}
|
|
4722
4873
|
if (isDateBeforeType(matcher)) {
|
|
4723
4874
|
return {
|
|
4724
|
-
before:
|
|
4875
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe)
|
|
4725
4876
|
};
|
|
4726
4877
|
}
|
|
4727
4878
|
return matcher;
|
|
4728
4879
|
}
|
|
4729
|
-
function convertMatchersToTimeZone(matchers, timeZone) {
|
|
4880
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
4730
4881
|
if (!matchers) {
|
|
4731
4882
|
return matchers;
|
|
4732
4883
|
}
|
|
4733
4884
|
if (Array.isArray(matchers)) {
|
|
4734
|
-
return matchers.map((matcher) => convertMatcher(matcher, timeZone));
|
|
4885
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
4735
4886
|
}
|
|
4736
|
-
return convertMatcher(matchers, timeZone);
|
|
4887
|
+
return convertMatcher(matchers, timeZone, noonSafe);
|
|
4737
4888
|
}
|
|
4738
4889
|
|
|
4739
4890
|
// node_modules/react-day-picker/dist/esm/DayPicker.js
|
|
@@ -4786,16 +4937,23 @@ function DayPicker(initialProps) {
|
|
|
4786
4937
|
}
|
|
4787
4938
|
}
|
|
4788
4939
|
const { components, formatters: formatters2, labels, dateLib, locale, classNames } = (0, import_react32.useMemo)(() => {
|
|
4940
|
+
var _a2;
|
|
4789
4941
|
const locale2 = __spreadValues(__spreadValues({}, enUS2), props.locale);
|
|
4942
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
4943
|
+
const noonOverrides = props.noonSafe && props.timeZone ? createNoonOverrides(props.timeZone, {
|
|
4944
|
+
weekStartsOn,
|
|
4945
|
+
locale: locale2
|
|
4946
|
+
}) : void 0;
|
|
4947
|
+
const overrides = props.dateLib && noonOverrides ? __spreadValues(__spreadValues({}, noonOverrides), props.dateLib) : (_a2 = props.dateLib) != null ? _a2 : noonOverrides;
|
|
4790
4948
|
const dateLib2 = new DateLib({
|
|
4791
4949
|
locale: locale2,
|
|
4792
|
-
weekStartsOn
|
|
4950
|
+
weekStartsOn,
|
|
4793
4951
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
4794
4952
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
4795
4953
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
4796
4954
|
timeZone: props.timeZone,
|
|
4797
4955
|
numerals: props.numerals
|
|
4798
|
-
},
|
|
4956
|
+
}, overrides);
|
|
4799
4957
|
return {
|
|
4800
4958
|
dateLib: dateLib2,
|
|
4801
4959
|
components: getComponents(props.components),
|
|
@@ -4814,6 +4972,7 @@ function DayPicker(initialProps) {
|
|
|
4814
4972
|
props.timeZone,
|
|
4815
4973
|
props.numerals,
|
|
4816
4974
|
props.dateLib,
|
|
4975
|
+
props.noonSafe,
|
|
4817
4976
|
props.components,
|
|
4818
4977
|
props.formatters,
|
|
4819
4978
|
props.labels,
|
|
@@ -6073,7 +6232,7 @@ var Input = React41.forwardRef(
|
|
|
6073
6232
|
]);
|
|
6074
6233
|
const base = "block w-full bg-transparent text-foreground placeholder:text-muted-foreground outline-none transition disabled:opacity-50 disabled:cursor-not-allowed";
|
|
6075
6234
|
const sizeCls = size === "sm" ? "h-9 px-3 text-sm" : size === "lg" ? "h-12 px-5 text-base" : "h-11 px-4 text-sm";
|
|
6076
|
-
const
|
|
6235
|
+
const variants4 = {
|
|
6077
6236
|
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",
|
|
6078
6237
|
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",
|
|
6079
6238
|
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
@@ -6116,7 +6275,7 @@ var Input = React41.forwardRef(
|
|
|
6116
6275
|
disabled,
|
|
6117
6276
|
className: classNameDefault ? cn(
|
|
6118
6277
|
base,
|
|
6119
|
-
|
|
6278
|
+
variants4[variant],
|
|
6120
6279
|
variant === "flushed" ? specialSizeForFlushed : variant === "link" ? specialSizeForLink : sizeCls,
|
|
6121
6280
|
errorCls,
|
|
6122
6281
|
iconPadLeft,
|
|
@@ -6223,7 +6382,7 @@ var FormField = (_a) => {
|
|
|
6223
6382
|
import_lucide_react2.Asterisk,
|
|
6224
6383
|
{
|
|
6225
6384
|
className: cn(
|
|
6226
|
-
"ml-
|
|
6385
|
+
"ml-px h-3 w-3 text-red-500",
|
|
6227
6386
|
requiredLabelClassName
|
|
6228
6387
|
)
|
|
6229
6388
|
}
|
|
@@ -6427,7 +6586,7 @@ var FormSelect = ({
|
|
|
6427
6586
|
import_lucide_react2.Asterisk,
|
|
6428
6587
|
{
|
|
6429
6588
|
className: cn(
|
|
6430
|
-
"ml-
|
|
6589
|
+
"ml-1 h-3 w-3 text-red-500",
|
|
6431
6590
|
requiredLabelClassName
|
|
6432
6591
|
)
|
|
6433
6592
|
}
|
|
@@ -7226,12 +7385,9 @@ var ResizablePanelGroup = (_a) => {
|
|
|
7226
7385
|
"className"
|
|
7227
7386
|
]);
|
|
7228
7387
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7229
|
-
ResizablePrimitive.
|
|
7388
|
+
ResizablePrimitive.Group,
|
|
7230
7389
|
__spreadValues({
|
|
7231
|
-
className: cn(
|
|
7232
|
-
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
7233
|
-
className
|
|
7234
|
-
)
|
|
7390
|
+
className: cn("flex h-full w-full aria-[orientation=vertical]:flex-col", className)
|
|
7235
7391
|
}, props)
|
|
7236
7392
|
);
|
|
7237
7393
|
};
|
|
@@ -7245,7 +7401,7 @@ var ResizableHandle = (_a) => {
|
|
|
7245
7401
|
"className"
|
|
7246
7402
|
]);
|
|
7247
7403
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7248
|
-
ResizablePrimitive.
|
|
7404
|
+
ResizablePrimitive.Separator,
|
|
7249
7405
|
__spreadProps(__spreadValues({
|
|
7250
7406
|
className: cn(
|
|
7251
7407
|
"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",
|
|
@@ -7399,7 +7555,7 @@ var SelectContent = React54.forwardRef((_a, ref) => {
|
|
|
7399
7555
|
__spreadProps(__spreadValues({
|
|
7400
7556
|
ref,
|
|
7401
7557
|
className: cn(
|
|
7402
|
-
"relative z-50 max-h-96 min-w-
|
|
7558
|
+
"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",
|
|
7403
7559
|
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",
|
|
7404
7560
|
className
|
|
7405
7561
|
),
|
|
@@ -7412,7 +7568,7 @@ var SelectContent = React54.forwardRef((_a, ref) => {
|
|
|
7412
7568
|
{
|
|
7413
7569
|
className: cn(
|
|
7414
7570
|
"p-1",
|
|
7415
|
-
position === "popper" && "h-
|
|
7571
|
+
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
|
7416
7572
|
),
|
|
7417
7573
|
children
|
|
7418
7574
|
}
|
|
@@ -7441,7 +7597,7 @@ var SelectItem = React54.forwardRef((_a, ref) => {
|
|
|
7441
7597
|
__spreadProps(__spreadValues({
|
|
7442
7598
|
ref,
|
|
7443
7599
|
className: cn(
|
|
7444
|
-
"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-
|
|
7600
|
+
"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",
|
|
7445
7601
|
className
|
|
7446
7602
|
)
|
|
7447
7603
|
}, props), {
|
|
@@ -7469,7 +7625,7 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
7469
7625
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
7470
7626
|
var React55 = __toESM(require("react"), 1);
|
|
7471
7627
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
7472
|
-
var
|
|
7628
|
+
var Separator6 = React55.forwardRef(
|
|
7473
7629
|
(_a, ref) => {
|
|
7474
7630
|
var _b = _a, { className, orientation = "horizontal", decorative = true } = _b, props = __objRest(_b, ["className", "orientation", "decorative"]);
|
|
7475
7631
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
@@ -7487,7 +7643,7 @@ var Separator5 = React55.forwardRef(
|
|
|
7487
7643
|
);
|
|
7488
7644
|
}
|
|
7489
7645
|
);
|
|
7490
|
-
|
|
7646
|
+
Separator6.displayName = SeparatorPrimitive.Root.displayName;
|
|
7491
7647
|
|
|
7492
7648
|
// src/components/sheet.tsx
|
|
7493
7649
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
@@ -7704,16 +7860,18 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
|
7704
7860
|
// src/components/table.tsx
|
|
7705
7861
|
var React59 = __toESM(require("react"), 1);
|
|
7706
7862
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
7707
|
-
var Table = React59.forwardRef(
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
"
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
});
|
|
7863
|
+
var Table = React59.forwardRef(
|
|
7864
|
+
(_a, ref) => {
|
|
7865
|
+
var _b = _a, { className, containerClassName } = _b, props = __objRest(_b, ["className", "containerClassName"]);
|
|
7866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("relative w-full overflow-auto", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7867
|
+
"table",
|
|
7868
|
+
__spreadValues({
|
|
7869
|
+
ref,
|
|
7870
|
+
className: cn("w-full caption-bottom text-sm", className)
|
|
7871
|
+
}, props)
|
|
7872
|
+
) });
|
|
7873
|
+
}
|
|
7874
|
+
);
|
|
7717
7875
|
Table.displayName = "Table";
|
|
7718
7876
|
var TableHeader = React59.forwardRef((_a, ref) => {
|
|
7719
7877
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
@@ -7766,7 +7924,7 @@ var TableHead = React59.forwardRef((_a, ref) => {
|
|
|
7766
7924
|
__spreadValues({
|
|
7767
7925
|
ref,
|
|
7768
7926
|
className: cn(
|
|
7769
|
-
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [
|
|
7927
|
+
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5",
|
|
7770
7928
|
className
|
|
7771
7929
|
)
|
|
7772
7930
|
}, props)
|
|
@@ -7780,7 +7938,7 @@ var TableCell = React59.forwardRef((_a, ref) => {
|
|
|
7780
7938
|
__spreadValues({
|
|
7781
7939
|
ref,
|
|
7782
7940
|
className: cn(
|
|
7783
|
-
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [
|
|
7941
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5",
|
|
7784
7942
|
className
|
|
7785
7943
|
)
|
|
7786
7944
|
}, props)
|
|
@@ -8234,6 +8392,7 @@ function Breadcrumbs({ items, className, classNameList }) {
|
|
|
8234
8392
|
|
|
8235
8393
|
// src/shared/data-table.tsx
|
|
8236
8394
|
var import_react36 = __toESM(require("react"), 1);
|
|
8395
|
+
var import_framer_motion2 = require("framer-motion");
|
|
8237
8396
|
var import_react_icons18 = require("@radix-ui/react-icons");
|
|
8238
8397
|
var import_react_table = require("@tanstack/react-table");
|
|
8239
8398
|
var import_lucide_react6 = require("lucide-react");
|
|
@@ -8260,16 +8419,36 @@ function DataTable({
|
|
|
8260
8419
|
tableClassName,
|
|
8261
8420
|
onPageChange,
|
|
8262
8421
|
onClick,
|
|
8263
|
-
onPageSizeChange
|
|
8422
|
+
onPageSizeChange,
|
|
8423
|
+
animate = true,
|
|
8424
|
+
stickyHeader = true,
|
|
8425
|
+
heightClassName = "h-[clamp(22rem,80vh,44rem)] supports-[height:100dvh]:h-[clamp(22rem,80dvh,44rem)]"
|
|
8264
8426
|
}) {
|
|
8427
|
+
const safePageCount = Math.max(pageCount != null ? pageCount : 1, 1);
|
|
8265
8428
|
const [pagination, setPagination] = import_react36.default.useState({
|
|
8266
8429
|
pageIndex: Math.max(page - 1, 0),
|
|
8267
8430
|
pageSize: perPage
|
|
8268
8431
|
});
|
|
8432
|
+
(0, import_react36.useEffect)(() => {
|
|
8433
|
+
setPagination((prev) => {
|
|
8434
|
+
const nextIndex = Math.max(page - 1, 0);
|
|
8435
|
+
const nextSize = perPage;
|
|
8436
|
+
if (prev.pageIndex === nextIndex && prev.pageSize === nextSize) return prev;
|
|
8437
|
+
return { pageIndex: nextIndex, pageSize: nextSize };
|
|
8438
|
+
});
|
|
8439
|
+
}, [page, perPage]);
|
|
8440
|
+
(0, import_react36.useEffect)(() => {
|
|
8441
|
+
setPagination((prev) => {
|
|
8442
|
+
const maxIndex = Math.max(safePageCount - 1, 0);
|
|
8443
|
+
const clamped = Math.min(prev.pageIndex, maxIndex);
|
|
8444
|
+
if (clamped === prev.pageIndex) return prev;
|
|
8445
|
+
return __spreadProps(__spreadValues({}, prev), { pageIndex: clamped });
|
|
8446
|
+
});
|
|
8447
|
+
}, [safePageCount]);
|
|
8269
8448
|
const table = (0, import_react_table.useReactTable)({
|
|
8270
8449
|
data,
|
|
8271
8450
|
columns,
|
|
8272
|
-
pageCount,
|
|
8451
|
+
pageCount: safePageCount,
|
|
8273
8452
|
getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
|
|
8274
8453
|
getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
|
|
8275
8454
|
state: { pagination },
|
|
@@ -8278,147 +8457,190 @@ function DataTable({
|
|
|
8278
8457
|
manualPagination: true,
|
|
8279
8458
|
manualFiltering: true
|
|
8280
8459
|
});
|
|
8281
|
-
const
|
|
8282
|
-
if (onClick) {
|
|
8283
|
-
onClick(row);
|
|
8284
|
-
}
|
|
8285
|
-
};
|
|
8460
|
+
const clickable = !!onClick;
|
|
8286
8461
|
(0, import_react36.useEffect)(() => {
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { className: cellClassName, children: (0, import_react_table.flexRender)(
|
|
8305
|
-
cell.column.columnDef.cell,
|
|
8306
|
-
cell.getContext()
|
|
8307
|
-
) }, cell.id))
|
|
8308
|
-
},
|
|
8309
|
-
row.id
|
|
8310
|
-
)) : emptyData || /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8311
|
-
TableCell,
|
|
8312
|
-
{
|
|
8313
|
-
colSpan: columns.length,
|
|
8314
|
-
className: "h-24 text-center",
|
|
8315
|
-
children: "No results."
|
|
8316
|
-
}
|
|
8317
|
-
) }) })
|
|
8318
|
-
] }),
|
|
8319
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScrollBar, { orientation: "horizontal" })
|
|
8320
|
-
] }),
|
|
8321
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "border-t px-4 py-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
8322
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
|
|
8323
|
-
isRowsSelected && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-muted-foreground text-sm", children: [
|
|
8324
|
-
table.getFilteredSelectedRowModel().rows.length,
|
|
8325
|
-
" ",
|
|
8326
|
-
ofLabel,
|
|
8327
|
-
" ",
|
|
8328
|
-
table.getFilteredRowModel().rows.length,
|
|
8329
|
-
" ",
|
|
8330
|
-
rowsSelectedLabel
|
|
8331
|
-
] }),
|
|
8332
|
-
totalRows ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-sm text-muted-foreground", children: [
|
|
8333
|
-
"Total: ",
|
|
8334
|
-
totalRows,
|
|
8335
|
-
" registros"
|
|
8336
|
-
] }) : null
|
|
8337
|
-
] }),
|
|
8338
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-end", children: [
|
|
8339
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8340
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
|
|
8462
|
+
onPageChange == null ? void 0 : onPageChange(pagination.pageIndex + 1);
|
|
8463
|
+
}, [pagination.pageIndex, onPageChange]);
|
|
8464
|
+
const pageKey = (0, import_react36.useMemo)(
|
|
8465
|
+
() => `${pagination.pageIndex}-${pagination.pageSize}-${data.length}`,
|
|
8466
|
+
[pagination.pageIndex, pagination.pageSize, data.length]
|
|
8467
|
+
);
|
|
8468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
8469
|
+
"div",
|
|
8470
|
+
{
|
|
8471
|
+
className: cn(
|
|
8472
|
+
"relative w-full overflow-hidden rounded-xl border bg-background/60 backdrop-blur supports-backdrop-filter:bg-background/40 shadow-sm",
|
|
8473
|
+
"flex flex-col",
|
|
8474
|
+
heightClassName,
|
|
8475
|
+
className
|
|
8476
|
+
),
|
|
8477
|
+
children: [
|
|
8478
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(ScrollArea, { className: "h-full", children: [
|
|
8341
8479
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
8342
|
-
|
|
8480
|
+
Table,
|
|
8343
8481
|
{
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
const newSize = Number(value);
|
|
8347
|
-
setPagination(__spreadProps(__spreadValues({}, pagination), {
|
|
8348
|
-
pageSize: newSize,
|
|
8349
|
-
pageIndex: 0
|
|
8350
|
-
}));
|
|
8351
|
-
if (onPageSizeChange) onPageSizeChange(newSize);
|
|
8352
|
-
},
|
|
8482
|
+
containerClassName: "overflow-visible",
|
|
8483
|
+
className: cn("w-full", tableClassName),
|
|
8353
8484
|
children: [
|
|
8354
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8355
|
-
|
|
8485
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8486
|
+
TableHeader,
|
|
8487
|
+
{
|
|
8488
|
+
className: cn(
|
|
8489
|
+
headerClassName,
|
|
8490
|
+
stickyHeader ? "sticky top-0 z-10 bg-background/80 backdrop-blur border-b" : ""
|
|
8491
|
+
),
|
|
8492
|
+
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { className: cn("hover:bg-transparent", rowClassName), children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableHead, { className: cn("whitespace-nowrap", headerClassName), children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()) }, header.id)) }, headerGroup.id))
|
|
8493
|
+
}
|
|
8494
|
+
),
|
|
8495
|
+
animate ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_framer_motion2.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8496
|
+
import_framer_motion2.motion.tbody,
|
|
8497
|
+
{
|
|
8498
|
+
className: cn("[&_tr:last-child]:border-0", bodyClassName),
|
|
8499
|
+
initial: { opacity: 0, y: 6 },
|
|
8500
|
+
animate: { opacity: 1, y: 0 },
|
|
8501
|
+
exit: { opacity: 0, y: -6 },
|
|
8502
|
+
transition: { duration: 0.18 },
|
|
8503
|
+
children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8504
|
+
TableRow,
|
|
8505
|
+
{
|
|
8506
|
+
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
8507
|
+
onClick: () => onClick == null ? void 0 : onClick(row.original),
|
|
8508
|
+
className: cn(
|
|
8509
|
+
rowClassName,
|
|
8510
|
+
clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
|
|
8511
|
+
),
|
|
8512
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { className: cellClassName, children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
8513
|
+
},
|
|
8514
|
+
row.id
|
|
8515
|
+
)) : emptyData || /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { colSpan: columns.length, className: "h-28 text-center text-muted-foreground", children: "No results." }) })
|
|
8516
|
+
},
|
|
8517
|
+
pageKey
|
|
8518
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableBody, { className: bodyClassName, children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8519
|
+
TableRow,
|
|
8520
|
+
{
|
|
8521
|
+
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
8522
|
+
onClick: () => onClick == null ? void 0 : onClick(row.original),
|
|
8523
|
+
className: cn(
|
|
8524
|
+
rowClassName,
|
|
8525
|
+
clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
|
|
8526
|
+
),
|
|
8527
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { className: cn(cellClassName), children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
8528
|
+
},
|
|
8529
|
+
row.id
|
|
8530
|
+
)) : emptyData || /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { colSpan: columns.length, className: "h-28 text-center text-muted-foreground", children: "No results." }) }) })
|
|
8356
8531
|
]
|
|
8357
8532
|
}
|
|
8358
|
-
)
|
|
8359
|
-
] }),
|
|
8360
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8361
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex w-[110px] items-center justify-center text-sm font-medium", children: [
|
|
8362
|
-
pageLabel,
|
|
8363
|
-
" ",
|
|
8364
|
-
pagination.pageIndex + 1,
|
|
8365
|
-
" ",
|
|
8366
|
-
ofLabel,
|
|
8367
|
-
" ",
|
|
8368
|
-
pageCount
|
|
8369
|
-
] }),
|
|
8370
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8371
|
-
Button,
|
|
8372
|
-
{
|
|
8373
|
-
"aria-label": "Go to first page",
|
|
8374
|
-
variant: "outline",
|
|
8375
|
-
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
8376
|
-
onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), { pageIndex: 0 })),
|
|
8377
|
-
disabled: pagination.pageIndex === 0,
|
|
8378
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_icons18.DoubleArrowLeftIcon, { className: "h-4 w-4" })
|
|
8379
|
-
}
|
|
8380
|
-
),
|
|
8381
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8382
|
-
Button,
|
|
8383
|
-
{
|
|
8384
|
-
"aria-label": "Go to previous page",
|
|
8385
|
-
variant: "outline",
|
|
8386
|
-
className: "h-8 w-8 p-0",
|
|
8387
|
-
onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), {
|
|
8388
|
-
pageIndex: pagination.pageIndex - 1
|
|
8389
|
-
})),
|
|
8390
|
-
disabled: pagination.pageIndex === 0,
|
|
8391
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.ChevronLeftIcon, { className: "h-4 w-4" })
|
|
8392
|
-
}
|
|
8393
|
-
),
|
|
8394
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8395
|
-
Button,
|
|
8396
|
-
{
|
|
8397
|
-
"aria-label": "Go to next page",
|
|
8398
|
-
variant: "outline",
|
|
8399
|
-
className: "h-8 w-8 p-0",
|
|
8400
|
-
onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), {
|
|
8401
|
-
pageIndex: pagination.pageIndex + 1
|
|
8402
|
-
})),
|
|
8403
|
-
disabled: pagination.pageIndex + 1 >= pageCount,
|
|
8404
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.ChevronRightIcon, { className: "h-4 w-4" })
|
|
8405
|
-
}
|
|
8406
8533
|
),
|
|
8407
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScrollBar, { orientation: "horizontal" })
|
|
8535
|
+
] }) }),
|
|
8536
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "border-t bg-background/70 backdrop-blur supports-backdrop-filter:bg-background/50", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-[1fr_auto] sm:items-center", children: [
|
|
8537
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
|
|
8538
|
+
isRowsSelected && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-muted-foreground text-sm", children: [
|
|
8539
|
+
table.getFilteredSelectedRowModel().rows.length,
|
|
8540
|
+
" ",
|
|
8541
|
+
ofLabel,
|
|
8542
|
+
" ",
|
|
8543
|
+
table.getFilteredRowModel().rows.length,
|
|
8544
|
+
" ",
|
|
8545
|
+
rowsSelectedLabel
|
|
8546
|
+
] }),
|
|
8547
|
+
typeof totalRows === "number" && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-sm text-muted-foreground", children: [
|
|
8548
|
+
"Total: ",
|
|
8549
|
+
totalRows,
|
|
8550
|
+
" registros"
|
|
8551
|
+
] })
|
|
8552
|
+
] }),
|
|
8553
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:justify-end", children: [
|
|
8554
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8555
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
|
|
8556
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
8557
|
+
Select2,
|
|
8558
|
+
{
|
|
8559
|
+
value: `${pagination.pageSize}`,
|
|
8560
|
+
onValueChange: (value) => {
|
|
8561
|
+
const newSize = Number(value);
|
|
8562
|
+
setPagination((p) => __spreadProps(__spreadValues({}, p), { pageSize: newSize, pageIndex: 0 }));
|
|
8563
|
+
onPageSizeChange == null ? void 0 : onPageSizeChange(newSize);
|
|
8564
|
+
onPageChange == null ? void 0 : onPageChange(1);
|
|
8565
|
+
},
|
|
8566
|
+
children: [
|
|
8567
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectTrigger, { className: "h-8 w-21", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectValue, { placeholder: pagination.pageSize }) }),
|
|
8568
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectItem, { value: `${size}`, children: size }, size)) })
|
|
8569
|
+
]
|
|
8570
|
+
}
|
|
8571
|
+
)
|
|
8572
|
+
] }),
|
|
8573
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8574
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "hidden sm:flex min-w-35 items-center justify-center text-sm font-medium", children: [
|
|
8575
|
+
pageLabel,
|
|
8576
|
+
" ",
|
|
8577
|
+
pagination.pageIndex + 1,
|
|
8578
|
+
" ",
|
|
8579
|
+
ofLabel,
|
|
8580
|
+
" ",
|
|
8581
|
+
safePageCount
|
|
8582
|
+
] }),
|
|
8583
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8584
|
+
Button,
|
|
8585
|
+
{
|
|
8586
|
+
"aria-label": "Go to first page",
|
|
8587
|
+
variant: "outline",
|
|
8588
|
+
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
8589
|
+
onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: 0 })),
|
|
8590
|
+
disabled: pagination.pageIndex === 0,
|
|
8591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_icons18.DoubleArrowLeftIcon, { className: "h-4 w-4" })
|
|
8592
|
+
}
|
|
8593
|
+
),
|
|
8594
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8595
|
+
Button,
|
|
8596
|
+
{
|
|
8597
|
+
"aria-label": "Go to previous page",
|
|
8598
|
+
variant: "outline",
|
|
8599
|
+
className: "h-8 w-8 p-0",
|
|
8600
|
+
onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: Math.max(p.pageIndex - 1, 0) })),
|
|
8601
|
+
disabled: pagination.pageIndex === 0,
|
|
8602
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.ChevronLeftIcon, { className: "h-4 w-4" })
|
|
8603
|
+
}
|
|
8604
|
+
),
|
|
8605
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8606
|
+
Button,
|
|
8607
|
+
{
|
|
8608
|
+
"aria-label": "Go to next page",
|
|
8609
|
+
variant: "outline",
|
|
8610
|
+
className: "h-8 w-8 p-0",
|
|
8611
|
+
onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), {
|
|
8612
|
+
pageIndex: Math.min(p.pageIndex + 1, safePageCount - 1)
|
|
8613
|
+
})),
|
|
8614
|
+
disabled: pagination.pageIndex + 1 >= safePageCount,
|
|
8615
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.ChevronRightIcon, { className: "h-4 w-4" })
|
|
8616
|
+
}
|
|
8617
|
+
),
|
|
8618
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8619
|
+
Button,
|
|
8620
|
+
{
|
|
8621
|
+
"aria-label": "Go to last page",
|
|
8622
|
+
variant: "outline",
|
|
8623
|
+
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
8624
|
+
onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: safePageCount - 1 })),
|
|
8625
|
+
disabled: pagination.pageIndex + 1 >= safePageCount,
|
|
8626
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_icons18.DoubleArrowRightIcon, { className: "h-4 w-4" })
|
|
8627
|
+
}
|
|
8628
|
+
)
|
|
8629
|
+
] }),
|
|
8630
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "sm:hidden w-full text-center text-xs text-muted-foreground", children: [
|
|
8631
|
+
pageLabel,
|
|
8632
|
+
" ",
|
|
8633
|
+
pagination.pageIndex + 1,
|
|
8634
|
+
" ",
|
|
8635
|
+
ofLabel,
|
|
8636
|
+
" ",
|
|
8637
|
+
safePageCount
|
|
8638
|
+
] })
|
|
8639
|
+
] })
|
|
8640
|
+
] }) }) })
|
|
8641
|
+
]
|
|
8642
|
+
}
|
|
8643
|
+
);
|
|
8422
8644
|
}
|
|
8423
8645
|
|
|
8424
8646
|
// src/shared/data-table-skeleton.tsx
|
|
@@ -8433,10 +8655,10 @@ function DataTableSkeleton({
|
|
|
8433
8655
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "w-full space-y-3 overflow-auto", children: [
|
|
8434
8656
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex w-full items-center justify-between space-x-2 overflow-auto p-1", children: [
|
|
8435
8657
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-1 items-center space-x-2 space-y-4", children: [
|
|
8436
|
-
searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-10 w-
|
|
8437
|
-
filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-10 w-
|
|
8658
|
+
searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-10 w-37.5 lg:w-62.5" }, i)) : null,
|
|
8659
|
+
filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-10 w-17.5 border-dashed" }, i)) : null
|
|
8438
8660
|
] }),
|
|
8439
|
-
showViewOptions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "ml-auto hidden h-7 w-
|
|
8661
|
+
showViewOptions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "ml-auto hidden h-7 w-17.5 lg:flex" }) : null
|
|
8440
8662
|
] }),
|
|
8441
8663
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "rounded-md border", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Table, { children: [
|
|
8442
8664
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHeader, { children: Array.from({ length: 1 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columnCount }).map((_2, i2) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-6 w-full" }) }, i2)) }, i)) }),
|
|
@@ -8447,9 +8669,9 @@ function DataTableSkeleton({
|
|
|
8447
8669
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8", children: [
|
|
8448
8670
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
8449
8671
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-24" }),
|
|
8450
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-
|
|
8672
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-17.5" })
|
|
8451
8673
|
] }),
|
|
8452
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex w-
|
|
8674
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex w-25 items-center justify-center text-sm font-medium", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-20" }) }),
|
|
8453
8675
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
8454
8676
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "hidden size-8 lg:block" }),
|
|
8455
8677
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "size-8" }),
|
|
@@ -8675,6 +8897,166 @@ function Dropzone({
|
|
|
8675
8897
|
] }, idx)) })
|
|
8676
8898
|
] });
|
|
8677
8899
|
}
|
|
8900
|
+
|
|
8901
|
+
// src/types/select.ts
|
|
8902
|
+
var inputVariants2 = {
|
|
8903
|
+
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",
|
|
8904
|
+
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",
|
|
8905
|
+
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
8906
|
+
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",
|
|
8907
|
+
// sin bordes laterales/superior, solo inferior; sin sombras ni radios
|
|
8908
|
+
flushed: "rounded-none border-0 border-b border-input px-0 shadow-none focus:border-b-2 focus:border-primary focus:ring-0",
|
|
8909
|
+
// sin estilos, útil para inputs embebidos o controles muy custom
|
|
8910
|
+
unstyled: "border-0 shadow-none focus:ring-0",
|
|
8911
|
+
// aspecto tipo enlace: inline height-auto, sin paddings ni borde
|
|
8912
|
+
link: "border-0 p-0 h-auto shadow-none bg-transparent text-primary underline-offset-4 focus:underline focus:ring-0"
|
|
8913
|
+
};
|
|
8914
|
+
var variants2 = inputVariants2;
|
|
8915
|
+
|
|
8916
|
+
// src/components/ui/select.tsx
|
|
8917
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
8918
|
+
function UiSelect({
|
|
8919
|
+
ref,
|
|
8920
|
+
label,
|
|
8921
|
+
placeholder,
|
|
8922
|
+
value,
|
|
8923
|
+
onChange,
|
|
8924
|
+
items,
|
|
8925
|
+
children,
|
|
8926
|
+
className,
|
|
8927
|
+
selectClassName,
|
|
8928
|
+
labelClassName,
|
|
8929
|
+
contentClassName,
|
|
8930
|
+
size = "md",
|
|
8931
|
+
variant = "outline",
|
|
8932
|
+
errorMessage,
|
|
8933
|
+
htmlFormItemId: formItemId
|
|
8934
|
+
}) {
|
|
8935
|
+
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";
|
|
8936
|
+
const sizeTrigger = {
|
|
8937
|
+
sm: "h-9 px-3 text-sm",
|
|
8938
|
+
md: "h-11 px-4 text-sm",
|
|
8939
|
+
lg: "h-12 px-5 text-base"
|
|
8940
|
+
};
|
|
8941
|
+
const specialFlushed = variant === "flushed" ? size === "sm" ? "h-9 text-sm" : size === "lg" ? "h-12 text-base" : "h-11 text-sm" : "";
|
|
8942
|
+
const specialLink = variant === "link" ? "text-sm" : "";
|
|
8943
|
+
const contentBase = "bg-popover text-popover-foreground border border-border rounded-md shadow-md";
|
|
8944
|
+
const itemSize = {
|
|
8945
|
+
sm: "h-8 text-sm",
|
|
8946
|
+
md: "h-9 text-sm",
|
|
8947
|
+
lg: "h-10 text-base"
|
|
8948
|
+
};
|
|
8949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: cn("w-full", selectClassName), children: [
|
|
8950
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8951
|
+
Label3,
|
|
8952
|
+
{
|
|
8953
|
+
ref,
|
|
8954
|
+
className: cn(errorMessage && "text-destructive", labelClassName),
|
|
8955
|
+
htmlFor: formItemId,
|
|
8956
|
+
children: label
|
|
8957
|
+
}
|
|
8958
|
+
) : null,
|
|
8959
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Select2, { value, onValueChange: onChange, children: [
|
|
8960
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8961
|
+
SelectTrigger,
|
|
8962
|
+
{
|
|
8963
|
+
className: cn(
|
|
8964
|
+
triggerBase,
|
|
8965
|
+
variants2[variant],
|
|
8966
|
+
variant === "flushed" ? specialFlushed : variant === "link" ? specialLink : sizeTrigger[size],
|
|
8967
|
+
errorMessage && "ring-destructive focus:ring-destructive/40 border-destructive",
|
|
8968
|
+
className,
|
|
8969
|
+
label ? "mt-1" : ""
|
|
8970
|
+
),
|
|
8971
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectValue, { placeholder })
|
|
8972
|
+
}
|
|
8973
|
+
),
|
|
8974
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectContent, { className: cn(contentBase, contentClassName), children: children ? children : items ? items == null ? void 0 : items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8975
|
+
SelectItem,
|
|
8976
|
+
{
|
|
8977
|
+
value: item.value,
|
|
8978
|
+
className: cn(itemSize[size]),
|
|
8979
|
+
children: item.label
|
|
8980
|
+
},
|
|
8981
|
+
item.value
|
|
8982
|
+
)) : null })
|
|
8983
|
+
] }),
|
|
8984
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-sm text-destructive mt-1 ", children: errorMessage }) : null
|
|
8985
|
+
] });
|
|
8986
|
+
}
|
|
8987
|
+
|
|
8988
|
+
// src/types/input.ts
|
|
8989
|
+
var inputVariants3 = {
|
|
8990
|
+
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",
|
|
8991
|
+
// default variant
|
|
8992
|
+
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",
|
|
8993
|
+
// similar to 'filled' but lighter
|
|
8994
|
+
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
8995
|
+
// no background, just hover/focus effect
|
|
8996
|
+
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",
|
|
8997
|
+
// solid background, inset shadow
|
|
8998
|
+
flushed: "rounded-none border-0 border-b border-input px-0 shadow-none focus:border-b-2 focus:border-primary focus:ring-0",
|
|
8999
|
+
// no lateral/top borders, only bottom; no shadows or rounding
|
|
9000
|
+
unstyled: "border-0 shadow-none focus:ring-0",
|
|
9001
|
+
// no styles, useful for embedded inputs or very custom controls
|
|
9002
|
+
link: "border-0 p-0 h-auto shadow-none bg-transparent text-primary underline-offset-4 focus:underline focus:ring-0"
|
|
9003
|
+
};
|
|
9004
|
+
var variants3 = inputVariants3;
|
|
9005
|
+
|
|
9006
|
+
// src/components/ui/input.tsx
|
|
9007
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
9008
|
+
function UiInput(_a) {
|
|
9009
|
+
var _b = _a, {
|
|
9010
|
+
ref,
|
|
9011
|
+
label,
|
|
9012
|
+
placeholder,
|
|
9013
|
+
onChange,
|
|
9014
|
+
className,
|
|
9015
|
+
classNameDefault,
|
|
9016
|
+
labelClassName,
|
|
9017
|
+
inputClassName,
|
|
9018
|
+
variant = "outline",
|
|
9019
|
+
errorMessage,
|
|
9020
|
+
htmlFormItemId: formItemId
|
|
9021
|
+
} = _b, inputProps = __objRest(_b, [
|
|
9022
|
+
"ref",
|
|
9023
|
+
"label",
|
|
9024
|
+
"placeholder",
|
|
9025
|
+
"onChange",
|
|
9026
|
+
"className",
|
|
9027
|
+
"classNameDefault",
|
|
9028
|
+
"labelClassName",
|
|
9029
|
+
"inputClassName",
|
|
9030
|
+
"variant",
|
|
9031
|
+
"errorMessage",
|
|
9032
|
+
"htmlFormItemId"
|
|
9033
|
+
]);
|
|
9034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: cn("w-full", inputClassName), children: [
|
|
9035
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9036
|
+
Label3,
|
|
9037
|
+
{
|
|
9038
|
+
ref,
|
|
9039
|
+
className: cn(errorMessage && "text-destructive", labelClassName),
|
|
9040
|
+
htmlFor: formItemId,
|
|
9041
|
+
children: label
|
|
9042
|
+
}
|
|
9043
|
+
) : null,
|
|
9044
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9045
|
+
Input,
|
|
9046
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
9047
|
+
onChange,
|
|
9048
|
+
placeholder,
|
|
9049
|
+
className: cn(
|
|
9050
|
+
"bg-input px-[0.9rem] py-5",
|
|
9051
|
+
className,
|
|
9052
|
+
variants3[variant]
|
|
9053
|
+
),
|
|
9054
|
+
classNameDefault
|
|
9055
|
+
})
|
|
9056
|
+
),
|
|
9057
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-sm text-destructive mt-1 ", children: errorMessage }) : null
|
|
9058
|
+
] });
|
|
9059
|
+
}
|
|
8678
9060
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8679
9061
|
0 && (module.exports = {
|
|
8680
9062
|
Accordion,
|
|
@@ -8899,6 +9281,8 @@ function Dropzone({
|
|
|
8899
9281
|
TooltipContent,
|
|
8900
9282
|
TooltipProvider,
|
|
8901
9283
|
TooltipTrigger,
|
|
9284
|
+
UiInput,
|
|
9285
|
+
UiSelect,
|
|
8902
9286
|
badgeVariants,
|
|
8903
9287
|
buttonVariants,
|
|
8904
9288
|
cn,
|