@deque/cauldron-react 5.7.0-canary.7cfac7d0 → 5.7.0-canary.ade57cca

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.
@@ -5,7 +5,7 @@ interface Props extends React.HTMLAttributes<HTMLDivElement> {
5
5
  totalItems: number;
6
6
  itemsPerPage?: number;
7
7
  currentPage?: number;
8
- statusLabel?: React.ReactNode;
8
+ statusLabel?: ContentNode;
9
9
  firstPageLabel?: ContentNode;
10
10
  previousPageLabel?: ContentNode;
11
11
  nextPageLabel?: ContentNode;
@@ -1,11 +1,18 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ declare type Theme = 'light' | 'dark';
3
4
  interface ProviderProps {
4
5
  children: React.ReactNode;
5
6
  context?: HTMLElement;
6
- initialTheme?: string;
7
+ initialTheme?: Theme;
7
8
  }
8
- declare const ThemeContext: React.Context<{}>;
9
+ interface State {
10
+ theme: Theme;
11
+ }
12
+ interface Methods {
13
+ toggleTheme: () => void;
14
+ }
15
+ declare const ThemeContext: React.Context<State & Methods>;
9
16
  declare const ThemeProvider: {
10
17
  ({ children, context, initialTheme }: ProviderProps): JSX.Element;
11
18
  propTypes: {
@@ -13,5 +20,5 @@ declare const ThemeProvider: {
13
20
  initialTheme: PropTypes.Requireable<string>;
14
21
  };
15
22
  };
16
- declare function useThemeContext(): {};
23
+ declare function useThemeContext(): State & Methods;
17
24
  export { ThemeContext, ThemeProvider, useThemeContext };
package/lib/index.js CHANGED
@@ -9154,7 +9154,12 @@ Notice.propTypes = {
9154
9154
 
9155
9155
  var LIGHT_THEME_CLASS = 'cauldron--theme-light';
9156
9156
  var DARK_THEME_CLASS = 'cauldron--theme-dark';
9157
- var ThemeContext = React.createContext({});
9157
+ var ThemeContext = React.createContext({
9158
+ theme: 'light',
9159
+ toggleTheme: function () {
9160
+ throw new Error('ThemeContext not initialized');
9161
+ }
9162
+ });
9158
9163
  var ThemeProvider = function (_a) {
9159
9164
  var children = _a.children, _b = _a.context, context = _b === void 0 ? document.body : _b, _c = _a.initialTheme, initialTheme = _c === void 0 ? 'light' : _c;
9160
9165
  var _d = tslib.__read(React.useState(initialTheme), 2), theme = _d[0], setTheme = _d[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "5.7.0-canary.7cfac7d0",
3
+ "version": "5.7.0-canary.ade57cca",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "homepage": "https://cauldron.dequelabs.com/",
6
6
  "publishConfig": {