@algorithm-shift/design-system 1.2.985 → 1.2.987

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.mts CHANGED
@@ -8,6 +8,7 @@ import { ClassValue } from 'clsx';
8
8
  interface ModalProps {
9
9
  isOpen: boolean | string;
10
10
  onModalClose?: () => void;
11
+ onModalOpen?: () => void;
11
12
  title: string;
12
13
  children: React$1.ReactNode;
13
14
  size?: 'sm' | 'md' | 'lg' | 'xl';
@@ -15,7 +16,7 @@ interface ModalProps {
15
16
  className?: string;
16
17
  style?: React$1.CSSProperties;
17
18
  }
18
- declare function Modal({ isOpen, onModalClose, title, children, size, showCloseButton, className, style }: ModalProps): react_jsx_runtime.JSX.Element | null;
19
+ declare function Modal({ isOpen, onModalClose, onModalOpen, title, children, size, showCloseButton, className, style }: ModalProps): react_jsx_runtime.JSX.Element | null;
19
20
 
20
21
  interface ElementProps {
21
22
  children?: React.ReactNode;
@@ -244,6 +245,8 @@ interface BreadcrumbProps extends ElementProps {
244
245
  interface ButtonGroupProps extends ElementProps {
245
246
  textContent?: string;
246
247
  list?: Record<string, any>;
248
+ onGroupItemClick?: (data: { item: Record<string, any>}) => void;
249
+ onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
247
250
  }
248
251
  interface AccordionProps extends ElementProps {
249
252
  name?: string;
@@ -312,7 +315,7 @@ declare const Typography: ({ className, style, tagName, textContent, }: Typograp
312
315
 
313
316
  declare const Breadcrumb: ({ list, className, style }: BreadcrumbProps) => react_jsx_runtime.JSX.Element;
314
317
 
315
- declare function SplitButton({ style, textContent, className, list }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
318
+ declare function ButtonGroup({ style, textContent, className, list, onGroupItemClick, onClick }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
316
319
 
317
320
  type IconSet = 'fa-css' | 'fa' | 'fontawesome' | 'lucide';
318
321
  type FAPrefix = 'fas' | 'far' | 'fab' | string;
@@ -475,4 +478,4 @@ declare const Toaster: ({ ...props }: ToasterProps) => react_jsx_runtime.JSX.Ele
475
478
  declare function cn(...inputs: ClassValue[]): string;
476
479
  declare function getInitials(name: string): string;
477
480
 
478
- export { Accordion, AccordionGroup, _default$1 as BarChart, Breadcrumb, ButtonWrapper as Button, SplitButton as ButtonGroup, CheckboxInput as Checkbox, Container, DateTimePicker as DatePicker, DateRange, Dropdown, EmailInput as Email, EmailComposer, FileInput, Flex as FlexLayout, Grid as GridLayout, HistoryTimeline, Icon, ImageControl as Image, Modal, MultiCheckbox, LazyMultiSelectDropdown as MultiSelect, Navbar, NumberInput, CustomPagination as Pagination, PasswordInput as Password, PhoneInput as Phone, _default as PieChart, RadioInput as RadioGroup, _default$2 as Repeater, RichText, SearchInput as Search, Shape, Slot, Spacer, StagesComponent as Stages, SwitchToggle, TabGroupComponent as TabGroup, TabList, Table, Tabs, TextInput as Text, TextInputGroup, Textarea, Toaster, Typography, UrlInput as URL, cn, getInitials, showSonnerToast };
481
+ export { Accordion, AccordionGroup, _default$1 as BarChart, Breadcrumb, ButtonWrapper as Button, ButtonGroup, CheckboxInput as Checkbox, Container, DateTimePicker as DatePicker, DateRange, Dropdown, EmailInput as Email, EmailComposer, FileInput, Flex as FlexLayout, Grid as GridLayout, HistoryTimeline, Icon, ImageControl as Image, Modal, MultiCheckbox, LazyMultiSelectDropdown as MultiSelect, Navbar, NumberInput, CustomPagination as Pagination, PasswordInput as Password, PhoneInput as Phone, _default as PieChart, RadioInput as RadioGroup, _default$2 as Repeater, RichText, SearchInput as Search, Shape, Slot, Spacer, StagesComponent as Stages, SwitchToggle, TabGroupComponent as TabGroup, TabList, Table, Tabs, TextInput as Text, TextInputGroup, Textarea, Toaster, Typography, UrlInput as URL, cn, getInitials, showSonnerToast };
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import { ClassValue } from 'clsx';
8
8
  interface ModalProps {
9
9
  isOpen: boolean | string;
10
10
  onModalClose?: () => void;
11
+ onModalOpen?: () => void;
11
12
  title: string;
12
13
  children: React$1.ReactNode;
13
14
  size?: 'sm' | 'md' | 'lg' | 'xl';
@@ -15,7 +16,7 @@ interface ModalProps {
15
16
  className?: string;
16
17
  style?: React$1.CSSProperties;
17
18
  }
18
- declare function Modal({ isOpen, onModalClose, title, children, size, showCloseButton, className, style }: ModalProps): react_jsx_runtime.JSX.Element | null;
19
+ declare function Modal({ isOpen, onModalClose, onModalOpen, title, children, size, showCloseButton, className, style }: ModalProps): react_jsx_runtime.JSX.Element | null;
19
20
 
20
21
  interface ElementProps {
21
22
  children?: React.ReactNode;
@@ -244,6 +245,8 @@ interface BreadcrumbProps extends ElementProps {
244
245
  interface ButtonGroupProps extends ElementProps {
245
246
  textContent?: string;
246
247
  list?: Record<string, any>;
248
+ onGroupItemClick?: (data: { item: Record<string, any>}) => void;
249
+ onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
247
250
  }
248
251
  interface AccordionProps extends ElementProps {
249
252
  name?: string;
@@ -312,7 +315,7 @@ declare const Typography: ({ className, style, tagName, textContent, }: Typograp
312
315
 
313
316
  declare const Breadcrumb: ({ list, className, style }: BreadcrumbProps) => react_jsx_runtime.JSX.Element;
314
317
 
315
- declare function SplitButton({ style, textContent, className, list }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
318
+ declare function ButtonGroup({ style, textContent, className, list, onGroupItemClick, onClick }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
316
319
 
317
320
  type IconSet = 'fa-css' | 'fa' | 'fontawesome' | 'lucide';
318
321
  type FAPrefix = 'fas' | 'far' | 'fab' | string;
@@ -475,4 +478,4 @@ declare const Toaster: ({ ...props }: ToasterProps) => react_jsx_runtime.JSX.Ele
475
478
  declare function cn(...inputs: ClassValue[]): string;
476
479
  declare function getInitials(name: string): string;
477
480
 
478
- export { Accordion, AccordionGroup, _default$1 as BarChart, Breadcrumb, ButtonWrapper as Button, SplitButton as ButtonGroup, CheckboxInput as Checkbox, Container, DateTimePicker as DatePicker, DateRange, Dropdown, EmailInput as Email, EmailComposer, FileInput, Flex as FlexLayout, Grid as GridLayout, HistoryTimeline, Icon, ImageControl as Image, Modal, MultiCheckbox, LazyMultiSelectDropdown as MultiSelect, Navbar, NumberInput, CustomPagination as Pagination, PasswordInput as Password, PhoneInput as Phone, _default as PieChart, RadioInput as RadioGroup, _default$2 as Repeater, RichText, SearchInput as Search, Shape, Slot, Spacer, StagesComponent as Stages, SwitchToggle, TabGroupComponent as TabGroup, TabList, Table, Tabs, TextInput as Text, TextInputGroup, Textarea, Toaster, Typography, UrlInput as URL, cn, getInitials, showSonnerToast };
481
+ export { Accordion, AccordionGroup, _default$1 as BarChart, Breadcrumb, ButtonWrapper as Button, ButtonGroup, CheckboxInput as Checkbox, Container, DateTimePicker as DatePicker, DateRange, Dropdown, EmailInput as Email, EmailComposer, FileInput, Flex as FlexLayout, Grid as GridLayout, HistoryTimeline, Icon, ImageControl as Image, Modal, MultiCheckbox, LazyMultiSelectDropdown as MultiSelect, Navbar, NumberInput, CustomPagination as Pagination, PasswordInput as Password, PhoneInput as Phone, _default as PieChart, RadioInput as RadioGroup, _default$2 as Repeater, RichText, SearchInput as Search, Shape, Slot, Spacer, StagesComponent as Stages, SwitchToggle, TabGroupComponent as TabGroup, TabList, Table, Tabs, TextInput as Text, TextInputGroup, Textarea, Toaster, Typography, UrlInput as URL, cn, getInitials, showSonnerToast };
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ __export(src_exports, {
36
36
  BarChart: () => BarChart_default,
37
37
  Breadcrumb: () => Breadcrumb_default,
38
38
  Button: () => Button_default,
39
- ButtonGroup: () => SplitButton,
39
+ ButtonGroup: () => ButtonGroup,
40
40
  Checkbox: () => Checkbox_default,
41
41
  Container: () => Container_default,
42
42
  DatePicker: () => DateTimePicker,
@@ -119,6 +119,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
119
119
  function Modal({
120
120
  isOpen,
121
121
  onModalClose,
122
+ onModalOpen,
122
123
  title,
123
124
  children,
124
125
  size = "md",
@@ -126,6 +127,11 @@ function Modal({
126
127
  className = "",
127
128
  style = {}
128
129
  }) {
130
+ (0, import_react.useEffect)(() => {
131
+ if (isOpen && onModalOpen) {
132
+ onModalOpen();
133
+ }
134
+ }, [isOpen]);
129
135
  (0, import_react.useEffect)(() => {
130
136
  const handleEscape = (e) => {
131
137
  if (e.key === "Escape") {
@@ -647,6 +653,7 @@ var Breadcrumb_default = Breadcrumb;
647
653
 
648
654
  // src/components/Basic/ButtonGroup/ButtonGroup.tsx
649
655
  var import_lucide_react3 = require("lucide-react");
656
+ var import_link2 = __toESM(require("next/link"));
650
657
 
651
658
  // src/components/ui/dropdown-menu.tsx
652
659
  var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
@@ -765,9 +772,9 @@ function DropdownMenuSubContent({
765
772
  }
766
773
 
767
774
  // src/components/Basic/ButtonGroup/ButtonGroup.tsx
768
- var import_link2 = __toESM(require("next/link"));
769
775
  var import_jsx_runtime17 = require("react/jsx-runtime");
770
- function SplitButton({ style, textContent, className, list = [] }) {
776
+ function ButtonGroup({ style, textContent, className, list = [], onGroupItemClick, onClick }) {
777
+ const data = Array.isArray(list) ? list : [];
771
778
  const bgColor = style?.backgroundColor || "";
772
779
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "inline-flex rounded-md overflow-hidden border border-teal-200 bg-teal-700 items-center focus:ring-0", style: { backgroundColor: bgColor }, children: [
773
780
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
@@ -775,6 +782,7 @@ function SplitButton({ style, textContent, className, list = [] }) {
775
782
  {
776
783
  className: `rounded-none border-r px-4 py-2 text-whit focus:ring-0 ${className || ""}`,
777
784
  style: { backgroundColor: bgColor },
785
+ onClick: (e) => onClick?.(e),
778
786
  children: textContent || "Button"
779
787
  }
780
788
  ),
@@ -788,7 +796,24 @@ function SplitButton({ style, textContent, className, list = [] }) {
788
796
  children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react3.ChevronDown, { className: "w-4 h-4" })
789
797
  }
790
798
  ) }),
791
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuContent, { align: "end", className: "bg-white min-w-[120px]", children: list.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuItem, { className: "text-black", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_link2.default, { href: item.url || "#", children: item.header }) }, item.id)) })
799
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
800
+ DropdownMenuContent,
801
+ {
802
+ align: "end",
803
+ className: "bg-white min-w-[120px]",
804
+ children: data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
805
+ DropdownMenuItem,
806
+ {
807
+ className: "text-black",
808
+ onSelect: () => onGroupItemClick?.({
809
+ item
810
+ }),
811
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_link2.default, { href: item.url || "#", children: item.header })
812
+ },
813
+ item.id
814
+ ))
815
+ }
816
+ )
792
817
  ] })
793
818
  ] });
794
819
  }
@@ -1565,6 +1590,7 @@ function MultiCheckbox({
1565
1590
  {
1566
1591
  id: props.name ? `${props.name}-${opt.value}` : opt.value,
1567
1592
  className: cn(hasError && "text-red-600"),
1593
+ htmlFor: props.name ? `${props.name}-${opt.value}` : opt.value,
1568
1594
  children: opt.label
1569
1595
  }
1570
1596
  )
@@ -2180,7 +2206,8 @@ function LazySelectDropdown({
2180
2206
  onFocus: handleFocus,
2181
2207
  onChange: handleSearchChange,
2182
2208
  readOnly: !isOpen || readOnly,
2183
- disabled
2209
+ disabled,
2210
+ autoComplete: "off"
2184
2211
  }
2185
2212
  ),
2186
2213
  selectedOption && !disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
@@ -3368,7 +3395,8 @@ function LazyMultiSelectDropdown({
3368
3395
  value: isOpen ? searchTerm : "",
3369
3396
  onChange: handleSearch,
3370
3397
  readOnly,
3371
- disabled
3398
+ disabled,
3399
+ autoComplete: "off"
3372
3400
  }
3373
3401
  )
3374
3402
  ]
@@ -3936,13 +3964,13 @@ function DataTable({
3936
3964
  const shouldShowLeftDots = leftSiblingIndex > 2;
3937
3965
  const shouldShowRightDots = rightSiblingIndex < totalPages - 1;
3938
3966
  if (!shouldShowLeftDots && shouldShowRightDots) {
3939
- return [1, 2, 3, "...", totalPages];
3967
+ return [1, 2, 3, "..."];
3940
3968
  }
3941
3969
  if (shouldShowLeftDots && !shouldShowRightDots) {
3942
3970
  return [1, "...", totalPages - 2, totalPages - 1, totalPages];
3943
3971
  }
3944
3972
  if (shouldShowLeftDots && shouldShowRightDots) {
3945
- return [1, "...", currentPage - 1, currentPage, currentPage + 1, "...", totalPages];
3973
+ return [1, "...", currentPage - 1, currentPage, currentPage + 1, "..."];
3946
3974
  }
3947
3975
  return [];
3948
3976
  };
@@ -4148,7 +4176,7 @@ function DataTable({
4148
4176
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
4149
4177
  TableCell,
4150
4178
  {
4151
- className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
4179
+ className: `break-words whitespace-normal align-top ${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
4152
4180
  style: {
4153
4181
  width: cell.column.getSize(),
4154
4182
  minWidth: cell.column.columnDef.minSize,
@@ -5125,8 +5153,15 @@ var StagesComponent = ({
5125
5153
  triggerOnClick = false,
5126
5154
  canvasMode = "desktop"
5127
5155
  }) => {
5128
- const [activeStage, setActiveStage] = (0, import_react33.useState)(currentStage || (stages && stages.length > 0 ? stages[0][dataKey] : null));
5156
+ const [activeStage, setActiveStage] = (0, import_react33.useState)("");
5129
5157
  const [isCompleted, setIsCompleted] = (0, import_react33.useState)(false);
5158
+ (0, import_react33.useEffect)(() => {
5159
+ if (currentStage) {
5160
+ setActiveStage(currentStage);
5161
+ } else {
5162
+ setActiveStage(stages && stages.length > 0 ? stages[0][dataKey] : null);
5163
+ }
5164
+ }, [currentStage]);
5130
5165
  const updateStage = (stageKey) => {
5131
5166
  setActiveStage(stageKey);
5132
5167
  onStageChange?.(stageKey);
@@ -5141,7 +5176,7 @@ var StagesComponent = ({
5141
5176
  return;
5142
5177
  }
5143
5178
  if (currentIndex < stages.length - 1) {
5144
- const nextStageObj = stages[currentIndex + 1];
5179
+ const nextStageObj = stages[currentIndex];
5145
5180
  updateStage(nextStageObj[dataKey]);
5146
5181
  return;
5147
5182
  }