@applica-software-guru/react-admin 1.3.168 → 1.3.171

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/index.jsx"],"names":[],"mappings":"AAcA;;;4CAgEC;;;;;;;sBArEqB,aAAa;sBACb,aAAa;sBAJb,YAAY"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/index.jsx"],"names":[],"mappings":"AAcA;;;4CAiEC;;;;;;;sBAtEqB,aAAa;sBACb,aAAa;sBAJb,YAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.3.168",
3
+ "version": "1.3.171",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,7 +48,7 @@
48
48
  "./style.css": "./dist/style.css"
49
49
  },
50
50
  "dependencies": {
51
- "@ant-design/icons": "^5.1.4",
51
+ "@ant-design/icons": "^5.3.1",
52
52
  "@emotion/react": "^11.4",
53
53
  "@emotion/styled": "^11.3.0",
54
54
  "@mui/base": "5.0.0-beta.19",
@@ -19,6 +19,7 @@ const ResponsiveSection = (props: IResponsiveSectionProps) => {
19
19
  <>
20
20
  {/*@ts-ignore*/}
21
21
  <HeaderToggleButton
22
+ value="drawer"
22
23
  aria-label="open more menu"
23
24
  aria-controls={open ? 'menu-list-grow' : undefined}
24
25
  aria-haspopup="true"
@@ -10,6 +10,7 @@ import { Navigation } from './Navigation';
10
10
  import { Outlet } from 'react-router-dom';
11
11
  import { useBreadcrumbs } from '../../hooks';
12
12
  import { withLayoutProvider } from './Provider';
13
+ import { ThemeToggler } from './ThemeToggler';
13
14
 
14
15
  type ILayoutProps = React.PropsWithChildren<{
15
16
  name: string;
@@ -26,6 +27,7 @@ const Layout = withLayoutProvider(function Layout(props: ILayoutProps) {
26
27
  <LayoutWrapper>
27
28
  <Header>
28
29
  <HeaderSpacer />
30
+ <ThemeToggler />
29
31
  <LoadingIndicator />
30
32
  <HeaderNotification />
31
33
  <ResponsiveSection>
@@ -0,0 +1,20 @@
1
+ import { SunOutlined, MoonOutlined } from '@ant-design/icons';
2
+ import { useThemeConfig } from '../../hooks';
3
+ import { HeaderToggleButton } from './Header';
4
+
5
+ const ThemeToggler = () => {
6
+ const { mode, setMode } = useThemeConfig();
7
+
8
+ return (
9
+ <HeaderToggleButton
10
+ value="theme-mode"
11
+ aria-label="toggle mode"
12
+ onChange={() => setMode(mode === 'dark' ? 'light' : 'dark')}
13
+ selected={false}
14
+ >
15
+ {mode === 'dark' ? <SunOutlined /> : <MoonOutlined />}
16
+ </HeaderToggleButton>
17
+ );
18
+ };
19
+
20
+ export { ThemeToggler };
@@ -8,4 +8,5 @@ export * from './Navigation';
8
8
  export * from './NavMenu';
9
9
  export * from './Provider';
10
10
  export * from './Wrapper';
11
- export * from './Error'
11
+ export * from './Error';
12
+ export * from './ThemeToggler';
@@ -13,7 +13,8 @@ import { useMemo } from 'react';
13
13
  import { useThemeConfig } from '../hooks';
14
14
 
15
15
  const ThemeCustomization = ({ themeOverrides, children }) => {
16
- const { themeDirection, mode, presetColor, fontFamily } = useThemeConfig();
16
+ const _themeConfig = useThemeConfig(1);
17
+ const { themeDirection, mode, presetColor, fontFamily } = _themeConfig;
17
18
 
18
19
  const theme = useMemo(() => Palette(mode, presetColor), [mode, presetColor]);
19
20