shadcn-ui-react 0.7.9 → 0.7.11
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 +1 -1
- package/bin/shadcn-ui-react.mjs +1 -1
- package/dist/index.cjs +1662 -1012
- package/dist/index.d.cts +104 -26
- package/dist/index.d.ts +104 -26
- package/dist/index.js +1626 -989
- package/dist/style.css +217 -163
- package/package.json +31 -19
package/dist/index.cjs
CHANGED
|
@@ -251,12 +251,10 @@ __export(index_exports, {
|
|
|
251
251
|
SelectGroup: () => SelectGroup,
|
|
252
252
|
SelectItem: () => SelectItem,
|
|
253
253
|
SelectLabel: () => SelectLabel,
|
|
254
|
-
SelectScrollDownButton: () => SelectScrollDownButton,
|
|
255
|
-
SelectScrollUpButton: () => SelectScrollUpButton,
|
|
256
254
|
SelectSeparator: () => SelectSeparator,
|
|
257
255
|
SelectTrigger: () => SelectTrigger,
|
|
258
256
|
SelectValue: () => SelectValue,
|
|
259
|
-
Separator: () =>
|
|
257
|
+
Separator: () => Separator5,
|
|
260
258
|
Sheet: () => Sheet,
|
|
261
259
|
SheetClose: () => SheetClose,
|
|
262
260
|
SheetContent: () => SheetContent,
|
|
@@ -307,9 +305,18 @@ __export(index_exports, {
|
|
|
307
305
|
badgeVariants: () => badgeVariants,
|
|
308
306
|
buttonVariants: () => buttonVariants,
|
|
309
307
|
cn: () => cn,
|
|
308
|
+
formCompositeControlBase: () => formCompositeControlBase,
|
|
309
|
+
formCompositeControlErrorClass: () => formCompositeControlErrorClass,
|
|
310
|
+
formCompositeVariants: () => formCompositeVariants,
|
|
311
|
+
formControlBase: () => formControlBase,
|
|
312
|
+
formControlErrorClass: () => formControlErrorClass,
|
|
313
|
+
formInputVariants: () => formInputVariants,
|
|
314
|
+
formSizeVariants: () => formSizeVariants,
|
|
310
315
|
getDefaultOptionLabel: () => getDefaultOptionLabel,
|
|
311
316
|
getDefaultOptionValue: () => getDefaultOptionValue,
|
|
312
317
|
getErrorMessage: () => getErrorMessage,
|
|
318
|
+
getFormControlSizeClass: () => getFormControlSizeClass,
|
|
319
|
+
getFormSizeClasses: () => getFormSizeClasses,
|
|
313
320
|
getNextEnabledIndex: () => getNextEnabledIndex,
|
|
314
321
|
iconButtonVariants: () => iconButtonVariants,
|
|
315
322
|
navigationMenuTriggerStyle: () => navigationMenuTriggerStyle,
|
|
@@ -319,7 +326,8 @@ __export(index_exports, {
|
|
|
319
326
|
toggleVariants: () => toggleVariants,
|
|
320
327
|
useFormField: () => useFormField,
|
|
321
328
|
useSidebar: () => useSidebar,
|
|
322
|
-
useToast: () => useToast
|
|
329
|
+
useToast: () => useToast,
|
|
330
|
+
variants: () => variants
|
|
323
331
|
});
|
|
324
332
|
module.exports = __toCommonJS(index_exports);
|
|
325
333
|
|
|
@@ -3139,16 +3147,16 @@ var DateLib = class _DateLib {
|
|
|
3139
3147
|
* @param overrides Custom overrides for the date library functions.
|
|
3140
3148
|
*/
|
|
3141
3149
|
constructor(options, overrides) {
|
|
3142
|
-
this.Date = Date;
|
|
3143
3150
|
this.today = () => {
|
|
3144
|
-
var _a;
|
|
3151
|
+
var _a, _b;
|
|
3145
3152
|
if ((_a = this.overrides) == null ? void 0 : _a.today) {
|
|
3146
3153
|
return this.overrides.today();
|
|
3147
3154
|
}
|
|
3148
3155
|
if (this.options.timeZone) {
|
|
3149
3156
|
return TZDate.tz(this.options.timeZone);
|
|
3150
3157
|
}
|
|
3151
|
-
|
|
3158
|
+
const DateCtor = (_b = this.options.Date) != null ? _b : Date;
|
|
3159
|
+
return new DateCtor();
|
|
3152
3160
|
};
|
|
3153
3161
|
this.newDate = (year, monthIndex, date) => {
|
|
3154
3162
|
var _a;
|
|
@@ -3451,7 +3459,6 @@ var CalendarWeek = class {
|
|
|
3451
3459
|
// node_modules/react-day-picker/dist/esm/components/custom-components.js
|
|
3452
3460
|
var custom_components_exports = {};
|
|
3453
3461
|
__export(custom_components_exports, {
|
|
3454
|
-
Button: () => Button2,
|
|
3455
3462
|
CaptionLabel: () => CaptionLabel,
|
|
3456
3463
|
Chevron: () => Chevron,
|
|
3457
3464
|
Day: () => Day,
|
|
@@ -3479,53 +3486,44 @@ __export(custom_components_exports, {
|
|
|
3479
3486
|
YearsDropdown: () => YearsDropdown
|
|
3480
3487
|
});
|
|
3481
3488
|
|
|
3482
|
-
// node_modules/react-day-picker/dist/esm/components/Button.js
|
|
3483
|
-
var import_react = __toESM(require("react"), 1);
|
|
3484
|
-
function Button2(props) {
|
|
3485
|
-
return import_react.default.createElement("button", __spreadValues({}, props));
|
|
3486
|
-
}
|
|
3487
|
-
|
|
3488
3489
|
// node_modules/react-day-picker/dist/esm/components/CaptionLabel.js
|
|
3489
|
-
var
|
|
3490
|
+
var import_react = __toESM(require("react"), 1);
|
|
3490
3491
|
function CaptionLabel(props) {
|
|
3491
|
-
return
|
|
3492
|
+
return import_react.default.createElement("span", __spreadValues({}, props));
|
|
3492
3493
|
}
|
|
3493
3494
|
|
|
3494
3495
|
// node_modules/react-day-picker/dist/esm/components/Chevron.js
|
|
3495
|
-
var
|
|
3496
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
3496
3497
|
function Chevron(props) {
|
|
3497
3498
|
const { size = 24, orientation = "left", className } = props;
|
|
3498
|
-
return (
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
orientation === "left" && import_react3.default.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
3506
|
-
orientation === "right" && import_react3.default.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
3507
|
-
)
|
|
3499
|
+
return import_react2.default.createElement(
|
|
3500
|
+
"svg",
|
|
3501
|
+
{ className, width: size, height: size, viewBox: "0 0 24 24" },
|
|
3502
|
+
orientation === "up" && import_react2.default.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
3503
|
+
orientation === "down" && import_react2.default.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
3504
|
+
orientation === "left" && import_react2.default.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
3505
|
+
orientation === "right" && import_react2.default.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
3508
3506
|
);
|
|
3509
3507
|
}
|
|
3510
3508
|
|
|
3511
3509
|
// node_modules/react-day-picker/dist/esm/components/Day.js
|
|
3512
|
-
var
|
|
3510
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
3513
3511
|
function Day(props) {
|
|
3514
3512
|
const _a = props, { day, modifiers } = _a, tdProps = __objRest(_a, ["day", "modifiers"]);
|
|
3515
|
-
return
|
|
3513
|
+
return import_react3.default.createElement("td", __spreadValues({}, tdProps));
|
|
3516
3514
|
}
|
|
3517
3515
|
|
|
3518
3516
|
// node_modules/react-day-picker/dist/esm/components/DayButton.js
|
|
3519
|
-
var
|
|
3517
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
3520
3518
|
function DayButton(props) {
|
|
3521
3519
|
const _a = props, { day, modifiers } = _a, buttonProps = __objRest(_a, ["day", "modifiers"]);
|
|
3522
|
-
const ref =
|
|
3523
|
-
|
|
3520
|
+
const ref = import_react4.default.useRef(null);
|
|
3521
|
+
import_react4.default.useEffect(() => {
|
|
3524
3522
|
var _a2;
|
|
3525
3523
|
if (modifiers.focused)
|
|
3526
3524
|
(_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
3527
3525
|
}, [modifiers.focused]);
|
|
3528
|
-
return
|
|
3526
|
+
return import_react4.default.createElement("button", __spreadValues({ ref }, buttonProps));
|
|
3529
3527
|
}
|
|
3530
3528
|
|
|
3531
3529
|
// node_modules/react-day-picker/dist/esm/components/Dropdown.js
|
|
@@ -3586,9 +3584,21 @@ var Animation;
|
|
|
3586
3584
|
Animation2["caption_before_exit"] = "caption_before_exit";
|
|
3587
3585
|
})(Animation || (Animation = {}));
|
|
3588
3586
|
|
|
3587
|
+
// node_modules/react-day-picker/dist/esm/useDayPicker.js
|
|
3588
|
+
var import_react5 = require("react");
|
|
3589
|
+
var dayPickerContext = (0, import_react5.createContext)(void 0);
|
|
3590
|
+
function useDayPicker() {
|
|
3591
|
+
const context = (0, import_react5.useContext)(dayPickerContext);
|
|
3592
|
+
if (context === void 0) {
|
|
3593
|
+
throw new Error("useDayPicker() must be used within a custom component.");
|
|
3594
|
+
}
|
|
3595
|
+
return context;
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3589
3598
|
// node_modules/react-day-picker/dist/esm/components/Dropdown.js
|
|
3590
3599
|
function Dropdown(props) {
|
|
3591
|
-
const _a = props, { options, className
|
|
3600
|
+
const _a = props, { options, className } = _a, selectProps = __objRest(_a, ["options", "className"]);
|
|
3601
|
+
const { classNames, components } = useDayPicker();
|
|
3592
3602
|
const cssClassSelect = [classNames[UI.Dropdown], className].join(" ");
|
|
3593
3603
|
const selectedOption = options == null ? void 0 : options.find(({ value }) => value === selectProps.value);
|
|
3594
3604
|
return import_react6.default.createElement(
|
|
@@ -3643,140 +3653,125 @@ function Months(props) {
|
|
|
3643
3653
|
}
|
|
3644
3654
|
|
|
3645
3655
|
// node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js
|
|
3646
|
-
var
|
|
3647
|
-
|
|
3648
|
-
// node_modules/react-day-picker/dist/esm/useDayPicker.js
|
|
3649
|
-
var import_react13 = require("react");
|
|
3650
|
-
var dayPickerContext = (0, import_react13.createContext)(void 0);
|
|
3651
|
-
function useDayPicker() {
|
|
3652
|
-
const context = (0, import_react13.useContext)(dayPickerContext);
|
|
3653
|
-
if (context === void 0) {
|
|
3654
|
-
throw new Error("useDayPicker() must be used within a custom component.");
|
|
3655
|
-
}
|
|
3656
|
-
return context;
|
|
3657
|
-
}
|
|
3658
|
-
|
|
3659
|
-
// node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js
|
|
3656
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
3660
3657
|
function MonthsDropdown(props) {
|
|
3661
3658
|
const { components } = useDayPicker();
|
|
3662
|
-
return
|
|
3659
|
+
return import_react13.default.createElement(components.Dropdown, __spreadValues({}, props));
|
|
3663
3660
|
}
|
|
3664
3661
|
|
|
3665
3662
|
// node_modules/react-day-picker/dist/esm/components/Nav.js
|
|
3666
|
-
var
|
|
3663
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
3667
3664
|
function Nav(props) {
|
|
3668
3665
|
const _a = props, { onPreviousClick, onNextClick, previousMonth, nextMonth } = _a, navProps = __objRest(_a, ["onPreviousClick", "onNextClick", "previousMonth", "nextMonth"]);
|
|
3669
3666
|
const { components, classNames, labels: { labelPrevious: labelPrevious2, labelNext: labelNext2 } } = useDayPicker();
|
|
3670
|
-
const handleNextClick = (0,
|
|
3667
|
+
const handleNextClick = (0, import_react14.useCallback)((e) => {
|
|
3671
3668
|
if (nextMonth) {
|
|
3672
3669
|
onNextClick == null ? void 0 : onNextClick(e);
|
|
3673
3670
|
}
|
|
3674
3671
|
}, [nextMonth, onNextClick]);
|
|
3675
|
-
const handlePreviousClick = (0,
|
|
3672
|
+
const handlePreviousClick = (0, import_react14.useCallback)((e) => {
|
|
3676
3673
|
if (previousMonth) {
|
|
3677
3674
|
onPreviousClick == null ? void 0 : onPreviousClick(e);
|
|
3678
3675
|
}
|
|
3679
3676
|
}, [previousMonth, onPreviousClick]);
|
|
3680
|
-
return
|
|
3677
|
+
return import_react14.default.createElement(
|
|
3681
3678
|
"nav",
|
|
3682
3679
|
__spreadValues({}, navProps),
|
|
3683
|
-
|
|
3680
|
+
import_react14.default.createElement(
|
|
3684
3681
|
components.PreviousMonthButton,
|
|
3685
3682
|
{ type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick },
|
|
3686
|
-
|
|
3683
|
+
import_react14.default.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: "left" })
|
|
3687
3684
|
),
|
|
3688
|
-
|
|
3685
|
+
import_react14.default.createElement(
|
|
3689
3686
|
components.NextMonthButton,
|
|
3690
3687
|
{ type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick },
|
|
3691
|
-
|
|
3688
|
+
import_react14.default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, orientation: "right", className: classNames[UI.Chevron] })
|
|
3692
3689
|
)
|
|
3693
3690
|
);
|
|
3694
3691
|
}
|
|
3695
3692
|
|
|
3696
3693
|
// node_modules/react-day-picker/dist/esm/components/NextMonthButton.js
|
|
3697
|
-
var
|
|
3694
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
3698
3695
|
function NextMonthButton(props) {
|
|
3699
|
-
|
|
3700
|
-
return import_react16.default.createElement(components.Button, __spreadValues({}, props));
|
|
3696
|
+
return import_react15.default.createElement("button", __spreadValues({}, props));
|
|
3701
3697
|
}
|
|
3702
3698
|
|
|
3703
3699
|
// node_modules/react-day-picker/dist/esm/components/Option.js
|
|
3704
|
-
var
|
|
3700
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
3705
3701
|
function Option(props) {
|
|
3706
|
-
return
|
|
3702
|
+
return import_react16.default.createElement("option", __spreadValues({}, props));
|
|
3707
3703
|
}
|
|
3708
3704
|
|
|
3709
3705
|
// node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js
|
|
3710
|
-
var
|
|
3706
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
3711
3707
|
function PreviousMonthButton(props) {
|
|
3712
|
-
|
|
3713
|
-
return import_react18.default.createElement(components.Button, __spreadValues({}, props));
|
|
3708
|
+
return import_react17.default.createElement("button", __spreadValues({}, props));
|
|
3714
3709
|
}
|
|
3715
3710
|
|
|
3716
3711
|
// node_modules/react-day-picker/dist/esm/components/Root.js
|
|
3717
|
-
var
|
|
3712
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
3718
3713
|
function Root5(props) {
|
|
3719
3714
|
const _a = props, { rootRef } = _a, rest = __objRest(_a, ["rootRef"]);
|
|
3720
|
-
return
|
|
3715
|
+
return import_react18.default.createElement("div", __spreadProps(__spreadValues({}, rest), { ref: rootRef }));
|
|
3721
3716
|
}
|
|
3722
3717
|
|
|
3723
3718
|
// node_modules/react-day-picker/dist/esm/components/Select.js
|
|
3724
|
-
var
|
|
3719
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
3725
3720
|
function Select(props) {
|
|
3726
|
-
return
|
|
3721
|
+
return import_react19.default.createElement("select", __spreadValues({}, props));
|
|
3727
3722
|
}
|
|
3728
3723
|
|
|
3729
3724
|
// node_modules/react-day-picker/dist/esm/components/Week.js
|
|
3730
|
-
var
|
|
3725
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
3731
3726
|
function Week(props) {
|
|
3732
3727
|
const _a = props, { week } = _a, trProps = __objRest(_a, ["week"]);
|
|
3733
|
-
return
|
|
3728
|
+
return import_react20.default.createElement("tr", __spreadValues({}, trProps));
|
|
3734
3729
|
}
|
|
3735
3730
|
|
|
3736
3731
|
// node_modules/react-day-picker/dist/esm/components/Weekday.js
|
|
3737
|
-
var
|
|
3732
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
3738
3733
|
function Weekday(props) {
|
|
3739
|
-
return
|
|
3734
|
+
return import_react21.default.createElement("th", __spreadValues({}, props));
|
|
3740
3735
|
}
|
|
3741
3736
|
|
|
3742
3737
|
// node_modules/react-day-picker/dist/esm/components/Weekdays.js
|
|
3743
|
-
var
|
|
3738
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
3744
3739
|
function Weekdays(props) {
|
|
3745
|
-
return
|
|
3740
|
+
return import_react22.default.createElement(
|
|
3746
3741
|
"thead",
|
|
3747
3742
|
{ "aria-hidden": true },
|
|
3748
|
-
|
|
3743
|
+
import_react22.default.createElement("tr", __spreadValues({}, props))
|
|
3749
3744
|
);
|
|
3750
3745
|
}
|
|
3751
3746
|
|
|
3752
3747
|
// node_modules/react-day-picker/dist/esm/components/WeekNumber.js
|
|
3753
|
-
var
|
|
3748
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
3754
3749
|
function WeekNumber(props) {
|
|
3755
3750
|
const _a = props, { week } = _a, thProps = __objRest(_a, ["week"]);
|
|
3756
|
-
return
|
|
3751
|
+
return import_react23.default.createElement("th", __spreadValues({}, thProps));
|
|
3757
3752
|
}
|
|
3758
3753
|
|
|
3759
3754
|
// node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js
|
|
3760
|
-
var
|
|
3755
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
3761
3756
|
function WeekNumberHeader(props) {
|
|
3762
|
-
return
|
|
3757
|
+
return import_react24.default.createElement("th", __spreadValues({}, props));
|
|
3763
3758
|
}
|
|
3764
3759
|
|
|
3765
3760
|
// node_modules/react-day-picker/dist/esm/components/Weeks.js
|
|
3766
|
-
var
|
|
3761
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
3767
3762
|
function Weeks(props) {
|
|
3768
|
-
return
|
|
3763
|
+
return import_react25.default.createElement("tbody", __spreadValues({}, props));
|
|
3769
3764
|
}
|
|
3770
3765
|
|
|
3771
3766
|
// node_modules/react-day-picker/dist/esm/components/YearsDropdown.js
|
|
3772
|
-
var
|
|
3767
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
3773
3768
|
function YearsDropdown(props) {
|
|
3774
3769
|
const { components } = useDayPicker();
|
|
3775
|
-
return
|
|
3770
|
+
return import_react26.default.createElement(components.Dropdown, __spreadValues({}, props));
|
|
3776
3771
|
}
|
|
3777
3772
|
|
|
3778
3773
|
// node_modules/react-day-picker/dist/esm/DayPicker.js
|
|
3779
|
-
var
|
|
3774
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
3780
3775
|
|
|
3781
3776
|
// node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js
|
|
3782
3777
|
function rangeIncludesDate(range, date, excludeEnds = false, dateLib = defaultDateLib) {
|
|
@@ -3994,12 +3989,10 @@ var formatters_exports = {};
|
|
|
3994
3989
|
__export(formatters_exports, {
|
|
3995
3990
|
formatCaption: () => formatCaption,
|
|
3996
3991
|
formatDay: () => formatDay,
|
|
3997
|
-
formatMonthCaption: () => formatMonthCaption,
|
|
3998
3992
|
formatMonthDropdown: () => formatMonthDropdown,
|
|
3999
3993
|
formatWeekNumber: () => formatWeekNumber,
|
|
4000
3994
|
formatWeekNumberHeader: () => formatWeekNumberHeader,
|
|
4001
3995
|
formatWeekdayName: () => formatWeekdayName,
|
|
4002
|
-
formatYearCaption: () => formatYearCaption,
|
|
4003
3996
|
formatYearDropdown: () => formatYearDropdown
|
|
4004
3997
|
});
|
|
4005
3998
|
|
|
@@ -4008,7 +4001,6 @@ function formatCaption(month, options, dateLib) {
|
|
|
4008
4001
|
const lib = dateLib != null ? dateLib : new DateLib(options);
|
|
4009
4002
|
return lib.formatMonthYear(month);
|
|
4010
4003
|
}
|
|
4011
|
-
var formatMonthCaption = formatCaption;
|
|
4012
4004
|
|
|
4013
4005
|
// node_modules/react-day-picker/dist/esm/formatters/formatDay.js
|
|
4014
4006
|
function formatDay(date, options, dateLib) {
|
|
@@ -4042,24 +4034,15 @@ function formatWeekNumberHeader() {
|
|
|
4042
4034
|
function formatYearDropdown(year, dateLib = defaultDateLib) {
|
|
4043
4035
|
return dateLib.format(year, "yyyy");
|
|
4044
4036
|
}
|
|
4045
|
-
var formatYearCaption = formatYearDropdown;
|
|
4046
4037
|
|
|
4047
4038
|
// node_modules/react-day-picker/dist/esm/helpers/getFormatters.js
|
|
4048
4039
|
function getFormatters(customFormatters) {
|
|
4049
|
-
if ((customFormatters == null ? void 0 : customFormatters.formatMonthCaption) && !customFormatters.formatCaption) {
|
|
4050
|
-
customFormatters.formatCaption = customFormatters.formatMonthCaption;
|
|
4051
|
-
}
|
|
4052
|
-
if ((customFormatters == null ? void 0 : customFormatters.formatYearCaption) && !customFormatters.formatYearDropdown) {
|
|
4053
|
-
customFormatters.formatYearDropdown = customFormatters.formatYearCaption;
|
|
4054
|
-
}
|
|
4055
4040
|
return __spreadValues(__spreadValues({}, formatters_exports), customFormatters);
|
|
4056
4041
|
}
|
|
4057
4042
|
|
|
4058
4043
|
// node_modules/react-day-picker/dist/esm/labels/index.js
|
|
4059
4044
|
var labels_exports = {};
|
|
4060
4045
|
__export(labels_exports, {
|
|
4061
|
-
labelCaption: () => labelCaption,
|
|
4062
|
-
labelDay: () => labelDay,
|
|
4063
4046
|
labelDayButton: () => labelDayButton,
|
|
4064
4047
|
labelGrid: () => labelGrid,
|
|
4065
4048
|
labelGridcell: () => labelGridcell,
|
|
@@ -4082,14 +4065,12 @@ function labelDayButton(date, modifiers, options, dateLib) {
|
|
|
4082
4065
|
label = `${label}, selected`;
|
|
4083
4066
|
return label;
|
|
4084
4067
|
}
|
|
4085
|
-
var labelDay = labelDayButton;
|
|
4086
4068
|
|
|
4087
4069
|
// node_modules/react-day-picker/dist/esm/labels/labelGrid.js
|
|
4088
4070
|
function labelGrid(date, options, dateLib) {
|
|
4089
4071
|
const lib = dateLib != null ? dateLib : new DateLib(options);
|
|
4090
4072
|
return lib.formatMonthYear(date);
|
|
4091
4073
|
}
|
|
4092
|
-
var labelCaption = labelGrid;
|
|
4093
4074
|
|
|
4094
4075
|
// node_modules/react-day-picker/dist/esm/labels/labelGridcell.js
|
|
4095
4076
|
function labelGridcell(date, modifiers, options, dateLib) {
|
|
@@ -4370,7 +4351,7 @@ function createNoonOverrides(timeZone, options = {}) {
|
|
|
4370
4351
|
}
|
|
4371
4352
|
|
|
4372
4353
|
// node_modules/react-day-picker/dist/esm/useAnimation.js
|
|
4373
|
-
var
|
|
4354
|
+
var import_react27 = require("react");
|
|
4374
4355
|
var asHtmlElement = (element) => {
|
|
4375
4356
|
if (element instanceof HTMLElement)
|
|
4376
4357
|
return element;
|
|
@@ -4388,10 +4369,10 @@ var queryWeeksEl = (element) => asHtmlElement(element.querySelector("[data-anima
|
|
|
4388
4369
|
var queryNavEl = (element) => asHtmlElement(element.querySelector("[data-animated-nav]"));
|
|
4389
4370
|
var queryWeekdaysEl = (element) => asHtmlElement(element.querySelector("[data-animated-weekdays]"));
|
|
4390
4371
|
function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib }) {
|
|
4391
|
-
const previousRootElSnapshotRef = (0,
|
|
4392
|
-
const previousMonthsRef = (0,
|
|
4393
|
-
const animatingRef = (0,
|
|
4394
|
-
(0,
|
|
4372
|
+
const previousRootElSnapshotRef = (0, import_react27.useRef)(null);
|
|
4373
|
+
const previousMonthsRef = (0, import_react27.useRef)(months);
|
|
4374
|
+
const animatingRef = (0, import_react27.useRef)(false);
|
|
4375
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
4395
4376
|
const previousMonths = previousMonthsRef.current;
|
|
4396
4377
|
previousMonthsRef.current = months;
|
|
4397
4378
|
if (!enabled || !rootElRef.current || // safety check because the ref can be set to anything by consumers
|
|
@@ -4433,7 +4414,7 @@ function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib
|
|
|
4433
4414
|
}
|
|
4434
4415
|
const previousMonthEls = previousRootElSnapshot instanceof HTMLElement ? queryMonthEls(previousRootElSnapshot) : [];
|
|
4435
4416
|
const currentMonthEls = queryMonthEls(rootElRef.current);
|
|
4436
|
-
if ((currentMonthEls == null ? void 0 : currentMonthEls.every((el) => el instanceof HTMLElement)) && previousMonthEls
|
|
4417
|
+
if ((currentMonthEls == null ? void 0 : currentMonthEls.every((el) => el instanceof HTMLElement)) && (previousMonthEls == null ? void 0 : previousMonthEls.every((el) => el instanceof HTMLElement))) {
|
|
4437
4418
|
animatingRef.current = true;
|
|
4438
4419
|
const cleanUpFunctions = [];
|
|
4439
4420
|
rootElRef.current.style.isolation = "isolate";
|
|
@@ -4501,7 +4482,7 @@ function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib
|
|
|
4501
4482
|
}
|
|
4502
4483
|
|
|
4503
4484
|
// node_modules/react-day-picker/dist/esm/useCalendar.js
|
|
4504
|
-
var
|
|
4485
|
+
var import_react29 = require("react");
|
|
4505
4486
|
|
|
4506
4487
|
// node_modules/react-day-picker/dist/esm/helpers/getDates.js
|
|
4507
4488
|
function getDates(displayMonths, maxDate, props, dateLib) {
|
|
@@ -4615,32 +4596,15 @@ function getMonths(displayMonths, dates, props, dateLib) {
|
|
|
4615
4596
|
function getNavMonths(props, dateLib) {
|
|
4616
4597
|
var _a, _b;
|
|
4617
4598
|
let { startMonth, endMonth } = props;
|
|
4618
|
-
const { startOfYear: startOfYear2, startOfDay: startOfDay2, startOfMonth: startOfMonth2, endOfMonth: endOfMonth2, addYears: addYears2, endOfYear: endOfYear2,
|
|
4619
|
-
const { fromYear, toYear, fromMonth, toMonth } = props;
|
|
4620
|
-
if (!startMonth && fromMonth) {
|
|
4621
|
-
startMonth = fromMonth;
|
|
4622
|
-
}
|
|
4623
|
-
if (!startMonth && fromYear) {
|
|
4624
|
-
startMonth = dateLib.newDate(fromYear, 0, 1);
|
|
4625
|
-
}
|
|
4626
|
-
if (!endMonth && toMonth) {
|
|
4627
|
-
endMonth = toMonth;
|
|
4628
|
-
}
|
|
4629
|
-
if (!endMonth && toYear) {
|
|
4630
|
-
endMonth = newDate(toYear, 11, 31);
|
|
4631
|
-
}
|
|
4599
|
+
const { startOfYear: startOfYear2, startOfDay: startOfDay2, startOfMonth: startOfMonth2, endOfMonth: endOfMonth2, addYears: addYears2, endOfYear: endOfYear2, today } = dateLib;
|
|
4632
4600
|
const hasYearDropdown = props.captionLayout === "dropdown" || props.captionLayout === "dropdown-years";
|
|
4633
4601
|
if (startMonth) {
|
|
4634
4602
|
startMonth = startOfMonth2(startMonth);
|
|
4635
|
-
} else if (fromYear) {
|
|
4636
|
-
startMonth = newDate(fromYear, 0, 1);
|
|
4637
4603
|
} else if (!startMonth && hasYearDropdown) {
|
|
4638
4604
|
startMonth = startOfYear2(addYears2((_a = props.today) != null ? _a : today(), -100));
|
|
4639
4605
|
}
|
|
4640
4606
|
if (endMonth) {
|
|
4641
4607
|
endMonth = endOfMonth2(endMonth);
|
|
4642
|
-
} else if (toYear) {
|
|
4643
|
-
endMonth = newDate(toYear, 11, 31);
|
|
4644
4608
|
} else if (!endMonth && hasYearDropdown) {
|
|
4645
4609
|
endMonth = endOfYear2((_b = props.today) != null ? _b : today());
|
|
4646
4610
|
}
|
|
@@ -4697,9 +4661,9 @@ function getWeeks(months) {
|
|
|
4697
4661
|
}
|
|
4698
4662
|
|
|
4699
4663
|
// node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js
|
|
4700
|
-
var
|
|
4664
|
+
var import_react28 = require("react");
|
|
4701
4665
|
function useControlledValue(defaultValue, controlledValue) {
|
|
4702
|
-
const [uncontrolledValue, setValue] = (0,
|
|
4666
|
+
const [uncontrolledValue, setValue] = (0, import_react28.useState)(defaultValue);
|
|
4703
4667
|
const value = controlledValue === void 0 ? uncontrolledValue : controlledValue;
|
|
4704
4668
|
return [value, setValue];
|
|
4705
4669
|
}
|
|
@@ -4715,11 +4679,11 @@ function useCalendar(props, dateLib) {
|
|
|
4715
4679
|
// initialMonth is always computed from props.month if provided
|
|
4716
4680
|
props.month ? initialMonth : void 0
|
|
4717
4681
|
);
|
|
4718
|
-
(0,
|
|
4682
|
+
(0, import_react29.useEffect)(() => {
|
|
4719
4683
|
const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
4720
4684
|
setFirstMonth(newInitialMonth);
|
|
4721
4685
|
}, [props.timeZone]);
|
|
4722
|
-
const { months, weeks, days, previousMonth, nextMonth } = (0,
|
|
4686
|
+
const { months, weeks, days, previousMonth, nextMonth } = (0, import_react29.useMemo)(() => {
|
|
4723
4687
|
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
4724
4688
|
const dates = getDates(displayMonths, props.endMonth ? endOfMonth2(props.endMonth) : void 0, {
|
|
4725
4689
|
ISOWeek: props.ISOWeek,
|
|
@@ -4794,7 +4758,7 @@ function useCalendar(props, dateLib) {
|
|
|
4794
4758
|
}
|
|
4795
4759
|
|
|
4796
4760
|
// node_modules/react-day-picker/dist/esm/useFocus.js
|
|
4797
|
-
var
|
|
4761
|
+
var import_react30 = require("react");
|
|
4798
4762
|
|
|
4799
4763
|
// node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js
|
|
4800
4764
|
var FocusTargetPriority;
|
|
@@ -4874,9 +4838,9 @@ function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMo
|
|
|
4874
4838
|
// node_modules/react-day-picker/dist/esm/useFocus.js
|
|
4875
4839
|
function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
4876
4840
|
const { autoFocus } = props;
|
|
4877
|
-
const [lastFocused, setLastFocused] = (0,
|
|
4841
|
+
const [lastFocused, setLastFocused] = (0, import_react30.useState)();
|
|
4878
4842
|
const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);
|
|
4879
|
-
const [focusedDay, setFocused] = (0,
|
|
4843
|
+
const [focusedDay, setFocused] = (0, import_react30.useState)(autoFocus ? focusTarget : void 0);
|
|
4880
4844
|
const blur = () => {
|
|
4881
4845
|
setLastFocused(focusedDay);
|
|
4882
4846
|
setFocused(void 0);
|
|
@@ -5277,7 +5241,7 @@ function DayPicker(initialProps) {
|
|
|
5277
5241
|
props.modifiers = nextModifiers;
|
|
5278
5242
|
}
|
|
5279
5243
|
}
|
|
5280
|
-
const { components, formatters: formatters2, labels, dateLib, locale, classNames } = (0,
|
|
5244
|
+
const { components, formatters: formatters2, labels, dateLib, locale, classNames } = (0, import_react31.useMemo)(() => {
|
|
5281
5245
|
var _a2;
|
|
5282
5246
|
const locale2 = __spreadValues(__spreadValues({}, enUS2), props.locale);
|
|
5283
5247
|
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
@@ -5330,21 +5294,21 @@ function DayPicker(initialProps) {
|
|
|
5330
5294
|
const { isSelected, select, selected: selectedValue } = (_b = useSelection(props, dateLib)) != null ? _b : {};
|
|
5331
5295
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected != null ? isSelected : (() => false), dateLib);
|
|
5332
5296
|
const { labelDayButton: labelDayButton2, labelGridcell: labelGridcell2, labelGrid: labelGrid2, labelMonthDropdown: labelMonthDropdown2, labelNav: labelNav2, labelPrevious: labelPrevious2, labelNext: labelNext2, labelWeekday: labelWeekday2, labelWeekNumber: labelWeekNumber2, labelWeekNumberHeader: labelWeekNumberHeader2, labelYearDropdown: labelYearDropdown2 } = labels;
|
|
5333
|
-
const weekdays = (0,
|
|
5297
|
+
const weekdays = (0, import_react31.useMemo)(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
5334
5298
|
const isInteractive = mode !== void 0 || onDayClick !== void 0;
|
|
5335
|
-
const handlePreviousClick = (0,
|
|
5299
|
+
const handlePreviousClick = (0, import_react31.useCallback)(() => {
|
|
5336
5300
|
if (!previousMonth)
|
|
5337
5301
|
return;
|
|
5338
5302
|
goToMonth(previousMonth);
|
|
5339
5303
|
onPrevClick == null ? void 0 : onPrevClick(previousMonth);
|
|
5340
5304
|
}, [previousMonth, goToMonth, onPrevClick]);
|
|
5341
|
-
const handleNextClick = (0,
|
|
5305
|
+
const handleNextClick = (0, import_react31.useCallback)(() => {
|
|
5342
5306
|
if (!nextMonth)
|
|
5343
5307
|
return;
|
|
5344
5308
|
goToMonth(nextMonth);
|
|
5345
5309
|
onNextClick == null ? void 0 : onNextClick(nextMonth);
|
|
5346
5310
|
}, [goToMonth, nextMonth, onNextClick]);
|
|
5347
|
-
const handleDayClick = (0,
|
|
5311
|
+
const handleDayClick = (0, import_react31.useCallback)((day, m) => (e) => {
|
|
5348
5312
|
e.preventDefault();
|
|
5349
5313
|
e.stopPropagation();
|
|
5350
5314
|
setFocused(day);
|
|
@@ -5354,15 +5318,15 @@ function DayPicker(initialProps) {
|
|
|
5354
5318
|
select == null ? void 0 : select(day.date, m, e);
|
|
5355
5319
|
onDayClick == null ? void 0 : onDayClick(day.date, m, e);
|
|
5356
5320
|
}, [select, onDayClick, setFocused]);
|
|
5357
|
-
const handleDayFocus = (0,
|
|
5321
|
+
const handleDayFocus = (0, import_react31.useCallback)((day, m) => (e) => {
|
|
5358
5322
|
setFocused(day);
|
|
5359
5323
|
onDayFocus == null ? void 0 : onDayFocus(day.date, m, e);
|
|
5360
5324
|
}, [onDayFocus, setFocused]);
|
|
5361
|
-
const handleDayBlur = (0,
|
|
5325
|
+
const handleDayBlur = (0, import_react31.useCallback)((day, m) => (e) => {
|
|
5362
5326
|
blur();
|
|
5363
5327
|
onDayBlur == null ? void 0 : onDayBlur(day.date, m, e);
|
|
5364
5328
|
}, [blur, onDayBlur]);
|
|
5365
|
-
const handleDayKeyDown = (0,
|
|
5329
|
+
const handleDayKeyDown = (0, import_react31.useCallback)((day, modifiers) => (e) => {
|
|
5366
5330
|
const keyMap = {
|
|
5367
5331
|
ArrowLeft: [
|
|
5368
5332
|
e.shiftKey ? "month" : "day",
|
|
@@ -5387,28 +5351,28 @@ function DayPicker(initialProps) {
|
|
|
5387
5351
|
}
|
|
5388
5352
|
onDayKeyDown == null ? void 0 : onDayKeyDown(day.date, modifiers, e);
|
|
5389
5353
|
}, [moveFocus, onDayKeyDown, props.dir]);
|
|
5390
|
-
const handleDayMouseEnter = (0,
|
|
5354
|
+
const handleDayMouseEnter = (0, import_react31.useCallback)((day, modifiers) => (e) => {
|
|
5391
5355
|
onDayMouseEnter == null ? void 0 : onDayMouseEnter(day.date, modifiers, e);
|
|
5392
5356
|
}, [onDayMouseEnter]);
|
|
5393
|
-
const handleDayMouseLeave = (0,
|
|
5357
|
+
const handleDayMouseLeave = (0, import_react31.useCallback)((day, modifiers) => (e) => {
|
|
5394
5358
|
onDayMouseLeave == null ? void 0 : onDayMouseLeave(day.date, modifiers, e);
|
|
5395
5359
|
}, [onDayMouseLeave]);
|
|
5396
|
-
const handleMonthChange = (0,
|
|
5360
|
+
const handleMonthChange = (0, import_react31.useCallback)((date, monthOffset) => (e) => {
|
|
5397
5361
|
const selectedMonth = Number(e.target.value);
|
|
5398
5362
|
const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
|
|
5399
|
-
goToMonth(month);
|
|
5363
|
+
goToMonth(dateLib.addMonths(month, -monthOffset));
|
|
5400
5364
|
}, [dateLib, goToMonth]);
|
|
5401
|
-
const handleYearChange = (0,
|
|
5365
|
+
const handleYearChange = (0, import_react31.useCallback)((date, monthOffset) => (e) => {
|
|
5402
5366
|
const selectedYear = Number(e.target.value);
|
|
5403
5367
|
const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
|
|
5404
|
-
goToMonth(month);
|
|
5368
|
+
goToMonth(dateLib.addMonths(month, -monthOffset));
|
|
5405
5369
|
}, [dateLib, goToMonth]);
|
|
5406
|
-
const { className, style } = (0,
|
|
5370
|
+
const { className, style } = (0, import_react31.useMemo)(() => ({
|
|
5407
5371
|
className: [classNames[UI.Root], props.className].filter(Boolean).join(" "),
|
|
5408
5372
|
style: __spreadValues(__spreadValues({}, styles == null ? void 0 : styles[UI.Root]), props.style)
|
|
5409
5373
|
}), [classNames, props.className, props.style, styles]);
|
|
5410
5374
|
const dataAttributes = getDataAttributes(props);
|
|
5411
|
-
const rootElRef = (0,
|
|
5375
|
+
const rootElRef = (0, import_react31.useRef)(null);
|
|
5412
5376
|
useAnimation(rootElRef, Boolean(props.animate), {
|
|
5413
5377
|
classNames,
|
|
5414
5378
|
months,
|
|
@@ -5431,18 +5395,19 @@ function DayPicker(initialProps) {
|
|
|
5431
5395
|
labels,
|
|
5432
5396
|
formatters: formatters2
|
|
5433
5397
|
};
|
|
5434
|
-
return
|
|
5398
|
+
return import_react31.default.createElement(
|
|
5435
5399
|
dayPickerContext.Provider,
|
|
5436
5400
|
{ value: contextValue },
|
|
5437
|
-
|
|
5401
|
+
import_react31.default.createElement(
|
|
5438
5402
|
components.Root,
|
|
5439
5403
|
__spreadValues({ rootRef: props.animate ? rootElRef : void 0, className, style, dir: props.dir, id: props.id, lang: (_c = props.lang) != null ? _c : locale.code, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"] }, dataAttributes),
|
|
5440
|
-
|
|
5404
|
+
import_react31.default.createElement(
|
|
5441
5405
|
components.Months,
|
|
5442
5406
|
{ className: classNames[UI.Months], style: styles == null ? void 0 : styles[UI.Months] },
|
|
5443
|
-
!props.hideNavigation && !navLayout &&
|
|
5407
|
+
!props.hideNavigation && !navLayout && import_react31.default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles == null ? void 0 : styles[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
|
|
5444
5408
|
months.map((calendarMonth, displayIndex) => {
|
|
5445
|
-
|
|
5409
|
+
const monthOffset = props.reverseMonths ? months.length - 1 - displayIndex : displayIndex;
|
|
5410
|
+
return import_react31.default.createElement(
|
|
5446
5411
|
components.Month,
|
|
5447
5412
|
{
|
|
5448
5413
|
"data-animated-month": props.animate ? "true" : void 0,
|
|
@@ -5453,21 +5418,21 @@ function DayPicker(initialProps) {
|
|
|
5453
5418
|
displayIndex,
|
|
5454
5419
|
calendarMonth
|
|
5455
5420
|
},
|
|
5456
|
-
navLayout === "around" && !props.hideNavigation && displayIndex === 0 &&
|
|
5421
|
+
navLayout === "around" && !props.hideNavigation && displayIndex === 0 && import_react31.default.createElement(
|
|
5457
5422
|
components.PreviousMonthButton,
|
|
5458
5423
|
{ type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? void 0 : -1, "aria-disabled": previousMonth ? void 0 : true, "aria-label": labelPrevious2(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : void 0 },
|
|
5459
|
-
|
|
5424
|
+
import_react31.default.createElement(components.Chevron, { disabled: previousMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" })
|
|
5460
5425
|
),
|
|
5461
|
-
|
|
5426
|
+
import_react31.default.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : void 0, className: classNames[UI.MonthCaption], style: styles == null ? void 0 : styles[UI.MonthCaption], calendarMonth, displayIndex }, (captionLayout == null ? void 0 : captionLayout.startsWith("dropdown")) ? import_react31.default.createElement(
|
|
5462
5427
|
components.DropdownNav,
|
|
5463
5428
|
{ className: classNames[UI.Dropdowns], style: styles == null ? void 0 : styles[UI.Dropdowns] },
|
|
5464
5429
|
(() => {
|
|
5465
|
-
const monthControl = captionLayout === "dropdown" || captionLayout === "dropdown-months" ?
|
|
5466
|
-
const yearControl = captionLayout === "dropdown" || captionLayout === "dropdown-years" ?
|
|
5430
|
+
const monthControl = captionLayout === "dropdown" || captionLayout === "dropdown-months" ? import_react31.default.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown2(), disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date, monthOffset), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters2, dateLib), style: styles == null ? void 0 : styles[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) }) : import_react31.default.createElement("span", { key: "month" }, formatMonthDropdown2(calendarMonth.date, dateLib));
|
|
5431
|
+
const yearControl = captionLayout === "dropdown" || captionLayout === "dropdown-years" ? import_react31.default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown2(dateLib.options), disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date, monthOffset), options: getYearOptions(navStart, navEnd, formatters2, dateLib, Boolean(props.reverseYears)), style: styles == null ? void 0 : styles[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) }) : import_react31.default.createElement("span", { key: "year" }, formatYearDropdown2(calendarMonth.date, dateLib));
|
|
5467
5432
|
const controls = dateLib.getMonthYearOrder() === "year-first" ? [yearControl, monthControl] : [monthControl, yearControl];
|
|
5468
5433
|
return controls;
|
|
5469
5434
|
})(),
|
|
5470
|
-
|
|
5435
|
+
import_react31.default.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
5471
5436
|
border: 0,
|
|
5472
5437
|
clip: "rect(0 0 0 0)",
|
|
5473
5438
|
height: "1px",
|
|
@@ -5479,27 +5444,27 @@ function DayPicker(initialProps) {
|
|
|
5479
5444
|
whiteSpace: "nowrap",
|
|
5480
5445
|
wordWrap: "normal"
|
|
5481
5446
|
} }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
|
|
5482
|
-
) :
|
|
5483
|
-
navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 &&
|
|
5447
|
+
) : import_react31.default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))),
|
|
5448
|
+
navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 && import_react31.default.createElement(
|
|
5484
5449
|
components.NextMonthButton,
|
|
5485
5450
|
{ 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 },
|
|
5486
|
-
|
|
5451
|
+
import_react31.default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" })
|
|
5487
5452
|
),
|
|
5488
|
-
displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation &&
|
|
5489
|
-
|
|
5453
|
+
displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation && import_react31.default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles == null ? void 0 : styles[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
|
|
5454
|
+
import_react31.default.createElement(
|
|
5490
5455
|
components.MonthGrid,
|
|
5491
5456
|
{ role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid2(calendarMonth.date, dateLib.options, dateLib) || void 0, className: classNames[UI.MonthGrid], style: styles == null ? void 0 : styles[UI.MonthGrid] },
|
|
5492
|
-
!props.hideWeekdays &&
|
|
5457
|
+
!props.hideWeekdays && import_react31.default.createElement(
|
|
5493
5458
|
components.Weekdays,
|
|
5494
5459
|
{ "data-animated-weekdays": props.animate ? "true" : void 0, className: classNames[UI.Weekdays], style: styles == null ? void 0 : styles[UI.Weekdays] },
|
|
5495
|
-
showWeekNumber &&
|
|
5496
|
-
weekdays.map((weekday) =>
|
|
5460
|
+
showWeekNumber && import_react31.default.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader2(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles == null ? void 0 : styles[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader2()),
|
|
5461
|
+
weekdays.map((weekday) => import_react31.default.createElement(components.Weekday, { "aria-label": labelWeekday2(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles == null ? void 0 : styles[UI.Weekday], scope: "col" }, formatWeekdayName2(weekday, dateLib.options, dateLib)))
|
|
5497
5462
|
),
|
|
5498
|
-
|
|
5499
|
-
return
|
|
5463
|
+
import_react31.default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : void 0, className: classNames[UI.Weeks], style: styles == null ? void 0 : styles[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
5464
|
+
return import_react31.default.createElement(
|
|
5500
5465
|
components.Week,
|
|
5501
5466
|
{ className: classNames[UI.Week], key: week.weekNumber, style: styles == null ? void 0 : styles[UI.Week], week },
|
|
5502
|
-
showWeekNumber &&
|
|
5467
|
+
showWeekNumber && import_react31.default.createElement(components.WeekNumber, { week, style: styles == null ? void 0 : styles[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
|
|
5503
5468
|
locale
|
|
5504
5469
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber2(week.weekNumber, dateLib)),
|
|
5505
5470
|
week.days.map((day) => {
|
|
@@ -5516,7 +5481,7 @@ function DayPicker(initialProps) {
|
|
|
5516
5481
|
const style2 = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
|
|
5517
5482
|
const className2 = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
|
|
5518
5483
|
const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell2(date, modifiers, dateLib.options, dateLib) : void 0;
|
|
5519
|
-
return
|
|
5484
|
+
return import_react31.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_react31.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));
|
|
5520
5485
|
})
|
|
5521
5486
|
);
|
|
5522
5487
|
}))
|
|
@@ -5524,7 +5489,7 @@ function DayPicker(initialProps) {
|
|
|
5524
5489
|
);
|
|
5525
5490
|
})
|
|
5526
5491
|
),
|
|
5527
|
-
props.footer &&
|
|
5492
|
+
props.footer && import_react31.default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles == null ? void 0 : styles[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
|
|
5528
5493
|
)
|
|
5529
5494
|
);
|
|
5530
5495
|
}
|
|
@@ -5547,37 +5512,40 @@ function Calendar(_a) {
|
|
|
5547
5512
|
showOutsideDays,
|
|
5548
5513
|
className: cn("p-3", className),
|
|
5549
5514
|
classNames: __spreadValues({
|
|
5550
|
-
months: "flex flex-col sm:flex-row
|
|
5515
|
+
months: "flex flex-col gap-4 sm:flex-row sm:gap-x-4 sm:gap-y-0",
|
|
5551
5516
|
month: "space-y-4",
|
|
5552
|
-
|
|
5517
|
+
month_caption: "relative flex items-center justify-center pt-1",
|
|
5553
5518
|
caption_label: "text-sm font-medium",
|
|
5554
|
-
nav: "
|
|
5555
|
-
|
|
5519
|
+
nav: "flex items-center gap-1",
|
|
5520
|
+
button_previous: cn(
|
|
5556
5521
|
buttonVariants({ variant: "outline" }),
|
|
5557
|
-
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
5522
|
+
"absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
5558
5523
|
),
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
head_row: "flex",
|
|
5563
|
-
head_cell: "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",
|
|
5564
|
-
row: "flex w-full mt-2",
|
|
5565
|
-
cell: cn(
|
|
5566
|
-
"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",
|
|
5567
|
-
props.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md"
|
|
5524
|
+
button_next: cn(
|
|
5525
|
+
buttonVariants({ variant: "outline" }),
|
|
5526
|
+
"absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
5568
5527
|
),
|
|
5528
|
+
month_grid: "w-full border-collapse space-y-1",
|
|
5529
|
+
weekdays: "flex",
|
|
5530
|
+
weekday: "w-8 rounded-md text-[0.8rem] font-normal text-muted-foreground",
|
|
5531
|
+
weeks: "space-y-1",
|
|
5532
|
+
week: "mt-2 flex w-full",
|
|
5569
5533
|
day: cn(
|
|
5534
|
+
"relative h-8 w-8 p-0 text-center text-sm focus-within:relative focus-within:z-20",
|
|
5535
|
+
props.mode === "range" ? "first:rounded-l-md last:rounded-r-md" : "rounded-md"
|
|
5536
|
+
),
|
|
5537
|
+
day_button: cn(
|
|
5570
5538
|
buttonVariants({ variant: "ghost" }),
|
|
5571
|
-
"h-8 w-8 p-0 font-normal
|
|
5539
|
+
"h-8 w-8 p-0 font-normal"
|
|
5572
5540
|
),
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5541
|
+
selected: "[&>button]:bg-primary [&>button]:text-primary-foreground [&>button:hover]:bg-primary [&>button:hover]:text-primary-foreground [&>button:focus]:bg-primary [&>button:focus]:text-primary-foreground",
|
|
5542
|
+
today: "[&>button]:bg-accent [&>button]:text-accent-foreground",
|
|
5543
|
+
outside: "text-muted-foreground opacity-50 [&>button]:text-muted-foreground",
|
|
5544
|
+
disabled: "text-muted-foreground opacity-50 [&>button]:cursor-not-allowed",
|
|
5545
|
+
range_start: "rounded-l-md [&>button]:rounded-l-md [&>button]:bg-primary [&>button]:text-primary-foreground",
|
|
5546
|
+
range_middle: "[&>button]:bg-accent [&>button]:text-accent-foreground [&>button]:rounded-none",
|
|
5547
|
+
range_end: "rounded-r-md [&>button]:rounded-r-md [&>button]:bg-primary [&>button]:text-primary-foreground",
|
|
5548
|
+
hidden: "invisible"
|
|
5581
5549
|
}, classNames)
|
|
5582
5550
|
}, props)
|
|
5583
5551
|
);
|
|
@@ -5585,9 +5553,9 @@ function Calendar(_a) {
|
|
|
5585
5553
|
Calendar.displayName = "Calendar";
|
|
5586
5554
|
|
|
5587
5555
|
// src/components/card.tsx
|
|
5588
|
-
var
|
|
5556
|
+
var React34 = __toESM(require("react"), 1);
|
|
5589
5557
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
5590
|
-
var Card =
|
|
5558
|
+
var Card = React34.forwardRef((_a, ref) => {
|
|
5591
5559
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5592
5560
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5593
5561
|
"div",
|
|
@@ -5601,7 +5569,7 @@ var Card = React35.forwardRef((_a, ref) => {
|
|
|
5601
5569
|
);
|
|
5602
5570
|
});
|
|
5603
5571
|
Card.displayName = "Card";
|
|
5604
|
-
var CardHeader =
|
|
5572
|
+
var CardHeader = React34.forwardRef((_a, ref) => {
|
|
5605
5573
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5606
5574
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5607
5575
|
"div",
|
|
@@ -5612,7 +5580,7 @@ var CardHeader = React35.forwardRef((_a, ref) => {
|
|
|
5612
5580
|
);
|
|
5613
5581
|
});
|
|
5614
5582
|
CardHeader.displayName = "CardHeader";
|
|
5615
|
-
var CardTitle =
|
|
5583
|
+
var CardTitle = React34.forwardRef((_a, ref) => {
|
|
5616
5584
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5617
5585
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5618
5586
|
"h3",
|
|
@@ -5623,7 +5591,7 @@ var CardTitle = React35.forwardRef((_a, ref) => {
|
|
|
5623
5591
|
);
|
|
5624
5592
|
});
|
|
5625
5593
|
CardTitle.displayName = "CardTitle";
|
|
5626
|
-
var CardDescription =
|
|
5594
|
+
var CardDescription = React34.forwardRef((_a, ref) => {
|
|
5627
5595
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5628
5596
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5629
5597
|
"p",
|
|
@@ -5634,12 +5602,12 @@ var CardDescription = React35.forwardRef((_a, ref) => {
|
|
|
5634
5602
|
);
|
|
5635
5603
|
});
|
|
5636
5604
|
CardDescription.displayName = "CardDescription";
|
|
5637
|
-
var CardContent =
|
|
5605
|
+
var CardContent = React34.forwardRef((_a, ref) => {
|
|
5638
5606
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5639
5607
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", __spreadValues({ ref, className: cn("p-6 pt-0", className) }, props));
|
|
5640
5608
|
});
|
|
5641
5609
|
CardContent.displayName = "CardContent";
|
|
5642
|
-
var CardFooter =
|
|
5610
|
+
var CardFooter = React34.forwardRef((_a, ref) => {
|
|
5643
5611
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5644
5612
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5645
5613
|
"div",
|
|
@@ -5654,17 +5622,17 @@ CardFooter.displayName = "CardFooter";
|
|
|
5654
5622
|
// src/components/carousel.tsx
|
|
5655
5623
|
var import_react_icons3 = require("@radix-ui/react-icons");
|
|
5656
5624
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"), 1);
|
|
5657
|
-
var
|
|
5625
|
+
var React35 = __toESM(require("react"), 1);
|
|
5658
5626
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
5659
|
-
var CarouselContext =
|
|
5627
|
+
var CarouselContext = React35.createContext(null);
|
|
5660
5628
|
function useCarousel() {
|
|
5661
|
-
const context =
|
|
5629
|
+
const context = React35.useContext(CarouselContext);
|
|
5662
5630
|
if (!context) {
|
|
5663
5631
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
5664
5632
|
}
|
|
5665
5633
|
return context;
|
|
5666
5634
|
}
|
|
5667
|
-
var Carousel =
|
|
5635
|
+
var Carousel = React35.forwardRef(
|
|
5668
5636
|
(_a, ref) => {
|
|
5669
5637
|
var _b = _a, {
|
|
5670
5638
|
orientation = "horizontal",
|
|
@@ -5687,22 +5655,22 @@ var Carousel = React36.forwardRef(
|
|
|
5687
5655
|
}),
|
|
5688
5656
|
plugins
|
|
5689
5657
|
);
|
|
5690
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
5691
|
-
const [canScrollNext, setCanScrollNext] =
|
|
5692
|
-
const onSelect =
|
|
5658
|
+
const [canScrollPrev, setCanScrollPrev] = React35.useState(false);
|
|
5659
|
+
const [canScrollNext, setCanScrollNext] = React35.useState(false);
|
|
5660
|
+
const onSelect = React35.useCallback((api2) => {
|
|
5693
5661
|
if (!api2) {
|
|
5694
5662
|
return;
|
|
5695
5663
|
}
|
|
5696
5664
|
setCanScrollPrev(api2.canScrollPrev());
|
|
5697
5665
|
setCanScrollNext(api2.canScrollNext());
|
|
5698
5666
|
}, []);
|
|
5699
|
-
const scrollPrev =
|
|
5667
|
+
const scrollPrev = React35.useCallback(() => {
|
|
5700
5668
|
api == null ? void 0 : api.scrollPrev();
|
|
5701
5669
|
}, [api]);
|
|
5702
|
-
const scrollNext =
|
|
5670
|
+
const scrollNext = React35.useCallback(() => {
|
|
5703
5671
|
api == null ? void 0 : api.scrollNext();
|
|
5704
5672
|
}, [api]);
|
|
5705
|
-
const handleKeyDown =
|
|
5673
|
+
const handleKeyDown = React35.useCallback(
|
|
5706
5674
|
(event) => {
|
|
5707
5675
|
if (event.key === "ArrowLeft") {
|
|
5708
5676
|
event.preventDefault();
|
|
@@ -5714,13 +5682,13 @@ var Carousel = React36.forwardRef(
|
|
|
5714
5682
|
},
|
|
5715
5683
|
[scrollPrev, scrollNext]
|
|
5716
5684
|
);
|
|
5717
|
-
|
|
5685
|
+
React35.useEffect(() => {
|
|
5718
5686
|
if (!api || !setApi) {
|
|
5719
5687
|
return;
|
|
5720
5688
|
}
|
|
5721
5689
|
setApi(api);
|
|
5722
5690
|
}, [api, setApi]);
|
|
5723
|
-
|
|
5691
|
+
React35.useEffect(() => {
|
|
5724
5692
|
if (!api) {
|
|
5725
5693
|
return;
|
|
5726
5694
|
}
|
|
@@ -5761,7 +5729,7 @@ var Carousel = React36.forwardRef(
|
|
|
5761
5729
|
}
|
|
5762
5730
|
);
|
|
5763
5731
|
Carousel.displayName = "Carousel";
|
|
5764
|
-
var CarouselContent =
|
|
5732
|
+
var CarouselContent = React35.forwardRef((_a, ref) => {
|
|
5765
5733
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5766
5734
|
const { carouselRef, orientation } = useCarousel();
|
|
5767
5735
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -5777,7 +5745,7 @@ var CarouselContent = React36.forwardRef((_a, ref) => {
|
|
|
5777
5745
|
) });
|
|
5778
5746
|
});
|
|
5779
5747
|
CarouselContent.displayName = "CarouselContent";
|
|
5780
|
-
var CarouselItem =
|
|
5748
|
+
var CarouselItem = React35.forwardRef((_a, ref) => {
|
|
5781
5749
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5782
5750
|
const { orientation } = useCarousel();
|
|
5783
5751
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -5795,7 +5763,7 @@ var CarouselItem = React36.forwardRef((_a, ref) => {
|
|
|
5795
5763
|
);
|
|
5796
5764
|
});
|
|
5797
5765
|
CarouselItem.displayName = "CarouselItem";
|
|
5798
|
-
var CarouselPrevious =
|
|
5766
|
+
var CarouselPrevious = React35.forwardRef((_a, ref) => {
|
|
5799
5767
|
var _b = _a, { className, variant = "outline", size = "icon" } = _b, props = __objRest(_b, ["className", "variant", "size"]);
|
|
5800
5768
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
5801
5769
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
@@ -5820,7 +5788,7 @@ var CarouselPrevious = React36.forwardRef((_a, ref) => {
|
|
|
5820
5788
|
);
|
|
5821
5789
|
});
|
|
5822
5790
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
5823
|
-
var CarouselNext =
|
|
5791
|
+
var CarouselNext = React35.forwardRef((_a, ref) => {
|
|
5824
5792
|
var _b = _a, { className, variant = "outline", size = "icon" } = _b, props = __objRest(_b, ["className", "variant", "size"]);
|
|
5825
5793
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
5826
5794
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
@@ -5849,7 +5817,7 @@ CarouselNext.displayName = "CarouselNext";
|
|
|
5849
5817
|
// src/components/checkbox.tsx
|
|
5850
5818
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
5851
5819
|
var import_react_icons4 = require("@radix-ui/react-icons");
|
|
5852
|
-
var
|
|
5820
|
+
var React36 = __toESM(require("react"), 1);
|
|
5853
5821
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
5854
5822
|
var checkboxSizes = {
|
|
5855
5823
|
sm: "h-4 w-4 rounded",
|
|
@@ -5868,7 +5836,7 @@ var checkboxVariants = {
|
|
|
5868
5836
|
success: "border-input bg-background data-[state=checked]:border-emerald-500 data-[state=checked]:bg-emerald-500 data-[state=checked]:text-white",
|
|
5869
5837
|
destructive: "border-input bg-background data-[state=checked]:border-destructive data-[state=checked]:bg-destructive data-[state=checked]:text-destructive-foreground"
|
|
5870
5838
|
};
|
|
5871
|
-
var Checkbox =
|
|
5839
|
+
var Checkbox = React36.forwardRef(
|
|
5872
5840
|
(_a, ref) => {
|
|
5873
5841
|
var _b = _a, {
|
|
5874
5842
|
className,
|
|
@@ -5935,18 +5903,18 @@ var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
|
5935
5903
|
// src/components/command.tsx
|
|
5936
5904
|
var import_react_icons6 = require("@radix-ui/react-icons");
|
|
5937
5905
|
var import_cmdk = require("cmdk");
|
|
5938
|
-
var
|
|
5906
|
+
var React38 = __toESM(require("react"), 1);
|
|
5939
5907
|
|
|
5940
5908
|
// src/components/dialog.tsx
|
|
5941
5909
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
5942
5910
|
var import_react_icons5 = require("@radix-ui/react-icons");
|
|
5943
|
-
var
|
|
5911
|
+
var React37 = __toESM(require("react"), 1);
|
|
5944
5912
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
5945
5913
|
var Dialog = DialogPrimitive.Root;
|
|
5946
5914
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
5947
5915
|
var DialogPortal = DialogPrimitive.Portal;
|
|
5948
5916
|
var DialogClose = DialogPrimitive.Close;
|
|
5949
|
-
var DialogOverlay =
|
|
5917
|
+
var DialogOverlay = React37.forwardRef((_a, ref) => {
|
|
5950
5918
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5951
5919
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5952
5920
|
DialogPrimitive.Overlay,
|
|
@@ -5960,7 +5928,7 @@ var DialogOverlay = React38.forwardRef((_a, ref) => {
|
|
|
5960
5928
|
);
|
|
5961
5929
|
});
|
|
5962
5930
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
5963
|
-
var DialogContent =
|
|
5931
|
+
var DialogContent = React37.forwardRef((_a, ref) => {
|
|
5964
5932
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
5965
5933
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPortal, { children: [
|
|
5966
5934
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlay, {}),
|
|
@@ -6019,7 +5987,7 @@ var DialogFooter = (_a) => {
|
|
|
6019
5987
|
);
|
|
6020
5988
|
};
|
|
6021
5989
|
DialogFooter.displayName = "DialogFooter";
|
|
6022
|
-
var DialogTitle =
|
|
5990
|
+
var DialogTitle = React37.forwardRef((_a, ref) => {
|
|
6023
5991
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6024
5992
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6025
5993
|
DialogPrimitive.Title,
|
|
@@ -6033,7 +6001,7 @@ var DialogTitle = React38.forwardRef((_a, ref) => {
|
|
|
6033
6001
|
);
|
|
6034
6002
|
});
|
|
6035
6003
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
6036
|
-
var DialogDescription =
|
|
6004
|
+
var DialogDescription = React37.forwardRef((_a, ref) => {
|
|
6037
6005
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6038
6006
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6039
6007
|
DialogPrimitive.Description,
|
|
@@ -6047,7 +6015,7 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
6047
6015
|
|
|
6048
6016
|
// src/components/command.tsx
|
|
6049
6017
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
6050
|
-
var Command =
|
|
6018
|
+
var Command = React38.forwardRef((_a, ref) => {
|
|
6051
6019
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6052
6020
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6053
6021
|
import_cmdk.Command,
|
|
@@ -6065,7 +6033,7 @@ var CommandDialog = (_a) => {
|
|
|
6065
6033
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
6066
6034
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Dialog, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) }));
|
|
6067
6035
|
};
|
|
6068
|
-
var CommandInput =
|
|
6036
|
+
var CommandInput = React38.forwardRef((_a, ref) => {
|
|
6069
6037
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6070
6038
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
6071
6039
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_icons6.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
@@ -6082,7 +6050,7 @@ var CommandInput = React39.forwardRef((_a, ref) => {
|
|
|
6082
6050
|
] });
|
|
6083
6051
|
});
|
|
6084
6052
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
6085
|
-
var CommandList =
|
|
6053
|
+
var CommandList = React38.forwardRef((_a, ref) => {
|
|
6086
6054
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6087
6055
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6088
6056
|
import_cmdk.Command.List,
|
|
@@ -6093,7 +6061,7 @@ var CommandList = React39.forwardRef((_a, ref) => {
|
|
|
6093
6061
|
);
|
|
6094
6062
|
});
|
|
6095
6063
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
6096
|
-
var CommandEmpty =
|
|
6064
|
+
var CommandEmpty = React38.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6097
6065
|
import_cmdk.Command.Empty,
|
|
6098
6066
|
__spreadValues({
|
|
6099
6067
|
ref,
|
|
@@ -6101,7 +6069,7 @@ var CommandEmpty = React39.forwardRef((props, ref) => /* @__PURE__ */ (0, import
|
|
|
6101
6069
|
}, props)
|
|
6102
6070
|
));
|
|
6103
6071
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
6104
|
-
var CommandGroup =
|
|
6072
|
+
var CommandGroup = React38.forwardRef((_a, ref) => {
|
|
6105
6073
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6106
6074
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6107
6075
|
import_cmdk.Command.Group,
|
|
@@ -6115,7 +6083,7 @@ var CommandGroup = React39.forwardRef((_a, ref) => {
|
|
|
6115
6083
|
);
|
|
6116
6084
|
});
|
|
6117
6085
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
6118
|
-
var CommandSeparator =
|
|
6086
|
+
var CommandSeparator = React38.forwardRef((_a, ref) => {
|
|
6119
6087
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6120
6088
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6121
6089
|
import_cmdk.Command.Separator,
|
|
@@ -6126,7 +6094,7 @@ var CommandSeparator = React39.forwardRef((_a, ref) => {
|
|
|
6126
6094
|
);
|
|
6127
6095
|
});
|
|
6128
6096
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
6129
|
-
var CommandItem =
|
|
6097
|
+
var CommandItem = React38.forwardRef((_a, ref) => {
|
|
6130
6098
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6131
6099
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6132
6100
|
import_cmdk.Command.Item,
|
|
@@ -6161,7 +6129,7 @@ CommandShortcut.displayName = "CommandShortcut";
|
|
|
6161
6129
|
// src/components/context-menu.tsx
|
|
6162
6130
|
var ContextMenuPrimitive = __toESM(require("@radix-ui/react-context-menu"), 1);
|
|
6163
6131
|
var import_react_icons7 = require("@radix-ui/react-icons");
|
|
6164
|
-
var
|
|
6132
|
+
var React39 = __toESM(require("react"), 1);
|
|
6165
6133
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6166
6134
|
var ContextMenu = ContextMenuPrimitive.Root;
|
|
6167
6135
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
@@ -6169,7 +6137,7 @@ var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
|
6169
6137
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
6170
6138
|
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
6171
6139
|
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
6172
|
-
var ContextMenuSubTrigger =
|
|
6140
|
+
var ContextMenuSubTrigger = React39.forwardRef((_a, ref) => {
|
|
6173
6141
|
var _b = _a, { className, inset, children } = _b, props = __objRest(_b, ["className", "inset", "children"]);
|
|
6174
6142
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6175
6143
|
ContextMenuPrimitive.SubTrigger,
|
|
@@ -6189,7 +6157,7 @@ var ContextMenuSubTrigger = React40.forwardRef((_a, ref) => {
|
|
|
6189
6157
|
);
|
|
6190
6158
|
});
|
|
6191
6159
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
6192
|
-
var ContextMenuSubContent =
|
|
6160
|
+
var ContextMenuSubContent = React39.forwardRef((_a, ref) => {
|
|
6193
6161
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6194
6162
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6195
6163
|
ContextMenuPrimitive.SubContent,
|
|
@@ -6203,7 +6171,7 @@ var ContextMenuSubContent = React40.forwardRef((_a, ref) => {
|
|
|
6203
6171
|
);
|
|
6204
6172
|
});
|
|
6205
6173
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
6206
|
-
var ContextMenuContent =
|
|
6174
|
+
var ContextMenuContent = React39.forwardRef((_a, ref) => {
|
|
6207
6175
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6208
6176
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6209
6177
|
ContextMenuPrimitive.Content,
|
|
@@ -6217,7 +6185,7 @@ var ContextMenuContent = React40.forwardRef((_a, ref) => {
|
|
|
6217
6185
|
) });
|
|
6218
6186
|
});
|
|
6219
6187
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
6220
|
-
var ContextMenuItem =
|
|
6188
|
+
var ContextMenuItem = React39.forwardRef((_a, ref) => {
|
|
6221
6189
|
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
|
6222
6190
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6223
6191
|
ContextMenuPrimitive.Item,
|
|
@@ -6232,7 +6200,7 @@ var ContextMenuItem = React40.forwardRef((_a, ref) => {
|
|
|
6232
6200
|
);
|
|
6233
6201
|
});
|
|
6234
6202
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
6235
|
-
var ContextMenuCheckboxItem =
|
|
6203
|
+
var ContextMenuCheckboxItem = React39.forwardRef((_a, ref) => {
|
|
6236
6204
|
var _b = _a, { className, children, checked } = _b, props = __objRest(_b, ["className", "children", "checked"]);
|
|
6237
6205
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6238
6206
|
ContextMenuPrimitive.CheckboxItem,
|
|
@@ -6252,7 +6220,7 @@ var ContextMenuCheckboxItem = React40.forwardRef((_a, ref) => {
|
|
|
6252
6220
|
);
|
|
6253
6221
|
});
|
|
6254
6222
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
6255
|
-
var ContextMenuRadioItem =
|
|
6223
|
+
var ContextMenuRadioItem = React39.forwardRef((_a, ref) => {
|
|
6256
6224
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
6257
6225
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6258
6226
|
ContextMenuPrimitive.RadioItem,
|
|
@@ -6271,7 +6239,7 @@ var ContextMenuRadioItem = React40.forwardRef((_a, ref) => {
|
|
|
6271
6239
|
);
|
|
6272
6240
|
});
|
|
6273
6241
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
6274
|
-
var ContextMenuLabel =
|
|
6242
|
+
var ContextMenuLabel = React39.forwardRef((_a, ref) => {
|
|
6275
6243
|
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
|
6276
6244
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6277
6245
|
ContextMenuPrimitive.Label,
|
|
@@ -6286,7 +6254,7 @@ var ContextMenuLabel = React40.forwardRef((_a, ref) => {
|
|
|
6286
6254
|
);
|
|
6287
6255
|
});
|
|
6288
6256
|
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
6289
|
-
var ContextMenuSeparator =
|
|
6257
|
+
var ContextMenuSeparator = React39.forwardRef((_a, ref) => {
|
|
6290
6258
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6291
6259
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6292
6260
|
ContextMenuPrimitive.Separator,
|
|
@@ -6316,7 +6284,7 @@ var ContextMenuShortcut = (_a) => {
|
|
|
6316
6284
|
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
6317
6285
|
|
|
6318
6286
|
// src/components/drawer.tsx
|
|
6319
|
-
var
|
|
6287
|
+
var React40 = __toESM(require("react"), 1);
|
|
6320
6288
|
var import_vaul = require("vaul");
|
|
6321
6289
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
6322
6290
|
var Drawer = (_a) => {
|
|
@@ -6336,7 +6304,7 @@ Drawer.displayName = "Drawer";
|
|
|
6336
6304
|
var DrawerTrigger = import_vaul.Drawer.Trigger;
|
|
6337
6305
|
var DrawerPortal = import_vaul.Drawer.Portal;
|
|
6338
6306
|
var DrawerClose = import_vaul.Drawer.Close;
|
|
6339
|
-
var DrawerOverlay =
|
|
6307
|
+
var DrawerOverlay = React40.forwardRef((_a, ref) => {
|
|
6340
6308
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6341
6309
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6342
6310
|
import_vaul.Drawer.Overlay,
|
|
@@ -6347,7 +6315,7 @@ var DrawerOverlay = React41.forwardRef((_a, ref) => {
|
|
|
6347
6315
|
);
|
|
6348
6316
|
});
|
|
6349
6317
|
DrawerOverlay.displayName = import_vaul.Drawer.Overlay.displayName;
|
|
6350
|
-
var DrawerContent =
|
|
6318
|
+
var DrawerContent = React40.forwardRef((_a, ref) => {
|
|
6351
6319
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
6352
6320
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DrawerPortal, { children: [
|
|
6353
6321
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerOverlay, {}),
|
|
@@ -6397,7 +6365,7 @@ var DrawerFooter = (_a) => {
|
|
|
6397
6365
|
);
|
|
6398
6366
|
};
|
|
6399
6367
|
DrawerFooter.displayName = "DrawerFooter";
|
|
6400
|
-
var DrawerTitle =
|
|
6368
|
+
var DrawerTitle = React40.forwardRef((_a, ref) => {
|
|
6401
6369
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6402
6370
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6403
6371
|
import_vaul.Drawer.Title,
|
|
@@ -6411,7 +6379,7 @@ var DrawerTitle = React41.forwardRef((_a, ref) => {
|
|
|
6411
6379
|
);
|
|
6412
6380
|
});
|
|
6413
6381
|
DrawerTitle.displayName = import_vaul.Drawer.Title.displayName;
|
|
6414
|
-
var DrawerDescription =
|
|
6382
|
+
var DrawerDescription = React40.forwardRef((_a, ref) => {
|
|
6415
6383
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6416
6384
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6417
6385
|
import_vaul.Drawer.Description,
|
|
@@ -6426,7 +6394,7 @@ DrawerDescription.displayName = import_vaul.Drawer.Description.displayName;
|
|
|
6426
6394
|
// src/components/dropdown-menu.tsx
|
|
6427
6395
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
6428
6396
|
var import_react_icons8 = require("@radix-ui/react-icons");
|
|
6429
|
-
var
|
|
6397
|
+
var React41 = __toESM(require("react"), 1);
|
|
6430
6398
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6431
6399
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
6432
6400
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
@@ -6434,7 +6402,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
6434
6402
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
6435
6403
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
6436
6404
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
6437
|
-
var DropdownMenuSubTrigger =
|
|
6405
|
+
var DropdownMenuSubTrigger = React41.forwardRef((_a, ref) => {
|
|
6438
6406
|
var _b = _a, { className, inset, children } = _b, props = __objRest(_b, ["className", "inset", "children"]);
|
|
6439
6407
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6440
6408
|
DropdownMenuPrimitive.SubTrigger,
|
|
@@ -6454,7 +6422,7 @@ var DropdownMenuSubTrigger = React42.forwardRef((_a, ref) => {
|
|
|
6454
6422
|
);
|
|
6455
6423
|
});
|
|
6456
6424
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
6457
|
-
var DropdownMenuSubContent =
|
|
6425
|
+
var DropdownMenuSubContent = React41.forwardRef((_a, ref) => {
|
|
6458
6426
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6459
6427
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6460
6428
|
DropdownMenuPrimitive.SubContent,
|
|
@@ -6468,7 +6436,7 @@ var DropdownMenuSubContent = React42.forwardRef((_a, ref) => {
|
|
|
6468
6436
|
);
|
|
6469
6437
|
});
|
|
6470
6438
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
6471
|
-
var DropdownMenuContent =
|
|
6439
|
+
var DropdownMenuContent = React41.forwardRef((_a, ref) => {
|
|
6472
6440
|
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
|
6473
6441
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6474
6442
|
DropdownMenuPrimitive.Content,
|
|
@@ -6484,7 +6452,7 @@ var DropdownMenuContent = React42.forwardRef((_a, ref) => {
|
|
|
6484
6452
|
) });
|
|
6485
6453
|
});
|
|
6486
6454
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
6487
|
-
var DropdownMenuItem =
|
|
6455
|
+
var DropdownMenuItem = React41.forwardRef((_a, ref) => {
|
|
6488
6456
|
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
|
6489
6457
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6490
6458
|
DropdownMenuPrimitive.Item,
|
|
@@ -6499,7 +6467,7 @@ var DropdownMenuItem = React42.forwardRef((_a, ref) => {
|
|
|
6499
6467
|
);
|
|
6500
6468
|
});
|
|
6501
6469
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
6502
|
-
var DropdownMenuCheckboxItem =
|
|
6470
|
+
var DropdownMenuCheckboxItem = React41.forwardRef((_a, ref) => {
|
|
6503
6471
|
var _b = _a, { className, children, checked } = _b, props = __objRest(_b, ["className", "children", "checked"]);
|
|
6504
6472
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6505
6473
|
DropdownMenuPrimitive.CheckboxItem,
|
|
@@ -6519,7 +6487,7 @@ var DropdownMenuCheckboxItem = React42.forwardRef((_a, ref) => {
|
|
|
6519
6487
|
);
|
|
6520
6488
|
});
|
|
6521
6489
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
6522
|
-
var DropdownMenuRadioItem =
|
|
6490
|
+
var DropdownMenuRadioItem = React41.forwardRef((_a, ref) => {
|
|
6523
6491
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
6524
6492
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6525
6493
|
DropdownMenuPrimitive.RadioItem,
|
|
@@ -6538,7 +6506,7 @@ var DropdownMenuRadioItem = React42.forwardRef((_a, ref) => {
|
|
|
6538
6506
|
);
|
|
6539
6507
|
});
|
|
6540
6508
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
6541
|
-
var DropdownMenuLabel =
|
|
6509
|
+
var DropdownMenuLabel = React41.forwardRef((_a, ref) => {
|
|
6542
6510
|
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
|
6543
6511
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6544
6512
|
DropdownMenuPrimitive.Label,
|
|
@@ -6553,7 +6521,7 @@ var DropdownMenuLabel = React42.forwardRef((_a, ref) => {
|
|
|
6553
6521
|
);
|
|
6554
6522
|
});
|
|
6555
6523
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
6556
|
-
var DropdownMenuSeparator =
|
|
6524
|
+
var DropdownMenuSeparator = React41.forwardRef((_a, ref) => {
|
|
6557
6525
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6558
6526
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6559
6527
|
DropdownMenuPrimitive.Separator,
|
|
@@ -6580,19 +6548,19 @@ var DropdownMenuShortcut = (_a) => {
|
|
|
6580
6548
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
6581
6549
|
|
|
6582
6550
|
// src/components/Form/form-component.tsx
|
|
6583
|
-
var
|
|
6551
|
+
var React43 = __toESM(require("react"), 1);
|
|
6584
6552
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
6585
6553
|
var import_react_hook_form = require("react-hook-form");
|
|
6586
6554
|
|
|
6587
6555
|
// src/components/Label/label.tsx
|
|
6588
6556
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
|
|
6589
6557
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
6590
|
-
var
|
|
6558
|
+
var React42 = __toESM(require("react"), 1);
|
|
6591
6559
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
6592
6560
|
var labelVariants = (0, import_class_variance_authority5.cva)(
|
|
6593
6561
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-label"
|
|
6594
6562
|
);
|
|
6595
|
-
var Label3 =
|
|
6563
|
+
var Label3 = React42.forwardRef((_a, ref) => {
|
|
6596
6564
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6597
6565
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6598
6566
|
LabelPrimitive.Root,
|
|
@@ -6606,7 +6574,7 @@ Label3.displayName = LabelPrimitive.Root.displayName;
|
|
|
6606
6574
|
|
|
6607
6575
|
// src/components/Form/form-component.tsx
|
|
6608
6576
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6609
|
-
var FormFieldContext =
|
|
6577
|
+
var FormFieldContext = React43.createContext(
|
|
6610
6578
|
null
|
|
6611
6579
|
);
|
|
6612
6580
|
function getErrorMessage(error) {
|
|
@@ -6642,18 +6610,18 @@ function getNextEnabledIndex(options, currentIndex, direction) {
|
|
|
6642
6610
|
}
|
|
6643
6611
|
return -1;
|
|
6644
6612
|
}
|
|
6645
|
-
var FormItemContext =
|
|
6646
|
-
var FormItem =
|
|
6613
|
+
var FormItemContext = React43.createContext(null);
|
|
6614
|
+
var FormItem = React43.forwardRef((_a, ref) => {
|
|
6647
6615
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6648
|
-
const id =
|
|
6616
|
+
const id = React43.useId();
|
|
6649
6617
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", __spreadValues({ ref, className: cn("space-y-2", className) }, props)) });
|
|
6650
6618
|
});
|
|
6651
6619
|
FormItem.displayName = "FormItem";
|
|
6652
6620
|
var useFormField = () => {
|
|
6653
6621
|
var _a;
|
|
6654
|
-
const generatedId =
|
|
6655
|
-
const fieldContext =
|
|
6656
|
-
const itemContext =
|
|
6622
|
+
const generatedId = React43.useId();
|
|
6623
|
+
const fieldContext = React43.useContext(FormFieldContext);
|
|
6624
|
+
const itemContext = React43.useContext(FormItemContext);
|
|
6657
6625
|
const formContext = (0, import_react_hook_form.useFormContext)();
|
|
6658
6626
|
const id = (_a = itemContext == null ? void 0 : itemContext.id) != null ? _a : generatedId;
|
|
6659
6627
|
if (!fieldContext || !formContext) {
|
|
@@ -6677,7 +6645,7 @@ var useFormField = () => {
|
|
|
6677
6645
|
formMessageId: `${id}-form-item-message`
|
|
6678
6646
|
}, fieldState);
|
|
6679
6647
|
};
|
|
6680
|
-
var FormLabel =
|
|
6648
|
+
var FormLabel = React43.forwardRef((_a, ref) => {
|
|
6681
6649
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6682
6650
|
const { error, formItemId } = useFormField();
|
|
6683
6651
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -6690,7 +6658,7 @@ var FormLabel = React44.forwardRef((_a, ref) => {
|
|
|
6690
6658
|
);
|
|
6691
6659
|
});
|
|
6692
6660
|
FormLabel.displayName = "FormLabel";
|
|
6693
|
-
var FormControl =
|
|
6661
|
+
var FormControl = React43.forwardRef((_a, ref) => {
|
|
6694
6662
|
var props = __objRest(_a, []);
|
|
6695
6663
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
6696
6664
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -6704,7 +6672,7 @@ var FormControl = React44.forwardRef((_a, ref) => {
|
|
|
6704
6672
|
);
|
|
6705
6673
|
});
|
|
6706
6674
|
FormControl.displayName = "FormControl";
|
|
6707
|
-
var FormMessage =
|
|
6675
|
+
var FormMessage = React43.forwardRef((_a, ref) => {
|
|
6708
6676
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
6709
6677
|
const { error, formMessageId } = useFormField();
|
|
6710
6678
|
const body = error ? getErrorMessage(error) : children;
|
|
@@ -6721,7 +6689,7 @@ var FormMessage = React44.forwardRef((_a, ref) => {
|
|
|
6721
6689
|
);
|
|
6722
6690
|
});
|
|
6723
6691
|
FormMessage.displayName = "FormMessage";
|
|
6724
|
-
var FormDescription =
|
|
6692
|
+
var FormDescription = React43.forwardRef((_a, ref) => {
|
|
6725
6693
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6726
6694
|
const { formDescriptionId } = useFormField();
|
|
6727
6695
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -6750,7 +6718,7 @@ function Form({
|
|
|
6750
6718
|
}
|
|
6751
6719
|
|
|
6752
6720
|
// src/components/Form/form-checkbox.tsx
|
|
6753
|
-
var
|
|
6721
|
+
var React44 = __toESM(require("react"), 1);
|
|
6754
6722
|
var import_lucide_react3 = require("lucide-react");
|
|
6755
6723
|
var import_react_hook_form3 = require("react-hook-form");
|
|
6756
6724
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
@@ -6791,7 +6759,7 @@ var FormCheckbox = (_a) => {
|
|
|
6791
6759
|
"onChange"
|
|
6792
6760
|
]);
|
|
6793
6761
|
var _a2;
|
|
6794
|
-
const generatedId =
|
|
6762
|
+
const generatedId = React44.useId();
|
|
6795
6763
|
const form = (0, import_react_hook_form3.useFormContext)();
|
|
6796
6764
|
const controllerControl = control != null ? control : form == null ? void 0 : form.control;
|
|
6797
6765
|
const checkboxId = (_a2 = checkboxProps.id) != null ? _a2 : `${generatedId}-checkbox`;
|
|
@@ -6903,9 +6871,9 @@ var import_lucide_react4 = require("lucide-react");
|
|
|
6903
6871
|
var import_react_hook_form4 = require("react-hook-form");
|
|
6904
6872
|
|
|
6905
6873
|
// src/components/input.tsx
|
|
6906
|
-
var
|
|
6874
|
+
var React45 = __toESM(require("react"), 1);
|
|
6907
6875
|
|
|
6908
|
-
// src/
|
|
6876
|
+
// src/utils/form-utils.ts
|
|
6909
6877
|
var formInputVariants = {
|
|
6910
6878
|
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",
|
|
6911
6879
|
soft: "rounded-md border border-transparent bg-muted/60 shadow-sm hover:bg-muted focus:bg-input/80 focus:ring-2 focus:ring-primary/20",
|
|
@@ -6915,6 +6883,15 @@ var formInputVariants = {
|
|
|
6915
6883
|
unstyled: "border-0 shadow-none focus:ring-0",
|
|
6916
6884
|
link: "h-auto border-0 bg-transparent p-0 text-primary shadow-none underline-offset-4 focus:underline focus:ring-0"
|
|
6917
6885
|
};
|
|
6886
|
+
var formCompositeVariants = {
|
|
6887
|
+
outline: "rounded-md border border-input bg-input backdrop-blur-sm shadow-sm hover:border-primary/60 focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/20",
|
|
6888
|
+
soft: "rounded-md border border-transparent bg-muted/60 shadow-sm hover:bg-muted focus-within:bg-input/80 focus-within:ring-2 focus-within:ring-primary/20",
|
|
6889
|
+
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus-within:ring-2 focus-within:ring-ring",
|
|
6890
|
+
filled: "rounded-md border border-input bg-muted/70 shadow-inner hover:bg-muted focus-within:bg-input/70 focus-within:ring-2 focus-within:ring-primary/20",
|
|
6891
|
+
flushed: "rounded-none border-0 border-b border-input px-0 shadow-none focus-within:border-b-2 focus-within:border-primary focus-within:ring-0",
|
|
6892
|
+
unstyled: "border-0 shadow-none focus-within:ring-0",
|
|
6893
|
+
link: "h-auto border-0 bg-transparent p-0 text-primary shadow-none underline-offset-4 focus-within:underline focus-within:ring-0"
|
|
6894
|
+
};
|
|
6918
6895
|
var variants = formInputVariants;
|
|
6919
6896
|
var formSizeVariants = {
|
|
6920
6897
|
"2xs": {
|
|
@@ -6995,13 +6972,22 @@ var formSizeVariants = {
|
|
|
6995
6972
|
message: "text-base"
|
|
6996
6973
|
}
|
|
6997
6974
|
};
|
|
6975
|
+
var formControlBase = "relative inline-flex w-full items-center justify-between gap-2 text-foreground outline-none transition data-[placeholder]:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50";
|
|
6976
|
+
var formCompositeControlBase = "relative flex w-full items-center gap-2 text-foreground outline-none transition";
|
|
6977
|
+
var formControlErrorClass = "border-destructive focus:border-destructive focus:ring-destructive/20";
|
|
6978
|
+
var formCompositeControlErrorClass = "border-destructive focus-within:border-destructive focus-within:ring-destructive/20";
|
|
6998
6979
|
function getFormSizeClasses(size = "md", customSize) {
|
|
6999
6980
|
return __spreadValues(__spreadValues({}, formSizeVariants[size]), customSize);
|
|
7000
6981
|
}
|
|
6982
|
+
function getFormControlSizeClass(variant, sizeClasses) {
|
|
6983
|
+
if (variant === "flushed") return sizeClasses.flushedControl;
|
|
6984
|
+
if (variant === "link") return sizeClasses.linkControl;
|
|
6985
|
+
return sizeClasses.control;
|
|
6986
|
+
}
|
|
7001
6987
|
|
|
7002
6988
|
// src/components/input.tsx
|
|
7003
6989
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7004
|
-
var Input =
|
|
6990
|
+
var Input = React45.forwardRef(
|
|
7005
6991
|
(_a, ref) => {
|
|
7006
6992
|
var _b = _a, {
|
|
7007
6993
|
className,
|
|
@@ -7207,178 +7193,1132 @@ var import_react_hook_form5 = require("react-hook-form");
|
|
|
7207
7193
|
|
|
7208
7194
|
// src/components/select.tsx
|
|
7209
7195
|
var import_react_icons9 = require("@radix-ui/react-icons");
|
|
7210
|
-
var
|
|
7211
|
-
var
|
|
7196
|
+
var React46 = __toESM(require("react"), 1);
|
|
7197
|
+
var import_react_dom = require("react-dom");
|
|
7212
7198
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
7213
|
-
var
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
}
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7238
|
-
SelectPrimitive.ScrollUpButton,
|
|
7239
|
-
__spreadProps(__spreadValues({
|
|
7240
|
-
ref,
|
|
7241
|
-
className: cn(
|
|
7242
|
-
"flex cursor-default items-center justify-center py-1",
|
|
7243
|
-
className
|
|
7244
|
-
)
|
|
7245
|
-
}, props), {
|
|
7246
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_icons9.ChevronUpIcon, {})
|
|
7247
|
-
})
|
|
7199
|
+
var SelectContext = React46.createContext(null);
|
|
7200
|
+
function useSelectContext(componentName) {
|
|
7201
|
+
const context = React46.useContext(SelectContext);
|
|
7202
|
+
if (!context) {
|
|
7203
|
+
throw new Error(`${componentName} must be used within <Select />`);
|
|
7204
|
+
}
|
|
7205
|
+
return context;
|
|
7206
|
+
}
|
|
7207
|
+
function useControllableState({
|
|
7208
|
+
value,
|
|
7209
|
+
defaultValue,
|
|
7210
|
+
onChange
|
|
7211
|
+
}) {
|
|
7212
|
+
const [internalValue, setInternalValue] = React46.useState(defaultValue);
|
|
7213
|
+
const isControlled = value !== void 0;
|
|
7214
|
+
const currentValue = isControlled ? value : internalValue;
|
|
7215
|
+
const setValue = React46.useCallback(
|
|
7216
|
+
(nextValue) => {
|
|
7217
|
+
if (!isControlled) {
|
|
7218
|
+
setInternalValue(nextValue);
|
|
7219
|
+
}
|
|
7220
|
+
onChange == null ? void 0 : onChange(nextValue);
|
|
7221
|
+
},
|
|
7222
|
+
[isControlled, onChange]
|
|
7248
7223
|
);
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7224
|
+
return [currentValue, setValue];
|
|
7225
|
+
}
|
|
7226
|
+
function composeRefs(...refs) {
|
|
7227
|
+
return (node) => {
|
|
7228
|
+
refs.forEach((ref) => {
|
|
7229
|
+
if (!ref) return;
|
|
7230
|
+
if (typeof ref === "function") {
|
|
7231
|
+
ref(node);
|
|
7232
|
+
return;
|
|
7233
|
+
}
|
|
7234
|
+
ref.current = node;
|
|
7235
|
+
});
|
|
7236
|
+
};
|
|
7237
|
+
}
|
|
7238
|
+
function getNodeText(node) {
|
|
7239
|
+
if (node === null || node === void 0 || typeof node === "boolean") {
|
|
7240
|
+
return "";
|
|
7241
|
+
}
|
|
7242
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
7243
|
+
return String(node);
|
|
7244
|
+
}
|
|
7245
|
+
if (Array.isArray(node)) {
|
|
7246
|
+
return node.map(getNodeText).join("");
|
|
7247
|
+
}
|
|
7248
|
+
if (React46.isValidElement(node)) {
|
|
7249
|
+
return getNodeText(node.props.children);
|
|
7250
|
+
}
|
|
7251
|
+
return "";
|
|
7252
|
+
}
|
|
7253
|
+
function getEnabledItems(items) {
|
|
7254
|
+
return items.filter((item) => !item.disabled);
|
|
7255
|
+
}
|
|
7256
|
+
function getNextItemValue(items, currentValue, direction) {
|
|
7257
|
+
var _a, _b, _c;
|
|
7258
|
+
const enabledItems = getEnabledItems(items);
|
|
7259
|
+
if (!enabledItems.length) return void 0;
|
|
7260
|
+
const currentIndex = enabledItems.findIndex(
|
|
7261
|
+
(item) => item.value === currentValue
|
|
7264
7262
|
);
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
return
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7263
|
+
if (currentIndex === -1) {
|
|
7264
|
+
return direction === "next" ? (_a = enabledItems[0]) == null ? void 0 : _a.value : (_b = enabledItems[enabledItems.length - 1]) == null ? void 0 : _b.value;
|
|
7265
|
+
}
|
|
7266
|
+
const nextIndex = direction === "next" ? (currentIndex + 1) % enabledItems.length : (currentIndex - 1 + enabledItems.length) % enabledItems.length;
|
|
7267
|
+
return (_c = enabledItems[nextIndex]) == null ? void 0 : _c.value;
|
|
7268
|
+
}
|
|
7269
|
+
function Select2({
|
|
7270
|
+
value,
|
|
7271
|
+
defaultValue = "",
|
|
7272
|
+
onValueChange,
|
|
7273
|
+
open,
|
|
7274
|
+
defaultOpen = false,
|
|
7275
|
+
onOpenChange,
|
|
7276
|
+
disabled = false,
|
|
7277
|
+
name,
|
|
7278
|
+
required,
|
|
7279
|
+
variant = "outline",
|
|
7280
|
+
size = "sm",
|
|
7281
|
+
customSize,
|
|
7282
|
+
invalid = false,
|
|
7283
|
+
children
|
|
7284
|
+
}) {
|
|
7285
|
+
const triggerRef = React46.useRef(null);
|
|
7286
|
+
const contentRef = React46.useRef(null);
|
|
7287
|
+
const [currentValue, setCurrentValue] = useControllableState({
|
|
7288
|
+
value,
|
|
7289
|
+
defaultValue,
|
|
7290
|
+
onChange: onValueChange
|
|
7291
|
+
});
|
|
7292
|
+
const [isOpen, setIsOpen] = useControllableState({
|
|
7293
|
+
value: open,
|
|
7294
|
+
defaultValue: defaultOpen,
|
|
7295
|
+
onChange: onOpenChange
|
|
7296
|
+
});
|
|
7297
|
+
const itemsRef = React46.useRef(/* @__PURE__ */ new Map());
|
|
7298
|
+
const [itemsVersion, forceItemsUpdate] = React46.useReducer(
|
|
7299
|
+
(version) => version + 1,
|
|
7300
|
+
0
|
|
7301
|
+
);
|
|
7302
|
+
const [activeValue, setActiveValue] = React46.useState();
|
|
7303
|
+
const items = React46.useMemo(
|
|
7304
|
+
() => Array.from(itemsRef.current.values()),
|
|
7305
|
+
[itemsVersion]
|
|
7306
|
+
);
|
|
7307
|
+
const selectedItem = items.find((item) => item.value === currentValue);
|
|
7308
|
+
const registerItem = React46.useCallback((item) => {
|
|
7309
|
+
itemsRef.current.set(item.value, item);
|
|
7310
|
+
forceItemsUpdate();
|
|
7311
|
+
}, []);
|
|
7312
|
+
const unregisterItem = React46.useCallback((value2, id) => {
|
|
7313
|
+
const currentItem = itemsRef.current.get(value2);
|
|
7314
|
+
if (!currentItem || currentItem.id !== id) return;
|
|
7315
|
+
itemsRef.current.set(value2, __spreadProps(__spreadValues({}, currentItem), {
|
|
7316
|
+
ref: null
|
|
7317
|
+
}));
|
|
7318
|
+
forceItemsUpdate();
|
|
7319
|
+
}, []);
|
|
7320
|
+
const updateItemRef = React46.useCallback(
|
|
7321
|
+
(value2, id, node) => {
|
|
7322
|
+
const currentItem = itemsRef.current.get(value2);
|
|
7323
|
+
if (!currentItem || currentItem.id !== id) return;
|
|
7324
|
+
if (currentItem.ref === node) return;
|
|
7325
|
+
itemsRef.current.set(value2, __spreadProps(__spreadValues({}, currentItem), {
|
|
7326
|
+
ref: node
|
|
7327
|
+
}));
|
|
7328
|
+
forceItemsUpdate();
|
|
7329
|
+
},
|
|
7330
|
+
[]
|
|
7306
7331
|
);
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
__spreadProps(__spreadValues({
|
|
7314
|
-
ref,
|
|
7315
|
-
className: cn(
|
|
7316
|
-
"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",
|
|
7317
|
-
className
|
|
7318
|
-
)
|
|
7319
|
-
}, props), {
|
|
7320
|
-
children: [
|
|
7321
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_icons9.CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
7322
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemText, { children })
|
|
7323
|
-
]
|
|
7324
|
-
})
|
|
7332
|
+
const handleOpenChange = React46.useCallback(
|
|
7333
|
+
(nextOpen) => {
|
|
7334
|
+
if (disabled) return;
|
|
7335
|
+
setIsOpen(nextOpen);
|
|
7336
|
+
},
|
|
7337
|
+
[disabled, setIsOpen]
|
|
7325
7338
|
);
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
},
|
|
7339
|
+
const handleValueChange = React46.useCallback(
|
|
7340
|
+
(nextValue) => {
|
|
7341
|
+
if (disabled) return;
|
|
7342
|
+
setCurrentValue(nextValue);
|
|
7343
|
+
setIsOpen(false);
|
|
7344
|
+
requestAnimationFrame(() => {
|
|
7345
|
+
var _a;
|
|
7346
|
+
(_a = triggerRef.current) == null ? void 0 : _a.focus();
|
|
7347
|
+
});
|
|
7348
|
+
},
|
|
7349
|
+
[disabled, setCurrentValue, setIsOpen]
|
|
7336
7350
|
);
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7351
|
+
React46.useEffect(() => {
|
|
7352
|
+
var _a;
|
|
7353
|
+
if (!isOpen) return;
|
|
7354
|
+
const selectedEnabledItem = items.find(
|
|
7355
|
+
(item) => item.value === currentValue && !item.disabled
|
|
7356
|
+
);
|
|
7357
|
+
const firstEnabledItem = getEnabledItems(items)[0];
|
|
7358
|
+
setActiveValue((_a = selectedEnabledItem == null ? void 0 : selectedEnabledItem.value) != null ? _a : firstEnabledItem == null ? void 0 : firstEnabledItem.value);
|
|
7359
|
+
}, [currentValue, isOpen, items]);
|
|
7360
|
+
React46.useEffect(() => {
|
|
7361
|
+
if (!isOpen) return;
|
|
7362
|
+
const handlePointerDown = (event) => {
|
|
7363
|
+
var _a, _b;
|
|
7364
|
+
const target = event.target;
|
|
7365
|
+
if (((_a = triggerRef.current) == null ? void 0 : _a.contains(target)) || ((_b = contentRef.current) == null ? void 0 : _b.contains(target))) {
|
|
7366
|
+
return;
|
|
7367
|
+
}
|
|
7368
|
+
setIsOpen(false);
|
|
7369
|
+
};
|
|
7370
|
+
document.addEventListener("pointerdown", handlePointerDown);
|
|
7371
|
+
return () => {
|
|
7372
|
+
document.removeEventListener("pointerdown", handlePointerDown);
|
|
7373
|
+
};
|
|
7374
|
+
}, [isOpen, setIsOpen]);
|
|
7375
|
+
const contextValue = React46.useMemo(
|
|
7376
|
+
() => ({
|
|
7377
|
+
value: currentValue,
|
|
7378
|
+
open: isOpen,
|
|
7379
|
+
disabled,
|
|
7380
|
+
invalid,
|
|
7381
|
+
variant,
|
|
7382
|
+
size,
|
|
7383
|
+
customSize,
|
|
7384
|
+
selectedItem,
|
|
7385
|
+
activeValue,
|
|
7386
|
+
items,
|
|
7387
|
+
triggerRef,
|
|
7388
|
+
contentRef,
|
|
7389
|
+
setOpen: handleOpenChange,
|
|
7390
|
+
setValue: handleValueChange,
|
|
7391
|
+
setActiveValue,
|
|
7392
|
+
registerItem,
|
|
7393
|
+
unregisterItem,
|
|
7394
|
+
updateItemRef
|
|
7395
|
+
}),
|
|
7396
|
+
[
|
|
7397
|
+
currentValue,
|
|
7398
|
+
isOpen,
|
|
7399
|
+
disabled,
|
|
7400
|
+
invalid,
|
|
7401
|
+
variant,
|
|
7402
|
+
size,
|
|
7403
|
+
customSize,
|
|
7404
|
+
selectedItem,
|
|
7405
|
+
activeValue,
|
|
7406
|
+
items,
|
|
7407
|
+
handleOpenChange,
|
|
7408
|
+
handleValueChange,
|
|
7409
|
+
registerItem,
|
|
7410
|
+
unregisterItem,
|
|
7411
|
+
updateItemRef
|
|
7412
|
+
]
|
|
7413
|
+
);
|
|
7414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(SelectContext.Provider, { value: contextValue, children: [
|
|
7415
|
+
children,
|
|
7416
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7417
|
+
"input",
|
|
7418
|
+
{
|
|
7419
|
+
type: "hidden",
|
|
7420
|
+
name,
|
|
7421
|
+
value: currentValue,
|
|
7422
|
+
required
|
|
7423
|
+
}
|
|
7424
|
+
) : null
|
|
7425
|
+
] });
|
|
7426
|
+
}
|
|
7427
|
+
var SelectTrigger = React46.forwardRef(
|
|
7428
|
+
(_a, ref) => {
|
|
7429
|
+
var _b = _a, {
|
|
7430
|
+
className,
|
|
7431
|
+
children,
|
|
7432
|
+
variant,
|
|
7433
|
+
size,
|
|
7434
|
+
customSize,
|
|
7435
|
+
invalid,
|
|
7436
|
+
disabled,
|
|
7437
|
+
onClick,
|
|
7438
|
+
onKeyDown
|
|
7439
|
+
} = _b, props = __objRest(_b, [
|
|
7440
|
+
"className",
|
|
7441
|
+
"children",
|
|
7442
|
+
"variant",
|
|
7443
|
+
"size",
|
|
7444
|
+
"customSize",
|
|
7445
|
+
"invalid",
|
|
7446
|
+
"disabled",
|
|
7447
|
+
"onClick",
|
|
7448
|
+
"onKeyDown"
|
|
7449
|
+
]);
|
|
7450
|
+
const context = useSelectContext("SelectTrigger");
|
|
7451
|
+
const resolvedVariant = variant != null ? variant : context.variant;
|
|
7452
|
+
const resolvedSize = size != null ? size : context.size;
|
|
7453
|
+
const resolvedCustomSize = customSize != null ? customSize : context.customSize;
|
|
7454
|
+
const resolvedInvalid = invalid != null ? invalid : context.invalid;
|
|
7455
|
+
const resolvedDisabled = disabled != null ? disabled : context.disabled;
|
|
7456
|
+
const sizeClasses = getFormSizeClasses(resolvedSize, resolvedCustomSize);
|
|
7457
|
+
const controlSizeClass = getFormControlSizeClass(
|
|
7458
|
+
resolvedVariant,
|
|
7459
|
+
sizeClasses
|
|
7460
|
+
);
|
|
7461
|
+
const typeaheadRef = React46.useRef("");
|
|
7462
|
+
const typeaheadTimeoutRef = React46.useRef(null);
|
|
7463
|
+
const moveActiveItem = React46.useCallback(
|
|
7464
|
+
(direction) => {
|
|
7465
|
+
var _a2;
|
|
7466
|
+
const nextValue = getNextItemValue(
|
|
7467
|
+
context.items,
|
|
7468
|
+
(_a2 = context.activeValue) != null ? _a2 : context.value,
|
|
7469
|
+
direction
|
|
7470
|
+
);
|
|
7471
|
+
if (nextValue) {
|
|
7472
|
+
context.setActiveValue(nextValue);
|
|
7473
|
+
}
|
|
7474
|
+
},
|
|
7475
|
+
[context]
|
|
7476
|
+
);
|
|
7477
|
+
const handleTypeahead = React46.useCallback(
|
|
7478
|
+
(key) => {
|
|
7479
|
+
typeaheadRef.current += key.toLowerCase();
|
|
7480
|
+
if (typeaheadTimeoutRef.current) {
|
|
7481
|
+
window.clearTimeout(typeaheadTimeoutRef.current);
|
|
7482
|
+
}
|
|
7483
|
+
typeaheadTimeoutRef.current = window.setTimeout(() => {
|
|
7484
|
+
typeaheadRef.current = "";
|
|
7485
|
+
}, 500);
|
|
7486
|
+
const enabledItems = getEnabledItems(context.items);
|
|
7487
|
+
const match2 = enabledItems.find(
|
|
7488
|
+
(item) => item.textValue.toLowerCase().startsWith(typeaheadRef.current)
|
|
7489
|
+
);
|
|
7490
|
+
if (!match2) return;
|
|
7491
|
+
if (!context.open) {
|
|
7492
|
+
context.setOpen(true);
|
|
7493
|
+
}
|
|
7494
|
+
context.setActiveValue(match2.value);
|
|
7495
|
+
},
|
|
7496
|
+
[context]
|
|
7497
|
+
);
|
|
7498
|
+
React46.useEffect(() => {
|
|
7499
|
+
return () => {
|
|
7500
|
+
if (typeaheadTimeoutRef.current) {
|
|
7501
|
+
window.clearTimeout(typeaheadTimeoutRef.current);
|
|
7502
|
+
}
|
|
7503
|
+
};
|
|
7504
|
+
}, []);
|
|
7505
|
+
const handleKeyDown = (event) => {
|
|
7506
|
+
onKeyDown == null ? void 0 : onKeyDown(event);
|
|
7507
|
+
if (event.defaultPrevented || resolvedDisabled) return;
|
|
7508
|
+
if (event.key === "ArrowDown") {
|
|
7509
|
+
event.preventDefault();
|
|
7510
|
+
if (!context.open) {
|
|
7511
|
+
context.setOpen(true);
|
|
7512
|
+
return;
|
|
7513
|
+
}
|
|
7514
|
+
moveActiveItem("next");
|
|
7515
|
+
return;
|
|
7516
|
+
}
|
|
7517
|
+
if (event.key === "ArrowUp") {
|
|
7518
|
+
event.preventDefault();
|
|
7519
|
+
if (!context.open) {
|
|
7520
|
+
context.setOpen(true);
|
|
7521
|
+
return;
|
|
7522
|
+
}
|
|
7523
|
+
moveActiveItem("previous");
|
|
7524
|
+
return;
|
|
7525
|
+
}
|
|
7526
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
7527
|
+
event.preventDefault();
|
|
7528
|
+
if (!context.open) {
|
|
7529
|
+
context.setOpen(true);
|
|
7530
|
+
return;
|
|
7531
|
+
}
|
|
7532
|
+
if (context.activeValue) {
|
|
7533
|
+
context.setValue(context.activeValue);
|
|
7534
|
+
}
|
|
7535
|
+
return;
|
|
7536
|
+
}
|
|
7537
|
+
if (event.key === "Escape") {
|
|
7538
|
+
event.preventDefault();
|
|
7539
|
+
context.setOpen(false);
|
|
7540
|
+
return;
|
|
7541
|
+
}
|
|
7542
|
+
if (event.key === "Home") {
|
|
7543
|
+
event.preventDefault();
|
|
7544
|
+
const firstEnabledItem = getEnabledItems(context.items)[0];
|
|
7545
|
+
if (firstEnabledItem) {
|
|
7546
|
+
context.setActiveValue(firstEnabledItem.value);
|
|
7547
|
+
}
|
|
7548
|
+
return;
|
|
7549
|
+
}
|
|
7550
|
+
if (event.key === "End") {
|
|
7551
|
+
event.preventDefault();
|
|
7552
|
+
const enabledItems = getEnabledItems(context.items);
|
|
7553
|
+
const lastEnabledItem = enabledItems[enabledItems.length - 1];
|
|
7554
|
+
if (lastEnabledItem) {
|
|
7555
|
+
context.setActiveValue(lastEnabledItem.value);
|
|
7556
|
+
}
|
|
7557
|
+
return;
|
|
7558
|
+
}
|
|
7559
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
7560
|
+
handleTypeahead(event.key);
|
|
7561
|
+
}
|
|
7562
|
+
};
|
|
7563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7564
|
+
"button",
|
|
7565
|
+
__spreadProps(__spreadValues({
|
|
7566
|
+
ref: composeRefs(ref, context.triggerRef),
|
|
7567
|
+
type: "button",
|
|
7568
|
+
"aria-haspopup": "listbox",
|
|
7569
|
+
"aria-expanded": context.open,
|
|
7570
|
+
"data-placeholder": !context.value ? "" : void 0,
|
|
7571
|
+
disabled: resolvedDisabled,
|
|
7572
|
+
className: cn(
|
|
7573
|
+
formControlBase,
|
|
7574
|
+
"whitespace-nowrap ring-offset-background [&>span]:line-clamp-1",
|
|
7575
|
+
formInputVariants[resolvedVariant],
|
|
7576
|
+
controlSizeClass,
|
|
7577
|
+
resolvedInvalid && formControlErrorClass,
|
|
7578
|
+
className
|
|
7579
|
+
),
|
|
7580
|
+
onClick: (event) => {
|
|
7581
|
+
onClick == null ? void 0 : onClick(event);
|
|
7582
|
+
if (!event.defaultPrevented && !resolvedDisabled) {
|
|
7583
|
+
context.setOpen(!context.open);
|
|
7584
|
+
}
|
|
7585
|
+
},
|
|
7586
|
+
onKeyDown: handleKeyDown
|
|
7587
|
+
}, props), {
|
|
7588
|
+
children: [
|
|
7589
|
+
children,
|
|
7590
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_icons9.CaretSortIcon, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
7591
|
+
]
|
|
7592
|
+
})
|
|
7593
|
+
);
|
|
7594
|
+
}
|
|
7595
|
+
);
|
|
7596
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
7597
|
+
var SelectValue = React46.forwardRef(
|
|
7598
|
+
(_a, ref) => {
|
|
7599
|
+
var _b = _a, { className, placeholder, children } = _b, props = __objRest(_b, ["className", "placeholder", "children"]);
|
|
7600
|
+
var _a2, _b2;
|
|
7601
|
+
const context = useSelectContext("SelectValue");
|
|
7602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", __spreadProps(__spreadValues({ ref, className: cn("truncate", className) }, props), { children: (_b2 = children != null ? children : (_a2 = context.selectedItem) == null ? void 0 : _a2.label) != null ? _b2 : placeholder }));
|
|
7603
|
+
}
|
|
7604
|
+
);
|
|
7605
|
+
SelectValue.displayName = "SelectValue";
|
|
7606
|
+
var SelectContent = React46.forwardRef(
|
|
7607
|
+
(_a, ref) => {
|
|
7608
|
+
var _b = _a, {
|
|
7609
|
+
className,
|
|
7610
|
+
children,
|
|
7611
|
+
sideOffset = 4,
|
|
7612
|
+
align = "start",
|
|
7613
|
+
position: _position,
|
|
7614
|
+
style
|
|
7615
|
+
} = _b, props = __objRest(_b, [
|
|
7616
|
+
"className",
|
|
7617
|
+
"children",
|
|
7618
|
+
"sideOffset",
|
|
7619
|
+
"align",
|
|
7620
|
+
"position",
|
|
7621
|
+
"style"
|
|
7622
|
+
]);
|
|
7623
|
+
const context = useSelectContext("SelectContent");
|
|
7624
|
+
const scrollRef = React46.useRef(null);
|
|
7625
|
+
const rafRef = React46.useRef(null);
|
|
7626
|
+
const [mounted, setMounted] = React46.useState(false);
|
|
7627
|
+
const [side, setSide] = React46.useState("bottom");
|
|
7628
|
+
const [contentStyle, setContentStyle] = React46.useState();
|
|
7629
|
+
React46.useEffect(() => {
|
|
7630
|
+
setMounted(true);
|
|
7631
|
+
}, []);
|
|
7632
|
+
const updatePosition = React46.useCallback(() => {
|
|
7633
|
+
const trigger = context.triggerRef.current;
|
|
7634
|
+
if (!trigger) return;
|
|
7635
|
+
const rect = trigger.getBoundingClientRect();
|
|
7636
|
+
const viewportPadding = 8;
|
|
7637
|
+
const preferredMaxHeight = 260;
|
|
7638
|
+
const minUsefulHeight = 140;
|
|
7639
|
+
const availableBelow = window.innerHeight - rect.bottom - viewportPadding - sideOffset;
|
|
7640
|
+
const availableAbove = rect.top - viewportPadding - sideOffset;
|
|
7641
|
+
const nextSide = availableBelow >= Math.min(preferredMaxHeight, minUsefulHeight) || availableBelow >= availableAbove ? "bottom" : "top";
|
|
7642
|
+
const availableHeight = nextSide === "bottom" ? availableBelow : availableAbove;
|
|
7643
|
+
const contentMaxHeight = Math.max(
|
|
7644
|
+
80,
|
|
7645
|
+
Math.min(preferredMaxHeight, availableHeight)
|
|
7646
|
+
);
|
|
7647
|
+
const baseStyle = {
|
|
7648
|
+
position: "fixed",
|
|
7649
|
+
zIndex: 9999,
|
|
7650
|
+
width: rect.width,
|
|
7651
|
+
minWidth: rect.width,
|
|
7652
|
+
maxWidth: "calc(100vw - 16px)",
|
|
7653
|
+
maxHeight: contentMaxHeight
|
|
7654
|
+
};
|
|
7655
|
+
if (align === "start") {
|
|
7656
|
+
baseStyle.left = rect.left;
|
|
7657
|
+
baseStyle.transform = void 0;
|
|
7658
|
+
}
|
|
7659
|
+
if (align === "center") {
|
|
7660
|
+
baseStyle.left = rect.left + rect.width / 2;
|
|
7661
|
+
baseStyle.transform = "translateX(-50%)";
|
|
7662
|
+
}
|
|
7663
|
+
if (align === "end") {
|
|
7664
|
+
baseStyle.left = rect.right;
|
|
7665
|
+
baseStyle.transform = "translateX(-100%)";
|
|
7666
|
+
}
|
|
7667
|
+
if (nextSide === "bottom") {
|
|
7668
|
+
baseStyle.top = rect.bottom + sideOffset;
|
|
7669
|
+
baseStyle.bottom = void 0;
|
|
7670
|
+
} else {
|
|
7671
|
+
baseStyle.bottom = window.innerHeight - rect.top + sideOffset;
|
|
7672
|
+
baseStyle.top = void 0;
|
|
7673
|
+
}
|
|
7674
|
+
setSide(nextSide);
|
|
7675
|
+
setContentStyle(baseStyle);
|
|
7676
|
+
}, [align, context.triggerRef, sideOffset]);
|
|
7677
|
+
const scheduleUpdatePosition = React46.useCallback(() => {
|
|
7678
|
+
if (rafRef.current) {
|
|
7679
|
+
cancelAnimationFrame(rafRef.current);
|
|
7680
|
+
}
|
|
7681
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
7682
|
+
updatePosition();
|
|
7683
|
+
});
|
|
7684
|
+
}, [updatePosition]);
|
|
7685
|
+
React46.useLayoutEffect(() => {
|
|
7686
|
+
var _a2, _b2;
|
|
7687
|
+
if (!context.open) return;
|
|
7688
|
+
updatePosition();
|
|
7689
|
+
scheduleUpdatePosition();
|
|
7690
|
+
const handleResize = () => {
|
|
7691
|
+
scheduleUpdatePosition();
|
|
7692
|
+
};
|
|
7693
|
+
const handlePageScroll = (event) => {
|
|
7694
|
+
var _a3;
|
|
7695
|
+
const target = event.target;
|
|
7696
|
+
if (target && ((_a3 = scrollRef.current) == null ? void 0 : _a3.contains(target))) {
|
|
7697
|
+
return;
|
|
7698
|
+
}
|
|
7699
|
+
scheduleUpdatePosition();
|
|
7700
|
+
};
|
|
7701
|
+
window.addEventListener("resize", handleResize);
|
|
7702
|
+
window.addEventListener("scroll", handlePageScroll, true);
|
|
7703
|
+
(_a2 = window.visualViewport) == null ? void 0 : _a2.addEventListener("resize", handleResize);
|
|
7704
|
+
(_b2 = window.visualViewport) == null ? void 0 : _b2.addEventListener("scroll", handleResize);
|
|
7705
|
+
return () => {
|
|
7706
|
+
var _a3, _b3;
|
|
7707
|
+
window.removeEventListener("resize", handleResize);
|
|
7708
|
+
window.removeEventListener("scroll", handlePageScroll, true);
|
|
7709
|
+
(_a3 = window.visualViewport) == null ? void 0 : _a3.removeEventListener("resize", handleResize);
|
|
7710
|
+
(_b3 = window.visualViewport) == null ? void 0 : _b3.removeEventListener("scroll", handleResize);
|
|
7711
|
+
if (rafRef.current) {
|
|
7712
|
+
cancelAnimationFrame(rafRef.current);
|
|
7713
|
+
rafRef.current = null;
|
|
7714
|
+
}
|
|
7715
|
+
};
|
|
7716
|
+
}, [context.open, scheduleUpdatePosition, updatePosition]);
|
|
7717
|
+
React46.useLayoutEffect(() => {
|
|
7718
|
+
if (!context.open) return;
|
|
7719
|
+
const frame = requestAnimationFrame(() => {
|
|
7720
|
+
var _a2;
|
|
7721
|
+
const activeItem = context.items.find(
|
|
7722
|
+
(item) => item.value === context.activeValue
|
|
7723
|
+
);
|
|
7724
|
+
(_a2 = activeItem == null ? void 0 : activeItem.ref) == null ? void 0 : _a2.scrollIntoView({
|
|
7725
|
+
block: "nearest"
|
|
7726
|
+
});
|
|
7727
|
+
});
|
|
7728
|
+
return () => {
|
|
7729
|
+
cancelAnimationFrame(frame);
|
|
7730
|
+
};
|
|
7731
|
+
}, [context.activeValue, context.items, context.open]);
|
|
7732
|
+
if (!context.open) {
|
|
7733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { hidden: true, "aria-hidden": "true", style: { display: "none" }, children });
|
|
7734
|
+
}
|
|
7735
|
+
if (!mounted || !contentStyle) return null;
|
|
7736
|
+
return (0, import_react_dom.createPortal)(
|
|
7737
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7738
|
+
"div",
|
|
7739
|
+
__spreadProps(__spreadValues({}, props), {
|
|
7740
|
+
ref: composeRefs(ref, context.contentRef),
|
|
7741
|
+
role: "listbox",
|
|
7742
|
+
"data-side": side,
|
|
7743
|
+
className: cn(
|
|
7744
|
+
"min-w-32 rounded-md border border-border bg-popover text-popover-foreground shadow-md",
|
|
7745
|
+
"overflow-hidden",
|
|
7746
|
+
className
|
|
7747
|
+
),
|
|
7748
|
+
style: __spreadValues(__spreadValues({}, contentStyle), style),
|
|
7749
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7750
|
+
"div",
|
|
7751
|
+
{
|
|
7752
|
+
ref: scrollRef,
|
|
7753
|
+
"data-select-scroll-content": true,
|
|
7754
|
+
className: cn(
|
|
7755
|
+
"max-h-full px-1 py-1",
|
|
7756
|
+
"!overflow-x-hidden !overflow-y-scroll overscroll-contain",
|
|
7757
|
+
"[scrollbar-gutter:stable]",
|
|
7758
|
+
"[scrollbar-width:thin]",
|
|
7759
|
+
"[&::-webkit-scrollbar]:!block",
|
|
7760
|
+
"[&::-webkit-scrollbar]:!w-2",
|
|
7761
|
+
"[&::-webkit-scrollbar-track]:!bg-transparent",
|
|
7762
|
+
"[&::-webkit-scrollbar-thumb]:!rounded-full",
|
|
7763
|
+
"[&::-webkit-scrollbar-thumb]:!bg-border"
|
|
7764
|
+
),
|
|
7765
|
+
style: {
|
|
7766
|
+
maxHeight: contentStyle.maxHeight,
|
|
7767
|
+
overflowX: "hidden",
|
|
7768
|
+
overflowY: "scroll",
|
|
7769
|
+
overscrollBehavior: "contain",
|
|
7770
|
+
scrollbarGutter: "stable",
|
|
7771
|
+
WebkitOverflowScrolling: "touch"
|
|
7772
|
+
},
|
|
7773
|
+
onWheel: (event) => {
|
|
7774
|
+
event.stopPropagation();
|
|
7775
|
+
},
|
|
7776
|
+
children
|
|
7777
|
+
}
|
|
7778
|
+
)
|
|
7779
|
+
})
|
|
7780
|
+
),
|
|
7781
|
+
document.body
|
|
7782
|
+
);
|
|
7783
|
+
}
|
|
7784
|
+
);
|
|
7785
|
+
SelectContent.displayName = "SelectContent";
|
|
7786
|
+
var SelectGroup = React46.forwardRef(
|
|
7787
|
+
(_a, ref) => {
|
|
7788
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", __spreadValues({ ref, role: "group", className }, props));
|
|
7790
|
+
}
|
|
7791
|
+
);
|
|
7792
|
+
SelectGroup.displayName = "SelectGroup";
|
|
7793
|
+
var SelectLabel = React46.forwardRef(
|
|
7794
|
+
(_a, ref) => {
|
|
7795
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7797
|
+
"div",
|
|
7798
|
+
__spreadValues({
|
|
7799
|
+
ref,
|
|
7800
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", className)
|
|
7801
|
+
}, props)
|
|
7802
|
+
);
|
|
7803
|
+
}
|
|
7804
|
+
);
|
|
7805
|
+
SelectLabel.displayName = "SelectLabel";
|
|
7806
|
+
var SelectItem = React46.forwardRef(
|
|
7807
|
+
(_a, ref) => {
|
|
7808
|
+
var _b = _a, {
|
|
7809
|
+
className,
|
|
7810
|
+
children,
|
|
7811
|
+
value,
|
|
7812
|
+
disabled = false,
|
|
7813
|
+
textValue,
|
|
7814
|
+
size,
|
|
7815
|
+
customSize,
|
|
7816
|
+
onClick,
|
|
7817
|
+
onMouseMove,
|
|
7818
|
+
onMouseDown
|
|
7819
|
+
} = _b, props = __objRest(_b, [
|
|
7820
|
+
"className",
|
|
7821
|
+
"children",
|
|
7822
|
+
"value",
|
|
7823
|
+
"disabled",
|
|
7824
|
+
"textValue",
|
|
7825
|
+
"size",
|
|
7826
|
+
"customSize",
|
|
7827
|
+
"onClick",
|
|
7828
|
+
"onMouseMove",
|
|
7829
|
+
"onMouseDown"
|
|
7830
|
+
]);
|
|
7831
|
+
const context = useSelectContext("SelectItem");
|
|
7832
|
+
const {
|
|
7833
|
+
registerItem,
|
|
7834
|
+
unregisterItem,
|
|
7835
|
+
updateItemRef,
|
|
7836
|
+
setActiveValue,
|
|
7837
|
+
setValue,
|
|
7838
|
+
value: selectedValue,
|
|
7839
|
+
activeValue,
|
|
7840
|
+
size: contextSize,
|
|
7841
|
+
customSize: contextCustomSize
|
|
7842
|
+
} = context;
|
|
7843
|
+
const itemId = React46.useId();
|
|
7844
|
+
const localRef = React46.useRef(null);
|
|
7845
|
+
const resolvedSize = size != null ? size : contextSize;
|
|
7846
|
+
const resolvedCustomSize = customSize != null ? customSize : contextCustomSize;
|
|
7847
|
+
const sizeClasses = getFormSizeClasses(resolvedSize, resolvedCustomSize);
|
|
7848
|
+
const labelText = textValue != null ? textValue : getNodeText(children);
|
|
7849
|
+
const isSelected = selectedValue === value;
|
|
7850
|
+
const isActive = activeValue === value;
|
|
7851
|
+
React46.useEffect(() => {
|
|
7852
|
+
registerItem({
|
|
7853
|
+
id: itemId,
|
|
7854
|
+
value,
|
|
7855
|
+
label: children,
|
|
7856
|
+
textValue: labelText,
|
|
7857
|
+
disabled,
|
|
7858
|
+
ref: localRef.current
|
|
7859
|
+
});
|
|
7860
|
+
return () => {
|
|
7861
|
+
unregisterItem(value, itemId);
|
|
7862
|
+
};
|
|
7863
|
+
}, [
|
|
7864
|
+
registerItem,
|
|
7865
|
+
unregisterItem,
|
|
7866
|
+
itemId,
|
|
7867
|
+
value,
|
|
7868
|
+
children,
|
|
7869
|
+
labelText,
|
|
7870
|
+
disabled
|
|
7871
|
+
]);
|
|
7872
|
+
const handleItemRef = React46.useCallback(
|
|
7873
|
+
(node) => {
|
|
7874
|
+
localRef.current = node;
|
|
7875
|
+
updateItemRef(value, itemId, node);
|
|
7876
|
+
},
|
|
7877
|
+
[updateItemRef, value, itemId]
|
|
7878
|
+
);
|
|
7879
|
+
const setRefs = React46.useMemo(
|
|
7880
|
+
() => composeRefs(ref, handleItemRef),
|
|
7881
|
+
[ref, handleItemRef]
|
|
7882
|
+
);
|
|
7883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7884
|
+
"div",
|
|
7885
|
+
__spreadProps(__spreadValues({
|
|
7886
|
+
ref: setRefs,
|
|
7887
|
+
id: itemId,
|
|
7888
|
+
role: "option",
|
|
7889
|
+
"aria-selected": isSelected,
|
|
7890
|
+
"aria-disabled": disabled,
|
|
7891
|
+
"data-highlighted": isActive ? "" : void 0,
|
|
7892
|
+
"data-disabled": disabled ? "" : void 0,
|
|
7893
|
+
className: cn(
|
|
7894
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 outline-none transition-colors",
|
|
7895
|
+
sizeClasses.selectItem,
|
|
7896
|
+
!disabled && "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
|
|
7897
|
+
disabled && "pointer-events-none opacity-50",
|
|
7898
|
+
className
|
|
7899
|
+
),
|
|
7900
|
+
onMouseDown: (event) => {
|
|
7901
|
+
event.preventDefault();
|
|
7902
|
+
onMouseDown == null ? void 0 : onMouseDown(event);
|
|
7903
|
+
},
|
|
7904
|
+
onMouseMove: (event) => {
|
|
7905
|
+
onMouseMove == null ? void 0 : onMouseMove(event);
|
|
7906
|
+
if (!disabled) {
|
|
7907
|
+
setActiveValue(value);
|
|
7908
|
+
}
|
|
7909
|
+
},
|
|
7910
|
+
onClick: (event) => {
|
|
7911
|
+
onClick == null ? void 0 : onClick(event);
|
|
7912
|
+
if (!event.defaultPrevented && !disabled) {
|
|
7913
|
+
setValue(value);
|
|
7914
|
+
}
|
|
7915
|
+
}
|
|
7916
|
+
}, props), {
|
|
7917
|
+
children: [
|
|
7918
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_icons9.CheckIcon, { className: "h-4 w-4" }) : null }),
|
|
7919
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate", children })
|
|
7920
|
+
]
|
|
7921
|
+
})
|
|
7922
|
+
);
|
|
7923
|
+
}
|
|
7924
|
+
);
|
|
7925
|
+
SelectItem.displayName = "SelectItem";
|
|
7926
|
+
var SelectSeparator = React46.forwardRef(
|
|
7927
|
+
(_a, ref) => {
|
|
7928
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7930
|
+
"div",
|
|
7931
|
+
__spreadValues({
|
|
7932
|
+
ref,
|
|
7933
|
+
role: "separator",
|
|
7934
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
7935
|
+
}, props)
|
|
7936
|
+
);
|
|
7937
|
+
}
|
|
7938
|
+
);
|
|
7939
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
7940
|
+
|
|
7941
|
+
// src/components/searchable-select.tsx
|
|
7942
|
+
var React47 = __toESM(require("react"), 1);
|
|
7943
|
+
var import_react_icons10 = require("@radix-ui/react-icons");
|
|
7944
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
7945
|
+
function normalizeText(value) {
|
|
7946
|
+
return String(value != null ? value : "").normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase().trim();
|
|
7947
|
+
}
|
|
7948
|
+
function getLabelText(value) {
|
|
7949
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
7950
|
+
return String(value);
|
|
7951
|
+
}
|
|
7952
|
+
return "";
|
|
7953
|
+
}
|
|
7954
|
+
function getOptionText(item) {
|
|
7955
|
+
if (!item) return "";
|
|
7956
|
+
return getLabelText(item.label) || item.value;
|
|
7957
|
+
}
|
|
7958
|
+
function getNextEnabledIndex2(items, currentIndex, direction) {
|
|
7959
|
+
var _a;
|
|
7960
|
+
if (!items.length) return -1;
|
|
7961
|
+
let nextIndex = currentIndex;
|
|
7962
|
+
for (let index = 0; index < items.length; index += 1) {
|
|
7963
|
+
nextIndex = (nextIndex + direction + items.length) % items.length;
|
|
7964
|
+
if (!((_a = items[nextIndex]) == null ? void 0 : _a.disabled)) {
|
|
7965
|
+
return nextIndex;
|
|
7966
|
+
}
|
|
7967
|
+
}
|
|
7968
|
+
return -1;
|
|
7969
|
+
}
|
|
7970
|
+
function SearchableSelectBase({
|
|
7971
|
+
items,
|
|
7972
|
+
value,
|
|
7973
|
+
defaultValue,
|
|
7974
|
+
onValueChange,
|
|
7975
|
+
placeholder = "Select an option",
|
|
7976
|
+
searchPlaceholder = "Search\u2026",
|
|
7977
|
+
emptyText = "No results found",
|
|
7978
|
+
disabled,
|
|
7979
|
+
name,
|
|
7980
|
+
required,
|
|
7981
|
+
invalid = false,
|
|
7982
|
+
size = "md",
|
|
7983
|
+
customSize,
|
|
7984
|
+
variant = "outline",
|
|
7985
|
+
classNameDefault = true,
|
|
7986
|
+
triggerClassName,
|
|
7987
|
+
contentClassName,
|
|
7988
|
+
itemClassName,
|
|
7989
|
+
searchInputClassName
|
|
7990
|
+
}) {
|
|
7991
|
+
const rootRef = React47.useRef(null);
|
|
7992
|
+
const inputRef = React47.useRef(null);
|
|
7993
|
+
const listboxId = React47.useId();
|
|
7994
|
+
const sizeClasses = getFormSizeClasses(size, customSize);
|
|
7995
|
+
const triggerSizeClass = getFormControlSizeClass(variant, sizeClasses);
|
|
7996
|
+
const isControlled = value !== void 0;
|
|
7997
|
+
const [internalValue, setInternalValue] = React47.useState(defaultValue != null ? defaultValue : "");
|
|
7998
|
+
const currentValue = isControlled ? value != null ? value : "" : internalValue;
|
|
7999
|
+
const selectedItem = React47.useMemo(() => {
|
|
8000
|
+
return items.find((item) => item.value === currentValue);
|
|
8001
|
+
}, [currentValue, items]);
|
|
8002
|
+
const selectedText = React47.useMemo(() => {
|
|
8003
|
+
return getOptionText(selectedItem);
|
|
8004
|
+
}, [selectedItem]);
|
|
8005
|
+
const [open, setOpen] = React47.useState(false);
|
|
8006
|
+
const [inputValue, setInputValue] = React47.useState(selectedText);
|
|
8007
|
+
const [activeIndex, setActiveIndex] = React47.useState(-1);
|
|
8008
|
+
React47.useEffect(() => {
|
|
8009
|
+
if (!open) {
|
|
8010
|
+
setInputValue(selectedText);
|
|
8011
|
+
}
|
|
8012
|
+
}, [open, selectedText]);
|
|
8013
|
+
const filteredItems = React47.useMemo(() => {
|
|
8014
|
+
const query = normalizeText(inputValue);
|
|
8015
|
+
if (!query) return items;
|
|
8016
|
+
return items.filter((item) => {
|
|
8017
|
+
var _a;
|
|
8018
|
+
const haystack = normalizeText(
|
|
8019
|
+
`${getLabelText(item.label)} ${item.value} ${(_a = item.keywords) != null ? _a : ""}`
|
|
8020
|
+
);
|
|
8021
|
+
return haystack.includes(query);
|
|
8022
|
+
});
|
|
8023
|
+
}, [inputValue, items]);
|
|
8024
|
+
React47.useEffect(() => {
|
|
8025
|
+
if (!open) return;
|
|
8026
|
+
const firstEnabledIndex = filteredItems.findIndex((item) => !item.disabled);
|
|
8027
|
+
setActiveIndex(firstEnabledIndex);
|
|
8028
|
+
}, [filteredItems, open]);
|
|
8029
|
+
React47.useEffect(() => {
|
|
8030
|
+
if (!open) return;
|
|
8031
|
+
const handlePointerDown = (event) => {
|
|
8032
|
+
var _a;
|
|
8033
|
+
const target = event.target;
|
|
8034
|
+
if (target && ((_a = rootRef.current) == null ? void 0 : _a.contains(target))) {
|
|
8035
|
+
return;
|
|
8036
|
+
}
|
|
8037
|
+
setOpen(false);
|
|
8038
|
+
};
|
|
8039
|
+
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
8040
|
+
return () => {
|
|
8041
|
+
document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
8042
|
+
};
|
|
8043
|
+
}, [open]);
|
|
8044
|
+
const selectItem = React47.useCallback(
|
|
8045
|
+
(item) => {
|
|
8046
|
+
if (item.disabled) return;
|
|
8047
|
+
if (!isControlled) {
|
|
8048
|
+
setInternalValue(item.value);
|
|
8049
|
+
}
|
|
8050
|
+
setInputValue(getOptionText(item));
|
|
8051
|
+
setOpen(false);
|
|
8052
|
+
onValueChange == null ? void 0 : onValueChange(item.value, item);
|
|
8053
|
+
requestAnimationFrame(() => {
|
|
8054
|
+
var _a;
|
|
8055
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
8056
|
+
});
|
|
8057
|
+
},
|
|
8058
|
+
[isControlled, onValueChange]
|
|
8059
|
+
);
|
|
8060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref: rootRef, className: "relative w-full", children: [
|
|
8061
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8062
|
+
"input",
|
|
8063
|
+
{
|
|
8064
|
+
type: "hidden",
|
|
8065
|
+
name,
|
|
8066
|
+
value: currentValue,
|
|
8067
|
+
required,
|
|
8068
|
+
disabled
|
|
8069
|
+
}
|
|
8070
|
+
) : null,
|
|
8071
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
8072
|
+
"div",
|
|
8073
|
+
{
|
|
8074
|
+
className: classNameDefault ? cn(
|
|
8075
|
+
formCompositeControlBase,
|
|
8076
|
+
formCompositeVariants[variant],
|
|
8077
|
+
triggerSizeClass,
|
|
8078
|
+
invalid && formCompositeControlErrorClass,
|
|
8079
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
8080
|
+
triggerClassName
|
|
8081
|
+
) : triggerClassName,
|
|
8082
|
+
onPointerDown: () => {
|
|
8083
|
+
if (disabled) return;
|
|
8084
|
+
setOpen(true);
|
|
8085
|
+
requestAnimationFrame(() => {
|
|
8086
|
+
var _a;
|
|
8087
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
8088
|
+
});
|
|
8089
|
+
},
|
|
8090
|
+
children: [
|
|
8091
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8092
|
+
"input",
|
|
8093
|
+
{
|
|
8094
|
+
ref: inputRef,
|
|
8095
|
+
value: inputValue,
|
|
8096
|
+
role: "combobox",
|
|
8097
|
+
"aria-autocomplete": "list",
|
|
8098
|
+
"aria-expanded": open,
|
|
8099
|
+
"aria-controls": listboxId,
|
|
8100
|
+
"aria-invalid": invalid || void 0,
|
|
8101
|
+
"aria-activedescendant": activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : void 0,
|
|
8102
|
+
placeholder: open ? searchPlaceholder : placeholder,
|
|
8103
|
+
autoComplete: "off",
|
|
8104
|
+
spellCheck: false,
|
|
8105
|
+
disabled,
|
|
8106
|
+
onFocus: () => {
|
|
8107
|
+
setOpen(true);
|
|
8108
|
+
requestAnimationFrame(() => {
|
|
8109
|
+
var _a;
|
|
8110
|
+
(_a = inputRef.current) == null ? void 0 : _a.select();
|
|
8111
|
+
});
|
|
8112
|
+
},
|
|
8113
|
+
onChange: (event) => {
|
|
8114
|
+
setInputValue(event.target.value);
|
|
8115
|
+
setOpen(true);
|
|
8116
|
+
},
|
|
8117
|
+
onKeyDown: (event) => {
|
|
8118
|
+
var _a;
|
|
8119
|
+
if (event.key === "ArrowDown") {
|
|
8120
|
+
event.preventDefault();
|
|
8121
|
+
setOpen(true);
|
|
8122
|
+
setActiveIndex(
|
|
8123
|
+
(currentIndex) => getNextEnabledIndex2(filteredItems, currentIndex, 1)
|
|
8124
|
+
);
|
|
8125
|
+
return;
|
|
8126
|
+
}
|
|
8127
|
+
if (event.key === "ArrowUp") {
|
|
8128
|
+
event.preventDefault();
|
|
8129
|
+
setOpen(true);
|
|
8130
|
+
setActiveIndex(
|
|
8131
|
+
(currentIndex) => getNextEnabledIndex2(filteredItems, currentIndex, -1)
|
|
8132
|
+
);
|
|
8133
|
+
return;
|
|
8134
|
+
}
|
|
8135
|
+
if (event.key === "Enter") {
|
|
8136
|
+
if (!open) return;
|
|
8137
|
+
event.preventDefault();
|
|
8138
|
+
const activeItem = filteredItems[activeIndex];
|
|
8139
|
+
if (activeItem) {
|
|
8140
|
+
selectItem(activeItem);
|
|
8141
|
+
}
|
|
8142
|
+
return;
|
|
8143
|
+
}
|
|
8144
|
+
if (event.key === "Escape") {
|
|
8145
|
+
event.preventDefault();
|
|
8146
|
+
setOpen(false);
|
|
8147
|
+
setInputValue(selectedText);
|
|
8148
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
8149
|
+
}
|
|
8150
|
+
},
|
|
8151
|
+
className: cn(
|
|
8152
|
+
"h-full min-w-0 flex-1 border-0 bg-transparent p-0 outline-none",
|
|
8153
|
+
"placeholder:text-muted-foreground disabled:cursor-not-allowed",
|
|
8154
|
+
searchInputClassName
|
|
8155
|
+
)
|
|
8156
|
+
}
|
|
8157
|
+
),
|
|
8158
|
+
inputValue && open ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8159
|
+
"button",
|
|
8160
|
+
{
|
|
8161
|
+
type: "button",
|
|
8162
|
+
"aria-label": "Limpiar b\xFAsqueda",
|
|
8163
|
+
tabIndex: -1,
|
|
8164
|
+
onPointerDown: (event) => {
|
|
8165
|
+
event.preventDefault();
|
|
8166
|
+
event.stopPropagation();
|
|
8167
|
+
},
|
|
8168
|
+
onClick: (event) => {
|
|
8169
|
+
event.preventDefault();
|
|
8170
|
+
event.stopPropagation();
|
|
8171
|
+
setInputValue("");
|
|
8172
|
+
requestAnimationFrame(() => {
|
|
8173
|
+
var _a;
|
|
8174
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
8175
|
+
});
|
|
8176
|
+
},
|
|
8177
|
+
className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted hover:text-foreground",
|
|
8178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_icons10.Cross2Icon, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
8179
|
+
}
|
|
8180
|
+
) : null,
|
|
8181
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8182
|
+
import_react_icons10.CaretSortIcon,
|
|
8183
|
+
{
|
|
8184
|
+
"aria-hidden": "true",
|
|
8185
|
+
className: cn(
|
|
8186
|
+
"h-4 w-4 shrink-0 opacity-50 transition-transform",
|
|
8187
|
+
open && "rotate-180"
|
|
8188
|
+
)
|
|
8189
|
+
}
|
|
8190
|
+
)
|
|
8191
|
+
]
|
|
8192
|
+
}
|
|
8193
|
+
),
|
|
8194
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8195
|
+
"div",
|
|
8196
|
+
{
|
|
8197
|
+
className: cn(
|
|
8198
|
+
"absolute left-0 top-full z-50 mt-1 w-full overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-xl transition",
|
|
8199
|
+
!open && "pointer-events-none invisible opacity-0",
|
|
8200
|
+
open && "visible opacity-100",
|
|
8201
|
+
contentClassName
|
|
8202
|
+
),
|
|
8203
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8204
|
+
"div",
|
|
8205
|
+
{
|
|
8206
|
+
id: listboxId,
|
|
8207
|
+
role: "listbox",
|
|
8208
|
+
className: "max-h-72 overflow-y-auto overscroll-contain p-1 [scrollbar-gutter:stable]",
|
|
8209
|
+
onWheelCapture: (event) => {
|
|
8210
|
+
event.stopPropagation();
|
|
8211
|
+
},
|
|
8212
|
+
onTouchMoveCapture: (event) => {
|
|
8213
|
+
event.stopPropagation();
|
|
8214
|
+
},
|
|
8215
|
+
children: filteredItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8216
|
+
"div",
|
|
8217
|
+
{
|
|
8218
|
+
className: cn(
|
|
8219
|
+
"px-3 py-6 text-center text-muted-foreground",
|
|
8220
|
+
sizeClasses.message
|
|
8221
|
+
),
|
|
8222
|
+
children: emptyText
|
|
8223
|
+
}
|
|
8224
|
+
) : filteredItems.map((item, index) => {
|
|
8225
|
+
const isSelected = item.value === currentValue;
|
|
8226
|
+
const isActive = index === activeIndex;
|
|
8227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
8228
|
+
"div",
|
|
8229
|
+
{
|
|
8230
|
+
id: `${listboxId}-option-${index}`,
|
|
8231
|
+
role: "option",
|
|
8232
|
+
"aria-selected": isSelected,
|
|
8233
|
+
"aria-disabled": item.disabled,
|
|
8234
|
+
tabIndex: -1,
|
|
8235
|
+
onMouseMove: () => {
|
|
8236
|
+
if (!item.disabled) {
|
|
8237
|
+
setActiveIndex(index);
|
|
8238
|
+
}
|
|
8239
|
+
},
|
|
8240
|
+
onPointerDown: (event) => {
|
|
8241
|
+
event.preventDefault();
|
|
8242
|
+
event.stopPropagation();
|
|
8243
|
+
if (!item.disabled) {
|
|
8244
|
+
selectItem(item);
|
|
8245
|
+
}
|
|
8246
|
+
},
|
|
8247
|
+
className: cn(
|
|
8248
|
+
"relative flex w-full select-none items-center gap-2 rounded-lg px-3 text-left outline-none transition",
|
|
8249
|
+
sizeClasses.selectItem,
|
|
8250
|
+
item.disabled ? "pointer-events-none opacity-50" : "cursor-pointer",
|
|
8251
|
+
isActive && !item.disabled && "bg-accent text-accent-foreground",
|
|
8252
|
+
!isActive && !item.disabled && "hover:bg-accent/70 hover:text-accent-foreground",
|
|
8253
|
+
isSelected && "font-medium",
|
|
8254
|
+
itemClassName
|
|
8255
|
+
),
|
|
8256
|
+
children: [
|
|
8257
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
8258
|
+
isSelected ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8259
|
+
import_react_icons10.CheckIcon,
|
|
8260
|
+
{
|
|
8261
|
+
"aria-hidden": "true",
|
|
8262
|
+
className: "h-4 w-4 shrink-0 text-primary"
|
|
8263
|
+
}
|
|
8264
|
+
) : null
|
|
8265
|
+
]
|
|
8266
|
+
},
|
|
8267
|
+
item.value
|
|
8268
|
+
);
|
|
8269
|
+
})
|
|
8270
|
+
}
|
|
8271
|
+
)
|
|
8272
|
+
}
|
|
8273
|
+
)
|
|
8274
|
+
] });
|
|
8275
|
+
}
|
|
8276
|
+
var SearchableSelect = React47.memo(
|
|
8277
|
+
SearchableSelectBase
|
|
8278
|
+
);
|
|
8279
|
+
|
|
8280
|
+
// src/components/Form/form-select.tsx
|
|
8281
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8282
|
+
var FormSelect = ({
|
|
8283
|
+
name,
|
|
8284
|
+
control,
|
|
8285
|
+
rules,
|
|
8286
|
+
shouldUnregister,
|
|
8287
|
+
defaultValue,
|
|
8288
|
+
placeholder = "Seleccionar opci\xF3n",
|
|
8289
|
+
label,
|
|
8290
|
+
requiredLabel,
|
|
8291
|
+
className,
|
|
8292
|
+
itemClassName,
|
|
8293
|
+
contentClassName,
|
|
8294
|
+
searchInputClassName,
|
|
8295
|
+
labelClassName,
|
|
8296
|
+
messageClassName,
|
|
8297
|
+
requiredLabelClassName,
|
|
8298
|
+
options,
|
|
8299
|
+
items,
|
|
8300
|
+
getOptionValue = getDefaultOptionValue,
|
|
8301
|
+
getOptionLabel = getDefaultOptionLabel,
|
|
8302
|
+
getOptionDisabled,
|
|
8303
|
+
getOptionData,
|
|
8304
|
+
children,
|
|
8305
|
+
onChange,
|
|
8306
|
+
onChangeItem,
|
|
8307
|
+
disabled,
|
|
8308
|
+
size = "md",
|
|
8309
|
+
customSize,
|
|
8310
|
+
variant = "outline",
|
|
8311
|
+
invalid,
|
|
8312
|
+
searchable = false,
|
|
8313
|
+
searchPlaceholder = "Buscar\u2026",
|
|
8314
|
+
emptyText = "No hay resultados",
|
|
8315
|
+
classNameDefault = true,
|
|
8316
|
+
position
|
|
8317
|
+
}) => {
|
|
8318
|
+
const form = (0, import_react_hook_form5.useFormContext)();
|
|
7378
8319
|
const controllerControl = control != null ? control : form == null ? void 0 : form.control;
|
|
7379
8320
|
const sizeClasses = getFormSizeClasses(size, customSize);
|
|
7380
|
-
const
|
|
7381
|
-
const triggerSizeClass = variant === "flushed" ? sizeClasses.flushedControl : variant === "link" ? sizeClasses.linkControl : sizeClasses.control;
|
|
8321
|
+
const triggerSizeClass = getFormControlSizeClass(variant, sizeClasses);
|
|
7382
8322
|
const contentBase = "z-50 rounded-xl border border-border bg-popover text-popover-foreground shadow-xl outline-none";
|
|
7383
8323
|
const contentViewport = "[&_[data-radix-select-viewport]]:max-h-72 [&_[data-radix-select-viewport]]:overflow-y-auto [&_[data-radix-select-viewport]]:overscroll-contain [&_[data-radix-select-viewport]]:[scrollbar-gutter:stable]";
|
|
7384
8324
|
const normalizedOptions = React48.useMemo(() => {
|
|
@@ -7400,7 +8340,7 @@ var FormSelect = ({
|
|
|
7400
8340
|
items,
|
|
7401
8341
|
options
|
|
7402
8342
|
]);
|
|
7403
|
-
return /* @__PURE__ */ (0,
|
|
8343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormFieldContext.Provider, { value: { name }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7404
8344
|
import_react_hook_form5.Controller,
|
|
7405
8345
|
{
|
|
7406
8346
|
control: controllerControl,
|
|
@@ -7409,7 +8349,7 @@ var FormSelect = ({
|
|
|
7409
8349
|
shouldUnregister,
|
|
7410
8350
|
defaultValue,
|
|
7411
8351
|
render: ({ field, fieldState }) => {
|
|
7412
|
-
var _a;
|
|
8352
|
+
var _a, _b;
|
|
7413
8353
|
const fieldError = getErrorMessage(fieldState.error);
|
|
7414
8354
|
const hasError = Boolean(invalid || fieldError);
|
|
7415
8355
|
const handleValueChange = (value) => {
|
|
@@ -7421,8 +8361,8 @@ var FormSelect = ({
|
|
|
7421
8361
|
onChange == null ? void 0 : onChange(value);
|
|
7422
8362
|
onChangeItem == null ? void 0 : onChangeItem((_a2 = nextOption == null ? void 0 : nextOption.data) != null ? _a2 : null);
|
|
7423
8363
|
};
|
|
7424
|
-
return /* @__PURE__ */ (0,
|
|
7425
|
-
label ? /* @__PURE__ */ (0,
|
|
8364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(FormItem, { children: [
|
|
8365
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7426
8366
|
FormLabel,
|
|
7427
8367
|
{
|
|
7428
8368
|
className: cn(
|
|
@@ -7431,8 +8371,8 @@ var FormSelect = ({
|
|
|
7431
8371
|
labelClassName
|
|
7432
8372
|
),
|
|
7433
8373
|
children: [
|
|
7434
|
-
/* @__PURE__ */ (0,
|
|
7435
|
-
requiredLabel ? /* @__PURE__ */ (0,
|
|
8374
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: label }),
|
|
8375
|
+
requiredLabel ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7436
8376
|
import_lucide_react5.Asterisk,
|
|
7437
8377
|
{
|
|
7438
8378
|
"aria-hidden": "true",
|
|
@@ -7445,20 +8385,37 @@ var FormSelect = ({
|
|
|
7445
8385
|
]
|
|
7446
8386
|
}
|
|
7447
8387
|
) : null,
|
|
7448
|
-
searchable ? /* @__PURE__ */ (0,
|
|
7449
|
-
|
|
8388
|
+
searchable ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8389
|
+
SearchableSelect,
|
|
7450
8390
|
{
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
8391
|
+
items: normalizedOptions,
|
|
8392
|
+
value: (_a = field.value) != null ? _a : "",
|
|
8393
|
+
name: field.name,
|
|
8394
|
+
placeholder,
|
|
8395
|
+
searchPlaceholder,
|
|
8396
|
+
emptyText,
|
|
8397
|
+
disabled,
|
|
8398
|
+
invalid: hasError,
|
|
8399
|
+
size,
|
|
8400
|
+
customSize,
|
|
8401
|
+
variant,
|
|
8402
|
+
classNameDefault,
|
|
8403
|
+
triggerClassName: className,
|
|
8404
|
+
contentClassName,
|
|
8405
|
+
itemClassName,
|
|
8406
|
+
searchInputClassName,
|
|
8407
|
+
onValueChange: (value, option) => {
|
|
8408
|
+
var _a2;
|
|
8409
|
+
field.onChange(value);
|
|
8410
|
+
onChange == null ? void 0 : onChange(value);
|
|
8411
|
+
onChangeItem == null ? void 0 : onChangeItem((_a2 = option == null ? void 0 : option.data) != null ? _a2 : null);
|
|
8412
|
+
field.onBlur();
|
|
8413
|
+
}
|
|
7457
8414
|
}
|
|
7458
|
-
) : /* @__PURE__ */ (0,
|
|
8415
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7459
8416
|
Select2,
|
|
7460
8417
|
{
|
|
7461
|
-
value: (
|
|
8418
|
+
value: (_b = field.value) != null ? _b : "",
|
|
7462
8419
|
onValueChange: handleValueChange,
|
|
7463
8420
|
onOpenChange: (nextOpen) => {
|
|
7464
8421
|
if (!nextOpen) {
|
|
@@ -7467,20 +8424,20 @@ var FormSelect = ({
|
|
|
7467
8424
|
},
|
|
7468
8425
|
disabled,
|
|
7469
8426
|
children: [
|
|
7470
|
-
/* @__PURE__ */ (0,
|
|
8427
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7471
8428
|
SelectTrigger,
|
|
7472
8429
|
{
|
|
7473
|
-
className: cn(
|
|
7474
|
-
|
|
7475
|
-
|
|
8430
|
+
className: classNameDefault ? cn(
|
|
8431
|
+
formControlBase,
|
|
8432
|
+
formInputVariants[variant],
|
|
7476
8433
|
triggerSizeClass,
|
|
7477
|
-
hasError &&
|
|
8434
|
+
hasError && formControlErrorClass,
|
|
7478
8435
|
className
|
|
7479
|
-
),
|
|
7480
|
-
children: /* @__PURE__ */ (0,
|
|
8436
|
+
) : className,
|
|
8437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectValue, { placeholder })
|
|
7481
8438
|
}
|
|
7482
8439
|
) }),
|
|
7483
|
-
/* @__PURE__ */ (0,
|
|
8440
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7484
8441
|
SelectContent,
|
|
7485
8442
|
{
|
|
7486
8443
|
position,
|
|
@@ -7497,7 +8454,7 @@ var FormSelect = ({
|
|
|
7497
8454
|
onTouchMoveCapture: (event) => {
|
|
7498
8455
|
event.stopPropagation();
|
|
7499
8456
|
},
|
|
7500
|
-
children: children ? children : normalizedOptions.length > 0 ? normalizedOptions.map((option) => /* @__PURE__ */ (0,
|
|
8457
|
+
children: children ? children : normalizedOptions.length > 0 ? normalizedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7501
8458
|
SelectItem,
|
|
7502
8459
|
{
|
|
7503
8460
|
value: option.value,
|
|
@@ -7506,7 +8463,7 @@ var FormSelect = ({
|
|
|
7506
8463
|
children: option.label
|
|
7507
8464
|
},
|
|
7508
8465
|
option.value
|
|
7509
|
-
)) : /* @__PURE__ */ (0,
|
|
8466
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7510
8467
|
"div",
|
|
7511
8468
|
{
|
|
7512
8469
|
className: cn(
|
|
@@ -7521,7 +8478,7 @@ var FormSelect = ({
|
|
|
7521
8478
|
]
|
|
7522
8479
|
}
|
|
7523
8480
|
),
|
|
7524
|
-
fieldError ? /* @__PURE__ */ (0,
|
|
8481
|
+
fieldError ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7525
8482
|
FormMessage,
|
|
7526
8483
|
{
|
|
7527
8484
|
className: cn(sizeClasses.message, messageClassName),
|
|
@@ -7538,12 +8495,12 @@ FormSelect.displayName = "FormSelect";
|
|
|
7538
8495
|
// src/components/hover-card.tsx
|
|
7539
8496
|
var HoverCardPrimitive = __toESM(require("@radix-ui/react-hover-card"), 1);
|
|
7540
8497
|
var React49 = __toESM(require("react"), 1);
|
|
7541
|
-
var
|
|
8498
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
7542
8499
|
var HoverCard = HoverCardPrimitive.Root;
|
|
7543
8500
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
7544
8501
|
var HoverCardContent = React49.forwardRef((_a, ref) => {
|
|
7545
8502
|
var _b = _a, { className, align = "center", sideOffset = 4 } = _b, props = __objRest(_b, ["className", "align", "sideOffset"]);
|
|
7546
|
-
return /* @__PURE__ */ (0,
|
|
8503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
7547
8504
|
HoverCardPrimitive.Content,
|
|
7548
8505
|
__spreadValues({
|
|
7549
8506
|
ref,
|
|
@@ -7592,13 +8549,13 @@ var IconsApp = {
|
|
|
7592
8549
|
var Icons = IconsApp;
|
|
7593
8550
|
|
|
7594
8551
|
// src/components/input-otp.tsx
|
|
7595
|
-
var
|
|
8552
|
+
var import_react_icons11 = require("@radix-ui/react-icons");
|
|
7596
8553
|
var import_input_otp = require("input-otp");
|
|
7597
8554
|
var React50 = __toESM(require("react"), 1);
|
|
7598
|
-
var
|
|
8555
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
7599
8556
|
var InputOTP = React50.forwardRef((_a, ref) => {
|
|
7600
8557
|
var _b = _a, { className, containerClassName } = _b, props = __objRest(_b, ["className", "containerClassName"]);
|
|
7601
|
-
return /* @__PURE__ */ (0,
|
|
8558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7602
8559
|
import_input_otp.OTPInput,
|
|
7603
8560
|
__spreadValues({
|
|
7604
8561
|
ref,
|
|
@@ -7613,14 +8570,14 @@ var InputOTP = React50.forwardRef((_a, ref) => {
|
|
|
7613
8570
|
InputOTP.displayName = "InputOTP";
|
|
7614
8571
|
var InputOTPGroup = React50.forwardRef((_a, ref) => {
|
|
7615
8572
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7616
|
-
return /* @__PURE__ */ (0,
|
|
8573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", __spreadValues({ ref, className: cn("flex items-center", className) }, props));
|
|
7617
8574
|
});
|
|
7618
8575
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
7619
8576
|
var InputOTPSlot = React50.forwardRef((_a, ref) => {
|
|
7620
8577
|
var _b = _a, { index, className } = _b, props = __objRest(_b, ["index", "className"]);
|
|
7621
8578
|
const inputOTPContext = React50.useContext(import_input_otp.OTPInputContext);
|
|
7622
8579
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
7623
|
-
return /* @__PURE__ */ (0,
|
|
8580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7624
8581
|
"div",
|
|
7625
8582
|
__spreadProps(__spreadValues({
|
|
7626
8583
|
ref,
|
|
@@ -7633,7 +8590,7 @@ var InputOTPSlot = React50.forwardRef((_a, ref) => {
|
|
|
7633
8590
|
}, props), {
|
|
7634
8591
|
children: [
|
|
7635
8592
|
char,
|
|
7636
|
-
hasFakeCaret && /* @__PURE__ */ (0,
|
|
8593
|
+
hasFakeCaret && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "animate-caret-blink h-4 w-px bg-foreground duration-1000" }) })
|
|
7637
8594
|
]
|
|
7638
8595
|
})
|
|
7639
8596
|
);
|
|
@@ -7641,15 +8598,15 @@ var InputOTPSlot = React50.forwardRef((_a, ref) => {
|
|
|
7641
8598
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
7642
8599
|
var InputOTPSeparator = React50.forwardRef((_a, ref) => {
|
|
7643
8600
|
var props = __objRest(_a, []);
|
|
7644
|
-
return /* @__PURE__ */ (0,
|
|
8601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", __spreadProps(__spreadValues({ ref, role: "separator" }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_icons11.DashIcon, {}) }));
|
|
7645
8602
|
});
|
|
7646
8603
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
7647
8604
|
|
|
7648
8605
|
// src/components/menubar.tsx
|
|
7649
|
-
var
|
|
8606
|
+
var import_react_icons12 = require("@radix-ui/react-icons");
|
|
7650
8607
|
var MenubarPrimitive = __toESM(require("@radix-ui/react-menubar"), 1);
|
|
7651
8608
|
var React51 = __toESM(require("react"), 1);
|
|
7652
|
-
var
|
|
8609
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
7653
8610
|
var MenubarMenu = MenubarPrimitive.Menu;
|
|
7654
8611
|
var MenubarGroup = MenubarPrimitive.Group;
|
|
7655
8612
|
var MenubarPortal = MenubarPrimitive.Portal;
|
|
@@ -7657,7 +8614,7 @@ var MenubarSub = MenubarPrimitive.Sub;
|
|
|
7657
8614
|
var MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
7658
8615
|
var Menubar = React51.forwardRef((_a, ref) => {
|
|
7659
8616
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7660
|
-
return /* @__PURE__ */ (0,
|
|
8617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7661
8618
|
MenubarPrimitive.Root,
|
|
7662
8619
|
__spreadValues({
|
|
7663
8620
|
ref,
|
|
@@ -7671,7 +8628,7 @@ var Menubar = React51.forwardRef((_a, ref) => {
|
|
|
7671
8628
|
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
7672
8629
|
var MenubarTrigger = React51.forwardRef((_a, ref) => {
|
|
7673
8630
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7674
|
-
return /* @__PURE__ */ (0,
|
|
8631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7675
8632
|
MenubarPrimitive.Trigger,
|
|
7676
8633
|
__spreadValues({
|
|
7677
8634
|
ref,
|
|
@@ -7685,7 +8642,7 @@ var MenubarTrigger = React51.forwardRef((_a, ref) => {
|
|
|
7685
8642
|
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
7686
8643
|
var MenubarSubTrigger = React51.forwardRef((_a, ref) => {
|
|
7687
8644
|
var _b = _a, { className, inset, children } = _b, props = __objRest(_b, ["className", "inset", "children"]);
|
|
7688
|
-
return /* @__PURE__ */ (0,
|
|
8645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
7689
8646
|
MenubarPrimitive.SubTrigger,
|
|
7690
8647
|
__spreadProps(__spreadValues({
|
|
7691
8648
|
ref,
|
|
@@ -7697,7 +8654,7 @@ var MenubarSubTrigger = React51.forwardRef((_a, ref) => {
|
|
|
7697
8654
|
}, props), {
|
|
7698
8655
|
children: [
|
|
7699
8656
|
children,
|
|
7700
|
-
/* @__PURE__ */ (0,
|
|
8657
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_icons12.ChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
7701
8658
|
]
|
|
7702
8659
|
})
|
|
7703
8660
|
);
|
|
@@ -7705,7 +8662,7 @@ var MenubarSubTrigger = React51.forwardRef((_a, ref) => {
|
|
|
7705
8662
|
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
7706
8663
|
var MenubarSubContent = React51.forwardRef((_a, ref) => {
|
|
7707
8664
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7708
|
-
return /* @__PURE__ */ (0,
|
|
8665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7709
8666
|
MenubarPrimitive.SubContent,
|
|
7710
8667
|
__spreadValues({
|
|
7711
8668
|
ref,
|
|
@@ -7720,7 +8677,7 @@ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
|
7720
8677
|
var MenubarContent = React51.forwardRef(
|
|
7721
8678
|
(_a, ref) => {
|
|
7722
8679
|
var _b = _a, { className, align = "start", alignOffset = -4, sideOffset = 8 } = _b, props = __objRest(_b, ["className", "align", "alignOffset", "sideOffset"]);
|
|
7723
|
-
return /* @__PURE__ */ (0,
|
|
8680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MenubarPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7724
8681
|
MenubarPrimitive.Content,
|
|
7725
8682
|
__spreadValues({
|
|
7726
8683
|
ref,
|
|
@@ -7738,7 +8695,7 @@ var MenubarContent = React51.forwardRef(
|
|
|
7738
8695
|
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
7739
8696
|
var MenubarItem = React51.forwardRef((_a, ref) => {
|
|
7740
8697
|
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
|
7741
|
-
return /* @__PURE__ */ (0,
|
|
8698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7742
8699
|
MenubarPrimitive.Item,
|
|
7743
8700
|
__spreadValues({
|
|
7744
8701
|
ref,
|
|
@@ -7753,7 +8710,7 @@ var MenubarItem = React51.forwardRef((_a, ref) => {
|
|
|
7753
8710
|
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
7754
8711
|
var MenubarCheckboxItem = React51.forwardRef((_a, ref) => {
|
|
7755
8712
|
var _b = _a, { className, children, checked } = _b, props = __objRest(_b, ["className", "children", "checked"]);
|
|
7756
|
-
return /* @__PURE__ */ (0,
|
|
8713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
7757
8714
|
MenubarPrimitive.CheckboxItem,
|
|
7758
8715
|
__spreadProps(__spreadValues({
|
|
7759
8716
|
ref,
|
|
@@ -7764,7 +8721,7 @@ var MenubarCheckboxItem = React51.forwardRef((_a, ref) => {
|
|
|
7764
8721
|
checked
|
|
7765
8722
|
}, props), {
|
|
7766
8723
|
children: [
|
|
7767
|
-
/* @__PURE__ */ (0,
|
|
8724
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_icons12.CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
7768
8725
|
children
|
|
7769
8726
|
]
|
|
7770
8727
|
})
|
|
@@ -7773,7 +8730,7 @@ var MenubarCheckboxItem = React51.forwardRef((_a, ref) => {
|
|
|
7773
8730
|
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
7774
8731
|
var MenubarRadioItem = React51.forwardRef((_a, ref) => {
|
|
7775
8732
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
7776
|
-
return /* @__PURE__ */ (0,
|
|
8733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
7777
8734
|
MenubarPrimitive.RadioItem,
|
|
7778
8735
|
__spreadProps(__spreadValues({
|
|
7779
8736
|
ref,
|
|
@@ -7783,7 +8740,7 @@ var MenubarRadioItem = React51.forwardRef((_a, ref) => {
|
|
|
7783
8740
|
)
|
|
7784
8741
|
}, props), {
|
|
7785
8742
|
children: [
|
|
7786
|
-
/* @__PURE__ */ (0,
|
|
8743
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_icons12.DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
7787
8744
|
children
|
|
7788
8745
|
]
|
|
7789
8746
|
})
|
|
@@ -7792,7 +8749,7 @@ var MenubarRadioItem = React51.forwardRef((_a, ref) => {
|
|
|
7792
8749
|
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
7793
8750
|
var MenubarLabel = React51.forwardRef((_a, ref) => {
|
|
7794
8751
|
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
|
7795
|
-
return /* @__PURE__ */ (0,
|
|
8752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7796
8753
|
MenubarPrimitive.Label,
|
|
7797
8754
|
__spreadValues({
|
|
7798
8755
|
ref,
|
|
@@ -7807,7 +8764,7 @@ var MenubarLabel = React51.forwardRef((_a, ref) => {
|
|
|
7807
8764
|
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
7808
8765
|
var MenubarSeparator = React51.forwardRef((_a, ref) => {
|
|
7809
8766
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7810
|
-
return /* @__PURE__ */ (0,
|
|
8767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7811
8768
|
MenubarPrimitive.Separator,
|
|
7812
8769
|
__spreadValues({
|
|
7813
8770
|
ref,
|
|
@@ -7822,7 +8779,7 @@ var MenubarShortcut = (_a) => {
|
|
|
7822
8779
|
} = _b, props = __objRest(_b, [
|
|
7823
8780
|
"className"
|
|
7824
8781
|
]);
|
|
7825
|
-
return /* @__PURE__ */ (0,
|
|
8782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
7826
8783
|
"span",
|
|
7827
8784
|
__spreadValues({
|
|
7828
8785
|
className: cn(
|
|
@@ -7835,7 +8792,7 @@ var MenubarShortcut = (_a) => {
|
|
|
7835
8792
|
MenubarShortcut.displayname = "MenubarShortcut";
|
|
7836
8793
|
|
|
7837
8794
|
// src/components/modal.tsx
|
|
7838
|
-
var
|
|
8795
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
7839
8796
|
var Modal = ({
|
|
7840
8797
|
title,
|
|
7841
8798
|
description,
|
|
@@ -7849,24 +8806,24 @@ var Modal = ({
|
|
|
7849
8806
|
onClose();
|
|
7850
8807
|
}
|
|
7851
8808
|
};
|
|
7852
|
-
return /* @__PURE__ */ (0,
|
|
7853
|
-
/* @__PURE__ */ (0,
|
|
7854
|
-
/* @__PURE__ */ (0,
|
|
7855
|
-
/* @__PURE__ */ (0,
|
|
8809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog, { open: isOpen, onOpenChange: onChange, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DialogContent, { className, children: [
|
|
8810
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DialogHeader, { children: [
|
|
8811
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogTitle, { children: title }),
|
|
8812
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogDescription, { children: description })
|
|
7856
8813
|
] }),
|
|
7857
|
-
/* @__PURE__ */ (0,
|
|
8814
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children })
|
|
7858
8815
|
] }) });
|
|
7859
8816
|
};
|
|
7860
8817
|
|
|
7861
8818
|
// src/components/navigation-menu.tsx
|
|
7862
|
-
var
|
|
8819
|
+
var import_react_icons13 = require("@radix-ui/react-icons");
|
|
7863
8820
|
var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"), 1);
|
|
7864
8821
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
7865
8822
|
var React52 = __toESM(require("react"), 1);
|
|
7866
|
-
var
|
|
8823
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
7867
8824
|
var NavigationMenu = React52.forwardRef((_a, ref) => {
|
|
7868
8825
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
7869
|
-
return /* @__PURE__ */ (0,
|
|
8826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
7870
8827
|
NavigationMenuPrimitive.Root,
|
|
7871
8828
|
__spreadProps(__spreadValues({
|
|
7872
8829
|
ref,
|
|
@@ -7877,7 +8834,7 @@ var NavigationMenu = React52.forwardRef((_a, ref) => {
|
|
|
7877
8834
|
}, props), {
|
|
7878
8835
|
children: [
|
|
7879
8836
|
children,
|
|
7880
|
-
/* @__PURE__ */ (0,
|
|
8837
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(NavigationMenuViewport, {})
|
|
7881
8838
|
]
|
|
7882
8839
|
})
|
|
7883
8840
|
);
|
|
@@ -7885,7 +8842,7 @@ var NavigationMenu = React52.forwardRef((_a, ref) => {
|
|
|
7885
8842
|
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
7886
8843
|
var NavigationMenuList = React52.forwardRef((_a, ref) => {
|
|
7887
8844
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7888
|
-
return /* @__PURE__ */ (0,
|
|
8845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
7889
8846
|
NavigationMenuPrimitive.List,
|
|
7890
8847
|
__spreadValues({
|
|
7891
8848
|
ref,
|
|
@@ -7903,7 +8860,7 @@ var navigationMenuTriggerStyle = (0, import_class_variance_authority6.cva)(
|
|
|
7903
8860
|
);
|
|
7904
8861
|
var NavigationMenuTrigger = React52.forwardRef((_a, ref) => {
|
|
7905
8862
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
7906
|
-
return /* @__PURE__ */ (0,
|
|
8863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
7907
8864
|
NavigationMenuPrimitive.Trigger,
|
|
7908
8865
|
__spreadProps(__spreadValues({
|
|
7909
8866
|
ref,
|
|
@@ -7912,8 +8869,8 @@ var NavigationMenuTrigger = React52.forwardRef((_a, ref) => {
|
|
|
7912
8869
|
children: [
|
|
7913
8870
|
children,
|
|
7914
8871
|
" ",
|
|
7915
|
-
/* @__PURE__ */ (0,
|
|
7916
|
-
|
|
8872
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8873
|
+
import_react_icons13.ChevronDownIcon,
|
|
7917
8874
|
{
|
|
7918
8875
|
className: "relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
7919
8876
|
"aria-hidden": "true"
|
|
@@ -7926,7 +8883,7 @@ var NavigationMenuTrigger = React52.forwardRef((_a, ref) => {
|
|
|
7926
8883
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
7927
8884
|
var NavigationMenuContent = React52.forwardRef((_a, ref) => {
|
|
7928
8885
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7929
|
-
return /* @__PURE__ */ (0,
|
|
8886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
7930
8887
|
NavigationMenuPrimitive.Content,
|
|
7931
8888
|
__spreadValues({
|
|
7932
8889
|
ref,
|
|
@@ -7941,7 +8898,7 @@ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
|
7941
8898
|
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
7942
8899
|
var NavigationMenuViewport = React52.forwardRef((_a, ref) => {
|
|
7943
8900
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7944
|
-
return /* @__PURE__ */ (0,
|
|
8901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
7945
8902
|
NavigationMenuPrimitive.Viewport,
|
|
7946
8903
|
__spreadValues({
|
|
7947
8904
|
className: cn(
|
|
@@ -7955,7 +8912,7 @@ var NavigationMenuViewport = React52.forwardRef((_a, ref) => {
|
|
|
7955
8912
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
7956
8913
|
var NavigationMenuIndicator = React52.forwardRef((_a, ref) => {
|
|
7957
8914
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7958
|
-
return /* @__PURE__ */ (0,
|
|
8915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
7959
8916
|
NavigationMenuPrimitive.Indicator,
|
|
7960
8917
|
__spreadProps(__spreadValues({
|
|
7961
8918
|
ref,
|
|
@@ -7964,20 +8921,20 @@ var NavigationMenuIndicator = React52.forwardRef((_a, ref) => {
|
|
|
7964
8921
|
className
|
|
7965
8922
|
)
|
|
7966
8923
|
}, props), {
|
|
7967
|
-
children: /* @__PURE__ */ (0,
|
|
8924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
|
|
7968
8925
|
})
|
|
7969
8926
|
);
|
|
7970
8927
|
});
|
|
7971
8928
|
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
7972
8929
|
|
|
7973
8930
|
// src/components/pagination.tsx
|
|
7974
|
-
var
|
|
8931
|
+
var import_react_icons14 = require("@radix-ui/react-icons");
|
|
7975
8932
|
var React53 = __toESM(require("react"), 1);
|
|
7976
8933
|
var import_lucide_react7 = require("lucide-react");
|
|
7977
|
-
var
|
|
8934
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
7978
8935
|
var Pagination = (_a) => {
|
|
7979
8936
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7980
|
-
return /* @__PURE__ */ (0,
|
|
8937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
7981
8938
|
"nav",
|
|
7982
8939
|
__spreadValues({
|
|
7983
8940
|
role: "navigation",
|
|
@@ -7989,7 +8946,7 @@ var Pagination = (_a) => {
|
|
|
7989
8946
|
Pagination.displayName = "Pagination";
|
|
7990
8947
|
var PaginationContent = React53.forwardRef((_a, ref) => {
|
|
7991
8948
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7992
|
-
return /* @__PURE__ */ (0,
|
|
8949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
7993
8950
|
"ul",
|
|
7994
8951
|
__spreadValues({
|
|
7995
8952
|
ref,
|
|
@@ -8000,7 +8957,7 @@ var PaginationContent = React53.forwardRef((_a, ref) => {
|
|
|
8000
8957
|
PaginationContent.displayName = "PaginationContent";
|
|
8001
8958
|
var PaginationItem = React53.forwardRef((_a, ref) => {
|
|
8002
8959
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8003
|
-
return /* @__PURE__ */ (0,
|
|
8960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("li", __spreadValues({ ref, className: cn("", className) }, props));
|
|
8004
8961
|
});
|
|
8005
8962
|
PaginationItem.displayName = "PaginationItem";
|
|
8006
8963
|
var PaginationLink = (_a) => {
|
|
@@ -8013,7 +8970,7 @@ var PaginationLink = (_a) => {
|
|
|
8013
8970
|
"isActive",
|
|
8014
8971
|
"size"
|
|
8015
8972
|
]);
|
|
8016
|
-
return /* @__PURE__ */ (0,
|
|
8973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
8017
8974
|
"a",
|
|
8018
8975
|
__spreadValues({
|
|
8019
8976
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -8034,7 +8991,7 @@ var PaginationPreviousLast = (_a) => {
|
|
|
8034
8991
|
} = _b, props = __objRest(_b, [
|
|
8035
8992
|
"className"
|
|
8036
8993
|
]);
|
|
8037
|
-
return /* @__PURE__ */ (0,
|
|
8994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
8038
8995
|
PaginationLink,
|
|
8039
8996
|
__spreadProps(__spreadValues({
|
|
8040
8997
|
"aria-label": "Go to previous page",
|
|
@@ -8042,8 +8999,8 @@ var PaginationPreviousLast = (_a) => {
|
|
|
8042
8999
|
className: cn("gap-1 pl-2.5", className)
|
|
8043
9000
|
}, props), {
|
|
8044
9001
|
children: [
|
|
8045
|
-
/* @__PURE__ */ (0,
|
|
8046
|
-
/* @__PURE__ */ (0,
|
|
9002
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react7.ChevronLeft, { className: "h-4 w-4" }),
|
|
9003
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "sr-only", children: "Previous Last" })
|
|
8047
9004
|
]
|
|
8048
9005
|
})
|
|
8049
9006
|
);
|
|
@@ -8055,7 +9012,7 @@ var PaginationPrevious = (_a) => {
|
|
|
8055
9012
|
} = _b, props = __objRest(_b, [
|
|
8056
9013
|
"className"
|
|
8057
9014
|
]);
|
|
8058
|
-
return /* @__PURE__ */ (0,
|
|
9015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
8059
9016
|
PaginationLink,
|
|
8060
9017
|
__spreadProps(__spreadValues({
|
|
8061
9018
|
"aria-label": "Go to previous page",
|
|
@@ -8063,8 +9020,8 @@ var PaginationPrevious = (_a) => {
|
|
|
8063
9020
|
className: cn("gap-1 pl-2.5", className)
|
|
8064
9021
|
}, props), {
|
|
8065
9022
|
children: [
|
|
8066
|
-
/* @__PURE__ */ (0,
|
|
8067
|
-
/* @__PURE__ */ (0,
|
|
9023
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_icons14.ChevronLeftIcon, { className: "h-4 w-4" }),
|
|
9024
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "Previous" })
|
|
8068
9025
|
]
|
|
8069
9026
|
})
|
|
8070
9027
|
);
|
|
@@ -8076,7 +9033,7 @@ var PaginationNext = (_a) => {
|
|
|
8076
9033
|
} = _b, props = __objRest(_b, [
|
|
8077
9034
|
"className"
|
|
8078
9035
|
]);
|
|
8079
|
-
return /* @__PURE__ */ (0,
|
|
9036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
8080
9037
|
PaginationLink,
|
|
8081
9038
|
__spreadProps(__spreadValues({
|
|
8082
9039
|
"aria-label": "Go to next page",
|
|
@@ -8084,8 +9041,8 @@ var PaginationNext = (_a) => {
|
|
|
8084
9041
|
className: cn("gap-1 pr-2.5", className)
|
|
8085
9042
|
}, props), {
|
|
8086
9043
|
children: [
|
|
8087
|
-
/* @__PURE__ */ (0,
|
|
8088
|
-
/* @__PURE__ */ (0,
|
|
9044
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "Next" }),
|
|
9045
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_icons14.ChevronRightIcon, { className: "h-4 w-4" })
|
|
8089
9046
|
]
|
|
8090
9047
|
})
|
|
8091
9048
|
);
|
|
@@ -8097,7 +9054,7 @@ var PaginationNextLast = (_a) => {
|
|
|
8097
9054
|
} = _b, props = __objRest(_b, [
|
|
8098
9055
|
"className"
|
|
8099
9056
|
]);
|
|
8100
|
-
return /* @__PURE__ */ (0,
|
|
9057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
8101
9058
|
PaginationLink,
|
|
8102
9059
|
__spreadProps(__spreadValues({
|
|
8103
9060
|
"aria-label": "Go to next page",
|
|
@@ -8105,8 +9062,8 @@ var PaginationNextLast = (_a) => {
|
|
|
8105
9062
|
className: cn("gap-1 pr-2.5", className)
|
|
8106
9063
|
}, props), {
|
|
8107
9064
|
children: [
|
|
8108
|
-
/* @__PURE__ */ (0,
|
|
8109
|
-
/* @__PURE__ */ (0,
|
|
9065
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "sr-only", children: "Next Last" }),
|
|
9066
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react7.ChevronRight, { className: "h-4 w-4" })
|
|
8110
9067
|
]
|
|
8111
9068
|
})
|
|
8112
9069
|
);
|
|
@@ -8118,15 +9075,15 @@ var PaginationEllipsis = (_a) => {
|
|
|
8118
9075
|
} = _b, props = __objRest(_b, [
|
|
8119
9076
|
"className"
|
|
8120
9077
|
]);
|
|
8121
|
-
return /* @__PURE__ */ (0,
|
|
9078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
8122
9079
|
"span",
|
|
8123
9080
|
__spreadProps(__spreadValues({
|
|
8124
9081
|
"aria-hidden": true,
|
|
8125
9082
|
className: cn("flex h-9 w-9 items-center justify-center", className)
|
|
8126
9083
|
}, props), {
|
|
8127
9084
|
children: [
|
|
8128
|
-
/* @__PURE__ */ (0,
|
|
8129
|
-
/* @__PURE__ */ (0,
|
|
9085
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_icons14.DotsHorizontalIcon, { className: "h-4 w-4" }),
|
|
9086
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
8130
9087
|
]
|
|
8131
9088
|
})
|
|
8132
9089
|
);
|
|
@@ -8136,13 +9093,13 @@ PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
|
8136
9093
|
// src/components/popover.tsx
|
|
8137
9094
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
8138
9095
|
var React54 = __toESM(require("react"), 1);
|
|
8139
|
-
var
|
|
9096
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
8140
9097
|
var Popover = PopoverPrimitive.Root;
|
|
8141
9098
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
8142
9099
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
8143
9100
|
var PopoverContent = React54.forwardRef((_a, ref) => {
|
|
8144
9101
|
var _b = _a, { className, align = "center", sideOffset = 4 } = _b, props = __objRest(_b, ["className", "align", "sideOffset"]);
|
|
8145
|
-
return /* @__PURE__ */ (0,
|
|
9102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
8146
9103
|
PopoverPrimitive.Content,
|
|
8147
9104
|
__spreadValues({
|
|
8148
9105
|
ref,
|
|
@@ -8160,10 +9117,10 @@ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
|
8160
9117
|
// src/components/progress.tsx
|
|
8161
9118
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
8162
9119
|
var React55 = __toESM(require("react"), 1);
|
|
8163
|
-
var
|
|
9120
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
8164
9121
|
var Progress = React55.forwardRef((_a, ref) => {
|
|
8165
9122
|
var _b = _a, { className, value } = _b, props = __objRest(_b, ["className", "value"]);
|
|
8166
|
-
return /* @__PURE__ */ (0,
|
|
9123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8167
9124
|
ProgressPrimitive.Root,
|
|
8168
9125
|
__spreadProps(__spreadValues({
|
|
8169
9126
|
ref,
|
|
@@ -8172,7 +9129,7 @@ var Progress = React55.forwardRef((_a, ref) => {
|
|
|
8172
9129
|
className
|
|
8173
9130
|
)
|
|
8174
9131
|
}, props), {
|
|
8175
|
-
children: /* @__PURE__ */ (0,
|
|
9132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8176
9133
|
ProgressPrimitive.Indicator,
|
|
8177
9134
|
{
|
|
8178
9135
|
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
@@ -8185,13 +9142,13 @@ var Progress = React55.forwardRef((_a, ref) => {
|
|
|
8185
9142
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
8186
9143
|
|
|
8187
9144
|
// src/components/radio-group.tsx
|
|
8188
|
-
var
|
|
9145
|
+
var import_react_icons15 = require("@radix-ui/react-icons");
|
|
8189
9146
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"), 1);
|
|
8190
9147
|
var React56 = __toESM(require("react"), 1);
|
|
8191
|
-
var
|
|
9148
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
8192
9149
|
var RadioGroup4 = React56.forwardRef((_a, ref) => {
|
|
8193
9150
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8194
|
-
return /* @__PURE__ */ (0,
|
|
9151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8195
9152
|
RadioGroupPrimitive.Root,
|
|
8196
9153
|
__spreadProps(__spreadValues({
|
|
8197
9154
|
className: cn("grid gap-2", className)
|
|
@@ -8203,7 +9160,7 @@ var RadioGroup4 = React56.forwardRef((_a, ref) => {
|
|
|
8203
9160
|
RadioGroup4.displayName = RadioGroupPrimitive.Root.displayName;
|
|
8204
9161
|
var RadioGroupItem = React56.forwardRef((_a, ref) => {
|
|
8205
9162
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8206
|
-
return /* @__PURE__ */ (0,
|
|
9163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8207
9164
|
RadioGroupPrimitive.Item,
|
|
8208
9165
|
__spreadProps(__spreadValues({
|
|
8209
9166
|
ref,
|
|
@@ -8212,23 +9169,23 @@ var RadioGroupItem = React56.forwardRef((_a, ref) => {
|
|
|
8212
9169
|
className
|
|
8213
9170
|
)
|
|
8214
9171
|
}, props), {
|
|
8215
|
-
children: /* @__PURE__ */ (0,
|
|
9172
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_icons15.CheckIcon, { className: "h-3.5 w-3.5 fill-primary" }) })
|
|
8216
9173
|
})
|
|
8217
9174
|
);
|
|
8218
9175
|
});
|
|
8219
9176
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
8220
9177
|
|
|
8221
9178
|
// src/components/resizable.tsx
|
|
8222
|
-
var
|
|
9179
|
+
var import_react_icons16 = require("@radix-ui/react-icons");
|
|
8223
9180
|
var ResizablePrimitive = __toESM(require("react-resizable-panels"), 1);
|
|
8224
|
-
var
|
|
9181
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
8225
9182
|
var ResizablePanelGroup = (_a) => {
|
|
8226
9183
|
var _b = _a, {
|
|
8227
9184
|
className
|
|
8228
9185
|
} = _b, props = __objRest(_b, [
|
|
8229
9186
|
"className"
|
|
8230
9187
|
]);
|
|
8231
|
-
return /* @__PURE__ */ (0,
|
|
9188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8232
9189
|
ResizablePrimitive.Group,
|
|
8233
9190
|
__spreadValues({
|
|
8234
9191
|
className: cn("flex h-full w-full aria-[orientation=vertical]:flex-col", className)
|
|
@@ -8244,7 +9201,7 @@ var ResizableHandle = (_a) => {
|
|
|
8244
9201
|
"withHandle",
|
|
8245
9202
|
"className"
|
|
8246
9203
|
]);
|
|
8247
|
-
return /* @__PURE__ */ (0,
|
|
9204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8248
9205
|
ResizablePrimitive.Separator,
|
|
8249
9206
|
__spreadProps(__spreadValues({
|
|
8250
9207
|
className: cn(
|
|
@@ -8252,7 +9209,7 @@ var ResizableHandle = (_a) => {
|
|
|
8252
9209
|
className
|
|
8253
9210
|
)
|
|
8254
9211
|
}, props), {
|
|
8255
|
-
children: withHandle && /* @__PURE__ */ (0,
|
|
9212
|
+
children: withHandle && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_icons16.DragHandleDots2Icon, { className: "h-2.5 w-2.5" }) })
|
|
8256
9213
|
})
|
|
8257
9214
|
);
|
|
8258
9215
|
};
|
|
@@ -8260,19 +9217,19 @@ var ResizableHandle = (_a) => {
|
|
|
8260
9217
|
// src/components/scroll-area.tsx
|
|
8261
9218
|
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
|
|
8262
9219
|
var React57 = __toESM(require("react"), 1);
|
|
8263
|
-
var
|
|
9220
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
8264
9221
|
var ScrollArea = React57.forwardRef((_a, ref) => {
|
|
8265
9222
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
8266
|
-
return /* @__PURE__ */ (0,
|
|
9223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
8267
9224
|
ScrollAreaPrimitive.Root,
|
|
8268
9225
|
__spreadProps(__spreadValues({
|
|
8269
9226
|
ref,
|
|
8270
9227
|
className: cn("relative overflow-hidden", className)
|
|
8271
9228
|
}, props), {
|
|
8272
9229
|
children: [
|
|
8273
|
-
/* @__PURE__ */ (0,
|
|
8274
|
-
/* @__PURE__ */ (0,
|
|
8275
|
-
/* @__PURE__ */ (0,
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
9231
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScrollBar, {}),
|
|
9232
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScrollAreaPrimitive.Corner, {})
|
|
8276
9233
|
]
|
|
8277
9234
|
})
|
|
8278
9235
|
);
|
|
@@ -8280,7 +9237,7 @@ var ScrollArea = React57.forwardRef((_a, ref) => {
|
|
|
8280
9237
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
8281
9238
|
var ScrollBar = React57.forwardRef((_a, ref) => {
|
|
8282
9239
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
8283
|
-
return /* @__PURE__ */ (0,
|
|
9240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8284
9241
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
8285
9242
|
__spreadProps(__spreadValues({
|
|
8286
9243
|
ref,
|
|
@@ -8292,7 +9249,7 @@ var ScrollBar = React57.forwardRef((_a, ref) => {
|
|
|
8292
9249
|
className
|
|
8293
9250
|
)
|
|
8294
9251
|
}, props), {
|
|
8295
|
-
children: /* @__PURE__ */ (0,
|
|
9252
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
8296
9253
|
})
|
|
8297
9254
|
);
|
|
8298
9255
|
});
|
|
@@ -8301,7 +9258,7 @@ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
|
8301
9258
|
// src/components/search-input.tsx
|
|
8302
9259
|
var React58 = __toESM(require("react"), 1);
|
|
8303
9260
|
var import_use_debounce = require("use-debounce");
|
|
8304
|
-
var
|
|
9261
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
8305
9262
|
function setForwardedRef(ref, value) {
|
|
8306
9263
|
if (typeof ref === "function") {
|
|
8307
9264
|
ref(value);
|
|
@@ -8382,7 +9339,7 @@ var SearchInput = React58.forwardRef(
|
|
|
8382
9339
|
focusInput();
|
|
8383
9340
|
});
|
|
8384
9341
|
};
|
|
8385
|
-
return /* @__PURE__ */ (0,
|
|
9342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8386
9343
|
Input,
|
|
8387
9344
|
__spreadValues({
|
|
8388
9345
|
ref: composedRef,
|
|
@@ -8396,358 +9353,39 @@ var SearchInput = React58.forwardRef(
|
|
|
8396
9353
|
onKeyDown: (event) => {
|
|
8397
9354
|
if (event.key !== "Escape") {
|
|
8398
9355
|
event.stopPropagation();
|
|
8399
|
-
}
|
|
8400
|
-
onKeyDown == null ? void 0 : onKeyDown(event);
|
|
8401
|
-
},
|
|
8402
|
-
onPointerDown: (event) => {
|
|
8403
|
-
event.stopPropagation();
|
|
8404
|
-
onPointerDown == null ? void 0 : onPointerDown(event);
|
|
8405
|
-
},
|
|
8406
|
-
onMouseDown: (event) => {
|
|
8407
|
-
event.stopPropagation();
|
|
8408
|
-
onMouseDown == null ? void 0 : onMouseDown(event);
|
|
8409
|
-
},
|
|
8410
|
-
onClick: (event) => {
|
|
8411
|
-
event.stopPropagation();
|
|
8412
|
-
requestAnimationFrame(() => {
|
|
8413
|
-
focusInput();
|
|
8414
|
-
});
|
|
8415
|
-
onClick == null ? void 0 : onClick(event);
|
|
8416
|
-
},
|
|
8417
|
-
onFocus: (event) => {
|
|
8418
|
-
event.stopPropagation();
|
|
8419
|
-
onFocus == null ? void 0 : onFocus(event);
|
|
8420
|
-
}
|
|
8421
|
-
}, props)
|
|
8422
|
-
);
|
|
8423
|
-
}
|
|
8424
|
-
);
|
|
8425
|
-
SearchInput.displayName = "SearchInput";
|
|
8426
|
-
|
|
8427
|
-
// src/components/searchable-select.tsx
|
|
8428
|
-
var React59 = __toESM(require("react"), 1);
|
|
8429
|
-
var import_react_icons16 = require("@radix-ui/react-icons");
|
|
8430
|
-
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
8431
|
-
function normalizeText(value) {
|
|
8432
|
-
return String(value != null ? value : "").normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase().trim();
|
|
8433
|
-
}
|
|
8434
|
-
function getLabelText(value) {
|
|
8435
|
-
if (typeof value === "string" || typeof value === "number") {
|
|
8436
|
-
return String(value);
|
|
8437
|
-
}
|
|
8438
|
-
return "";
|
|
8439
|
-
}
|
|
8440
|
-
function getOptionText(item) {
|
|
8441
|
-
if (!item) return "";
|
|
8442
|
-
return getLabelText(item.label) || item.value;
|
|
8443
|
-
}
|
|
8444
|
-
function getNextEnabledIndex2(items, currentIndex, direction) {
|
|
8445
|
-
var _a;
|
|
8446
|
-
if (!items.length) return -1;
|
|
8447
|
-
let nextIndex = currentIndex;
|
|
8448
|
-
for (let index = 0; index < items.length; index += 1) {
|
|
8449
|
-
nextIndex = (nextIndex + direction + items.length) % items.length;
|
|
8450
|
-
if (!((_a = items[nextIndex]) == null ? void 0 : _a.disabled)) {
|
|
8451
|
-
return nextIndex;
|
|
8452
|
-
}
|
|
8453
|
-
}
|
|
8454
|
-
return -1;
|
|
8455
|
-
}
|
|
8456
|
-
function SearchableSelectBase({
|
|
8457
|
-
items,
|
|
8458
|
-
value,
|
|
8459
|
-
defaultValue,
|
|
8460
|
-
onValueChange,
|
|
8461
|
-
placeholder = "Seleccionar opci\xF3n",
|
|
8462
|
-
searchPlaceholder = "Buscar\u2026",
|
|
8463
|
-
emptyText = "No hay resultados",
|
|
8464
|
-
disabled,
|
|
8465
|
-
name,
|
|
8466
|
-
required,
|
|
8467
|
-
triggerClassName,
|
|
8468
|
-
contentClassName,
|
|
8469
|
-
itemClassName,
|
|
8470
|
-
searchInputClassName
|
|
8471
|
-
}) {
|
|
8472
|
-
const rootRef = React59.useRef(null);
|
|
8473
|
-
const inputRef = React59.useRef(null);
|
|
8474
|
-
const listboxId = React59.useId();
|
|
8475
|
-
const isControlled = value !== void 0;
|
|
8476
|
-
const [internalValue, setInternalValue] = React59.useState(defaultValue != null ? defaultValue : "");
|
|
8477
|
-
const currentValue = isControlled ? value != null ? value : "" : internalValue;
|
|
8478
|
-
const selectedItem = React59.useMemo(() => {
|
|
8479
|
-
return items.find((item) => item.value === currentValue);
|
|
8480
|
-
}, [currentValue, items]);
|
|
8481
|
-
const selectedText = React59.useMemo(() => {
|
|
8482
|
-
return getOptionText(selectedItem);
|
|
8483
|
-
}, [selectedItem]);
|
|
8484
|
-
const [open, setOpen] = React59.useState(false);
|
|
8485
|
-
const [inputValue, setInputValue] = React59.useState(selectedText);
|
|
8486
|
-
const [activeIndex, setActiveIndex] = React59.useState(-1);
|
|
8487
|
-
React59.useEffect(() => {
|
|
8488
|
-
if (!open) {
|
|
8489
|
-
setInputValue(selectedText);
|
|
8490
|
-
}
|
|
8491
|
-
}, [open, selectedText]);
|
|
8492
|
-
const filteredItems = React59.useMemo(() => {
|
|
8493
|
-
const query = normalizeText(inputValue);
|
|
8494
|
-
if (!query) return items;
|
|
8495
|
-
return items.filter((item) => {
|
|
8496
|
-
var _a;
|
|
8497
|
-
const haystack = normalizeText(
|
|
8498
|
-
`${getLabelText(item.label)} ${item.value} ${(_a = item.keywords) != null ? _a : ""}`
|
|
8499
|
-
);
|
|
8500
|
-
return haystack.includes(query);
|
|
8501
|
-
});
|
|
8502
|
-
}, [inputValue, items]);
|
|
8503
|
-
React59.useEffect(() => {
|
|
8504
|
-
if (!open) return;
|
|
8505
|
-
const firstEnabledIndex = filteredItems.findIndex((item) => !item.disabled);
|
|
8506
|
-
setActiveIndex(firstEnabledIndex);
|
|
8507
|
-
}, [filteredItems, open]);
|
|
8508
|
-
React59.useEffect(() => {
|
|
8509
|
-
if (!open) return;
|
|
8510
|
-
const handlePointerDown = (event) => {
|
|
8511
|
-
var _a;
|
|
8512
|
-
const target = event.target;
|
|
8513
|
-
if (target && ((_a = rootRef.current) == null ? void 0 : _a.contains(target))) {
|
|
8514
|
-
return;
|
|
8515
|
-
}
|
|
8516
|
-
setOpen(false);
|
|
8517
|
-
};
|
|
8518
|
-
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
8519
|
-
return () => {
|
|
8520
|
-
document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
8521
|
-
};
|
|
8522
|
-
}, [open]);
|
|
8523
|
-
const selectItem = React59.useCallback(
|
|
8524
|
-
(item) => {
|
|
8525
|
-
if (item.disabled) return;
|
|
8526
|
-
if (!isControlled) {
|
|
8527
|
-
setInternalValue(item.value);
|
|
8528
|
-
}
|
|
8529
|
-
setInputValue(getOptionText(item));
|
|
8530
|
-
setOpen(false);
|
|
8531
|
-
onValueChange == null ? void 0 : onValueChange(item.value, item);
|
|
8532
|
-
requestAnimationFrame(() => {
|
|
8533
|
-
var _a;
|
|
8534
|
-
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
8535
|
-
});
|
|
8536
|
-
},
|
|
8537
|
-
[isControlled, onValueChange]
|
|
8538
|
-
);
|
|
8539
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref: rootRef, className: "relative w-full", children: [
|
|
8540
|
-
name ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8541
|
-
"input",
|
|
8542
|
-
{
|
|
8543
|
-
type: "hidden",
|
|
8544
|
-
name,
|
|
8545
|
-
value: currentValue,
|
|
8546
|
-
required,
|
|
8547
|
-
disabled
|
|
8548
|
-
}
|
|
8549
|
-
) : null,
|
|
8550
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8551
|
-
"div",
|
|
8552
|
-
{
|
|
8553
|
-
className: cn(
|
|
8554
|
-
"relative flex h-9 w-full items-center gap-2 rounded-md border border-input bg-background px-3 text-sm shadow-sm transition",
|
|
8555
|
-
"focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/20",
|
|
8556
|
-
disabled && "cursor-not-allowed opacity-50",
|
|
8557
|
-
triggerClassName
|
|
8558
|
-
),
|
|
8559
|
-
onPointerDown: () => {
|
|
8560
|
-
if (disabled) return;
|
|
8561
|
-
setOpen(true);
|
|
9356
|
+
}
|
|
9357
|
+
onKeyDown == null ? void 0 : onKeyDown(event);
|
|
9358
|
+
},
|
|
9359
|
+
onPointerDown: (event) => {
|
|
9360
|
+
event.stopPropagation();
|
|
9361
|
+
onPointerDown == null ? void 0 : onPointerDown(event);
|
|
9362
|
+
},
|
|
9363
|
+
onMouseDown: (event) => {
|
|
9364
|
+
event.stopPropagation();
|
|
9365
|
+
onMouseDown == null ? void 0 : onMouseDown(event);
|
|
9366
|
+
},
|
|
9367
|
+
onClick: (event) => {
|
|
9368
|
+
event.stopPropagation();
|
|
8562
9369
|
requestAnimationFrame(() => {
|
|
8563
|
-
|
|
8564
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
9370
|
+
focusInput();
|
|
8565
9371
|
});
|
|
9372
|
+
onClick == null ? void 0 : onClick(event);
|
|
8566
9373
|
},
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
"aria-autocomplete": "list",
|
|
8575
|
-
"aria-expanded": open,
|
|
8576
|
-
"aria-controls": listboxId,
|
|
8577
|
-
"aria-activedescendant": activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : void 0,
|
|
8578
|
-
placeholder: open ? searchPlaceholder : placeholder,
|
|
8579
|
-
autoComplete: "off",
|
|
8580
|
-
spellCheck: false,
|
|
8581
|
-
disabled,
|
|
8582
|
-
onFocus: () => {
|
|
8583
|
-
setOpen(true);
|
|
8584
|
-
requestAnimationFrame(() => {
|
|
8585
|
-
var _a;
|
|
8586
|
-
(_a = inputRef.current) == null ? void 0 : _a.select();
|
|
8587
|
-
});
|
|
8588
|
-
},
|
|
8589
|
-
onChange: (event) => {
|
|
8590
|
-
setInputValue(event.target.value);
|
|
8591
|
-
setOpen(true);
|
|
8592
|
-
},
|
|
8593
|
-
onKeyDown: (event) => {
|
|
8594
|
-
var _a;
|
|
8595
|
-
if (event.key === "ArrowDown") {
|
|
8596
|
-
event.preventDefault();
|
|
8597
|
-
setOpen(true);
|
|
8598
|
-
setActiveIndex(
|
|
8599
|
-
(currentIndex) => getNextEnabledIndex2(filteredItems, currentIndex, 1)
|
|
8600
|
-
);
|
|
8601
|
-
return;
|
|
8602
|
-
}
|
|
8603
|
-
if (event.key === "ArrowUp") {
|
|
8604
|
-
event.preventDefault();
|
|
8605
|
-
setOpen(true);
|
|
8606
|
-
setActiveIndex(
|
|
8607
|
-
(currentIndex) => getNextEnabledIndex2(filteredItems, currentIndex, -1)
|
|
8608
|
-
);
|
|
8609
|
-
return;
|
|
8610
|
-
}
|
|
8611
|
-
if (event.key === "Enter") {
|
|
8612
|
-
if (!open) return;
|
|
8613
|
-
event.preventDefault();
|
|
8614
|
-
const activeItem = filteredItems[activeIndex];
|
|
8615
|
-
if (activeItem) {
|
|
8616
|
-
selectItem(activeItem);
|
|
8617
|
-
}
|
|
8618
|
-
return;
|
|
8619
|
-
}
|
|
8620
|
-
if (event.key === "Escape") {
|
|
8621
|
-
event.preventDefault();
|
|
8622
|
-
setOpen(false);
|
|
8623
|
-
setInputValue(selectedText);
|
|
8624
|
-
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
8625
|
-
}
|
|
8626
|
-
},
|
|
8627
|
-
className: cn(
|
|
8628
|
-
"h-full min-w-0 flex-1 border-0 bg-transparent p-0 text-sm outline-none",
|
|
8629
|
-
"placeholder:text-muted-foreground disabled:cursor-not-allowed",
|
|
8630
|
-
searchInputClassName
|
|
8631
|
-
)
|
|
8632
|
-
}
|
|
8633
|
-
),
|
|
8634
|
-
inputValue && open ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8635
|
-
"button",
|
|
8636
|
-
{
|
|
8637
|
-
type: "button",
|
|
8638
|
-
"aria-label": "Limpiar b\xFAsqueda",
|
|
8639
|
-
tabIndex: -1,
|
|
8640
|
-
onPointerDown: (event) => {
|
|
8641
|
-
event.preventDefault();
|
|
8642
|
-
event.stopPropagation();
|
|
8643
|
-
},
|
|
8644
|
-
onClick: (event) => {
|
|
8645
|
-
event.preventDefault();
|
|
8646
|
-
event.stopPropagation();
|
|
8647
|
-
setInputValue("");
|
|
8648
|
-
requestAnimationFrame(() => {
|
|
8649
|
-
var _a;
|
|
8650
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
8651
|
-
});
|
|
8652
|
-
},
|
|
8653
|
-
className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted hover:text-foreground",
|
|
8654
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_icons16.Cross2Icon, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
8655
|
-
}
|
|
8656
|
-
) : null,
|
|
8657
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8658
|
-
import_react_icons16.CaretSortIcon,
|
|
8659
|
-
{
|
|
8660
|
-
"aria-hidden": "true",
|
|
8661
|
-
className: cn(
|
|
8662
|
-
"h-4 w-4 shrink-0 opacity-50 transition-transform",
|
|
8663
|
-
open && "rotate-180"
|
|
8664
|
-
)
|
|
8665
|
-
}
|
|
8666
|
-
)
|
|
8667
|
-
]
|
|
8668
|
-
}
|
|
8669
|
-
),
|
|
8670
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8671
|
-
"div",
|
|
8672
|
-
{
|
|
8673
|
-
className: cn(
|
|
8674
|
-
"absolute left-0 top-full z-50 mt-1 w-full overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-xl transition",
|
|
8675
|
-
!open && "pointer-events-none invisible opacity-0",
|
|
8676
|
-
open && "visible opacity-100",
|
|
8677
|
-
contentClassName
|
|
8678
|
-
),
|
|
8679
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8680
|
-
"div",
|
|
8681
|
-
{
|
|
8682
|
-
id: listboxId,
|
|
8683
|
-
role: "listbox",
|
|
8684
|
-
className: "max-h-72 overflow-y-auto overscroll-contain p-1 [scrollbar-gutter:stable]",
|
|
8685
|
-
onWheelCapture: (event) => {
|
|
8686
|
-
event.stopPropagation();
|
|
8687
|
-
},
|
|
8688
|
-
onTouchMoveCapture: (event) => {
|
|
8689
|
-
event.stopPropagation();
|
|
8690
|
-
},
|
|
8691
|
-
children: filteredItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: emptyText }) : filteredItems.map((item, index) => {
|
|
8692
|
-
const isSelected = item.value === currentValue;
|
|
8693
|
-
const isActive = index === activeIndex;
|
|
8694
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8695
|
-
"div",
|
|
8696
|
-
{
|
|
8697
|
-
id: `${listboxId}-option-${index}`,
|
|
8698
|
-
role: "option",
|
|
8699
|
-
"aria-selected": isSelected,
|
|
8700
|
-
"aria-disabled": item.disabled,
|
|
8701
|
-
tabIndex: -1,
|
|
8702
|
-
onMouseMove: () => {
|
|
8703
|
-
if (!item.disabled) {
|
|
8704
|
-
setActiveIndex(index);
|
|
8705
|
-
}
|
|
8706
|
-
},
|
|
8707
|
-
onPointerDown: (event) => {
|
|
8708
|
-
event.preventDefault();
|
|
8709
|
-
event.stopPropagation();
|
|
8710
|
-
if (!item.disabled) {
|
|
8711
|
-
selectItem(item);
|
|
8712
|
-
}
|
|
8713
|
-
},
|
|
8714
|
-
className: cn(
|
|
8715
|
-
"relative flex w-full select-none items-center gap-2 rounded-lg px-3 py-2 text-left text-sm outline-none transition",
|
|
8716
|
-
item.disabled ? "pointer-events-none opacity-50" : "cursor-pointer",
|
|
8717
|
-
isActive && !item.disabled && "bg-accent text-accent-foreground",
|
|
8718
|
-
!isActive && !item.disabled && "hover:bg-accent/70 hover:text-accent-foreground",
|
|
8719
|
-
isSelected && "font-medium",
|
|
8720
|
-
itemClassName
|
|
8721
|
-
),
|
|
8722
|
-
children: [
|
|
8723
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
8724
|
-
isSelected ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8725
|
-
import_react_icons16.CheckIcon,
|
|
8726
|
-
{
|
|
8727
|
-
"aria-hidden": "true",
|
|
8728
|
-
className: "h-4 w-4 shrink-0 text-primary"
|
|
8729
|
-
}
|
|
8730
|
-
) : null
|
|
8731
|
-
]
|
|
8732
|
-
},
|
|
8733
|
-
item.value
|
|
8734
|
-
);
|
|
8735
|
-
})
|
|
8736
|
-
}
|
|
8737
|
-
)
|
|
8738
|
-
}
|
|
8739
|
-
)
|
|
8740
|
-
] });
|
|
8741
|
-
}
|
|
8742
|
-
var SearchableSelect = React59.memo(
|
|
8743
|
-
SearchableSelectBase
|
|
9374
|
+
onFocus: (event) => {
|
|
9375
|
+
event.stopPropagation();
|
|
9376
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
9377
|
+
}
|
|
9378
|
+
}, props)
|
|
9379
|
+
);
|
|
9380
|
+
}
|
|
8744
9381
|
);
|
|
9382
|
+
SearchInput.displayName = "SearchInput";
|
|
8745
9383
|
|
|
8746
9384
|
// src/components/separator.tsx
|
|
8747
9385
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
8748
|
-
var
|
|
9386
|
+
var React59 = __toESM(require("react"), 1);
|
|
8749
9387
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
8750
|
-
var
|
|
9388
|
+
var Separator5 = React59.forwardRef(
|
|
8751
9389
|
(_a, ref) => {
|
|
8752
9390
|
var _b = _a, { className, orientation = "horizontal", decorative = true } = _b, props = __objRest(_b, ["className", "orientation", "decorative"]);
|
|
8753
9391
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
@@ -8765,19 +9403,19 @@ var Separator6 = React60.forwardRef(
|
|
|
8765
9403
|
);
|
|
8766
9404
|
}
|
|
8767
9405
|
);
|
|
8768
|
-
|
|
9406
|
+
Separator5.displayName = SeparatorPrimitive.Root.displayName;
|
|
8769
9407
|
|
|
8770
9408
|
// src/components/sheet.tsx
|
|
8771
9409
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
8772
9410
|
var import_react_icons17 = require("@radix-ui/react-icons");
|
|
8773
9411
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
8774
|
-
var
|
|
9412
|
+
var React60 = __toESM(require("react"), 1);
|
|
8775
9413
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
8776
9414
|
var Sheet = SheetPrimitive.Root;
|
|
8777
9415
|
var SheetTrigger = SheetPrimitive.Trigger;
|
|
8778
9416
|
var SheetClose = SheetPrimitive.Close;
|
|
8779
9417
|
var SheetPortal = SheetPrimitive.Portal;
|
|
8780
|
-
var SheetOverlay =
|
|
9418
|
+
var SheetOverlay = React60.forwardRef((_a, ref) => {
|
|
8781
9419
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8782
9420
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8783
9421
|
SheetPrimitive.Overlay,
|
|
@@ -8808,7 +9446,7 @@ var sheetVariants = (0, import_class_variance_authority7.cva)(
|
|
|
8808
9446
|
}
|
|
8809
9447
|
}
|
|
8810
9448
|
);
|
|
8811
|
-
var SheetContent =
|
|
9449
|
+
var SheetContent = React60.forwardRef((_a, ref) => {
|
|
8812
9450
|
var _b = _a, { side = "right", className, children } = _b, props = __objRest(_b, ["side", "className", "children"]);
|
|
8813
9451
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(SheetPortal, { children: [
|
|
8814
9452
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SheetOverlay, {}),
|
|
@@ -8864,7 +9502,7 @@ var SheetFooter = (_a) => {
|
|
|
8864
9502
|
);
|
|
8865
9503
|
};
|
|
8866
9504
|
SheetFooter.displayName = "SheetFooter";
|
|
8867
|
-
var SheetTitle =
|
|
9505
|
+
var SheetTitle = React60.forwardRef((_a, ref) => {
|
|
8868
9506
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8869
9507
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8870
9508
|
SheetPrimitive.Title,
|
|
@@ -8875,7 +9513,7 @@ var SheetTitle = React61.forwardRef((_a, ref) => {
|
|
|
8875
9513
|
);
|
|
8876
9514
|
});
|
|
8877
9515
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
8878
|
-
var SheetDescription =
|
|
9516
|
+
var SheetDescription = React60.forwardRef((_a, ref) => {
|
|
8879
9517
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8880
9518
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8881
9519
|
SheetPrimitive.Description,
|
|
@@ -8905,9 +9543,9 @@ function Skeleton(_a) {
|
|
|
8905
9543
|
|
|
8906
9544
|
// src/components/slider.tsx
|
|
8907
9545
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"), 1);
|
|
8908
|
-
var
|
|
9546
|
+
var React61 = __toESM(require("react"), 1);
|
|
8909
9547
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
8910
|
-
var Slider =
|
|
9548
|
+
var Slider = React61.forwardRef((_a, ref) => {
|
|
8911
9549
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8912
9550
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
8913
9551
|
SliderPrimitive.Root,
|
|
@@ -8953,9 +9591,9 @@ var ToasterSonner = (_a) => {
|
|
|
8953
9591
|
|
|
8954
9592
|
// src/components/switch.tsx
|
|
8955
9593
|
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
8956
|
-
var
|
|
9594
|
+
var React62 = __toESM(require("react"), 1);
|
|
8957
9595
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
8958
|
-
var Switch =
|
|
9596
|
+
var Switch = React62.forwardRef((_a, ref) => {
|
|
8959
9597
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8960
9598
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8961
9599
|
SwitchPrimitives.Root,
|
|
@@ -8980,9 +9618,9 @@ var Switch = React63.forwardRef((_a, ref) => {
|
|
|
8980
9618
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
8981
9619
|
|
|
8982
9620
|
// src/components/table.tsx
|
|
8983
|
-
var
|
|
9621
|
+
var React63 = __toESM(require("react"), 1);
|
|
8984
9622
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
8985
|
-
var Table =
|
|
9623
|
+
var Table = React63.forwardRef(
|
|
8986
9624
|
(_a, ref) => {
|
|
8987
9625
|
var _b = _a, { className, containerClassName } = _b, props = __objRest(_b, ["className", "containerClassName"]);
|
|
8988
9626
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: cn("relative w-full overflow-visible", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
@@ -8995,12 +9633,12 @@ var Table = React64.forwardRef(
|
|
|
8995
9633
|
}
|
|
8996
9634
|
);
|
|
8997
9635
|
Table.displayName = "Table";
|
|
8998
|
-
var TableHeader =
|
|
9636
|
+
var TableHeader = React63.forwardRef((_a, ref) => {
|
|
8999
9637
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9000
9638
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", __spreadValues({ ref, className: cn("[&_tr]:border-b", className) }, props));
|
|
9001
9639
|
});
|
|
9002
9640
|
TableHeader.displayName = "TableHeader";
|
|
9003
|
-
var TableBody =
|
|
9641
|
+
var TableBody = React63.forwardRef((_a, ref) => {
|
|
9004
9642
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9005
9643
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9006
9644
|
"tbody",
|
|
@@ -9011,7 +9649,7 @@ var TableBody = React64.forwardRef((_a, ref) => {
|
|
|
9011
9649
|
);
|
|
9012
9650
|
});
|
|
9013
9651
|
TableBody.displayName = "TableBody";
|
|
9014
|
-
var TableFooter =
|
|
9652
|
+
var TableFooter = React63.forwardRef((_a, ref) => {
|
|
9015
9653
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9016
9654
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9017
9655
|
"tfoot",
|
|
@@ -9025,7 +9663,7 @@ var TableFooter = React64.forwardRef((_a, ref) => {
|
|
|
9025
9663
|
);
|
|
9026
9664
|
});
|
|
9027
9665
|
TableFooter.displayName = "TableFooter";
|
|
9028
|
-
var TableRow =
|
|
9666
|
+
var TableRow = React63.forwardRef((_a, ref) => {
|
|
9029
9667
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9030
9668
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9031
9669
|
"tr",
|
|
@@ -9039,7 +9677,7 @@ var TableRow = React64.forwardRef((_a, ref) => {
|
|
|
9039
9677
|
);
|
|
9040
9678
|
});
|
|
9041
9679
|
TableRow.displayName = "TableRow";
|
|
9042
|
-
var TableHead =
|
|
9680
|
+
var TableHead = React63.forwardRef((_a, ref) => {
|
|
9043
9681
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9044
9682
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9045
9683
|
"th",
|
|
@@ -9053,7 +9691,7 @@ var TableHead = React64.forwardRef((_a, ref) => {
|
|
|
9053
9691
|
);
|
|
9054
9692
|
});
|
|
9055
9693
|
TableHead.displayName = "TableHead";
|
|
9056
|
-
var TableCell =
|
|
9694
|
+
var TableCell = React63.forwardRef((_a, ref) => {
|
|
9057
9695
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9058
9696
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9059
9697
|
"td",
|
|
@@ -9067,7 +9705,7 @@ var TableCell = React64.forwardRef((_a, ref) => {
|
|
|
9067
9705
|
);
|
|
9068
9706
|
});
|
|
9069
9707
|
TableCell.displayName = "TableCell";
|
|
9070
|
-
var TableCaption =
|
|
9708
|
+
var TableCaption = React63.forwardRef((_a, ref) => {
|
|
9071
9709
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9072
9710
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9073
9711
|
"caption",
|
|
@@ -9081,10 +9719,10 @@ TableCaption.displayName = "TableCaption";
|
|
|
9081
9719
|
|
|
9082
9720
|
// src/components/tabs.tsx
|
|
9083
9721
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
9084
|
-
var
|
|
9722
|
+
var React64 = __toESM(require("react"), 1);
|
|
9085
9723
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
9086
9724
|
var Tabs = TabsPrimitive.Root;
|
|
9087
|
-
var TabsList =
|
|
9725
|
+
var TabsList = React64.forwardRef((_a, ref) => {
|
|
9088
9726
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9089
9727
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9090
9728
|
TabsPrimitive.List,
|
|
@@ -9098,7 +9736,7 @@ var TabsList = React65.forwardRef((_a, ref) => {
|
|
|
9098
9736
|
);
|
|
9099
9737
|
});
|
|
9100
9738
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
9101
|
-
var TabsTrigger =
|
|
9739
|
+
var TabsTrigger = React64.forwardRef((_a, ref) => {
|
|
9102
9740
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9103
9741
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9104
9742
|
TabsPrimitive.Trigger,
|
|
@@ -9112,7 +9750,7 @@ var TabsTrigger = React65.forwardRef((_a, ref) => {
|
|
|
9112
9750
|
);
|
|
9113
9751
|
});
|
|
9114
9752
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
9115
|
-
var TabsContent =
|
|
9753
|
+
var TabsContent = React64.forwardRef((_a, ref) => {
|
|
9116
9754
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9117
9755
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9118
9756
|
TabsPrimitive.Content,
|
|
@@ -9128,9 +9766,9 @@ var TabsContent = React65.forwardRef((_a, ref) => {
|
|
|
9128
9766
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
9129
9767
|
|
|
9130
9768
|
// src/components/textarea.tsx
|
|
9131
|
-
var
|
|
9769
|
+
var React65 = __toESM(require("react"), 1);
|
|
9132
9770
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
9133
|
-
var Textarea =
|
|
9771
|
+
var Textarea = React65.forwardRef(
|
|
9134
9772
|
(_a, ref) => {
|
|
9135
9773
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9136
9774
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -9151,10 +9789,10 @@ Textarea.displayName = "Textarea";
|
|
|
9151
9789
|
var import_react_icons18 = require("@radix-ui/react-icons");
|
|
9152
9790
|
var ToastPrimitives = __toESM(require("@radix-ui/react-toast"), 1);
|
|
9153
9791
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
9154
|
-
var
|
|
9792
|
+
var React66 = __toESM(require("react"), 1);
|
|
9155
9793
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
9156
9794
|
var ToastProvider = ToastPrimitives.Provider;
|
|
9157
|
-
var ToastViewport =
|
|
9795
|
+
var ToastViewport = React66.forwardRef((_a, ref) => {
|
|
9158
9796
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9159
9797
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9160
9798
|
ToastPrimitives.Viewport,
|
|
@@ -9182,7 +9820,7 @@ var toastVariants = (0, import_class_variance_authority8.cva)(
|
|
|
9182
9820
|
}
|
|
9183
9821
|
}
|
|
9184
9822
|
);
|
|
9185
|
-
var Toast =
|
|
9823
|
+
var Toast = React66.forwardRef((_a, ref) => {
|
|
9186
9824
|
var _b = _a, { className, variant } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
9187
9825
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9188
9826
|
ToastPrimitives.Root,
|
|
@@ -9193,7 +9831,7 @@ var Toast = React67.forwardRef((_a, ref) => {
|
|
|
9193
9831
|
);
|
|
9194
9832
|
});
|
|
9195
9833
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
9196
|
-
var ToastAction =
|
|
9834
|
+
var ToastAction = React66.forwardRef((_a, ref) => {
|
|
9197
9835
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9198
9836
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9199
9837
|
ToastPrimitives.Action,
|
|
@@ -9207,7 +9845,7 @@ var ToastAction = React67.forwardRef((_a, ref) => {
|
|
|
9207
9845
|
);
|
|
9208
9846
|
});
|
|
9209
9847
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
9210
|
-
var ToastClose =
|
|
9848
|
+
var ToastClose = React66.forwardRef((_a, ref) => {
|
|
9211
9849
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9212
9850
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9213
9851
|
ToastPrimitives.Close,
|
|
@@ -9224,7 +9862,7 @@ var ToastClose = React67.forwardRef((_a, ref) => {
|
|
|
9224
9862
|
);
|
|
9225
9863
|
});
|
|
9226
9864
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
9227
|
-
var ToastTitle =
|
|
9865
|
+
var ToastTitle = React66.forwardRef((_a, ref) => {
|
|
9228
9866
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9229
9867
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9230
9868
|
ToastPrimitives.Title,
|
|
@@ -9235,7 +9873,7 @@ var ToastTitle = React67.forwardRef((_a, ref) => {
|
|
|
9235
9873
|
);
|
|
9236
9874
|
});
|
|
9237
9875
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
9238
|
-
var ToastDescription =
|
|
9876
|
+
var ToastDescription = React66.forwardRef((_a, ref) => {
|
|
9239
9877
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9240
9878
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9241
9879
|
ToastPrimitives.Description,
|
|
@@ -9248,7 +9886,7 @@ var ToastDescription = React67.forwardRef((_a, ref) => {
|
|
|
9248
9886
|
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
9249
9887
|
|
|
9250
9888
|
// src/components/use-toast.ts
|
|
9251
|
-
var
|
|
9889
|
+
var React67 = __toESM(require("react"), 1);
|
|
9252
9890
|
var TOAST_LIMIT = 1;
|
|
9253
9891
|
var TOAST_REMOVE_DELAY = 1e6;
|
|
9254
9892
|
var count = 0;
|
|
@@ -9343,8 +9981,8 @@ function toast(_a) {
|
|
|
9343
9981
|
};
|
|
9344
9982
|
}
|
|
9345
9983
|
function useToast() {
|
|
9346
|
-
const [state, setState] =
|
|
9347
|
-
|
|
9984
|
+
const [state, setState] = React67.useState(memoryState);
|
|
9985
|
+
React67.useEffect(() => {
|
|
9348
9986
|
listeners.push(setState);
|
|
9349
9987
|
return () => {
|
|
9350
9988
|
const index = listeners.indexOf(setState);
|
|
@@ -9382,7 +10020,7 @@ function Toaster() {
|
|
|
9382
10020
|
// src/components/toggle.tsx
|
|
9383
10021
|
var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"), 1);
|
|
9384
10022
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
9385
|
-
var
|
|
10023
|
+
var React68 = __toESM(require("react"), 1);
|
|
9386
10024
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
9387
10025
|
var toggleVariants = (0, import_class_variance_authority9.cva)(
|
|
9388
10026
|
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
@@ -9404,7 +10042,7 @@ var toggleVariants = (0, import_class_variance_authority9.cva)(
|
|
|
9404
10042
|
}
|
|
9405
10043
|
}
|
|
9406
10044
|
);
|
|
9407
|
-
var Toggle =
|
|
10045
|
+
var Toggle = React68.forwardRef((_a, ref) => {
|
|
9408
10046
|
var _b = _a, { className, variant, size } = _b, props = __objRest(_b, ["className", "variant", "size"]);
|
|
9409
10047
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
9410
10048
|
TogglePrimitive.Root,
|
|
@@ -9418,13 +10056,13 @@ Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
|
9418
10056
|
|
|
9419
10057
|
// src/components/toggle-group.tsx
|
|
9420
10058
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
|
|
9421
|
-
var
|
|
10059
|
+
var React69 = __toESM(require("react"), 1);
|
|
9422
10060
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
9423
|
-
var ToggleGroupContext =
|
|
10061
|
+
var ToggleGroupContext = React69.createContext({
|
|
9424
10062
|
size: "default",
|
|
9425
10063
|
variant: "default"
|
|
9426
10064
|
});
|
|
9427
|
-
var ToggleGroup =
|
|
10065
|
+
var ToggleGroup = React69.forwardRef((_a, ref) => {
|
|
9428
10066
|
var _b = _a, { className, variant, size, children } = _b, props = __objRest(_b, ["className", "variant", "size", "children"]);
|
|
9429
10067
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9430
10068
|
ToggleGroupPrimitive.Root,
|
|
@@ -9437,9 +10075,9 @@ var ToggleGroup = React70.forwardRef((_a, ref) => {
|
|
|
9437
10075
|
);
|
|
9438
10076
|
});
|
|
9439
10077
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
9440
|
-
var ToggleGroupItem =
|
|
10078
|
+
var ToggleGroupItem = React69.forwardRef((_a, ref) => {
|
|
9441
10079
|
var _b = _a, { className, children, variant, size } = _b, props = __objRest(_b, ["className", "children", "variant", "size"]);
|
|
9442
|
-
const context =
|
|
10080
|
+
const context = React69.useContext(ToggleGroupContext);
|
|
9443
10081
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9444
10082
|
ToggleGroupPrimitive.Item,
|
|
9445
10083
|
__spreadProps(__spreadValues({
|
|
@@ -9460,12 +10098,12 @@ ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
|
9460
10098
|
|
|
9461
10099
|
// src/components/tooltip.tsx
|
|
9462
10100
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
9463
|
-
var
|
|
10101
|
+
var React70 = __toESM(require("react"), 1);
|
|
9464
10102
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
9465
10103
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
9466
10104
|
var Tooltip = TooltipPrimitive.Root;
|
|
9467
10105
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
9468
|
-
var TooltipContent =
|
|
10106
|
+
var TooltipContent = React70.forwardRef((_a, ref) => {
|
|
9469
10107
|
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
|
9470
10108
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9471
10109
|
TooltipPrimitive.Content,
|
|
@@ -9482,10 +10120,10 @@ var TooltipContent = React71.forwardRef((_a, ref) => {
|
|
|
9482
10120
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
9483
10121
|
|
|
9484
10122
|
// src/components/ui/input.tsx
|
|
9485
|
-
var
|
|
10123
|
+
var React71 = __toESM(require("react"), 1);
|
|
9486
10124
|
var import_lucide_react8 = require("lucide-react");
|
|
9487
10125
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
9488
|
-
var UiInput =
|
|
10126
|
+
var UiInput = React71.forwardRef(
|
|
9489
10127
|
(_a, ref) => {
|
|
9490
10128
|
var _b = _a, {
|
|
9491
10129
|
label,
|
|
@@ -9510,7 +10148,7 @@ var UiInput = React72.forwardRef(
|
|
|
9510
10148
|
"invalid",
|
|
9511
10149
|
"className"
|
|
9512
10150
|
]);
|
|
9513
|
-
const generatedId =
|
|
10151
|
+
const generatedId = React71.useId();
|
|
9514
10152
|
const inputId = htmlFormItemId != null ? htmlFormItemId : generatedId;
|
|
9515
10153
|
const messageId = `${inputId}-message`;
|
|
9516
10154
|
const hasError = Boolean(errorMessage || invalid);
|
|
@@ -9564,22 +10202,8 @@ var UiInput = React72.forwardRef(
|
|
|
9564
10202
|
UiInput.displayName = "UiInput";
|
|
9565
10203
|
|
|
9566
10204
|
// src/components/ui/select.tsx
|
|
9567
|
-
var
|
|
10205
|
+
var React72 = __toESM(require("react"), 1);
|
|
9568
10206
|
var import_lucide_react9 = require("lucide-react");
|
|
9569
|
-
|
|
9570
|
-
// src/types/select.ts
|
|
9571
|
-
var selectVariants = {
|
|
9572
|
-
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",
|
|
9573
|
-
soft: "rounded-md border border-transparent bg-muted/60 shadow-sm hover:bg-muted focus:bg-input/80 focus:ring-2 focus:ring-primary/20",
|
|
9574
|
-
ghost: "rounded-md border border-transparent bg-transparent hover:bg-muted/50 focus:ring-2 focus:ring-ring",
|
|
9575
|
-
filled: "rounded-md border border-input bg-muted/70 shadow-inner hover:bg-muted focus:bg-input/70 focus:ring-2 focus:ring-primary/20",
|
|
9576
|
-
flushed: "rounded-none border-0 border-b border-input px-0 shadow-none focus:border-b-2 focus:border-primary focus:ring-0",
|
|
9577
|
-
unstyled: "border-0 shadow-none focus:ring-0",
|
|
9578
|
-
link: "h-auto border-0 bg-transparent p-0 text-primary shadow-none underline-offset-4 focus:underline focus:ring-0"
|
|
9579
|
-
};
|
|
9580
|
-
var variants2 = selectVariants;
|
|
9581
|
-
|
|
9582
|
-
// src/components/ui/select.tsx
|
|
9583
10207
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
9584
10208
|
function UiSelect({
|
|
9585
10209
|
label,
|
|
@@ -9599,33 +10223,28 @@ function UiSelect({
|
|
|
9599
10223
|
messageClassName,
|
|
9600
10224
|
requiredLabelClassName,
|
|
9601
10225
|
size = "md",
|
|
10226
|
+
customSize,
|
|
9602
10227
|
variant = "outline",
|
|
10228
|
+
classNameDefault = true,
|
|
9603
10229
|
errorMessage,
|
|
9604
|
-
htmlFormItemId
|
|
10230
|
+
htmlFormItemId,
|
|
10231
|
+
position
|
|
9605
10232
|
}) {
|
|
9606
|
-
const generatedId =
|
|
10233
|
+
const generatedId = React72.useId();
|
|
9607
10234
|
const triggerId = htmlFormItemId != null ? htmlFormItemId : generatedId;
|
|
9608
10235
|
const messageId = `${triggerId}-message`;
|
|
9609
10236
|
const hasError = Boolean(errorMessage);
|
|
9610
|
-
const
|
|
9611
|
-
const
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
};
|
|
9616
|
-
const itemSize = {
|
|
9617
|
-
sm: "h-8 text-sm",
|
|
9618
|
-
md: "h-9 text-sm",
|
|
9619
|
-
lg: "h-10 text-base"
|
|
9620
|
-
};
|
|
9621
|
-
const specialFlushed = variant === "flushed" ? size === "sm" ? "h-9 text-sm" : size === "lg" ? "h-11 text-base" : "h-10 text-sm" : "";
|
|
9622
|
-
const specialLink = variant === "link" ? "text-sm" : "";
|
|
9623
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: cn("w-full space-y-1.5", selectClassName), children: [
|
|
10237
|
+
const sizeClasses = getFormSizeClasses(size, customSize);
|
|
10238
|
+
const triggerSizeClass = getFormControlSizeClass(variant, sizeClasses);
|
|
10239
|
+
const contentBase = "z-50 rounded-xl border border-border bg-popover text-popover-foreground shadow-xl outline-none";
|
|
10240
|
+
const contentViewport = "[&_[data-radix-select-viewport]]:max-h-72 [&_[data-radix-select-viewport]]:overflow-y-auto [&_[data-radix-select-viewport]]:overscroll-contain [&_[data-radix-select-viewport]]:[scrollbar-gutter:stable]";
|
|
10241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: cn("w-full space-y-2", selectClassName), children: [
|
|
9624
10242
|
label ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
9625
10243
|
Label3,
|
|
9626
10244
|
{
|
|
9627
10245
|
className: cn(
|
|
9628
|
-
"inline-flex items-start gap-0.5
|
|
10246
|
+
"inline-flex items-start gap-0.5 font-medium",
|
|
10247
|
+
sizeClasses.label,
|
|
9629
10248
|
hasError && "text-destructive",
|
|
9630
10249
|
labelClassName
|
|
9631
10250
|
),
|
|
@@ -9637,7 +10256,7 @@ function UiSelect({
|
|
|
9637
10256
|
{
|
|
9638
10257
|
"aria-hidden": "true",
|
|
9639
10258
|
className: cn(
|
|
9640
|
-
"
|
|
10259
|
+
"h-3 w-3 shrink-0 text-red-500",
|
|
9641
10260
|
requiredLabelClassName
|
|
9642
10261
|
)
|
|
9643
10262
|
}
|
|
@@ -9659,26 +10278,45 @@ function UiSelect({
|
|
|
9659
10278
|
id: triggerId,
|
|
9660
10279
|
"aria-invalid": hasError || void 0,
|
|
9661
10280
|
"aria-describedby": errorMessage ? messageId : void 0,
|
|
9662
|
-
className: cn(
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
hasError &&
|
|
10281
|
+
className: classNameDefault ? cn(
|
|
10282
|
+
formControlBase,
|
|
10283
|
+
formInputVariants[variant],
|
|
10284
|
+
triggerSizeClass,
|
|
10285
|
+
hasError && formControlErrorClass,
|
|
9667
10286
|
className
|
|
9668
|
-
),
|
|
10287
|
+
) : className,
|
|
9669
10288
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValue, { placeholder })
|
|
9670
10289
|
}
|
|
9671
10290
|
),
|
|
9672
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
9673
|
-
|
|
10291
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10292
|
+
SelectContent,
|
|
9674
10293
|
{
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
className: cn(
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
10294
|
+
position,
|
|
10295
|
+
sideOffset: 6,
|
|
10296
|
+
className: cn(
|
|
10297
|
+
contentBase,
|
|
10298
|
+
contentViewport,
|
|
10299
|
+
"w-(--radix-select-trigger-width) min-w-(--radix-select-trigger-width) overflow-hidden!",
|
|
10300
|
+
contentClassName
|
|
10301
|
+
),
|
|
10302
|
+
onWheelCapture: (event) => {
|
|
10303
|
+
event.stopPropagation();
|
|
10304
|
+
},
|
|
10305
|
+
onTouchMoveCapture: (event) => {
|
|
10306
|
+
event.stopPropagation();
|
|
10307
|
+
},
|
|
10308
|
+
children: children != null ? children : items == null ? void 0 : items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10309
|
+
SelectItem,
|
|
10310
|
+
{
|
|
10311
|
+
value: item.value,
|
|
10312
|
+
disabled: item.disabled,
|
|
10313
|
+
className: cn(sizeClasses.selectItem, itemClassName),
|
|
10314
|
+
children: item.label
|
|
10315
|
+
},
|
|
10316
|
+
item.value
|
|
10317
|
+
))
|
|
10318
|
+
}
|
|
10319
|
+
)
|
|
9682
10320
|
]
|
|
9683
10321
|
}
|
|
9684
10322
|
),
|
|
@@ -9686,7 +10324,11 @@ function UiSelect({
|
|
|
9686
10324
|
"p",
|
|
9687
10325
|
{
|
|
9688
10326
|
id: messageId,
|
|
9689
|
-
className: cn(
|
|
10327
|
+
className: cn(
|
|
10328
|
+
"font-medium text-destructive",
|
|
10329
|
+
sizeClasses.message,
|
|
10330
|
+
messageClassName
|
|
10331
|
+
),
|
|
9690
10332
|
children: errorMessage
|
|
9691
10333
|
}
|
|
9692
10334
|
) : null
|
|
@@ -9694,10 +10336,10 @@ function UiSelect({
|
|
|
9694
10336
|
}
|
|
9695
10337
|
|
|
9696
10338
|
// src/components/ui/ui-checkbox.tsx
|
|
9697
|
-
var
|
|
10339
|
+
var React73 = __toESM(require("react"), 1);
|
|
9698
10340
|
var import_lucide_react10 = require("lucide-react");
|
|
9699
10341
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
9700
|
-
var UiCheckbox =
|
|
10342
|
+
var UiCheckbox = React73.forwardRef(
|
|
9701
10343
|
(_a, ref) => {
|
|
9702
10344
|
var _b = _a, {
|
|
9703
10345
|
label,
|
|
@@ -9802,18 +10444,18 @@ var UiCheckbox = React74.forwardRef(
|
|
|
9802
10444
|
UiCheckbox.displayName = "UiCheckbox";
|
|
9803
10445
|
|
|
9804
10446
|
// src/hooks/use-sidebar.tsx
|
|
9805
|
-
var
|
|
10447
|
+
var import_react32 = require("react");
|
|
9806
10448
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
9807
|
-
var SidebarContext = (0,
|
|
10449
|
+
var SidebarContext = (0, import_react32.createContext)({
|
|
9808
10450
|
isMinimized: false,
|
|
9809
10451
|
toggle: () => {
|
|
9810
10452
|
}
|
|
9811
10453
|
});
|
|
9812
|
-
var useSidebar = () => (0,
|
|
10454
|
+
var useSidebar = () => (0, import_react32.useContext)(SidebarContext);
|
|
9813
10455
|
var SidebarProvider = ({
|
|
9814
10456
|
children
|
|
9815
10457
|
}) => {
|
|
9816
|
-
const [isMinimized, setIsMinimized] = (0,
|
|
10458
|
+
const [isMinimized, setIsMinimized] = (0, import_react32.useState)(false);
|
|
9817
10459
|
const toggle = () => {
|
|
9818
10460
|
setIsMinimized(!isMinimized);
|
|
9819
10461
|
};
|
|
@@ -9861,7 +10503,7 @@ var AlertModal = ({
|
|
|
9861
10503
|
|
|
9862
10504
|
// src/shared/breadcrumbs.tsx
|
|
9863
10505
|
var import_lucide_react11 = require("lucide-react");
|
|
9864
|
-
var
|
|
10506
|
+
var import_react33 = require("react");
|
|
9865
10507
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
9866
10508
|
function Breadcrumbs({
|
|
9867
10509
|
items,
|
|
@@ -9872,7 +10514,7 @@ function Breadcrumbs({
|
|
|
9872
10514
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Breadcrumb, { className, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BreadcrumbList, { className: classNameList, children: items.map((item, index) => {
|
|
9873
10515
|
var _a;
|
|
9874
10516
|
const isLast = index === items.length - 1;
|
|
9875
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
10517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react33.Fragment, { children: [
|
|
9876
10518
|
!isLast ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BreadcrumbItem, { className: item.className, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BreadcrumbLink, { href: (_a = item.link) != null ? _a : "#", children: item.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BreadcrumbItem, { className: item.className, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BreadcrumbPage, { children: item.title }) }),
|
|
9877
10519
|
!isLast ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BreadcrumbSeparator, { children: separator }) : null
|
|
9878
10520
|
] }, `${item.title}-${index}`);
|
|
@@ -9880,7 +10522,7 @@ function Breadcrumbs({
|
|
|
9880
10522
|
}
|
|
9881
10523
|
|
|
9882
10524
|
// src/shared/data-table.tsx
|
|
9883
|
-
var
|
|
10525
|
+
var import_react34 = require("react");
|
|
9884
10526
|
var import_framer_motion = require("framer-motion");
|
|
9885
10527
|
var import_react_icons19 = require("@radix-ui/react-icons");
|
|
9886
10528
|
var import_react_table = require("@tanstack/react-table");
|
|
@@ -10122,7 +10764,7 @@ function DataTable({
|
|
|
10122
10764
|
const safePageCount = Math.max(pageCount != null ? pageCount : 1, 1);
|
|
10123
10765
|
const pageIndex = Math.min(Math.max(page - 1, 0), safePageCount - 1);
|
|
10124
10766
|
const pageSize = Math.max(perPage, 1);
|
|
10125
|
-
const paginationState = (0,
|
|
10767
|
+
const paginationState = (0, import_react34.useMemo)(
|
|
10126
10768
|
() => ({ pageIndex, pageSize }),
|
|
10127
10769
|
[pageIndex, pageSize]
|
|
10128
10770
|
);
|
|
@@ -10139,7 +10781,7 @@ function DataTable({
|
|
|
10139
10781
|
autoResetPageIndex: false
|
|
10140
10782
|
});
|
|
10141
10783
|
const clickable = !!onClick;
|
|
10142
|
-
const pageKey = (0,
|
|
10784
|
+
const pageKey = (0, import_react34.useMemo)(
|
|
10143
10785
|
() => `${pageIndex}-${pageSize}-${data.length}`,
|
|
10144
10786
|
[pageIndex, pageSize, data.length]
|
|
10145
10787
|
);
|
|
@@ -10154,7 +10796,7 @@ function DataTable({
|
|
|
10154
10796
|
onPageSizeChange == null ? void 0 : onPageSizeChange(size);
|
|
10155
10797
|
onPageChange == null ? void 0 : onPageChange(1);
|
|
10156
10798
|
};
|
|
10157
|
-
const ui = (0,
|
|
10799
|
+
const ui = (0, import_react34.useMemo)(() => {
|
|
10158
10800
|
var _a;
|
|
10159
10801
|
const builtIn = (_a = DATA_TABLE_TEMPLATES[template]) != null ? _a : DATA_TABLE_TEMPLATES.neo;
|
|
10160
10802
|
return mergeSlots(DATA_TABLE_TEMPLATES.neo, builtIn, classNames);
|
|
@@ -10287,7 +10929,7 @@ function DataTable({
|
|
|
10287
10929
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectValue, { placeholder: `${pageSize}` })
|
|
10288
10930
|
}
|
|
10289
10931
|
),
|
|
10290
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectContent, {
|
|
10932
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectContent, { children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectItem, { value: `${size}`, children: size }, size)) })
|
|
10291
10933
|
]
|
|
10292
10934
|
}
|
|
10293
10935
|
)
|
|
@@ -10458,7 +11100,7 @@ function Dropzone({
|
|
|
10458
11100
|
// src/shared/fileupload.tsx
|
|
10459
11101
|
var import_react_icons20 = require("@radix-ui/react-icons");
|
|
10460
11102
|
var import_lucide_react13 = require("lucide-react");
|
|
10461
|
-
var
|
|
11103
|
+
var import_react35 = require("react");
|
|
10462
11104
|
var import_react_dropzone2 = require("react-dropzone");
|
|
10463
11105
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
10464
11106
|
function FileUpload({
|
|
@@ -10495,8 +11137,8 @@ function FileUpload({
|
|
|
10495
11137
|
) });
|
|
10496
11138
|
}
|
|
10497
11139
|
function ImagePreview({ file }) {
|
|
10498
|
-
const [objectUrl, setObjectUrl] = (0,
|
|
10499
|
-
(0,
|
|
11140
|
+
const [objectUrl, setObjectUrl] = (0, import_react35.useState)(null);
|
|
11141
|
+
(0, import_react35.useEffect)(() => {
|
|
10500
11142
|
const url = URL.createObjectURL(file);
|
|
10501
11143
|
setObjectUrl(url);
|
|
10502
11144
|
return () => {
|
|
@@ -10812,8 +11454,6 @@ function PaginationSection({
|
|
|
10812
11454
|
SelectGroup,
|
|
10813
11455
|
SelectItem,
|
|
10814
11456
|
SelectLabel,
|
|
10815
|
-
SelectScrollDownButton,
|
|
10816
|
-
SelectScrollUpButton,
|
|
10817
11457
|
SelectSeparator,
|
|
10818
11458
|
SelectTrigger,
|
|
10819
11459
|
SelectValue,
|
|
@@ -10868,9 +11508,18 @@ function PaginationSection({
|
|
|
10868
11508
|
badgeVariants,
|
|
10869
11509
|
buttonVariants,
|
|
10870
11510
|
cn,
|
|
11511
|
+
formCompositeControlBase,
|
|
11512
|
+
formCompositeControlErrorClass,
|
|
11513
|
+
formCompositeVariants,
|
|
11514
|
+
formControlBase,
|
|
11515
|
+
formControlErrorClass,
|
|
11516
|
+
formInputVariants,
|
|
11517
|
+
formSizeVariants,
|
|
10871
11518
|
getDefaultOptionLabel,
|
|
10872
11519
|
getDefaultOptionValue,
|
|
10873
11520
|
getErrorMessage,
|
|
11521
|
+
getFormControlSizeClass,
|
|
11522
|
+
getFormSizeClasses,
|
|
10874
11523
|
getNextEnabledIndex,
|
|
10875
11524
|
iconButtonVariants,
|
|
10876
11525
|
navigationMenuTriggerStyle,
|
|
@@ -10880,5 +11529,6 @@ function PaginationSection({
|
|
|
10880
11529
|
toggleVariants,
|
|
10881
11530
|
useFormField,
|
|
10882
11531
|
useSidebar,
|
|
10883
|
-
useToast
|
|
11532
|
+
useToast,
|
|
11533
|
+
variants
|
|
10884
11534
|
});
|