@cyclone-ui/state 0.0.11 → 0.0.13

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.
Files changed (167) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +1 -1
  3. package/dist/base/atoms/atom-with-broadcast.cjs +45 -1
  4. package/dist/base/atoms/atom-with-broadcast.mjs +45 -1
  5. package/dist/base/atoms/atom-with-broadcast.mjs.map +1 -1
  6. package/dist/base/atoms/atom-with-compare.cjs +12 -1
  7. package/dist/base/atoms/atom-with-compare.mjs +12 -1
  8. package/dist/base/atoms/atom-with-compare.mjs.map +1 -1
  9. package/dist/base/atoms/atom-with-debounce.cjs +52 -1
  10. package/dist/base/atoms/atom-with-debounce.mjs +52 -1
  11. package/dist/base/atoms/atom-with-debounce.mjs.map +1 -1
  12. package/dist/base/atoms/atom-with-effect.cjs +123 -1
  13. package/dist/base/atoms/atom-with-effect.mjs +120 -1
  14. package/dist/base/atoms/atom-with-effect.mjs.map +1 -1
  15. package/dist/base/atoms/atom-with-listeners.cjs +36 -1
  16. package/dist/base/atoms/atom-with-listeners.mjs +36 -1
  17. package/dist/base/atoms/atom-with-listeners.mjs.map +1 -1
  18. package/dist/base/atoms/atom-with-pending.cjs +14 -1
  19. package/dist/base/atoms/atom-with-pending.mjs +14 -1
  20. package/dist/base/atoms/atom-with-pending.mjs.map +1 -1
  21. package/dist/base/atoms/atom-with-refresh-and-default.cjs +19 -1
  22. package/dist/base/atoms/atom-with-refresh-and-default.mjs +19 -1
  23. package/dist/base/atoms/atom-with-refresh-and-default.mjs.map +1 -1
  24. package/dist/base/atoms/atom-with-refresh.cjs +13 -1
  25. package/dist/base/atoms/atom-with-refresh.mjs +13 -1
  26. package/dist/base/atoms/atom-with-refresh.mjs.map +1 -1
  27. package/dist/base/atoms/atom-with-toggle.cjs +13 -1
  28. package/dist/base/atoms/atom-with-toggle.mjs +13 -1
  29. package/dist/base/atoms/atom-with-toggle.mjs.map +1 -1
  30. package/dist/base/atoms/atom-with-web-storage.cjs +48 -1
  31. package/dist/base/atoms/atom-with-web-storage.mjs +47 -1
  32. package/dist/base/atoms/atom-with-web-storage.mjs.map +1 -1
  33. package/dist/base/atoms/atom-with-wrapper.cjs +25 -1
  34. package/dist/base/atoms/atom-with-wrapper.mjs +25 -1
  35. package/dist/base/atoms/atom-with-wrapper.mjs.map +1 -1
  36. package/dist/base/atoms/base-atom.cjs +25 -1
  37. package/dist/base/atoms/base-atom.mjs +25 -1
  38. package/dist/base/atoms/base-atom.mjs.map +1 -1
  39. package/dist/base/atoms/index.cjs +24 -1
  40. package/dist/base/atoms/index.mjs +13 -1
  41. package/dist/base/hooks/index.cjs +9 -1
  42. package/dist/base/hooks/index.mjs +6 -1
  43. package/dist/base/hooks/use-atom-effect.cjs +17 -1
  44. package/dist/base/hooks/use-atom-effect.mjs +17 -1
  45. package/dist/base/hooks/use-atom-effect.mjs.map +1 -1
  46. package/dist/base/hooks/use-hydrate-molecule.cjs +17 -1
  47. package/dist/base/hooks/use-hydrate-molecule.mjs +17 -1
  48. package/dist/base/hooks/use-hydrate-molecule.mjs.map +1 -1
  49. package/dist/base/hooks/use-prepare-atoms.cjs +20 -1
  50. package/dist/base/hooks/use-prepare-atoms.mjs +20 -1
  51. package/dist/base/hooks/use-prepare-atoms.mjs.map +1 -1
  52. package/dist/base/hooks/use-sync-molecule.cjs +37 -1
  53. package/dist/base/hooks/use-sync-molecule.mjs +37 -1
  54. package/dist/base/hooks/use-sync-molecule.mjs.map +1 -1
  55. package/dist/base/index.cjs +47 -1
  56. package/dist/base/index.mjs +24 -1
  57. package/dist/base/utilities/create-molecule.cjs +105 -4
  58. package/dist/base/utilities/create-molecule.d.cts.map +1 -1
  59. package/dist/base/utilities/create-molecule.mjs +102 -4
  60. package/dist/base/utilities/create-molecule.mjs.map +1 -1
  61. package/dist/base/utilities/create-web-storage.cjs +55 -1
  62. package/dist/base/utilities/create-web-storage.mjs +55 -1
  63. package/dist/base/utilities/create-web-storage.mjs.map +1 -1
  64. package/dist/base/utilities/debounce.cjs +52 -1
  65. package/dist/base/utilities/debounce.mjs +52 -1
  66. package/dist/base/utilities/debounce.mjs.map +1 -1
  67. package/dist/base/utilities/index.cjs +13 -1
  68. package/dist/base/utilities/index.mjs +6 -1
  69. package/dist/base/utilities/is-atom.cjs +48 -1
  70. package/dist/base/utilities/is-atom.mjs +46 -1
  71. package/dist/base/utilities/is-atom.mjs.map +1 -1
  72. package/dist/base/utilities/set-atom-debug.cjs +24 -1
  73. package/dist/base/utilities/set-atom-debug.mjs +23 -1
  74. package/dist/base/utilities/set-atom-debug.mjs.map +1 -1
  75. package/dist/client/index.cjs +16 -1
  76. package/dist/client/index.mjs +8 -1
  77. package/dist/form/atoms/atom-with-field.cjs +23 -1
  78. package/dist/form/atoms/atom-with-field.mjs +23 -1
  79. package/dist/form/atoms/atom-with-field.mjs.map +1 -1
  80. package/dist/form/atoms/atom-with-messages.cjs +85 -1
  81. package/dist/form/atoms/atom-with-messages.mjs +78 -1
  82. package/dist/form/atoms/atom-with-messages.mjs.map +1 -1
  83. package/dist/form/hooks/index.cjs +7 -1
  84. package/dist/form/hooks/index.mjs +5 -1
  85. package/dist/form/hooks/use-field-actions.cjs +92 -1
  86. package/dist/form/hooks/use-field-actions.mjs +92 -1
  87. package/dist/form/hooks/use-field-actions.mjs.map +1 -1
  88. package/dist/form/hooks/use-field-ref.cjs +16 -1
  89. package/dist/form/hooks/use-field-ref.mjs +16 -1
  90. package/dist/form/hooks/use-field-ref.mjs.map +1 -1
  91. package/dist/form/hooks/use-form-actions.cjs +69 -1
  92. package/dist/form/hooks/use-form-actions.mjs +69 -1
  93. package/dist/form/hooks/use-form-actions.mjs.map +1 -1
  94. package/dist/form/index.cjs +30 -1
  95. package/dist/form/index.mjs +17 -1
  96. package/dist/form/molecules/field-molecule.cjs +154 -1
  97. package/dist/form/molecules/field-molecule.mjs +153 -1
  98. package/dist/form/molecules/field-molecule.mjs.map +1 -1
  99. package/dist/form/molecules/form-molecule.cjs +180 -1
  100. package/dist/form/molecules/form-molecule.mjs +179 -1
  101. package/dist/form/molecules/form-molecule.mjs.map +1 -1
  102. package/dist/form/molecules/index.cjs +7 -1
  103. package/dist/form/molecules/index.mjs +4 -1
  104. package/dist/form/providers/FieldProvider.cjs +103 -4
  105. package/dist/form/providers/FieldProvider.mjs +103 -4
  106. package/dist/form/providers/FieldProvider.mjs.map +1 -1
  107. package/dist/form/providers/FormProvider.cjs +66 -4
  108. package/dist/form/providers/FormProvider.d.cts.map +1 -1
  109. package/dist/form/providers/FormProvider.mjs +66 -4
  110. package/dist/form/providers/FormProvider.mjs.map +1 -1
  111. package/dist/form/providers/index.cjs +5 -1
  112. package/dist/form/providers/index.mjs +4 -1
  113. package/dist/form/types.cjs +13 -1
  114. package/dist/form/types.mjs +13 -1
  115. package/dist/form/types.mjs.map +1 -1
  116. package/dist/form/utilities/abort-error.cjs +15 -1
  117. package/dist/form/utilities/abort-error.mjs +15 -1
  118. package/dist/form/utilities/abort-error.mjs.map +1 -1
  119. package/dist/form/utilities/index.cjs +7 -1
  120. package/dist/form/utilities/index.mjs +5 -1
  121. package/dist/form/utilities/is-validation-results.cjs +9 -1
  122. package/dist/form/utilities/is-validation-results.mjs +9 -1
  123. package/dist/form/utilities/is-validation-results.mjs.map +1 -1
  124. package/dist/form/utilities/validators.cjs +8 -1
  125. package/dist/form/utilities/validators.mjs +8 -1
  126. package/dist/form/utilities/validators.mjs.map +1 -1
  127. package/dist/index.cjs +71 -1
  128. package/dist/index.mjs +34 -1
  129. package/dist/message/components/MessageViewport.cjs +21 -6
  130. package/dist/message/components/MessageViewport.mjs +21 -6
  131. package/dist/message/components/MessageViewport.mjs.map +1 -1
  132. package/dist/message/components/index.cjs +3 -1
  133. package/dist/message/components/index.mjs +3 -1
  134. package/dist/message/hooks/index.cjs +3 -1
  135. package/dist/message/hooks/index.mjs +3 -1
  136. package/dist/message/hooks/use-message-actions.cjs +63 -1
  137. package/dist/message/hooks/use-message-actions.mjs +63 -1
  138. package/dist/message/hooks/use-message-actions.mjs.map +1 -1
  139. package/dist/message/index.cjs +23 -1
  140. package/dist/message/index.mjs +8 -1
  141. package/dist/message/providers/MessageProvider.cjs +16 -1
  142. package/dist/message/providers/MessageProvider.mjs +16 -1
  143. package/dist/message/providers/MessageProvider.mjs.map +1 -1
  144. package/dist/theme/hooks/index.cjs +7 -1
  145. package/dist/theme/hooks/index.mjs +4 -1
  146. package/dist/theme/hooks/use-theme-actions.cjs +21 -1
  147. package/dist/theme/hooks/use-theme-actions.mjs +21 -1
  148. package/dist/theme/hooks/use-theme-actions.mjs.map +1 -1
  149. package/dist/theme/hooks/use-theme-store.cjs +61 -1
  150. package/dist/theme/hooks/use-theme-store.d.cts +2 -2
  151. package/dist/theme/hooks/use-theme-store.d.mts +2 -2
  152. package/dist/theme/hooks/use-theme-store.mjs +59 -1
  153. package/dist/theme/hooks/use-theme-store.mjs.map +1 -1
  154. package/dist/theme/index.cjs +17 -1
  155. package/dist/theme/index.mjs +9 -1
  156. package/dist/theme/molecules/index.cjs +3 -1
  157. package/dist/theme/molecules/index.mjs +3 -1
  158. package/dist/theme/molecules/theme-molecule.cjs +14 -1
  159. package/dist/theme/molecules/theme-molecule.mjs +14 -1
  160. package/dist/theme/molecules/theme-molecule.mjs.map +1 -1
  161. package/dist/theme/providers/ThemeProvider.cjs +30 -5
  162. package/dist/theme/providers/ThemeProvider.mjs +30 -5
  163. package/dist/theme/providers/ThemeProvider.mjs.map +1 -1
  164. package/dist/theme/utilities/theme-helpers.cjs +71 -1
  165. package/dist/theme/utilities/theme-helpers.mjs +70 -1
  166. package/dist/theme/utilities/theme-helpers.mjs.map +1 -1
  167. package/package.json +6 -6
package/dist/index.mjs CHANGED
@@ -1 +1,34 @@
1
- import{setAtomDebugLabel as e,setAtomDebugPrivate as t}from"./base/utilities/set-atom-debug.mjs";import{atomWithBroadcast as n}from"./base/atoms/atom-with-broadcast.mjs";import{atomWithCompare as r}from"./base/atoms/atom-with-compare.mjs";import{atomWithWrapper as i}from"./base/atoms/atom-with-wrapper.mjs";import{atomWithDebounce as a}from"./base/atoms/atom-with-debounce.mjs";import{atomWithEffect as o}from"./base/atoms/atom-with-effect.mjs";import{atomWithListeners as s}from"./base/atoms/atom-with-listeners.mjs";import{atomWithPending as c}from"./base/atoms/atom-with-pending.mjs";import{atomWithRefresh as l}from"./base/atoms/atom-with-refresh.mjs";import{atomWithRefreshAndDefault as u}from"./base/atoms/atom-with-refresh-and-default.mjs";import{atomWithToggle as d}from"./base/atoms/atom-with-toggle.mjs";import{createWebStorage as f}from"./base/utilities/create-web-storage.mjs";import{atomWithWebStorage as p,getWebStorage as m}from"./base/atoms/atom-with-web-storage.mjs";import{useAtomEffect as h}from"./base/hooks/use-atom-effect.mjs";import{useHydrateMolecule as g}from"./base/hooks/use-hydrate-molecule.mjs";import{usePrepareAtoms as _}from"./base/hooks/use-prepare-atoms.mjs";import{useSyncMolecule as v}from"./base/hooks/use-sync-molecule.mjs";import{DEFAULT_SCOPE as y,createMoleculeApi as b,createScope as x,use as S}from"./base/utilities/create-molecule.mjs";import{debounce as C}from"./base/utilities/debounce.mjs";import"./base/index.mjs";import{isValidationResults as w}from"./form/utilities/is-validation-results.mjs";import{requiredValidator as T}from"./form/utilities/validators.mjs";import{DEFAULT_FORM_OPTIONS as E,FormApi as D}from"./form/molecules/form-molecule.mjs";import{DEFAULT_FIELD_OPTIONS as O,FieldApi as k}from"./form/molecules/field-molecule.mjs";import{ValidationCause as A}from"./form/types.mjs";import{useFieldActions as j}from"./form/hooks/use-field-actions.mjs";import{useFieldRef as M}from"./form/hooks/use-field-ref.mjs";import{useFormActions as N}from"./form/hooks/use-form-actions.mjs";import{AbortError as P}from"./form/utilities/abort-error.mjs";import{FieldProvider as F}from"./form/providers/FieldProvider.mjs";import{FormProvider as I}from"./form/providers/FormProvider.mjs";import"./form/index.mjs";export{P as AbortError,O as DEFAULT_FIELD_OPTIONS,E as DEFAULT_FORM_OPTIONS,y as DEFAULT_SCOPE,k as FieldApi,F as FieldProvider,D as FormApi,I as FormProvider,A as ValidationCause,n as atomWithBroadcast,r as atomWithCompare,a as atomWithDebounce,o as atomWithEffect,s as atomWithListeners,c as atomWithPending,l as atomWithRefresh,u as atomWithRefreshAndDefault,d as atomWithToggle,p as atomWithWebStorage,i as atomWithWrapper,b as createMoleculeApi,x as createScope,f as createWebStorage,C as debounce,m as getWebStorage,w as isValidationResults,T as requiredValidator,e as setAtomDebugLabel,t as setAtomDebugPrivate,S as use,h as useAtomEffect,j as useFieldActions,M as useFieldRef,N as useFormActions,g as useHydrateMolecule,_ as usePrepareAtoms,v as useSyncMolecule};
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 e=require("@tamagui/toast");const t=({label:t=`Storm Messages`,children:n,...r})=><e.Toast duration={3e4} position="top-right" swipeDirection="horizontal" swipeThreshold={50}{...r}>
2
- <e.Toast.Viewport label={t}>
3
- <e.Toast.List/>
4
- </e.Toast.Viewport>
5
- {n}
6
- </e.Toast>;exports.MessageViewport=t;
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 as e}from"@tamagui/toast";const t=({label:t=`Storm Messages`,children:n,...r})=><e duration={3e4} position="top-right" swipeDirection="horizontal" swipeThreshold={50}{...r}>
2
- <e.Viewport label={t}>
3
- <e.List/>
4
- </e.Viewport>
5
- {n}
6
- </e>;export{t as MessageViewport};
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":["MessageViewport","props","Toast","label","children"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"MessageViewport.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,3 @@
1
- const e=require("./MessageViewport.cjs");exports.MessageViewport=e.MessageViewport;
1
+ const require_MessageViewport = require("./MessageViewport.cjs");
2
+
3
+ exports.MessageViewport = require_MessageViewport.MessageViewport;
@@ -1 +1,3 @@
1
- import{MessageViewport as e}from"./MessageViewport.mjs";export{e as MessageViewport};
1
+ import { MessageViewport } from "./MessageViewport.mjs";
2
+
3
+ export { MessageViewport };
@@ -1 +1,3 @@
1
- const e=require("./use-message-actions.cjs");exports.useMessageActions=e.useMessageActions;
1
+ const require_use_message_actions = require("./use-message-actions.cjs");
2
+
3
+ exports.useMessageActions = require_use_message_actions.useMessageActions;
@@ -1 +1,3 @@
1
- import{useMessageActions as e}from"./use-message-actions.mjs";export{e as useMessageActions};
1
+ import { useMessageActions } from "./use-message-actions.mjs";
2
+
3
+ export { useMessageActions };
@@ -1 +1,63 @@
1
- let e=require("@tamagui/toast");const t=()=>{let t=(t,n={})=>{let{heading:r,type:i,...a}=n,o=r||t,s={...a,data:{messageType:i},description:r?t:void 0};switch(i){case`error`:e.toast.error(o,s);break;case`warning`:e.toast.warning(o,s);break;case`info`:e.toast.info(o,s);break;case`success`:e.toast.success(o,s);break;default:(0,e.toast)(o,s)}};return{hide:()=>e.toast.dismiss(),show:t,showInfo:(e,n={})=>{t(e,{...n,type:`info`})},showSuccess:(e,n={})=>{t(e||`Process completed successfully`,{...n,type:`success`})},showWarning:(e,n={})=>{t(e,{...n,type:`warning`})},showError:(e,n={})=>{t(e||`An error occured during processing`,{...n,type:`error`})},showHelp:(e,n={})=>{t(e,n)}}};exports.useMessageActions=t;
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 as e}from"@tamagui/toast";const t=()=>{let t=(t,n={})=>{let{heading:r,type:i,...a}=n,o=r||t,s={...a,data:{messageType:i},description:r?t:void 0};switch(i){case`error`:e.error(o,s);break;case`warning`:e.warning(o,s);break;case`info`:e.info(o,s);break;case`success`:e.success(o,s);break;default:e(o,s)}};return{hide:()=>e.dismiss(),show:t,showInfo:(e,n={})=>{t(e,{...n,type:`info`})},showSuccess:(e,n={})=>{t(e||`Process completed successfully`,{...n,type:`success`})},showWarning:(e,n={})=>{t(e,{...n,type:`warning`})},showError:(e,n={})=>{t(e||`An error occured during processing`,{...n,type:`error`})},showHelp:(e,n={})=>{t(e,n)}}};export{t as useMessageActions};
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":["useMessageActions","show","toastOptions","options","title","heading","message","data","type","toast"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"use-message-actions.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,23 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./components/MessageViewport.cjs");require("./components/index.cjs");const t=require("./hooks/use-message-actions.cjs");require("./hooks/index.cjs");const n=require("./providers/MessageProvider.cjs");let r=require("@tamagui/toast");exports.MessageProvider=n.MessageProvider,exports.MessageViewport=e.MessageViewport,Object.defineProperty(exports,"Toast",{enumerable:!0,get:function(){return r.Toast}}),Object.defineProperty(exports,"toast",{enumerable:!0,get:function(){return r.toast}}),exports.useMessageActions=t.useMessageActions;
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;
@@ -1 +1,8 @@
1
- import{MessageViewport as e}from"./components/MessageViewport.mjs";import"./components/index.mjs";import{useMessageActions as t}from"./hooks/use-message-actions.mjs";import"./hooks/index.mjs";import{MessageProvider as n}from"./providers/MessageProvider.mjs";import{Toast as r,toast as i}from"@tamagui/toast";export{n as MessageProvider,e as MessageViewport,r as Toast,i as toast,t as useMessageActions};
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
- const e=({children:e})=>e;exports.MessageProvider=e;
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
- const e=({children:e})=>e;export{e as MessageProvider};
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":["MessageProvider","children"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"MessageProvider.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,7 @@
1
- const e=require("./use-theme-actions.cjs"),t=require("./use-theme-store.cjs");exports.useColorThemeName=t.useColorThemeName,exports.useColorThemeNameExists=t.useColorThemeNameExists,exports.useThemeActions=e.useThemeActions,exports.useThemeMode=t.useThemeMode;
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 as e}from"./use-theme-actions.mjs";import{useColorThemeName as t,useColorThemeNameExists as n,useThemeMode as r}from"./use-theme-store.mjs";export{t as useColorThemeName,n as useColorThemeNameExists,e as useThemeActions,r as useThemeMode};
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 e=require("../molecules/theme-molecule.cjs");let t=require("jotai/utils"),n=require("react");const r=r=>{let i=e.ThemeApi.useMolecule(r),a=(0,t.useAtomCallback)((0,n.useCallback)((e,t,n)=>{e(i.mode)!==n&&t(i.mode,n)},[]));return{changeMode:a,toggleMode:(0,t.useAtomCallback)((0,n.useCallback)(e=>a(e(i.mode)===`light`?`dark`:`light`),[a])),reset:(0,t.useAtomCallback)((0,n.useCallback)((e,n)=>{n(i.mode,t.RESET)},[]))}};exports.useThemeActions=r;
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 as e}from"../molecules/theme-molecule.mjs";import{RESET as t,useAtomCallback as n}from"jotai/utils";import{useCallback as r}from"react";const i=i=>{let a=e.useMolecule(i),o=n(r((e,t,n)=>{e(a.mode)!==n&&t(a.mode,n)},[]));return{changeMode:o,toggleMode:n(r(e=>o(e(a.mode)===`light`?`dark`:`light`),[o])),reset:n(r((e,n)=>{n(a.mode,t)},[]))}};export{i as useThemeActions};
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":["useThemeActions","themeMolecule","ThemeApi","opts","changeMode","useAtomCallback","useCallback","get","mode","set","RESET"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"use-theme-actions.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,61 @@
1
- const e=require("../molecules/theme-molecule.cjs"),t=require("../utilities/theme-helpers.cjs");let n=require("@tamagui/core");const r=()=>{let e=(0,n.useThemeName)();return t.getThemeColorThemeName(e)},i=()=>{let e=(0,n.useThemeName)();return t.themeColorThemeNameExists(e)},a=t=>e.ThemeApi.use(t).mode.get();exports.useColorThemeName=r,exports.useColorThemeNameExists=i,exports.useThemeMode=a;
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
- * - help
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
- * - help
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
- * - help
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
- * - help
35
+ * - discovery
36
36
  * - info
37
37
  * - warning
38
38
  * - danger
@@ -1,2 +1,60 @@
1
- import{ThemeApi as e}from"../molecules/theme-molecule.mjs";import{getThemeColorThemeName as t,themeColorThemeNameExists as n}from"../utilities/theme-helpers.mjs";import{useThemeName as r}from"@tamagui/core";const i=()=>{let e=r();return t(e)},a=()=>{let e=r();return n(e)},o=t=>e.use(t).mode.get();export{i as useColorThemeName,a as useColorThemeNameExists,o as useThemeMode};
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":["useColorThemeName","theme","useThemeName","getThemeColorThemeName","useColorThemeNameExists","themeColorThemeNameExists","useThemeMode","ThemeApi","options"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"use-theme-store.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,17 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./molecules/theme-molecule.cjs"),t=require("./hooks/use-theme-actions.cjs"),n=require("./utilities/theme-helpers.cjs"),r=require("./hooks/use-theme-store.cjs");require("./hooks/index.cjs"),require("./molecules/index.cjs");const i=require("./providers/ThemeProvider.cjs");exports.ThemeApi=e.ThemeApi,exports.ThemeProvider=i.ThemeProvider,exports.getThemeColorThemeName=n.getThemeColorThemeName,exports.themeColorThemeNameExists=n.themeColorThemeNameExists,exports.useColorThemeName=r.useColorThemeName,exports.useColorThemeNameExists=r.useColorThemeNameExists,exports.useThemeActions=t.useThemeActions,exports.useThemeMode=r.useThemeMode;
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;
@@ -1 +1,9 @@
1
- import{ThemeApi as e}from"./molecules/theme-molecule.mjs";import{useThemeActions as t}from"./hooks/use-theme-actions.mjs";import{getThemeColorThemeName as n,themeColorThemeNameExists as r}from"./utilities/theme-helpers.mjs";import{useColorThemeName as i,useColorThemeNameExists as a,useThemeMode as o}from"./hooks/use-theme-store.mjs";import"./hooks/index.mjs";import"./molecules/index.mjs";import{ThemeProvider as s}from"./providers/ThemeProvider.mjs";export{e as ThemeApi,s as ThemeProvider,n as getThemeColorThemeName,r as themeColorThemeNameExists,i as useColorThemeName,a as useColorThemeNameExists,t as useThemeActions,o as useThemeMode};
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 };
@@ -1 +1,3 @@
1
- const e=require("./theme-molecule.cjs");exports.ThemeApi=e.ThemeApi;
1
+ const require_theme_molecule = require("./theme-molecule.cjs");
2
+
3
+ exports.ThemeApi = require_theme_molecule.ThemeApi;
@@ -1 +1,3 @@
1
- import{ThemeApi as e}from"./theme-molecule.mjs";export{e as ThemeApi};
1
+ import { ThemeApi } from "./theme-molecule.mjs";
2
+
3
+ export { ThemeApi };