@julseb-lib/react 1.0.61 → 1.0.62

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
@@ -556,7 +556,7 @@ declare const usePagination: ({ currentPage, setCurrentPage, totalPages, }: ILib
556
556
  */
557
557
  declare const useTextLineCount: (text: string, fontSize?: number) => {
558
558
  visualLines: number;
559
- elementRef: react.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
559
+ elementRef: react.RefObject<HTMLTextAreaElement | HTMLInputElement | null>;
560
560
  };
561
561
 
562
562
  /**
@@ -1737,6 +1737,8 @@ declare const countries: Array<LibCountry>;
1737
1737
  * @prop {number} [props.max=100] - Maximum allowed value for the counter.
1738
1738
  * @prop {number} [props.step=1] - Increment/decrement step value.
1739
1739
  * @prop {string} [containerClassName] - Additional CSS classes for the container.
1740
+ * @param props.onClickPlus - Callback function triggered when plus button is clicked
1741
+ * @param props.onClickMinus - Callback function triggered when minus button is clicked
1740
1742
  * @prop {any} [props.rest] - Additional props spread to the input or span element.
1741
1743
  *
1742
1744
  * @returns {JSX.Element} The rendered InputCounter component.
package/dist/index.d.ts CHANGED
@@ -556,7 +556,7 @@ declare const usePagination: ({ currentPage, setCurrentPage, totalPages, }: ILib
556
556
  */
557
557
  declare const useTextLineCount: (text: string, fontSize?: number) => {
558
558
  visualLines: number;
559
- elementRef: react.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
559
+ elementRef: react.RefObject<HTMLTextAreaElement | HTMLInputElement | null>;
560
560
  };
561
561
 
562
562
  /**
@@ -1737,6 +1737,8 @@ declare const countries: Array<LibCountry>;
1737
1737
  * @prop {number} [props.max=100] - Maximum allowed value for the counter.
1738
1738
  * @prop {number} [props.step=1] - Increment/decrement step value.
1739
1739
  * @prop {string} [containerClassName] - Additional CSS classes for the container.
1740
+ * @param props.onClickPlus - Callback function triggered when plus button is clicked
1741
+ * @param props.onClickMinus - Callback function triggered when minus button is clicked
1740
1742
  * @prop {any} [props.rest] - Additional props spread to the input or span element.
1741
1743
  *
1742
1744
  * @returns {JSX.Element} The rendered InputCounter component.
package/dist/index.js CHANGED
@@ -65967,6 +65967,8 @@ var InputCounter = ({
65967
65967
  max = 100,
65968
65968
  step = 1,
65969
65969
  containerClassName,
65970
+ onClickPlus,
65971
+ onClickMinus,
65970
65972
  ...rest
65971
65973
  }) => {
65972
65974
  return /* @__PURE__ */ jsx314(
@@ -65998,7 +66000,10 @@ var InputCounter = ({
65998
66000
  "aria-label": labelButtons?.minus,
65999
66001
  tooltip: labelButtons?.minus ?? "Minus",
66000
66002
  showTooltip: showButtonsTooltip && { offset: "xs" },
66001
- onClick: () => setValue((prev) => prev - step),
66003
+ onClick: () => {
66004
+ setValue((prev) => prev - step);
66005
+ if (onClickMinus) onClickMinus();
66006
+ },
66002
66007
  disabled: value === min
66003
66008
  }
66004
66009
  ),
@@ -66032,7 +66037,10 @@ var InputCounter = ({
66032
66037
  "aria-label": labelButtons?.plus,
66033
66038
  tooltip: labelButtons?.plus ?? "Plus",
66034
66039
  showTooltip: showButtonsTooltip && { offset: "xs" },
66035
- onClick: () => setValue((prev) => prev + step),
66040
+ onClick: () => {
66041
+ setValue((prev) => prev + step);
66042
+ if (onClickPlus) onClickPlus();
66043
+ },
66036
66044
  disabled: value === max
66037
66045
  }
66038
66046
  )