@algorithm-shift/design-system 1.2.998 → 1.3.101
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 +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -474,10 +474,17 @@ type SonnerToastProps = {
|
|
|
474
474
|
onAction?: () => void;
|
|
475
475
|
};
|
|
476
476
|
declare function showSonnerToast({ title, description, variant, duration, actionLabel, onAction, }: SonnerToastProps): void;
|
|
477
|
+
type ConfirmToastOptions = {
|
|
478
|
+
title: string;
|
|
479
|
+
description?: string;
|
|
480
|
+
confirmLabel?: string;
|
|
481
|
+
cancelLabel?: string;
|
|
482
|
+
};
|
|
483
|
+
declare function showConfirmToast({ title, description, confirmLabel, cancelLabel, }: ConfirmToastOptions): Promise<boolean>;
|
|
477
484
|
|
|
478
485
|
declare const Toaster: ({ ...props }: ToasterProps) => react_jsx_runtime.JSX.Element;
|
|
479
486
|
|
|
480
487
|
declare function cn(...inputs: ClassValue[]): string;
|
|
481
488
|
declare function getInitials(name: string): string;
|
|
482
489
|
|
|
483
|
-
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 };
|
|
490
|
+
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, showConfirmToast, showSonnerToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -474,10 +474,17 @@ type SonnerToastProps = {
|
|
|
474
474
|
onAction?: () => void;
|
|
475
475
|
};
|
|
476
476
|
declare function showSonnerToast({ title, description, variant, duration, actionLabel, onAction, }: SonnerToastProps): void;
|
|
477
|
+
type ConfirmToastOptions = {
|
|
478
|
+
title: string;
|
|
479
|
+
description?: string;
|
|
480
|
+
confirmLabel?: string;
|
|
481
|
+
cancelLabel?: string;
|
|
482
|
+
};
|
|
483
|
+
declare function showConfirmToast({ title, description, confirmLabel, cancelLabel, }: ConfirmToastOptions): Promise<boolean>;
|
|
477
484
|
|
|
478
485
|
declare const Toaster: ({ ...props }: ToasterProps) => react_jsx_runtime.JSX.Element;
|
|
479
486
|
|
|
480
487
|
declare function cn(...inputs: ClassValue[]): string;
|
|
481
488
|
declare function getInitials(name: string): string;
|
|
482
489
|
|
|
483
|
-
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 };
|
|
490
|
+
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, showConfirmToast, showSonnerToast };
|
package/dist/index.js
CHANGED
|
@@ -80,6 +80,7 @@ __export(src_exports, {
|
|
|
80
80
|
URL: () => UrlInput_default,
|
|
81
81
|
cn: () => cn,
|
|
82
82
|
getInitials: () => getInitials,
|
|
83
|
+
showConfirmToast: () => showConfirmToast,
|
|
83
84
|
showSonnerToast: () => showSonnerToast
|
|
84
85
|
});
|
|
85
86
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -4936,6 +4937,34 @@ function showSonnerToast({
|
|
|
4936
4937
|
(0, import_sonner.toast)(title, options);
|
|
4937
4938
|
}
|
|
4938
4939
|
}
|
|
4940
|
+
function showConfirmToast({
|
|
4941
|
+
title,
|
|
4942
|
+
description,
|
|
4943
|
+
confirmLabel = "Confirm",
|
|
4944
|
+
cancelLabel = "Cancel"
|
|
4945
|
+
}) {
|
|
4946
|
+
return new Promise((resolve) => {
|
|
4947
|
+
const id = (0, import_sonner.toast)(title, {
|
|
4948
|
+
description,
|
|
4949
|
+
duration: Infinity,
|
|
4950
|
+
closeButton: false,
|
|
4951
|
+
action: {
|
|
4952
|
+
label: confirmLabel,
|
|
4953
|
+
onClick: () => {
|
|
4954
|
+
resolve(true);
|
|
4955
|
+
import_sonner.toast.dismiss(id);
|
|
4956
|
+
}
|
|
4957
|
+
},
|
|
4958
|
+
cancel: {
|
|
4959
|
+
label: cancelLabel,
|
|
4960
|
+
onClick: () => {
|
|
4961
|
+
resolve(false);
|
|
4962
|
+
import_sonner.toast.dismiss(id);
|
|
4963
|
+
}
|
|
4964
|
+
}
|
|
4965
|
+
});
|
|
4966
|
+
});
|
|
4967
|
+
}
|
|
4939
4968
|
|
|
4940
4969
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
4941
4970
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
@@ -5355,11 +5384,17 @@ var StagesComponent = ({
|
|
|
5355
5384
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
5356
5385
|
const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
|
|
5357
5386
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
5358
|
-
let stageColor =
|
|
5387
|
+
let stageColor = "bg-green-50 text-green-700 border-2 border-green-700";
|
|
5388
|
+
if (stage.hasOwnProperty("isSuccess") && stage.isSuccess === false) {
|
|
5389
|
+
stageColor = "bg-red-50 text-red-700 border-2 border-red-700";
|
|
5390
|
+
}
|
|
5359
5391
|
let stageLabel = stage[dataLabel];
|
|
5360
5392
|
if (stage[dataKey] !== activeChildStage?.[dataKey] && activeRootStage?.[dataKey] === stage[dataKey]) {
|
|
5361
5393
|
stageLabel = activeChildStage?.[dataLabel] || stageLabel;
|
|
5362
|
-
stageColor =
|
|
5394
|
+
stageColor = "bg-green-50 text-green-700 border-2 border-green-700";
|
|
5395
|
+
if (activeChildStage.hasOwnProperty("isSuccess") && activeChildStage.isSuccess === false) {
|
|
5396
|
+
stageColor = "bg-red-50 text-red-700 border-2 border-red-700";
|
|
5397
|
+
}
|
|
5363
5398
|
}
|
|
5364
5399
|
const stageKey = typeof stage[dataKey] === "string" ? stage[dataKey] : JSON.stringify(stage[dataKey]);
|
|
5365
5400
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react33.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Tooltip, { delayDuration: 500, disableHoverableContent: true, children: [
|
|
@@ -6367,6 +6402,7 @@ var Toaster = ({ ...props }) => {
|
|
|
6367
6402
|
URL,
|
|
6368
6403
|
cn,
|
|
6369
6404
|
getInitials,
|
|
6405
|
+
showConfirmToast,
|
|
6370
6406
|
showSonnerToast
|
|
6371
6407
|
});
|
|
6372
6408
|
//# sourceMappingURL=index.js.map
|