@cyclone-ui/state 0.0.12 → 0.0.14
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/CHANGELOG.md +26 -0
- package/README.md +1 -1
- package/dist/base/atoms/atom-with-broadcast.cjs +45 -1
- package/dist/base/atoms/atom-with-broadcast.mjs +45 -1
- package/dist/base/atoms/atom-with-broadcast.mjs.map +1 -1
- package/dist/base/atoms/atom-with-compare.cjs +12 -1
- package/dist/base/atoms/atom-with-compare.mjs +12 -1
- package/dist/base/atoms/atom-with-compare.mjs.map +1 -1
- package/dist/base/atoms/atom-with-debounce.cjs +52 -1
- package/dist/base/atoms/atom-with-debounce.mjs +52 -1
- package/dist/base/atoms/atom-with-debounce.mjs.map +1 -1
- package/dist/base/atoms/atom-with-effect.cjs +123 -1
- package/dist/base/atoms/atom-with-effect.mjs +120 -1
- package/dist/base/atoms/atom-with-effect.mjs.map +1 -1
- package/dist/base/atoms/atom-with-listeners.cjs +36 -1
- package/dist/base/atoms/atom-with-listeners.mjs +36 -1
- package/dist/base/atoms/atom-with-listeners.mjs.map +1 -1
- package/dist/base/atoms/atom-with-pending.cjs +14 -1
- package/dist/base/atoms/atom-with-pending.mjs +14 -1
- package/dist/base/atoms/atom-with-pending.mjs.map +1 -1
- package/dist/base/atoms/atom-with-refresh-and-default.cjs +19 -1
- package/dist/base/atoms/atom-with-refresh-and-default.mjs +19 -1
- package/dist/base/atoms/atom-with-refresh-and-default.mjs.map +1 -1
- package/dist/base/atoms/atom-with-refresh.cjs +13 -1
- package/dist/base/atoms/atom-with-refresh.mjs +13 -1
- package/dist/base/atoms/atom-with-refresh.mjs.map +1 -1
- package/dist/base/atoms/atom-with-toggle.cjs +13 -1
- package/dist/base/atoms/atom-with-toggle.mjs +13 -1
- package/dist/base/atoms/atom-with-toggle.mjs.map +1 -1
- package/dist/base/atoms/atom-with-web-storage.cjs +48 -1
- package/dist/base/atoms/atom-with-web-storage.mjs +47 -1
- package/dist/base/atoms/atom-with-web-storage.mjs.map +1 -1
- package/dist/base/atoms/atom-with-wrapper.cjs +25 -1
- package/dist/base/atoms/atom-with-wrapper.mjs +25 -1
- package/dist/base/atoms/atom-with-wrapper.mjs.map +1 -1
- package/dist/base/atoms/base-atom.cjs +25 -1
- package/dist/base/atoms/base-atom.mjs +25 -1
- package/dist/base/atoms/base-atom.mjs.map +1 -1
- package/dist/base/atoms/index.cjs +24 -1
- package/dist/base/atoms/index.mjs +13 -1
- package/dist/base/hooks/index.cjs +9 -1
- package/dist/base/hooks/index.mjs +6 -1
- package/dist/base/hooks/use-atom-effect.cjs +17 -1
- package/dist/base/hooks/use-atom-effect.mjs +17 -1
- package/dist/base/hooks/use-atom-effect.mjs.map +1 -1
- package/dist/base/hooks/use-hydrate-molecule.cjs +17 -1
- package/dist/base/hooks/use-hydrate-molecule.mjs +17 -1
- package/dist/base/hooks/use-hydrate-molecule.mjs.map +1 -1
- package/dist/base/hooks/use-prepare-atoms.cjs +20 -1
- package/dist/base/hooks/use-prepare-atoms.mjs +20 -1
- package/dist/base/hooks/use-prepare-atoms.mjs.map +1 -1
- package/dist/base/hooks/use-sync-molecule.cjs +37 -1
- package/dist/base/hooks/use-sync-molecule.mjs +37 -1
- package/dist/base/hooks/use-sync-molecule.mjs.map +1 -1
- package/dist/base/index.cjs +47 -1
- package/dist/base/index.mjs +24 -1
- package/dist/base/utilities/create-molecule.cjs +105 -4
- package/dist/base/utilities/create-molecule.d.cts.map +1 -1
- package/dist/base/utilities/create-molecule.mjs +102 -4
- package/dist/base/utilities/create-molecule.mjs.map +1 -1
- package/dist/base/utilities/create-web-storage.cjs +55 -1
- package/dist/base/utilities/create-web-storage.mjs +55 -1
- package/dist/base/utilities/create-web-storage.mjs.map +1 -1
- package/dist/base/utilities/debounce.cjs +52 -1
- package/dist/base/utilities/debounce.mjs +52 -1
- package/dist/base/utilities/debounce.mjs.map +1 -1
- package/dist/base/utilities/index.cjs +13 -1
- package/dist/base/utilities/index.mjs +6 -1
- package/dist/base/utilities/is-atom.cjs +48 -1
- package/dist/base/utilities/is-atom.mjs +46 -1
- package/dist/base/utilities/is-atom.mjs.map +1 -1
- package/dist/base/utilities/set-atom-debug.cjs +24 -1
- package/dist/base/utilities/set-atom-debug.mjs +23 -1
- package/dist/base/utilities/set-atom-debug.mjs.map +1 -1
- package/dist/client/index.cjs +16 -1
- package/dist/client/index.mjs +8 -1
- package/dist/form/atoms/atom-with-field.cjs +23 -1
- package/dist/form/atoms/atom-with-field.mjs +23 -1
- package/dist/form/atoms/atom-with-field.mjs.map +1 -1
- package/dist/form/atoms/atom-with-messages.cjs +85 -1
- package/dist/form/atoms/atom-with-messages.mjs +78 -1
- package/dist/form/atoms/atom-with-messages.mjs.map +1 -1
- package/dist/form/hooks/index.cjs +7 -1
- package/dist/form/hooks/index.mjs +5 -1
- package/dist/form/hooks/use-field-actions.cjs +92 -1
- package/dist/form/hooks/use-field-actions.mjs +92 -1
- package/dist/form/hooks/use-field-actions.mjs.map +1 -1
- package/dist/form/hooks/use-field-ref.cjs +16 -1
- package/dist/form/hooks/use-field-ref.mjs +16 -1
- package/dist/form/hooks/use-field-ref.mjs.map +1 -1
- package/dist/form/hooks/use-form-actions.cjs +69 -1
- package/dist/form/hooks/use-form-actions.mjs +69 -1
- package/dist/form/hooks/use-form-actions.mjs.map +1 -1
- package/dist/form/index.cjs +30 -1
- package/dist/form/index.mjs +17 -1
- package/dist/form/molecules/field-molecule.cjs +154 -1
- package/dist/form/molecules/field-molecule.mjs +153 -1
- package/dist/form/molecules/field-molecule.mjs.map +1 -1
- package/dist/form/molecules/form-molecule.cjs +180 -1
- package/dist/form/molecules/form-molecule.mjs +179 -1
- package/dist/form/molecules/form-molecule.mjs.map +1 -1
- package/dist/form/molecules/index.cjs +7 -1
- package/dist/form/molecules/index.mjs +4 -1
- package/dist/form/providers/FieldProvider.cjs +103 -4
- package/dist/form/providers/FieldProvider.mjs +103 -4
- package/dist/form/providers/FieldProvider.mjs.map +1 -1
- package/dist/form/providers/FormProvider.cjs +66 -4
- package/dist/form/providers/FormProvider.d.cts.map +1 -1
- package/dist/form/providers/FormProvider.mjs +66 -4
- package/dist/form/providers/FormProvider.mjs.map +1 -1
- package/dist/form/providers/index.cjs +5 -1
- package/dist/form/providers/index.mjs +4 -1
- package/dist/form/types.cjs +13 -1
- package/dist/form/types.mjs +13 -1
- package/dist/form/types.mjs.map +1 -1
- package/dist/form/utilities/abort-error.cjs +15 -1
- package/dist/form/utilities/abort-error.mjs +15 -1
- package/dist/form/utilities/abort-error.mjs.map +1 -1
- package/dist/form/utilities/index.cjs +7 -1
- package/dist/form/utilities/index.mjs +5 -1
- package/dist/form/utilities/is-validation-results.cjs +9 -1
- package/dist/form/utilities/is-validation-results.mjs +9 -1
- package/dist/form/utilities/is-validation-results.mjs.map +1 -1
- package/dist/form/utilities/validators.cjs +8 -1
- package/dist/form/utilities/validators.mjs +8 -1
- package/dist/form/utilities/validators.mjs.map +1 -1
- package/dist/index.cjs +71 -1
- package/dist/index.mjs +34 -1
- package/dist/message/components/MessageViewport.cjs +21 -6
- package/dist/message/components/MessageViewport.mjs +21 -6
- package/dist/message/components/MessageViewport.mjs.map +1 -1
- package/dist/message/components/index.cjs +3 -1
- package/dist/message/components/index.mjs +3 -1
- package/dist/message/hooks/index.cjs +3 -1
- package/dist/message/hooks/index.mjs +3 -1
- package/dist/message/hooks/use-message-actions.cjs +63 -1
- package/dist/message/hooks/use-message-actions.mjs +63 -1
- package/dist/message/hooks/use-message-actions.mjs.map +1 -1
- package/dist/message/index.cjs +23 -1
- package/dist/message/index.mjs +8 -1
- package/dist/message/providers/MessageProvider.cjs +16 -1
- package/dist/message/providers/MessageProvider.mjs +16 -1
- package/dist/message/providers/MessageProvider.mjs.map +1 -1
- package/dist/theme/hooks/index.cjs +7 -1
- package/dist/theme/hooks/index.mjs +4 -1
- package/dist/theme/hooks/use-theme-actions.cjs +21 -1
- package/dist/theme/hooks/use-theme-actions.mjs +21 -1
- package/dist/theme/hooks/use-theme-actions.mjs.map +1 -1
- package/dist/theme/hooks/use-theme-store.cjs +61 -1
- package/dist/theme/hooks/use-theme-store.d.cts +2 -2
- package/dist/theme/hooks/use-theme-store.d.mts +2 -2
- package/dist/theme/hooks/use-theme-store.mjs +59 -1
- package/dist/theme/hooks/use-theme-store.mjs.map +1 -1
- package/dist/theme/index.cjs +17 -1
- package/dist/theme/index.mjs +9 -1
- package/dist/theme/molecules/index.cjs +3 -1
- package/dist/theme/molecules/index.mjs +3 -1
- package/dist/theme/molecules/theme-molecule.cjs +14 -1
- package/dist/theme/molecules/theme-molecule.mjs +14 -1
- package/dist/theme/molecules/theme-molecule.mjs.map +1 -1
- package/dist/theme/providers/ThemeProvider.cjs +30 -5
- package/dist/theme/providers/ThemeProvider.mjs +30 -5
- package/dist/theme/providers/ThemeProvider.mjs.map +1 -1
- package/dist/theme/utilities/theme-helpers.cjs +71 -1
- package/dist/theme/utilities/theme-helpers.mjs +70 -1
- package/dist/theme/utilities/theme-helpers.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
import{setAtomDebugLabel
|
|
1
|
+
import { setAtomDebugLabel, setAtomDebugPrivate } from "./base/utilities/set-atom-debug.mjs";
|
|
2
|
+
import { atomWithBroadcast } from "./base/atoms/atom-with-broadcast.mjs";
|
|
3
|
+
import { atomWithCompare } from "./base/atoms/atom-with-compare.mjs";
|
|
4
|
+
import { atomWithWrapper } from "./base/atoms/atom-with-wrapper.mjs";
|
|
5
|
+
import { atomWithDebounce } from "./base/atoms/atom-with-debounce.mjs";
|
|
6
|
+
import { atomWithEffect } from "./base/atoms/atom-with-effect.mjs";
|
|
7
|
+
import { atomWithListeners } from "./base/atoms/atom-with-listeners.mjs";
|
|
8
|
+
import { atomWithPending } from "./base/atoms/atom-with-pending.mjs";
|
|
9
|
+
import { atomWithRefresh } from "./base/atoms/atom-with-refresh.mjs";
|
|
10
|
+
import { atomWithRefreshAndDefault } from "./base/atoms/atom-with-refresh-and-default.mjs";
|
|
11
|
+
import { atomWithToggle } from "./base/atoms/atom-with-toggle.mjs";
|
|
12
|
+
import { createWebStorage } from "./base/utilities/create-web-storage.mjs";
|
|
13
|
+
import { atomWithWebStorage, getWebStorage } from "./base/atoms/atom-with-web-storage.mjs";
|
|
14
|
+
import { useAtomEffect } from "./base/hooks/use-atom-effect.mjs";
|
|
15
|
+
import { useHydrateMolecule } from "./base/hooks/use-hydrate-molecule.mjs";
|
|
16
|
+
import { usePrepareAtoms } from "./base/hooks/use-prepare-atoms.mjs";
|
|
17
|
+
import { useSyncMolecule } from "./base/hooks/use-sync-molecule.mjs";
|
|
18
|
+
import { DEFAULT_SCOPE, createMoleculeApi, createScope, use } from "./base/utilities/create-molecule.mjs";
|
|
19
|
+
import { debounce } from "./base/utilities/debounce.mjs";
|
|
20
|
+
import "./base/index.mjs";
|
|
21
|
+
import { isValidationResults } from "./form/utilities/is-validation-results.mjs";
|
|
22
|
+
import { requiredValidator } from "./form/utilities/validators.mjs";
|
|
23
|
+
import { DEFAULT_FORM_OPTIONS, FormApi } from "./form/molecules/form-molecule.mjs";
|
|
24
|
+
import { DEFAULT_FIELD_OPTIONS, FieldApi } from "./form/molecules/field-molecule.mjs";
|
|
25
|
+
import { ValidationCause } from "./form/types.mjs";
|
|
26
|
+
import { useFieldActions } from "./form/hooks/use-field-actions.mjs";
|
|
27
|
+
import { useFieldRef } from "./form/hooks/use-field-ref.mjs";
|
|
28
|
+
import { useFormActions } from "./form/hooks/use-form-actions.mjs";
|
|
29
|
+
import { AbortError } from "./form/utilities/abort-error.mjs";
|
|
30
|
+
import { FieldProvider } from "./form/providers/FieldProvider.mjs";
|
|
31
|
+
import { FormProvider } from "./form/providers/FormProvider.mjs";
|
|
32
|
+
import "./form/index.mjs";
|
|
33
|
+
|
|
34
|
+
export { AbortError, DEFAULT_FIELD_OPTIONS, DEFAULT_FORM_OPTIONS, DEFAULT_SCOPE, FieldApi, FieldProvider, FormApi, FormProvider, ValidationCause, atomWithBroadcast, atomWithCompare, atomWithDebounce, atomWithEffect, atomWithListeners, atomWithPending, atomWithRefresh, atomWithRefreshAndDefault, atomWithToggle, atomWithWebStorage, atomWithWrapper, createMoleculeApi, createScope, createWebStorage, debounce, getWebStorage, isValidationResults, requiredValidator, setAtomDebugLabel, setAtomDebugPrivate, use, useAtomEffect, useFieldActions, useFieldRef, useFormActions, useHydrateMolecule, usePrepareAtoms, useSyncMolecule };
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
let
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
let _tamagui_toast = require("@tamagui/toast");
|
|
2
|
+
|
|
3
|
+
//#region src/message/components/MessageViewport.tsx
|
|
4
|
+
/**
|
|
5
|
+
* The MessageViewport component configures Tamagui's composable Toast for messages.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <MessageProvider>
|
|
9
|
+
* <App />
|
|
10
|
+
* <MessageViewport />
|
|
11
|
+
* </MessageProvider>
|
|
12
|
+
*/
|
|
13
|
+
const MessageViewport = ({ label = "Storm Messages", children, ...props }) => <_tamagui_toast.Toast duration={3e4} position="top-right" swipeDirection="horizontal" swipeThreshold={50} {...props}>
|
|
14
|
+
<_tamagui_toast.Toast.Viewport label={label}>
|
|
15
|
+
<_tamagui_toast.Toast.List />
|
|
16
|
+
</_tamagui_toast.Toast.Viewport>
|
|
17
|
+
{children}
|
|
18
|
+
</_tamagui_toast.Toast>;
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.MessageViewport = MessageViewport;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import{Toast
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Toast } from "@tamagui/toast";
|
|
2
|
+
|
|
3
|
+
//#region src/message/components/MessageViewport.tsx
|
|
4
|
+
/**
|
|
5
|
+
* The MessageViewport component configures Tamagui's composable Toast for messages.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <MessageProvider>
|
|
9
|
+
* <App />
|
|
10
|
+
* <MessageViewport />
|
|
11
|
+
* </MessageProvider>
|
|
12
|
+
*/
|
|
13
|
+
const MessageViewport = ({ label = "Storm Messages", children, ...props }) => <Toast duration={3e4} position="top-right" swipeDirection="horizontal" swipeThreshold={50} {...props}>
|
|
14
|
+
<Toast.Viewport label={label}>
|
|
15
|
+
<Toast.List />
|
|
16
|
+
</Toast.Viewport>
|
|
17
|
+
{children}
|
|
18
|
+
</Toast>;
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { MessageViewport };
|
|
7
22
|
//# sourceMappingURL=MessageViewport.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageViewport.mjs","names":[
|
|
1
|
+
{"version":3,"file":"MessageViewport.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,63 @@
|
|
|
1
|
-
let
|
|
1
|
+
let _tamagui_toast = require("@tamagui/toast");
|
|
2
|
+
|
|
3
|
+
//#region src/message/hooks/use-message-actions.ts
|
|
4
|
+
const useMessageActions = () => {
|
|
5
|
+
const show = (message, options = {}) => {
|
|
6
|
+
const { heading, type, ...toastOptions } = options;
|
|
7
|
+
const title = heading || message;
|
|
8
|
+
const data = {
|
|
9
|
+
...toastOptions,
|
|
10
|
+
data: { messageType: type },
|
|
11
|
+
description: heading ? message : void 0
|
|
12
|
+
};
|
|
13
|
+
switch (type) {
|
|
14
|
+
case "error":
|
|
15
|
+
_tamagui_toast.toast.error(title, data);
|
|
16
|
+
break;
|
|
17
|
+
case "warning":
|
|
18
|
+
_tamagui_toast.toast.warning(title, data);
|
|
19
|
+
break;
|
|
20
|
+
case "info":
|
|
21
|
+
_tamagui_toast.toast.info(title, data);
|
|
22
|
+
break;
|
|
23
|
+
case "success":
|
|
24
|
+
_tamagui_toast.toast.success(title, data);
|
|
25
|
+
break;
|
|
26
|
+
default: (0, _tamagui_toast.toast)(title, data);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
hide: () => _tamagui_toast.toast.dismiss(),
|
|
31
|
+
show,
|
|
32
|
+
showInfo: (message, options = {}) => {
|
|
33
|
+
show(message, {
|
|
34
|
+
...options,
|
|
35
|
+
type: "info"
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
showSuccess: (message, options = {}) => {
|
|
39
|
+
show(message || "Process completed successfully", {
|
|
40
|
+
...options,
|
|
41
|
+
type: "success"
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
showWarning: (message, options = {}) => {
|
|
45
|
+
show(message, {
|
|
46
|
+
...options,
|
|
47
|
+
type: "warning"
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
showError: (message, options = {}) => {
|
|
51
|
+
show(message || "An error occured during processing", {
|
|
52
|
+
...options,
|
|
53
|
+
type: "error"
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
showHelp: (message, options = {}) => {
|
|
57
|
+
show(message, options);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.useMessageActions = useMessageActions;
|
|
@@ -1,2 +1,64 @@
|
|
|
1
|
-
import{toast
|
|
1
|
+
import { toast } from "@tamagui/toast";
|
|
2
|
+
|
|
3
|
+
//#region src/message/hooks/use-message-actions.ts
|
|
4
|
+
const useMessageActions = () => {
|
|
5
|
+
const show = (message, options = {}) => {
|
|
6
|
+
const { heading, type, ...toastOptions } = options;
|
|
7
|
+
const title = heading || message;
|
|
8
|
+
const data = {
|
|
9
|
+
...toastOptions,
|
|
10
|
+
data: { messageType: type },
|
|
11
|
+
description: heading ? message : void 0
|
|
12
|
+
};
|
|
13
|
+
switch (type) {
|
|
14
|
+
case "error":
|
|
15
|
+
toast.error(title, data);
|
|
16
|
+
break;
|
|
17
|
+
case "warning":
|
|
18
|
+
toast.warning(title, data);
|
|
19
|
+
break;
|
|
20
|
+
case "info":
|
|
21
|
+
toast.info(title, data);
|
|
22
|
+
break;
|
|
23
|
+
case "success":
|
|
24
|
+
toast.success(title, data);
|
|
25
|
+
break;
|
|
26
|
+
default: toast(title, data);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
hide: () => toast.dismiss(),
|
|
31
|
+
show,
|
|
32
|
+
showInfo: (message, options = {}) => {
|
|
33
|
+
show(message, {
|
|
34
|
+
...options,
|
|
35
|
+
type: "info"
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
showSuccess: (message, options = {}) => {
|
|
39
|
+
show(message || "Process completed successfully", {
|
|
40
|
+
...options,
|
|
41
|
+
type: "success"
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
showWarning: (message, options = {}) => {
|
|
45
|
+
show(message, {
|
|
46
|
+
...options,
|
|
47
|
+
type: "warning"
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
showError: (message, options = {}) => {
|
|
51
|
+
show(message || "An error occured during processing", {
|
|
52
|
+
...options,
|
|
53
|
+
type: "error"
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
showHelp: (message, options = {}) => {
|
|
57
|
+
show(message, options);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { useMessageActions };
|
|
2
64
|
//# sourceMappingURL=use-message-actions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-message-actions.mjs","names":[
|
|
1
|
+
{"version":3,"file":"use-message-actions.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/message/index.cjs
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_MessageViewport = require("./components/MessageViewport.cjs");
|
|
3
|
+
require("./components/index.cjs");
|
|
4
|
+
const require_use_message_actions = require("./hooks/use-message-actions.cjs");
|
|
5
|
+
require("./hooks/index.cjs");
|
|
6
|
+
const require_MessageProvider = require("./providers/MessageProvider.cjs");
|
|
7
|
+
let _tamagui_toast = require("@tamagui/toast");
|
|
8
|
+
|
|
9
|
+
exports.MessageProvider = require_MessageProvider.MessageProvider;
|
|
10
|
+
exports.MessageViewport = require_MessageViewport.MessageViewport;
|
|
11
|
+
Object.defineProperty(exports, "Toast", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _tamagui_toast.Toast;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "toast", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _tamagui_toast.toast;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
exports.useMessageActions = require_use_message_actions.useMessageActions;
|
package/dist/message/index.mjs
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import{MessageViewport
|
|
1
|
+
import { MessageViewport } from "./components/MessageViewport.mjs";
|
|
2
|
+
import "./components/index.mjs";
|
|
3
|
+
import { useMessageActions } from "./hooks/use-message-actions.mjs";
|
|
4
|
+
import "./hooks/index.mjs";
|
|
5
|
+
import { MessageProvider } from "./providers/MessageProvider.mjs";
|
|
6
|
+
import { Toast, toast } from "@tamagui/toast";
|
|
7
|
+
|
|
8
|
+
export { MessageProvider, MessageViewport, Toast, toast, useMessageActions };
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/message/providers/MessageProvider.tsx
|
|
2
|
+
/**
|
|
3
|
+
* A compatibility wrapper for message descendants.
|
|
4
|
+
*
|
|
5
|
+
* Toast 2 uses a global store, so rendering a MessageProvider is no longer required
|
|
6
|
+
* for useMessageActions. Mount Message or MessageViewport once to render the toasts.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <MessageProvider>
|
|
10
|
+
* <App />
|
|
11
|
+
* </MessageProvider>
|
|
12
|
+
*/
|
|
13
|
+
const MessageProvider = ({ children }) => children;
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.MessageProvider = MessageProvider;
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/message/providers/MessageProvider.tsx
|
|
2
|
+
/**
|
|
3
|
+
* A compatibility wrapper for message descendants.
|
|
4
|
+
*
|
|
5
|
+
* Toast 2 uses a global store, so rendering a MessageProvider is no longer required
|
|
6
|
+
* for useMessageActions. Mount Message or MessageViewport once to render the toasts.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <MessageProvider>
|
|
10
|
+
* <App />
|
|
11
|
+
* </MessageProvider>
|
|
12
|
+
*/
|
|
13
|
+
const MessageProvider = ({ children }) => children;
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { MessageProvider };
|
|
2
17
|
//# sourceMappingURL=MessageProvider.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageProvider.mjs","names":[
|
|
1
|
+
{"version":3,"file":"MessageProvider.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_use_theme_actions = require("./use-theme-actions.cjs");
|
|
2
|
+
const require_use_theme_store = require("./use-theme-store.cjs");
|
|
3
|
+
|
|
4
|
+
exports.useColorThemeName = require_use_theme_store.useColorThemeName;
|
|
5
|
+
exports.useColorThemeNameExists = require_use_theme_store.useColorThemeNameExists;
|
|
6
|
+
exports.useThemeActions = require_use_theme_actions.useThemeActions;
|
|
7
|
+
exports.useThemeMode = require_use_theme_store.useThemeMode;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
import{useThemeActions
|
|
1
|
+
import { useThemeActions } from "./use-theme-actions.mjs";
|
|
2
|
+
import { useColorThemeName, useColorThemeNameExists, useThemeMode } from "./use-theme-store.mjs";
|
|
3
|
+
|
|
4
|
+
export { useColorThemeName, useColorThemeNameExists, useThemeActions, useThemeMode };
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_theme_molecule = require("../molecules/theme-molecule.cjs");
|
|
2
|
+
let jotai_utils = require("jotai/utils");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
|
|
5
|
+
//#region src/theme/hooks/use-theme-actions.ts
|
|
6
|
+
const useThemeActions = (opts) => {
|
|
7
|
+
const themeMolecule = require_theme_molecule.ThemeApi.useMolecule(opts);
|
|
8
|
+
const changeMode = (0, jotai_utils.useAtomCallback)((0, react.useCallback)((get, set, mode) => {
|
|
9
|
+
if (get(themeMolecule.mode) !== mode) set(themeMolecule.mode, mode);
|
|
10
|
+
}, [themeMolecule.mode]));
|
|
11
|
+
return {
|
|
12
|
+
changeMode,
|
|
13
|
+
toggleMode: (0, jotai_utils.useAtomCallback)((0, react.useCallback)((get) => changeMode(get(themeMolecule.mode) === "light" ? "dark" : "light"), [changeMode, themeMolecule.mode])),
|
|
14
|
+
reset: (0, jotai_utils.useAtomCallback)((0, react.useCallback)((get, set) => {
|
|
15
|
+
set(themeMolecule.mode, jotai_utils.RESET);
|
|
16
|
+
}, [themeMolecule.mode]))
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.useThemeActions = useThemeActions;
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
import{ThemeApi
|
|
1
|
+
import { ThemeApi } from "../molecules/theme-molecule.mjs";
|
|
2
|
+
import { RESET, useAtomCallback } from "jotai/utils";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/theme/hooks/use-theme-actions.ts
|
|
6
|
+
const useThemeActions = (opts) => {
|
|
7
|
+
const themeMolecule = ThemeApi.useMolecule(opts);
|
|
8
|
+
const changeMode = useAtomCallback(useCallback((get, set, mode) => {
|
|
9
|
+
if (get(themeMolecule.mode) !== mode) set(themeMolecule.mode, mode);
|
|
10
|
+
}, [themeMolecule.mode]));
|
|
11
|
+
return {
|
|
12
|
+
changeMode,
|
|
13
|
+
toggleMode: useAtomCallback(useCallback((get) => changeMode(get(themeMolecule.mode) === "light" ? "dark" : "light"), [changeMode, themeMolecule.mode])),
|
|
14
|
+
reset: useAtomCallback(useCallback((get, set) => {
|
|
15
|
+
set(themeMolecule.mode, RESET);
|
|
16
|
+
}, [themeMolecule.mode]))
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { useThemeActions };
|
|
2
22
|
//# sourceMappingURL=use-theme-actions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-theme-actions.mjs","names":[
|
|
1
|
+
{"version":3,"file":"use-theme-actions.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_theme_molecule = require("../molecules/theme-molecule.cjs");
|
|
2
|
+
const require_theme_helpers = require("../utilities/theme-helpers.cjs");
|
|
3
|
+
let _tamagui_core = require("@tamagui/core");
|
|
4
|
+
|
|
5
|
+
//#region src/theme/hooks/use-theme-store.ts
|
|
6
|
+
/**
|
|
7
|
+
* Get the color role scheme for the current theme name
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* The following color roles are checked:
|
|
11
|
+
* - base
|
|
12
|
+
* - brand
|
|
13
|
+
* - alternate
|
|
14
|
+
* - accent
|
|
15
|
+
* - link
|
|
16
|
+
* - discovery
|
|
17
|
+
* - info
|
|
18
|
+
* - warning
|
|
19
|
+
* - danger
|
|
20
|
+
* - success
|
|
21
|
+
* - positive
|
|
22
|
+
* - negative
|
|
23
|
+
*
|
|
24
|
+
* @returns The color role scheme for the theme name or undefined
|
|
25
|
+
*/
|
|
26
|
+
const useColorThemeName = () => {
|
|
27
|
+
const theme = (0, _tamagui_core.useThemeName)();
|
|
28
|
+
return require_theme_helpers.getThemeColorThemeName(theme);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a color role scheme is set for the current theme name
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* The following color roles are checked:
|
|
35
|
+
* - base
|
|
36
|
+
* - brand
|
|
37
|
+
* - alternate
|
|
38
|
+
* - accent
|
|
39
|
+
* - link
|
|
40
|
+
* - discovery
|
|
41
|
+
* - info
|
|
42
|
+
* - warning
|
|
43
|
+
* - danger
|
|
44
|
+
* - success
|
|
45
|
+
* - positive
|
|
46
|
+
* - negative
|
|
47
|
+
*
|
|
48
|
+
* @returns An indication if a theme color scheme is set
|
|
49
|
+
*/
|
|
50
|
+
const useColorThemeNameExists = () => {
|
|
51
|
+
const theme = (0, _tamagui_core.useThemeName)();
|
|
52
|
+
return require_theme_helpers.themeColorThemeNameExists(theme);
|
|
53
|
+
};
|
|
54
|
+
const useThemeMode = (options) => {
|
|
55
|
+
return require_theme_molecule.ThemeApi.use(options).mode.get();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.useColorThemeName = useColorThemeName;
|
|
60
|
+
exports.useColorThemeNameExists = useColorThemeNameExists;
|
|
61
|
+
exports.useThemeMode = useThemeMode;
|
|
@@ -11,7 +11,7 @@ import { ColorThemeName } from "../types.cjs";
|
|
|
11
11
|
* - alternate
|
|
12
12
|
* - accent
|
|
13
13
|
* - link
|
|
14
|
-
* -
|
|
14
|
+
* - discovery
|
|
15
15
|
* - info
|
|
16
16
|
* - warning
|
|
17
17
|
* - danger
|
|
@@ -32,7 +32,7 @@ declare const useColorThemeName: () => ColorThemeName | undefined;
|
|
|
32
32
|
* - alternate
|
|
33
33
|
* - accent
|
|
34
34
|
* - link
|
|
35
|
-
* -
|
|
35
|
+
* - discovery
|
|
36
36
|
* - info
|
|
37
37
|
* - warning
|
|
38
38
|
* - danger
|
|
@@ -11,7 +11,7 @@ import { ColorThemeName } from "../types.mjs";
|
|
|
11
11
|
* - alternate
|
|
12
12
|
* - accent
|
|
13
13
|
* - link
|
|
14
|
-
* -
|
|
14
|
+
* - discovery
|
|
15
15
|
* - info
|
|
16
16
|
* - warning
|
|
17
17
|
* - danger
|
|
@@ -32,7 +32,7 @@ declare const useColorThemeName: () => ColorThemeName | undefined;
|
|
|
32
32
|
* - alternate
|
|
33
33
|
* - accent
|
|
34
34
|
* - link
|
|
35
|
-
* -
|
|
35
|
+
* - discovery
|
|
36
36
|
* - info
|
|
37
37
|
* - warning
|
|
38
38
|
* - danger
|
|
@@ -1,2 +1,60 @@
|
|
|
1
|
-
import{ThemeApi
|
|
1
|
+
import { ThemeApi } from "../molecules/theme-molecule.mjs";
|
|
2
|
+
import { getThemeColorThemeName, themeColorThemeNameExists } from "../utilities/theme-helpers.mjs";
|
|
3
|
+
import { useThemeName } from "@tamagui/core";
|
|
4
|
+
|
|
5
|
+
//#region src/theme/hooks/use-theme-store.ts
|
|
6
|
+
/**
|
|
7
|
+
* Get the color role scheme for the current theme name
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* The following color roles are checked:
|
|
11
|
+
* - base
|
|
12
|
+
* - brand
|
|
13
|
+
* - alternate
|
|
14
|
+
* - accent
|
|
15
|
+
* - link
|
|
16
|
+
* - discovery
|
|
17
|
+
* - info
|
|
18
|
+
* - warning
|
|
19
|
+
* - danger
|
|
20
|
+
* - success
|
|
21
|
+
* - positive
|
|
22
|
+
* - negative
|
|
23
|
+
*
|
|
24
|
+
* @returns The color role scheme for the theme name or undefined
|
|
25
|
+
*/
|
|
26
|
+
const useColorThemeName = () => {
|
|
27
|
+
const theme = useThemeName();
|
|
28
|
+
return getThemeColorThemeName(theme);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a color role scheme is set for the current theme name
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* The following color roles are checked:
|
|
35
|
+
* - base
|
|
36
|
+
* - brand
|
|
37
|
+
* - alternate
|
|
38
|
+
* - accent
|
|
39
|
+
* - link
|
|
40
|
+
* - discovery
|
|
41
|
+
* - info
|
|
42
|
+
* - warning
|
|
43
|
+
* - danger
|
|
44
|
+
* - success
|
|
45
|
+
* - positive
|
|
46
|
+
* - negative
|
|
47
|
+
*
|
|
48
|
+
* @returns An indication if a theme color scheme is set
|
|
49
|
+
*/
|
|
50
|
+
const useColorThemeNameExists = () => {
|
|
51
|
+
const theme = useThemeName();
|
|
52
|
+
return themeColorThemeNameExists(theme);
|
|
53
|
+
};
|
|
54
|
+
const useThemeMode = (options) => {
|
|
55
|
+
return ThemeApi.use(options).mode.get();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
export { useColorThemeName, useColorThemeNameExists, useThemeMode };
|
|
2
60
|
//# sourceMappingURL=use-theme-store.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-theme-store.mjs","names":[
|
|
1
|
+
{"version":3,"file":"use-theme-store.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/theme/index.cjs
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_theme_molecule = require("./molecules/theme-molecule.cjs");
|
|
3
|
+
const require_use_theme_actions = require("./hooks/use-theme-actions.cjs");
|
|
4
|
+
const require_theme_helpers = require("./utilities/theme-helpers.cjs");
|
|
5
|
+
const require_use_theme_store = require("./hooks/use-theme-store.cjs");
|
|
6
|
+
require("./hooks/index.cjs");
|
|
7
|
+
require("./molecules/index.cjs");
|
|
8
|
+
const require_ThemeProvider = require("./providers/ThemeProvider.cjs");
|
|
9
|
+
|
|
10
|
+
exports.ThemeApi = require_theme_molecule.ThemeApi;
|
|
11
|
+
exports.ThemeProvider = require_ThemeProvider.ThemeProvider;
|
|
12
|
+
exports.getThemeColorThemeName = require_theme_helpers.getThemeColorThemeName;
|
|
13
|
+
exports.themeColorThemeNameExists = require_theme_helpers.themeColorThemeNameExists;
|
|
14
|
+
exports.useColorThemeName = require_use_theme_store.useColorThemeName;
|
|
15
|
+
exports.useColorThemeNameExists = require_use_theme_store.useColorThemeNameExists;
|
|
16
|
+
exports.useThemeActions = require_use_theme_actions.useThemeActions;
|
|
17
|
+
exports.useThemeMode = require_use_theme_store.useThemeMode;
|
package/dist/theme/index.mjs
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ThemeApi } from "./molecules/theme-molecule.mjs";
|
|
2
|
+
import { useThemeActions } from "./hooks/use-theme-actions.mjs";
|
|
3
|
+
import { getThemeColorThemeName, themeColorThemeNameExists } from "./utilities/theme-helpers.mjs";
|
|
4
|
+
import { useColorThemeName, useColorThemeNameExists, useThemeMode } from "./hooks/use-theme-store.mjs";
|
|
5
|
+
import "./hooks/index.mjs";
|
|
6
|
+
import "./molecules/index.mjs";
|
|
7
|
+
import { ThemeProvider } from "./providers/ThemeProvider.mjs";
|
|
8
|
+
|
|
9
|
+
export { ThemeApi, ThemeProvider, getThemeColorThemeName, themeColorThemeNameExists, useColorThemeName, useColorThemeNameExists, useThemeActions, useThemeMode };
|