@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.
Files changed (167) hide show
  1. package/CHANGELOG.md +26 -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
@@ -1 +1,14 @@
1
- const e=require("../../base/utilities/create-molecule.cjs");let t=require("jotai/utils"),n=require("jotai");const r=e.createMoleculeApi(()=>({items:(0,n.atom)([`light`,`dark`]),mode:(0,t.atomWithReset)(`dark`)}),{type:`theme`});exports.ThemeApi=r;
1
+ const require_create_molecule = require("../../base/utilities/create-molecule.cjs");
2
+ let jotai_utils = require("jotai/utils");
3
+ let jotai = require("jotai");
4
+
5
+ //#region src/theme/molecules/theme-molecule.ts
6
+ const ThemeApi = require_create_molecule.createMoleculeApi(() => {
7
+ return {
8
+ items: (0, jotai.atom)(["light", "dark"]),
9
+ mode: (0, jotai_utils.atomWithReset)("dark")
10
+ };
11
+ }, { type: "theme" });
12
+
13
+ //#endregion
14
+ exports.ThemeApi = ThemeApi;
@@ -1,2 +1,15 @@
1
- import{createMoleculeApi as e}from"../../base/utilities/create-molecule.mjs";import{atomWithReset as t}from"jotai/utils";import{atom as n}from"jotai";const r=e(()=>({items:n([`light`,`dark`]),mode:t(`dark`)}),{type:`theme`});export{r as ThemeApi};
1
+ import { createMoleculeApi } from "../../base/utilities/create-molecule.mjs";
2
+ import { atomWithReset } from "jotai/utils";
3
+ import { atom } from "jotai";
4
+
5
+ //#region src/theme/molecules/theme-molecule.ts
6
+ const ThemeApi = createMoleculeApi(() => {
7
+ return {
8
+ items: atom(["light", "dark"]),
9
+ mode: atomWithReset("dark")
10
+ };
11
+ }, { type: "theme" });
12
+
13
+ //#endregion
14
+ export { ThemeApi };
2
15
  //# sourceMappingURL=theme-molecule.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme-molecule.mjs","names":["ThemeApi","createMoleculeApi","atom","atomWithReset"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"theme-molecule.mjs","names":[],"sources":[],"mappings":""}
@@ -1,5 +1,30 @@
1
- const e=require("../molecules/theme-molecule.cjs");let t=require("react"),n=require("@tamagui/core");const r=({children:t,disableInjectCSS:r=!0,...i})=>{let a=e.ThemeApi.use().mode.get();return<n.TamaguiProvider{...i} defaultTheme={a} disableInjectCSS={r}>
2
- {t}
3
- </n.TamaguiProvider>},i=[`light`,`dark`],a=({children:n,defaultMode:a=`dark`,items:o=i,...s})=>{let c=(0,t.useMemo)(()=>{if(typeof window<`u`&&window.matchMedia){if(window.matchMedia(`(prefers-color-scheme: light)`).matches)return`light`;if(window.matchMedia(`(prefers-color-scheme: dark)`).matches)return`dark`}return a},[a]);return<e.ThemeApi.Provider scope="theme" initialState={{mode:c,items:o}}>
4
- <r{...s}>{n}</r>
5
- </e.ThemeApi.Provider>};exports.ThemeProvider=a;
1
+ const require_theme_molecule = require("../molecules/theme-molecule.cjs");
2
+ let react = require("react");
3
+ let _tamagui_core = require("@tamagui/core");
4
+
5
+ //#region src/theme/providers/ThemeProvider.tsx
6
+ const ThemeStateManager = ({ children, disableInjectCSS = true, ...props }) => {
7
+ const mode = require_theme_molecule.ThemeApi.use().mode.get();
8
+ return <_tamagui_core.TamaguiProvider {...props} defaultTheme={mode} disableInjectCSS={disableInjectCSS}>
9
+ {children}
10
+ </_tamagui_core.TamaguiProvider>;
11
+ };
12
+ const DEFAULT_ITEMS = ["light", "dark"];
13
+ const ThemeProvider = ({ children, defaultMode = "dark", items = DEFAULT_ITEMS, ...props }) => {
14
+ const mode = (0, react.useMemo)(() => {
15
+ if (typeof window !== "undefined" && window.matchMedia) {
16
+ if (window.matchMedia("(prefers-color-scheme: light)").matches) return "light";
17
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) return "dark";
18
+ }
19
+ return defaultMode;
20
+ }, [defaultMode]);
21
+ return <require_theme_molecule.ThemeApi.Provider scope="theme" initialState={{
22
+ mode,
23
+ items
24
+ }}>
25
+ <ThemeStateManager {...props}>{children}</ThemeStateManager>
26
+ </require_theme_molecule.ThemeApi.Provider>;
27
+ };
28
+
29
+ //#endregion
30
+ exports.ThemeProvider = ThemeProvider;
@@ -1,6 +1,31 @@
1
- import{ThemeApi as e}from"../molecules/theme-molecule.mjs";import{useMemo as t}from"react";import{TamaguiProvider as n}from"@tamagui/core";const r=({children:t,disableInjectCSS:r=!0,...i})=>{let a=e.use().mode.get();return<n{...i} defaultTheme={a} disableInjectCSS={r}>
2
- {t}
3
- </n>},i=[`light`,`dark`],a=({children:n,defaultMode:a=`dark`,items:o=i,...s})=>{let c=t(()=>{if(typeof window<`u`&&window.matchMedia){if(window.matchMedia(`(prefers-color-scheme: light)`).matches)return`light`;if(window.matchMedia(`(prefers-color-scheme: dark)`).matches)return`dark`}return a},[a]);return<e.Provider scope="theme" initialState={{mode:c,items:o}}>
4
- <r{...s}>{n}</r>
5
- </e.Provider>};export{a as ThemeProvider};
1
+ import { ThemeApi } from "../molecules/theme-molecule.mjs";
2
+ import { useMemo } from "react";
3
+ import { TamaguiProvider } from "@tamagui/core";
4
+
5
+ //#region src/theme/providers/ThemeProvider.tsx
6
+ const ThemeStateManager = ({ children, disableInjectCSS = true, ...props }) => {
7
+ const mode = ThemeApi.use().mode.get();
8
+ return <TamaguiProvider {...props} defaultTheme={mode} disableInjectCSS={disableInjectCSS}>
9
+ {children}
10
+ </TamaguiProvider>;
11
+ };
12
+ const DEFAULT_ITEMS = ["light", "dark"];
13
+ const ThemeProvider = ({ children, defaultMode = "dark", items = DEFAULT_ITEMS, ...props }) => {
14
+ const mode = useMemo(() => {
15
+ if (typeof window !== "undefined" && window.matchMedia) {
16
+ if (window.matchMedia("(prefers-color-scheme: light)").matches) return "light";
17
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) return "dark";
18
+ }
19
+ return defaultMode;
20
+ }, [defaultMode]);
21
+ return <ThemeApi.Provider scope="theme" initialState={{
22
+ mode,
23
+ items
24
+ }}>
25
+ <ThemeStateManager {...props}>{children}</ThemeStateManager>
26
+ </ThemeApi.Provider>;
27
+ };
28
+
29
+ //#endregion
30
+ export { ThemeProvider };
6
31
  //# sourceMappingURL=ThemeProvider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.mjs","names":["ThemeStateManager","props","mode","ThemeApi","TamaguiProvider","disableInjectCSS","children","DEFAULT_ITEMS","ThemeProvider","useMemo","defaultMode"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"ThemeProvider.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,71 @@
1
- const e=e=>{if(e){if(e.includes(`base`))return`base`;if(e.includes(`brand`))return`brand`;if(e.includes(`discovery`))return`discovery`;if(e.includes(`info`))return`info`;if(e.includes(`warning`))return`warning`;if(e.includes(`danger`))return`danger`;if(e.includes(`success`))return`success`;if(e.includes(`positive`))return`positive`;if(e.includes(`negative`))return`negative`}},t=t=>!!e(t);exports.getThemeColorThemeName=e,exports.themeColorThemeNameExists=t;
1
+ //#region src/theme/utilities/theme-helpers.ts
2
+ /**
3
+ * Get the color role scheme for the current theme name
4
+ *
5
+ * @example
6
+ * getThemeColorThemeName('dark') // undefined
7
+ * getThemeColorThemeName('dark_Input') // undefined
8
+ * getThemeColorThemeName('dark_base_Input') // "base"
9
+ * getThemeColorThemeName('dark_brand_Input') // "brand"
10
+ *
11
+ * @remarks
12
+ * The following color roles are checked:
13
+ * - base
14
+ * - secondary
15
+ * - brand
16
+ * - discovery
17
+ * - info
18
+ * - warning
19
+ * - danger
20
+ * - success
21
+ * - positive
22
+ * - negative
23
+ *
24
+ * @param theme - The theme name
25
+ * @returns The color role scheme for the theme name or undefined
26
+ */
27
+ const getThemeColorThemeName = (theme) => {
28
+ if (theme) {
29
+ if (theme.includes("base")) return "base";
30
+ else if (theme.includes("brand")) return "brand";
31
+ else if (theme.includes("discovery")) return "discovery";
32
+ else if (theme.includes("info")) return "info";
33
+ else if (theme.includes("warning")) return "warning";
34
+ else if (theme.includes("danger")) return "danger";
35
+ else if (theme.includes("success")) return "success";
36
+ else if (theme.includes("positive")) return "positive";
37
+ else if (theme.includes("negative")) return "negative";
38
+ }
39
+ };
40
+ /**
41
+ * Check if a color role scheme is set for the current theme name
42
+ *
43
+ * @example
44
+ * themeColorThemeNameExists('dark') // false
45
+ * themeColorThemeNameExists('dark_Input') // false
46
+ * themeColorThemeNameExists('dark_base_Input') // true
47
+ * themeColorThemeNameExists('dark_brand_Input') // true
48
+ *
49
+ * @remarks
50
+ * The following color roles are checked:
51
+ * - base
52
+ * - secondary
53
+ * - brand
54
+ * - discovery
55
+ * - info
56
+ * - warning
57
+ * - danger
58
+ * - success
59
+ * - positive
60
+ * - negative
61
+ *
62
+ * @param theme - The theme name
63
+ * @returns An indication if a theme color scheme is set
64
+ */
65
+ const themeColorThemeNameExists = (theme) => {
66
+ return Boolean(getThemeColorThemeName(theme));
67
+ };
68
+
69
+ //#endregion
70
+ exports.getThemeColorThemeName = getThemeColorThemeName;
71
+ exports.themeColorThemeNameExists = themeColorThemeNameExists;
@@ -1,2 +1,71 @@
1
- const e=e=>{if(e){if(e.includes(`base`))return`base`;if(e.includes(`brand`))return`brand`;if(e.includes(`discovery`))return`discovery`;if(e.includes(`info`))return`info`;if(e.includes(`warning`))return`warning`;if(e.includes(`danger`))return`danger`;if(e.includes(`success`))return`success`;if(e.includes(`positive`))return`positive`;if(e.includes(`negative`))return`negative`}},t=t=>!!e(t);export{e as getThemeColorThemeName,t as themeColorThemeNameExists};
1
+ //#region src/theme/utilities/theme-helpers.ts
2
+ /**
3
+ * Get the color role scheme for the current theme name
4
+ *
5
+ * @example
6
+ * getThemeColorThemeName('dark') // undefined
7
+ * getThemeColorThemeName('dark_Input') // undefined
8
+ * getThemeColorThemeName('dark_base_Input') // "base"
9
+ * getThemeColorThemeName('dark_brand_Input') // "brand"
10
+ *
11
+ * @remarks
12
+ * The following color roles are checked:
13
+ * - base
14
+ * - secondary
15
+ * - brand
16
+ * - discovery
17
+ * - info
18
+ * - warning
19
+ * - danger
20
+ * - success
21
+ * - positive
22
+ * - negative
23
+ *
24
+ * @param theme - The theme name
25
+ * @returns The color role scheme for the theme name or undefined
26
+ */
27
+ const getThemeColorThemeName = (theme) => {
28
+ if (theme) {
29
+ if (theme.includes("base")) return "base";
30
+ else if (theme.includes("brand")) return "brand";
31
+ else if (theme.includes("discovery")) return "discovery";
32
+ else if (theme.includes("info")) return "info";
33
+ else if (theme.includes("warning")) return "warning";
34
+ else if (theme.includes("danger")) return "danger";
35
+ else if (theme.includes("success")) return "success";
36
+ else if (theme.includes("positive")) return "positive";
37
+ else if (theme.includes("negative")) return "negative";
38
+ }
39
+ };
40
+ /**
41
+ * Check if a color role scheme is set for the current theme name
42
+ *
43
+ * @example
44
+ * themeColorThemeNameExists('dark') // false
45
+ * themeColorThemeNameExists('dark_Input') // false
46
+ * themeColorThemeNameExists('dark_base_Input') // true
47
+ * themeColorThemeNameExists('dark_brand_Input') // true
48
+ *
49
+ * @remarks
50
+ * The following color roles are checked:
51
+ * - base
52
+ * - secondary
53
+ * - brand
54
+ * - discovery
55
+ * - info
56
+ * - warning
57
+ * - danger
58
+ * - success
59
+ * - positive
60
+ * - negative
61
+ *
62
+ * @param theme - The theme name
63
+ * @returns An indication if a theme color scheme is set
64
+ */
65
+ const themeColorThemeNameExists = (theme) => {
66
+ return Boolean(getThemeColorThemeName(theme));
67
+ };
68
+
69
+ //#endregion
70
+ export { getThemeColorThemeName, themeColorThemeNameExists };
2
71
  //# sourceMappingURL=theme-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme-helpers.mjs","names":["getThemeColorThemeName","theme","themeColorThemeNameExists"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"theme-helpers.mjs","names":[],"sources":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyclone-ui/state",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "description": "A state management package used to handle state in Storm Software applications.",
6
6
  "repository": {
@@ -123,16 +123,16 @@
123
123
  "@stryke/type-checks": "^0.6.49",
124
124
  "@stryke/types": "^0.12.44",
125
125
  "@stryke/unique-id": "^0.3.129",
126
- "@tamagui/core": "3.0.0-beta.1422.1",
127
- "@tamagui/portal": "3.0.0-beta.1422.1",
128
- "@tamagui/toast": "3.0.0-beta.1422.1",
126
+ "@tamagui/core": "3.0.2",
127
+ "@tamagui/portal": "3.0.2",
128
+ "@tamagui/toast": "3.0.2",
129
129
  "bunshi": "^2.2.0",
130
130
  "jotai-optics": "^0.4.0",
131
131
  "maska": "^3.2.2",
132
132
  "optics-ts": "^2.4.1",
133
133
  "react-native-safe-area-context": "^4.14.1",
134
134
  "valibot": "^0.42.1",
135
- "@cyclone-ui/helpers": "0.3.11"
135
+ "@cyclone-ui/helpers": "0.3.13"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@powerlines/plugin-tsdown": "^0.1.615",
@@ -143,5 +143,5 @@
143
143
  },
144
144
  "publishConfig": { "access": "public" },
145
145
  "module": "./dist/index.mjs",
146
- "gitHead": "394fbc8f564ba966872485af47d3afcac07dacf0"
146
+ "gitHead": "0ca271e05c31b584a9c66598769cd2a0c432edf8"
147
147
  }