@algorithm-shift/design-system 1.2.35 → 1.2.37
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.css +16 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +32 -5
- package/dist/index.d.ts +32 -5
- package/dist/index.js +103 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +98 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
package/dist/index.mjs
CHANGED
|
@@ -30,9 +30,10 @@ import { jsx as jsx2 } from "react/jsx-runtime";
|
|
|
30
30
|
var Flex = ({
|
|
31
31
|
children,
|
|
32
32
|
className,
|
|
33
|
-
style
|
|
33
|
+
style,
|
|
34
|
+
...props
|
|
34
35
|
}) => {
|
|
35
|
-
return /* @__PURE__ */ jsx2("div", { className, style, children });
|
|
36
|
+
return /* @__PURE__ */ jsx2("div", { ...props, className, style, children });
|
|
36
37
|
};
|
|
37
38
|
var Flex_default = Flex;
|
|
38
39
|
|
|
@@ -41,9 +42,10 @@ import { jsx as jsx3 } from "react/jsx-runtime";
|
|
|
41
42
|
var Grid = ({
|
|
42
43
|
children,
|
|
43
44
|
className,
|
|
44
|
-
style
|
|
45
|
+
style,
|
|
46
|
+
...props
|
|
45
47
|
}) => {
|
|
46
|
-
return /* @__PURE__ */ jsx3("div", { className, style, children });
|
|
48
|
+
return /* @__PURE__ */ jsx3("div", { ...props, className, style, children });
|
|
47
49
|
};
|
|
48
50
|
var Grid_default = Grid;
|
|
49
51
|
|
|
@@ -52,9 +54,10 @@ import { jsx as jsx4 } from "react/jsx-runtime";
|
|
|
52
54
|
var Container = ({
|
|
53
55
|
children,
|
|
54
56
|
className,
|
|
55
|
-
style
|
|
57
|
+
style,
|
|
58
|
+
...props
|
|
56
59
|
}) => {
|
|
57
|
-
return /* @__PURE__ */ jsx4("div", { className, style, children });
|
|
60
|
+
return /* @__PURE__ */ jsx4("div", { ...props, className, style, children });
|
|
58
61
|
};
|
|
59
62
|
var Container_default = Container;
|
|
60
63
|
|
|
@@ -1727,7 +1730,7 @@ var DateRange_default = DateRange;
|
|
|
1727
1730
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
1728
1731
|
import * as React14 from "react";
|
|
1729
1732
|
import { Fragment as Fragment15, jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1730
|
-
var TextInputGroup = ({ className, style, prepend, append
|
|
1733
|
+
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
1731
1734
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1732
1735
|
const isEditable = props.isEditable ?? true;
|
|
1733
1736
|
const isDisabled = props.isDisabled ?? false;
|
|
@@ -2124,7 +2127,18 @@ var Pagination_default = CustomPagination;
|
|
|
2124
2127
|
// src/components/DataDisplay/Table/Table.tsx
|
|
2125
2128
|
import { useState as useState18 } from "react";
|
|
2126
2129
|
import { jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2127
|
-
var Table2 = ({
|
|
2130
|
+
var Table2 = ({
|
|
2131
|
+
columns,
|
|
2132
|
+
data,
|
|
2133
|
+
rowActions,
|
|
2134
|
+
className,
|
|
2135
|
+
style,
|
|
2136
|
+
pagination = false,
|
|
2137
|
+
itemsPerPage = 10,
|
|
2138
|
+
onPageChange,
|
|
2139
|
+
loading = false,
|
|
2140
|
+
...props
|
|
2141
|
+
}) => {
|
|
2128
2142
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
2129
2143
|
const rawData = Array.isArray(data) ? data : [];
|
|
2130
2144
|
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
@@ -2136,7 +2150,16 @@ var Table2 = ({ columns, data, rowActions, className, style, pagination = false,
|
|
|
2136
2150
|
};
|
|
2137
2151
|
const paginatedData = enablePagination ? rawData.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage) : rawData;
|
|
2138
2152
|
return /* @__PURE__ */ jsxs24("div", { className: `${className} space-y-3`, style, children: [
|
|
2139
|
-
/* @__PURE__ */ jsx41(
|
|
2153
|
+
/* @__PURE__ */ jsx41(
|
|
2154
|
+
DataTable,
|
|
2155
|
+
{
|
|
2156
|
+
...props,
|
|
2157
|
+
columns: rawColumns,
|
|
2158
|
+
data: paginatedData,
|
|
2159
|
+
rowActions: rawRowActions,
|
|
2160
|
+
loading
|
|
2161
|
+
}
|
|
2162
|
+
),
|
|
2140
2163
|
enablePagination && /* @__PURE__ */ jsx41(
|
|
2141
2164
|
Pagination_default,
|
|
2142
2165
|
{
|
|
@@ -2717,6 +2740,67 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
2717
2740
|
] })
|
|
2718
2741
|
] }) });
|
|
2719
2742
|
}
|
|
2743
|
+
|
|
2744
|
+
// src/components/ui/sonner-toast.tsx
|
|
2745
|
+
import { toast } from "sonner";
|
|
2746
|
+
function showSonnerToast({
|
|
2747
|
+
title,
|
|
2748
|
+
description,
|
|
2749
|
+
variant = "default",
|
|
2750
|
+
duration = 3e3,
|
|
2751
|
+
actionLabel,
|
|
2752
|
+
onAction
|
|
2753
|
+
}) {
|
|
2754
|
+
const options = {
|
|
2755
|
+
description,
|
|
2756
|
+
duration,
|
|
2757
|
+
action: actionLabel ? {
|
|
2758
|
+
label: actionLabel,
|
|
2759
|
+
onClick: onAction || (() => {
|
|
2760
|
+
})
|
|
2761
|
+
} : void 0
|
|
2762
|
+
};
|
|
2763
|
+
switch (variant) {
|
|
2764
|
+
case "success":
|
|
2765
|
+
toast.success(title, options);
|
|
2766
|
+
break;
|
|
2767
|
+
case "error":
|
|
2768
|
+
toast.error(title, options);
|
|
2769
|
+
break;
|
|
2770
|
+
case "info":
|
|
2771
|
+
toast.info(title, options);
|
|
2772
|
+
break;
|
|
2773
|
+
case "warning":
|
|
2774
|
+
toast.warning(title, options);
|
|
2775
|
+
break;
|
|
2776
|
+
default:
|
|
2777
|
+
toast(title, options);
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
// src/components/StateManagment/StateContext.tsx
|
|
2782
|
+
import { createContext, useContext, useReducer } from "react";
|
|
2783
|
+
|
|
2784
|
+
// src/components/StateManagment/stateReducer.ts
|
|
2785
|
+
function stateReducer(state, action) {
|
|
2786
|
+
switch (action.type) {
|
|
2787
|
+
case "SET_STATE":
|
|
2788
|
+
return { ...state, [action.key]: action.value };
|
|
2789
|
+
default:
|
|
2790
|
+
return state;
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
// src/components/StateManagment/StateContext.tsx
|
|
2795
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2796
|
+
var StateContext = createContext(null);
|
|
2797
|
+
function StateProvider({ children }) {
|
|
2798
|
+
const [state, dispatch] = useReducer(stateReducer, {});
|
|
2799
|
+
return /* @__PURE__ */ jsx54(StateContext.Provider, { value: { state, dispatch }, children });
|
|
2800
|
+
}
|
|
2801
|
+
function useAppState() {
|
|
2802
|
+
return useContext(StateContext);
|
|
2803
|
+
}
|
|
2720
2804
|
export {
|
|
2721
2805
|
BarChart_default as BarChart,
|
|
2722
2806
|
Button_default as Button,
|
|
@@ -2748,6 +2832,7 @@ export {
|
|
|
2748
2832
|
Shape_default as Shape,
|
|
2749
2833
|
Spacer_default as Spacer,
|
|
2750
2834
|
Stages_default as Stages,
|
|
2835
|
+
StateProvider,
|
|
2751
2836
|
SwitchToggle_default as SwitchToggle,
|
|
2752
2837
|
Table_default as Table,
|
|
2753
2838
|
Tabs_default as Tabs,
|
|
@@ -2756,7 +2841,10 @@ export {
|
|
|
2756
2841
|
Textarea_default as Textarea,
|
|
2757
2842
|
Typography_default as Typography,
|
|
2758
2843
|
UrlInput_default as URL,
|
|
2759
|
-
cn
|
|
2844
|
+
cn,
|
|
2845
|
+
showSonnerToast,
|
|
2846
|
+
stateReducer,
|
|
2847
|
+
useAppState
|
|
2760
2848
|
};
|
|
2761
2849
|
/*! Bundled license information:
|
|
2762
2850
|
|