@deque/cauldron-react 5.7.0 → 5.7.1-canary.0dd10f2c

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/lib/clock.js ADDED
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var React = require('react');
6
+ var React__default = _interopDefault(React);
7
+
8
+ var _path;
9
+
10
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+
12
+ const SvgClock = props => /*#__PURE__*/React.createElement("svg", _extends({
13
+ overflow: "visible",
14
+ preserveAspectRatio: "none",
15
+ viewBox: "0 0 72 72",
16
+ height: 24,
17
+ width: 24
18
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
19
+ d: "M65.25 36c0 16.154-13.096 29.25-29.25 29.25S6.75 52.154 6.75 36 19.846 6.75 36 6.75 65.25 19.846 65.25 36zM0 36c0 19.882 16.118 36 36 36s36-16.118 36-36S55.882 0 36 0 0 16.118 0 36zm32.625-19.125V36a3.39 3.39 0 0 0 1.505 2.813l13.5 9a3.367 3.367 0 0 0 4.682-.943 3.364 3.364 0 0 0-.942-4.682L39.375 34.2V16.875A3.367 3.367 0 0 0 36 13.5a3.367 3.367 0 0 0-3.375 3.375z",
20
+ fill: "currentColor",
21
+ vectorEffect: "non-scaling-stroke"
22
+ })));
23
+
24
+ exports.default = SvgClock;
@@ -2,6 +2,6 @@
2
2
  * GENERATED CODE. DO NOT EDIT DIRECTLY!
3
3
  */
4
4
  /** IconType represents each valid icon type. */
5
- export declare type IconType = 'add-user' | 'arrow-circle-up' | 'arrow-circle-down' | 'arrow-circle-left' | 'arrow-circle-right' | 'arrow-up' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrows-alt' | 'bolt' | 'caution' | 'check-circle' | 'check-shield' | 'check-solid' | 'check' | 'checkbox-checked' | 'checkbox-unchecked' | 'chevron-double-up' | 'chevron-double-down' | 'chevron-double-left' | 'chevron-double-right' | 'chevron-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'clipboard' | 'close' | 'code' | 'copy' | 'download' | 'dropper' | 'exchange' | 'export-solid' | 'external-link' | 'eye' | 'filter-solid' | 'filter' | 'flag' | 'gears' | 'github' | 'grid' | 'hamburger-menu' | 'hashtag' | 'highlight' | 'info-circle-alt' | 'info-circle' | 'info-square' | 'kabob' | 'link' | 'linkedin' | 'list' | 'lock' | 'magnifying-glass' | 'menu' | 'minus' | 'new-releases' | 'new' | 'no' | 'pencil' | 'person-running' | 'play' | 'plus' | 'question-circle-alt' | 'question-circle' | 'radio-checked' | 'radio-unchecked' | 'recycle-square' | 'recycle' | 'resend' | 'robot' | 'run-again' | 'save' | 'share-nodes' | 'share' | 'sort-triangle' | 'sort' | 'star' | 'sun' | 'table-sort-ascending' | 'table-sort-descending' | 'tag' | 'target' | 'trash' | 'triangle-up' | 'triangle-down' | 'triangle-left' | 'triangle-right' | 'twitter' | 'upload';
5
+ export declare type IconType = 'add-user' | 'arrow-circle-up' | 'arrow-circle-down' | 'arrow-circle-left' | 'arrow-circle-right' | 'arrow-up' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrows-alt' | 'bolt' | 'caution' | 'check-circle' | 'check-shield' | 'check-solid' | 'check' | 'checkbox-checked' | 'checkbox-unchecked' | 'chevron-double-up' | 'chevron-double-down' | 'chevron-double-left' | 'chevron-double-right' | 'chevron-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'clipboard' | 'clock' | 'close' | 'code' | 'copy' | 'download' | 'dropper' | 'exchange' | 'export-solid' | 'external-link' | 'eye' | 'filter-solid' | 'filter' | 'flag' | 'gears' | 'github' | 'grid' | 'hamburger-menu' | 'hashtag' | 'highlight' | 'info-circle-alt' | 'info-circle' | 'info-square' | 'kabob' | 'link' | 'linkedin' | 'list' | 'lock' | 'magnifying-glass' | 'menu' | 'minus' | 'new-releases' | 'new' | 'no' | 'pencil' | 'person-running' | 'play' | 'plus' | 'question-circle-alt' | 'question-circle' | 'radio-checked' | 'radio-unchecked' | 'recycle-square' | 'recycle' | 'resend' | 'robot' | 'run-again' | 'save' | 'share-nodes' | 'share' | 'sort-triangle' | 'sort' | 'star' | 'sun' | 'table-sort-ascending' | 'table-sort-descending' | 'tag' | 'target' | 'trash' | 'triangle-up' | 'triangle-down' | 'triangle-left' | 'triangle-right' | 'twitter' | 'upload';
6
6
  /** iconTypes holds each valid icon type. */
7
7
  export declare const iconTypes: string[];
@@ -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
@@ -149,6 +149,7 @@ var iconTypes = [
149
149
  'chevron-left',
150
150
  'chevron-right',
151
151
  'clipboard',
152
+ 'clock',
152
153
  'close',
153
154
  'code',
154
155
  'copy',
@@ -231,6 +232,7 @@ function __variableDynamicImportRuntime0__(path) {
231
232
  case './icons/chevron-double.svg': return Promise.resolve().then(function () { return require('./chevron-double.js'); });
232
233
  case './icons/chevron.svg': return Promise.resolve().then(function () { return require('./chevron.js'); });
233
234
  case './icons/clipboard.svg': return Promise.resolve().then(function () { return require('./clipboard.js'); });
235
+ case './icons/clock.svg': return Promise.resolve().then(function () { return require('./clock.js'); });
234
236
  case './icons/close.svg': return Promise.resolve().then(function () { return require('./close.js'); });
235
237
  case './icons/code.svg': return Promise.resolve().then(function () { return require('./code.js'); });
236
238
  case './icons/copy.svg': return Promise.resolve().then(function () { return require('./copy.js'); });
@@ -2660,7 +2662,7 @@ var RadioGroup = React.forwardRef(function (_a, ref) {
2660
2662
  handleChange(radioValue);
2661
2663
  onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
2662
2664
  }, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription ? "".concat(id, "Desc") : undefined }, other)),
2663
- React__default.createElement("label", { htmlFor: id, className: classNames('Radio__label', {
2665
+ React__default.createElement("label", { htmlFor: id, className: classNames('Field__label Radio__label', {
2664
2666
  'Field__label--disabled': disabled
2665
2667
  }) }, label),
2666
2668
  React__default.createElement(Icon, { className: classNames('Radio__overlay', {
@@ -2859,7 +2861,7 @@ var Checkbox = React.forwardRef(function (_a, ref) {
2859
2861
  onChange(e);
2860
2862
  }
2861
2863
  } }, other)),
2862
- React__default.createElement("label", { className: classNames('Checkbox__label', {
2864
+ React__default.createElement("label", { className: classNames('Field__label Checkbox__label', {
2863
2865
  'Field__label--disabled': disabled
2864
2866
  }), htmlFor: id }, label),
2865
2867
  React__default.createElement(Icon, { className: classNames('Checkbox__overlay', {
@@ -9154,7 +9156,12 @@ Notice.propTypes = {
9154
9156
 
9155
9157
  var LIGHT_THEME_CLASS = 'cauldron--theme-light';
9156
9158
  var DARK_THEME_CLASS = 'cauldron--theme-dark';
9157
- var ThemeContext = React.createContext({});
9159
+ var ThemeContext = React.createContext({
9160
+ theme: 'light',
9161
+ toggleTheme: function () {
9162
+ throw new Error('ThemeContext not initialized');
9163
+ }
9164
+ });
9158
9165
  var ThemeProvider = function (_a) {
9159
9166
  var children = _a.children, _b = _a.context, context = _b === void 0 ? document.body : _b, _c = _a.initialTheme, initialTheme = _c === void 0 ? 'light' : _c;
9160
9167
  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.0dd10f2c",
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
+ }