@open-ui-kit/core 1.5.0 → 1.6.0
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/README.md +19 -13
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/index.d.ts +388 -392
- package/index.esm.js +1 -1
- package/index.esm.js.map +1 -1
- package/index.umd.js +1 -1
- package/index.umd.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -97,23 +97,29 @@ yarn add @open-ui-kit/core @mui/material @emotion/react @emotion/styled
|
|
|
97
97
|
Wrap your application with the `ThemeProvider` to enable Open UI Kit theming:
|
|
98
98
|
|
|
99
99
|
```jsx
|
|
100
|
-
import React
|
|
101
|
-
import { ThemeProvider } from '@open-ui-kit/core';
|
|
100
|
+
import React from 'react';
|
|
101
|
+
import { ThemeProvider, useThemeMode } from '@open-ui-kit/core';
|
|
102
102
|
import '@open-ui-kit/core/typography.css';
|
|
103
103
|
|
|
104
|
-
function
|
|
105
|
-
const
|
|
104
|
+
function AppContent() {
|
|
105
|
+
const { isDarkMode, toggleTheme } = useThemeMode();
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
|
-
<
|
|
109
|
-
<
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
<div className="app">
|
|
109
|
+
<header>
|
|
110
|
+
<button type="button" onClick={toggleTheme}>
|
|
111
|
+
Switch to {isDarkMode ? 'Light' : 'Dark'} Mode
|
|
112
|
+
</button>
|
|
113
|
+
</header>
|
|
114
|
+
{/* Your app content goes here */}
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function App() {
|
|
120
|
+
return (
|
|
121
|
+
<ThemeProvider>
|
|
122
|
+
<AppContent />
|
|
117
123
|
</ThemeProvider>
|
|
118
124
|
);
|
|
119
125
|
}
|