@algorithm-shift/design-system 1.2.35 → 1.2.36
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 +29 -2
- package/dist/index.d.ts +29 -2
- package/dist/index.js +94 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +89 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
package/dist/index.mjs
CHANGED
|
@@ -1727,7 +1727,7 @@ var DateRange_default = DateRange;
|
|
|
1727
1727
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
1728
1728
|
import * as React14 from "react";
|
|
1729
1729
|
import { Fragment as Fragment15, jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1730
|
-
var TextInputGroup = ({ className, style, prepend, append
|
|
1730
|
+
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
1731
1731
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1732
1732
|
const isEditable = props.isEditable ?? true;
|
|
1733
1733
|
const isDisabled = props.isDisabled ?? false;
|
|
@@ -2124,7 +2124,18 @@ var Pagination_default = CustomPagination;
|
|
|
2124
2124
|
// src/components/DataDisplay/Table/Table.tsx
|
|
2125
2125
|
import { useState as useState18 } from "react";
|
|
2126
2126
|
import { jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2127
|
-
var Table2 = ({
|
|
2127
|
+
var Table2 = ({
|
|
2128
|
+
columns,
|
|
2129
|
+
data,
|
|
2130
|
+
rowActions,
|
|
2131
|
+
className,
|
|
2132
|
+
style,
|
|
2133
|
+
pagination = false,
|
|
2134
|
+
itemsPerPage = 10,
|
|
2135
|
+
onPageChange,
|
|
2136
|
+
loading = false,
|
|
2137
|
+
...props
|
|
2138
|
+
}) => {
|
|
2128
2139
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
2129
2140
|
const rawData = Array.isArray(data) ? data : [];
|
|
2130
2141
|
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
@@ -2136,7 +2147,16 @@ var Table2 = ({ columns, data, rowActions, className, style, pagination = false,
|
|
|
2136
2147
|
};
|
|
2137
2148
|
const paginatedData = enablePagination ? rawData.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage) : rawData;
|
|
2138
2149
|
return /* @__PURE__ */ jsxs24("div", { className: `${className} space-y-3`, style, children: [
|
|
2139
|
-
/* @__PURE__ */ jsx41(
|
|
2150
|
+
/* @__PURE__ */ jsx41(
|
|
2151
|
+
DataTable,
|
|
2152
|
+
{
|
|
2153
|
+
...props,
|
|
2154
|
+
columns: rawColumns,
|
|
2155
|
+
data: paginatedData,
|
|
2156
|
+
rowActions: rawRowActions,
|
|
2157
|
+
loading
|
|
2158
|
+
}
|
|
2159
|
+
),
|
|
2140
2160
|
enablePagination && /* @__PURE__ */ jsx41(
|
|
2141
2161
|
Pagination_default,
|
|
2142
2162
|
{
|
|
@@ -2717,6 +2737,67 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
2717
2737
|
] })
|
|
2718
2738
|
] }) });
|
|
2719
2739
|
}
|
|
2740
|
+
|
|
2741
|
+
// src/components/ui/sonner-toast.tsx
|
|
2742
|
+
import { toast } from "sonner";
|
|
2743
|
+
function showSonnerToast({
|
|
2744
|
+
title,
|
|
2745
|
+
description,
|
|
2746
|
+
variant = "default",
|
|
2747
|
+
duration = 3e3,
|
|
2748
|
+
actionLabel,
|
|
2749
|
+
onAction
|
|
2750
|
+
}) {
|
|
2751
|
+
const options = {
|
|
2752
|
+
description,
|
|
2753
|
+
duration,
|
|
2754
|
+
action: actionLabel ? {
|
|
2755
|
+
label: actionLabel,
|
|
2756
|
+
onClick: onAction || (() => {
|
|
2757
|
+
})
|
|
2758
|
+
} : void 0
|
|
2759
|
+
};
|
|
2760
|
+
switch (variant) {
|
|
2761
|
+
case "success":
|
|
2762
|
+
toast.success(title, options);
|
|
2763
|
+
break;
|
|
2764
|
+
case "error":
|
|
2765
|
+
toast.error(title, options);
|
|
2766
|
+
break;
|
|
2767
|
+
case "info":
|
|
2768
|
+
toast.info(title, options);
|
|
2769
|
+
break;
|
|
2770
|
+
case "warning":
|
|
2771
|
+
toast.warning(title, options);
|
|
2772
|
+
break;
|
|
2773
|
+
default:
|
|
2774
|
+
toast(title, options);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
// src/components/StateManagment/StateContext.tsx
|
|
2779
|
+
import { createContext, useContext, useReducer } from "react";
|
|
2780
|
+
|
|
2781
|
+
// src/components/StateManagment/stateReducer.ts
|
|
2782
|
+
function stateReducer(state, action) {
|
|
2783
|
+
switch (action.type) {
|
|
2784
|
+
case "SET_STATE":
|
|
2785
|
+
return { ...state, [action.key]: action.value };
|
|
2786
|
+
default:
|
|
2787
|
+
return state;
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
// src/components/StateManagment/StateContext.tsx
|
|
2792
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2793
|
+
var StateContext = createContext(null);
|
|
2794
|
+
function StateProvider({ children }) {
|
|
2795
|
+
const [state, dispatch] = useReducer(stateReducer, {});
|
|
2796
|
+
return /* @__PURE__ */ jsx54(StateContext.Provider, { value: { state, dispatch }, children });
|
|
2797
|
+
}
|
|
2798
|
+
function useAppState() {
|
|
2799
|
+
return useContext(StateContext);
|
|
2800
|
+
}
|
|
2720
2801
|
export {
|
|
2721
2802
|
BarChart_default as BarChart,
|
|
2722
2803
|
Button_default as Button,
|
|
@@ -2748,6 +2829,7 @@ export {
|
|
|
2748
2829
|
Shape_default as Shape,
|
|
2749
2830
|
Spacer_default as Spacer,
|
|
2750
2831
|
Stages_default as Stages,
|
|
2832
|
+
StateProvider,
|
|
2751
2833
|
SwitchToggle_default as SwitchToggle,
|
|
2752
2834
|
Table_default as Table,
|
|
2753
2835
|
Tabs_default as Tabs,
|
|
@@ -2756,7 +2838,10 @@ export {
|
|
|
2756
2838
|
Textarea_default as Textarea,
|
|
2757
2839
|
Typography_default as Typography,
|
|
2758
2840
|
UrlInput_default as URL,
|
|
2759
|
-
cn
|
|
2841
|
+
cn,
|
|
2842
|
+
showSonnerToast,
|
|
2843
|
+
stateReducer,
|
|
2844
|
+
useAppState
|
|
2760
2845
|
};
|
|
2761
2846
|
/*! Bundled license information:
|
|
2762
2847
|
|