akeyless-client-commons 1.1.93 → 1.1.95
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.map +1 -1
- package/dist/components/index.d.mts +15 -2
- package/dist/components/index.d.ts +15 -2
- package/dist/components/index.js +251 -130
- package/dist/components/index.mjs +237 -120
- package/dist/types/index.d.mts +14 -2
- package/dist/types/index.d.ts +14 -2
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -440,6 +440,9 @@ __export(index_exports, {
|
|
|
440
440
|
ConfirmForm: function() {
|
|
441
441
|
return ConfirmForm;
|
|
442
442
|
},
|
|
443
|
+
DateInputContainer: function() {
|
|
444
|
+
return DateInputContainer;
|
|
445
|
+
},
|
|
443
446
|
DatePicker: function() {
|
|
444
447
|
return DatePicker;
|
|
445
448
|
},
|
|
@@ -5553,7 +5556,9 @@ var DisplayAllRowsButton = (0, import_react11.memo)(function() {
|
|
|
5553
5556
|
var toggleDisplayAmount = function() {
|
|
5554
5557
|
return setDisplayAllRows(!displayAllRows);
|
|
5555
5558
|
};
|
|
5556
|
-
var
|
|
5559
|
+
var totalFiltered = dataToRender.filtered.length;
|
|
5560
|
+
var limitedCount = Math.min(maxRows, totalFiltered);
|
|
5561
|
+
var title = displayAllRows ? limitedCount : totalFiltered;
|
|
5557
5562
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", _object_spread_props(_object_spread({}, displayAllRowsButtonProps || {}), {
|
|
5558
5563
|
className: cn("bg-[#547f22] text-white px-3 py-1.5 rounded-md hover:bg-[#3e671f] focus:outline-none flex gap-1", displayAllRowsButtonProps === null || displayAllRowsButtonProps === void 0 ? void 0 : displayAllRowsButtonProps.className),
|
|
5559
5564
|
onClick: toggleDisplayAmount,
|
|
@@ -5970,6 +5975,7 @@ function useDeepCompareEffect(effect, dependencies) {
|
|
|
5970
5975
|
}
|
|
5971
5976
|
// src/components/forms/ModularForm/formElements.tsx
|
|
5972
5977
|
var import_react15 = require("react");
|
|
5978
|
+
var import_react_aria_components2 = require("react-aria-components");
|
|
5973
5979
|
// src/components/forms/ModularForm/InternationalPhonePicker.tsx
|
|
5974
5980
|
var import_lucide_react5 = require("lucide-react");
|
|
5975
5981
|
var import_react13 = require("react");
|
|
@@ -6160,7 +6166,44 @@ var FlagComponent = function(param) {
|
|
|
6160
6166
|
});
|
|
6161
6167
|
};
|
|
6162
6168
|
// src/components/forms/ModularForm/formElements.tsx
|
|
6169
|
+
var import_react_aria_components3 = require("react-aria-components");
|
|
6170
|
+
// src/components/ui/datefield-rac.tsx
|
|
6171
|
+
var import_react_aria_components = require("react-aria-components");
|
|
6163
6172
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6173
|
+
function DateSegment(_param) {
|
|
6174
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
6175
|
+
"className"
|
|
6176
|
+
]);
|
|
6177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_aria_components.DateSegment, _object_spread_props(_object_spread({
|
|
6178
|
+
className: (0, import_react_aria_components.composeRenderProps)(className, function(className2) {
|
|
6179
|
+
return cn("inline rounded p-0.5 text-foreground caret-transparent outline-hidden data-invalid:data-focused:bg-destructive data-focused:data-placeholder:text-foreground data-invalid:data-focused:text-white data-invalid:data-placeholder:text-destructive data-disabled:cursor-not-allowed data-focused:bg-accent data-[type=literal]:px-0 data-[type=literal]:text-muted-foreground/70 data-focused:text-foreground data-invalid:data-focused:data-placeholder:text-white data-invalid:text-destructive data-placeholder:text-muted-foreground/70 data-disabled:opacity-50", className2);
|
|
6180
|
+
})
|
|
6181
|
+
}, props), {
|
|
6182
|
+
"data-invalid": true
|
|
6183
|
+
}));
|
|
6184
|
+
}
|
|
6185
|
+
var dateInputStyle = "relative inline-flex h-9 w-full items-center overflow-hidden whitespace-nowrap rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none data-focus-within:border-ring data-focus-within:ring-ring/50 data-focus-within:ring-[3px] data-focus-within:has-aria-invalid:ring-destructive/20 dark:data-focus-within:has-aria-invalid:ring-destructive/40 data-focus-within:has-aria-invalid:border-destructive";
|
|
6186
|
+
function DateInput(_param) {
|
|
6187
|
+
var className = _param.className, _param_unstyled = _param.unstyled, unstyled = _param_unstyled === void 0 ? false : _param_unstyled, props = _object_without_properties(_param, [
|
|
6188
|
+
"className",
|
|
6189
|
+
"unstyled"
|
|
6190
|
+
]);
|
|
6191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_aria_components.DateInput, _object_spread_props(_object_spread({
|
|
6192
|
+
className: (0, import_react_aria_components.composeRenderProps)(className, function(className2) {
|
|
6193
|
+
return cn(!unstyled && dateInputStyle, className2);
|
|
6194
|
+
})
|
|
6195
|
+
}, props), {
|
|
6196
|
+
children: function(segment) {
|
|
6197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DateSegment, {
|
|
6198
|
+
segment: segment
|
|
6199
|
+
});
|
|
6200
|
+
}
|
|
6201
|
+
}));
|
|
6202
|
+
}
|
|
6203
|
+
// src/components/forms/ModularForm/formElements.tsx
|
|
6204
|
+
var import_lucide_react6 = require("lucide-react");
|
|
6205
|
+
var import_date = require("@internationalized/date");
|
|
6206
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6164
6207
|
var defaultFormElementContainerClassName = "flex justify-start items-center gap-3 w-full";
|
|
6165
6208
|
var defaultFormElementBorderClassName = "border-[1px] border-gray-300 hover:border-black rounded-sm";
|
|
6166
6209
|
var useSortValues = function(options, sortDirection, sortAsNumber) {
|
|
@@ -6218,8 +6261,8 @@ var InputContainer = function(param) {
|
|
|
6218
6261
|
labelStyle,
|
|
6219
6262
|
elementsCommonClassName
|
|
6220
6263
|
]);
|
|
6221
|
-
return /* @__PURE__ */ (0,
|
|
6222
|
-
children: /* @__PURE__ */ (0,
|
|
6264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6265
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, props), {
|
|
6223
6266
|
title: title,
|
|
6224
6267
|
minLength: minLength,
|
|
6225
6268
|
placeholder: placeholder,
|
|
@@ -6237,6 +6280,109 @@ var InputContainer = function(param) {
|
|
|
6237
6280
|
}))
|
|
6238
6281
|
}));
|
|
6239
6282
|
};
|
|
6283
|
+
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, _param_calendarIconClassName = param.calendarIconClassName, calendarIconClassName = _param_calendarIconClassName === void 0 ? "" : _param_calendarIconClassName;
|
|
6285
|
+
var containerProps = (0, import_react15.useMemo)(function() {
|
|
6286
|
+
return {
|
|
6287
|
+
containerClassName: containerClassName,
|
|
6288
|
+
direction: direction,
|
|
6289
|
+
labelClassName: labelClassName,
|
|
6290
|
+
labelContent: labelContent,
|
|
6291
|
+
labelWithDots: labelWithDots,
|
|
6292
|
+
labelsCommonClassName: labelsCommonClassName,
|
|
6293
|
+
name: name,
|
|
6294
|
+
required: required,
|
|
6295
|
+
labelStyle: labelStyle,
|
|
6296
|
+
elementsCommonClassName: elementsCommonClassName
|
|
6297
|
+
};
|
|
6298
|
+
}, [
|
|
6299
|
+
containerClassName,
|
|
6300
|
+
direction,
|
|
6301
|
+
labelClassName,
|
|
6302
|
+
labelContent,
|
|
6303
|
+
labelWithDots,
|
|
6304
|
+
labelsCommonClassName,
|
|
6305
|
+
name,
|
|
6306
|
+
required,
|
|
6307
|
+
labelStyle,
|
|
6308
|
+
elementsCommonClassName
|
|
6309
|
+
]);
|
|
6310
|
+
var getDefaultValue = function(dateStr) {
|
|
6311
|
+
if (dateStr) {
|
|
6312
|
+
try {
|
|
6313
|
+
return (0, import_date.parseDate)(dateStr);
|
|
6314
|
+
} catch (e) {
|
|
6315
|
+
return (0, import_date.today)((0, import_date.getLocalTimeZone)());
|
|
6316
|
+
}
|
|
6317
|
+
}
|
|
6318
|
+
return (0, import_date.today)((0, import_date.getLocalTimeZone)());
|
|
6319
|
+
};
|
|
6320
|
+
var handleDateChange = (0, import_react15.useCallback)(function(date) {
|
|
6321
|
+
if (!onChange) {
|
|
6322
|
+
return;
|
|
6323
|
+
}
|
|
6324
|
+
var valueStr = date ? date.toString() : "";
|
|
6325
|
+
var syntheticEvent = {
|
|
6326
|
+
target: {
|
|
6327
|
+
name: name,
|
|
6328
|
+
value: valueStr
|
|
6329
|
+
}
|
|
6330
|
+
};
|
|
6331
|
+
onChange(syntheticEvent);
|
|
6332
|
+
}, [
|
|
6333
|
+
onChange,
|
|
6334
|
+
name
|
|
6335
|
+
]);
|
|
6336
|
+
var pickerValue = value ? getDefaultValue(value) : void 0;
|
|
6337
|
+
var pickerDefaultValue = !pickerValue && defaultValue ? getDefaultValue(defaultValue) : void 0;
|
|
6338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6339
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.I18nProvider, {
|
|
6340
|
+
locale: "en-GB",
|
|
6341
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_aria_components3.DatePicker, {
|
|
6342
|
+
className: cn("flex items-center gap-2"),
|
|
6343
|
+
name: name,
|
|
6344
|
+
defaultValue: pickerDefaultValue,
|
|
6345
|
+
value: pickerValue,
|
|
6346
|
+
onChange: handleDateChange,
|
|
6347
|
+
onKeyDown: onKeyDown,
|
|
6348
|
+
children: [
|
|
6349
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6350
|
+
title: title,
|
|
6351
|
+
className: "flex flex-1",
|
|
6352
|
+
children: [
|
|
6353
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components3.Group, {
|
|
6354
|
+
className: cn("flex-1 bg-background", defaultFormElementBorderClassName, elementClassName),
|
|
6355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DateInput, _object_spread_props(_object_spread({}, props), {
|
|
6356
|
+
unstyled: true,
|
|
6357
|
+
style: {
|
|
6358
|
+
direction: "ltr"
|
|
6359
|
+
},
|
|
6360
|
+
className: cn("flex-1 h-9 px-3 py-2 text-sm", direction === "rtl" ? "justify-end text-right" : "justify-start text-left")
|
|
6361
|
+
}))
|
|
6362
|
+
}),
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components3.Button, {
|
|
6364
|
+
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, import_jsx_runtime21.jsx)(import_lucide_react6.CalendarIcon, {
|
|
6366
|
+
size: 16
|
|
6367
|
+
})
|
|
6368
|
+
})
|
|
6369
|
+
]
|
|
6370
|
+
}),
|
|
6371
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components3.Popover, {
|
|
6372
|
+
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
|
+
offset: 4,
|
|
6374
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components3.Dialog, {
|
|
6375
|
+
className: "max-h-[inherit] overflow-auto p-2",
|
|
6376
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react6.Calendar, {
|
|
6377
|
+
className: cn("bg-white", calendarIconClassName)
|
|
6378
|
+
})
|
|
6379
|
+
})
|
|
6380
|
+
})
|
|
6381
|
+
]
|
|
6382
|
+
})
|
|
6383
|
+
})
|
|
6384
|
+
}));
|
|
6385
|
+
};
|
|
6240
6386
|
var SelectContainer = function(param) {
|
|
6241
6387
|
var _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_labelContent = param.labelContent, labelContent = _param_labelContent === void 0 ? "" : _param_labelContent, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_labelClassName = param.labelClassName, labelClassName = _param_labelClassName === void 0 ? "" : _param_labelClassName, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_elementClassName = param.elementClassName, elementClassName = _param_elementClassName === void 0 ? "" : _param_elementClassName, _param_optionClassName = param.optionClassName, optionClassName = _param_optionClassName === void 0 ? "" : _param_optionClassName, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, _param_options = param.options, options = _param_options === void 0 ? [] : _param_options, _param_selectClassName = param.selectClassName, selectClassName = _param_selectClassName === void 0 ? "" : _param_selectClassName, _param_optionsContainerClassName = param.optionsContainerClassName, optionsContainerClassName = _param_optionsContainerClassName === void 0 ? "" : _param_optionsContainerClassName, _param_sortDirection = param.sortDirection, sortDirection = _param_sortDirection === void 0 ? "abc" : _param_sortDirection, sortAsNumber = param.sortAsNumber, direction = param.direction, onChange = param.onChange, labelWithDots = param.labelWithDots, iconClassName = param.iconClassName, labelsCommonClassName = param.labelsCommonClassName, elementsCommonClassName = param.elementsCommonClassName, title = param.title, labelStyle = param.labelStyle;
|
|
6242
6388
|
var _sortOptions_, _options_find;
|
|
@@ -6273,8 +6419,8 @@ var SelectContainer = function(param) {
|
|
|
6273
6419
|
labelStyle,
|
|
6274
6420
|
elementsCommonClassName
|
|
6275
6421
|
]);
|
|
6276
|
-
return /* @__PURE__ */ (0,
|
|
6277
|
-
children: /* @__PURE__ */ (0,
|
|
6422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6423
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6278
6424
|
title: title,
|
|
6279
6425
|
style: {
|
|
6280
6426
|
direction: direction
|
|
@@ -6284,21 +6430,21 @@ var SelectContainer = function(param) {
|
|
|
6284
6430
|
return setIsOpen(!isOpen);
|
|
6285
6431
|
},
|
|
6286
6432
|
children: [
|
|
6287
|
-
/* @__PURE__ */ (0,
|
|
6433
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6288
6434
|
className: cn("h-9 max-h-9 py-2 px-3 flex items-center justify-center cursor-pointer", defaultFormElementBorderClassName, selectClassName),
|
|
6289
6435
|
children: ((_options_find = options.find(function(opt) {
|
|
6290
6436
|
return opt.value === selectedValue;
|
|
6291
6437
|
})) === null || _options_find === void 0 ? void 0 : _options_find.label) || selectedValue
|
|
6292
6438
|
}),
|
|
6293
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
6439
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", {
|
|
6294
6440
|
className: cn("fa-light fa-chevron-up absolute top-3 ".concat(direction === "ltr" ? "right-2" : "left-2", " cursor-pointer"), iconClassName)
|
|
6295
|
-
}) : /* @__PURE__ */ (0,
|
|
6441
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", {
|
|
6296
6442
|
className: cn("fa-light fa-chevron-down absolute top-3 ".concat(direction === "ltr" ? "right-2" : "left-2", " cursor-pointer"), iconClassName)
|
|
6297
6443
|
}),
|
|
6298
|
-
isOpen && /* @__PURE__ */ (0,
|
|
6444
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6299
6445
|
className: cn("absolute w-full bg-white border border-gray-300 max-h-32 overflow-y-auto z-10", optionsContainerClassName),
|
|
6300
6446
|
children: sortOptions.map(function(option) {
|
|
6301
|
-
return /* @__PURE__ */ (0,
|
|
6447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6302
6448
|
className: "p-2 cursor-pointer hover:bg-gray-200 ".concat(optionClassName),
|
|
6303
6449
|
onClick: function() {
|
|
6304
6450
|
return handleOptionClick(option.value);
|
|
@@ -6307,7 +6453,7 @@ var SelectContainer = function(param) {
|
|
|
6307
6453
|
}, option.value);
|
|
6308
6454
|
})
|
|
6309
6455
|
}),
|
|
6310
|
-
/* @__PURE__ */ (0,
|
|
6456
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", {
|
|
6311
6457
|
value: selectedValue,
|
|
6312
6458
|
type: "hidden",
|
|
6313
6459
|
name: name,
|
|
@@ -6346,8 +6492,8 @@ function MultiSelect(param) {
|
|
|
6346
6492
|
labelStyle,
|
|
6347
6493
|
elementsCommonClassName
|
|
6348
6494
|
]);
|
|
6349
|
-
return /* @__PURE__ */ (0,
|
|
6350
|
-
children: /* @__PURE__ */ (0,
|
|
6495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(multiselect_default, {
|
|
6351
6497
|
closeDropdownOnSelect: closeDropdownOnSelect,
|
|
6352
6498
|
commandProps: {
|
|
6353
6499
|
label: placeholder
|
|
@@ -6369,7 +6515,7 @@ function MultiSelect(param) {
|
|
|
6369
6515
|
className: cn(defaultFormElementBorderClassName, styles.className),
|
|
6370
6516
|
dropdownClassName: styles.dropdownClassName,
|
|
6371
6517
|
dropdownOptionClassName: styles.dropdownOptionClassName,
|
|
6372
|
-
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0,
|
|
6518
|
+
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", {
|
|
6373
6519
|
className: "text-center text-sm",
|
|
6374
6520
|
children: "all options selected."
|
|
6375
6521
|
}),
|
|
@@ -6407,8 +6553,8 @@ var SelectWithSearch = function(param) {
|
|
|
6407
6553
|
labelStyle,
|
|
6408
6554
|
elementsCommonClassName
|
|
6409
6555
|
]);
|
|
6410
|
-
return /* @__PURE__ */ (0,
|
|
6411
|
-
children: /* @__PURE__ */ (0,
|
|
6556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SearchSelect, {
|
|
6412
6558
|
direction: direction,
|
|
6413
6559
|
createNewOptionLabel: createNewOptionLabel,
|
|
6414
6560
|
createNewOptionContainerClassName: createNewOptionContainerClassName,
|
|
@@ -6459,8 +6605,8 @@ var TextAreaContainer = function(param) {
|
|
|
6459
6605
|
labelStyle,
|
|
6460
6606
|
elementsCommonClassName
|
|
6461
6607
|
]);
|
|
6462
|
-
return /* @__PURE__ */ (0,
|
|
6463
|
-
children: /* @__PURE__ */ (0,
|
|
6608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("textarea", _object_spread_props(_object_spread({}, props), {
|
|
6464
6610
|
defaultValue: value ? void 0 : defaultValue,
|
|
6465
6611
|
value: defaultValue ? void 0 : value,
|
|
6466
6612
|
onChange: onChange,
|
|
@@ -6476,7 +6622,7 @@ var TextAreaContainer = function(param) {
|
|
|
6476
6622
|
};
|
|
6477
6623
|
var FormSeparator = function(param) {
|
|
6478
6624
|
var props = param.props, children = param.children;
|
|
6479
|
-
return /* @__PURE__ */ (0,
|
|
6625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", _object_spread_props(_object_spread({}, props), {
|
|
6480
6626
|
className: cn("border-b-[1px] border-gray-300 h-[1px]", props === null || props === void 0 ? void 0 : props.className),
|
|
6481
6627
|
children: children
|
|
6482
6628
|
}));
|
|
@@ -6508,8 +6654,8 @@ var CheckboxContainer = function(param) {
|
|
|
6508
6654
|
labelStyle,
|
|
6509
6655
|
elementsCommonClassName
|
|
6510
6656
|
]);
|
|
6511
|
-
return /* @__PURE__ */ (0,
|
|
6512
|
-
children: /* @__PURE__ */ (0,
|
|
6657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6658
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Checkbox, {
|
|
6513
6659
|
id: id,
|
|
6514
6660
|
name: name,
|
|
6515
6661
|
checked: checked,
|
|
@@ -6573,21 +6719,21 @@ var DurationPicker = function(param) {
|
|
|
6573
6719
|
onChange === null || onChange === void 0 ? void 0 : onChange(durationToSeconds(update));
|
|
6574
6720
|
};
|
|
6575
6721
|
};
|
|
6576
|
-
return /* @__PURE__ */ (0,
|
|
6577
|
-
children: /* @__PURE__ */ (0,
|
|
6722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6723
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6578
6724
|
title: title,
|
|
6579
6725
|
className: cn("flex gap-1.5 text-sm", elementClassName),
|
|
6580
6726
|
dir: "ltr",
|
|
6581
6727
|
children: [
|
|
6582
6728
|
Array.from(new Set(options)).map(function(field) {
|
|
6583
|
-
return /* @__PURE__ */ (0,
|
|
6729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6584
6730
|
className: "flex flex-col border p-0.5 rounded-md",
|
|
6585
6731
|
children: [
|
|
6586
|
-
!hideLabels && /* @__PURE__ */ (0,
|
|
6732
|
+
!hideLabels && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", {
|
|
6587
6733
|
className: "mb-1 ps-1 capitalize text-start border-b-[1px] border-b-gray-300",
|
|
6588
6734
|
children: field.slice(0, 1)
|
|
6589
6735
|
}),
|
|
6590
|
-
/* @__PURE__ */ (0,
|
|
6736
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", {
|
|
6591
6737
|
type: "number",
|
|
6592
6738
|
inputMode: "numeric",
|
|
6593
6739
|
min: 0,
|
|
@@ -6605,7 +6751,7 @@ var DurationPicker = function(param) {
|
|
|
6605
6751
|
]
|
|
6606
6752
|
}, field);
|
|
6607
6753
|
}),
|
|
6608
|
-
/* @__PURE__ */ (0,
|
|
6754
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", {
|
|
6609
6755
|
name: name,
|
|
6610
6756
|
type: "hidden",
|
|
6611
6757
|
value: durationToSeconds(duration)
|
|
@@ -6616,10 +6762,10 @@ var DurationPicker = function(param) {
|
|
|
6616
6762
|
};
|
|
6617
6763
|
var FormElementContainer = function(param) {
|
|
6618
6764
|
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;
|
|
6619
|
-
return /* @__PURE__ */ (0,
|
|
6765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6620
6766
|
className: cn(defaultContainerClassName ? defaultFormElementContainerClassName : "", containerClassName, elementsCommonClassName),
|
|
6621
6767
|
children: [
|
|
6622
|
-
labelContent && /* @__PURE__ */ (0,
|
|
6768
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ElementLabel, {
|
|
6623
6769
|
labelStyle: labelStyle,
|
|
6624
6770
|
labelsCommonClassName: labelsCommonClassName,
|
|
6625
6771
|
withDots: labelWithDots,
|
|
@@ -6635,7 +6781,7 @@ var FormElementContainer = function(param) {
|
|
|
6635
6781
|
};
|
|
6636
6782
|
var ElementLabel = function(param) {
|
|
6637
6783
|
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;
|
|
6638
|
-
return /* @__PURE__ */ (0,
|
|
6784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", {
|
|
6639
6785
|
style: _object_spread({
|
|
6640
6786
|
direction: direction
|
|
6641
6787
|
}, labelStyle),
|
|
@@ -6644,11 +6790,11 @@ var ElementLabel = function(param) {
|
|
|
6644
6790
|
title: labelContent,
|
|
6645
6791
|
children: [
|
|
6646
6792
|
labelContent,
|
|
6647
|
-
required && /* @__PURE__ */ (0,
|
|
6793
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6648
6794
|
className: "text-red-500",
|
|
6649
6795
|
children: "*"
|
|
6650
6796
|
}),
|
|
6651
|
-
withDots && /* @__PURE__ */ (0,
|
|
6797
|
+
withDots && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6652
6798
|
children: ":"
|
|
6653
6799
|
})
|
|
6654
6800
|
]
|
|
@@ -6710,15 +6856,15 @@ var ElementsContainer = (0, import_react15.memo)(function(props) {
|
|
|
6710
6856
|
containerClassName,
|
|
6711
6857
|
elementProps
|
|
6712
6858
|
]);
|
|
6713
|
-
return /* @__PURE__ */ (0,
|
|
6859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6714
6860
|
ref: containerRef,
|
|
6715
6861
|
className: cn("flex flex-col gap-1", className),
|
|
6716
6862
|
children: [
|
|
6717
|
-
headline && /* @__PURE__ */ (0,
|
|
6863
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6718
6864
|
className: cn("text-start text-primary font-bold border-b-[1px] border-gray-400 pb-0.5", headlineClassName),
|
|
6719
6865
|
children: headline
|
|
6720
6866
|
}),
|
|
6721
|
-
/* @__PURE__ */ (0,
|
|
6867
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6722
6868
|
className: cn("flex flex-col gap-1.5", childrenContainerClassName),
|
|
6723
6869
|
children: enhancedChildren
|
|
6724
6870
|
})
|
|
@@ -6727,7 +6873,7 @@ var ElementsContainer = (0, import_react15.memo)(function(props) {
|
|
|
6727
6873
|
}, propsAreEqual);
|
|
6728
6874
|
ElementsContainer.displayName = "ElementsContainer";
|
|
6729
6875
|
// src/components/forms/ModularForm/ModularForm.tsx
|
|
6730
|
-
var
|
|
6876
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
6731
6877
|
var ModularForm = function(param) {
|
|
6732
6878
|
var _param_submitFunction = param.submitFunction, submitFunction = _param_submitFunction === void 0 ? /*#__PURE__*/ function() {
|
|
6733
6879
|
var _ref = _async_to_generator(function(form) {
|
|
@@ -6834,7 +6980,7 @@ var ModularForm = function(param) {
|
|
|
6834
6980
|
return _ref.apply(this, arguments);
|
|
6835
6981
|
};
|
|
6836
6982
|
}();
|
|
6837
|
-
return /* @__PURE__ */ (0,
|
|
6983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("form", {
|
|
6838
6984
|
ref: formRef,
|
|
6839
6985
|
onSubmit: onSubmit,
|
|
6840
6986
|
style: {
|
|
@@ -6842,72 +6988,79 @@ var ModularForm = function(param) {
|
|
|
6842
6988
|
},
|
|
6843
6989
|
className: cn("w-[350px] px-5 py-5 flex flex-col gap-4", className),
|
|
6844
6990
|
children: [
|
|
6845
|
-
headerContent && /* @__PURE__ */ (0,
|
|
6991
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6846
6992
|
className: cn("border-b-2 border-[#547f22] pb-2 text-start font-bold text-[20px]", headerClassName),
|
|
6847
6993
|
children: headerContent
|
|
6848
6994
|
}),
|
|
6849
|
-
/* @__PURE__ */ (0,
|
|
6995
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6850
6996
|
className: cn("w-full flex flex-col gap-5", elementsContainerClassName),
|
|
6851
6997
|
children: elements.map(function(element, index2) {
|
|
6852
6998
|
switch(element.type){
|
|
6853
6999
|
case "input":
|
|
6854
|
-
return /* @__PURE__ */ (0,
|
|
7000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InputContainer, _object_spread_props(_object_spread({
|
|
7001
|
+
direction: direction
|
|
7002
|
+
}, element), {
|
|
7003
|
+
labelsCommonClassName: labelsCommonClassName,
|
|
7004
|
+
elementsCommonClassName: elementsCommonClassName
|
|
7005
|
+
}), index2);
|
|
7006
|
+
case "dateInput":
|
|
7007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DateInputContainer, _object_spread_props(_object_spread({
|
|
6855
7008
|
direction: direction
|
|
6856
7009
|
}, element), {
|
|
6857
7010
|
labelsCommonClassName: labelsCommonClassName,
|
|
6858
7011
|
elementsCommonClassName: elementsCommonClassName
|
|
6859
7012
|
}), index2);
|
|
6860
7013
|
case "textarea":
|
|
6861
|
-
return /* @__PURE__ */ (0,
|
|
7014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TextAreaContainer, _object_spread_props(_object_spread({
|
|
6862
7015
|
direction: element.direction || direction
|
|
6863
7016
|
}, element), {
|
|
6864
7017
|
labelsCommonClassName: labelsCommonClassName,
|
|
6865
7018
|
elementsCommonClassName: elementsCommonClassName
|
|
6866
7019
|
}), index2);
|
|
6867
7020
|
case "select":
|
|
6868
|
-
return /* @__PURE__ */ (0,
|
|
7021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectContainer, _object_spread_props(_object_spread({
|
|
6869
7022
|
direction: direction
|
|
6870
7023
|
}, element), {
|
|
6871
7024
|
labelsCommonClassName: labelsCommonClassName,
|
|
6872
7025
|
elementsCommonClassName: elementsCommonClassName
|
|
6873
7026
|
}), index2);
|
|
6874
7027
|
case "checkbox":
|
|
6875
|
-
return /* @__PURE__ */ (0,
|
|
7028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CheckboxContainer, _object_spread_props(_object_spread({
|
|
6876
7029
|
direction: direction
|
|
6877
7030
|
}, element), {
|
|
6878
7031
|
labelsCommonClassName: labelsCommonClassName,
|
|
6879
7032
|
elementsCommonClassName: elementsCommonClassName
|
|
6880
7033
|
}), index2);
|
|
6881
7034
|
case "multiSelect":
|
|
6882
|
-
return /* @__PURE__ */ (0,
|
|
7035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MultiSelect, _object_spread_props(_object_spread({
|
|
6883
7036
|
direction: direction
|
|
6884
7037
|
}, element), {
|
|
6885
7038
|
labelsCommonClassName: labelsCommonClassName,
|
|
6886
7039
|
elementsCommonClassName: elementsCommonClassName
|
|
6887
7040
|
}), index2);
|
|
6888
7041
|
case "selectWithSearch":
|
|
6889
|
-
return /* @__PURE__ */ (0,
|
|
7042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectWithSearch, _object_spread_props(_object_spread({
|
|
6890
7043
|
direction: direction
|
|
6891
7044
|
}, element), {
|
|
6892
7045
|
labelsCommonClassName: labelsCommonClassName,
|
|
6893
7046
|
elementsCommonClassName: elementsCommonClassName
|
|
6894
7047
|
}), index2);
|
|
6895
7048
|
case "internationalPhoneInput":
|
|
6896
|
-
return /* @__PURE__ */ (0,
|
|
7049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InternationalPhonePicker, _object_spread_props(_object_spread({
|
|
6897
7050
|
direction: direction
|
|
6898
7051
|
}, element), {
|
|
6899
7052
|
labelsCommonClassName: labelsCommonClassName,
|
|
6900
7053
|
elementsCommonClassName: elementsCommonClassName
|
|
6901
7054
|
}), index2);
|
|
6902
7055
|
case "duration":
|
|
6903
|
-
return /* @__PURE__ */ (0,
|
|
7056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DurationPicker, _object_spread_props(_object_spread({
|
|
6904
7057
|
direction: direction
|
|
6905
7058
|
}, element), {
|
|
6906
7059
|
labelsCommonClassName: labelsCommonClassName,
|
|
6907
7060
|
elementsCommonClassName: elementsCommonClassName
|
|
6908
7061
|
}), index2);
|
|
6909
7062
|
case "separator":
|
|
6910
|
-
return /* @__PURE__ */ (0,
|
|
7063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormSeparator, _object_spread_props(_object_spread({
|
|
6911
7064
|
direction: direction
|
|
6912
7065
|
}, element), {
|
|
6913
7066
|
children: element.children
|
|
@@ -6922,15 +7075,15 @@ var ModularForm = function(param) {
|
|
|
6922
7075
|
}
|
|
6923
7076
|
})
|
|
6924
7077
|
}),
|
|
6925
|
-
/* @__PURE__ */ (0,
|
|
7078
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
6926
7079
|
className: cn("flex justify-between w-full", footerClassName),
|
|
6927
7080
|
children: [
|
|
6928
|
-
/* @__PURE__ */ (0,
|
|
7081
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6929
7082
|
title: errorMsg,
|
|
6930
7083
|
className: cn("text-[#f22] text-[18px] max-w-[80%] ellipsis", errorClassName),
|
|
6931
7084
|
children: errorMsg
|
|
6932
7085
|
}),
|
|
6933
|
-
/* @__PURE__ */ (0,
|
|
7086
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", {
|
|
6934
7087
|
ref: submitRef,
|
|
6935
7088
|
disabled: isLoading,
|
|
6936
7089
|
onClick: function(e) {
|
|
@@ -6938,7 +7091,7 @@ var ModularForm = function(param) {
|
|
|
6938
7091
|
},
|
|
6939
7092
|
className: cn("bg-[#547f22] px-3 py-1.5 rounded-lg text-white min-w-20", buttonClassName),
|
|
6940
7093
|
type: "submit",
|
|
6941
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
7094
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loader, _object_spread({
|
|
6942
7095
|
size: 18,
|
|
6943
7096
|
color: "#fff"
|
|
6944
7097
|
}, loaderProps)) : buttonContent
|
|
@@ -6952,32 +7105,32 @@ var ModularForm_default = ModularForm;
|
|
|
6952
7105
|
// src/components/forms/index.tsx
|
|
6953
7106
|
var import_react18 = require("react");
|
|
6954
7107
|
var import_moment2 = __toESM(require("moment"));
|
|
6955
|
-
var
|
|
6956
|
-
var
|
|
6957
|
-
var
|
|
7108
|
+
var import_lucide_react8 = require("lucide-react");
|
|
7109
|
+
var import_react_aria_components5 = require("react-aria-components");
|
|
7110
|
+
var import_date3 = require("@internationalized/date");
|
|
6958
7111
|
// src/components/ui/calendar-rac.tsx
|
|
6959
|
-
var
|
|
6960
|
-
var
|
|
6961
|
-
var
|
|
6962
|
-
var
|
|
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");
|
|
6963
7116
|
function CalendarHeader() {
|
|
6964
|
-
return /* @__PURE__ */ (0,
|
|
7117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("header", {
|
|
6965
7118
|
className: "flex w-full items-center gap-1 pb-1",
|
|
6966
7119
|
children: [
|
|
6967
|
-
/* @__PURE__ */ (0,
|
|
7120
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Button, {
|
|
6968
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",
|
|
6969
7122
|
slot: "previous",
|
|
6970
|
-
children: /* @__PURE__ */ (0,
|
|
7123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react7.ChevronLeftIcon, {
|
|
6971
7124
|
size: 16
|
|
6972
7125
|
})
|
|
6973
7126
|
}),
|
|
6974
|
-
/* @__PURE__ */ (0,
|
|
7127
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Heading, {
|
|
6975
7128
|
className: "grow text-center font-medium text-sm"
|
|
6976
7129
|
}),
|
|
6977
|
-
/* @__PURE__ */ (0,
|
|
7130
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Button, {
|
|
6978
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",
|
|
6979
7132
|
slot: "next",
|
|
6980
|
-
children: /* @__PURE__ */ (0,
|
|
7133
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react7.ChevronRightIcon, {
|
|
6981
7134
|
size: 16
|
|
6982
7135
|
})
|
|
6983
7136
|
})
|
|
@@ -6986,21 +7139,21 @@ function CalendarHeader() {
|
|
|
6986
7139
|
}
|
|
6987
7140
|
function CalendarGridComponent(param) {
|
|
6988
7141
|
var _param_isRange = param.isRange, isRange = _param_isRange === void 0 ? false : _param_isRange;
|
|
6989
|
-
var now = (0,
|
|
6990
|
-
return /* @__PURE__ */ (0,
|
|
7142
|
+
var now = (0, import_date2.today)((0, import_date2.getLocalTimeZone)());
|
|
7143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_aria_components4.CalendarGrid, {
|
|
6991
7144
|
children: [
|
|
6992
|
-
/* @__PURE__ */ (0,
|
|
7145
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarGridHeader, {
|
|
6993
7146
|
children: function(day) {
|
|
6994
|
-
return /* @__PURE__ */ (0,
|
|
7147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarHeaderCell, {
|
|
6995
7148
|
className: "size-9 rounded-md p-0 font-medium text-muted-foreground/80 text-xs",
|
|
6996
7149
|
children: day
|
|
6997
7150
|
});
|
|
6998
7151
|
}
|
|
6999
7152
|
}),
|
|
7000
|
-
/* @__PURE__ */ (0,
|
|
7153
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarGridBody, {
|
|
7001
7154
|
className: "[&_td]:px-0 [&_td]:py-px",
|
|
7002
7155
|
children: function(date) {
|
|
7003
|
-
return /* @__PURE__ */ (0,
|
|
7156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarCell, {
|
|
7004
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
|
|
7005
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
|
|
7006
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")),
|
|
@@ -7011,55 +7164,22 @@ function CalendarGridComponent(param) {
|
|
|
7011
7164
|
]
|
|
7012
7165
|
});
|
|
7013
7166
|
}
|
|
7014
|
-
function
|
|
7167
|
+
function Calendar2(_param) {
|
|
7015
7168
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7016
7169
|
"className"
|
|
7017
7170
|
]);
|
|
7018
|
-
return /* @__PURE__ */ (0,
|
|
7019
|
-
className: (0,
|
|
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) {
|
|
7020
7173
|
return cn("w-fit", className2);
|
|
7021
7174
|
}),
|
|
7022
7175
|
children: [
|
|
7023
|
-
/* @__PURE__ */ (0,
|
|
7024
|
-
/* @__PURE__ */ (0,
|
|
7176
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CalendarHeader, {}),
|
|
7177
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CalendarGridComponent, {})
|
|
7025
7178
|
]
|
|
7026
7179
|
}));
|
|
7027
7180
|
}
|
|
7028
|
-
// src/components/ui/datefield-rac.tsx
|
|
7029
|
-
var import_react_aria_components2 = require("react-aria-components");
|
|
7030
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
7031
|
-
function DateSegment(_param) {
|
|
7032
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
7033
|
-
"className"
|
|
7034
|
-
]);
|
|
7035
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components2.DateSegment, _object_spread_props(_object_spread({
|
|
7036
|
-
className: (0, import_react_aria_components2.composeRenderProps)(className, function(className2) {
|
|
7037
|
-
return cn("inline rounded p-0.5 text-foreground caret-transparent outline-hidden data-invalid:data-focused:bg-destructive data-focused:data-placeholder:text-foreground data-invalid:data-focused:text-white data-invalid:data-placeholder:text-destructive data-disabled:cursor-not-allowed data-focused:bg-accent data-[type=literal]:px-0 data-[type=literal]:text-muted-foreground/70 data-focused:text-foreground data-invalid:data-focused:data-placeholder:text-white data-invalid:text-destructive data-placeholder:text-muted-foreground/70 data-disabled:opacity-50", className2);
|
|
7038
|
-
})
|
|
7039
|
-
}, props), {
|
|
7040
|
-
"data-invalid": true
|
|
7041
|
-
}));
|
|
7042
|
-
}
|
|
7043
|
-
var dateInputStyle = "relative inline-flex h-9 w-full items-center overflow-hidden whitespace-nowrap rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none data-focus-within:border-ring data-focus-within:ring-ring/50 data-focus-within:ring-[3px] data-focus-within:has-aria-invalid:ring-destructive/20 dark:data-focus-within:has-aria-invalid:ring-destructive/40 data-focus-within:has-aria-invalid:border-destructive";
|
|
7044
|
-
function DateInput(_param) {
|
|
7045
|
-
var className = _param.className, _param_unstyled = _param.unstyled, unstyled = _param_unstyled === void 0 ? false : _param_unstyled, props = _object_without_properties(_param, [
|
|
7046
|
-
"className",
|
|
7047
|
-
"unstyled"
|
|
7048
|
-
]);
|
|
7049
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components2.DateInput, _object_spread_props(_object_spread({
|
|
7050
|
-
className: (0, import_react_aria_components2.composeRenderProps)(className, function(className2) {
|
|
7051
|
-
return cn(!unstyled && dateInputStyle, className2);
|
|
7052
|
-
})
|
|
7053
|
-
}, props), {
|
|
7054
|
-
children: function(segment) {
|
|
7055
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DateSegment, {
|
|
7056
|
-
segment: segment
|
|
7057
|
-
});
|
|
7058
|
-
}
|
|
7059
|
-
}));
|
|
7060
|
-
}
|
|
7061
7181
|
// src/components/forms/index.tsx
|
|
7062
|
-
var
|
|
7182
|
+
var import_react_aria_components6 = require("react-aria-components");
|
|
7063
7183
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
7064
7184
|
var ConfirmForm = function(param) {
|
|
7065
7185
|
var onV = param.onV, onX = param.onX, _param_headline = param.headline, headline = _param_headline === void 0 ? "" : _param_headline, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_buttonsContainerClassName = param.buttonsContainerClassName, buttonsContainerClassName = _param_buttonsContainerClassName === void 0 ? "" : _param_buttonsContainerClassName, _param_headlineClassName = param.headlineClassName, headlineClassName = _param_headlineClassName === void 0 ? "" : _param_headlineClassName, _param_cancelButtonClassName = param.cancelButtonClassName, cancelButtonClassName = _param_cancelButtonClassName === void 0 ? "" : _param_cancelButtonClassName, _param_confirmButtonClassName = param.confirmButtonClassName, confirmButtonClassName = _param_confirmButtonClassName === void 0 ? "" : _param_confirmButtonClassName, _param_cancelButtonProps = param.cancelButtonProps, cancelButtonProps = _param_cancelButtonProps === void 0 ? {} : _param_cancelButtonProps, _param_confirmButtonProps = param.confirmButtonProps, confirmButtonProps = _param_confirmButtonProps === void 0 ? {} : _param_confirmButtonProps, cancelElement = param.cancelElement, confirmElement = param.confirmElement;
|
|
@@ -7219,14 +7339,14 @@ function DatePicker2(param) {
|
|
|
7219
7339
|
var getDefaultValue = function(dateStr) {
|
|
7220
7340
|
if (dateStr) {
|
|
7221
7341
|
try {
|
|
7222
|
-
return (0,
|
|
7342
|
+
return (0, import_date3.parseDate)(dateStr);
|
|
7223
7343
|
} catch (e) {
|
|
7224
|
-
return (0,
|
|
7344
|
+
return (0, import_date3.today)((0, import_date3.getLocalTimeZone)());
|
|
7225
7345
|
}
|
|
7226
7346
|
}
|
|
7227
|
-
return (0,
|
|
7347
|
+
return (0, import_date3.today)((0, import_date3.getLocalTimeZone)());
|
|
7228
7348
|
};
|
|
7229
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components6.I18nProvider, {
|
|
7230
7350
|
locale: "en-GB",
|
|
7231
7351
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("form", {
|
|
7232
7352
|
style: {
|
|
@@ -7235,19 +7355,19 @@ function DatePicker2(param) {
|
|
|
7235
7355
|
onSubmit: onSubmit,
|
|
7236
7356
|
className: cn("w-full h-10 flex justify-start gap-3 items-center", formClassName),
|
|
7237
7357
|
children: [
|
|
7238
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7358
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_aria_components5.DatePicker, {
|
|
7239
7359
|
className: cn("flex items-center gap-2", labelsClassName),
|
|
7240
7360
|
name: "from",
|
|
7241
7361
|
defaultValue: getDefaultValue(defaultFrom),
|
|
7242
7362
|
children: [
|
|
7243
|
-
fromText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7363
|
+
fromText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Label, {
|
|
7244
7364
|
className: "font-medium text-foreground text-sm whitespace-nowrap",
|
|
7245
7365
|
children: fromText
|
|
7246
7366
|
}),
|
|
7247
7367
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", {
|
|
7248
7368
|
className: "flex",
|
|
7249
7369
|
children: [
|
|
7250
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7370
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Group, {
|
|
7251
7371
|
className: cn("w-32 border rounded-md bg-background ", inputsClassName),
|
|
7252
7372
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DateInput, {
|
|
7253
7373
|
style: {
|
|
@@ -7256,39 +7376,39 @@ function DatePicker2(param) {
|
|
|
7256
7376
|
className: cn("px-2 py-1", direction === "rtl" ? "justify-end" : "justify-start")
|
|
7257
7377
|
})
|
|
7258
7378
|
}),
|
|
7259
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Button, {
|
|
7260
7380
|
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",
|
|
7261
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react8.CalendarIcon, {
|
|
7262
7382
|
size: 16
|
|
7263
7383
|
})
|
|
7264
7384
|
})
|
|
7265
7385
|
]
|
|
7266
7386
|
}),
|
|
7267
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7387
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Popover, {
|
|
7268
7388
|
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",
|
|
7269
7389
|
offset: 4,
|
|
7270
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7390
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Dialog, {
|
|
7271
7391
|
className: "max-h-[inherit] overflow-auto p-2",
|
|
7272
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Calendar2, {
|
|
7273
7393
|
className: cn("bg-white", calendarClassName)
|
|
7274
7394
|
})
|
|
7275
7395
|
})
|
|
7276
7396
|
})
|
|
7277
7397
|
]
|
|
7278
7398
|
}),
|
|
7279
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7399
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_aria_components5.DatePicker, {
|
|
7280
7400
|
className: cn("flex items-center gap-2", labelsClassName),
|
|
7281
7401
|
name: "to",
|
|
7282
7402
|
defaultValue: getDefaultValue(defaultTo),
|
|
7283
7403
|
children: [
|
|
7284
|
-
toText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7404
|
+
toText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Label, {
|
|
7285
7405
|
className: "font-medium text-foreground text-sm whitespace-nowrap",
|
|
7286
7406
|
children: toText
|
|
7287
7407
|
}),
|
|
7288
7408
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", {
|
|
7289
7409
|
className: "flex",
|
|
7290
7410
|
children: [
|
|
7291
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7411
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Group, {
|
|
7292
7412
|
className: cn("w-32 border rounded-md bg-background", inputsClassName),
|
|
7293
7413
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DateInput, {
|
|
7294
7414
|
style: {
|
|
@@ -7297,20 +7417,20 @@ function DatePicker2(param) {
|
|
|
7297
7417
|
className: cn("px-2 py-1", direction === "rtl" ? "justify-end" : "justify-start")
|
|
7298
7418
|
})
|
|
7299
7419
|
}),
|
|
7300
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7420
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Button, {
|
|
7301
7421
|
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",
|
|
7302
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7422
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react8.CalendarIcon, {
|
|
7303
7423
|
size: 16
|
|
7304
7424
|
})
|
|
7305
7425
|
})
|
|
7306
7426
|
]
|
|
7307
7427
|
}),
|
|
7308
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7428
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Popover, {
|
|
7309
7429
|
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",
|
|
7310
7430
|
offset: 4,
|
|
7311
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7431
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Dialog, {
|
|
7312
7432
|
className: "max-h-[inherit] overflow-auto p-2",
|
|
7313
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Calendar2, {
|
|
7314
7434
|
className: cn("bg-white", calendarClassName)
|
|
7315
7435
|
})
|
|
7316
7436
|
})
|
|
@@ -7388,6 +7508,7 @@ function Slot2(props) {
|
|
|
7388
7508
|
CheckboxContainer: CheckboxContainer,
|
|
7389
7509
|
CodeInput: CodeInput,
|
|
7390
7510
|
ConfirmForm: ConfirmForm,
|
|
7511
|
+
DateInputContainer: DateInputContainer,
|
|
7391
7512
|
DatePicker: DatePicker,
|
|
7392
7513
|
DatePicker2: DatePicker2,
|
|
7393
7514
|
DisplayAllRowsButton: DisplayAllRowsButton,
|