@herca/r-kit 0.0.24 → 0.0.25

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.d.cts CHANGED
@@ -476,6 +476,8 @@ interface CalendarProps {
476
476
  onEventClick?: (event?: CalendarEvent) => void;
477
477
  backdropOnClick?: (day?: CalendarDay) => void;
478
478
  showDefaultController?: boolean;
479
+ onMonthChange?: (month: number) => void;
480
+ onYearChange?: (year: number) => void;
479
481
  }
480
482
  type CalendarState = {
481
483
  currentMonth: number;
@@ -533,7 +535,7 @@ declare const ItemDropdown: ({ active, value, onClick, }: {
533
535
  onClick: () => void;
534
536
  }) => react_jsx_runtime.JSX.Element;
535
537
 
536
- declare const Calendar: ({ showNavigator, showHeader, value, onChange, disabledDates, dayConfigs, defaultMonth, defaultYear, styleConfig, wrapperClassname, weekWrapperClassname, dayWrapperClassname, daysOfWeek, months, showNextNavigator, showPrevNavigator, mode, rangeValue, size, variant, events, showCalendarTooltip, type, onTypeChange, onEventClick, backdropOnClick, showDefaultController, }: CalendarProps) => react_jsx_runtime.JSX.Element;
538
+ declare const Calendar: ({ showNavigator, showHeader, value, onChange, disabledDates, dayConfigs, defaultMonth, defaultYear, styleConfig, wrapperClassname, weekWrapperClassname, dayWrapperClassname, daysOfWeek, months, showNextNavigator, showPrevNavigator, mode, rangeValue, size, variant, events, showCalendarTooltip, type, onTypeChange, onEventClick, backdropOnClick, onMonthChange, onYearChange, showDefaultController, }: CalendarProps) => react_jsx_runtime.JSX.Element;
537
539
 
538
540
  declare const getCalendarDays: ({ currentYear, currentMonth, }: GetCalendarDaysProps) => {
539
541
  date: number;
@@ -914,6 +916,7 @@ interface InputProps extends Omit<react.ComponentProps<'input'>, 'size'>, InputV
914
916
  declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
915
917
 
916
918
  interface FileItem {
919
+ id?: string;
917
920
  file: File;
918
921
  label?: string;
919
922
  hint?: string;
@@ -982,11 +985,11 @@ declare const ModalPreviewAttachment: ({ onClose, open, src, name, type, iframeP
982
985
  interface InputOTPProps {
983
986
  length?: number;
984
987
  value: string;
985
- onChange: (value: string) => void;
988
+ onChange?: (value: string) => void;
986
989
  label?: string;
987
990
  hint?: string;
988
- description?: string;
989
- errorMessages?: string | string[];
991
+ description?: string | undefined;
992
+ errorMessages?: string | string[] | undefined;
990
993
  disabled?: boolean;
991
994
  className?: string;
992
995
  size?: 'sm' | 'md' | 'lg';
@@ -1250,7 +1253,7 @@ interface TextWithChildren extends TextBaseProps {
1250
1253
  value?: never;
1251
1254
  }
1252
1255
  interface TextWithValue extends TextBaseProps {
1253
- value: string;
1256
+ value?: string | null | undefined;
1254
1257
  children?: never;
1255
1258
  }
1256
1259
  type TextProps = TextWithChildren | TextWithValue;
package/dist/index.d.ts CHANGED
@@ -476,6 +476,8 @@ interface CalendarProps {
476
476
  onEventClick?: (event?: CalendarEvent) => void;
477
477
  backdropOnClick?: (day?: CalendarDay) => void;
478
478
  showDefaultController?: boolean;
479
+ onMonthChange?: (month: number) => void;
480
+ onYearChange?: (year: number) => void;
479
481
  }
480
482
  type CalendarState = {
481
483
  currentMonth: number;
@@ -533,7 +535,7 @@ declare const ItemDropdown: ({ active, value, onClick, }: {
533
535
  onClick: () => void;
534
536
  }) => react_jsx_runtime.JSX.Element;
535
537
 
536
- declare const Calendar: ({ showNavigator, showHeader, value, onChange, disabledDates, dayConfigs, defaultMonth, defaultYear, styleConfig, wrapperClassname, weekWrapperClassname, dayWrapperClassname, daysOfWeek, months, showNextNavigator, showPrevNavigator, mode, rangeValue, size, variant, events, showCalendarTooltip, type, onTypeChange, onEventClick, backdropOnClick, showDefaultController, }: CalendarProps) => react_jsx_runtime.JSX.Element;
538
+ declare const Calendar: ({ showNavigator, showHeader, value, onChange, disabledDates, dayConfigs, defaultMonth, defaultYear, styleConfig, wrapperClassname, weekWrapperClassname, dayWrapperClassname, daysOfWeek, months, showNextNavigator, showPrevNavigator, mode, rangeValue, size, variant, events, showCalendarTooltip, type, onTypeChange, onEventClick, backdropOnClick, onMonthChange, onYearChange, showDefaultController, }: CalendarProps) => react_jsx_runtime.JSX.Element;
537
539
 
538
540
  declare const getCalendarDays: ({ currentYear, currentMonth, }: GetCalendarDaysProps) => {
539
541
  date: number;
@@ -914,6 +916,7 @@ interface InputProps extends Omit<react.ComponentProps<'input'>, 'size'>, InputV
914
916
  declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
915
917
 
916
918
  interface FileItem {
919
+ id?: string;
917
920
  file: File;
918
921
  label?: string;
919
922
  hint?: string;
@@ -982,11 +985,11 @@ declare const ModalPreviewAttachment: ({ onClose, open, src, name, type, iframeP
982
985
  interface InputOTPProps {
983
986
  length?: number;
984
987
  value: string;
985
- onChange: (value: string) => void;
988
+ onChange?: (value: string) => void;
986
989
  label?: string;
987
990
  hint?: string;
988
- description?: string;
989
- errorMessages?: string | string[];
991
+ description?: string | undefined;
992
+ errorMessages?: string | string[] | undefined;
990
993
  disabled?: boolean;
991
994
  className?: string;
992
995
  size?: 'sm' | 'md' | 'lg';
@@ -1250,7 +1253,7 @@ interface TextWithChildren extends TextBaseProps {
1250
1253
  value?: never;
1251
1254
  }
1252
1255
  interface TextWithValue extends TextBaseProps {
1253
- value: string;
1256
+ value?: string | null | undefined;
1254
1257
  children?: never;
1255
1258
  }
1256
1259
  type TextProps = TextWithChildren | TextWithValue;
package/dist/index.js CHANGED
@@ -7715,7 +7715,7 @@ var ModalPreviewAttachment = ({
7715
7715
  children: [
7716
7716
  /* @__PURE__ */ jsxs("div", { className: "flex w-full justify-between", children: [
7717
7717
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
7718
- /* @__PURE__ */ jsx("button", { onClick: onClose, className: "cursor-pointer", children: /* @__PURE__ */ jsx(Icon_default, { name: "times", color: "white" }) }),
7718
+ /* @__PURE__ */ jsx("button", { onClick: onClose, className: "cursor-pointer", type: "button", children: /* @__PURE__ */ jsx(Icon_default, { name: "times", color: "white" }) }),
7719
7719
  /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
7720
7720
  iconName && /* @__PURE__ */ jsx(Icon_default, { name: iconName, size: 48 }),
7721
7721
  /* @__PURE__ */ jsx(
@@ -7821,8 +7821,26 @@ var ZoomController = ({
7821
7821
  minZoom
7822
7822
  }) => {
7823
7823
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7824
- /* @__PURE__ */ jsx(Button, { size: "icon", onClick: onZoomIn, disabled: zoom >= maxZoom, children: /* @__PURE__ */ jsx(Icon_default, { name: "search-plus-fill" }) }),
7825
- /* @__PURE__ */ jsx(Button, { size: "icon", onClick: onZoomOut, disabled: zoom <= minZoom, children: /* @__PURE__ */ jsx(Icon_default, { name: "search-minus-fill" }) }),
7824
+ /* @__PURE__ */ jsx(
7825
+ Button,
7826
+ {
7827
+ size: "icon",
7828
+ onClick: onZoomIn,
7829
+ disabled: zoom >= maxZoom,
7830
+ type: "button",
7831
+ children: /* @__PURE__ */ jsx(Icon_default, { name: "search-plus-fill" })
7832
+ }
7833
+ ),
7834
+ /* @__PURE__ */ jsx(
7835
+ Button,
7836
+ {
7837
+ size: "icon",
7838
+ onClick: onZoomOut,
7839
+ disabled: zoom <= minZoom,
7840
+ type: "button",
7841
+ children: /* @__PURE__ */ jsx(Icon_default, { name: "search-minus-fill" })
7842
+ }
7843
+ ),
7826
7844
  /* @__PURE__ */ jsxs(Button, { color: "secondary", onClick: onDownload, children: [
7827
7845
  /* @__PURE__ */ jsx(Icon_default, { name: "download" }),
7828
7846
  /* @__PURE__ */ jsx(
@@ -8044,6 +8062,7 @@ var InputFile = forwardRef(
8044
8062
  }
8045
8063
  }
8046
8064
  const mapped = selectedFiles.map((file) => ({
8065
+ id: crypto.randomUUID(),
8047
8066
  file,
8048
8067
  customName: file.name,
8049
8068
  preview: URL.createObjectURL(file)
@@ -8321,7 +8340,7 @@ var InputFile = forwardRef(
8321
8340
  customName: customNames[i] ?? item.customName ?? item.file.name,
8322
8341
  disabled
8323
8342
  },
8324
- i
8343
+ item?.id
8325
8344
  )) })
8326
8345
  ] })
8327
8346
  ] });
@@ -8573,7 +8592,7 @@ var InputOTP = ({
8573
8592
  if (!/^\d?$/.test(char)) return;
8574
8593
  const next = [...values];
8575
8594
  next[index] = char;
8576
- onChange(next.join(""));
8595
+ onChange?.(next.join(""));
8577
8596
  if (char && index < length - 1) {
8578
8597
  focusInput(index + 1);
8579
8598
  }
@@ -9611,7 +9630,7 @@ function Textarea({
9611
9630
  description,
9612
9631
  errorMessages,
9613
9632
  className,
9614
- required: props.required,
9633
+ required: false,
9615
9634
  children: /* @__PURE__ */ jsx(
9616
9635
  "textarea",
9617
9636
  {
@@ -11201,6 +11220,8 @@ var Calendar2 = ({
11201
11220
  onTypeChange,
11202
11221
  onEventClick,
11203
11222
  backdropOnClick,
11223
+ onMonthChange,
11224
+ onYearChange,
11204
11225
  showDefaultController = false
11205
11226
  }) => {
11206
11227
  const currentDate = /* @__PURE__ */ new Date();
@@ -11276,6 +11297,8 @@ var Calendar2 = ({
11276
11297
  newMonth = 0;
11277
11298
  newYear += 1;
11278
11299
  }
11300
+ onMonthChange?.(newMonth);
11301
+ onYearChange?.(newYear);
11279
11302
  setCurrentMonth(newMonth);
11280
11303
  setCurrentYear(newYear);
11281
11304
  };