@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.cjs CHANGED
@@ -2686,6 +2686,7 @@ var init_Image = __esm({
2686
2686
  caption,
2687
2687
  borderRadius,
2688
2688
  fit,
2689
+ alt,
2689
2690
  ...rest
2690
2691
  }) => {
2691
2692
  const Element = caption ? "figure" : "img";
@@ -2709,6 +2710,7 @@ var init_Image = __esm({
2709
2710
  typeof caption === "object" && caption.imgClasses,
2710
2711
  "image"
2711
2712
  ),
2713
+ alt,
2712
2714
  ...rest
2713
2715
  }
2714
2716
  ),
@@ -5212,7 +5214,10 @@ var import_react49 = require("react");
5212
5214
  var import_bi = require("react-icons/bi");
5213
5215
  init_Text2();
5214
5216
  init_utils();
5215
- var import_jsx_runtime52 = require("react/jsx-runtime");
5217
+ var import_jsx_runtime52 = (
5218
+ // eslint-disable-next-line
5219
+ require("react/jsx-runtime")
5220
+ );
5216
5221
  var InputContainer = ({
5217
5222
  className,
5218
5223
  element = "div",
@@ -5569,7 +5574,6 @@ var InputListItem = ({
5569
5574
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
5570
5575
  "button",
5571
5576
  {
5572
- role: "button",
5573
5577
  onClick,
5574
5578
  className: clsx(
5575
5579
  "flex items-center gap-2 p-2 w-full text-left",
@@ -6244,42 +6248,48 @@ var InputImage = ({
6244
6248
  helperBottom,
6245
6249
  validation,
6246
6250
  className: containerClassName,
6247
- children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
6248
- "label",
6251
+ children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
6252
+ "button",
6249
6253
  {
6250
- htmlFor: id,
6251
- ref,
6252
- className: clsx(
6253
- "relative flex justify-center items-center size-16 overflow-hidden text-primary-500 cursor-pointer",
6254
- validation?.status === false ? "bg-danger-50 text-danger-500" : "bg-gray-100",
6255
- disabled && "cursor-not-allowed text-gray-500",
6256
- genBorderRadius[borderRadius],
6257
- "input-image-container",
6258
- className
6259
- ),
6260
6254
  onMouseEnter: () => !disabled && setIsHovered(true),
6261
6255
  onMouseLeave: () => !disabled && setIsHovered(false),
6262
- children: [
6263
- value === "" || !value ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(EmptyContainer, { icons }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
6264
- "img",
6265
- {
6266
- src: value,
6267
- alt: "Image input",
6268
- className: "w-full h-full object-cover input-image-image"
6269
- }
6270
- ),
6271
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(HoverContainer, { isVisible: isHovered, icons }),
6272
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
6273
- "input",
6274
- {
6275
- type: "file",
6276
- id,
6277
- disabled,
6278
- className: "hidden input-image-input",
6279
- ...rest
6280
- }
6281
- )
6282
- ]
6256
+ children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
6257
+ "label",
6258
+ {
6259
+ htmlFor: id,
6260
+ ref,
6261
+ className: clsx(
6262
+ "relative flex justify-center items-center size-16 overflow-hidden text-primary-500 cursor-pointer",
6263
+ validation?.status === false ? "bg-danger-50 text-danger-500" : "bg-gray-100",
6264
+ disabled && "cursor-not-allowed text-gray-500",
6265
+ genBorderRadius[borderRadius],
6266
+ "input-image-container",
6267
+ className
6268
+ ),
6269
+ children: [
6270
+ value === "" || !value ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(EmptyContainer, { icons }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
6271
+ "img",
6272
+ {
6273
+ src: value,
6274
+ alt: "Input",
6275
+ className: "w-full h-full object-cover input-image-image"
6276
+ }
6277
+ ),
6278
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(HoverContainer, { isVisible: isHovered, icons }),
6279
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
6280
+ "input",
6281
+ {
6282
+ type: "file",
6283
+ id,
6284
+ disabled,
6285
+ className: "sr-only input-image-input",
6286
+ accept: "image/*",
6287
+ ...rest
6288
+ }
6289
+ )
6290
+ ]
6291
+ }
6292
+ )
6283
6293
  }
6284
6294
  )
6285
6295
  }
@@ -66801,7 +66811,6 @@ var InputPhone = ({
66801
66811
  "input-phone-country-button"
66802
66812
  ),
66803
66813
  onClick: () => setIsOpen(!isOpen),
66804
- role: "button",
66805
66814
  "aria-label": countryButtonAriaLabel,
66806
66815
  children: [
66807
66816
  country?.flag,
@@ -66872,7 +66881,8 @@ var InputPhone = ({
66872
66881
  className: "outline-none w-full input-phone-search",
66873
66882
  placeholder: searchPlaceholder,
66874
66883
  value: search,
66875
- onChange: (e) => setSearch(e.target.value)
66884
+ onChange: (e) => setSearch(e.target.value),
66885
+ "aria-label": "Search country"
66876
66886
  }
66877
66887
  )
66878
66888
  ]
@@ -67092,12 +67102,6 @@ var InputSlider = ({
67092
67102
  "flex items-center gap-2 w-full input-slider-container",
67093
67103
  className
67094
67104
  ),
67095
- onMouseEnter: () => {
67096
- if (showValue === "hover") setIsTooltipVisible(true);
67097
- },
67098
- onMouseLeave: () => {
67099
- if (showValue === "hover") setIsTooltipVisible(false);
67100
- },
67101
67105
  children: [
67102
67106
  showMinMax && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(Text, { tag: "small", color: "gray", className: "min-max", children: min }),
67103
67107
  /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { className: "relative w-full slider-wrapper", children: [
@@ -67126,6 +67130,13 @@ var InputSlider = ({
67126
67130
  ["--cursor-value"]: `${percentage}%`,
67127
67131
  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%)`
67128
67132
  },
67133
+ onMouseEnter: () => {
67134
+ if (showValue === "hover") setIsTooltipVisible(true);
67135
+ },
67136
+ onMouseLeave: () => {
67137
+ if (showValue === "hover")
67138
+ setIsTooltipVisible(false);
67139
+ },
67129
67140
  ...inputProps
67130
67141
  }
67131
67142
  )
@@ -67574,7 +67585,8 @@ var InputPin = ({
67574
67585
  "border border-gray-200 size-12 rounded-lg text-center focus:border-primary-500",
67575
67586
  validation?.status === false ? "focus:border-danger-500" : validation?.status === true && "focus:border-success-500",
67576
67587
  "input-pin"
67577
- )
67588
+ ),
67589
+ "aria-label": `Input pin ${i + 1}`
67578
67590
  },
67579
67591
  i
67580
67592
  );
@@ -68446,7 +68458,6 @@ var Modal = ({
68446
68458
  ),
68447
68459
  onClick: () => setIsOpen(false),
68448
68460
  "aria-label": labelClose,
68449
- role: "button",
68450
68461
  type: "button",
68451
68462
  children: closeIcon
68452
68463
  }
@@ -68507,7 +68518,6 @@ var DragListItem = ({
68507
68518
  /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
68508
68519
  "button",
68509
68520
  {
68510
- role: "button",
68511
68521
  "aria-label": iconLabel,
68512
68522
  className: clsx(
68513
68523
  "outline-none cursor-grab! active:cursor-grabbing",
@@ -68823,7 +68833,8 @@ var Paginator = ({
68823
68833
  "[&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [appearance:textfield]",
68824
68834
  "paginator-input"
68825
68835
  ),
68826
- size: currentPage.toString().length + 1
68836
+ size: currentPage.toString().length + 1,
68837
+ "aria-label": "Change page"
68827
68838
  }
68828
68839
  ),
68829
68840
  " ",
@@ -69247,7 +69258,6 @@ var SlideshowButton = ({
69247
69258
  onClick,
69248
69259
  "aria-label": position === "left" ? controls?.labelPrev ?? "Previous" : controls?.labelNext ?? "Next",
69249
69260
  type: "button",
69250
- role: "button",
69251
69261
  children: position === "left" ? controls?.icons?.prev ?? /* @__PURE__ */ (0, import_jsx_runtime354.jsx)(
69252
69262
  import_bi22.BiChevronLeft,
69253
69263
  {
@@ -69305,6 +69315,7 @@ var SlideshowPagination = ({
69305
69315
  setActive(i);
69306
69316
  handleClick(i);
69307
69317
  },
69318
+ "aria-label": `Set image ${i + 1} active`,
69308
69319
  children: /* @__PURE__ */ (0, import_jsx_runtime355.jsx)(
69309
69320
  "img",
69310
69321
  {
@@ -69312,7 +69323,8 @@ var SlideshowPagination = ({
69312
69323
  className: clsx(
69313
69324
  "w-full h-full object-cover",
69314
69325
  "slideshow-thumbnail"
69315
- )
69326
+ ),
69327
+ alt: `Slideshow ${i + 1}`
69316
69328
  }
69317
69329
  )
69318
69330
  },
@@ -69321,7 +69333,6 @@ var SlideshowPagination = ({
69321
69333
  "button",
69322
69334
  {
69323
69335
  className: clsx(
69324
- "",
69325
69336
  type === "dots-outline" ? outlineColor[color ?? "primary"] : genBgColor2[color ?? "primary"],
69326
69337
  active === n && "active",
69327
69338
  type === "dots" && [
@@ -69336,7 +69347,8 @@ var SlideshowPagination = ({
69336
69347
  onClick: () => {
69337
69348
  setActive(n);
69338
69349
  handleClick(n);
69339
- }
69350
+ },
69351
+ "aria-label": `Set image ${n + 1} active`
69340
69352
  },
69341
69353
  n
69342
69354
  ))
@@ -69363,7 +69375,6 @@ var outlineColor = {
69363
69375
  };
69364
69376
 
69365
69377
  // src/lib/components/Slideshow/Slideshow.tsx
69366
- init_Image2();
69367
69378
  init_utils();
69368
69379
  var import_jsx_runtime356 = require("react/jsx-runtime");
69369
69380
  var Slideshow = ({
@@ -69526,6 +69537,9 @@ var Slideshow = ({
69526
69537
  userSelect: "none",
69527
69538
  WebkitUserSelect: "none"
69528
69539
  },
69540
+ "aria-label": "Slides wrapper",
69541
+ role: "slider",
69542
+ tabIndex: 0,
69529
69543
  children: /* @__PURE__ */ (0, import_jsx_runtime356.jsx)(
69530
69544
  "div",
69531
69545
  {
@@ -69540,27 +69554,21 @@ var Slideshow = ({
69540
69554
  transitionDuration: `${options?.speed ?? 300}ms`
69541
69555
  },
69542
69556
  children: images ? images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime356.jsx)(
69543
- import_react103.Suspense,
69557
+ LazyImage,
69544
69558
  {
69545
- fallback: /* @__PURE__ */ (0, import_jsx_runtime356.jsx)("p", { children: "Loading..." }),
69546
- children: /* @__PURE__ */ (0, import_jsx_runtime356.jsx)(
69547
- Image,
69548
- {
69549
- src: img,
69550
- alt: `Slideshow image ${i + 1}`,
69551
- className: clsx(
69552
- "size-full shrink-0",
69553
- genObjectFit[imgFit],
69554
- "slideshow-image"
69555
- ),
69556
- width: "100%",
69557
- height: "100%",
69558
- fit: "cover",
69559
- borderRadius,
69560
- draggable: false
69561
- },
69562
- (0, import_utils122.uuid)()
69563
- )
69559
+ src: img,
69560
+ alt: `Slideshow image ${i + 1}`,
69561
+ className: clsx(
69562
+ "size-full shrink-0",
69563
+ genObjectFit[imgFit],
69564
+ "slideshow-image"
69565
+ ),
69566
+ width: "100%",
69567
+ height: "100%",
69568
+ borderRadius,
69569
+ draggable: false,
69570
+ skeletonClasses: "size-full",
69571
+ skeletonAnimation: "shine"
69564
69572
  },
69565
69573
  (0, import_utils122.uuid)()
69566
69574
  )) : childrenArray.map((child) => /* @__PURE__ */ (0, import_jsx_runtime356.jsx)(
@@ -70651,7 +70659,7 @@ var Drawer = ({
70651
70659
  "[&.open]:opacity-100 [&.open]:visible",
70652
70660
  "overlay"
70653
70661
  ),
70654
- onClick: () => setIsOpen(false)
70662
+ "aria-label": "Close drawer"
70655
70663
  }
70656
70664
  ),
70657
70665
  /* @__PURE__ */ (0, import_jsx_runtime371.jsxs)(
@@ -70799,7 +70807,8 @@ var Header = ({
70799
70807
  }, [hideOnScroll]);
70800
70808
  const burgerProps = {
70801
70809
  isOpen,
70802
- onClick: () => {
70810
+ onClick: (e) => {
70811
+ e.stopPropagation();
70803
70812
  if (isOpen) handleClose();
70804
70813
  else handleOpen();
70805
70814
  },
@@ -70838,7 +70847,8 @@ var Header = ({
70838
70847
  ref: el
70839
70848
  };
70840
70849
  useKeyPress("Escape", handleClose);
70841
- useClickOutside(el, () => {
70850
+ useClickOutside(el, (e) => {
70851
+ if (e.target?.closest(".header-burger")) return;
70842
70852
  if (isOpen) handleClose();
70843
70853
  });
70844
70854
  return /* @__PURE__ */ (0, import_jsx_runtime373.jsxs)(
@@ -70883,7 +70893,7 @@ var Header = ({
70883
70893
  isOpen ? "visible opacity-100" : "invisible opacity-0",
70884
70894
  "drawer-overlay"
70885
70895
  ),
70886
- onClick: handleClose
70896
+ "aria-label": "Close drawer"
70887
70897
  }
70888
70898
  ),
70889
70899
  navDesktopPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime373.jsx)("nav", { ...navProps }),