@algorithm-shift/design-system 1.2.985 → 1.2.986

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.mjs CHANGED
@@ -22,6 +22,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
22
22
  function Modal({
23
23
  isOpen,
24
24
  onModalClose,
25
+ onModalOpen,
25
26
  title,
26
27
  children,
27
28
  size = "md",
@@ -29,6 +30,11 @@ function Modal({
29
30
  className = "",
30
31
  style = {}
31
32
  }) {
33
+ useEffect(() => {
34
+ if (isOpen && onModalOpen) {
35
+ onModalOpen();
36
+ }
37
+ }, [isOpen]);
32
38
  useEffect(() => {
33
39
  const handleEscape = (e) => {
34
40
  if (e.key === "Escape") {
@@ -550,6 +556,7 @@ var Breadcrumb_default = Breadcrumb;
550
556
 
551
557
  // src/components/Basic/ButtonGroup/ButtonGroup.tsx
552
558
  import { ChevronDown } from "lucide-react";
559
+ import Link2 from "next/link";
553
560
 
554
561
  // src/components/ui/dropdown-menu.tsx
555
562
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
@@ -668,9 +675,9 @@ function DropdownMenuSubContent({
668
675
  }
669
676
 
670
677
  // src/components/Basic/ButtonGroup/ButtonGroup.tsx
671
- import Link2 from "next/link";
672
678
  import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
673
- function SplitButton({ style, textContent, className, list = [] }) {
679
+ function ButtonGroup({ style, textContent, className, list = [], onGroupItemClick, onClick }) {
680
+ const data = Array.isArray(list) ? list : [];
674
681
  const bgColor = style?.backgroundColor || "";
675
682
  return /* @__PURE__ */ jsxs7("div", { className: "inline-flex rounded-md overflow-hidden border border-teal-200 bg-teal-700 items-center focus:ring-0", style: { backgroundColor: bgColor }, children: [
676
683
  /* @__PURE__ */ jsx17(
@@ -678,6 +685,7 @@ function SplitButton({ style, textContent, className, list = [] }) {
678
685
  {
679
686
  className: `rounded-none border-r px-4 py-2 text-whit focus:ring-0 ${className || ""}`,
680
687
  style: { backgroundColor: bgColor },
688
+ onClick: (e) => onClick?.(e),
681
689
  children: textContent || "Button"
682
690
  }
683
691
  ),
@@ -691,7 +699,24 @@ function SplitButton({ style, textContent, className, list = [] }) {
691
699
  children: /* @__PURE__ */ jsx17(ChevronDown, { className: "w-4 h-4" })
692
700
  }
693
701
  ) }),
694
- /* @__PURE__ */ jsx17(DropdownMenuContent, { align: "end", className: "bg-white min-w-[120px]", children: list.map((item) => /* @__PURE__ */ jsx17(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ jsx17(Link2, { href: item.url || "#", children: item.header }) }, item.id)) })
702
+ /* @__PURE__ */ jsx17(
703
+ DropdownMenuContent,
704
+ {
705
+ align: "end",
706
+ className: "bg-white min-w-[120px]",
707
+ children: data.map((item) => /* @__PURE__ */ jsx17(
708
+ DropdownMenuItem,
709
+ {
710
+ className: "text-black",
711
+ onSelect: () => onGroupItemClick?.({
712
+ item
713
+ }),
714
+ children: /* @__PURE__ */ jsx17(Link2, { href: item.url || "#", children: item.header })
715
+ },
716
+ item.id
717
+ ))
718
+ }
719
+ )
695
720
  ] })
696
721
  ] });
697
722
  }
@@ -1468,6 +1493,7 @@ function MultiCheckbox({
1468
1493
  {
1469
1494
  id: props.name ? `${props.name}-${opt.value}` : opt.value,
1470
1495
  className: cn(hasError && "text-red-600"),
1496
+ htmlFor: props.name ? `${props.name}-${opt.value}` : opt.value,
1471
1497
  children: opt.label
1472
1498
  }
1473
1499
  )
@@ -2083,7 +2109,8 @@ function LazySelectDropdown({
2083
2109
  onFocus: handleFocus,
2084
2110
  onChange: handleSearchChange,
2085
2111
  readOnly: !isOpen || readOnly,
2086
- disabled
2112
+ disabled,
2113
+ autoComplete: "off"
2087
2114
  }
2088
2115
  ),
2089
2116
  selectedOption && !disabled && !readOnly && /* @__PURE__ */ jsx36(
@@ -3275,7 +3302,8 @@ function LazyMultiSelectDropdown({
3275
3302
  value: isOpen ? searchTerm : "",
3276
3303
  onChange: handleSearch,
3277
3304
  readOnly,
3278
- disabled
3305
+ disabled,
3306
+ autoComplete: "off"
3279
3307
  }
3280
3308
  )
3281
3309
  ]
@@ -3849,13 +3877,13 @@ function DataTable({
3849
3877
  const shouldShowLeftDots = leftSiblingIndex > 2;
3850
3878
  const shouldShowRightDots = rightSiblingIndex < totalPages - 1;
3851
3879
  if (!shouldShowLeftDots && shouldShowRightDots) {
3852
- return [1, 2, 3, "...", totalPages];
3880
+ return [1, 2, 3, "..."];
3853
3881
  }
3854
3882
  if (shouldShowLeftDots && !shouldShowRightDots) {
3855
3883
  return [1, "...", totalPages - 2, totalPages - 1, totalPages];
3856
3884
  }
3857
3885
  if (shouldShowLeftDots && shouldShowRightDots) {
3858
- return [1, "...", currentPage - 1, currentPage, currentPage + 1, "...", totalPages];
3886
+ return [1, "...", currentPage - 1, currentPage, currentPage + 1, "..."];
3859
3887
  }
3860
3888
  return [];
3861
3889
  };
@@ -4061,7 +4089,7 @@ function DataTable({
4061
4089
  return /* @__PURE__ */ jsxs30(
4062
4090
  TableCell,
4063
4091
  {
4064
- className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
4092
+ className: `break-words whitespace-normal align-top ${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
4065
4093
  style: {
4066
4094
  width: cell.column.getSize(),
4067
4095
  minWidth: cell.column.columnDef.minSize,
@@ -6087,7 +6115,7 @@ export {
6087
6115
  BarChart_default as BarChart,
6088
6116
  Breadcrumb_default as Breadcrumb,
6089
6117
  Button_default as Button,
6090
- SplitButton as ButtonGroup,
6118
+ ButtonGroup,
6091
6119
  Checkbox_default as Checkbox,
6092
6120
  Container_default as Container,
6093
6121
  DateTimePicker as DatePicker,