@konoma-development/react-components 0.1.17 → 0.1.19

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.
@@ -2337,6 +2337,9 @@ function Icon({
2337
2337
  name,
2338
2338
  ...props
2339
2339
  }) {
2340
+ if (process.env.NEXT_PUBLIC_PREVENT_EXTERNAL_RESOURCES === "true" && !path && name) {
2341
+ throw new Error("External resources are disabled, cannot use iconify icons");
2342
+ }
2340
2343
  return path ? /* @__PURE__ */ jsx("svg", { ...props, children: /* @__PURE__ */ jsx("use", { href: path }) }) : name ? /* @__PURE__ */ jsx(Icon$1, { icon: name, height: "none", width: "none", ...props }) : /* @__PURE__ */ jsx(Fragment, {});
2341
2344
  }
2342
2345
 
@@ -2359,6 +2362,10 @@ function Checkbox({
2359
2362
  iconClassesFilled = baseClasses$d.iconClassesFilled,
2360
2363
  value,
2361
2364
  defaultValue,
2365
+ indeterminateIconPath,
2366
+ indeterminateIconName,
2367
+ checkedIconPath,
2368
+ checkedIconName,
2362
2369
  /** UNUSED, only listed so that the typing for onInput does not clash with the onInput event of the input */
2363
2370
  onInput = () => {
2364
2371
  return;
@@ -2398,7 +2405,14 @@ function Checkbox({
2398
2405
  ...props
2399
2406
  }
2400
2407
  ),
2401
- /* @__PURE__ */ jsx("div", { className: classesFilled, children: /* @__PURE__ */ jsx(Icon, { name: indeterminate ? "heroicons:minus" : "heroicons:check-16-solid", className: iconClassesFilled }) }),
2408
+ /* @__PURE__ */ jsx("div", { className: classesFilled, children: /* @__PURE__ */ jsx(
2409
+ Icon,
2410
+ {
2411
+ name: indeterminate ? indeterminateIconName || "heroicons:minus" : checkedIconName || "heroicons:check-16-solid",
2412
+ path: indeterminate ? indeterminateIconPath : checkedIconPath,
2413
+ className: iconClassesFilled
2414
+ }
2415
+ ) }),
2402
2416
  /* @__PURE__ */ jsx("span", { className: labelClassesFilled, children: label })
2403
2417
  ] });
2404
2418
  } else if (error?.length) {
@@ -18598,6 +18612,14 @@ function Pagination({
18598
18612
  currentTotal,
18599
18613
  totalPages,
18600
18614
  showButtons,
18615
+ firstPageIconName,
18616
+ firstPageIconPath,
18617
+ previousPageIconName,
18618
+ previousPageIconPath,
18619
+ nextPageIconName,
18620
+ nextPageIconPath,
18621
+ lastPageIconName,
18622
+ lastPageIconPath,
18601
18623
  onFirstPage = () => {
18602
18624
  return;
18603
18625
  },
@@ -18635,7 +18657,8 @@ function Pagination({
18635
18657
  Icon,
18636
18658
  {
18637
18659
  className: previousPageActive ? activeIconClasses : inactiveIconClasses,
18638
- name: "lucide:chevron-first",
18660
+ name: firstPageIconName || "lucide:chevron-first",
18661
+ path: firstPageIconPath,
18639
18662
  onClick: () => previousPageActive ? onFirstPage() : void 0
18640
18663
  }
18641
18664
  ),
@@ -18643,7 +18666,8 @@ function Pagination({
18643
18666
  Icon,
18644
18667
  {
18645
18668
  className: previousPageActive ? activeIconClasses : inactiveIconClasses,
18646
- name: "lucide:chevron-left",
18669
+ name: previousPageIconName || "lucide:chevron-left",
18670
+ path: previousPageIconPath,
18647
18671
  onClick: () => previousPageActive ? onPreviousPage() : void 0
18648
18672
  }
18649
18673
  ),
@@ -18660,7 +18684,8 @@ function Pagination({
18660
18684
  Icon,
18661
18685
  {
18662
18686
  className: nextPageActive ? activeIconClasses : inactiveIconClasses,
18663
- name: "lucide:chevron-right",
18687
+ name: nextPageIconName || "lucide:chevron-right",
18688
+ path: nextPageIconPath,
18664
18689
  onClick: () => nextPageActive ? onNextPage() : void 0
18665
18690
  }
18666
18691
  ),
@@ -18668,7 +18693,8 @@ function Pagination({
18668
18693
  Icon,
18669
18694
  {
18670
18695
  className: nextPageActive ? activeIconClasses : inactiveIconClasses,
18671
- name: "lucide:chevron-last",
18696
+ name: lastPageIconName || "lucide:chevron-last",
18697
+ path: lastPageIconPath,
18672
18698
  onClick: () => nextPageActive ? onLastPage() : void 0
18673
18699
  }
18674
18700
  )
@@ -22454,6 +22480,18 @@ function Table({
22454
22480
  pagesize = 10,
22455
22481
  xToY,
22456
22482
  isInfinite = true,
22483
+ firstPageIconName,
22484
+ firstPageIconPath,
22485
+ previousPageIconName,
22486
+ previousPageIconPath,
22487
+ nextPageIconName,
22488
+ nextPageIconPath,
22489
+ lastPageIconName,
22490
+ lastPageIconPath,
22491
+ sortingAscIconName,
22492
+ sortingAscIconPath,
22493
+ sortingDescIconName,
22494
+ sortingDescIconPath,
22457
22495
  onDragRow = () => {
22458
22496
  return;
22459
22497
  },
@@ -22544,9 +22582,10 @@ function Table({
22544
22582
  {
22545
22583
  className: "h-4 w-4",
22546
22584
  name: column.sorting ? {
22547
- "+": "heroicons:chevron-down-16-solid",
22548
- "-": "heroicons:chevron-up-16-solid"
22549
- }[column.sorting] : "heroicons:chevron-up-down-16-solid"
22585
+ "+": sortingAscIconName || "heroicons:chevron-down-16-solid",
22586
+ "-": sortingDescIconName || "heroicons:chevron-up-16-solid"
22587
+ }[column.sorting] : sortingDescIconName || "heroicons:chevron-up-down-16-solid",
22588
+ path: column.sorting ? column.sorting === "+" ? sortingAscIconPath : sortingDescIconPath : void 0
22550
22589
  }
22551
22590
  ) })
22552
22591
  ] }),
@@ -22627,9 +22666,10 @@ function Table({
22627
22666
  {
22628
22667
  className: "h-4 w-4",
22629
22668
  name: column.sorting ? {
22630
- "+": "heroicons:chevron-down-16-solid",
22631
- "-": "heroicons:chevron-up-16-solid"
22632
- }[column.sorting] : "heroicons:chevron-up-down-16-solid"
22669
+ "+": sortingAscIconName || "heroicons:chevron-down-16-solid",
22670
+ "-": sortingDescIconName || "heroicons:chevron-up-16-solid"
22671
+ }[column.sorting] : sortingDescIconName || "heroicons:chevron-up-down-16-solid",
22672
+ path: column.sorting ? column.sorting === "+" ? sortingAscIconPath : sortingDescIconPath : void 0
22633
22673
  }
22634
22674
  ) })
22635
22675
  ] }),
@@ -22787,6 +22827,14 @@ function Table({
22787
22827
  currentStart,
22788
22828
  currentEnd,
22789
22829
  currentPage,
22830
+ firstPageIconName,
22831
+ firstPageIconPath,
22832
+ previousPageIconName,
22833
+ previousPageIconPath,
22834
+ nextPageIconName,
22835
+ nextPageIconPath,
22836
+ lastPageIconName,
22837
+ lastPageIconPath,
22790
22838
  totalPages,
22791
22839
  onFirstPage,
22792
22840
  onPreviousPage,
@@ -22937,7 +22985,12 @@ function Row({
22937
22985
  );
22938
22986
  }
22939
22987
 
22940
- function TableActions({ children, classes = "h-14 p-4" }) {
22988
+ function TableActions({
22989
+ children,
22990
+ classes = "h-14 p-4",
22991
+ showActionsIconName,
22992
+ showActionsIconPath
22993
+ }) {
22941
22994
  const [actionsVisible, setActionsVisible] = useState(false);
22942
22995
  const { refs, floatingStyles, context } = useFloating({
22943
22996
  open: actionsVisible,
@@ -22951,7 +23004,7 @@ function TableActions({ children, classes = "h-14 p-4" }) {
22951
23004
  const role = useRole(context);
22952
23005
  const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]);
22953
23006
  return /* @__PURE__ */ jsxs("div", { className: classes, children: [
22954
- /* @__PURE__ */ jsx("div", { ref: refs.setReference, ...getReferenceProps(), className: "cursor-pointer", children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Icon, { name: "heroicons:ellipsis-vertical-16-solid", className: "h-5 w-5" }) }) }),
23007
+ /* @__PURE__ */ jsx("div", { ref: refs.setReference, ...getReferenceProps(), className: "cursor-pointer", children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Icon, { name: showActionsIconName || "heroicons:ellipsis-vertical-16-solid", path: showActionsIconPath, className: "h-5 w-5" }) }) }),
22955
23008
  actionsVisible && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(FloatingFocusManager, { context, modal: false, children: /* @__PURE__ */ jsx(
22956
23009
  "div",
22957
23010
  {
@@ -23039,6 +23092,7 @@ function Button({
23039
23092
  iconLeftName,
23040
23093
  iconRightPath,
23041
23094
  iconRightName,
23095
+ name,
23042
23096
  onClick
23043
23097
  }) {
23044
23098
  const classes = [classesBase, className];
@@ -23065,7 +23119,7 @@ function Button({
23065
23119
  loadingClasses.push(loadingClassesAlert);
23066
23120
  break;
23067
23121
  }
23068
- return /* @__PURE__ */ jsxs("button", { onClick: async (e) => await onClick?.(e), className: classes.join(" "), disabled, type, children: [
23122
+ return /* @__PURE__ */ jsxs("button", { name, onClick: async (e) => await onClick?.(e), className: classes.join(" "), disabled, type, children: [
23069
23123
  (iconLeftPath || iconLeftName) && /* @__PURE__ */ jsx(Icon, { className: iconLeftClasses, name: iconLeftName, path: iconLeftPath }),
23070
23124
  label && /* @__PURE__ */ jsx("span", { children: label }),
23071
23125
  (iconRightPath || iconRightName) && /* @__PURE__ */ jsx(Icon, { className: iconRightClasses, name: iconRightName, path: iconRightPath }),
@@ -23089,6 +23143,8 @@ function Modal({
23089
23143
  title,
23090
23144
  footerActions,
23091
23145
  hasCloseIcon,
23146
+ closeIconName,
23147
+ closeIconPath,
23092
23148
  onClose
23093
23149
  }) {
23094
23150
  return /* @__PURE__ */ jsx(Fragment, { children: reactDomExports.createPortal(
@@ -23101,7 +23157,7 @@ function Modal({
23101
23157
  e.stopPropagation();
23102
23158
  },
23103
23159
  children: [
23104
- hasCloseIcon && /* @__PURE__ */ jsx("div", { className: closeWrapperClasses, children: /* @__PURE__ */ jsx("button", { onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "heroicons:x-mark-16-solid", className: iconClasses }) }) }),
23160
+ hasCloseIcon && /* @__PURE__ */ jsx("div", { className: closeWrapperClasses, children: /* @__PURE__ */ jsx("button", { onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: closeIconName || "heroicons:x-mark-16-solid", path: closeIconPath, className: iconClasses }) }) }),
23105
23161
  headerContent || (title ? /* @__PURE__ */ jsx("div", { className: headerWrapperClasses, children: /* @__PURE__ */ jsx("span", { className: titleClasses, children: title }) }) : null),
23106
23162
  /* @__PURE__ */ jsx("div", { className: "grow", children }),
23107
23163
  footerContent || footerActions && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: footerWrapperClasses, children: [