akeyless-client-commons 1.1.97 → 1.1.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.css +94 -38
- package/dist/components/index.css.map +1 -1
- package/dist/components/index.d.mts +7 -3
- package/dist/components/index.d.ts +7 -3
- package/dist/components/index.js +161 -146
- package/dist/components/index.mjs +160 -145
- package/dist/types/index.d.mts +5 -1
- package/dist/types/index.d.ts +5 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -5975,7 +5975,7 @@ function useDeepCompareEffect(effect, dependencies) {
|
|
|
5975
5975
|
}
|
|
5976
5976
|
// src/components/forms/ModularForm/formElements.tsx
|
|
5977
5977
|
var import_react15 = require("react");
|
|
5978
|
-
var
|
|
5978
|
+
var import_react_aria_components3 = require("react-aria-components");
|
|
5979
5979
|
// src/components/forms/ModularForm/InternationalPhonePicker.tsx
|
|
5980
5980
|
var import_lucide_react5 = require("lucide-react");
|
|
5981
5981
|
var import_react13 = require("react");
|
|
@@ -6166,7 +6166,7 @@ var FlagComponent = function(param) {
|
|
|
6166
6166
|
});
|
|
6167
6167
|
};
|
|
6168
6168
|
// src/components/forms/ModularForm/formElements.tsx
|
|
6169
|
-
var
|
|
6169
|
+
var import_react_aria_components4 = require("react-aria-components");
|
|
6170
6170
|
// src/components/ui/datefield-rac.tsx
|
|
6171
6171
|
var import_react_aria_components = require("react-aria-components");
|
|
6172
6172
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -6200,10 +6200,89 @@ function DateInput(_param) {
|
|
|
6200
6200
|
}
|
|
6201
6201
|
}));
|
|
6202
6202
|
}
|
|
6203
|
-
// src/components/
|
|
6204
|
-
var import_lucide_react6 = require("lucide-react");
|
|
6203
|
+
// src/components/ui/calendar-rac.tsx
|
|
6205
6204
|
var import_date = require("@internationalized/date");
|
|
6205
|
+
var import_lucide_react6 = require("lucide-react");
|
|
6206
|
+
var import_react_aria_components2 = require("react-aria-components");
|
|
6206
6207
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6208
|
+
function CalendarHeader() {
|
|
6209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("header", {
|
|
6210
|
+
className: "flex w-full items-center gap-1 pb-1",
|
|
6211
|
+
children: [
|
|
6212
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.Button, {
|
|
6213
|
+
className: "flex size-9 items-center justify-center rounded-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:bg-accent hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
6214
|
+
slot: "previous",
|
|
6215
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react6.ChevronLeftIcon, {
|
|
6216
|
+
size: 16
|
|
6217
|
+
})
|
|
6218
|
+
}),
|
|
6219
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.Heading, {
|
|
6220
|
+
className: "grow text-center font-medium text-sm"
|
|
6221
|
+
}),
|
|
6222
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.Button, {
|
|
6223
|
+
className: "flex size-9 items-center justify-center rounded-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:bg-accent hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
6224
|
+
slot: "next",
|
|
6225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react6.ChevronRightIcon, {
|
|
6226
|
+
size: 16
|
|
6227
|
+
})
|
|
6228
|
+
})
|
|
6229
|
+
]
|
|
6230
|
+
});
|
|
6231
|
+
}
|
|
6232
|
+
function CalendarGridComponent(param) {
|
|
6233
|
+
var _param_isRange = param.isRange, isRange = _param_isRange === void 0 ? false : _param_isRange, selectedDayClassName = param.selectedDayClassName, todayDayClassName = param.todayDayClassName;
|
|
6234
|
+
var now = (0, import_date.today)((0, import_date.getLocalTimeZone)());
|
|
6235
|
+
var resolvedSelectedDayClassName = (selectedDayClassName === null || selectedDayClassName === void 0 ? void 0 : selectedDayClassName.trim()) ? selectedDayClassName : "bg-blue-600 text-white";
|
|
6236
|
+
var resolvedTodayDayClassName = (todayDayClassName === null || todayDayClassName === void 0 ? void 0 : todayDayClassName.trim()) ? todayDayClassName : "bg-sky-200 text-sky-950";
|
|
6237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_aria_components2.CalendarGrid, {
|
|
6238
|
+
children: [
|
|
6239
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.CalendarGridHeader, {
|
|
6240
|
+
children: function(day) {
|
|
6241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.CalendarHeaderCell, {
|
|
6242
|
+
className: "size-9 rounded-md p-0 font-medium text-muted-foreground/80 text-xs",
|
|
6243
|
+
children: day
|
|
6244
|
+
});
|
|
6245
|
+
}
|
|
6246
|
+
}),
|
|
6247
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.CalendarGridBody, {
|
|
6248
|
+
className: "[&_td]:px-0 [&_td]:py-px",
|
|
6249
|
+
children: function(date) {
|
|
6250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.CalendarCell, {
|
|
6251
|
+
className: (0, import_react_aria_components2.composeRenderProps)(void 0, function(_className, renderProps) {
|
|
6252
|
+
return cn("relative flex size-9 items-center justify-center whitespace-nowrap rounded-md p-0 font-normal text-foreground text-sm outline-none duration-150 [transition-property:color,background-color,border-radius,box-shadow]", "data-[disabled]:pointer-events-none data-[unavailable]:pointer-events-none data-[focus-visible]:z-10 data-[hovered]:bg-accent data-[hovered]:text-foreground data-[unavailable]:line-through data-[disabled]:opacity-30 data-[unavailable]:opacity-30 data-[focus-visible]:ring-[3px] data-[focus-visible]:ring-ring/50", // Single date calendar selected/today styles (props-driven)
|
|
6253
|
+
!isRange && (renderProps === null || renderProps === void 0 ? void 0 : renderProps.isSelected) && !(renderProps === null || renderProps === void 0 ? void 0 : renderProps.isDisabled) && resolvedSelectedDayClassName, !isRange && date.compare(now) === 0 && !(renderProps === null || renderProps === void 0 ? void 0 : renderProps.isSelected) && !(renderProps === null || renderProps === void 0 ? void 0 : renderProps.isDisabled) && resolvedTodayDayClassName, // Range-specific styles (fixed Tailwind data-* variant syntax)
|
|
6254
|
+
isRange && "data-[invalid]:data-[selection-end]:bg-destructive data-[invalid]:data-[selection-start]:bg-destructive data-[invalid]:data-[selection-end]:text-white data-[invalid]:data-[selection-start]:text-white data-[selected]:rounded-none data-[selection-start]:rounded-s-md data-[selection-end]:rounded-e-md data-[invalid]:bg-red-100 data-[selected]:bg-accent data-[selection-end]:bg-primary data-[selection-start]:bg-primary data-[selected]:text-foreground data-[selection-end]:text-primary-foreground data-[selection-start]:text-primary-foreground");
|
|
6255
|
+
}),
|
|
6256
|
+
date: date
|
|
6257
|
+
});
|
|
6258
|
+
}
|
|
6259
|
+
})
|
|
6260
|
+
]
|
|
6261
|
+
});
|
|
6262
|
+
}
|
|
6263
|
+
function Calendar(_param) {
|
|
6264
|
+
var className = _param.className, selectedDayClassName = _param.selectedDayClassName, todayDayClassName = _param.todayDayClassName, props = _object_without_properties(_param, [
|
|
6265
|
+
"className",
|
|
6266
|
+
"selectedDayClassName",
|
|
6267
|
+
"todayDayClassName"
|
|
6268
|
+
]);
|
|
6269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_aria_components2.Calendar, _object_spread_props(_object_spread({}, props), {
|
|
6270
|
+
className: (0, import_react_aria_components2.composeRenderProps)(className, function(className2) {
|
|
6271
|
+
return cn("w-fit", className2);
|
|
6272
|
+
}),
|
|
6273
|
+
children: [
|
|
6274
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CalendarHeader, {}),
|
|
6275
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CalendarGridComponent, {
|
|
6276
|
+
selectedDayClassName: selectedDayClassName,
|
|
6277
|
+
todayDayClassName: todayDayClassName
|
|
6278
|
+
})
|
|
6279
|
+
]
|
|
6280
|
+
}));
|
|
6281
|
+
}
|
|
6282
|
+
// src/components/forms/ModularForm/formElements.tsx
|
|
6283
|
+
var import_lucide_react7 = require("lucide-react");
|
|
6284
|
+
var import_date2 = require("@internationalized/date");
|
|
6285
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
6207
6286
|
var defaultFormElementContainerClassName = "flex justify-start items-center gap-3 w-full";
|
|
6208
6287
|
var defaultFormElementBorderClassName = "border-[1px] border-gray-300 hover:border-black rounded-sm";
|
|
6209
6288
|
var useSortValues = function(options, sortDirection, sortAsNumber) {
|
|
@@ -6261,8 +6340,8 @@ var InputContainer = function(param) {
|
|
|
6261
6340
|
labelStyle,
|
|
6262
6341
|
elementsCommonClassName
|
|
6263
6342
|
]);
|
|
6264
|
-
return /* @__PURE__ */ (0,
|
|
6265
|
-
children: /* @__PURE__ */ (0,
|
|
6343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6344
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, props), {
|
|
6266
6345
|
title: title,
|
|
6267
6346
|
minLength: minLength,
|
|
6268
6347
|
placeholder: placeholder,
|
|
@@ -6281,7 +6360,7 @@ var InputContainer = function(param) {
|
|
|
6281
6360
|
}));
|
|
6282
6361
|
};
|
|
6283
6362
|
var DateInputContainer = function(param) {
|
|
6284
|
-
var _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_labelContent = param.labelContent, labelContent = _param_labelContent === void 0 ? "" : _param_labelContent, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_labelClassName = param.labelClassName, labelClassName = _param_labelClassName === void 0 ? "" : _param_labelClassName, _param_elementClassName = param.elementClassName, elementClassName = _param_elementClassName === void 0 ? "" : _param_elementClassName, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, placeholder = param.placeholder, props = param.props, onKeyDown = param.onKeyDown, onChange = param.onChange, direction = param.direction, value = param.value, labelWithDots = param.labelWithDots, labelsCommonClassName = param.labelsCommonClassName, elementsCommonClassName = param.elementsCommonClassName, title = param.title, labelStyle = param.labelStyle,
|
|
6363
|
+
var _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_labelContent = param.labelContent, labelContent = _param_labelContent === void 0 ? "" : _param_labelContent, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_labelClassName = param.labelClassName, labelClassName = _param_labelClassName === void 0 ? "" : _param_labelClassName, _param_elementClassName = param.elementClassName, elementClassName = _param_elementClassName === void 0 ? "" : _param_elementClassName, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, placeholder = param.placeholder, props = param.props, onKeyDown = param.onKeyDown, onChange = param.onChange, direction = param.direction, value = param.value, labelWithDots = param.labelWithDots, labelsCommonClassName = param.labelsCommonClassName, elementsCommonClassName = param.elementsCommonClassName, title = param.title, labelStyle = param.labelStyle, _param_calendarClassName = param.calendarClassName, calendarClassName = _param_calendarClassName === void 0 ? "" : _param_calendarClassName, _param_inputClassName = param.inputClassName, inputClassName = _param_inputClassName === void 0 ? "" : _param_inputClassName, _param_selectedDayClassName = param.selectedDayClassName, selectedDayClassName = _param_selectedDayClassName === void 0 ? "" : _param_selectedDayClassName, _param_todayDayClassName = param.todayDayClassName, todayDayClassName = _param_todayDayClassName === void 0 ? "" : _param_todayDayClassName;
|
|
6285
6364
|
var containerProps = (0, import_react15.useMemo)(function() {
|
|
6286
6365
|
return {
|
|
6287
6366
|
containerClassName: containerClassName,
|
|
@@ -6310,12 +6389,12 @@ var DateInputContainer = function(param) {
|
|
|
6310
6389
|
var getDefaultValue = function(dateStr) {
|
|
6311
6390
|
if (dateStr) {
|
|
6312
6391
|
try {
|
|
6313
|
-
return (0,
|
|
6392
|
+
return (0, import_date2.parseDate)(dateStr);
|
|
6314
6393
|
} catch (e) {
|
|
6315
|
-
return (0,
|
|
6394
|
+
return (0, import_date2.today)((0, import_date2.getLocalTimeZone)());
|
|
6316
6395
|
}
|
|
6317
6396
|
}
|
|
6318
|
-
return (0,
|
|
6397
|
+
return (0, import_date2.today)((0, import_date2.getLocalTimeZone)());
|
|
6319
6398
|
};
|
|
6320
6399
|
var handleDateChange = (0, import_react15.useCallback)(function(date) {
|
|
6321
6400
|
if (!onChange) {
|
|
@@ -6335,10 +6414,11 @@ var DateInputContainer = function(param) {
|
|
|
6335
6414
|
]);
|
|
6336
6415
|
var pickerValue = value ? getDefaultValue(value) : void 0;
|
|
6337
6416
|
var pickerDefaultValue = !pickerValue && defaultValue ? getDefaultValue(defaultValue) : void 0;
|
|
6338
|
-
return /* @__PURE__ */ (0,
|
|
6339
|
-
children: /* @__PURE__ */ (0,
|
|
6417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_aria_components3.I18nProvider, {
|
|
6340
6419
|
locale: "en-GB",
|
|
6341
|
-
children: /* @__PURE__ */ (0,
|
|
6420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react_aria_components4.DatePicker, {
|
|
6421
|
+
placeholderValue: placeholder ? (0, import_date2.parseDate)(placeholder) : void 0,
|
|
6342
6422
|
className: cn("flex items-center gap-2 flex-1", elementClassName),
|
|
6343
6423
|
name: name,
|
|
6344
6424
|
defaultValue: pickerDefaultValue,
|
|
@@ -6346,13 +6426,13 @@ var DateInputContainer = function(param) {
|
|
|
6346
6426
|
onChange: handleDateChange,
|
|
6347
6427
|
onKeyDown: onKeyDown,
|
|
6348
6428
|
children: [
|
|
6349
|
-
/* @__PURE__ */ (0,
|
|
6429
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
6350
6430
|
title: title,
|
|
6351
6431
|
className: cn("flex flex-1"),
|
|
6352
6432
|
children: [
|
|
6353
|
-
/* @__PURE__ */ (0,
|
|
6433
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_aria_components4.Group, {
|
|
6354
6434
|
className: cn("flex-1 bg-background", defaultFormElementBorderClassName),
|
|
6355
|
-
children: /* @__PURE__ */ (0,
|
|
6435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DateInput, _object_spread_props(_object_spread({}, props), {
|
|
6356
6436
|
unstyled: true,
|
|
6357
6437
|
style: {
|
|
6358
6438
|
direction: "ltr"
|
|
@@ -6360,21 +6440,23 @@ var DateInputContainer = function(param) {
|
|
|
6360
6440
|
className: cn("flex-1 h-9 px-3 py-2 text-sm", direction === "rtl" ? "justify-end text-right" : "justify-start text-left", inputClassName)
|
|
6361
6441
|
}))
|
|
6362
6442
|
}),
|
|
6363
|
-
/* @__PURE__ */ (0,
|
|
6443
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_aria_components4.Button, {
|
|
6364
6444
|
className: "-ms-9 -me-px z-10 flex w-9 items-center justify-center rounded-e-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:text-foreground data-focus-visible:border-ring data-focus-visible:ring-[3px] data-focus-visible:ring-ring/50",
|
|
6365
|
-
children: /* @__PURE__ */ (0,
|
|
6445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.CalendarIcon, {
|
|
6366
6446
|
size: 16
|
|
6367
6447
|
})
|
|
6368
6448
|
})
|
|
6369
6449
|
]
|
|
6370
6450
|
}),
|
|
6371
|
-
/* @__PURE__ */ (0,
|
|
6451
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_aria_components4.Popover, {
|
|
6372
6452
|
className: "data-[entering]:fade-in-0 data-[entering]:zoom-in-95 data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95 data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2 z-50 rounded-lg border bg-background text-popover-foreground shadow-lg outline-hidden data-entering:animate-in data-exiting:animate-out",
|
|
6373
6453
|
offset: 4,
|
|
6374
|
-
children: /* @__PURE__ */ (0,
|
|
6454
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_aria_components4.Dialog, {
|
|
6375
6455
|
className: "max-h-[inherit] overflow-auto p-2",
|
|
6376
|
-
children: /* @__PURE__ */ (0,
|
|
6377
|
-
|
|
6456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Calendar, {
|
|
6457
|
+
selectedDayClassName: selectedDayClassName,
|
|
6458
|
+
todayDayClassName: todayDayClassName,
|
|
6459
|
+
className: cn("bg-white", calendarClassName)
|
|
6378
6460
|
})
|
|
6379
6461
|
})
|
|
6380
6462
|
})
|
|
@@ -6419,8 +6501,8 @@ var SelectContainer = function(param) {
|
|
|
6419
6501
|
labelStyle,
|
|
6420
6502
|
elementsCommonClassName
|
|
6421
6503
|
]);
|
|
6422
|
-
return /* @__PURE__ */ (0,
|
|
6423
|
-
children: /* @__PURE__ */ (0,
|
|
6504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
6424
6506
|
title: title,
|
|
6425
6507
|
style: {
|
|
6426
6508
|
direction: direction
|
|
@@ -6430,21 +6512,21 @@ var SelectContainer = function(param) {
|
|
|
6430
6512
|
return setIsOpen(!isOpen);
|
|
6431
6513
|
},
|
|
6432
6514
|
children: [
|
|
6433
|
-
/* @__PURE__ */ (0,
|
|
6515
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6434
6516
|
className: cn("h-9 max-h-9 py-2 px-3 flex items-center justify-center cursor-pointer", defaultFormElementBorderClassName, selectClassName),
|
|
6435
6517
|
children: ((_options_find = options.find(function(opt) {
|
|
6436
6518
|
return opt.value === selectedValue;
|
|
6437
6519
|
})) === null || _options_find === void 0 ? void 0 : _options_find.label) || selectedValue
|
|
6438
6520
|
}),
|
|
6439
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
6521
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", {
|
|
6440
6522
|
className: cn("fa-light fa-chevron-up absolute top-3 ".concat(direction === "ltr" ? "right-2" : "left-2", " cursor-pointer"), iconClassName)
|
|
6441
|
-
}) : /* @__PURE__ */ (0,
|
|
6523
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", {
|
|
6442
6524
|
className: cn("fa-light fa-chevron-down absolute top-3 ".concat(direction === "ltr" ? "right-2" : "left-2", " cursor-pointer"), iconClassName)
|
|
6443
6525
|
}),
|
|
6444
|
-
isOpen && /* @__PURE__ */ (0,
|
|
6526
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6445
6527
|
className: cn("absolute w-full bg-white border border-gray-300 max-h-32 overflow-y-auto z-10", optionsContainerClassName),
|
|
6446
6528
|
children: sortOptions.map(function(option) {
|
|
6447
|
-
return /* @__PURE__ */ (0,
|
|
6529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6448
6530
|
className: "p-2 cursor-pointer hover:bg-gray-200 ".concat(optionClassName),
|
|
6449
6531
|
onClick: function() {
|
|
6450
6532
|
return handleOptionClick(option.value);
|
|
@@ -6453,7 +6535,7 @@ var SelectContainer = function(param) {
|
|
|
6453
6535
|
}, option.value);
|
|
6454
6536
|
})
|
|
6455
6537
|
}),
|
|
6456
|
-
/* @__PURE__ */ (0,
|
|
6538
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", {
|
|
6457
6539
|
value: selectedValue,
|
|
6458
6540
|
type: "hidden",
|
|
6459
6541
|
name: name,
|
|
@@ -6492,8 +6574,8 @@ function MultiSelect(param) {
|
|
|
6492
6574
|
labelStyle,
|
|
6493
6575
|
elementsCommonClassName
|
|
6494
6576
|
]);
|
|
6495
|
-
return /* @__PURE__ */ (0,
|
|
6496
|
-
children: /* @__PURE__ */ (0,
|
|
6577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6578
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(multiselect_default, {
|
|
6497
6579
|
closeDropdownOnSelect: closeDropdownOnSelect,
|
|
6498
6580
|
commandProps: {
|
|
6499
6581
|
label: placeholder
|
|
@@ -6515,7 +6597,7 @@ function MultiSelect(param) {
|
|
|
6515
6597
|
className: cn(defaultFormElementBorderClassName, styles.className),
|
|
6516
6598
|
dropdownClassName: styles.dropdownClassName,
|
|
6517
6599
|
dropdownOptionClassName: styles.dropdownOptionClassName,
|
|
6518
|
-
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0,
|
|
6600
|
+
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", {
|
|
6519
6601
|
className: "text-center text-sm",
|
|
6520
6602
|
children: "all options selected."
|
|
6521
6603
|
}),
|
|
@@ -6553,8 +6635,8 @@ var SelectWithSearch = function(param) {
|
|
|
6553
6635
|
labelStyle,
|
|
6554
6636
|
elementsCommonClassName
|
|
6555
6637
|
]);
|
|
6556
|
-
return /* @__PURE__ */ (0,
|
|
6557
|
-
children: /* @__PURE__ */ (0,
|
|
6638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6639
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SearchSelect, {
|
|
6558
6640
|
direction: direction,
|
|
6559
6641
|
createNewOptionLabel: createNewOptionLabel,
|
|
6560
6642
|
createNewOptionContainerClassName: createNewOptionContainerClassName,
|
|
@@ -6605,8 +6687,8 @@ var TextAreaContainer = function(param) {
|
|
|
6605
6687
|
labelStyle,
|
|
6606
6688
|
elementsCommonClassName
|
|
6607
6689
|
]);
|
|
6608
|
-
return /* @__PURE__ */ (0,
|
|
6609
|
-
children: /* @__PURE__ */ (0,
|
|
6690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("textarea", _object_spread_props(_object_spread({}, props), {
|
|
6610
6692
|
defaultValue: value ? void 0 : defaultValue,
|
|
6611
6693
|
value: defaultValue ? void 0 : value,
|
|
6612
6694
|
onChange: onChange,
|
|
@@ -6622,7 +6704,7 @@ var TextAreaContainer = function(param) {
|
|
|
6622
6704
|
};
|
|
6623
6705
|
var FormSeparator = function(param) {
|
|
6624
6706
|
var props = param.props, children = param.children;
|
|
6625
|
-
return /* @__PURE__ */ (0,
|
|
6707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", _object_spread_props(_object_spread({}, props), {
|
|
6626
6708
|
className: cn("border-b-[1px] border-gray-300 h-[1px]", props === null || props === void 0 ? void 0 : props.className),
|
|
6627
6709
|
children: children
|
|
6628
6710
|
}));
|
|
@@ -6654,8 +6736,8 @@ var CheckboxContainer = function(param) {
|
|
|
6654
6736
|
labelStyle,
|
|
6655
6737
|
elementsCommonClassName
|
|
6656
6738
|
]);
|
|
6657
|
-
return /* @__PURE__ */ (0,
|
|
6658
|
-
children: /* @__PURE__ */ (0,
|
|
6739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6740
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Checkbox, {
|
|
6659
6741
|
id: id,
|
|
6660
6742
|
name: name,
|
|
6661
6743
|
checked: checked,
|
|
@@ -6719,21 +6801,21 @@ var DurationPicker = function(param) {
|
|
|
6719
6801
|
onChange === null || onChange === void 0 ? void 0 : onChange(durationToSeconds(update));
|
|
6720
6802
|
};
|
|
6721
6803
|
};
|
|
6722
|
-
return /* @__PURE__ */ (0,
|
|
6723
|
-
children: /* @__PURE__ */ (0,
|
|
6804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6805
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
6724
6806
|
title: title,
|
|
6725
6807
|
className: cn("flex gap-1.5 text-sm", elementClassName),
|
|
6726
6808
|
dir: "ltr",
|
|
6727
6809
|
children: [
|
|
6728
6810
|
Array.from(new Set(options)).map(function(field) {
|
|
6729
|
-
return /* @__PURE__ */ (0,
|
|
6811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
6730
6812
|
className: "flex flex-col border p-0.5 rounded-md",
|
|
6731
6813
|
children: [
|
|
6732
|
-
!hideLabels && /* @__PURE__ */ (0,
|
|
6814
|
+
!hideLabels && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("label", {
|
|
6733
6815
|
className: "mb-1 ps-1 capitalize text-start border-b-[1px] border-b-gray-300",
|
|
6734
6816
|
children: field.slice(0, 1)
|
|
6735
6817
|
}),
|
|
6736
|
-
/* @__PURE__ */ (0,
|
|
6818
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", {
|
|
6737
6819
|
type: "number",
|
|
6738
6820
|
inputMode: "numeric",
|
|
6739
6821
|
min: 0,
|
|
@@ -6751,7 +6833,7 @@ var DurationPicker = function(param) {
|
|
|
6751
6833
|
]
|
|
6752
6834
|
}, field);
|
|
6753
6835
|
}),
|
|
6754
|
-
/* @__PURE__ */ (0,
|
|
6836
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", {
|
|
6755
6837
|
name: name,
|
|
6756
6838
|
type: "hidden",
|
|
6757
6839
|
value: durationToSeconds(duration)
|
|
@@ -6762,10 +6844,10 @@ var DurationPicker = function(param) {
|
|
|
6762
6844
|
};
|
|
6763
6845
|
var FormElementContainer = function(param) {
|
|
6764
6846
|
var containerClassName = param.containerClassName, direction = param.direction, labelClassName = param.labelClassName, labelContent = param.labelContent, labelWithDots = param.labelWithDots, labelsCommonClassName = param.labelsCommonClassName, name = param.name, required = param.required, children = param.children, _param_defaultContainerClassName = param.defaultContainerClassName, defaultContainerClassName = _param_defaultContainerClassName === void 0 ? true : _param_defaultContainerClassName, _param_elementsCommonClassName = param.elementsCommonClassName, elementsCommonClassName = _param_elementsCommonClassName === void 0 ? "" : _param_elementsCommonClassName, labelStyle = param.labelStyle;
|
|
6765
|
-
return /* @__PURE__ */ (0,
|
|
6847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
6766
6848
|
className: cn(defaultContainerClassName ? defaultFormElementContainerClassName : "", containerClassName, elementsCommonClassName),
|
|
6767
6849
|
children: [
|
|
6768
|
-
labelContent && /* @__PURE__ */ (0,
|
|
6850
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ElementLabel, {
|
|
6769
6851
|
labelStyle: labelStyle,
|
|
6770
6852
|
labelsCommonClassName: labelsCommonClassName,
|
|
6771
6853
|
withDots: labelWithDots,
|
|
@@ -6781,7 +6863,7 @@ var FormElementContainer = function(param) {
|
|
|
6781
6863
|
};
|
|
6782
6864
|
var ElementLabel = function(param) {
|
|
6783
6865
|
var labelContent = param.labelContent, labelClassName = param.labelClassName, name = param.name, required = param.required, _param_withDots = param.withDots, withDots = _param_withDots === void 0 ? false : _param_withDots, direction = param.direction, labelsCommonClassName = param.labelsCommonClassName, _param_labelStyle = param.labelStyle, labelStyle = _param_labelStyle === void 0 ? {} : _param_labelStyle;
|
|
6784
|
-
return /* @__PURE__ */ (0,
|
|
6866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", {
|
|
6785
6867
|
style: _object_spread({
|
|
6786
6868
|
direction: direction
|
|
6787
6869
|
}, labelStyle),
|
|
@@ -6790,11 +6872,11 @@ var ElementLabel = function(param) {
|
|
|
6790
6872
|
title: labelContent,
|
|
6791
6873
|
children: [
|
|
6792
6874
|
labelContent,
|
|
6793
|
-
required && /* @__PURE__ */ (0,
|
|
6875
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6794
6876
|
className: "text-red-500",
|
|
6795
6877
|
children: "*"
|
|
6796
6878
|
}),
|
|
6797
|
-
withDots && /* @__PURE__ */ (0,
|
|
6879
|
+
withDots && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6798
6880
|
children: ":"
|
|
6799
6881
|
})
|
|
6800
6882
|
]
|
|
@@ -6856,15 +6938,15 @@ var ElementsContainer = (0, import_react15.memo)(function(props) {
|
|
|
6856
6938
|
containerClassName,
|
|
6857
6939
|
elementProps
|
|
6858
6940
|
]);
|
|
6859
|
-
return /* @__PURE__ */ (0,
|
|
6941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
6860
6942
|
ref: containerRef,
|
|
6861
6943
|
className: cn("flex flex-col gap-1", className),
|
|
6862
6944
|
children: [
|
|
6863
|
-
headline && /* @__PURE__ */ (0,
|
|
6945
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6864
6946
|
className: cn("text-start text-primary font-bold border-b-[1px] border-gray-400 pb-0.5", headlineClassName),
|
|
6865
6947
|
children: headline
|
|
6866
6948
|
}),
|
|
6867
|
-
/* @__PURE__ */ (0,
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6868
6950
|
className: cn("flex flex-col gap-1.5", childrenContainerClassName),
|
|
6869
6951
|
children: enhancedChildren
|
|
6870
6952
|
})
|
|
@@ -6873,7 +6955,7 @@ var ElementsContainer = (0, import_react15.memo)(function(props) {
|
|
|
6873
6955
|
}, propsAreEqual);
|
|
6874
6956
|
ElementsContainer.displayName = "ElementsContainer";
|
|
6875
6957
|
// src/components/forms/ModularForm/ModularForm.tsx
|
|
6876
|
-
var
|
|
6958
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
6877
6959
|
var ModularForm = function(param) {
|
|
6878
6960
|
var _param_submitFunction = param.submitFunction, submitFunction = _param_submitFunction === void 0 ? /*#__PURE__*/ function() {
|
|
6879
6961
|
var _ref = _async_to_generator(function(form) {
|
|
@@ -6980,7 +7062,7 @@ var ModularForm = function(param) {
|
|
|
6980
7062
|
return _ref.apply(this, arguments);
|
|
6981
7063
|
};
|
|
6982
7064
|
}();
|
|
6983
|
-
return /* @__PURE__ */ (0,
|
|
7065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("form", {
|
|
6984
7066
|
ref: formRef,
|
|
6985
7067
|
onSubmit: onSubmit,
|
|
6986
7068
|
style: {
|
|
@@ -6988,79 +7070,79 @@ var ModularForm = function(param) {
|
|
|
6988
7070
|
},
|
|
6989
7071
|
className: cn("w-[350px] px-5 py-5 flex flex-col gap-4", className),
|
|
6990
7072
|
children: [
|
|
6991
|
-
headerContent && /* @__PURE__ */ (0,
|
|
7073
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
6992
7074
|
className: cn("border-b-2 border-[#547f22] pb-2 text-start font-bold text-[20px]", headerClassName),
|
|
6993
7075
|
children: headerContent
|
|
6994
7076
|
}),
|
|
6995
|
-
/* @__PURE__ */ (0,
|
|
7077
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
6996
7078
|
className: cn("w-full flex flex-col gap-5", elementsContainerClassName),
|
|
6997
7079
|
children: elements.map(function(element, index2) {
|
|
6998
7080
|
switch(element.type){
|
|
6999
7081
|
case "input":
|
|
7000
|
-
return /* @__PURE__ */ (0,
|
|
7082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InputContainer, _object_spread_props(_object_spread({
|
|
7001
7083
|
direction: direction
|
|
7002
7084
|
}, element), {
|
|
7003
7085
|
labelsCommonClassName: labelsCommonClassName,
|
|
7004
7086
|
elementsCommonClassName: elementsCommonClassName
|
|
7005
7087
|
}), index2);
|
|
7006
7088
|
case "dateInput":
|
|
7007
|
-
return /* @__PURE__ */ (0,
|
|
7089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DateInputContainer, _object_spread_props(_object_spread({
|
|
7008
7090
|
direction: direction
|
|
7009
7091
|
}, element), {
|
|
7010
7092
|
labelsCommonClassName: labelsCommonClassName,
|
|
7011
7093
|
elementsCommonClassName: elementsCommonClassName
|
|
7012
7094
|
}), index2);
|
|
7013
7095
|
case "textarea":
|
|
7014
|
-
return /* @__PURE__ */ (0,
|
|
7096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TextAreaContainer, _object_spread_props(_object_spread({
|
|
7015
7097
|
direction: element.direction || direction
|
|
7016
7098
|
}, element), {
|
|
7017
7099
|
labelsCommonClassName: labelsCommonClassName,
|
|
7018
7100
|
elementsCommonClassName: elementsCommonClassName
|
|
7019
7101
|
}), index2);
|
|
7020
7102
|
case "select":
|
|
7021
|
-
return /* @__PURE__ */ (0,
|
|
7103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SelectContainer, _object_spread_props(_object_spread({
|
|
7022
7104
|
direction: direction
|
|
7023
7105
|
}, element), {
|
|
7024
7106
|
labelsCommonClassName: labelsCommonClassName,
|
|
7025
7107
|
elementsCommonClassName: elementsCommonClassName
|
|
7026
7108
|
}), index2);
|
|
7027
7109
|
case "checkbox":
|
|
7028
|
-
return /* @__PURE__ */ (0,
|
|
7110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CheckboxContainer, _object_spread_props(_object_spread({
|
|
7029
7111
|
direction: direction
|
|
7030
7112
|
}, element), {
|
|
7031
7113
|
labelsCommonClassName: labelsCommonClassName,
|
|
7032
7114
|
elementsCommonClassName: elementsCommonClassName
|
|
7033
7115
|
}), index2);
|
|
7034
7116
|
case "multiSelect":
|
|
7035
|
-
return /* @__PURE__ */ (0,
|
|
7117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MultiSelect, _object_spread_props(_object_spread({
|
|
7036
7118
|
direction: direction
|
|
7037
7119
|
}, element), {
|
|
7038
7120
|
labelsCommonClassName: labelsCommonClassName,
|
|
7039
7121
|
elementsCommonClassName: elementsCommonClassName
|
|
7040
7122
|
}), index2);
|
|
7041
7123
|
case "selectWithSearch":
|
|
7042
|
-
return /* @__PURE__ */ (0,
|
|
7124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SelectWithSearch, _object_spread_props(_object_spread({
|
|
7043
7125
|
direction: direction
|
|
7044
7126
|
}, element), {
|
|
7045
7127
|
labelsCommonClassName: labelsCommonClassName,
|
|
7046
7128
|
elementsCommonClassName: elementsCommonClassName
|
|
7047
7129
|
}), index2);
|
|
7048
7130
|
case "internationalPhoneInput":
|
|
7049
|
-
return /* @__PURE__ */ (0,
|
|
7131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InternationalPhonePicker, _object_spread_props(_object_spread({
|
|
7050
7132
|
direction: direction
|
|
7051
7133
|
}, element), {
|
|
7052
7134
|
labelsCommonClassName: labelsCommonClassName,
|
|
7053
7135
|
elementsCommonClassName: elementsCommonClassName
|
|
7054
7136
|
}), index2);
|
|
7055
7137
|
case "duration":
|
|
7056
|
-
return /* @__PURE__ */ (0,
|
|
7138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DurationPicker, _object_spread_props(_object_spread({
|
|
7057
7139
|
direction: direction
|
|
7058
7140
|
}, element), {
|
|
7059
7141
|
labelsCommonClassName: labelsCommonClassName,
|
|
7060
7142
|
elementsCommonClassName: elementsCommonClassName
|
|
7061
7143
|
}), index2);
|
|
7062
7144
|
case "separator":
|
|
7063
|
-
return /* @__PURE__ */ (0,
|
|
7145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FormSeparator, _object_spread_props(_object_spread({
|
|
7064
7146
|
direction: direction
|
|
7065
7147
|
}, element), {
|
|
7066
7148
|
children: element.children
|
|
@@ -7075,15 +7157,15 @@ var ModularForm = function(param) {
|
|
|
7075
7157
|
}
|
|
7076
7158
|
})
|
|
7077
7159
|
}),
|
|
7078
|
-
/* @__PURE__ */ (0,
|
|
7160
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", {
|
|
7079
7161
|
className: cn("flex justify-between w-full", footerClassName),
|
|
7080
7162
|
children: [
|
|
7081
|
-
/* @__PURE__ */ (0,
|
|
7163
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
7082
7164
|
title: errorMsg,
|
|
7083
7165
|
className: cn("text-[#f22] text-[18px] max-w-[80%] ellipsis", errorClassName),
|
|
7084
7166
|
children: errorMsg
|
|
7085
7167
|
}),
|
|
7086
|
-
/* @__PURE__ */ (0,
|
|
7168
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", {
|
|
7087
7169
|
ref: submitRef,
|
|
7088
7170
|
disabled: isLoading,
|
|
7089
7171
|
onClick: function(e) {
|
|
@@ -7091,7 +7173,7 @@ var ModularForm = function(param) {
|
|
|
7091
7173
|
},
|
|
7092
7174
|
className: cn("bg-[#547f22] px-3 py-1.5 rounded-lg text-white min-w-20", buttonClassName),
|
|
7093
7175
|
type: "submit",
|
|
7094
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
7176
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loader, _object_spread({
|
|
7095
7177
|
size: 18,
|
|
7096
7178
|
color: "#fff"
|
|
7097
7179
|
}, loaderProps)) : buttonContent
|
|
@@ -7108,77 +7190,6 @@ var import_moment2 = __toESM(require("moment"));
|
|
|
7108
7190
|
var import_lucide_react8 = require("lucide-react");
|
|
7109
7191
|
var import_react_aria_components5 = require("react-aria-components");
|
|
7110
7192
|
var import_date3 = require("@internationalized/date");
|
|
7111
|
-
// src/components/ui/calendar-rac.tsx
|
|
7112
|
-
var import_date2 = require("@internationalized/date");
|
|
7113
|
-
var import_lucide_react7 = require("lucide-react");
|
|
7114
|
-
var import_react_aria_components4 = require("react-aria-components");
|
|
7115
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
7116
|
-
function CalendarHeader() {
|
|
7117
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("header", {
|
|
7118
|
-
className: "flex w-full items-center gap-1 pb-1",
|
|
7119
|
-
children: [
|
|
7120
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Button, {
|
|
7121
|
-
className: "flex size-9 items-center justify-center rounded-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:bg-accent hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
7122
|
-
slot: "previous",
|
|
7123
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react7.ChevronLeftIcon, {
|
|
7124
|
-
size: 16
|
|
7125
|
-
})
|
|
7126
|
-
}),
|
|
7127
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Heading, {
|
|
7128
|
-
className: "grow text-center font-medium text-sm"
|
|
7129
|
-
}),
|
|
7130
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Button, {
|
|
7131
|
-
className: "flex size-9 items-center justify-center rounded-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:bg-accent hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
7132
|
-
slot: "next",
|
|
7133
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react7.ChevronRightIcon, {
|
|
7134
|
-
size: 16
|
|
7135
|
-
})
|
|
7136
|
-
})
|
|
7137
|
-
]
|
|
7138
|
-
});
|
|
7139
|
-
}
|
|
7140
|
-
function CalendarGridComponent(param) {
|
|
7141
|
-
var _param_isRange = param.isRange, isRange = _param_isRange === void 0 ? false : _param_isRange;
|
|
7142
|
-
var now = (0, import_date2.today)((0, import_date2.getLocalTimeZone)());
|
|
7143
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_aria_components4.CalendarGrid, {
|
|
7144
|
-
children: [
|
|
7145
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarGridHeader, {
|
|
7146
|
-
children: function(day) {
|
|
7147
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarHeaderCell, {
|
|
7148
|
-
className: "size-9 rounded-md p-0 font-medium text-muted-foreground/80 text-xs",
|
|
7149
|
-
children: day
|
|
7150
|
-
});
|
|
7151
|
-
}
|
|
7152
|
-
}),
|
|
7153
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarGridBody, {
|
|
7154
|
-
className: "[&_td]:px-0 [&_td]:py-px",
|
|
7155
|
-
children: function(date) {
|
|
7156
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarCell, {
|
|
7157
|
-
className: cn("relative flex size-9 items-center justify-center whitespace-nowrap rounded-md p-0 font-normal text-foreground text-sm outline-none duration-150 [transition-property:color,background-color,border-radius,box-shadow] data-disabled:pointer-events-none data-unavailable:pointer-events-none data-focus-visible:z-10 data-hovered:bg-accent data-selected:bg-primary data-hovered:text-foreground data-selected:text-primary-foreground data-unavailable:line-through data-disabled:opacity-30 data-unavailable:opacity-30 data-focus-visible:ring-[3px] data-focus-visible:ring-ring/50", // Range-specific styles
|
|
7158
|
-
isRange && "data-invalid:data-selection-end:bg-destructive data-invalid:data-selection-start:bg-destructive data-invalid:data-selection-end:text-white data-invalid:data-selection-start:text-white data-selected:rounded-none data-selection-start:rounded-s-md data-selection-end:rounded-e-md data-invalid:bg-red-100 data-selected:bg-accent data-selection-end:bg-primary data-selection-start:bg-primary data-selected:text-foreground data-selection-end:text-primary-foreground data-selection-start:text-primary-foreground", // Today indicator styles
|
|
7159
|
-
date.compare(now) === 0 && cn("after:-translate-x-1/2 after:pointer-events-none after:absolute after:start-1/2 after:bottom-1 after:z-10 after:size-[3px] after:rounded-full after:bg-primary", isRange ? "data-selection-end:after:bg-background data-selection-start:after:bg-background" : "data-selected:after:bg-background")),
|
|
7160
|
-
date: date
|
|
7161
|
-
});
|
|
7162
|
-
}
|
|
7163
|
-
})
|
|
7164
|
-
]
|
|
7165
|
-
});
|
|
7166
|
-
}
|
|
7167
|
-
function Calendar2(_param) {
|
|
7168
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
7169
|
-
"className"
|
|
7170
|
-
]);
|
|
7171
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_aria_components4.Calendar, _object_spread_props(_object_spread({}, props), {
|
|
7172
|
-
className: (0, import_react_aria_components4.composeRenderProps)(className, function(className2) {
|
|
7173
|
-
return cn("w-fit", className2);
|
|
7174
|
-
}),
|
|
7175
|
-
children: [
|
|
7176
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CalendarHeader, {}),
|
|
7177
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CalendarGridComponent, {})
|
|
7178
|
-
]
|
|
7179
|
-
}));
|
|
7180
|
-
}
|
|
7181
|
-
// src/components/forms/index.tsx
|
|
7182
7193
|
var import_react_aria_components6 = require("react-aria-components");
|
|
7183
7194
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
7184
7195
|
var ConfirmForm = function(param) {
|
|
@@ -7310,7 +7321,7 @@ function DatePicker2(param) {
|
|
|
7310
7321
|
return function(form) {
|
|
7311
7322
|
return _ref.apply(this, arguments);
|
|
7312
7323
|
};
|
|
7313
|
-
}() : _param_submit, _param_formClassName = param.formClassName, formClassName = _param_formClassName === void 0 ? "" : _param_formClassName, _param_labelsClassName = param.labelsClassName, labelsClassName = _param_labelsClassName === void 0 ? "" : _param_labelsClassName, _param_inputsClassName = param.inputsClassName, inputsClassName = _param_inputsClassName === void 0 ? "" : _param_inputsClassName, _param_buttonClassName = param.buttonClassName, buttonClassName = _param_buttonClassName === void 0 ? "" : _param_buttonClassName, _param_calendarClassName = param.calendarClassName, calendarClassName = _param_calendarClassName === void 0 ? "" : _param_calendarClassName, _param_buttonStyle = param.buttonStyle, buttonStyle = _param_buttonStyle === void 0 ? {} : _param_buttonStyle, defaultFrom = param.defaultFrom, defaultTo = param.defaultTo, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_fromText = param.fromText, fromText = _param_fromText === void 0 ? "From date" : _param_fromText, _param_toText = param.toText, toText = _param_toText === void 0 ? "To date" : _param_toText, _param_buttonText = param.buttonText, buttonText = _param_buttonText === void 0 ? "Search" : _param_buttonText;
|
|
7324
|
+
}() : _param_submit, _param_formClassName = param.formClassName, formClassName = _param_formClassName === void 0 ? "" : _param_formClassName, _param_labelsClassName = param.labelsClassName, labelsClassName = _param_labelsClassName === void 0 ? "" : _param_labelsClassName, _param_inputsClassName = param.inputsClassName, inputsClassName = _param_inputsClassName === void 0 ? "" : _param_inputsClassName, _param_buttonClassName = param.buttonClassName, buttonClassName = _param_buttonClassName === void 0 ? "" : _param_buttonClassName, _param_calendarClassName = param.calendarClassName, calendarClassName = _param_calendarClassName === void 0 ? "" : _param_calendarClassName, _param_selectedDayClassName = param.selectedDayClassName, selectedDayClassName = _param_selectedDayClassName === void 0 ? "" : _param_selectedDayClassName, _param_todayDayClassName = param.todayDayClassName, todayDayClassName = _param_todayDayClassName === void 0 ? "" : _param_todayDayClassName, _param_buttonStyle = param.buttonStyle, buttonStyle = _param_buttonStyle === void 0 ? {} : _param_buttonStyle, defaultFrom = param.defaultFrom, defaultTo = param.defaultTo, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_fromText = param.fromText, fromText = _param_fromText === void 0 ? "From date" : _param_fromText, _param_toText = param.toText, toText = _param_toText === void 0 ? "To date" : _param_toText, _param_buttonText = param.buttonText, buttonText = _param_buttonText === void 0 ? "Search" : _param_buttonText;
|
|
7314
7325
|
var _ref = _sliced_to_array((0, import_react18.useState)(false), 2), isLoading = _ref[0], setIsLoading = _ref[1];
|
|
7315
7326
|
var onSubmit = /*#__PURE__*/ function() {
|
|
7316
7327
|
var _ref = _async_to_generator(function(e) {
|
|
@@ -7389,7 +7400,9 @@ function DatePicker2(param) {
|
|
|
7389
7400
|
offset: 4,
|
|
7390
7401
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Dialog, {
|
|
7391
7402
|
className: "max-h-[inherit] overflow-auto p-2",
|
|
7392
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7403
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Calendar, {
|
|
7404
|
+
selectedDayClassName: selectedDayClassName,
|
|
7405
|
+
todayDayClassName: todayDayClassName,
|
|
7393
7406
|
className: cn("bg-white", calendarClassName)
|
|
7394
7407
|
})
|
|
7395
7408
|
})
|
|
@@ -7430,7 +7443,9 @@ function DatePicker2(param) {
|
|
|
7430
7443
|
offset: 4,
|
|
7431
7444
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Dialog, {
|
|
7432
7445
|
className: "max-h-[inherit] overflow-auto p-2",
|
|
7433
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Calendar, {
|
|
7447
|
+
selectedDayClassName: selectedDayClassName,
|
|
7448
|
+
todayDayClassName: todayDayClassName,
|
|
7434
7449
|
className: cn("bg-white", calendarClassName)
|
|
7435
7450
|
})
|
|
7436
7451
|
})
|