react-better-html 1.1.76 → 1.1.77

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/index.mjs CHANGED
@@ -1396,6 +1396,26 @@ var icons = {
1396
1396
  }
1397
1397
  ]
1398
1398
  },
1399
+ chevronLeft: {
1400
+ width: 320,
1401
+ height: 512,
1402
+ paths: [
1403
+ {
1404
+ d: "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z",
1405
+ type: "fill"
1406
+ }
1407
+ ]
1408
+ },
1409
+ chevronRight: {
1410
+ width: 320,
1411
+ height: 512,
1412
+ paths: [
1413
+ {
1414
+ d: "M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z",
1415
+ type: "fill"
1416
+ }
1417
+ ]
1418
+ },
1399
1419
  eye: {
1400
1420
  width: 576,
1401
1421
  height: 512,
@@ -1703,7 +1723,7 @@ function useComponentPropsWithoutStyle(props) {
1703
1723
  [props]
1704
1724
  );
1705
1725
  }
1706
- function useComponentInputFieldDateProps(props, holderRef) {
1726
+ function useComponentInputFieldDateProps(props, holderRef, disabled) {
1707
1727
  const theme2 = useTheme();
1708
1728
  const [isOpen, setIsOpen] = useBooleanState();
1709
1729
  const [isOpenLate, setIsOpenLate] = useBooleanState();
@@ -1712,7 +1732,7 @@ function useComponentInputFieldDateProps(props, holderRef) {
1712
1732
  const inputFieldProps = useMemo2(
1713
1733
  () => ({
1714
1734
  value: internalValue,
1715
- className: `${isOpen ? "react-better-html-inputField-dateTime-opened" : ""}${isOpenLate ? " react-better-html-inputField-dateTime-opened-late" : ""}${props.className ? ` ${props.className}` : ""}`,
1735
+ className: `${isOpen && !disabled ? "react-better-html-inputField-dateTime-opened" : ""}${isOpenLate && !disabled ? " react-better-html-inputField-dateTime-opened-late" : ""}${props.className ? ` ${props.className}` : ""}`,
1716
1736
  onClick: (event) => {
1717
1737
  if (props.disabled) return;
1718
1738
  setIsOpen.setTrue();
@@ -1731,7 +1751,7 @@ function useComponentInputFieldDateProps(props, holderRef) {
1731
1751
  props.onChangeValue?.(value);
1732
1752
  }
1733
1753
  }),
1734
- [props, internalValue, isOpen, isOpenLate]
1754
+ [props, internalValue, isOpen, isOpenLate, disabled]
1735
1755
  );
1736
1756
  const insideInputFieldComponentProps = useMemo2(
1737
1757
  () => ({
@@ -3059,7 +3079,7 @@ Chip2.circle = ChipComponent.circle;
3059
3079
  var Chip_default = Chip2;
3060
3080
 
3061
3081
  // src/components/InputField.tsx
3062
- import { forwardRef as forwardRef8, memo as memo15, useCallback as useCallback8, useState as useState6, useEffect as useEffect6, useMemo as useMemo4, useRef as useRef4 } from "react";
3082
+ import { forwardRef as forwardRef8, memo as memo16, useCallback as useCallback9, useState as useState7, useEffect as useEffect7, useMemo as useMemo5, useRef as useRef4 } from "react";
3063
3083
  import styled8 from "styled-components";
3064
3084
 
3065
3085
  // src/constants/countries.ts
@@ -4543,6 +4563,68 @@ var countries = [
4543
4563
  }
4544
4564
  ];
4545
4565
 
4566
+ // src/utils/functions.ts
4567
+ var generateRandomString = (stringLength, options) => {
4568
+ const capitals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
4569
+ const lowers = "abcdefghijklmnopqrstuvwxyz";
4570
+ const numbers = "0123456789";
4571
+ const includes = [];
4572
+ if (options?.includeCapitalLetters !== false) includes.push(capitals);
4573
+ if (options?.includeLowerLetters !== false) includes.push(lowers);
4574
+ if (options?.includeNumbers !== false) includes.push(numbers);
4575
+ const characters = includes.join("");
4576
+ const dashSections = Math.max(1, options?.dashSections ?? 1);
4577
+ const dashSectionLength = Math.floor(stringLength / dashSections);
4578
+ if (stringLength < dashSections) return "";
4579
+ let result = "";
4580
+ let currentSectionLength = 0;
4581
+ while (result.length < stringLength) {
4582
+ if (currentSectionLength >= dashSectionLength) {
4583
+ result += "-";
4584
+ currentSectionLength = 0;
4585
+ }
4586
+ if (result.length < stringLength) {
4587
+ result += characters.charAt(Math.floor(Math.random() * characters.length));
4588
+ currentSectionLength += 1;
4589
+ }
4590
+ }
4591
+ return result;
4592
+ };
4593
+ var getBrowser = () => {
4594
+ const userAgent = navigator.userAgent.toLowerCase();
4595
+ if (userAgent.includes("firefox")) return "firefox";
4596
+ if (userAgent.includes("chrome") && !userAgent.includes("edg")) return "chrome";
4597
+ if (userAgent.includes("safari") && !userAgent.includes("chrome")) return "safari";
4598
+ if (userAgent.includes("edg")) return "edge";
4599
+ if (userAgent.includes("opr") || userAgent.includes("opera")) return "opera";
4600
+ return;
4601
+ };
4602
+ var formatPhoneNumber = (phoneNumber) => {
4603
+ const cleanPhoneNumber = phoneNumber.replace(/\D/g, "");
4604
+ const country = countries.find(
4605
+ (country2) => country2.phoneNumberExtension === cleanPhoneNumber.slice(0, country2.phoneNumberExtension.length)
4606
+ );
4607
+ if (!country) return phoneNumber;
4608
+ let phonNumberRest = cleanPhoneNumber.slice(country.phoneNumberExtension.length);
4609
+ if (country.phoneNumberFormat) {
4610
+ let formattedNumber = "";
4611
+ let index = 0;
4612
+ for (const char of country.phoneNumberFormat) {
4613
+ if (char === "X" && index < phonNumberRest.length) {
4614
+ formattedNumber += phonNumberRest[index];
4615
+ index++;
4616
+ } else {
4617
+ formattedNumber += char;
4618
+ }
4619
+ }
4620
+ phonNumberRest = formattedNumber.replace(/X/g, "").trim();
4621
+ }
4622
+ return `+${country.phoneNumberExtension} ${phonNumberRest}`;
4623
+ };
4624
+ var getFormErrorObject = (formValues) => {
4625
+ return {};
4626
+ };
4627
+
4546
4628
  // src/components/Label.tsx
4547
4629
  import { memo as memo13 } from "react";
4548
4630
  import { jsxs as jsxs7 } from "react/jsx-runtime";
@@ -4850,8 +4932,188 @@ var DropdownComponent = forwardRef7(function Dropdown({
4850
4932
  var Dropdown2 = memo14(DropdownComponent);
4851
4933
  var Dropdown_default = Dropdown2;
4852
4934
 
4853
- // src/components/InputField.tsx
4935
+ // src/components/Calendar.tsx
4936
+ import { useCallback as useCallback8, useMemo as useMemo4, useState as useState6, memo as memo15, useEffect as useEffect6 } from "react";
4854
4937
  import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
4938
+ var getMonthName = (month, short = false) => {
4939
+ return [
4940
+ short ? "Jan" : "January",
4941
+ short ? "Feb" : "February",
4942
+ short ? "Mar" : "March",
4943
+ short ? "Apr" : "April",
4944
+ short ? "May" : "May",
4945
+ short ? "Jun" : "June",
4946
+ short ? "Jul" : "July",
4947
+ short ? "Aug" : "August",
4948
+ short ? "Sep" : "September",
4949
+ short ? "Oct" : "October",
4950
+ short ? "Nov" : "November",
4951
+ short ? "Dec" : "December"
4952
+ ][month];
4953
+ };
4954
+ var getWeekDayName = (day, short = false) => {
4955
+ return [
4956
+ short ? "Sun" : "Sunday",
4957
+ short ? "Mon" : "Monday",
4958
+ short ? "Tue" : "Tuesday",
4959
+ short ? "Wed" : "Wednesday",
4960
+ short ? "Thu" : "Thursday",
4961
+ short ? "Fri" : "Friday",
4962
+ short ? "Sat" : "Saturday"
4963
+ ][day];
4964
+ };
4965
+ var weekDaysIndex = [1, 2, 3, 4, 5, 6, 0];
4966
+ function Calendar({ value, minDate, maxDate, onChange }) {
4967
+ const theme2 = useTheme();
4968
+ const [currentDate, setCurrentDate] = useState6(value ? new Date(value) : void 0);
4969
+ const [currentMonth, setCurrentMonth] = useState6(currentDate?.getMonth() ?? (/* @__PURE__ */ new Date()).getMonth());
4970
+ const [currentYear, setCurrentYear] = useState6(currentDate?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear());
4971
+ const daysInMonth = useMemo4(() => new Date(currentYear, currentMonth + 1, 0).getDate(), [currentMonth, currentYear]);
4972
+ const onClickPreviousMonthButton = useCallback8(() => {
4973
+ const newMonth = currentMonth === 0 ? 11 : currentMonth - 1;
4974
+ const newYear = currentMonth === 0 ? currentYear - 1 : currentYear;
4975
+ setCurrentMonth(newMonth);
4976
+ setCurrentYear(newYear);
4977
+ }, [currentMonth, currentYear]);
4978
+ const onClickNextMonthButton = useCallback8(() => {
4979
+ const newMonth = currentMonth === 11 ? 0 : currentMonth + 1;
4980
+ const newYear = currentMonth === 11 ? currentYear + 1 : currentYear;
4981
+ setCurrentMonth(newMonth);
4982
+ setCurrentYear(newYear);
4983
+ }, [currentMonth, currentYear]);
4984
+ const onClickDay = useCallback8(
4985
+ (day) => {
4986
+ if (!day) return;
4987
+ const newDate = new Date(currentYear, currentMonth, day);
4988
+ setCurrentDate(newDate);
4989
+ onChange?.(
4990
+ `${newDate.getFullYear()}-${(newDate.getMonth() + 1).toString().padStart(2, "0")}-${newDate.getDate().toString().padStart(2, "0")}`
4991
+ );
4992
+ },
4993
+ [currentMonth, currentYear, onChange]
4994
+ );
4995
+ const onClickClear = useCallback8(() => {
4996
+ setCurrentDate(void 0);
4997
+ onChange?.(void 0);
4998
+ }, []);
4999
+ const onClickToday = useCallback8(() => {
5000
+ const today = /* @__PURE__ */ new Date();
5001
+ setCurrentDate(today);
5002
+ onChange?.(
5003
+ `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, "0")}-${today.getDate().toString().padStart(2, "0")}`
5004
+ );
5005
+ }, [onChange]);
5006
+ const firstDayOfMonth = useMemo4(() => {
5007
+ const day = new Date(currentYear, currentMonth, 1).getDay();
5008
+ return day === 0 ? 6 : day - 1;
5009
+ }, [currentMonth, currentYear]);
5010
+ const days = useMemo4(() => {
5011
+ const result = [];
5012
+ for (let index = 0; index < firstDayOfMonth; index++) {
5013
+ result.push(void 0);
5014
+ }
5015
+ for (let index = 1; index <= daysInMonth; index++) {
5016
+ result.push(index);
5017
+ }
5018
+ return result;
5019
+ }, [daysInMonth, firstDayOfMonth]);
5020
+ useEffect6(() => {
5021
+ if (!value) return;
5022
+ const date = new Date(value);
5023
+ setCurrentDate(date);
5024
+ setCurrentMonth(date.getMonth());
5025
+ setCurrentYear(date.getFullYear());
5026
+ }, [value]);
5027
+ return /* @__PURE__ */ jsxs9(Div_default.column, { width: "100%", maxWidth: 320, gap: theme2.styles.gap, padding: theme2.styles.space / 2, userSelect: "none", children: [
5028
+ /* @__PURE__ */ jsxs9(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
5029
+ /* @__PURE__ */ jsx14(Button_default.icon, { icon: "chevronLeft", onClick: onClickPreviousMonthButton }),
5030
+ /* @__PURE__ */ jsxs9(Text_default, { fontWeight: 700, children: [
5031
+ getMonthName(currentMonth),
5032
+ " ",
5033
+ currentYear
5034
+ ] }),
5035
+ /* @__PURE__ */ jsx14(Button_default.icon, { icon: "chevronRight", onClick: onClickNextMonthButton })
5036
+ ] }),
5037
+ /* @__PURE__ */ jsxs9(Div_default.grid, { width: "100%", gridTemplateColumns: "repeat(7, 1fr)", gap: theme2.styles.gap / 2, children: [
5038
+ weekDaysIndex.map((day) => /* @__PURE__ */ jsx14(Div_default.row, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx14(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", children: getWeekDayName(day, true) }) }, day)),
5039
+ days.map((day, index) => {
5040
+ const thisDayDate = new Date(currentYear, currentMonth, day);
5041
+ const isSelected = day !== void 0 && day === currentDate?.getDate() && currentMonth === currentDate.getMonth() && currentYear === currentDate.getFullYear();
5042
+ const isWeekend = thisDayDate.getDay() === 6 || thisDayDate.getDay() === 0;
5043
+ const isDisabled = minDate && thisDayDate.getTime() < minDate.getTime() || maxDate && thisDayDate.getTime() > maxDate.getTime();
5044
+ return /* @__PURE__ */ jsxs9(
5045
+ Div_default.row,
5046
+ {
5047
+ position: "relative",
5048
+ width: "100%",
5049
+ aspectRatio: "1",
5050
+ alignItems: "center",
5051
+ justifyContent: "center",
5052
+ backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
5053
+ filterHover: !isDisabled ? "brightness(0.9)" : void 0,
5054
+ borderRadius: theme2.styles.borderRadius / 2,
5055
+ padding: theme2.styles.space / 2,
5056
+ cursor: day ? !isDisabled ? "pointer" : "not-allowed" : void 0,
5057
+ value: day,
5058
+ onClickWithValue: !isDisabled ? onClickDay : void 0,
5059
+ children: [
5060
+ day && /* @__PURE__ */ jsx14(
5061
+ Text_default,
5062
+ {
5063
+ fontSize: 14,
5064
+ textAlign: "center",
5065
+ color: isDisabled ? theme2.colors.textSecondary + "80" : isSelected ? theme2.colors.base : isWeekend ? theme2.colors.textSecondary : void 0,
5066
+ children: day
5067
+ }
5068
+ ),
5069
+ isDisabled && /* @__PURE__ */ jsx14(
5070
+ Div_default,
5071
+ {
5072
+ position: "absolute",
5073
+ width: "60%",
5074
+ height: 1,
5075
+ top: "50%",
5076
+ left: "50%",
5077
+ backgroundColor: theme2.colors.textSecondary,
5078
+ borderRadius: 999,
5079
+ transform: "translate(-50%, -50%) rotate(45deg)"
5080
+ }
5081
+ )
5082
+ ]
5083
+ },
5084
+ index
5085
+ );
5086
+ })
5087
+ ] }),
5088
+ /* @__PURE__ */ jsxs9(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
5089
+ /* @__PURE__ */ jsx14(Div_default, { isTabAccessed: true, cursor: "pointer", onClick: onClickClear, children: /* @__PURE__ */ jsx14(
5090
+ Text_default,
5091
+ {
5092
+ fontSize: 14,
5093
+ textDecorationHover: "underline",
5094
+ color: theme2.colors.textSecondary,
5095
+ colorHover: theme2.colors.textPrimary,
5096
+ children: "Clear"
5097
+ }
5098
+ ) }),
5099
+ /* @__PURE__ */ jsx14(Div_default, { isTabAccessed: true, cursor: "pointer", onClick: onClickToday, children: /* @__PURE__ */ jsx14(
5100
+ Text_default,
5101
+ {
5102
+ fontSize: 14,
5103
+ textDecorationHover: "underline",
5104
+ color: theme2.colors.textSecondary,
5105
+ colorHover: theme2.colors.textPrimary,
5106
+ children: "Today"
5107
+ }
5108
+ ) })
5109
+ ] })
5110
+ ] });
5111
+ }
5112
+ var Calendar_default = memo15(Calendar);
5113
+
5114
+ // src/components/InputField.tsx
5115
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
5116
+ var buttonWidth = 50;
4855
5117
  var InputElement = styled8.input.withConfig({
4856
5118
  shouldForwardProp: (prop) => !["theme", "withLeftIcon", "withRightIcon", "normalStyle", "hoverStyle"].includes(prop)
4857
5119
  })`
@@ -4883,11 +5145,20 @@ var InputElement = styled8.input.withConfig({
4883
5145
  cursor: not-allowed;
4884
5146
  }
4885
5147
 
4886
- &[type="date"]::-webkit-calendar-picker-indicator,
4887
- &[type="datetime-local"]::-webkit-calendar-picker-indicator,
4888
- &[type="time"]::-webkit-calendar-picker-indicator {
4889
- display: none;
5148
+ &[type="date"],
5149
+ &[type="datetime-local"],
5150
+ &[type="time"] {
5151
+ min-height: 48px;
4890
5152
  -webkit-appearance: none;
5153
+
5154
+ &::-webkit-calendar-picker-indicator {
5155
+ display: none;
5156
+ -webkit-appearance: none;
5157
+ }
5158
+
5159
+ &::-webkit-date-and-time-value {
5160
+ text-align: left !important;
5161
+ }
4891
5162
  }
4892
5163
 
4893
5164
  &.react-better-html-phone-number-holder {
@@ -4993,7 +5264,7 @@ var InputFieldComponent = forwardRef8(function InputField({
4993
5264
  const dataProps = useComponentPropsWithPrefix(props, "data");
4994
5265
  const ariaProps = useComponentPropsWithPrefix(props, "aria");
4995
5266
  const restProps = useComponentPropsWithoutStyle(props);
4996
- const onChangeElement = useCallback8(
5267
+ const onChangeElement = useCallback9(
4997
5268
  (event) => {
4998
5269
  const newValue = event.target.value;
4999
5270
  if (withDebounce) {
@@ -5006,14 +5277,14 @@ var InputFieldComponent = forwardRef8(function InputField({
5006
5277
  },
5007
5278
  [onChange, onChangeValue, withDebounce]
5008
5279
  );
5009
- useEffect6(() => {
5280
+ useEffect7(() => {
5010
5281
  if (!withDebounce) return;
5011
5282
  onChangeValue?.(debouncedValue);
5012
5283
  }, [withDebounce, onChangeValue, debouncedValue]);
5013
- return /* @__PURE__ */ jsxs9(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, ref: holderRef, children: [
5014
- label && /* @__PURE__ */ jsx14(Label_default, { text: label, color: labelColor, required, isError: !!errorText }),
5015
- /* @__PURE__ */ jsxs9(Div_default, { position: "relative", width: "100%", children: [
5016
- leftIcon && /* @__PURE__ */ jsx14(
5284
+ return /* @__PURE__ */ jsxs10(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, ref: holderRef, children: [
5285
+ label && /* @__PURE__ */ jsx15(Label_default, { text: label, color: labelColor, required, isError: !!errorText }),
5286
+ /* @__PURE__ */ jsxs10(Div_default, { position: "relative", width: "100%", children: [
5287
+ leftIcon && /* @__PURE__ */ jsx15(
5017
5288
  Icon_default,
5018
5289
  {
5019
5290
  name: leftIcon,
@@ -5025,7 +5296,7 @@ var InputFieldComponent = forwardRef8(function InputField({
5025
5296
  zIndex: props.className?.includes("react-better-html-dropdown-open-late") ? 1002 : 1
5026
5297
  }
5027
5298
  ),
5028
- /* @__PURE__ */ jsx14(
5299
+ /* @__PURE__ */ jsx15(
5029
5300
  InputElement,
5030
5301
  {
5031
5302
  theme: theme2,
@@ -5041,7 +5312,7 @@ var InputFieldComponent = forwardRef8(function InputField({
5041
5312
  ref
5042
5313
  }
5043
5314
  ),
5044
- rightIcon ? onClickRightIcon ? /* @__PURE__ */ jsx14(
5315
+ rightIcon ? onClickRightIcon ? /* @__PURE__ */ jsx15(
5045
5316
  Button_default.icon,
5046
5317
  {
5047
5318
  icon: rightIcon,
@@ -5051,7 +5322,7 @@ var InputFieldComponent = forwardRef8(function InputField({
5051
5322
  transform: "translateY(-50%)",
5052
5323
  onClick: onClickRightIcon
5053
5324
  }
5054
- ) : /* @__PURE__ */ jsx14(
5325
+ ) : /* @__PURE__ */ jsx15(
5055
5326
  Icon_default,
5056
5327
  {
5057
5328
  name: rightIcon,
@@ -5064,7 +5335,7 @@ var InputFieldComponent = forwardRef8(function InputField({
5064
5335
  ) : void 0,
5065
5336
  insideInputFieldComponent
5066
5337
  ] }),
5067
- (errorText || infoText) && /* @__PURE__ */ jsx14(
5338
+ (errorText || infoText) && /* @__PURE__ */ jsx15(
5068
5339
  Text_default,
5069
5340
  {
5070
5341
  as: "span",
@@ -5094,17 +5365,17 @@ InputFieldComponent.multiline = forwardRef8(function Multiline({
5094
5365
  const dataProps = useComponentPropsWithPrefix(props, "data");
5095
5366
  const ariaProps = useComponentPropsWithPrefix(props, "aria");
5096
5367
  const restProps = useComponentPropsWithoutStyle(props);
5097
- const onChangeElement = useCallback8(
5368
+ const onChangeElement = useCallback9(
5098
5369
  (event) => {
5099
5370
  onChange?.(event);
5100
5371
  onChangeValue?.(event.target.value);
5101
5372
  },
5102
5373
  [onChange, onChangeValue]
5103
5374
  );
5104
- return /* @__PURE__ */ jsxs9(Div_default.column, { gap: theme2.styles.gap, children: [
5105
- label && /* @__PURE__ */ jsx14(Label_default, { text: label, required, isError: !!errorText }),
5106
- /* @__PURE__ */ jsxs9(Div_default, { position: "relative", width: "100%", children: [
5107
- leftIcon && /* @__PURE__ */ jsx14(
5375
+ return /* @__PURE__ */ jsxs10(Div_default.column, { gap: theme2.styles.gap, children: [
5376
+ label && /* @__PURE__ */ jsx15(Label_default, { text: label, required, isError: !!errorText }),
5377
+ /* @__PURE__ */ jsxs10(Div_default, { position: "relative", width: "100%", children: [
5378
+ leftIcon && /* @__PURE__ */ jsx15(
5108
5379
  Icon_default,
5109
5380
  {
5110
5381
  name: leftIcon,
@@ -5115,7 +5386,7 @@ InputFieldComponent.multiline = forwardRef8(function Multiline({
5115
5386
  pointerEvents: "none"
5116
5387
  }
5117
5388
  ),
5118
- /* @__PURE__ */ jsx14(
5389
+ /* @__PURE__ */ jsx15(
5119
5390
  TextareaElement,
5120
5391
  {
5121
5392
  theme: theme2,
@@ -5131,7 +5402,7 @@ InputFieldComponent.multiline = forwardRef8(function Multiline({
5131
5402
  ref
5132
5403
  }
5133
5404
  ),
5134
- rightIcon ? onClickRightIcon ? /* @__PURE__ */ jsx14(
5405
+ rightIcon ? onClickRightIcon ? /* @__PURE__ */ jsx15(
5135
5406
  Button_default.icon,
5136
5407
  {
5137
5408
  icon: rightIcon,
@@ -5141,7 +5412,7 @@ InputFieldComponent.multiline = forwardRef8(function Multiline({
5141
5412
  transform: "translateY(-50%)",
5142
5413
  onClick: onClickRightIcon
5143
5414
  }
5144
- ) : /* @__PURE__ */ jsx14(
5415
+ ) : /* @__PURE__ */ jsx15(
5145
5416
  Icon_default,
5146
5417
  {
5147
5418
  name: rightIcon,
@@ -5153,7 +5424,7 @@ InputFieldComponent.multiline = forwardRef8(function Multiline({
5153
5424
  }
5154
5425
  ) : void 0
5155
5426
  ] }),
5156
- (errorText || infoText) && /* @__PURE__ */ jsx14(
5427
+ (errorText || infoText) && /* @__PURE__ */ jsx15(
5157
5428
  Text_default,
5158
5429
  {
5159
5430
  as: "span",
@@ -5167,7 +5438,7 @@ InputFieldComponent.multiline = forwardRef8(function Multiline({
5167
5438
  ] });
5168
5439
  });
5169
5440
  InputFieldComponent.email = forwardRef8(function Email({ ...props }, ref) {
5170
- return /* @__PURE__ */ jsx14(
5441
+ return /* @__PURE__ */ jsx15(
5171
5442
  InputFieldComponent,
5172
5443
  {
5173
5444
  type: "email",
@@ -5182,7 +5453,7 @@ InputFieldComponent.email = forwardRef8(function Email({ ...props }, ref) {
5182
5453
  });
5183
5454
  InputFieldComponent.password = forwardRef8(function Password({ ...props }, ref) {
5184
5455
  const [isPassword, setIsPassword] = useBooleanState(true);
5185
- return /* @__PURE__ */ jsx14(
5456
+ return /* @__PURE__ */ jsx15(
5186
5457
  InputFieldComponent,
5187
5458
  {
5188
5459
  type: isPassword ? "password" : "text",
@@ -5198,20 +5469,20 @@ InputFieldComponent.password = forwardRef8(function Password({ ...props }, ref)
5198
5469
  );
5199
5470
  });
5200
5471
  InputFieldComponent.search = forwardRef8(function Search({ ...props }, ref) {
5201
- return /* @__PURE__ */ jsx14(InputFieldComponent, { leftIcon: "magnifyingGlass", placeholder: "Search...", ref, ...props });
5472
+ return /* @__PURE__ */ jsx15(InputFieldComponent, { leftIcon: "magnifyingGlass", placeholder: "Search...", ref, ...props });
5202
5473
  });
5203
5474
  InputFieldComponent.phoneNumber = forwardRef8(function PhoneNumber({ label, value, onChangeValue, labelColor, ...props }, ref) {
5204
5475
  const theme2 = useTheme();
5205
- const [dropdownValue, setDropdownValue] = useState6();
5206
- const [inputFieldValue, setInputFieldValue] = useState6(value?.toString() ?? "");
5207
- const renderOption = useCallback8(
5208
- (option, index, isSelected) => /* @__PURE__ */ jsxs9(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5209
- /* @__PURE__ */ jsx14(Image_default, { src: `https://flagcdn.com/w80/${option.data?.code.toString().toLowerCase()}.webp`, width: 20 }),
5210
- /* @__PURE__ */ jsx14(Text_default, { children: option.label })
5476
+ const [dropdownValue, setDropdownValue] = useState7();
5477
+ const [inputFieldValue, setInputFieldValue] = useState7(value?.toString() ?? "");
5478
+ const renderOption = useCallback9(
5479
+ (option, index, isSelected) => /* @__PURE__ */ jsxs10(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5480
+ /* @__PURE__ */ jsx15(Image_default, { src: `https://flagcdn.com/w80/${option.data?.code.toString().toLowerCase()}.webp`, width: 20 }),
5481
+ /* @__PURE__ */ jsx15(Text_default, { children: option.label })
5211
5482
  ] }),
5212
5483
  []
5213
5484
  );
5214
- const onChangeValueElement = useCallback8(
5485
+ const onChangeValueElement = useCallback9(
5215
5486
  (value2) => {
5216
5487
  const readyValue = value2.replace(/\D/g, "");
5217
5488
  setInputFieldValue(readyValue);
@@ -5219,7 +5490,7 @@ InputFieldComponent.phoneNumber = forwardRef8(function PhoneNumber({ label, valu
5219
5490
  },
5220
5491
  [onChangeValue, dropdownValue]
5221
5492
  );
5222
- const options = useMemo4(
5493
+ const options = useMemo5(
5223
5494
  () => countries.map((country) => ({
5224
5495
  value: country.phoneNumberExtension,
5225
5496
  label: `+${country.phoneNumberExtension}`,
@@ -5227,13 +5498,13 @@ InputFieldComponent.phoneNumber = forwardRef8(function PhoneNumber({ label, valu
5227
5498
  })),
5228
5499
  []
5229
5500
  );
5230
- const defaultValue = useMemo4(() => {
5501
+ const defaultValue = useMemo5(() => {
5231
5502
  const thisTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
5232
5503
  const initialDefaultValue = options.find((option) => option.data?.timeZone === thisTimeZone)?.value ?? "";
5233
5504
  setDropdownValue(initialDefaultValue);
5234
5505
  return initialDefaultValue;
5235
5506
  }, [options]);
5236
- useEffect6(() => {
5507
+ useEffect7(() => {
5237
5508
  if (value === void 0 || value === null) return;
5238
5509
  const newValue = value.toString();
5239
5510
  const country = countries.find(
@@ -5249,10 +5520,10 @@ InputFieldComponent.phoneNumber = forwardRef8(function PhoneNumber({ label, valu
5249
5520
  setDropdownValue(country.phoneNumberExtension);
5250
5521
  setInputFieldValue(newValue.slice(country?.phoneNumberExtension.length + 1));
5251
5522
  }, [value]);
5252
- return /* @__PURE__ */ jsxs9(Div_default.column, { width: "100%", gap: theme2.styles.gap, children: [
5253
- label && /* @__PURE__ */ jsx14(Label_default, { text: label, color: labelColor, required: props.required, isError: !!props.errorText }),
5254
- /* @__PURE__ */ jsxs9(Div_default.row, { children: [
5255
- /* @__PURE__ */ jsx14(
5523
+ return /* @__PURE__ */ jsxs10(Div_default.column, { width: "100%", gap: theme2.styles.gap, children: [
5524
+ label && /* @__PURE__ */ jsx15(Label_default, { text: label, color: labelColor, required: props.required, isError: !!props.errorText }),
5525
+ /* @__PURE__ */ jsxs10(Div_default.row, { children: [
5526
+ /* @__PURE__ */ jsx15(
5256
5527
  Dropdown_default,
5257
5528
  {
5258
5529
  options,
@@ -5268,7 +5539,7 @@ InputFieldComponent.phoneNumber = forwardRef8(function PhoneNumber({ label, valu
5268
5539
  withoutClearButton: true
5269
5540
  }
5270
5541
  ),
5271
- /* @__PURE__ */ jsx14(
5542
+ /* @__PURE__ */ jsx15(
5272
5543
  InputFieldComponent,
5273
5544
  {
5274
5545
  placeholder: label ?? "Phone number",
@@ -5282,31 +5553,38 @@ InputFieldComponent.phoneNumber = forwardRef8(function PhoneNumber({ label, valu
5282
5553
  ] })
5283
5554
  ] });
5284
5555
  });
5285
- InputFieldComponent.date = forwardRef8(function Date({ className, onFocus, onBlur, ...props }, ref) {
5556
+ InputFieldComponent.date = forwardRef8(function Date2({ minDate, maxDate, ...props }, ref) {
5286
5557
  const theme2 = useTheme();
5287
5558
  const holderRef = useRef4(null);
5288
- const { internalValue, setInternalValue, inputFieldProps, insideInputFieldComponentProps } = useComponentInputFieldDateProps(props, holderRef);
5289
- return /* @__PURE__ */ jsx14(
5559
+ const isMobileIOS = isMobileDevice && getBrowser() === "safari";
5560
+ const { internalValue, setInternalValue, inputFieldProps, insideInputFieldComponentProps } = useComponentInputFieldDateProps(props, holderRef, isMobileIOS);
5561
+ const onChange = useCallback9(
5562
+ (date) => {
5563
+ inputFieldProps.onChangeValue?.(date ?? "");
5564
+ setInternalValue(date ?? "");
5565
+ },
5566
+ [inputFieldProps.onChangeValue]
5567
+ );
5568
+ return /* @__PURE__ */ jsx15(
5290
5569
  InputFieldComponent,
5291
5570
  {
5292
5571
  type: "date",
5293
- insideInputFieldComponent: /* @__PURE__ */ jsx14(
5572
+ insideInputFieldComponent: !isMobileIOS ? /* @__PURE__ */ jsx15(
5294
5573
  Div_default,
5295
5574
  {
5296
5575
  position: "absolute",
5297
5576
  top: "100%",
5298
5577
  left: 0,
5299
- width: "100%",
5300
- maxHeight: 300,
5578
+ width: "fit-content",
5301
5579
  backgroundColor: theme2.colors.backgroundContent,
5302
5580
  borderBottomLeftRadius: theme2.styles.borderRadius,
5303
5581
  borderBottomRightRadius: theme2.styles.borderRadius,
5304
5582
  boxShadow: "0px 10px 20px #00000020",
5305
- overflowY: "auto",
5583
+ userSelect: "none",
5306
5584
  ...insideInputFieldComponentProps,
5307
- children: "Hello there"
5585
+ children: /* @__PURE__ */ jsx15(Calendar_default, { value: internalValue, minDate, maxDate, onChange })
5308
5586
  }
5309
- ),
5587
+ ) : void 0,
5310
5588
  holderRef,
5311
5589
  ref,
5312
5590
  ...props,
@@ -5314,31 +5592,152 @@ InputFieldComponent.date = forwardRef8(function Date({ className, onFocus, onBlu
5314
5592
  }
5315
5593
  );
5316
5594
  });
5317
- InputFieldComponent.dateTime = forwardRef8(function DateTime({ className, onFocus, onBlur, ...props }, ref) {
5595
+ InputFieldComponent.dateTime = forwardRef8(function DateTime({ minDate, maxDate, ...props }, ref) {
5318
5596
  const theme2 = useTheme();
5319
5597
  const holderRef = useRef4(null);
5320
- const { internalValue, setInternalValue, inputFieldProps, insideInputFieldComponentProps } = useComponentInputFieldDateProps(props, holderRef);
5321
- return /* @__PURE__ */ jsx14(
5598
+ const selectedHourRef = useRef4(null);
5599
+ const selectedMinuteRef = useRef4(null);
5600
+ const isMobileIOS = isMobileDevice && getBrowser() === "safari";
5601
+ const { internalValue, setInternalValue, inputFieldProps, insideInputFieldComponentProps, isOpen } = useComponentInputFieldDateProps(props, holderRef, isMobileIOS);
5602
+ const onChange = useCallback9(
5603
+ (date) => {
5604
+ const newValue = date ? `${date}T${internalValue?.toString().split("T")[1] ?? "00:00"}` : "";
5605
+ inputFieldProps.onChangeValue?.(newValue);
5606
+ setInternalValue(newValue);
5607
+ },
5608
+ [internalValue, inputFieldProps.onChangeValue]
5609
+ );
5610
+ const onClickHour = useCallback9(
5611
+ (hour) => {
5612
+ const newTime = `${hour.toString().padStart(2, "0")}:${internalValue?.toString().split(":")[1] || "00"}`;
5613
+ const today = `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
5614
+ const newValue = `${(internalValue.trim() || today)?.toString().split("T")[0]}T${newTime}`;
5615
+ inputFieldProps.onChangeValue?.(newValue);
5616
+ setInternalValue(newValue);
5617
+ },
5618
+ [internalValue, inputFieldProps.onChangeValue]
5619
+ );
5620
+ const onClickMinute = useCallback9(
5621
+ (minute) => {
5622
+ const newTime = `${internalValue?.toString().split("T")?.[1]?.split(":")[0] || "00"}:${minute.toString().padStart(2, "0")}`;
5623
+ const today = `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
5624
+ const newValue = `${(internalValue.trim() || today)?.toString().split("T")[0]}T${newTime}`;
5625
+ console.log(newValue);
5626
+ inputFieldProps.onChangeValue?.(newValue);
5627
+ setInternalValue(newValue);
5628
+ },
5629
+ [internalValue, inputFieldProps.onChangeValue]
5630
+ );
5631
+ useEffect7(() => {
5632
+ if (isOpen && selectedHourRef.current)
5633
+ selectedHourRef.current.scrollIntoView({ block: "nearest", behavior: "instant" });
5634
+ if (isOpen && selectedMinuteRef.current)
5635
+ selectedMinuteRef.current.scrollIntoView({ block: "nearest", behavior: "instant" });
5636
+ }, [isOpen]);
5637
+ const valueHour = parseInt(internalValue?.toString().split("T")?.[1]?.split(":")?.[0]).toString();
5638
+ const valueMinute = parseInt(internalValue?.toString().split("T")?.[1]?.split(":")?.[1]).toString();
5639
+ const topSpacing = 32 + theme2.styles.space / 2 + theme2.styles.gap;
5640
+ return /* @__PURE__ */ jsx15(
5322
5641
  InputFieldComponent,
5323
5642
  {
5324
5643
  type: "datetime-local",
5325
- insideInputFieldComponent: /* @__PURE__ */ jsx14(
5644
+ insideInputFieldComponent: !isMobileIOS ? /* @__PURE__ */ jsx15(
5326
5645
  Div_default,
5327
5646
  {
5328
5647
  position: "absolute",
5329
5648
  top: "100%",
5330
5649
  left: 0,
5331
- width: "100%",
5332
- maxHeight: 300,
5650
+ width: "fit-content",
5333
5651
  backgroundColor: theme2.colors.backgroundContent,
5334
5652
  borderBottomLeftRadius: theme2.styles.borderRadius,
5335
5653
  borderBottomRightRadius: theme2.styles.borderRadius,
5336
5654
  boxShadow: "0px 10px 20px #00000020",
5337
- overflowY: "auto",
5655
+ overflow: "hidden",
5656
+ userSelect: "none",
5338
5657
  ...insideInputFieldComponentProps,
5339
- children: "Hello there"
5658
+ children: /* @__PURE__ */ jsxs10(Div_default.row, { gap: theme2.styles.space, children: [
5659
+ /* @__PURE__ */ jsx15(Calendar_default, { value: internalValue, minDate, maxDate, onChange }),
5660
+ /* @__PURE__ */ jsxs10(
5661
+ Div_default.row,
5662
+ {
5663
+ height: 276,
5664
+ gap: theme2.styles.gap / 2,
5665
+ paddingTop: topSpacing,
5666
+ paddingBottom: theme2.styles.space / 2,
5667
+ paddingRight: theme2.styles.space / 2,
5668
+ children: [
5669
+ /* @__PURE__ */ jsxs10(Div_default, { height: "100%", children: [
5670
+ /* @__PURE__ */ jsx15(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", marginBottom: theme2.styles.gap / 2, children: "H" }),
5671
+ /* @__PURE__ */ jsx15(
5672
+ Div_default,
5673
+ {
5674
+ className: "react-better-html-no-scrollbar",
5675
+ width: buttonWidth,
5676
+ height: `calc(100% - ${16 + theme2.styles.gap / 2}px)`,
5677
+ overflowY: "auto",
5678
+ children: hours.map((hour) => {
5679
+ const isSelected = hour.toString() === valueHour;
5680
+ return /* @__PURE__ */ jsx15(
5681
+ Div_default.row,
5682
+ {
5683
+ alignItems: "center",
5684
+ justifyContent: "center",
5685
+ color: isSelected ? theme2.colors.base : theme2.colors.textPrimary,
5686
+ backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
5687
+ borderRadius: theme2.styles.borderRadius / 2,
5688
+ filterHover: "brightness(0.9)",
5689
+ cursor: "pointer",
5690
+ padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`,
5691
+ value: hour,
5692
+ onClickWithValue: onClickHour,
5693
+ ref: isSelected ? selectedHourRef : void 0,
5694
+ children: /* @__PURE__ */ jsx15(Text_default, { textAlign: "center", children: hour.toString().padStart(2, "0") })
5695
+ },
5696
+ hour
5697
+ );
5698
+ })
5699
+ }
5700
+ )
5701
+ ] }),
5702
+ /* @__PURE__ */ jsxs10(Div_default, { height: "100%", children: [
5703
+ /* @__PURE__ */ jsx15(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", marginBottom: theme2.styles.gap / 2, children: "M" }),
5704
+ /* @__PURE__ */ jsx15(
5705
+ Div_default,
5706
+ {
5707
+ className: "react-better-html-no-scrollbar",
5708
+ width: buttonWidth,
5709
+ height: `calc(100% - ${16 + theme2.styles.gap / 2}px)`,
5710
+ overflowY: "auto",
5711
+ children: minutes.map((minute) => {
5712
+ const isSelected = minute.toString() === valueMinute;
5713
+ return /* @__PURE__ */ jsx15(
5714
+ Div_default.row,
5715
+ {
5716
+ alignItems: "center",
5717
+ justifyContent: "center",
5718
+ color: isSelected ? theme2.colors.base : theme2.colors.textPrimary,
5719
+ backgroundColor: isSelected ? theme2.colors.primary : theme2.colors.backgroundContent,
5720
+ borderRadius: theme2.styles.borderRadius / 2,
5721
+ filterHover: "brightness(0.9)",
5722
+ cursor: "pointer",
5723
+ padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`,
5724
+ value: minute,
5725
+ onClickWithValue: onClickMinute,
5726
+ ref: isSelected ? selectedMinuteRef : void 0,
5727
+ children: /* @__PURE__ */ jsx15(Text_default, { textAlign: "center", children: minute.toString().padStart(2, "0") })
5728
+ },
5729
+ minute
5730
+ );
5731
+ })
5732
+ }
5733
+ )
5734
+ ] })
5735
+ ]
5736
+ }
5737
+ )
5738
+ ] })
5340
5739
  }
5341
- ),
5740
+ ) : void 0,
5342
5741
  holderRef,
5343
5742
  ref,
5344
5743
  ...props,
@@ -5351,8 +5750,9 @@ InputFieldComponent.time = forwardRef8(function Time({ ...props }, ref) {
5351
5750
  const holderRef = useRef4(null);
5352
5751
  const selectedHourRef = useRef4(null);
5353
5752
  const selectedMinuteRef = useRef4(null);
5354
- const { internalValue, setInternalValue, inputFieldProps, insideInputFieldComponentProps, isOpen } = useComponentInputFieldDateProps(props, holderRef);
5355
- const onClickHour = useCallback8(
5753
+ const isMobileIOS = isMobileDevice && getBrowser() === "safari";
5754
+ const { internalValue, setInternalValue, inputFieldProps, insideInputFieldComponentProps, isOpen } = useComponentInputFieldDateProps(props, holderRef, isMobileIOS);
5755
+ const onClickHour = useCallback9(
5356
5756
  (hour) => {
5357
5757
  const value = `${hour.toString().padStart(2, "0")}:${internalValue?.toString().split(":")[1] || "00"}`;
5358
5758
  inputFieldProps.onChangeValue?.(value);
@@ -5360,7 +5760,7 @@ InputFieldComponent.time = forwardRef8(function Time({ ...props }, ref) {
5360
5760
  },
5361
5761
  [internalValue, inputFieldProps.onChangeValue]
5362
5762
  );
5363
- const onClickMinute = useCallback8(
5763
+ const onClickMinute = useCallback9(
5364
5764
  (minute) => {
5365
5765
  const value = `${internalValue?.toString().split(":")[0] || "00"}:${minute.toString().padStart(2, "0")}`;
5366
5766
  inputFieldProps.onChangeValue?.(value);
@@ -5368,7 +5768,7 @@ InputFieldComponent.time = forwardRef8(function Time({ ...props }, ref) {
5368
5768
  },
5369
5769
  [internalValue, inputFieldProps.onChangeValue]
5370
5770
  );
5371
- useEffect6(() => {
5771
+ useEffect7(() => {
5372
5772
  if (isOpen && selectedHourRef.current)
5373
5773
  selectedHourRef.current.scrollIntoView({ block: "nearest", behavior: "instant" });
5374
5774
  if (isOpen && selectedMinuteRef.current)
@@ -5376,12 +5776,11 @@ InputFieldComponent.time = forwardRef8(function Time({ ...props }, ref) {
5376
5776
  }, [isOpen]);
5377
5777
  const valueHour = parseInt(internalValue?.toString().split(":")?.[0]).toString();
5378
5778
  const valueMinute = parseInt(internalValue?.toString().split(":")?.[1]).toString();
5379
- const buttonWidth = 50;
5380
- return /* @__PURE__ */ jsx14(
5779
+ return /* @__PURE__ */ jsx15(
5381
5780
  InputFieldComponent,
5382
5781
  {
5383
5782
  type: "time",
5384
- insideInputFieldComponent: /* @__PURE__ */ jsx14(
5783
+ insideInputFieldComponent: !isMobileIOS ? /* @__PURE__ */ jsx15(
5385
5784
  Div_default,
5386
5785
  {
5387
5786
  position: "absolute",
@@ -5394,11 +5793,12 @@ InputFieldComponent.time = forwardRef8(function Time({ ...props }, ref) {
5394
5793
  borderBottomRightRadius: theme2.styles.borderRadius,
5395
5794
  boxShadow: "0px 10px 20px #00000020",
5396
5795
  overflowY: "auto",
5796
+ userSelect: "none",
5397
5797
  ...insideInputFieldComponentProps,
5398
- children: /* @__PURE__ */ jsxs9(Div_default.row, { height: "100%", children: [
5399
- /* @__PURE__ */ jsx14(Div_default, { className: "react-better-html-no-scrollbar", width: buttonWidth, height: "100%", overflowY: "auto", children: hours.map((hour) => {
5798
+ children: /* @__PURE__ */ jsxs10(Div_default.row, { height: "100%", children: [
5799
+ /* @__PURE__ */ jsx15(Div_default, { className: "react-better-html-no-scrollbar", width: buttonWidth, height: "100%", overflowY: "auto", children: hours.map((hour) => {
5400
5800
  const isSelected = hour.toString() === valueHour;
5401
- return /* @__PURE__ */ jsx14(
5801
+ return /* @__PURE__ */ jsx15(
5402
5802
  Div_default.row,
5403
5803
  {
5404
5804
  alignItems: "center",
@@ -5411,14 +5811,14 @@ InputFieldComponent.time = forwardRef8(function Time({ ...props }, ref) {
5411
5811
  value: hour,
5412
5812
  onClickWithValue: onClickHour,
5413
5813
  ref: isSelected ? selectedHourRef : void 0,
5414
- children: /* @__PURE__ */ jsx14(Text_default, { textAlign: "center", children: hour.toString().padStart(2, "0") })
5814
+ children: /* @__PURE__ */ jsx15(Text_default, { textAlign: "center", children: hour.toString().padStart(2, "0") })
5415
5815
  },
5416
5816
  hour
5417
5817
  );
5418
5818
  }) }),
5419
- /* @__PURE__ */ jsx14(Div_default, { className: "react-better-html-no-scrollbar", width: buttonWidth, height: "100%", overflowY: "auto", children: minutes.map((minute) => {
5819
+ /* @__PURE__ */ jsx15(Div_default, { className: "react-better-html-no-scrollbar", width: buttonWidth, height: "100%", overflowY: "auto", children: minutes.map((minute) => {
5420
5820
  const isSelected = minute.toString() === valueMinute;
5421
- return /* @__PURE__ */ jsx14(
5821
+ return /* @__PURE__ */ jsx15(
5422
5822
  Div_default.row,
5423
5823
  {
5424
5824
  alignItems: "center",
@@ -5431,14 +5831,14 @@ InputFieldComponent.time = forwardRef8(function Time({ ...props }, ref) {
5431
5831
  value: minute,
5432
5832
  onClickWithValue: onClickMinute,
5433
5833
  ref: isSelected ? selectedMinuteRef : void 0,
5434
- children: /* @__PURE__ */ jsx14(Text_default, { textAlign: "center", children: minute.toString().padStart(2, "0") })
5834
+ children: /* @__PURE__ */ jsx15(Text_default, { textAlign: "center", children: minute.toString().padStart(2, "0") })
5435
5835
  },
5436
5836
  minute
5437
5837
  );
5438
5838
  }) })
5439
5839
  ] })
5440
5840
  }
5441
- ),
5841
+ ) : void 0,
5442
5842
  holderRef,
5443
5843
  ref,
5444
5844
  ...props,
@@ -5447,7 +5847,7 @@ InputFieldComponent.time = forwardRef8(function Time({ ...props }, ref) {
5447
5847
  }
5448
5848
  );
5449
5849
  });
5450
- var InputField2 = memo15(InputFieldComponent);
5850
+ var InputField2 = memo16(InputFieldComponent);
5451
5851
  InputField2.multiline = InputFieldComponent.multiline;
5452
5852
  InputField2.email = InputFieldComponent.email;
5453
5853
  InputField2.password = InputFieldComponent.password;
@@ -5459,9 +5859,9 @@ InputField2.time = InputFieldComponent.time;
5459
5859
  var InputField_default = InputField2;
5460
5860
 
5461
5861
  // src/components/ToggleInput.tsx
5462
- import { forwardRef as forwardRef9, useCallback as useCallback9, useState as useState7 } from "react";
5862
+ import { forwardRef as forwardRef9, useCallback as useCallback10, useState as useState8 } from "react";
5463
5863
  import styled9 from "styled-components";
5464
- import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
5864
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
5465
5865
  var componentSize = 26;
5466
5866
  var switchComponentBallGap = 3;
5467
5867
  var switchComponentMouseDownDifference = 4;
@@ -5571,8 +5971,8 @@ var ToggleInputComponent = forwardRef9(function ToggleInput({
5571
5971
  const dataProps = useComponentPropsWithPrefix(props, "data");
5572
5972
  const ariaProps = useComponentPropsWithPrefix(props, "aria");
5573
5973
  const restProps = useComponentPropsWithoutStyle(props);
5574
- const [internalChecked, setInternalChecked] = useState7(false);
5575
- const onChangeElement = useCallback9(
5974
+ const [internalChecked, setInternalChecked] = useState8(false);
5975
+ const onChangeElement = useCallback10(
5576
5976
  (event) => {
5577
5977
  const newIsChecked = event.target.checked;
5578
5978
  if (controlledChecked === void 0) setInternalChecked(newIsChecked);
@@ -5581,16 +5981,16 @@ var ToggleInputComponent = forwardRef9(function ToggleInput({
5581
5981
  [onChange, controlledChecked, value]
5582
5982
  );
5583
5983
  const checked = controlledChecked ?? internalChecked;
5584
- const onClickText = useCallback9(() => {
5984
+ const onClickText = useCallback10(() => {
5585
5985
  const newIsChecked = !checked;
5586
5986
  if (controlledChecked === void 0) setInternalChecked(newIsChecked);
5587
5987
  onChange?.(newIsChecked, value);
5588
5988
  }, [checked, controlledChecked, onChange, value]);
5589
- return /* @__PURE__ */ jsxs10(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
5590
- label && /* @__PURE__ */ jsx15(Label_default, { text: label, color: labelColor, required, isError: !!errorText }),
5591
- /* @__PURE__ */ jsxs10(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5592
- /* @__PURE__ */ jsxs10(Div_default.row, { position: "relative", alignItems: "center", children: [
5593
- /* @__PURE__ */ jsx15(
5989
+ return /* @__PURE__ */ jsxs11(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
5990
+ label && /* @__PURE__ */ jsx16(Label_default, { text: label, color: labelColor, required, isError: !!errorText }),
5991
+ /* @__PURE__ */ jsxs11(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5992
+ /* @__PURE__ */ jsxs11(Div_default.row, { position: "relative", alignItems: "center", children: [
5993
+ /* @__PURE__ */ jsx16(
5594
5994
  InputElement2,
5595
5995
  {
5596
5996
  theme: theme2,
@@ -5603,7 +6003,7 @@ var ToggleInputComponent = forwardRef9(function ToggleInput({
5603
6003
  ...restProps
5604
6004
  }
5605
6005
  ),
5606
- props.type === "checkbox" ? /* @__PURE__ */ jsx15(
6006
+ props.type === "checkbox" ? /* @__PURE__ */ jsx16(
5607
6007
  Icon_default,
5608
6008
  {
5609
6009
  name: "check",
@@ -5617,7 +6017,7 @@ var ToggleInputComponent = forwardRef9(function ToggleInput({
5617
6017
  pointerEvents: "none",
5618
6018
  transition: theme2.styles.transition
5619
6019
  }
5620
- ) : props.type === "radio" ? /* @__PURE__ */ jsx15(
6020
+ ) : props.type === "radio" ? /* @__PURE__ */ jsx16(
5621
6021
  Div_default,
5622
6022
  {
5623
6023
  position: "absolute",
@@ -5633,15 +6033,15 @@ var ToggleInputComponent = forwardRef9(function ToggleInput({
5633
6033
  }
5634
6034
  ) : void 0
5635
6035
  ] }),
5636
- text && /* @__PURE__ */ jsxs10(Text_default, { color, userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
6036
+ text && /* @__PURE__ */ jsxs11(Text_default, { color, userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
5637
6037
  text,
5638
- required && !label && /* @__PURE__ */ jsxs10(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
6038
+ required && !label && /* @__PURE__ */ jsxs11(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
5639
6039
  " ",
5640
6040
  "*"
5641
6041
  ] })
5642
6042
  ] })
5643
6043
  ] }),
5644
- (errorText || infoText) && /* @__PURE__ */ jsx15(
6044
+ (errorText || infoText) && /* @__PURE__ */ jsx16(
5645
6045
  Text_default,
5646
6046
  {
5647
6047
  as: "span",
@@ -5655,10 +6055,10 @@ var ToggleInputComponent = forwardRef9(function ToggleInput({
5655
6055
  });
5656
6056
  var ToggleInput_default = {
5657
6057
  checkbox: forwardRef9(function Checkbox(props, ref) {
5658
- return /* @__PURE__ */ jsx15(ToggleInputComponent, { type: "checkbox", ref, ...props });
6058
+ return /* @__PURE__ */ jsx16(ToggleInputComponent, { type: "checkbox", ref, ...props });
5659
6059
  }),
5660
6060
  radiobutton: forwardRef9(function RadioButton(props, ref) {
5661
- return /* @__PURE__ */ jsx15(ToggleInputComponent, { type: "radio", ref, ...props });
6061
+ return /* @__PURE__ */ jsx16(ToggleInputComponent, { type: "radio", ref, ...props });
5662
6062
  }),
5663
6063
  switch: forwardRef9(function Switch({
5664
6064
  label,
@@ -5681,15 +6081,15 @@ var ToggleInput_default = {
5681
6081
  const [internalChecked, setInternalChecked] = useBooleanState();
5682
6082
  const [isMouseDown, setIsMouseDown] = useBooleanState();
5683
6083
  const checked = controlledChecked ?? internalChecked;
5684
- const onClickElement = useCallback9(() => {
6084
+ const onClickElement = useCallback10(() => {
5685
6085
  if (disabled) return;
5686
6086
  const newIsChecked = !checked;
5687
6087
  if (controlledChecked === void 0) setInternalChecked.setState(newIsChecked);
5688
6088
  onChange?.(newIsChecked, value);
5689
6089
  }, [disabled, checked, onChange, controlledChecked, value]);
5690
- return /* @__PURE__ */ jsxs10(Div_default.column, { width: "fit-content", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
5691
- label && /* @__PURE__ */ jsx15(Label_default, { text: label, color: labelColor, required, isError: !!errorText }),
5692
- /* @__PURE__ */ jsx15(
6090
+ return /* @__PURE__ */ jsxs11(Div_default.column, { width: "fit-content", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
6091
+ label && /* @__PURE__ */ jsx16(Label_default, { text: label, color: labelColor, required, isError: !!errorText }),
6092
+ /* @__PURE__ */ jsx16(
5693
6093
  Div_default.row,
5694
6094
  {
5695
6095
  alignItems: "center",
@@ -5700,7 +6100,7 @@ var ToggleInput_default = {
5700
6100
  onTouchStart: setIsMouseDown.setTrue,
5701
6101
  onTouchEnd: setIsMouseDown.setFalse,
5702
6102
  onTouchCancel: setIsMouseDown.setFalse,
5703
- children: /* @__PURE__ */ jsx15(
6103
+ children: /* @__PURE__ */ jsx16(
5704
6104
  SwitchElement,
5705
6105
  {
5706
6106
  theme: theme2,
@@ -5716,7 +6116,7 @@ var ToggleInput_default = {
5716
6116
  )
5717
6117
  }
5718
6118
  ),
5719
- (errorText || infoText) && /* @__PURE__ */ jsx15(
6119
+ (errorText || infoText) && /* @__PURE__ */ jsx16(
5720
6120
  Text_default,
5721
6121
  {
5722
6122
  as: "span",
@@ -5731,8 +6131,8 @@ var ToggleInput_default = {
5731
6131
  };
5732
6132
 
5733
6133
  // src/components/Form.tsx
5734
- import { memo as memo16, useMemo as useMemo5 } from "react";
5735
- import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
6134
+ import { memo as memo17, useMemo as useMemo6 } from "react";
6135
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
5736
6136
  function Form({
5737
6137
  form,
5738
6138
  submitButtonText,
@@ -5749,7 +6149,7 @@ function Form({
5749
6149
  ...props
5750
6150
  }) {
5751
6151
  const theme2 = useTheme();
5752
- const submitButtonIsDisabledInternal = useMemo5(() => {
6152
+ const submitButtonIsDisabledInternal = useMemo6(() => {
5753
6153
  if (!form || !form.requiredFields) return false;
5754
6154
  return Object.entries(form.values).some(
5755
6155
  ([key, value]) => form.requiredFields?.includes(key) && (value === void 0 || value === null || value?.toString().trim() === "")
@@ -5757,9 +6157,9 @@ function Form({
5757
6157
  }, [form]);
5758
6158
  const SubmitButtonTag = isDestructive ? Button_default.destructive : Button_default;
5759
6159
  const submitButtonIsDisabledFinal = submitButtonIsDisabled || submitButtonIsDisabledInternal;
5760
- return /* @__PURE__ */ jsx16(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ jsxs11("form", { onSubmit: onSubmit ?? form?.onSubmit, children: [
5761
- gap !== void 0 ? /* @__PURE__ */ jsx16(Div_default.column, { gap, children }) : children,
5762
- submitButtonText && /* @__PURE__ */ jsxs11(
6160
+ return /* @__PURE__ */ jsx17(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ jsxs12("form", { onSubmit: onSubmit ?? form?.onSubmit, children: [
6161
+ gap !== void 0 ? /* @__PURE__ */ jsx17(Div_default.column, { gap, children }) : children,
6162
+ submitButtonText && /* @__PURE__ */ jsxs12(
5763
6163
  Div_default.row,
5764
6164
  {
5765
6165
  alignItems: "center",
@@ -5767,8 +6167,8 @@ function Form({
5767
6167
  gap: theme2.styles.gap,
5768
6168
  marginTop: theme2.styles.space,
5769
6169
  children: [
5770
- onClickCancel && /* @__PURE__ */ jsx16(Button_default.secondary, { text: "Cancel", onClick: onClickCancel }),
5771
- /* @__PURE__ */ jsx16(
6170
+ onClickCancel && /* @__PURE__ */ jsx17(Button_default.secondary, { text: "Cancel", onClick: onClickCancel }),
6171
+ /* @__PURE__ */ jsx17(
5772
6172
  SubmitButtonTag,
5773
6173
  {
5774
6174
  text: submitButtonText,
@@ -5784,19 +6184,19 @@ function Form({
5784
6184
  )
5785
6185
  ] }) });
5786
6186
  }
5787
- var Form_default = memo16(Form);
6187
+ var Form_default = memo17(Form);
5788
6188
 
5789
6189
  // src/components/FormRow.tsx
5790
- import { forwardRef as forwardRef10, memo as memo17 } from "react";
5791
- import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
6190
+ import { forwardRef as forwardRef10, memo as memo18 } from "react";
6191
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
5792
6192
  var FormRowComponent = forwardRef10(function FormRow({ oneItemOnly, noBreakingPoint, gap, children, ...props }, ref) {
5793
6193
  const theme2 = useTheme();
5794
6194
  const mediaQuery = useMediaQuery();
5795
6195
  const breakingPoint = !noBreakingPoint ? mediaQuery.size900 : false;
5796
6196
  const readyGap = breakingPoint || noBreakingPoint && mediaQuery.size900 ? theme2.styles.gap : theme2.styles.space * 2;
5797
- return /* @__PURE__ */ jsxs12(Div_default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref, children: [
6197
+ return /* @__PURE__ */ jsxs13(Div_default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref, children: [
5798
6198
  children,
5799
- oneItemOnly && /* @__PURE__ */ jsx17(Div_default, { width: "100%" })
6199
+ oneItemOnly && /* @__PURE__ */ jsx18(Div_default, { width: "100%" })
5800
6200
  ] });
5801
6201
  });
5802
6202
  FormRowComponent.withTitle = forwardRef10(function WithTitle({
@@ -5813,15 +6213,15 @@ FormRowComponent.withTitle = forwardRef10(function WithTitle({
5813
6213
  }, ref) {
5814
6214
  const theme2 = useTheme();
5815
6215
  const mediaQuery = useMediaQuery();
5816
- return /* @__PURE__ */ jsxs12(FormRowComponent, { ...props, ref, children: [
5817
- /* @__PURE__ */ jsxs12(Div_default.row, { width: "100%", alignItems: "center", gap: theme2.styles.space, children: [
5818
- icon && /* @__PURE__ */ jsx17(Icon_default, { name: icon }),
5819
- /* @__PURE__ */ jsxs12(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
5820
- /* @__PURE__ */ jsx17(Text_default, { as: "h3", children: title }),
5821
- description && /* @__PURE__ */ jsx17(Text_default, { color: theme2.colors.textSecondary, children: description })
6216
+ return /* @__PURE__ */ jsxs13(FormRowComponent, { ...props, ref, children: [
6217
+ /* @__PURE__ */ jsxs13(Div_default.row, { width: "100%", alignItems: "center", gap: theme2.styles.space, children: [
6218
+ icon && /* @__PURE__ */ jsx18(Icon_default, { name: icon }),
6219
+ /* @__PURE__ */ jsxs13(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
6220
+ /* @__PURE__ */ jsx18(Text_default, { as: "h3", children: title }),
6221
+ description && /* @__PURE__ */ jsx18(Text_default, { color: theme2.colors.textSecondary, children: description })
5822
6222
  ] })
5823
6223
  ] }),
5824
- /* @__PURE__ */ jsxs12(
6224
+ /* @__PURE__ */ jsxs13(
5825
6225
  Div_default.row,
5826
6226
  {
5827
6227
  width: props.noBreakingPoint && mediaQuery.size900 ? void 0 : "100%",
@@ -5829,22 +6229,22 @@ FormRowComponent.withTitle = forwardRef10(function WithTitle({
5829
6229
  gap: theme2.styles.gap,
5830
6230
  children: [
5831
6231
  children,
5832
- withActions && /* @__PURE__ */ jsxs12(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5833
- onClickReset && /* @__PURE__ */ jsx17(Button_default.icon, { icon: "XMark", loaderName: resetButtonLoaderName, onClick: onClickReset }),
5834
- /* @__PURE__ */ jsx17(Button_default.icon, { icon: "check", loaderName: saveButtonLoaderName, onClick: onClickSave })
6232
+ withActions && /* @__PURE__ */ jsxs13(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
6233
+ onClickReset && /* @__PURE__ */ jsx18(Button_default.icon, { icon: "XMark", loaderName: resetButtonLoaderName, onClick: onClickReset }),
6234
+ /* @__PURE__ */ jsx18(Button_default.icon, { icon: "check", loaderName: saveButtonLoaderName, onClick: onClickSave })
5835
6235
  ] })
5836
6236
  ]
5837
6237
  }
5838
6238
  )
5839
6239
  ] });
5840
6240
  });
5841
- var FormRow2 = memo17(FormRowComponent);
6241
+ var FormRow2 = memo18(FormRowComponent);
5842
6242
  FormRow2.withTitle = FormRowComponent.withTitle;
5843
6243
  var FormRow_default = FormRow2;
5844
6244
 
5845
6245
  // src/components/ColorThemeSwitch.tsx
5846
- import { memo as memo18, useEffect as useEffect7 } from "react";
5847
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
6246
+ import { memo as memo19, useEffect as useEffect8 } from "react";
6247
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
5848
6248
  var ColorThemeSwitchComponent = function ColorThemeSwitch({
5849
6249
  withMoon,
5850
6250
  className,
@@ -5855,7 +6255,7 @@ var ColorThemeSwitchComponent = function ColorThemeSwitch({
5855
6255
  darkMode: localStorage.getItem("theme") === "dark"
5856
6256
  }
5857
6257
  });
5858
- useEffect7(() => {
6258
+ useEffect8(() => {
5859
6259
  const timeout = setTimeout(() => {
5860
6260
  window.document.body.parentElement?.setAttribute("data-theme", form.values.darkMode ? "dark" : "light");
5861
6261
  localStorage.setItem("theme", form.values.darkMode ? "dark" : "light");
@@ -5864,7 +6264,7 @@ var ColorThemeSwitchComponent = function ColorThemeSwitch({
5864
6264
  clearTimeout(timeout);
5865
6265
  };
5866
6266
  }, [form.values.darkMode]);
5867
- useEffect7(() => {
6267
+ useEffect8(() => {
5868
6268
  const html = document.querySelector("html");
5869
6269
  if (!html) return;
5870
6270
  const observer = new MutationObserver((mutations) => {
@@ -5881,7 +6281,7 @@ var ColorThemeSwitchComponent = function ColorThemeSwitch({
5881
6281
  observer.disconnect();
5882
6282
  };
5883
6283
  }, []);
5884
- return /* @__PURE__ */ jsx18(
6284
+ return /* @__PURE__ */ jsx19(
5885
6285
  ToggleInput_default.switch,
5886
6286
  {
5887
6287
  className: `react-better-html-color-theme-switch ${withMoon ? ` react-better-html-color-theme-switch-with-moon` : ""}${className ? ` ${className}` : ""}`,
@@ -5892,20 +6292,20 @@ var ColorThemeSwitchComponent = function ColorThemeSwitch({
5892
6292
  };
5893
6293
  ColorThemeSwitchComponent.withText = function WithText({ withMoon, className, ...props }) {
5894
6294
  const theme2 = useTheme();
5895
- return /* @__PURE__ */ jsxs13(Div_default.row, { width: "fit-content", alignItems: "center", gap: theme2.styles.gap, userSelect: "none", ...props, children: [
5896
- /* @__PURE__ */ jsx18(Text_default, { children: "Light" }),
5897
- /* @__PURE__ */ jsx18(ColorThemeSwitchComponent, { withMoon, className }),
5898
- /* @__PURE__ */ jsx18(Text_default, { children: "Dark" })
6295
+ return /* @__PURE__ */ jsxs14(Div_default.row, { width: "fit-content", alignItems: "center", gap: theme2.styles.gap, userSelect: "none", ...props, children: [
6296
+ /* @__PURE__ */ jsx19(Text_default, { children: "Light" }),
6297
+ /* @__PURE__ */ jsx19(ColorThemeSwitchComponent, { withMoon, className }),
6298
+ /* @__PURE__ */ jsx19(Text_default, { children: "Dark" })
5899
6299
  ] });
5900
6300
  };
5901
- var ColorThemeSwitch2 = memo18(ColorThemeSwitchComponent);
6301
+ var ColorThemeSwitch2 = memo19(ColorThemeSwitchComponent);
5902
6302
  ColorThemeSwitch2.withText = ColorThemeSwitchComponent.withText;
5903
6303
  var ColorThemeSwitch_default = ColorThemeSwitch2;
5904
6304
 
5905
6305
  // src/components/Table.tsx
5906
- import { forwardRef as forwardRef11, memo as memo19, useCallback as useCallback10, useMemo as useMemo6, useState as useState8 } from "react";
6306
+ import { forwardRef as forwardRef11, memo as memo20, useCallback as useCallback11, useMemo as useMemo7, useState as useState9 } from "react";
5907
6307
  import styled10, { css as css2 } from "styled-components";
5908
- import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
6308
+ import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
5909
6309
  var defaultImageWidth = 120;
5910
6310
  var TableStyledComponent = styled10.table.withConfig({
5911
6311
  shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "colorTheme", "theme"].includes(prop)
@@ -5983,8 +6383,8 @@ var TableComponent = forwardRef11(function Table({
5983
6383
  }, ref) {
5984
6384
  const { colorTheme } = useBetterHtmlContext();
5985
6385
  const theme2 = useTheme();
5986
- const [checkedItems, setCheckedItems] = useState8([]);
5987
- const renderCellContent = useCallback10(
6386
+ const [checkedItems, setCheckedItems] = useState9([]);
6387
+ const renderCellContent = useCallback11(
5988
6388
  (column, item, index) => {
5989
6389
  switch (column.type) {
5990
6390
  case "text": {
@@ -5992,17 +6392,17 @@ var TableComponent = forwardRef11(function Table({
5992
6392
  return column.format ? column.format(item, index) : String(value ?? "");
5993
6393
  }
5994
6394
  case "element": {
5995
- return column.render?.(item, index) ?? /* @__PURE__ */ jsx19(Fragment3, {});
6395
+ return column.render?.(item, index) ?? /* @__PURE__ */ jsx20(Fragment3, {});
5996
6396
  }
5997
6397
  case "image": {
5998
6398
  const { type, keyName, ...props2 } = column;
5999
6399
  const src = keyName ? item[keyName] : void 0;
6000
- return /* @__PURE__ */ jsx19(Image_default, { src, width: defaultImageWidth, borderRadius: theme2.styles.borderRadius / 2, ...props2 });
6400
+ return /* @__PURE__ */ jsx20(Image_default, { src, width: defaultImageWidth, borderRadius: theme2.styles.borderRadius / 2, ...props2 });
6001
6401
  }
6002
6402
  case "checkbox": {
6003
6403
  const { type, onChange, ...props2 } = column;
6004
6404
  const checkedValue = checkedItems[index];
6005
- return /* @__PURE__ */ jsx19(
6405
+ return /* @__PURE__ */ jsx20(
6006
6406
  ToggleInput_default.checkbox,
6007
6407
  {
6008
6408
  checked: checkedValue,
@@ -6017,29 +6417,29 @@ var TableComponent = forwardRef11(function Table({
6017
6417
  );
6018
6418
  }
6019
6419
  default: {
6020
- return /* @__PURE__ */ jsx19(Fragment3, {});
6420
+ return /* @__PURE__ */ jsx20(Fragment3, {});
6021
6421
  }
6022
6422
  }
6023
6423
  },
6024
6424
  [theme2, checkedItems]
6025
6425
  );
6026
- const onClickRowElement = useCallback10(
6426
+ const onClickRowElement = useCallback11(
6027
6427
  (item, index) => {
6028
6428
  onClickRow?.(item, index);
6029
6429
  },
6030
6430
  [onClickRow]
6031
6431
  );
6032
- const onClickAllCheckboxesElement = useCallback10(
6432
+ const onClickAllCheckboxesElement = useCallback11(
6033
6433
  (checked) => {
6034
6434
  onClickAllCheckboxes?.(checked);
6035
6435
  setCheckedItems(data.map(() => checked));
6036
6436
  },
6037
6437
  [onClickAllCheckboxes, data]
6038
6438
  );
6039
- const everythingIsChecked = useMemo6(() => {
6439
+ const everythingIsChecked = useMemo7(() => {
6040
6440
  return checkedItems.every((checked) => checked) && checkedItems.length === data.length;
6041
6441
  }, [data, checkedItems]);
6042
- return /* @__PURE__ */ jsx19(
6442
+ return /* @__PURE__ */ jsx20(
6043
6443
  Div_default,
6044
6444
  {
6045
6445
  border: `1px solid ${theme2.colors.border}`,
@@ -6047,7 +6447,7 @@ var TableComponent = forwardRef11(function Table({
6047
6447
  overflow: "auto",
6048
6448
  ...props,
6049
6449
  ref,
6050
- children: /* @__PURE__ */ jsxs14(
6450
+ children: /* @__PURE__ */ jsxs15(
6051
6451
  TableStyledComponent,
6052
6452
  {
6053
6453
  isStriped,
@@ -6056,14 +6456,14 @@ var TableComponent = forwardRef11(function Table({
6056
6456
  colorTheme,
6057
6457
  theme: theme2,
6058
6458
  children: [
6059
- /* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsx19("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ jsx19(
6459
+ /* @__PURE__ */ jsx20("thead", { children: /* @__PURE__ */ jsx20("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ jsx20(
6060
6460
  ThStyledComponent,
6061
6461
  {
6062
6462
  width: column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : column.width,
6063
6463
  minWidth: column.minWidth,
6064
6464
  maxWidth: column.maxWidth,
6065
6465
  textAlign: column.align,
6066
- children: column.label ?? (column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ jsx19(
6466
+ children: column.label ?? (column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ jsx20(
6067
6467
  ToggleInput_default.checkbox,
6068
6468
  {
6069
6469
  checked: everythingIsChecked,
@@ -6073,86 +6473,24 @@ var TableComponent = forwardRef11(function Table({
6073
6473
  },
6074
6474
  column.type + column.label + index
6075
6475
  )) }) }),
6076
- /* @__PURE__ */ jsx19("tbody", { children: isLoading ? /* @__PURE__ */ jsx19("tr", { children: /* @__PURE__ */ jsx19("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx19(Loader_default.box, {}) }) }) : data.length > 0 ? data.map((item, rowIndex) => /* @__PURE__ */ jsx19(
6476
+ /* @__PURE__ */ jsx20("tbody", { children: isLoading ? /* @__PURE__ */ jsx20("tr", { children: /* @__PURE__ */ jsx20("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx20(Loader_default.box, {}) }) }) : data.length > 0 ? data.map((item, rowIndex) => /* @__PURE__ */ jsx20(
6077
6477
  "tr",
6078
6478
  {
6079
6479
  className: onClickRow ? "isClickable" : void 0,
6080
6480
  onClick: () => onClickRowElement(item, rowIndex),
6081
- children: columns.map((column, colIndex) => /* @__PURE__ */ jsx19(TdStyledComponent, { textAlign: column.align, children: renderCellContent(column, item, rowIndex) }, column.type + column.label + colIndex))
6481
+ children: columns.map((column, colIndex) => /* @__PURE__ */ jsx20(TdStyledComponent, { textAlign: column.align, children: renderCellContent(column, item, rowIndex) }, column.type + column.label + colIndex))
6082
6482
  },
6083
6483
  JSON.stringify(item) + rowIndex
6084
- )) : /* @__PURE__ */ jsx19("tr", { children: /* @__PURE__ */ jsx19("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx19(Text_default.unknown, { children: noDataItemsMessage }) }) }) })
6484
+ )) : /* @__PURE__ */ jsx20("tr", { children: /* @__PURE__ */ jsx20("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx20(Text_default.unknown, { children: noDataItemsMessage }) }) }) })
6085
6485
  ]
6086
6486
  }
6087
6487
  )
6088
6488
  }
6089
6489
  );
6090
6490
  });
6091
- var Table2 = memo19(TableComponent);
6491
+ var Table2 = memo20(TableComponent);
6092
6492
  var Table_default = Table2;
6093
6493
 
6094
- // src/utils/functions.ts
6095
- var generateRandomString = (stringLength, options) => {
6096
- const capitals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
6097
- const lowers = "abcdefghijklmnopqrstuvwxyz";
6098
- const numbers = "0123456789";
6099
- const includes = [];
6100
- if (options?.includeCapitalLetters !== false) includes.push(capitals);
6101
- if (options?.includeLowerLetters !== false) includes.push(lowers);
6102
- if (options?.includeNumbers !== false) includes.push(numbers);
6103
- const characters = includes.join("");
6104
- const dashSections = Math.max(1, options?.dashSections ?? 1);
6105
- const dashSectionLength = Math.floor(stringLength / dashSections);
6106
- if (stringLength < dashSections) return "";
6107
- let result = "";
6108
- let currentSectionLength = 0;
6109
- while (result.length < stringLength) {
6110
- if (currentSectionLength >= dashSectionLength) {
6111
- result += "-";
6112
- currentSectionLength = 0;
6113
- }
6114
- if (result.length < stringLength) {
6115
- result += characters.charAt(Math.floor(Math.random() * characters.length));
6116
- currentSectionLength += 1;
6117
- }
6118
- }
6119
- return result;
6120
- };
6121
- var getBrowser = () => {
6122
- const userAgent = navigator.userAgent.toLowerCase();
6123
- if (userAgent.includes("firefox")) return "firefox";
6124
- if (userAgent.includes("chrome") && !userAgent.includes("edg")) return "chrome";
6125
- if (userAgent.includes("safari") && !userAgent.includes("chrome")) return "safari";
6126
- if (userAgent.includes("edg")) return "edge";
6127
- if (userAgent.includes("opr") || userAgent.includes("opera")) return "opera";
6128
- return;
6129
- };
6130
- var formatPhoneNumber = (phoneNumber) => {
6131
- const cleanPhoneNumber = phoneNumber.replace(/\D/g, "");
6132
- const country = countries.find(
6133
- (country2) => country2.phoneNumberExtension === cleanPhoneNumber.slice(0, country2.phoneNumberExtension.length)
6134
- );
6135
- if (!country) return phoneNumber;
6136
- let phonNumberRest = cleanPhoneNumber.slice(country.phoneNumberExtension.length);
6137
- if (country.phoneNumberFormat) {
6138
- let formattedNumber = "";
6139
- let index = 0;
6140
- for (const char of country.phoneNumberFormat) {
6141
- if (char === "X" && index < phonNumberRest.length) {
6142
- formattedNumber += phonNumberRest[index];
6143
- index++;
6144
- } else {
6145
- formattedNumber += char;
6146
- }
6147
- }
6148
- phonNumberRest = formattedNumber.replace(/X/g, "").trim();
6149
- }
6150
- return `+${country.phoneNumberExtension} ${phonNumberRest}`;
6151
- };
6152
- var getFormErrorObject = (formValues) => {
6153
- return {};
6154
- };
6155
-
6156
6494
  // src/utils/variableFunctions.ts
6157
6495
  var checkBetterHtmlContextValue = (value, functionsName) => {
6158
6496
  if (value === void 0) {