@causw/core 0.0.20 → 0.0.21
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/components/Avatar/Avatar.d.cts +2 -2
- package/dist/components/Avatar/Avatar.d.mts +2 -2
- package/dist/components/Avatar/Avatar.styles.d.cts +3 -3
- package/dist/components/Avatar/Avatar.styles.d.mts +3 -3
- package/dist/components/Avatar/Avatar.styles.d.mts.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.d.mts +5 -5
- package/dist/components/BottomNavigation/BottomNavigation.styles.d.cts +3 -3
- package/dist/components/BottomNavigation/BottomNavigation.styles.d.mts +3 -3
- package/dist/components/BottomSheet/BottomSheet.d.mts +6 -6
- package/dist/components/BottomSheet/BottomSheet.styles.d.cts +3 -3
- package/dist/components/BottomSheet/BottomSheet.styles.d.mts +3 -3
- package/dist/components/Box/Box.styles.d.mts +3 -3
- package/dist/components/Button/Button.d.cts +2 -2
- package/dist/components/Button/Button.styles.d.cts +3 -3
- package/dist/components/Button/Button.styles.d.mts +3 -3
- package/dist/components/CTAButton/CTAButton.d.cts +2 -2
- package/dist/components/CTAButton/CTAButton.d.mts +2 -2
- package/dist/components/CTAButton/CTAButton.styles.d.cts +3 -3
- package/dist/components/CTAButton/CTAButton.styles.d.mts +3 -3
- package/dist/components/Calendar/Calendar.d.cts +2 -2
- package/dist/components/Calendar/Calendar.d.mts +2 -2
- package/dist/components/Calendar/Calendar.styles.d.cts +3 -3
- package/dist/components/Calendar/Calendar.styles.d.mts +3 -3
- package/dist/components/Checkbox/Checkbox.d.cts +4 -4
- package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.styles.d.cts +3 -3
- package/dist/components/Checkbox/Checkbox.styles.d.mts +3 -3
- package/dist/components/Chip/Chip.d.cts +2 -2
- package/dist/components/Chip/Chip.d.mts +2 -2
- package/dist/components/Chip/Chip.styles.d.cts +3 -3
- package/dist/components/Chip/Chip.styles.d.mts +3 -3
- package/dist/components/DatePicker/DatePicker.d.cts +2 -2
- package/dist/components/DatePicker/DatePicker.d.cts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.mts +2 -2
- package/dist/components/DatePicker/DatePicker.styles.d.cts +3 -3
- package/dist/components/DatePicker/DatePicker.styles.d.cts.map +1 -1
- package/dist/components/DatePicker/DatePicker.styles.d.mts +3 -3
- package/dist/components/Dialog/Dialog.d.cts +5 -5
- package/dist/components/Dialog/Dialog.d.mts +5 -5
- package/dist/components/Dialog/Dialog.styles.d.mts +3 -3
- package/dist/components/Dropdown/Dropdown.d.cts +3 -3
- package/dist/components/Dropdown/Dropdown.d.mts +3 -3
- package/dist/components/Dropdown/Dropdown.styles.d.cts +3 -3
- package/dist/components/Dropdown/Dropdown.styles.d.mts +3 -3
- package/dist/components/Field/Field.d.mts +5 -5
- package/dist/components/Float/Float.styles.d.cts +3 -3
- package/dist/components/FloatingActionButton/FloatingActionButton.d.cts +2 -2
- package/dist/components/FloatingActionButton/FloatingActionButton.d.cts.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.d.mts +2 -2
- package/dist/components/FloatingActionButton/FloatingActionButton.styles.d.cts +3 -3
- package/dist/components/FloatingActionButton/FloatingActionButton.styles.d.mts +3 -3
- package/dist/components/Grid/Grid.styles.d.mts +3 -3
- package/dist/components/HStack/HStack.d.mts +2 -2
- package/dist/components/Modal/Modal.d.cts +7 -7
- package/dist/components/Modal/Modal.d.mts +7 -7
- package/dist/components/Modal/Modal.styles.d.cts +3 -3
- package/dist/components/Modal/Modal.styles.d.mts +3 -3
- package/dist/components/Primitive/Primitive.d.cts +16 -16
- package/dist/components/Primitive/Primitive.d.mts +16 -16
- package/dist/components/PullToRefresh/PullToRefresh.d.cts +2 -2
- package/dist/components/PullToRefresh/PullToRefresh.d.mts +2 -2
- package/dist/components/PullToRefresh/PullToRefresh.styles.d.cts +3 -3
- package/dist/components/PullToRefresh/PullToRefresh.styles.d.mts +3 -3
- package/dist/components/Radio/Radio.d.cts +3 -3
- package/dist/components/Radio/Radio.d.cts.map +1 -1
- package/dist/components/Radio/Radio.d.mts +3 -3
- package/dist/components/Radio/Radio.d.mts.map +1 -1
- package/dist/components/RatioChart/RatioChart.d.cts +5 -5
- package/dist/components/RatioChart/RatioChart.d.mts +5 -5
- package/dist/components/RatioChart/RatioChartEditor.d.cts +2 -2
- package/dist/components/RatioChart/RatioChartEditor.d.mts +2 -2
- package/dist/components/Select/Select.d.cts +5 -5
- package/dist/components/Select/Select.d.mts +5 -5
- package/dist/components/Select/Select.styles.d.cts +3 -3
- package/dist/components/Select/Select.styles.d.mts +3 -3
- package/dist/components/Separator/Separator.styles.d.cts +3 -3
- package/dist/components/Sidebar/Sidebar.d.cts +8 -8
- package/dist/components/Sidebar/Sidebar.d.mts +8 -8
- package/dist/components/Sidebar/Sidebar.styles.d.cts +3 -3
- package/dist/components/Sidebar/Sidebar.styles.d.mts +3 -3
- package/dist/components/Skeleton/Skeleton.d.cts +2 -2
- package/dist/components/Skeleton/Skeleton.d.mts +2 -2
- package/dist/components/Skeleton/Skeleton.styles.d.cts +3 -3
- package/dist/components/Spacer/Spacer.styles.d.cts +3 -3
- package/dist/components/Spacer/Spacer.styles.d.cts.map +1 -1
- package/dist/components/Spacer/Spacer.styles.d.mts +3 -3
- package/dist/components/Spacer/Spacer.styles.d.mts.map +1 -1
- package/dist/components/Spinner/Spinner.d.cts +2 -2
- package/dist/components/Spinner/Spinner.d.mts +2 -2
- package/dist/components/Spinner/Spinner.styles.d.cts +3 -3
- package/dist/components/Spinner/Spinner.styles.d.mts +3 -3
- package/dist/components/Stack/Stack.styles.d.cts +3 -3
- package/dist/components/Stack/Stack.styles.d.mts +3 -3
- package/dist/components/Tab/Tab.d.cts +6 -6
- package/dist/components/Tab/Tab.d.mts +6 -6
- package/dist/components/Tab/Tab.styles.d.cts +3 -3
- package/dist/components/Tab/Tab.styles.d.mts +3 -3
- package/dist/components/Text/Text.d.cts +1 -1
- package/dist/components/Text/Text.d.mts +1 -1
- package/dist/components/Text/Text.styles.d.cts +3 -3
- package/dist/components/TextArea/TextArea.d.cts +4 -4
- package/dist/components/TextArea/TextArea.d.cts.map +1 -1
- package/dist/components/TextArea/TextArea.d.mts +4 -4
- package/dist/components/TextArea/TextArea.styles.d.cts +3 -3
- package/dist/components/TextInput/TextInput.d.cts +2 -2
- package/dist/components/TextInput/TextInput.d.cts.map +1 -1
- package/dist/components/TextInput/TextInput.styles.d.cts +3 -3
- package/dist/components/Toast/Toast.d.cts +3 -3
- package/dist/components/Toast/Toast.d.mts +3 -3
- package/dist/components/Toast/Toast.styles.d.cts +3 -3
- package/dist/components/Toast/Toast.styles.d.mts +3 -3
- package/dist/components/Toast/Toaster.cjs +2 -0
- package/dist/components/Toast/Toaster.d.cts +2 -2
- package/dist/components/Toast/Toaster.d.cts.map +1 -1
- package/dist/components/Toast/Toaster.d.mts +2 -2
- package/dist/components/Toast/Toaster.d.mts.map +1 -1
- package/dist/components/Toast/Toaster.mjs +2 -0
- package/dist/components/Toast/Toaster.mjs.map +1 -1
- package/dist/components/Toast/toastStore.cjs +4 -3
- package/dist/components/Toast/toastStore.d.cts.map +1 -1
- package/dist/components/Toast/toastStore.d.mts.map +1 -1
- package/dist/components/Toast/toastStore.mjs +4 -3
- package/dist/components/Toast/toastStore.mjs.map +1 -1
- package/dist/components/Toggle/Toggle.d.cts +4 -4
- package/dist/components/Toggle/Toggle.d.cts.map +1 -1
- package/dist/components/Toggle/Toggle.d.mts +4 -4
- package/dist/components/Toggle/Toggle.styles.d.cts +3 -3
- package/dist/components/Toggle/Toggle.styles.d.mts +3 -3
- package/dist/components/VStack/VStack.d.mts +2 -2
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToastVariants } from "./Toast.styles.cjs";
|
|
2
2
|
import * as react11 from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime43 from "react/jsx-runtime";
|
|
4
4
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
5
5
|
|
|
6
6
|
//#region src/components/Toast/Toast.d.ts
|
|
@@ -15,12 +15,12 @@ declare const Toast: ({
|
|
|
15
15
|
message,
|
|
16
16
|
icon,
|
|
17
17
|
...props
|
|
18
|
-
}: ToastProps) =>
|
|
18
|
+
}: ToastProps) => react_jsx_runtime43.JSX.Element;
|
|
19
19
|
type ToastViewportProps = React.ComponentProps<typeof ToastPrimitives.Viewport>;
|
|
20
20
|
declare const ToastViewport: ({
|
|
21
21
|
className,
|
|
22
22
|
...props
|
|
23
|
-
}: ToastViewportProps) =>
|
|
23
|
+
}: ToastViewportProps) => react_jsx_runtime43.JSX.Element;
|
|
24
24
|
declare const ToastProvider: react11.FC<ToastPrimitives.ToastProviderProps>;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { Toast, ToastProps, ToastProvider, ToastViewport, ToastViewportProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToastVariants } from "./Toast.styles.mjs";
|
|
2
2
|
import * as react11 from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime44 from "react/jsx-runtime";
|
|
4
4
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
5
5
|
|
|
6
6
|
//#region src/components/Toast/Toast.d.ts
|
|
@@ -15,12 +15,12 @@ declare const Toast: ({
|
|
|
15
15
|
message,
|
|
16
16
|
icon,
|
|
17
17
|
...props
|
|
18
|
-
}: ToastProps) =>
|
|
18
|
+
}: ToastProps) => react_jsx_runtime44.JSX.Element;
|
|
19
19
|
type ToastViewportProps = React.ComponentProps<typeof ToastPrimitives.Viewport>;
|
|
20
20
|
declare const ToastViewport: ({
|
|
21
21
|
className,
|
|
22
22
|
...props
|
|
23
|
-
}: ToastViewportProps) =>
|
|
23
|
+
}: ToastViewportProps) => react_jsx_runtime44.JSX.Element;
|
|
24
24
|
declare const ToastProvider: react11.FC<ToastPrimitives.ToastProviderProps>;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { Toast, ToastProps, ToastProvider, ToastViewport, ToastViewportProps };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants21 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Toast/Toast.styles.d.ts
|
|
5
|
-
declare const toast:
|
|
5
|
+
declare const toast: tailwind_variants21.TVReturnType<{
|
|
6
6
|
variant: {
|
|
7
7
|
default: {
|
|
8
8
|
root: string;
|
|
@@ -20,7 +20,7 @@ declare const toast: tailwind_variants25.TVReturnType<{
|
|
|
20
20
|
}, {
|
|
21
21
|
root: string[];
|
|
22
22
|
viewport: string[];
|
|
23
|
-
},
|
|
23
|
+
}, tailwind_variants21.TVReturnType<{
|
|
24
24
|
variant: {
|
|
25
25
|
default: {
|
|
26
26
|
root: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants25 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Toast/Toast.styles.d.ts
|
|
5
|
-
declare const toast:
|
|
5
|
+
declare const toast: tailwind_variants25.TVReturnType<{
|
|
6
6
|
variant: {
|
|
7
7
|
default: {
|
|
8
8
|
root: string;
|
|
@@ -20,7 +20,7 @@ declare const toast: tailwind_variants21.TVReturnType<{
|
|
|
20
20
|
}, {
|
|
21
21
|
root: string[];
|
|
22
22
|
viewport: string[];
|
|
23
|
-
},
|
|
23
|
+
}, tailwind_variants25.TVReturnType<{
|
|
24
24
|
variant: {
|
|
25
25
|
default: {
|
|
26
26
|
root: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime45 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Toast/Toaster.d.ts
|
|
4
|
-
declare const Toaster: () =>
|
|
4
|
+
declare const Toaster: () => react_jsx_runtime45.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { Toaster };
|
|
7
7
|
//# sourceMappingURL=Toaster.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.cts","names":[],"sources":["../../../src/components/Toast/Toaster.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Toaster.d.cts","names":[],"sources":["../../../src/components/Toast/Toaster.tsx"],"mappings":";;;cAmBa,OAAA,QAAO,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime43 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Toast/Toaster.d.ts
|
|
4
|
-
declare const Toaster: () =>
|
|
4
|
+
declare const Toaster: () => react_jsx_runtime43.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { Toaster };
|
|
7
7
|
//# sourceMappingURL=Toaster.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.mts","names":[],"sources":["../../../src/components/Toast/Toaster.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Toaster.d.mts","names":[],"sources":["../../../src/components/Toast/Toaster.tsx"],"mappings":";;;cAmBa,OAAA,QAAO,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.mjs","names":[],"sources":["../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Toaster.mjs","names":[],"sources":["../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["'use client';\n\nimport { Toast, ToastProvider, ToastViewport } from './Toast';\nimport { useToastStore, toast, ToastType } from './toastStore';\nimport { SuccessColored, ErrorColored, LoadingColored } from '@causw/icons';\n\nconst Icons = {\n success: () => <SuccessColored size={20} />,\n error: () => <ErrorColored size={20} />,\n loading: () => <LoadingColored size={20} className=\"animate-spin\" />,\n};\n\nconst toastIconMap: Record<ToastType, React.ReactNode> = {\n success: <Icons.success />,\n error: <Icons.error />,\n loading: <Icons.loading />,\n default: undefined,\n};\n\nexport const Toaster = () => {\n const toasts = useToastStore();\n\n return (\n <ToastProvider>\n {toasts.map((t) => {\n const iconToRender = t.icon || toastIconMap[t.type];\n\n return (\n <Toast\n key={t.id}\n message={t.message}\n icon={iconToRender}\n variant=\"default\"\n duration={t.duration || 3000}\n open={true}\n onOpenChange={(open) => {\n if (!open) toast.dismiss(t.id);\n }}\n />\n );\n })}\n <ToastViewport />\n </ToastProvider>\n );\n};\n"],"mappings":";;;;;;;;AAMA,MAAM,QAAQ;CACZ,eAAe,oBAAC,kBAAe,MAAM,KAAM;CAC3C,aAAa,oBAAC,gBAAa,MAAM,KAAM;CACvC,eAAe,oBAAC;EAAe,MAAM;EAAI,WAAU;GAAiB;CACrE;AAED,MAAM,eAAmD;CACvD,SAAS,oBAAC,MAAM,YAAU;CAC1B,OAAO,oBAAC,MAAM,UAAQ;CACtB,SAAS,oBAAC,MAAM,YAAU;CAC1B,SAAS;CACV;AAED,MAAa,gBAAgB;AAG3B,QACE,qBAAC,4BAHY,eAAe,CAIlB,KAAK,MAAM;EACjB,MAAM,eAAe,EAAE,QAAQ,aAAa,EAAE;AAE9C,SACE,oBAAC;GAEC,SAAS,EAAE;GACX,MAAM;GACN,SAAQ;GACR,UAAU,EAAE,YAAY;GACxB,MAAM;GACN,eAAe,SAAS;AACtB,QAAI,CAAC,KAAM,OAAM,QAAQ,EAAE,GAAG;;KAP3B,EAAE,GASP;GAEJ,EACF,oBAAC,kBAAgB,IACH"}
|
|
@@ -12,12 +12,13 @@ const genId = () => {
|
|
|
12
12
|
};
|
|
13
13
|
const dispatch = (message, type, options) => {
|
|
14
14
|
const id = genId();
|
|
15
|
-
|
|
15
|
+
const newToast = {
|
|
16
16
|
id,
|
|
17
17
|
message,
|
|
18
18
|
type,
|
|
19
19
|
...options
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
|
+
memoryState = [...memoryState, newToast];
|
|
21
22
|
notify();
|
|
22
23
|
return id;
|
|
23
24
|
};
|
|
@@ -27,7 +28,7 @@ const useToastStore = () => {
|
|
|
27
28
|
return () => {
|
|
28
29
|
listeners = listeners.filter((l) => l !== listener);
|
|
29
30
|
};
|
|
30
|
-
}, () => memoryState);
|
|
31
|
+
}, () => memoryState, () => []);
|
|
31
32
|
};
|
|
32
33
|
const toastRoot = (message, options) => dispatch(message, "default", options);
|
|
33
34
|
const toast = Object.assign(toastRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toastStore.d.cts","names":[],"sources":["../../../src/components/Toast/toastStore.ts"],"mappings":";KAEY,SAAA;AAAA,UAEK,SAAA;EACf,EAAA;EACA,OAAA;EACA,IAAA,EAAM,SAAA;EACN,QAAA;EACA,IAAA,GAAO,KAAA,CAAM,SAAA;AAAA;AAAA,KAGV,YAAA,GAAe,IAAA,CAAK,SAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"toastStore.d.cts","names":[],"sources":["../../../src/components/Toast/toastStore.ts"],"mappings":";KAEY,SAAA;AAAA,UAEK,SAAA;EACf,EAAA;EACA,OAAA;EACA,IAAA,EAAM,SAAA;EACN,QAAA;EACA,IAAA,GAAO,KAAA,CAAM,SAAA;AAAA;AAAA,KAGV,YAAA,GAAe,IAAA,CAAK,SAAA;AAAA,cAqCZ,KAAA,IAAK,OAAA,UAHgB,OAAA,GAAY,YAAA;6BAInB,OAAA,GAAY,YAAA;2BAEd,OAAA,GAAY,YAAA;6BAEV,OAAA,GAAY,YAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toastStore.d.mts","names":[],"sources":["../../../src/components/Toast/toastStore.ts"],"mappings":";KAEY,SAAA;AAAA,UAEK,SAAA;EACf,EAAA;EACA,OAAA;EACA,IAAA,EAAM,SAAA;EACN,QAAA;EACA,IAAA,GAAO,KAAA,CAAM,SAAA;AAAA;AAAA,KAGV,YAAA,GAAe,IAAA,CAAK,SAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"toastStore.d.mts","names":[],"sources":["../../../src/components/Toast/toastStore.ts"],"mappings":";KAEY,SAAA;AAAA,UAEK,SAAA;EACf,EAAA;EACA,OAAA;EACA,IAAA,EAAM,SAAA;EACN,QAAA;EACA,IAAA,GAAO,KAAA,CAAM,SAAA;AAAA;AAAA,KAGV,YAAA,GAAe,IAAA,CAAK,SAAA;AAAA,cAqCZ,KAAA,IAAK,OAAA,UAHgB,OAAA,GAAY,YAAA;6BAInB,OAAA,GAAY,YAAA;2BAEd,OAAA,GAAY,YAAA;6BAEV,OAAA,GAAY,YAAA"}
|
|
@@ -11,12 +11,13 @@ const genId = () => {
|
|
|
11
11
|
};
|
|
12
12
|
const dispatch = (message, type, options) => {
|
|
13
13
|
const id = genId();
|
|
14
|
-
|
|
14
|
+
const newToast = {
|
|
15
15
|
id,
|
|
16
16
|
message,
|
|
17
17
|
type,
|
|
18
18
|
...options
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
memoryState = [...memoryState, newToast];
|
|
20
21
|
notify();
|
|
21
22
|
return id;
|
|
22
23
|
};
|
|
@@ -26,7 +27,7 @@ const useToastStore = () => {
|
|
|
26
27
|
return () => {
|
|
27
28
|
listeners = listeners.filter((l) => l !== listener);
|
|
28
29
|
};
|
|
29
|
-
}, () => memoryState);
|
|
30
|
+
}, () => memoryState, () => []);
|
|
30
31
|
};
|
|
31
32
|
const toastRoot = (message, options) => dispatch(message, "default", options);
|
|
32
33
|
const toast = Object.assign(toastRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toastStore.mjs","names":[],"sources":["../../../src/components/Toast/toastStore.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react';\n\nexport type ToastType = 'default' | 'success' | 'error' | 'loading';\n\nexport interface ToastData {\n id: string;\n message: string;\n type: ToastType;\n duration?: number;\n icon?: React.ReactNode;\n}\n\ntype ToastOptions = Omit<ToastData, 'id' | 'message' | 'type'>;\n\nlet memoryState: ToastData[] = [];\nlet listeners: Array<() => void> = [];\nconst notify = () => listeners.forEach((l) => l());\n\nlet count = 0;\nconst genId = () => {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n};\n\nconst dispatch = (message: string, type: ToastType, options?: ToastOptions) => {\n const id = genId();\n const newToast = { id, message, type, ...options };\n\n memoryState = [newToast];\n notify();\n return id;\n};\n\nexport const useToastStore = () => {\n return useSyncExternalStore(\n (listener) => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter((l) => l !== listener);\n };\n },\n () => memoryState,\n );\n};\n\nconst toastRoot = (message: string, options?: ToastOptions) =>\n dispatch(message, 'default', options);\n\nexport const toast = Object.assign(toastRoot, {\n success: (message: string, options?: ToastOptions) =>\n dispatch(message, 'success', options),\n error: (message: string, options?: ToastOptions) =>\n dispatch(message, 'error', options),\n loading: (message: string, options?: ToastOptions) =>\n dispatch(message, 'loading', {\n ...options,\n duration: options?.duration ?? 100000,\n }),\n dismiss: (id: string) => {\n memoryState = memoryState.filter((t) => t.id !== id);\n notify();\n },\n});\n"],"mappings":";;;AAcA,IAAI,cAA2B,EAAE;AACjC,IAAI,YAA+B,EAAE;AACrC,MAAM,eAAe,UAAU,SAAS,MAAM,GAAG,CAAC;AAElD,IAAI,QAAQ;AACZ,MAAM,cAAc;AAClB,UAAS,QAAQ,KAAK,OAAO;AAC7B,QAAO,MAAM,UAAU;;AAGzB,MAAM,YAAY,SAAiB,MAAiB,YAA2B;CAC7E,MAAM,KAAK,OAAO;
|
|
1
|
+
{"version":3,"file":"toastStore.mjs","names":[],"sources":["../../../src/components/Toast/toastStore.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react';\n\nexport type ToastType = 'default' | 'success' | 'error' | 'loading';\n\nexport interface ToastData {\n id: string;\n message: string;\n type: ToastType;\n duration?: number;\n icon?: React.ReactNode;\n}\n\ntype ToastOptions = Omit<ToastData, 'id' | 'message' | 'type'>;\n\nlet memoryState: ToastData[] = [];\nlet listeners: Array<() => void> = [];\nconst notify = () => listeners.forEach((l) => l());\n\nlet count = 0;\nconst genId = () => {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n};\n\nconst dispatch = (message: string, type: ToastType, options?: ToastOptions) => {\n const id = genId();\n const newToast = { id, message, type, ...options };\n\n memoryState = [...memoryState, newToast];\n notify();\n return id;\n};\n\nexport const useToastStore = () => {\n return useSyncExternalStore(\n (listener) => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter((l) => l !== listener);\n };\n },\n () => memoryState,\n () => [],\n );\n};\n\nconst toastRoot = (message: string, options?: ToastOptions) =>\n dispatch(message, 'default', options);\n\nexport const toast = Object.assign(toastRoot, {\n success: (message: string, options?: ToastOptions) =>\n dispatch(message, 'success', options),\n error: (message: string, options?: ToastOptions) =>\n dispatch(message, 'error', options),\n loading: (message: string, options?: ToastOptions) =>\n dispatch(message, 'loading', {\n ...options,\n duration: options?.duration ?? 100000,\n }),\n dismiss: (id: string) => {\n memoryState = memoryState.filter((t) => t.id !== id);\n notify();\n },\n});\n"],"mappings":";;;AAcA,IAAI,cAA2B,EAAE;AACjC,IAAI,YAA+B,EAAE;AACrC,MAAM,eAAe,UAAU,SAAS,MAAM,GAAG,CAAC;AAElD,IAAI,QAAQ;AACZ,MAAM,cAAc;AAClB,UAAS,QAAQ,KAAK,OAAO;AAC7B,QAAO,MAAM,UAAU;;AAGzB,MAAM,YAAY,SAAiB,MAAiB,YAA2B;CAC7E,MAAM,KAAK,OAAO;CAClB,MAAM,WAAW;EAAE;EAAI;EAAS;EAAM,GAAG;EAAS;AAElD,eAAc,CAAC,GAAG,aAAa,SAAS;AACxC,SAAQ;AACR,QAAO;;AAGT,MAAa,sBAAsB;AACjC,QAAO,sBACJ,aAAa;AACZ,YAAU,KAAK,SAAS;AACxB,eAAa;AACX,eAAY,UAAU,QAAQ,MAAM,MAAM,SAAS;;UAGjD,mBACA,EAAE,CACT;;AAGH,MAAM,aAAa,SAAiB,YAClC,SAAS,SAAS,WAAW,QAAQ;AAEvC,MAAa,QAAQ,OAAO,OAAO,WAAW;CAC5C,UAAU,SAAiB,YACzB,SAAS,SAAS,WAAW,QAAQ;CACvC,QAAQ,SAAiB,YACvB,SAAS,SAAS,SAAS,QAAQ;CACrC,UAAU,SAAiB,YACzB,SAAS,SAAS,WAAW;EAC3B,GAAG;EACH,UAAU,SAAS,YAAY;EAChC,CAAC;CACJ,UAAU,OAAe;AACvB,gBAAc,YAAY,QAAQ,MAAM,EAAE,OAAO,GAAG;AACpD,UAAQ;;CAEX,CAAC"}
|
|
@@ -5,7 +5,7 @@ import "../Text/index.cjs";
|
|
|
5
5
|
import "../../utils/index.cjs";
|
|
6
6
|
import { ToggleVariants } from "./Toggle.styles.cjs";
|
|
7
7
|
import React from "react";
|
|
8
|
-
import * as
|
|
8
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/components/Toggle/Toggle.d.ts
|
|
11
11
|
interface ToggleRootProps extends Omit<React.ComponentProps<'label'>, 'onChange'>, ToggleVariants {
|
|
@@ -23,11 +23,11 @@ declare const Toggle: {
|
|
|
23
23
|
children,
|
|
24
24
|
className,
|
|
25
25
|
...props
|
|
26
|
-
}: ToggleRootProps):
|
|
26
|
+
}: ToggleRootProps): react_jsx_runtime10.JSX.Element;
|
|
27
27
|
displayName: string;
|
|
28
28
|
} & {
|
|
29
29
|
Switch: {
|
|
30
|
-
():
|
|
30
|
+
(): react_jsx_runtime10.JSX.Element;
|
|
31
31
|
displayName: string;
|
|
32
32
|
};
|
|
33
33
|
Label: {
|
|
@@ -37,7 +37,7 @@ declare const Toggle: {
|
|
|
37
37
|
textColor,
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: ToggleLabelProps<E>):
|
|
40
|
+
}: ToggleLabelProps<E>): react_jsx_runtime10.JSX.Element;
|
|
41
41
|
displayName: string;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.d.cts","names":[],"sources":["../../../src/components/Toggle/Toggle.tsx"],"mappings":";;;;;;;;;;UAyBiB,eAAA,SACP,IAAA,CAAK,KAAA,CAAM,cAAA,wBAAsC,cAAA;EACzD,cAAA;EACA,eAAA,IAAmB,OAAA;EACnB,QAAA,GAAW,KAAA,CAAM,SAAA;AAAA;AAAA,KAwDP,gBAAA,WAA2B,WAAA,aAAwB,gBAAA,CAC7D,CAAA,EACA,YAAA;AAAA,cA8BW,MAAA;EAAA;;;;;;;;KA7EV,eAAA,GAAe,
|
|
1
|
+
{"version":3,"file":"Toggle.d.cts","names":[],"sources":["../../../src/components/Toggle/Toggle.tsx"],"mappings":";;;;;;;;;;UAyBiB,eAAA,SACP,IAAA,CAAK,KAAA,CAAM,cAAA,wBAAsC,cAAA;EACzD,cAAA;EACA,eAAA,IAAmB,OAAA;EACnB,QAAA,GAAW,KAAA,CAAM,SAAA;AAAA;AAAA,KAwDP,gBAAA,WAA2B,WAAA,aAAwB,gBAAA,CAC7D,CAAA,EACA,YAAA;AAAA,cA8BW,MAAA;EAAA;;;;;;;;KA7EV,eAAA,GAAe,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;eAkDa,WAAA;MAAW,QAAA;MAAA,UAAA;MAAA,SAAA;MAAA,SAAA;MAAA,GAAA;IAAA,GAMvC,gBAAA,CAAiB,CAAA,IAAE,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -5,7 +5,7 @@ import "../Text/index.mjs";
|
|
|
5
5
|
import "../../utils/index.mjs";
|
|
6
6
|
import { ToggleVariants } from "./Toggle.styles.mjs";
|
|
7
7
|
import React from "react";
|
|
8
|
-
import * as
|
|
8
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/components/Toggle/Toggle.d.ts
|
|
11
11
|
interface ToggleRootProps extends Omit<React.ComponentProps<'label'>, 'onChange'>, ToggleVariants {
|
|
@@ -23,11 +23,11 @@ declare const Toggle: {
|
|
|
23
23
|
children,
|
|
24
24
|
className,
|
|
25
25
|
...props
|
|
26
|
-
}: ToggleRootProps):
|
|
26
|
+
}: ToggleRootProps): react_jsx_runtime9.JSX.Element;
|
|
27
27
|
displayName: string;
|
|
28
28
|
} & {
|
|
29
29
|
Switch: {
|
|
30
|
-
():
|
|
30
|
+
(): react_jsx_runtime9.JSX.Element;
|
|
31
31
|
displayName: string;
|
|
32
32
|
};
|
|
33
33
|
Label: {
|
|
@@ -37,7 +37,7 @@ declare const Toggle: {
|
|
|
37
37
|
textColor,
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: ToggleLabelProps<E>):
|
|
40
|
+
}: ToggleLabelProps<E>): react_jsx_runtime9.JSX.Element;
|
|
41
41
|
displayName: string;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants33 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Toggle/Toggle.styles.d.ts
|
|
5
|
-
declare const toggle:
|
|
5
|
+
declare const toggle: tailwind_variants33.TVReturnType<{
|
|
6
6
|
checked: {
|
|
7
7
|
true: {
|
|
8
8
|
switch: string;
|
|
@@ -46,7 +46,7 @@ declare const toggle: tailwind_variants31.TVReturnType<{
|
|
|
46
46
|
switch: string;
|
|
47
47
|
switchThumb: string;
|
|
48
48
|
label: string;
|
|
49
|
-
},
|
|
49
|
+
}, tailwind_variants33.TVReturnType<{
|
|
50
50
|
checked: {
|
|
51
51
|
true: {
|
|
52
52
|
switch: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as tailwind_variants35 from "tailwind-variants";
|
|
2
2
|
import { VariantProps } from "tailwind-variants";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Toggle/Toggle.styles.d.ts
|
|
5
|
-
declare const toggle:
|
|
5
|
+
declare const toggle: tailwind_variants35.TVReturnType<{
|
|
6
6
|
checked: {
|
|
7
7
|
true: {
|
|
8
8
|
switch: string;
|
|
@@ -46,7 +46,7 @@ declare const toggle: tailwind_variants31.TVReturnType<{
|
|
|
46
46
|
switch: string;
|
|
47
47
|
switchThumb: string;
|
|
48
48
|
label: string;
|
|
49
|
-
},
|
|
49
|
+
}, tailwind_variants35.TVReturnType<{
|
|
50
50
|
checked: {
|
|
51
51
|
true: {
|
|
52
52
|
switch: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { StackProps } from "../Stack/Stack.mjs";
|
|
2
2
|
import "../Stack/index.mjs";
|
|
3
3
|
import { ElementType } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/VStack/VStack.d.ts
|
|
7
7
|
type VStackProps<E extends ElementType = 'div'> = Omit<StackProps<E>, 'direction'>;
|
|
8
8
|
declare const VStack: {
|
|
9
9
|
<E extends ElementType = "div">({
|
|
10
10
|
...props
|
|
11
|
-
}: VStackProps<E>):
|
|
11
|
+
}: VStackProps<E>): react_jsx_runtime18.JSX.Element;
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@causw/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Core components and utilities for CAUSW Design System - CAU Software Community Service",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"tailwind-merge": "^3.4.0",
|
|
38
38
|
"tailwind-variants": "^3.2.2",
|
|
39
39
|
"vaul": "^1.1.2",
|
|
40
|
-
"@causw/
|
|
41
|
-
"@causw/
|
|
40
|
+
"@causw/icons": "1.0.3",
|
|
41
|
+
"@causw/tokens": "0.0.12"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": ">=18",
|