@deque/cauldron-react 5.7.0 → 5.7.1-canary.ac0947b9

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
@@ -2660,7 +2660,7 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
2660
2660
  handleChange(radioValue);
2661
2661
  onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
2662
2662
  }, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription ? "".concat(id, "Desc") : undefined }, other)),
2663
- React__default.createElement("label", { htmlFor: id, className: classNames('Radio__label', {
2663
+ React__default.createElement("label", { htmlFor: id, className: classNames('Field__label Radio__label', {
2664
2664
  'Field__label--disabled': disabled
2665
2665
  }) }, label),
2666
2666
  React__default.createElement(Icon, { className: classNames('Radio__overlay', {
@@ -2859,7 +2859,7 @@ var Checkbox = React.forwardRef(function (_a, ref) {
2859
2859
  onChange(e);
2860
2860
  }
2861
2861
  } }, other)),
2862
- React__default.createElement("label", { className: classNames('Checkbox__label', {
2862
+ React__default.createElement("label", { className: classNames('Field__label Checkbox__label', {
2863
2863
  'Field__label--disabled': disabled
2864
2864
  }), htmlFor: id }, label),
2865
2865
  React__default.createElement(Icon, { className: classNames('Checkbox__overlay', {
@@ -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",
3
+ "version": "5.7.1-canary.ac0947b9",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "homepage": "https://cauldron.dequelabs.com/",
6
6
  "publishConfig": {
@@ -122,4 +122,4 @@
122
122
  "\\.svg$": "<rootDir>/__tests__/svgMock.js"
123
123
  }
124
124
  }
125
- }
125
+ }