@julseb-lib/react 1.1.25 → 1.1.26

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
@@ -180,7 +180,7 @@ declare const genFontWeight: Record<LibFontWeights, string>;
180
180
  *
181
181
  * @see https://doc-julseb-lib-react.vercel.app/helpers/hooks#useClickOutside
182
182
  */
183
- declare const useClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: () => void, isActive?: boolean, delay?: number) => void;
183
+ declare const useClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (e?: MouseEvent) => void, isActive?: boolean, delay?: number) => void;
184
184
 
185
185
  type CopiedValue = string | null;
186
186
  type CopyFn = (text: string) => Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -180,7 +180,7 @@ declare const genFontWeight: Record<LibFontWeights, string>;
180
180
  *
181
181
  * @see https://doc-julseb-lib-react.vercel.app/helpers/hooks#useClickOutside
182
182
  */
183
- declare const useClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: () => void, isActive?: boolean, delay?: number) => void;
183
+ declare const useClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (e?: MouseEvent) => void, isActive?: boolean, delay?: number) => void;
184
184
 
185
185
  type CopiedValue = string | null;
186
186
  type CopyFn = (text: string) => Promise<boolean>;
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ import {
51
51
  libMarkdownEditorOptions,
52
52
  linkifyText,
53
53
  scrollToTop
54
- } from "./chunk-UHS3R3PM.js";
54
+ } from "./chunk-PXJ4JXEH.js";
55
55
 
56
56
  // #style-inject:#style-inject
57
57
  function styleInject(css, { insertAt } = {}) {
@@ -1425,7 +1425,7 @@ var genPosition = {
1425
1425
  // src/lib/components/LazyImage/LazyImage.tsx
1426
1426
  import { Suspense, lazy } from "react";
1427
1427
  import { jsx as jsx16 } from "react/jsx-runtime";
1428
- var Image2 = lazy(() => import("./Image-SKLDS4YE.js"));
1428
+ var Image2 = lazy(() => import("./Image-4MLJ7FPA.js"));
1429
1429
  var LazyImage = ({
1430
1430
  className,
1431
1431
  ref,
@@ -2317,7 +2317,8 @@ var InputContainer = ({
2317
2317
  ),
2318
2318
  ...rest,
2319
2319
  children: [
2320
- label && /* @__PURE__ */ jsxs10(
2320
+ label && // eslint-disable-next-line
2321
+ /* @__PURE__ */ jsxs10(
2321
2322
  "label",
2322
2323
  {
2323
2324
  htmlFor: id,
@@ -2630,7 +2631,6 @@ var InputListItem = ({
2630
2631
  return /* @__PURE__ */ jsxs11(
2631
2632
  "button",
2632
2633
  {
2633
- role: "button",
2634
2634
  onClick,
2635
2635
  className: clsx(
2636
2636
  "flex items-center gap-2 p-2 w-full text-left",
@@ -3294,42 +3294,48 @@ var InputImage = ({
3294
3294
  helperBottom,
3295
3295
  validation,
3296
3296
  className: containerClassName,
3297
- children: /* @__PURE__ */ jsxs20(
3298
- "label",
3297
+ children: /* @__PURE__ */ jsx52(
3298
+ "button",
3299
3299
  {
3300
- htmlFor: id,
3301
- ref,
3302
- className: clsx(
3303
- "relative flex justify-center items-center size-16 overflow-hidden text-primary-500 cursor-pointer",
3304
- validation?.status === false ? "bg-danger-50 text-danger-500" : "bg-gray-100",
3305
- disabled && "cursor-not-allowed text-gray-500",
3306
- genBorderRadius[borderRadius],
3307
- "input-image-container",
3308
- className
3309
- ),
3310
3300
  onMouseEnter: () => !disabled && setIsHovered(true),
3311
3301
  onMouseLeave: () => !disabled && setIsHovered(false),
3312
- children: [
3313
- value === "" || !value ? /* @__PURE__ */ jsx52(EmptyContainer, { icons }) : /* @__PURE__ */ jsx52(
3314
- "img",
3315
- {
3316
- src: value,
3317
- alt: "Image input",
3318
- className: "w-full h-full object-cover input-image-image"
3319
- }
3320
- ),
3321
- /* @__PURE__ */ jsx52(HoverContainer, { isVisible: isHovered, icons }),
3322
- /* @__PURE__ */ jsx52(
3323
- "input",
3324
- {
3325
- type: "file",
3326
- id,
3327
- disabled,
3328
- className: "hidden input-image-input",
3329
- ...rest
3330
- }
3331
- )
3332
- ]
3302
+ children: /* @__PURE__ */ jsxs20(
3303
+ "label",
3304
+ {
3305
+ htmlFor: id,
3306
+ ref,
3307
+ className: clsx(
3308
+ "relative flex justify-center items-center size-16 overflow-hidden text-primary-500 cursor-pointer",
3309
+ validation?.status === false ? "bg-danger-50 text-danger-500" : "bg-gray-100",
3310
+ disabled && "cursor-not-allowed text-gray-500",
3311
+ genBorderRadius[borderRadius],
3312
+ "input-image-container",
3313
+ className
3314
+ ),
3315
+ children: [
3316
+ value === "" || !value ? /* @__PURE__ */ jsx52(EmptyContainer, { icons }) : /* @__PURE__ */ jsx52(
3317
+ "img",
3318
+ {
3319
+ src: value,
3320
+ alt: "Input",
3321
+ className: "w-full h-full object-cover input-image-image"
3322
+ }
3323
+ ),
3324
+ /* @__PURE__ */ jsx52(HoverContainer, { isVisible: isHovered, icons }),
3325
+ /* @__PURE__ */ jsx52(
3326
+ "input",
3327
+ {
3328
+ type: "file",
3329
+ id,
3330
+ disabled,
3331
+ className: "sr-only input-image-input",
3332
+ accept: "image/*",
3333
+ ...rest
3334
+ }
3335
+ )
3336
+ ]
3337
+ }
3338
+ )
3333
3339
  }
3334
3340
  )
3335
3341
  }
@@ -63847,7 +63853,6 @@ var InputPhone = ({
63847
63853
  "input-phone-country-button"
63848
63854
  ),
63849
63855
  onClick: () => setIsOpen(!isOpen),
63850
- role: "button",
63851
63856
  "aria-label": countryButtonAriaLabel,
63852
63857
  children: [
63853
63858
  country?.flag,
@@ -63918,7 +63923,8 @@ var InputPhone = ({
63918
63923
  className: "outline-none w-full input-phone-search",
63919
63924
  placeholder: searchPlaceholder,
63920
63925
  value: search,
63921
- onChange: (e) => setSearch(e.target.value)
63926
+ onChange: (e) => setSearch(e.target.value),
63927
+ "aria-label": "Search country"
63922
63928
  }
63923
63929
  )
63924
63930
  ]
@@ -64135,12 +64141,6 @@ var InputSlider = ({
64135
64141
  "flex items-center gap-2 w-full input-slider-container",
64136
64142
  className
64137
64143
  ),
64138
- onMouseEnter: () => {
64139
- if (showValue === "hover") setIsTooltipVisible(true);
64140
- },
64141
- onMouseLeave: () => {
64142
- if (showValue === "hover") setIsTooltipVisible(false);
64143
- },
64144
64144
  children: [
64145
64145
  showMinMax && /* @__PURE__ */ jsx298(Text, { tag: "small", color: "gray", className: "min-max", children: min }),
64146
64146
  /* @__PURE__ */ jsxs265("div", { className: "relative w-full slider-wrapper", children: [
@@ -64169,6 +64169,13 @@ var InputSlider = ({
64169
64169
  ["--cursor-value"]: `${percentage}%`,
64170
64170
  background: validation?.status === false ? `linear-gradient(to right, rgb(239 68 68) 0%, rgb(239 68 68) ${percentage}%, rgb(229 231 235) ${percentage}%, rgb(229 231 235) 100%)` : validation?.status === true ? `linear-gradient(to right, rgb(34 197 94) 0%, rgb(34 197 94) ${percentage}%, rgb(229 231 235) ${percentage}%, rgb(229 231 235) 100%)` : `linear-gradient(to right, rgb(59 130 246) 0%, rgb(59 130 246) ${percentage}%, rgb(229 231 235) ${percentage}%, rgb(229 231 235) 100%)`
64171
64171
  },
64172
+ onMouseEnter: () => {
64173
+ if (showValue === "hover") setIsTooltipVisible(true);
64174
+ },
64175
+ onMouseLeave: () => {
64176
+ if (showValue === "hover")
64177
+ setIsTooltipVisible(false);
64178
+ },
64172
64179
  ...inputProps
64173
64180
  }
64174
64181
  )
@@ -64612,7 +64619,8 @@ var InputPin = ({
64612
64619
  "border border-gray-200 size-12 rounded-lg text-center focus:border-primary-500",
64613
64620
  validation?.status === false ? "focus:border-danger-500" : validation?.status === true && "focus:border-success-500",
64614
64621
  "input-pin"
64615
- )
64622
+ ),
64623
+ "aria-label": `Input pin ${i + 1}`
64616
64624
  },
64617
64625
  i
64618
64626
  );
@@ -65465,7 +65473,6 @@ var Modal = ({
65465
65473
  ),
65466
65474
  onClick: () => setIsOpen(false),
65467
65475
  "aria-label": labelClose,
65468
- role: "button",
65469
65476
  type: "button",
65470
65477
  children: closeIcon
65471
65478
  }
@@ -65524,7 +65531,6 @@ var DragListItem = ({
65524
65531
  /* @__PURE__ */ jsx320(
65525
65532
  "button",
65526
65533
  {
65527
- role: "button",
65528
65534
  "aria-label": iconLabel,
65529
65535
  className: clsx(
65530
65536
  "outline-none cursor-grab! active:cursor-grabbing",
@@ -65835,7 +65841,8 @@ var Paginator = ({
65835
65841
  "[&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [appearance:textfield]",
65836
65842
  "paginator-input"
65837
65843
  ),
65838
- size: currentPage.toString().length + 1
65844
+ size: currentPage.toString().length + 1,
65845
+ "aria-label": "Change page"
65839
65846
  }
65840
65847
  ),
65841
65848
  " ",
@@ -66220,8 +66227,7 @@ import {
66220
66227
  Children as Children3,
66221
66228
  useState as useState25,
66222
66229
  useEffect as useEffect14,
66223
- useRef as useRef15,
66224
- Suspense as Suspense2
66230
+ useRef as useRef15
66225
66231
  } from "react";
66226
66232
  import { uuid as uuid10 } from "@julseb-lib/utils";
66227
66233
 
@@ -66255,7 +66261,6 @@ var SlideshowButton = ({
66255
66261
  onClick,
66256
66262
  "aria-label": position === "left" ? controls?.labelPrev ?? "Previous" : controls?.labelNext ?? "Next",
66257
66263
  type: "button",
66258
- role: "button",
66259
66264
  children: position === "left" ? controls?.icons?.prev ?? /* @__PURE__ */ jsx332(
66260
66265
  BiChevronLeft,
66261
66266
  {
@@ -66312,6 +66317,7 @@ var SlideshowPagination = ({
66312
66317
  setActive(i);
66313
66318
  handleClick(i);
66314
66319
  },
66320
+ "aria-label": `Set image ${i + 1} active`,
66315
66321
  children: /* @__PURE__ */ jsx333(
66316
66322
  "img",
66317
66323
  {
@@ -66319,7 +66325,8 @@ var SlideshowPagination = ({
66319
66325
  className: clsx(
66320
66326
  "w-full h-full object-cover",
66321
66327
  "slideshow-thumbnail"
66322
- )
66328
+ ),
66329
+ alt: `Slideshow ${i + 1}`
66323
66330
  }
66324
66331
  )
66325
66332
  },
@@ -66328,7 +66335,6 @@ var SlideshowPagination = ({
66328
66335
  "button",
66329
66336
  {
66330
66337
  className: clsx(
66331
- "",
66332
66338
  type === "dots-outline" ? outlineColor[color ?? "primary"] : genBgColor2[color ?? "primary"],
66333
66339
  active === n && "active",
66334
66340
  type === "dots" && [
@@ -66343,7 +66349,8 @@ var SlideshowPagination = ({
66343
66349
  onClick: () => {
66344
66350
  setActive(n);
66345
66351
  handleClick(n);
66346
- }
66352
+ },
66353
+ "aria-label": `Set image ${n + 1} active`
66347
66354
  },
66348
66355
  n
66349
66356
  ))
@@ -66531,6 +66538,9 @@ var Slideshow = ({
66531
66538
  userSelect: "none",
66532
66539
  WebkitUserSelect: "none"
66533
66540
  },
66541
+ "aria-label": "Slides wrapper",
66542
+ role: "slider",
66543
+ tabIndex: 0,
66534
66544
  children: /* @__PURE__ */ jsx334(
66535
66545
  "div",
66536
66546
  {
@@ -66545,27 +66555,21 @@ var Slideshow = ({
66545
66555
  transitionDuration: `${options?.speed ?? 300}ms`
66546
66556
  },
66547
66557
  children: images ? images.map((img, i) => /* @__PURE__ */ jsx334(
66548
- Suspense2,
66558
+ LazyImage,
66549
66559
  {
66550
- fallback: /* @__PURE__ */ jsx334("p", { children: "Loading..." }),
66551
- children: /* @__PURE__ */ jsx334(
66552
- Image,
66553
- {
66554
- src: img,
66555
- alt: `Slideshow image ${i + 1}`,
66556
- className: clsx(
66557
- "size-full shrink-0",
66558
- genObjectFit[imgFit],
66559
- "slideshow-image"
66560
- ),
66561
- width: "100%",
66562
- height: "100%",
66563
- fit: "cover",
66564
- borderRadius,
66565
- draggable: false
66566
- },
66567
- uuid10()
66568
- )
66560
+ src: img,
66561
+ alt: `Slideshow image ${i + 1}`,
66562
+ className: clsx(
66563
+ "size-full shrink-0",
66564
+ genObjectFit[imgFit],
66565
+ "slideshow-image"
66566
+ ),
66567
+ width: "100%",
66568
+ height: "100%",
66569
+ borderRadius,
66570
+ draggable: false,
66571
+ skeletonClasses: "size-full",
66572
+ skeletonAnimation: "shine"
66569
66573
  },
66570
66574
  uuid10()
66571
66575
  )) : childrenArray.map((child) => /* @__PURE__ */ jsx334(
@@ -67650,7 +67654,7 @@ var Drawer = ({
67650
67654
  "[&.open]:opacity-100 [&.open]:visible",
67651
67655
  "overlay"
67652
67656
  ),
67653
- onClick: () => setIsOpen(false)
67657
+ "aria-label": "Close drawer"
67654
67658
  }
67655
67659
  ),
67656
67660
  /* @__PURE__ */ jsxs290(
@@ -67796,7 +67800,8 @@ var Header = ({
67796
67800
  }, [hideOnScroll]);
67797
67801
  const burgerProps = {
67798
67802
  isOpen,
67799
- onClick: () => {
67803
+ onClick: (e) => {
67804
+ e.stopPropagation();
67800
67805
  if (isOpen) handleClose();
67801
67806
  else handleOpen();
67802
67807
  },
@@ -67835,7 +67840,8 @@ var Header = ({
67835
67840
  ref: el
67836
67841
  };
67837
67842
  useKeyPress("Escape", handleClose);
67838
- useClickOutside(el, () => {
67843
+ useClickOutside(el, (e) => {
67844
+ if (e.target?.closest(".header-burger")) return;
67839
67845
  if (isOpen) handleClose();
67840
67846
  });
67841
67847
  return /* @__PURE__ */ jsxs291(
@@ -67880,7 +67886,7 @@ var Header = ({
67880
67886
  isOpen ? "visible opacity-100" : "invisible opacity-0",
67881
67887
  "drawer-overlay"
67882
67888
  ),
67883
- onClick: handleClose
67889
+ "aria-label": "Close drawer"
67884
67890
  }
67885
67891
  ),
67886
67892
  navDesktopPosition === "right" && /* @__PURE__ */ jsx351("nav", { ...navProps }),