shadcn-ui-react 0.4.2 → 0.5.1
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 +703 -160
- package/dist/index.d.cts +70 -40
- package/dist/index.d.ts +70 -40
- package/dist/index.js +706 -165
- package/dist/style.css +47 -18
- package/package.json +51 -51
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,
|
|
@@ -661,9 +663,6 @@ var Button = React5.forwardRef(
|
|
|
661
663
|
);
|
|
662
664
|
Button.displayName = "Button";
|
|
663
665
|
|
|
664
|
-
// node_modules/@date-fns/tz/constants/index.js
|
|
665
|
-
var constructFromSymbol = Symbol.for("constructDateFrom");
|
|
666
|
-
|
|
667
666
|
// node_modules/@date-fns/tz/tzName/index.js
|
|
668
667
|
function tzName(timeZone, date, format2 = "long") {
|
|
669
668
|
return new Intl.DateTimeFormat("en-US", {
|
|
@@ -749,7 +748,7 @@ var TZDateMini = class _TZDateMini extends Date {
|
|
|
749
748
|
}
|
|
750
749
|
//#endregion
|
|
751
750
|
//#region date-fns integration
|
|
752
|
-
[Symbol.for("constructDateFrom")](date) {
|
|
751
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
|
|
753
752
|
return new _TZDateMini(+new Date(date), this.timeZone);
|
|
754
753
|
}
|
|
755
754
|
//#endregion
|
|
@@ -877,7 +876,7 @@ var TZDate = class _TZDate extends TZDateMini {
|
|
|
877
876
|
return new _TZDate(+this, timeZone);
|
|
878
877
|
}
|
|
879
878
|
//#region date-fns integration
|
|
880
|
-
[Symbol.for("constructDateFrom")](date) {
|
|
879
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
|
|
881
880
|
return new _TZDate(+new Date(date), this.timeZone);
|
|
882
881
|
}
|
|
883
882
|
//#endregion
|
|
@@ -895,13 +894,13 @@ var secondsInWeek = secondsInDay * 7;
|
|
|
895
894
|
var secondsInYear = secondsInDay * daysInYear;
|
|
896
895
|
var secondsInMonth = secondsInYear / 12;
|
|
897
896
|
var secondsInQuarter = secondsInMonth * 3;
|
|
898
|
-
var
|
|
897
|
+
var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
899
898
|
|
|
900
899
|
// node_modules/date-fns/constructFrom.js
|
|
901
900
|
function constructFrom(date, value) {
|
|
902
901
|
if (typeof date === "function") return date(value);
|
|
903
|
-
if (date && typeof date === "object" &&
|
|
904
|
-
return date[
|
|
902
|
+
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
903
|
+
return date[constructFromSymbol](value);
|
|
905
904
|
if (date instanceof Date) return new date.constructor(value);
|
|
906
905
|
return new Date(value);
|
|
907
906
|
}
|
|
@@ -1176,6 +1175,29 @@ function startOfYear(date, options) {
|
|
|
1176
1175
|
return date_;
|
|
1177
1176
|
}
|
|
1178
1177
|
|
|
1178
|
+
// node_modules/date-fns/eachYearOfInterval.js
|
|
1179
|
+
function eachYearOfInterval(interval, options) {
|
|
1180
|
+
var _a;
|
|
1181
|
+
const { start, end } = normalizeInterval(options == null ? void 0 : options.in, interval);
|
|
1182
|
+
let reversed = +start > +end;
|
|
1183
|
+
const endTime = reversed ? +start : +end;
|
|
1184
|
+
const date = reversed ? end : start;
|
|
1185
|
+
date.setHours(0, 0, 0, 0);
|
|
1186
|
+
date.setMonth(0, 1);
|
|
1187
|
+
let step = (_a = options == null ? void 0 : options.step) != null ? _a : 1;
|
|
1188
|
+
if (!step) return [];
|
|
1189
|
+
if (step < 0) {
|
|
1190
|
+
step = -step;
|
|
1191
|
+
reversed = !reversed;
|
|
1192
|
+
}
|
|
1193
|
+
const dates = [];
|
|
1194
|
+
while (+date <= endTime) {
|
|
1195
|
+
dates.push(constructFrom(start, date));
|
|
1196
|
+
date.setFullYear(date.getFullYear() + step);
|
|
1197
|
+
}
|
|
1198
|
+
return reversed ? dates.reverse() : dates;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1179
1201
|
// node_modules/date-fns/endOfWeek.js
|
|
1180
1202
|
function endOfWeek(date, options) {
|
|
1181
1203
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -2724,6 +2746,64 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
2724
2746
|
return endDate;
|
|
2725
2747
|
}
|
|
2726
2748
|
|
|
2749
|
+
// node_modules/react-day-picker/dist/esm/locale/en-US.js
|
|
2750
|
+
var enUS2 = __spreadProps(__spreadValues({}, enUS), {
|
|
2751
|
+
labels: {
|
|
2752
|
+
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
2753
|
+
let formatDate;
|
|
2754
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
2755
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
2756
|
+
} else {
|
|
2757
|
+
formatDate = (d, pattern) => format(d, pattern, __spreadValues({ locale: enUS }, options));
|
|
2758
|
+
}
|
|
2759
|
+
let label = formatDate(date, "PPPP");
|
|
2760
|
+
if (modifiers.today)
|
|
2761
|
+
label = `Today, ${label}`;
|
|
2762
|
+
if (modifiers.selected)
|
|
2763
|
+
label = `${label}, selected`;
|
|
2764
|
+
return label;
|
|
2765
|
+
},
|
|
2766
|
+
labelMonthDropdown: "Choose the Month",
|
|
2767
|
+
labelNext: "Go to the Next Month",
|
|
2768
|
+
labelPrevious: "Go to the Previous Month",
|
|
2769
|
+
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
2770
|
+
labelYearDropdown: "Choose the Year",
|
|
2771
|
+
labelGrid: (date, options, dateLib) => {
|
|
2772
|
+
let formatDate;
|
|
2773
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
2774
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
2775
|
+
} else {
|
|
2776
|
+
formatDate = (d, pattern) => format(d, pattern, __spreadValues({ locale: enUS }, options));
|
|
2777
|
+
}
|
|
2778
|
+
return formatDate(date, "LLLL yyyy");
|
|
2779
|
+
},
|
|
2780
|
+
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
2781
|
+
let formatDate;
|
|
2782
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
2783
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
2784
|
+
} else {
|
|
2785
|
+
formatDate = (d, pattern) => format(d, pattern, __spreadValues({ locale: enUS }, options));
|
|
2786
|
+
}
|
|
2787
|
+
let label = formatDate(date, "PPPP");
|
|
2788
|
+
if (modifiers == null ? void 0 : modifiers.today) {
|
|
2789
|
+
label = `Today, ${label}`;
|
|
2790
|
+
}
|
|
2791
|
+
return label;
|
|
2792
|
+
},
|
|
2793
|
+
labelNav: "Navigation bar",
|
|
2794
|
+
labelWeekNumberHeader: "Week Number",
|
|
2795
|
+
labelWeekday: (date, options, dateLib) => {
|
|
2796
|
+
let formatDate;
|
|
2797
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
2798
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
2799
|
+
} else {
|
|
2800
|
+
formatDate = (d, pattern) => format(d, pattern, __spreadValues({ locale: enUS }, options));
|
|
2801
|
+
}
|
|
2802
|
+
return formatDate(date, "cccc");
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
});
|
|
2806
|
+
|
|
2727
2807
|
// node_modules/react-day-picker/dist/esm/classes/DateLib.js
|
|
2728
2808
|
var DateLib = class _DateLib {
|
|
2729
2809
|
/**
|
|
@@ -2782,6 +2862,19 @@ var DateLib = class _DateLib {
|
|
|
2782
2862
|
var _a;
|
|
2783
2863
|
return ((_a = this.overrides) == null ? void 0 : _a.eachMonthOfInterval) ? this.overrides.eachMonthOfInterval(interval) : eachMonthOfInterval(interval);
|
|
2784
2864
|
};
|
|
2865
|
+
this.eachYearOfInterval = (interval) => {
|
|
2866
|
+
var _a;
|
|
2867
|
+
const years = ((_a = this.overrides) == null ? void 0 : _a.eachYearOfInterval) ? this.overrides.eachYearOfInterval(interval) : eachYearOfInterval(interval);
|
|
2868
|
+
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
2869
|
+
if (uniqueYears.size === years.length) {
|
|
2870
|
+
return years;
|
|
2871
|
+
}
|
|
2872
|
+
const yearsArray = [];
|
|
2873
|
+
uniqueYears.forEach((y) => {
|
|
2874
|
+
yearsArray.push(new Date(y, 0, 1));
|
|
2875
|
+
});
|
|
2876
|
+
return yearsArray;
|
|
2877
|
+
};
|
|
2785
2878
|
this.endOfBroadcastWeek = (date) => {
|
|
2786
2879
|
var _a;
|
|
2787
2880
|
return ((_a = this.overrides) == null ? void 0 : _a.endOfBroadcastWeek) ? this.overrides.endOfBroadcastWeek(date) : endOfBroadcastWeek(date, this);
|
|
@@ -2890,7 +2983,7 @@ var DateLib = class _DateLib {
|
|
|
2890
2983
|
var _a;
|
|
2891
2984
|
return ((_a = this.overrides) == null ? void 0 : _a.startOfYear) ? this.overrides.startOfYear(date) : startOfYear(date);
|
|
2892
2985
|
};
|
|
2893
|
-
this.options = __spreadValues({ locale:
|
|
2986
|
+
this.options = __spreadValues({ locale: enUS2 }, options);
|
|
2894
2987
|
this.overrides = overrides;
|
|
2895
2988
|
}
|
|
2896
2989
|
/**
|
|
@@ -2997,6 +3090,9 @@ var CalendarDay = class {
|
|
|
2997
3090
|
this.displayMonth = displayMonth;
|
|
2998
3091
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
2999
3092
|
this.dateLib = dateLib;
|
|
3093
|
+
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
3094
|
+
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
3095
|
+
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
3000
3096
|
}
|
|
3001
3097
|
/**
|
|
3002
3098
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -3409,7 +3505,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
3409
3505
|
return isSameDay2(date, matcher);
|
|
3410
3506
|
}
|
|
3411
3507
|
if (isDatesArray(matcher, dateLib)) {
|
|
3412
|
-
return matcher.
|
|
3508
|
+
return matcher.some((matcherDate) => isSameDay2(date, matcherDate));
|
|
3413
3509
|
}
|
|
3414
3510
|
if (isDateRange(matcher)) {
|
|
3415
3511
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -3447,7 +3543,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
3447
3543
|
|
|
3448
3544
|
// node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js
|
|
3449
3545
|
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
3450
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today } = props;
|
|
3546
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today() } = props;
|
|
3451
3547
|
const { isSameDay: isSameDay2, isSameMonth: isSameMonth2, startOfMonth: startOfMonth2, isBefore: isBefore2, endOfMonth: endOfMonth2, isAfter: isAfter2 } = dateLib;
|
|
3452
3548
|
const computedNavStart = navStart && startOfMonth2(navStart);
|
|
3453
3549
|
const computedNavEnd = navEnd && endOfMonth2(navEnd);
|
|
@@ -3467,7 +3563,7 @@ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
|
3467
3563
|
const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
|
|
3468
3564
|
const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) || isBeforeNavStart || isAfterNavEnd || // Broadcast calendar will show outside days as default
|
|
3469
3565
|
!broadcastCalendar && !showOutsideDays && isOutside || broadcastCalendar && showOutsideDays === false && isOutside;
|
|
3470
|
-
const isToday = isSameDay2(date, today
|
|
3566
|
+
const isToday = isSameDay2(date, today);
|
|
3471
3567
|
if (isOutside)
|
|
3472
3568
|
internalModifiersMap.outside.push(day);
|
|
3473
3569
|
if (isDisabled)
|
|
@@ -3633,70 +3729,6 @@ function getFormatters(customFormatters) {
|
|
|
3633
3729
|
return __spreadValues(__spreadValues({}, formatters_exports), customFormatters);
|
|
3634
3730
|
}
|
|
3635
3731
|
|
|
3636
|
-
// node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js
|
|
3637
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters2, dateLib) {
|
|
3638
|
-
const { startOfMonth: startOfMonth2, startOfYear: startOfYear2, endOfYear: endOfYear2, eachMonthOfInterval: eachMonthOfInterval2, getMonth: getMonth2 } = dateLib;
|
|
3639
|
-
const months = eachMonthOfInterval2({
|
|
3640
|
-
start: startOfYear2(displayMonth),
|
|
3641
|
-
end: endOfYear2(displayMonth)
|
|
3642
|
-
});
|
|
3643
|
-
const options = months.map((month) => {
|
|
3644
|
-
const label = formatters2.formatMonthDropdown(month, dateLib);
|
|
3645
|
-
const value = getMonth2(month);
|
|
3646
|
-
const disabled = navStart && month < startOfMonth2(navStart) || navEnd && month > startOfMonth2(navEnd) || false;
|
|
3647
|
-
return { value, label, disabled };
|
|
3648
|
-
});
|
|
3649
|
-
return options;
|
|
3650
|
-
}
|
|
3651
|
-
|
|
3652
|
-
// node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js
|
|
3653
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
3654
|
-
let style = __spreadValues({}, styles == null ? void 0 : styles[UI.Day]);
|
|
3655
|
-
Object.entries(dayModifiers).filter(([, active]) => active === true).forEach(([modifier]) => {
|
|
3656
|
-
style = __spreadValues(__spreadValues({}, style), modifiersStyles == null ? void 0 : modifiersStyles[modifier]);
|
|
3657
|
-
});
|
|
3658
|
-
return style;
|
|
3659
|
-
}
|
|
3660
|
-
|
|
3661
|
-
// node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js
|
|
3662
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
3663
|
-
const today = dateLib.today();
|
|
3664
|
-
const start = broadcastCalendar ? dateLib.startOfBroadcastWeek(today, dateLib) : ISOWeek ? dateLib.startOfISOWeek(today) : dateLib.startOfWeek(today);
|
|
3665
|
-
const days = [];
|
|
3666
|
-
for (let i = 0; i < 7; i++) {
|
|
3667
|
-
const day = dateLib.addDays(start, i);
|
|
3668
|
-
days.push(day);
|
|
3669
|
-
}
|
|
3670
|
-
return days;
|
|
3671
|
-
}
|
|
3672
|
-
|
|
3673
|
-
// node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js
|
|
3674
|
-
function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false) {
|
|
3675
|
-
if (!navStart)
|
|
3676
|
-
return void 0;
|
|
3677
|
-
if (!navEnd)
|
|
3678
|
-
return void 0;
|
|
3679
|
-
const { startOfYear: startOfYear2, endOfYear: endOfYear2, addYears: addYears2, getYear: getYear2, isBefore: isBefore2, isSameYear: isSameYear2 } = dateLib;
|
|
3680
|
-
const firstNavYear = startOfYear2(navStart);
|
|
3681
|
-
const lastNavYear = endOfYear2(navEnd);
|
|
3682
|
-
const years = [];
|
|
3683
|
-
let year = firstNavYear;
|
|
3684
|
-
while (isBefore2(year, lastNavYear) || isSameYear2(year, lastNavYear)) {
|
|
3685
|
-
years.push(year);
|
|
3686
|
-
year = addYears2(year, 1);
|
|
3687
|
-
}
|
|
3688
|
-
if (reverse)
|
|
3689
|
-
years.reverse();
|
|
3690
|
-
return years.map((year2) => {
|
|
3691
|
-
const label = formatters2.formatYearDropdown(year2, dateLib);
|
|
3692
|
-
return {
|
|
3693
|
-
value: getYear2(year2),
|
|
3694
|
-
label,
|
|
3695
|
-
disabled: false
|
|
3696
|
-
};
|
|
3697
|
-
});
|
|
3698
|
-
}
|
|
3699
|
-
|
|
3700
3732
|
// node_modules/react-day-picker/dist/esm/labels/index.js
|
|
3701
3733
|
var labels_exports = {};
|
|
3702
3734
|
__export(labels_exports, {
|
|
@@ -3753,8 +3785,9 @@ function labelNav() {
|
|
|
3753
3785
|
}
|
|
3754
3786
|
|
|
3755
3787
|
// node_modules/react-day-picker/dist/esm/labels/labelNext.js
|
|
3756
|
-
|
|
3757
|
-
|
|
3788
|
+
var defaultLabel = "Go to the Next Month";
|
|
3789
|
+
function labelNext(_month, _options) {
|
|
3790
|
+
return defaultLabel;
|
|
3758
3791
|
}
|
|
3759
3792
|
|
|
3760
3793
|
// node_modules/react-day-picker/dist/esm/labels/labelPrevious.js
|
|
@@ -3782,6 +3815,234 @@ function labelYearDropdown(_options) {
|
|
|
3782
3815
|
return "Choose the Year";
|
|
3783
3816
|
}
|
|
3784
3817
|
|
|
3818
|
+
// node_modules/react-day-picker/dist/esm/helpers/getLabels.js
|
|
3819
|
+
var resolveLabel = (defaultLabel2, customLabel, localeLabel) => {
|
|
3820
|
+
if (customLabel)
|
|
3821
|
+
return customLabel;
|
|
3822
|
+
if (localeLabel) {
|
|
3823
|
+
return typeof localeLabel === "function" ? localeLabel : (..._args) => localeLabel;
|
|
3824
|
+
}
|
|
3825
|
+
return defaultLabel2;
|
|
3826
|
+
};
|
|
3827
|
+
function getLabels(customLabels, options) {
|
|
3828
|
+
var _a, _b;
|
|
3829
|
+
const localeLabels = (_b = (_a = options.locale) == null ? void 0 : _a.labels) != null ? _b : {};
|
|
3830
|
+
return __spreadProps(__spreadValues(__spreadValues({}, labels_exports), customLabels != null ? customLabels : {}), {
|
|
3831
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels == null ? void 0 : customLabels.labelDayButton, localeLabels.labelDayButton),
|
|
3832
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels == null ? void 0 : customLabels.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
3833
|
+
labelNext: resolveLabel(labelNext, customLabels == null ? void 0 : customLabels.labelNext, localeLabels.labelNext),
|
|
3834
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels == null ? void 0 : customLabels.labelPrevious, localeLabels.labelPrevious),
|
|
3835
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels == null ? void 0 : customLabels.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
3836
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels == null ? void 0 : customLabels.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
3837
|
+
labelGrid: resolveLabel(labelGrid, customLabels == null ? void 0 : customLabels.labelGrid, localeLabels.labelGrid),
|
|
3838
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels == null ? void 0 : customLabels.labelGridcell, localeLabels.labelGridcell),
|
|
3839
|
+
labelNav: resolveLabel(labelNav, customLabels == null ? void 0 : customLabels.labelNav, localeLabels.labelNav),
|
|
3840
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels == null ? void 0 : customLabels.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
3841
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels == null ? void 0 : customLabels.labelWeekday, localeLabels.labelWeekday)
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
|
|
3845
|
+
// node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js
|
|
3846
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters2, dateLib) {
|
|
3847
|
+
const { startOfMonth: startOfMonth2, startOfYear: startOfYear2, endOfYear: endOfYear2, eachMonthOfInterval: eachMonthOfInterval2, getMonth: getMonth2 } = dateLib;
|
|
3848
|
+
const months = eachMonthOfInterval2({
|
|
3849
|
+
start: startOfYear2(displayMonth),
|
|
3850
|
+
end: endOfYear2(displayMonth)
|
|
3851
|
+
});
|
|
3852
|
+
const options = months.map((month) => {
|
|
3853
|
+
const label = formatters2.formatMonthDropdown(month, dateLib);
|
|
3854
|
+
const value = getMonth2(month);
|
|
3855
|
+
const disabled = navStart && month < startOfMonth2(navStart) || navEnd && month > startOfMonth2(navEnd) || false;
|
|
3856
|
+
return { value, label, disabled };
|
|
3857
|
+
});
|
|
3858
|
+
return options;
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
// node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js
|
|
3862
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
3863
|
+
let style = __spreadValues({}, styles == null ? void 0 : styles[UI.Day]);
|
|
3864
|
+
Object.entries(dayModifiers).filter(([, active]) => active === true).forEach(([modifier]) => {
|
|
3865
|
+
style = __spreadValues(__spreadValues({}, style), modifiersStyles == null ? void 0 : modifiersStyles[modifier]);
|
|
3866
|
+
});
|
|
3867
|
+
return style;
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3870
|
+
// node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js
|
|
3871
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
3872
|
+
const referenceToday = today != null ? today : dateLib.today();
|
|
3873
|
+
const start = broadcastCalendar ? dateLib.startOfBroadcastWeek(referenceToday, dateLib) : ISOWeek ? dateLib.startOfISOWeek(referenceToday) : dateLib.startOfWeek(referenceToday);
|
|
3874
|
+
const days = [];
|
|
3875
|
+
for (let i = 0; i < 7; i++) {
|
|
3876
|
+
const day = dateLib.addDays(start, i);
|
|
3877
|
+
days.push(day);
|
|
3878
|
+
}
|
|
3879
|
+
return days;
|
|
3880
|
+
}
|
|
3881
|
+
|
|
3882
|
+
// node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js
|
|
3883
|
+
function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false) {
|
|
3884
|
+
if (!navStart)
|
|
3885
|
+
return void 0;
|
|
3886
|
+
if (!navEnd)
|
|
3887
|
+
return void 0;
|
|
3888
|
+
const { startOfYear: startOfYear2, endOfYear: endOfYear2, eachYearOfInterval: eachYearOfInterval2, getYear: getYear2 } = dateLib;
|
|
3889
|
+
const firstNavYear = startOfYear2(navStart);
|
|
3890
|
+
const lastNavYear = endOfYear2(navEnd);
|
|
3891
|
+
const years = eachYearOfInterval2({ start: firstNavYear, end: lastNavYear });
|
|
3892
|
+
if (reverse)
|
|
3893
|
+
years.reverse();
|
|
3894
|
+
return years.map((year) => {
|
|
3895
|
+
const label = formatters2.formatYearDropdown(year, dateLib);
|
|
3896
|
+
return {
|
|
3897
|
+
value: getYear2(year),
|
|
3898
|
+
label,
|
|
3899
|
+
disabled: false
|
|
3900
|
+
};
|
|
3901
|
+
});
|
|
3902
|
+
}
|
|
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
|
+
|
|
3785
4046
|
// node_modules/react-day-picker/dist/esm/useAnimation.js
|
|
3786
4047
|
var import_react28 = require("react");
|
|
3787
4048
|
var asHtmlElement = (element) => {
|
|
@@ -3923,15 +4184,14 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
3923
4184
|
const { ISOWeek, fixedWeeks, broadcastCalendar } = props != null ? props : {};
|
|
3924
4185
|
const { addDays: addDays2, differenceInCalendarDays: differenceInCalendarDays2, differenceInCalendarMonths: differenceInCalendarMonths2, endOfBroadcastWeek: endOfBroadcastWeek2, endOfISOWeek: endOfISOWeek2, endOfMonth: endOfMonth2, endOfWeek: endOfWeek2, isAfter: isAfter2, startOfBroadcastWeek: startOfBroadcastWeek2, startOfISOWeek: startOfISOWeek2, startOfWeek: startOfWeek2 } = dateLib;
|
|
3925
4186
|
const startWeekFirstDate = broadcastCalendar ? startOfBroadcastWeek2(firstMonth, dateLib) : ISOWeek ? startOfISOWeek2(firstMonth) : startOfWeek2(firstMonth);
|
|
3926
|
-
const
|
|
3927
|
-
const
|
|
4187
|
+
const displayMonthsWeekEnd = broadcastCalendar ? endOfBroadcastWeek2(lastMonth) : ISOWeek ? endOfISOWeek2(endOfMonth2(lastMonth)) : endOfWeek2(endOfMonth2(lastMonth));
|
|
4188
|
+
const constraintWeekEnd = maxDate && (broadcastCalendar ? endOfBroadcastWeek2(maxDate) : ISOWeek ? endOfISOWeek2(maxDate) : endOfWeek2(maxDate));
|
|
4189
|
+
const gridEndDate = constraintWeekEnd && isAfter2(displayMonthsWeekEnd, constraintWeekEnd) ? constraintWeekEnd : displayMonthsWeekEnd;
|
|
4190
|
+
const nOfDays = differenceInCalendarDays2(gridEndDate, startWeekFirstDate);
|
|
3928
4191
|
const nOfMonths = differenceInCalendarMonths2(lastMonth, firstMonth) + 1;
|
|
3929
4192
|
const dates = [];
|
|
3930
4193
|
for (let i = 0; i <= nOfDays; i++) {
|
|
3931
4194
|
const date = addDays2(startWeekFirstDate, i);
|
|
3932
|
-
if (maxDate && isAfter2(date, maxDate)) {
|
|
3933
|
-
break;
|
|
3934
|
-
}
|
|
3935
4195
|
dates.push(date);
|
|
3936
4196
|
}
|
|
3937
4197
|
const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;
|
|
@@ -4120,6 +4380,7 @@ function useControlledValue(defaultValue, controlledValue) {
|
|
|
4120
4380
|
|
|
4121
4381
|
// node_modules/react-day-picker/dist/esm/useCalendar.js
|
|
4122
4382
|
function useCalendar(props, dateLib) {
|
|
4383
|
+
var _a;
|
|
4123
4384
|
const [navStart, navEnd] = getNavMonths(props, dateLib);
|
|
4124
4385
|
const { startOfMonth: startOfMonth2, endOfMonth: endOfMonth2 } = dateLib;
|
|
4125
4386
|
const initialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
@@ -4132,13 +4393,44 @@ function useCalendar(props, dateLib) {
|
|
|
4132
4393
|
const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
4133
4394
|
setFirstMonth(newInitialMonth);
|
|
4134
4395
|
}, [props.timeZone]);
|
|
4135
|
-
const
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4396
|
+
const { months, weeks, days, previousMonth, nextMonth } = (0, import_react30.useMemo)(() => {
|
|
4397
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
4398
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth2(props.endMonth) : void 0, {
|
|
4399
|
+
ISOWeek: props.ISOWeek,
|
|
4400
|
+
fixedWeeks: props.fixedWeeks,
|
|
4401
|
+
broadcastCalendar: props.broadcastCalendar
|
|
4402
|
+
}, dateLib);
|
|
4403
|
+
const months2 = getMonths(displayMonths, dates, {
|
|
4404
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
4405
|
+
fixedWeeks: props.fixedWeeks,
|
|
4406
|
+
ISOWeek: props.ISOWeek,
|
|
4407
|
+
reverseMonths: props.reverseMonths
|
|
4408
|
+
}, dateLib);
|
|
4409
|
+
const weeks2 = getWeeks(months2);
|
|
4410
|
+
const days2 = getDays(months2);
|
|
4411
|
+
const previousMonth2 = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
4412
|
+
const nextMonth2 = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
4413
|
+
return {
|
|
4414
|
+
months: months2,
|
|
4415
|
+
weeks: weeks2,
|
|
4416
|
+
days: days2,
|
|
4417
|
+
previousMonth: previousMonth2,
|
|
4418
|
+
nextMonth: nextMonth2
|
|
4419
|
+
};
|
|
4420
|
+
}, [
|
|
4421
|
+
dateLib,
|
|
4422
|
+
firstMonth.getTime(),
|
|
4423
|
+
navEnd == null ? void 0 : navEnd.getTime(),
|
|
4424
|
+
navStart == null ? void 0 : navStart.getTime(),
|
|
4425
|
+
props.disableNavigation,
|
|
4426
|
+
props.broadcastCalendar,
|
|
4427
|
+
(_a = props.endMonth) == null ? void 0 : _a.getTime(),
|
|
4428
|
+
props.fixedWeeks,
|
|
4429
|
+
props.ISOWeek,
|
|
4430
|
+
props.numberOfMonths,
|
|
4431
|
+
props.pagedNavigation,
|
|
4432
|
+
props.reverseMonths
|
|
4433
|
+
]);
|
|
4142
4434
|
const { disableNavigation, onMonthChange } = props;
|
|
4143
4435
|
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
4144
4436
|
const goToMonth = (date) => {
|
|
@@ -4269,6 +4561,12 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
4269
4561
|
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
4270
4562
|
if (!nextFocus)
|
|
4271
4563
|
return;
|
|
4564
|
+
if (props.disableNavigation) {
|
|
4565
|
+
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
4566
|
+
if (!isNextInCalendar) {
|
|
4567
|
+
return;
|
|
4568
|
+
}
|
|
4569
|
+
}
|
|
4272
4570
|
calendar.goToDay(nextFocus);
|
|
4273
4571
|
setFocused(nextFocus);
|
|
4274
4572
|
};
|
|
@@ -4529,54 +4827,138 @@ function useSelection(props, dateLib) {
|
|
|
4529
4827
|
}
|
|
4530
4828
|
}
|
|
4531
4829
|
|
|
4830
|
+
// node_modules/react-day-picker/dist/esm/utils/toTimeZone.js
|
|
4831
|
+
function toTimeZone(date, timeZone) {
|
|
4832
|
+
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
4833
|
+
return date;
|
|
4834
|
+
}
|
|
4835
|
+
return new TZDate(date, timeZone);
|
|
4836
|
+
}
|
|
4837
|
+
|
|
4838
|
+
// node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js
|
|
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) {
|
|
4847
|
+
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
4848
|
+
return matcher;
|
|
4849
|
+
}
|
|
4850
|
+
if (matcher instanceof Date) {
|
|
4851
|
+
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
4852
|
+
}
|
|
4853
|
+
if (Array.isArray(matcher)) {
|
|
4854
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
4855
|
+
}
|
|
4856
|
+
if (isDateRange(matcher)) {
|
|
4857
|
+
return __spreadProps(__spreadValues({}, matcher), {
|
|
4858
|
+
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
4859
|
+
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to
|
|
4860
|
+
});
|
|
4861
|
+
}
|
|
4862
|
+
if (isDateInterval(matcher)) {
|
|
4863
|
+
return {
|
|
4864
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
4865
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe)
|
|
4866
|
+
};
|
|
4867
|
+
}
|
|
4868
|
+
if (isDateAfterType(matcher)) {
|
|
4869
|
+
return {
|
|
4870
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe)
|
|
4871
|
+
};
|
|
4872
|
+
}
|
|
4873
|
+
if (isDateBeforeType(matcher)) {
|
|
4874
|
+
return {
|
|
4875
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe)
|
|
4876
|
+
};
|
|
4877
|
+
}
|
|
4878
|
+
return matcher;
|
|
4879
|
+
}
|
|
4880
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
4881
|
+
if (!matchers) {
|
|
4882
|
+
return matchers;
|
|
4883
|
+
}
|
|
4884
|
+
if (Array.isArray(matchers)) {
|
|
4885
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
4886
|
+
}
|
|
4887
|
+
return convertMatcher(matchers, timeZone, noonSafe);
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4532
4890
|
// node_modules/react-day-picker/dist/esm/DayPicker.js
|
|
4533
4891
|
function DayPicker(initialProps) {
|
|
4534
4892
|
var _a, _b;
|
|
4535
4893
|
let props = initialProps;
|
|
4536
|
-
|
|
4537
|
-
|
|
4894
|
+
const timeZone = props.timeZone;
|
|
4895
|
+
if (timeZone) {
|
|
4896
|
+
props = __spreadProps(__spreadValues({}, initialProps), {
|
|
4897
|
+
timeZone
|
|
4898
|
+
});
|
|
4538
4899
|
if (props.today) {
|
|
4539
|
-
props.today =
|
|
4900
|
+
props.today = toTimeZone(props.today, timeZone);
|
|
4540
4901
|
}
|
|
4541
4902
|
if (props.month) {
|
|
4542
|
-
props.month =
|
|
4903
|
+
props.month = toTimeZone(props.month, timeZone);
|
|
4543
4904
|
}
|
|
4544
4905
|
if (props.defaultMonth) {
|
|
4545
|
-
props.defaultMonth =
|
|
4906
|
+
props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
|
|
4546
4907
|
}
|
|
4547
4908
|
if (props.startMonth) {
|
|
4548
|
-
props.startMonth =
|
|
4909
|
+
props.startMonth = toTimeZone(props.startMonth, timeZone);
|
|
4549
4910
|
}
|
|
4550
4911
|
if (props.endMonth) {
|
|
4551
|
-
props.endMonth =
|
|
4912
|
+
props.endMonth = toTimeZone(props.endMonth, timeZone);
|
|
4552
4913
|
}
|
|
4553
4914
|
if (props.mode === "single" && props.selected) {
|
|
4554
|
-
props.selected =
|
|
4915
|
+
props.selected = toTimeZone(props.selected, timeZone);
|
|
4555
4916
|
} else if (props.mode === "multiple" && props.selected) {
|
|
4556
|
-
props.selected = (_a = props.selected) == null ? void 0 : _a.map((date) =>
|
|
4917
|
+
props.selected = (_a = props.selected) == null ? void 0 : _a.map((date) => toTimeZone(date, timeZone));
|
|
4557
4918
|
} else if (props.mode === "range" && props.selected) {
|
|
4558
4919
|
props.selected = {
|
|
4559
|
-
from: props.selected.from ?
|
|
4560
|
-
to: props.selected.to ?
|
|
4920
|
+
from: props.selected.from ? toTimeZone(props.selected.from, timeZone) : props.selected.from,
|
|
4921
|
+
to: props.selected.to ? toTimeZone(props.selected.to, timeZone) : props.selected.to
|
|
4561
4922
|
};
|
|
4562
4923
|
}
|
|
4924
|
+
if (props.disabled !== void 0) {
|
|
4925
|
+
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
4926
|
+
}
|
|
4927
|
+
if (props.hidden !== void 0) {
|
|
4928
|
+
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
4929
|
+
}
|
|
4930
|
+
if (props.modifiers) {
|
|
4931
|
+
const nextModifiers = {};
|
|
4932
|
+
Object.keys(props.modifiers).forEach((key) => {
|
|
4933
|
+
var _a2;
|
|
4934
|
+
nextModifiers[key] = convertMatchersToTimeZone((_a2 = props.modifiers) == null ? void 0 : _a2[key], timeZone);
|
|
4935
|
+
});
|
|
4936
|
+
props.modifiers = nextModifiers;
|
|
4937
|
+
}
|
|
4563
4938
|
}
|
|
4564
4939
|
const { components, formatters: formatters2, labels, dateLib, locale, classNames } = (0, import_react32.useMemo)(() => {
|
|
4565
|
-
|
|
4940
|
+
var _a2;
|
|
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;
|
|
4566
4948
|
const dateLib2 = new DateLib({
|
|
4567
4949
|
locale: locale2,
|
|
4568
|
-
weekStartsOn
|
|
4950
|
+
weekStartsOn,
|
|
4569
4951
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
4570
4952
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
4571
4953
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
4572
4954
|
timeZone: props.timeZone,
|
|
4573
4955
|
numerals: props.numerals
|
|
4574
|
-
},
|
|
4956
|
+
}, overrides);
|
|
4575
4957
|
return {
|
|
4576
4958
|
dateLib: dateLib2,
|
|
4577
4959
|
components: getComponents(props.components),
|
|
4578
4960
|
formatters: getFormatters(props.formatters),
|
|
4579
|
-
labels:
|
|
4961
|
+
labels: getLabels(props.labels, dateLib2.options),
|
|
4580
4962
|
locale: locale2,
|
|
4581
4963
|
classNames: __spreadValues(__spreadValues({}, getDefaultClassNames()), props.classNames)
|
|
4582
4964
|
};
|
|
@@ -4590,20 +4972,24 @@ function DayPicker(initialProps) {
|
|
|
4590
4972
|
props.timeZone,
|
|
4591
4973
|
props.numerals,
|
|
4592
4974
|
props.dateLib,
|
|
4975
|
+
props.noonSafe,
|
|
4593
4976
|
props.components,
|
|
4594
4977
|
props.formatters,
|
|
4595
4978
|
props.labels,
|
|
4596
4979
|
props.classNames
|
|
4597
4980
|
]);
|
|
4981
|
+
if (!props.today) {
|
|
4982
|
+
props = __spreadProps(__spreadValues({}, props), { today: dateLib.today() });
|
|
4983
|
+
}
|
|
4598
4984
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles } = props;
|
|
4599
4985
|
const { formatCaption: formatCaption2, formatDay: formatDay2, formatMonthDropdown: formatMonthDropdown2, formatWeekNumber: formatWeekNumber2, formatWeekNumberHeader: formatWeekNumberHeader2, formatWeekdayName: formatWeekdayName2, formatYearDropdown: formatYearDropdown2 } = formatters2;
|
|
4600
4986
|
const calendar = useCalendar(props, dateLib);
|
|
4601
4987
|
const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth } = calendar;
|
|
4602
4988
|
const getModifiers = createGetModifiers(days, props, navStart, navEnd, dateLib);
|
|
4603
4989
|
const { isSelected, select, selected: selectedValue } = (_b = useSelection(props, dateLib)) != null ? _b : {};
|
|
4604
|
-
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected != null ? isSelected : () => false, dateLib);
|
|
4990
|
+
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected != null ? isSelected : (() => false), dateLib);
|
|
4605
4991
|
const { labelDayButton: labelDayButton2, labelGridcell: labelGridcell2, labelGrid: labelGrid2, labelMonthDropdown: labelMonthDropdown2, labelNav: labelNav2, labelPrevious: labelPrevious2, labelNext: labelNext2, labelWeekday: labelWeekday2, labelWeekNumber: labelWeekNumber2, labelWeekNumberHeader: labelWeekNumberHeader2, labelYearDropdown: labelYearDropdown2 } = labels;
|
|
4606
|
-
const weekdays = (0, import_react32.useMemo)(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
4992
|
+
const weekdays = (0, import_react32.useMemo)(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
4607
4993
|
const isInteractive = mode !== void 0 || onDayClick !== void 0;
|
|
4608
4994
|
const handlePreviousClick = (0, import_react32.useCallback)(() => {
|
|
4609
4995
|
if (!previousMonth)
|
|
@@ -4621,6 +5007,9 @@ function DayPicker(initialProps) {
|
|
|
4621
5007
|
e.preventDefault();
|
|
4622
5008
|
e.stopPropagation();
|
|
4623
5009
|
setFocused(day);
|
|
5010
|
+
if (m.disabled) {
|
|
5011
|
+
return;
|
|
5012
|
+
}
|
|
4624
5013
|
select == null ? void 0 : select(day.date, m, e);
|
|
4625
5014
|
onDayClick == null ? void 0 : onDayClick(day.date, m, e);
|
|
4626
5015
|
}, [select, onDayClick, setFocused]);
|
|
@@ -4749,10 +5138,7 @@ function DayPicker(initialProps) {
|
|
|
4749
5138
|
whiteSpace: "nowrap",
|
|
4750
5139
|
wordWrap: "normal"
|
|
4751
5140
|
} }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
|
|
4752
|
-
) : (
|
|
4753
|
-
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
4754
|
-
import_react32.default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
|
|
4755
|
-
)),
|
|
5141
|
+
) : import_react32.default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))),
|
|
4756
5142
|
navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 && import_react32.default.createElement(
|
|
4757
5143
|
components.NextMonthButton,
|
|
4758
5144
|
{ type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : void 0 },
|
|
@@ -4772,8 +5158,7 @@ function DayPicker(initialProps) {
|
|
|
4772
5158
|
return import_react32.default.createElement(
|
|
4773
5159
|
components.Week,
|
|
4774
5160
|
{ className: classNames[UI.Week], key: week.weekNumber, style: styles == null ? void 0 : styles[UI.Week], week },
|
|
4775
|
-
showWeekNumber &&
|
|
4776
|
-
import_react32.default.createElement(components.WeekNumber, { week, style: styles == null ? void 0 : styles[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
|
|
5161
|
+
showWeekNumber && import_react32.default.createElement(components.WeekNumber, { week, style: styles == null ? void 0 : styles[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
|
|
4777
5162
|
locale
|
|
4778
5163
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber2(week.weekNumber, dateLib)),
|
|
4779
5164
|
week.days.map((day) => {
|
|
@@ -4790,10 +5175,7 @@ function DayPicker(initialProps) {
|
|
|
4790
5175
|
const style2 = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
|
|
4791
5176
|
const className2 = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
|
|
4792
5177
|
const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell2(date, modifiers, dateLib.options, dateLib) : void 0;
|
|
4793
|
-
return (
|
|
4794
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
4795
|
-
import_react32.default.createElement(components.Day, { key: `${dateLib.format(date, "yyyy-MM-dd")}_${dateLib.format(day.displayMonth, "yyyy-MM")}`, day, modifiers, className: className2.join(" "), style: style2, role: "gridcell", "aria-selected": modifiers.selected || void 0, "aria-label": ariaLabel, "data-day": dateLib.format(date, "yyyy-MM-dd"), "data-month": day.outside ? dateLib.format(date, "yyyy-MM") : void 0, "data-selected": modifiers.selected || void 0, "data-disabled": modifiers.disabled || void 0, "data-hidden": modifiers.hidden || void 0, "data-outside": day.outside || void 0, "data-focused": modifiers.focused || void 0, "data-today": modifiers.today || void 0 }, !modifiers.hidden && isInteractive ? import_react32.default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles == null ? void 0 : styles[UI.DayButton], type: "button", day, modifiers, disabled: modifiers.disabled || void 0, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton2(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay2(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay2(day.date, dateLib.options, dateLib))
|
|
4796
|
-
);
|
|
5178
|
+
return import_react32.default.createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day, modifiers, className: className2.join(" "), style: style2, role: "gridcell", "aria-selected": modifiers.selected || void 0, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : void 0, "data-selected": modifiers.selected || void 0, "data-disabled": modifiers.disabled || void 0, "data-hidden": modifiers.hidden || void 0, "data-outside": day.outside || void 0, "data-focused": modifiers.focused || void 0, "data-today": modifiers.today || void 0 }, !modifiers.hidden && isInteractive ? import_react32.default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles == null ? void 0 : styles[UI.DayButton], type: "button", day, modifiers, disabled: !modifiers.focused && modifiers.disabled || void 0, "aria-disabled": modifiers.focused && modifiers.disabled || void 0, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton2(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay2(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay2(day.date, dateLib.options, dateLib));
|
|
4797
5179
|
})
|
|
4798
5180
|
);
|
|
4799
5181
|
}))
|
|
@@ -4801,8 +5183,7 @@ function DayPicker(initialProps) {
|
|
|
4801
5183
|
);
|
|
4802
5184
|
})
|
|
4803
5185
|
),
|
|
4804
|
-
props.footer &&
|
|
4805
|
-
import_react32.default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles == null ? void 0 : styles[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
|
|
5186
|
+
props.footer && import_react32.default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles == null ? void 0 : styles[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
|
|
4806
5187
|
)
|
|
4807
5188
|
);
|
|
4808
5189
|
}
|
|
@@ -5851,7 +6232,7 @@ var Input = React41.forwardRef(
|
|
|
5851
6232
|
]);
|
|
5852
6233
|
const base = "block w-full bg-transparent text-foreground placeholder:text-muted-foreground outline-none transition disabled:opacity-50 disabled:cursor-not-allowed";
|
|
5853
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";
|
|
5854
|
-
const
|
|
6235
|
+
const variants4 = {
|
|
5855
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",
|
|
5856
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",
|
|
5857
6238
|
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
@@ -5894,13 +6275,14 @@ var Input = React41.forwardRef(
|
|
|
5894
6275
|
disabled,
|
|
5895
6276
|
className: classNameDefault ? cn(
|
|
5896
6277
|
base,
|
|
5897
|
-
|
|
6278
|
+
variants4[variant],
|
|
5898
6279
|
variant === "flushed" ? specialSizeForFlushed : variant === "link" ? specialSizeForLink : sizeCls,
|
|
5899
6280
|
errorCls,
|
|
5900
6281
|
iconPadLeft,
|
|
5901
6282
|
iconPadRight,
|
|
5902
6283
|
className
|
|
5903
|
-
) : className
|
|
6284
|
+
) : className,
|
|
6285
|
+
"data-private": true
|
|
5904
6286
|
}, props)
|
|
5905
6287
|
),
|
|
5906
6288
|
trailing ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -6000,7 +6382,7 @@ var FormField = (_a) => {
|
|
|
6000
6382
|
import_lucide_react2.Asterisk,
|
|
6001
6383
|
{
|
|
6002
6384
|
className: cn(
|
|
6003
|
-
"ml-
|
|
6385
|
+
"ml-px h-3 w-3 text-red-500",
|
|
6004
6386
|
requiredLabelClassName
|
|
6005
6387
|
)
|
|
6006
6388
|
}
|
|
@@ -6204,7 +6586,7 @@ var FormSelect = ({
|
|
|
6204
6586
|
import_lucide_react2.Asterisk,
|
|
6205
6587
|
{
|
|
6206
6588
|
className: cn(
|
|
6207
|
-
"ml-
|
|
6589
|
+
"ml-1 h-3 w-3 text-red-500",
|
|
6208
6590
|
requiredLabelClassName
|
|
6209
6591
|
)
|
|
6210
6592
|
}
|
|
@@ -6382,7 +6764,8 @@ var InputOTPSlot = React44.forwardRef((_a, ref) => {
|
|
|
6382
6764
|
"relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
|
|
6383
6765
|
isActive && "z-10 ring-1 ring-ring",
|
|
6384
6766
|
className
|
|
6385
|
-
)
|
|
6767
|
+
),
|
|
6768
|
+
"data-private": true
|
|
6386
6769
|
}, props), {
|
|
6387
6770
|
children: [
|
|
6388
6771
|
char,
|
|
@@ -7002,12 +7385,9 @@ var ResizablePanelGroup = (_a) => {
|
|
|
7002
7385
|
"className"
|
|
7003
7386
|
]);
|
|
7004
7387
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7005
|
-
ResizablePrimitive.
|
|
7388
|
+
ResizablePrimitive.Group,
|
|
7006
7389
|
__spreadValues({
|
|
7007
|
-
className: cn(
|
|
7008
|
-
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
7009
|
-
className
|
|
7010
|
-
)
|
|
7390
|
+
className: cn("flex h-full w-full aria-[orientation=vertical]:flex-col", className)
|
|
7011
7391
|
}, props)
|
|
7012
7392
|
);
|
|
7013
7393
|
};
|
|
@@ -7021,7 +7401,7 @@ var ResizableHandle = (_a) => {
|
|
|
7021
7401
|
"className"
|
|
7022
7402
|
]);
|
|
7023
7403
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7024
|
-
ResizablePrimitive.
|
|
7404
|
+
ResizablePrimitive.Separator,
|
|
7025
7405
|
__spreadProps(__spreadValues({
|
|
7026
7406
|
className: cn(
|
|
7027
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",
|
|
@@ -7175,7 +7555,7 @@ var SelectContent = React54.forwardRef((_a, ref) => {
|
|
|
7175
7555
|
__spreadProps(__spreadValues({
|
|
7176
7556
|
ref,
|
|
7177
7557
|
className: cn(
|
|
7178
|
-
"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",
|
|
7179
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",
|
|
7180
7560
|
className
|
|
7181
7561
|
),
|
|
@@ -7188,7 +7568,7 @@ var SelectContent = React54.forwardRef((_a, ref) => {
|
|
|
7188
7568
|
{
|
|
7189
7569
|
className: cn(
|
|
7190
7570
|
"p-1",
|
|
7191
|
-
position === "popper" && "h-
|
|
7571
|
+
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
|
7192
7572
|
),
|
|
7193
7573
|
children
|
|
7194
7574
|
}
|
|
@@ -7217,7 +7597,7 @@ var SelectItem = React54.forwardRef((_a, ref) => {
|
|
|
7217
7597
|
__spreadProps(__spreadValues({
|
|
7218
7598
|
ref,
|
|
7219
7599
|
className: cn(
|
|
7220
|
-
"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",
|
|
7221
7601
|
className
|
|
7222
7602
|
)
|
|
7223
7603
|
}, props), {
|
|
@@ -7245,7 +7625,7 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
7245
7625
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
7246
7626
|
var React55 = __toESM(require("react"), 1);
|
|
7247
7627
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
7248
|
-
var
|
|
7628
|
+
var Separator6 = React55.forwardRef(
|
|
7249
7629
|
(_a, ref) => {
|
|
7250
7630
|
var _b = _a, { className, orientation = "horizontal", decorative = true } = _b, props = __objRest(_b, ["className", "orientation", "decorative"]);
|
|
7251
7631
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
@@ -7263,7 +7643,7 @@ var Separator5 = React55.forwardRef(
|
|
|
7263
7643
|
);
|
|
7264
7644
|
}
|
|
7265
7645
|
);
|
|
7266
|
-
|
|
7646
|
+
Separator6.displayName = SeparatorPrimitive.Root.displayName;
|
|
7267
7647
|
|
|
7268
7648
|
// src/components/sheet.tsx
|
|
7269
7649
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
@@ -8063,9 +8443,9 @@ function DataTable({
|
|
|
8063
8443
|
if (onPageChange) {
|
|
8064
8444
|
onPageChange(pagination.pageIndex + 1);
|
|
8065
8445
|
}
|
|
8066
|
-
}, [pagination]);
|
|
8067
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
8068
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.
|
|
8446
|
+
}, [pagination, onPageChange]);
|
|
8447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("rounded-md border bg-background flex flex-col", className), children: [
|
|
8448
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(ScrollArea, { className: "h-[calc(80vh-220px)] md:h-[calc(80dvh-80px)]", children: [
|
|
8069
8449
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Table, { className: cn("relative", tableClassName), children: [
|
|
8070
8450
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableHeader, { className: headerClassName, children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { className: rowClassName, children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableHead, { className: headerClassName, children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
|
|
8071
8451
|
header.column.columnDef.header,
|
|
@@ -8093,23 +8473,26 @@ function DataTable({
|
|
|
8093
8473
|
) }) })
|
|
8094
8474
|
] }),
|
|
8095
8475
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScrollBar, { orientation: "horizontal" })
|
|
8096
|
-
] })
|
|
8097
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "
|
|
8098
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex
|
|
8099
|
-
isRowsSelected
|
|
8476
|
+
] }),
|
|
8477
|
+
/* @__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: [
|
|
8478
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
|
|
8479
|
+
isRowsSelected && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-muted-foreground text-sm", children: [
|
|
8100
8480
|
table.getFilteredSelectedRowModel().rows.length,
|
|
8101
8481
|
" ",
|
|
8102
8482
|
ofLabel,
|
|
8103
8483
|
" ",
|
|
8104
8484
|
table.getFilteredRowModel().rows.length,
|
|
8105
|
-
" "
|
|
8106
|
-
|
|
8485
|
+
" ",
|
|
8486
|
+
rowsSelectedLabel
|
|
8487
|
+
] }),
|
|
8107
8488
|
totalRows ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-sm text-muted-foreground", children: [
|
|
8108
8489
|
"Total: ",
|
|
8109
8490
|
totalRows,
|
|
8110
8491
|
" registros"
|
|
8111
|
-
] }) : null
|
|
8112
|
-
|
|
8492
|
+
] }) : null
|
|
8493
|
+
] }),
|
|
8494
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-end", children: [
|
|
8495
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8113
8496
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
|
|
8114
8497
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
8115
8498
|
Select2,
|
|
@@ -8129,19 +8512,17 @@ function DataTable({
|
|
|
8129
8512
|
]
|
|
8130
8513
|
}
|
|
8131
8514
|
)
|
|
8132
|
-
] })
|
|
8133
|
-
] }),
|
|
8134
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex w-full items-center justify-between gap-2 sm:justify-end", children: [
|
|
8135
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
|
|
8136
|
-
pageLabel,
|
|
8137
|
-
" ",
|
|
8138
|
-
pagination.pageIndex + 1,
|
|
8139
|
-
" ",
|
|
8140
|
-
ofLabel,
|
|
8141
|
-
" ",
|
|
8142
|
-
pageCount
|
|
8143
8515
|
] }),
|
|
8144
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center
|
|
8516
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8517
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex w-[110px] items-center justify-center text-sm font-medium", children: [
|
|
8518
|
+
pageLabel,
|
|
8519
|
+
" ",
|
|
8520
|
+
pagination.pageIndex + 1,
|
|
8521
|
+
" ",
|
|
8522
|
+
ofLabel,
|
|
8523
|
+
" ",
|
|
8524
|
+
pageCount
|
|
8525
|
+
] }),
|
|
8145
8526
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8146
8527
|
Button,
|
|
8147
8528
|
{
|
|
@@ -8450,6 +8831,166 @@ function Dropzone({
|
|
|
8450
8831
|
] }, idx)) })
|
|
8451
8832
|
] });
|
|
8452
8833
|
}
|
|
8834
|
+
|
|
8835
|
+
// src/types/select.ts
|
|
8836
|
+
var inputVariants2 = {
|
|
8837
|
+
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",
|
|
8838
|
+
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",
|
|
8839
|
+
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
8840
|
+
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",
|
|
8841
|
+
// sin bordes laterales/superior, solo inferior; sin sombras ni radios
|
|
8842
|
+
flushed: "rounded-none border-0 border-b border-input px-0 shadow-none focus:border-b-2 focus:border-primary focus:ring-0",
|
|
8843
|
+
// sin estilos, útil para inputs embebidos o controles muy custom
|
|
8844
|
+
unstyled: "border-0 shadow-none focus:ring-0",
|
|
8845
|
+
// aspecto tipo enlace: inline height-auto, sin paddings ni borde
|
|
8846
|
+
link: "border-0 p-0 h-auto shadow-none bg-transparent text-primary underline-offset-4 focus:underline focus:ring-0"
|
|
8847
|
+
};
|
|
8848
|
+
var variants2 = inputVariants2;
|
|
8849
|
+
|
|
8850
|
+
// src/components/ui/select.tsx
|
|
8851
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
8852
|
+
function UiSelect({
|
|
8853
|
+
ref,
|
|
8854
|
+
label,
|
|
8855
|
+
placeholder,
|
|
8856
|
+
value,
|
|
8857
|
+
onChange,
|
|
8858
|
+
items,
|
|
8859
|
+
children,
|
|
8860
|
+
className,
|
|
8861
|
+
selectClassName,
|
|
8862
|
+
labelClassName,
|
|
8863
|
+
contentClassName,
|
|
8864
|
+
size = "md",
|
|
8865
|
+
variant = "outline",
|
|
8866
|
+
errorMessage,
|
|
8867
|
+
htmlFormItemId: formItemId
|
|
8868
|
+
}) {
|
|
8869
|
+
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";
|
|
8870
|
+
const sizeTrigger = {
|
|
8871
|
+
sm: "h-9 px-3 text-sm",
|
|
8872
|
+
md: "h-11 px-4 text-sm",
|
|
8873
|
+
lg: "h-12 px-5 text-base"
|
|
8874
|
+
};
|
|
8875
|
+
const specialFlushed = variant === "flushed" ? size === "sm" ? "h-9 text-sm" : size === "lg" ? "h-12 text-base" : "h-11 text-sm" : "";
|
|
8876
|
+
const specialLink = variant === "link" ? "text-sm" : "";
|
|
8877
|
+
const contentBase = "bg-popover text-popover-foreground border border-border rounded-md shadow-md";
|
|
8878
|
+
const itemSize = {
|
|
8879
|
+
sm: "h-8 text-sm",
|
|
8880
|
+
md: "h-9 text-sm",
|
|
8881
|
+
lg: "h-10 text-base"
|
|
8882
|
+
};
|
|
8883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: cn("w-full", selectClassName), children: [
|
|
8884
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8885
|
+
Label3,
|
|
8886
|
+
{
|
|
8887
|
+
ref,
|
|
8888
|
+
className: cn(errorMessage && "text-destructive", labelClassName),
|
|
8889
|
+
htmlFor: formItemId,
|
|
8890
|
+
children: label
|
|
8891
|
+
}
|
|
8892
|
+
) : null,
|
|
8893
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Select2, { value, onValueChange: onChange, children: [
|
|
8894
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8895
|
+
SelectTrigger,
|
|
8896
|
+
{
|
|
8897
|
+
className: cn(
|
|
8898
|
+
triggerBase,
|
|
8899
|
+
variants2[variant],
|
|
8900
|
+
variant === "flushed" ? specialFlushed : variant === "link" ? specialLink : sizeTrigger[size],
|
|
8901
|
+
errorMessage && "ring-destructive focus:ring-destructive/40 border-destructive",
|
|
8902
|
+
className,
|
|
8903
|
+
label ? "mt-1" : ""
|
|
8904
|
+
),
|
|
8905
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SelectValue, { placeholder })
|
|
8906
|
+
}
|
|
8907
|
+
),
|
|
8908
|
+
/* @__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)(
|
|
8909
|
+
SelectItem,
|
|
8910
|
+
{
|
|
8911
|
+
value: item.value,
|
|
8912
|
+
className: cn(itemSize[size]),
|
|
8913
|
+
children: item.label
|
|
8914
|
+
},
|
|
8915
|
+
item.value
|
|
8916
|
+
)) : null })
|
|
8917
|
+
] }),
|
|
8918
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-sm text-destructive mt-1 ", children: errorMessage }) : null
|
|
8919
|
+
] });
|
|
8920
|
+
}
|
|
8921
|
+
|
|
8922
|
+
// src/types/input.ts
|
|
8923
|
+
var inputVariants3 = {
|
|
8924
|
+
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",
|
|
8925
|
+
// default variant
|
|
8926
|
+
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",
|
|
8927
|
+
// similar to 'filled' but lighter
|
|
8928
|
+
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
8929
|
+
// no background, just hover/focus effect
|
|
8930
|
+
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",
|
|
8931
|
+
// solid background, inset shadow
|
|
8932
|
+
flushed: "rounded-none border-0 border-b border-input px-0 shadow-none focus:border-b-2 focus:border-primary focus:ring-0",
|
|
8933
|
+
// no lateral/top borders, only bottom; no shadows or rounding
|
|
8934
|
+
unstyled: "border-0 shadow-none focus:ring-0",
|
|
8935
|
+
// no styles, useful for embedded inputs or very custom controls
|
|
8936
|
+
link: "border-0 p-0 h-auto shadow-none bg-transparent text-primary underline-offset-4 focus:underline focus:ring-0"
|
|
8937
|
+
};
|
|
8938
|
+
var variants3 = inputVariants3;
|
|
8939
|
+
|
|
8940
|
+
// src/components/ui/input.tsx
|
|
8941
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8942
|
+
function UiInput(_a) {
|
|
8943
|
+
var _b = _a, {
|
|
8944
|
+
ref,
|
|
8945
|
+
label,
|
|
8946
|
+
placeholder,
|
|
8947
|
+
onChange,
|
|
8948
|
+
className,
|
|
8949
|
+
classNameDefault,
|
|
8950
|
+
labelClassName,
|
|
8951
|
+
inputClassName,
|
|
8952
|
+
variant = "outline",
|
|
8953
|
+
errorMessage,
|
|
8954
|
+
htmlFormItemId: formItemId
|
|
8955
|
+
} = _b, inputProps = __objRest(_b, [
|
|
8956
|
+
"ref",
|
|
8957
|
+
"label",
|
|
8958
|
+
"placeholder",
|
|
8959
|
+
"onChange",
|
|
8960
|
+
"className",
|
|
8961
|
+
"classNameDefault",
|
|
8962
|
+
"labelClassName",
|
|
8963
|
+
"inputClassName",
|
|
8964
|
+
"variant",
|
|
8965
|
+
"errorMessage",
|
|
8966
|
+
"htmlFormItemId"
|
|
8967
|
+
]);
|
|
8968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: cn("w-full", inputClassName), children: [
|
|
8969
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8970
|
+
Label3,
|
|
8971
|
+
{
|
|
8972
|
+
ref,
|
|
8973
|
+
className: cn(errorMessage && "text-destructive", labelClassName),
|
|
8974
|
+
htmlFor: formItemId,
|
|
8975
|
+
children: label
|
|
8976
|
+
}
|
|
8977
|
+
) : null,
|
|
8978
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8979
|
+
Input,
|
|
8980
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
8981
|
+
onChange,
|
|
8982
|
+
placeholder,
|
|
8983
|
+
className: cn(
|
|
8984
|
+
"bg-input px-[0.9rem] py-5",
|
|
8985
|
+
className,
|
|
8986
|
+
variants3[variant]
|
|
8987
|
+
),
|
|
8988
|
+
classNameDefault
|
|
8989
|
+
})
|
|
8990
|
+
),
|
|
8991
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-sm text-destructive mt-1 ", children: errorMessage }) : null
|
|
8992
|
+
] });
|
|
8993
|
+
}
|
|
8453
8994
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8454
8995
|
0 && (module.exports = {
|
|
8455
8996
|
Accordion,
|
|
@@ -8674,6 +9215,8 @@ function Dropzone({
|
|
|
8674
9215
|
TooltipContent,
|
|
8675
9216
|
TooltipProvider,
|
|
8676
9217
|
TooltipTrigger,
|
|
9218
|
+
UiInput,
|
|
9219
|
+
UiSelect,
|
|
8677
9220
|
badgeVariants,
|
|
8678
9221
|
buttonVariants,
|
|
8679
9222
|
cn,
|