@zydon/common 2.6.8 → 2.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { C as CustomShadows } from './index-6dff3367.js';
2
2
  export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-6dff3367.js';
3
- export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-570069f1.js';
3
+ export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-4537dcad.js';
4
4
  export { default as ThemeProvider } from './theme/theme-provider.js';
5
- import { S as SettingsState } from './settings-5a31f5b8.js';
5
+ import { S as SettingsState, C as ColorScheme } from './settings-4d4dc42f.js';
6
6
  import { Theme as Theme$1 } from '@mui/material/styles';
7
7
  import { a as ThemeLocaleComponents } from './types-2a4efc17.js';
8
8
  export { BgBlurProps, BgGradientProps, BorderGradientProps, ColorWithAlpha, MaxLineProps, MediaFontSize, bgBlur, bgGradient, borderGradient, createPaletteChannel, hexToRgbChannel, hexToRgbaChannel, hideScrollX, hideScrollY, maxLine, mediaQueries, menuItem, paper, pxToRem, remToPx, responsiveFontSizes, setFont, stylesMode, textGradient, varAlpha } from './theme/styles/index.js';
@@ -24,6 +24,14 @@ import 'csstype';
24
24
 
25
25
  declare function createTheme(localeComponents: ThemeLocaleComponents, settings: SettingsState, cssVarPrefix?: string): Theme$1;
26
26
 
27
+ interface UseThemeToggleReturn {
28
+ colorScheme: ColorScheme;
29
+ isDark: boolean;
30
+ toggleTheme: () => void;
31
+ setColorScheme: (scheme: ColorScheme) => void;
32
+ }
33
+ declare const useThemeToggle: () => UseThemeToggleReturn;
34
+
27
35
  declare module '@mui/material/styles/createPalette' {
28
36
  interface CommonColors {
29
37
  whiteChannel: string;
@@ -148,4 +156,4 @@ declare module '@mui/material/styles' {
148
156
 
149
157
  declare const test: () => boolean;
150
158
 
151
- export { SettingsState, createTheme, test };
159
+ export { SettingsState, createTheme, test, useThemeToggle };
package/dist/index.js CHANGED
@@ -11,7 +11,9 @@ import './chunk-QQDMA4TE.js';
11
11
  import './chunk-Z2TDWMRU.js';
12
12
  import './chunk-4INDXVIX.js';
13
13
  import './chunk-3APKMSVD.js';
14
+ import { useCallback } from 'react';
15
+ import { useColorScheme } from '@mui/material/styles';
14
16
 
15
- var X=()=>!0;
17
+ var d=()=>{let{mode:i,setMode:e}=useColorScheme(),t=i||"light",r=t==="dark",n=useCallback(()=>{e(r?"light":"dark");},[r,e]),s=useCallback(o=>{e(o);},[e]);return {colorScheme:t,isDark:r,toggleTheme:n,setColorScheme:s}};var le=()=>!0;
16
18
 
17
- export { X as test };
19
+ export { le as test, d as useThemeToggle };
@@ -9,4 +9,4 @@ type SettingsState = {
9
9
  navLayout: 'vertical' | 'horizontal' | 'mini';
10
10
  };
11
11
 
12
- export { SettingsState as S };
12
+ export { ColorScheme as C, SettingsState as S };
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { PropsWithChildren } from 'react';
4
- import { S as SettingsState } from './settings-5a31f5b8.js';
4
+ import { S as SettingsState } from './settings-4d4dc42f.js';
5
5
 
6
6
  interface ThemeProviderProps extends PropsWithChildren<Partial<SettingsState>> {
7
7
  storageKey?: string;
@@ -1,4 +1,4 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'react';
3
- import '../settings-5a31f5b8.js';
4
- export { a as SettingsContext, _ as default, u as useSettingsContext } from '../settings-provider-570069f1.js';
3
+ import '../settings-4d4dc42f.js';
4
+ export { a as SettingsContext, _ as default, u as useSettingsContext } from '../settings-provider-4537dcad.js';
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { T as ThemeProviderProps } from '../settings-provider-570069f1.js';
3
- export { u as useSettingsContext } from '../settings-provider-570069f1.js';
2
+ import { T as ThemeProviderProps } from '../settings-provider-4537dcad.js';
3
+ export { u as useSettingsContext } from '../settings-provider-4537dcad.js';
4
4
  import 'react';
5
- import '../settings-5a31f5b8.js';
5
+ import '../settings-4d4dc42f.js';
6
6
 
7
7
  declare const ThemeProvider: ({ children, cssVarPrefix, primaryColor, fontFamily, compactLayout, contrast, navColor, navLayout, colorScheme, }: ThemeProviderProps) => react_jsx_runtime.JSX.Element;
8
8
 
@@ -1,6 +1,6 @@
1
1
  import * as _mui_material_styles from '@mui/material/styles';
2
2
  import { Components, Theme } from '@mui/material/styles';
3
- import { S as SettingsState } from '../../settings-5a31f5b8.js';
3
+ import { S as SettingsState } from '../../settings-4d4dc42f.js';
4
4
  import { T as ThemeUpdateOptions } from '../../types-2a4efc17.js';
5
5
  import '@mui/material/styles/createTypography';
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.6.8",
3
+ "version": "2.6.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",