@deque/cauldron-react 3.0.0 → 3.0.1-canary.0298c7b0

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.
@@ -8,19 +8,17 @@ var React__default = _interopDefault(React);
8
8
  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); }
9
9
 
10
10
  var _ref = /*#__PURE__*/React.createElement("path", {
11
- d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",
12
- vectorEffect: "non-scaling-stroke",
13
- fill: "currentColor"
11
+ d: "M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",
12
+ fill: "currentColor",
13
+ vectorEffect: "non-scaling-stroke"
14
14
  });
15
15
 
16
16
  function SvgArrow(props) {
17
17
  return /*#__PURE__*/React.createElement("svg", _extends({
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
- viewBox: "0 0 24 24",
21
- width: 28,
22
- height: 28,
23
- transform: "rotate(180)"
20
+ width: 24,
21
+ height: 24
24
22
  }, props), _ref);
25
23
  }
26
24
 
@@ -8,19 +8,17 @@ var React__default = _interopDefault(React);
8
8
  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); }
9
9
 
10
10
  var _ref = /*#__PURE__*/React.createElement("path", {
11
- d: "M17.33 12.67c-.01.37-.3.66-.67.67h-5.22l2 2c.25.26.25.68 0 .94l-.95.95c-.26.25-.68.25-.94 0L6.8 12.47a.683.683 0 010-.94l4.72-4.72c.26-.25.68-.25.94 0l.95.95c.26.25.27.66.02.92l-.02.02-2 2h5.23c.37.01.66.3.67.67v1.33l.02-.03zM18.92 8A8.016 8.016 0 0016 5.08 7.798 7.798 0 0012 4c-1.41-.01-2.79.37-4 1.08-1.21.7-2.22 1.71-2.92 2.92A7.798 7.798 0 004 12c-.01 1.41.36 2.79 1.07 4 .7 1.21 1.71 2.22 2.93 2.92 1.21.71 2.59 1.09 4 1.08 1.41.01 2.79-.36 4-1.07 1.21-.7 2.22-1.71 2.92-2.93A7.798 7.798 0 0020 12c.01-1.41-.37-2.79-1.08-4z",
12
- vectorEffect: "non-scaling-stroke",
13
- fill: "currentColor"
11
+ d: "M17.37 12c0 .18-.06.35-.19.47l-4.71 4.73c-.26.25-.68.25-.94 0l-4.71-4.72a.683.683 0 010-.94l.95-.95c.25-.26.66-.27.92-.02l.02.02 2 2V7.34c.01-.37.3-.66.67-.67h1.33c.37.01.66.3.67.67v5.23l2-2c.26-.25.68-.25.94 0l.95.95c.13.12.19.29.19.47l-.09.01zm1.55-4A8.016 8.016 0 0016 5.08 7.798 7.798 0 0012 4c-1.41-.01-2.79.37-4 1.08-1.21.7-2.22 1.71-2.92 2.92A7.798 7.798 0 004 12c-.01 1.41.36 2.79 1.07 4 .7 1.21 1.71 2.22 2.93 2.92 1.21.71 2.59 1.09 4 1.08 1.41.01 2.79-.36 4-1.07 1.21-.7 2.22-1.71 2.92-2.93A7.798 7.798 0 0020 12c.01-1.41-.37-2.79-1.08-4z",
12
+ fill: "currentColor",
13
+ vectorEffect: "non-scaling-stroke"
14
14
  });
15
15
 
16
16
  function SvgArrowCircle(props) {
17
17
  return /*#__PURE__*/React.createElement("svg", _extends({
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
- viewBox: "0 0 24 24",
21
- width: 17,
22
- height: 17,
23
- transform: "rotate(180)"
20
+ width: 24,
21
+ height: 24
24
22
  }, props), _ref);
25
23
  }
26
24
 
package/lib/cauldron.css CHANGED
@@ -48,19 +48,19 @@ a.Button--primary {
48
48
  display: block;
49
49
  }
50
50
 
51
- /* Icon--right is the default orientation */
51
+ /* Icon--down is the default orientation */
52
52
 
53
- .Icon__right {
54
- }
55
-
56
- .Icon__left {
57
- transform: scaleX(-1);
53
+ .Icon__down {
58
54
  }
59
55
 
60
56
  .Icon__up {
61
- transform: rotate(-90deg);
57
+ transform: scaleY(-1);
62
58
  }
63
59
 
64
- .Icon__down {
60
+ .Icon__left {
65
61
  transform: rotate(90deg);
66
62
  }
63
+
64
+ .Icon__right {
65
+ transform: rotate(-90deg);
66
+ }
@@ -8,18 +8,17 @@ var React__default = _interopDefault(React);
8
8
  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); }
9
9
 
10
10
  var _ref = /*#__PURE__*/React.createElement("path", {
11
- d: "M15.02 12a.35.35 0 00-.1-.24l-4.83-4.85a.332.332 0 00-.47-.01l-.01.01-.52.52c-.14.13-.14.33-.02.47l.01.01 4.1 4.09-4.1 4.09c-.13.13-.14.33-.01.47l.01.01.52.52c.13.13.33.14.47.01l.01-.01 4.85-4.85c.06-.07.09-.15.09-.24z",
12
- vectorEffect: "non-scaling-stroke",
13
- fill: "currentColor"
11
+ d: "M17.2 9.84a.35.35 0 00-.1-.24l-.52-.52a.332.332 0 00-.47-.01l-.01.01-4.1 4.1-4.09-4.1a.333.333 0 00-.47-.02l-.01.01-.52.53c-.13.13-.14.33-.01.47l.01.01 4.85 4.85c.13.13.33.14.47.01l.01-.01 4.85-4.85c.06-.06.1-.15.1-.24h.01z",
12
+ fill: "currentColor",
13
+ vectorEffect: "non-scaling-stroke"
14
14
  });
15
15
 
16
16
  function SvgChevron(props) {
17
17
  return /*#__PURE__*/React.createElement("svg", _extends({
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
- viewBox: "0 0 24 24",
21
- width: 25,
22
- height: 25
20
+ width: 24,
21
+ height: 24
23
22
  }, props), _ref);
24
23
  }
25
24
 
@@ -8,18 +8,17 @@ var React__default = _interopDefault(React);
8
8
  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); }
9
9
 
10
10
  var _ref = /*#__PURE__*/React.createElement("path", {
11
- d: "M13.02 12a.35.35 0 00-.1-.24L8.09 6.91a.332.332 0 00-.47-.01l-.01.01-.52.52c-.14.13-.14.33-.02.47l.01.01 4.1 4.09-4.08 4.09c-.13.13-.14.33-.01.47l.01.01.52.52c.13.13.33.14.47.01l.01-.01 4.85-4.85c.05-.07.07-.15.07-.24zm4 0a.35.35 0 00-.1-.24l-4.83-4.85a.332.332 0 00-.47-.01l-.01.01-.52.52c-.13.13-.14.33-.01.47l.01.01 4.1 4.09-4.09 4.09c-.13.13-.14.33-.01.47l.01.01.52.52c.13.13.33.14.47.01l.01-.01 4.85-4.85c.05-.07.07-.15.07-.24z",
12
- vectorEffect: "non-scaling-stroke",
13
- fill: "currentColor"
11
+ d: "M17.2 11.84a.35.35 0 00-.1-.24l-.52-.52a.332.332 0 00-.47-.01l-.01.01-4.1 4.1-4.09-4.1a.332.332 0 00-.47-.01l-.01.01-.52.52c-.13.13-.14.33-.01.47l.01.01 4.85 4.85c.13.13.33.14.47.01l.01-.01 4.85-4.85c.06-.06.1-.15.1-.24h.01zm0-4a.35.35 0 00-.1-.24l-.52-.52a.332.332 0 00-.47-.01l-.01.01-4.1 4.1-4.09-4.09a.333.333 0 00-.47-.02l-.01.01-.52.53a.32.32 0 00-.02.46l.01.01 4.85 4.85c.13.13.33.14.47.01l.01-.01 4.85-4.85c.06-.06.1-.15.1-.24h.02z",
12
+ fill: "currentColor",
13
+ vectorEffect: "non-scaling-stroke"
14
14
  });
15
15
 
16
16
  function SvgChevronDouble(props) {
17
17
  return /*#__PURE__*/React.createElement("svg", _extends({
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
- viewBox: "0 0 24 24",
21
- width: 25,
22
- height: 25
20
+ width: 24,
21
+ height: 24
23
22
  }, props), _ref);
24
23
  }
25
24
 
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ interface AddressProps extends React.HTMLAttributes<HTMLElement> {
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const Address: {
7
+ ({ children, className, ...other }: AddressProps): JSX.Element;
8
+ displayName: string;
9
+ propTypes: {
10
+ children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
11
+ className: PropTypes.Requireable<string>;
12
+ };
13
+ };
14
+ declare type AddressLineProps = React.HTMLAttributes<HTMLElement>;
15
+ export declare const AddressLine: {
16
+ ({ children, className, ...other }: AddressLineProps): JSX.Element | null;
17
+ displayName: string;
18
+ propTypes: {
19
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
23
+ interface AddressCityStateZipProps extends React.HTMLAttributes<HTMLElement> {
24
+ city: React.ReactNode;
25
+ state: React.ReactNode;
26
+ zip: React.ReactNode;
27
+ }
28
+ export declare const AddressCityStateZip: {
29
+ ({ city, state, zip, className, ...other }: AddressCityStateZipProps): JSX.Element | null;
30
+ displayName: string;
31
+ propTypes: {
32
+ city: PropTypes.Requireable<PropTypes.ReactNodeLike>;
33
+ state: PropTypes.Requireable<PropTypes.ReactNodeLike>;
34
+ zip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
35
+ className: PropTypes.Requireable<string>;
36
+ };
37
+ };
38
+ export {};
@@ -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' | 'close' | 'code' | 'copy' | 'download' | 'exchange' | 'external-link' | 'eye' | 'filter' | 'flag' | 'gears' | 'grid' | 'hamburger-menu' | 'highlight' | 'info-circle-alt' | 'info-circle' | 'info-square' | 'kabob' | 'list' | 'lock' | 'menu' | 'new-releases' | 'new' | 'no' | 'pencil' | 'plus' | 'question-circle' | 'radio-checked' | 'radio-unchecked' | 'recycle' | 'robot' | 'run-again' | 'save' | 'share' | 'sort' | 'star' | 'sun' | 'tag' | 'target' | 'trash' | 'triangle-up' | 'triangle-down' | 'triangle-left' | 'triangle-right' | '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' | 'close' | 'code' | 'copy' | 'download' | 'exchange' | 'external-link' | 'eye' | 'filter' | 'flag' | 'gears' | 'grid' | 'hamburger-menu' | 'highlight' | 'info-circle-alt' | 'info-circle' | 'info-square' | 'kabob' | 'list' | 'lock' | 'magnifying-glass' | 'menu' | 'new-releases' | 'new' | 'no' | 'pencil' | 'plus' | 'question-circle' | 'radio-checked' | 'radio-unchecked' | 'recycle' | 'robot' | 'run-again' | 'save' | 'share' | 'sort' | 'star' | 'sun' | 'tag' | 'target' | 'trash' | 'triangle-up' | 'triangle-down' | 'triangle-left' | 'triangle-right' | 'upload';
6
6
  /** iconTypes holds each valid icon type. */
7
7
  export declare const iconTypes: string[];
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ import * as Polymorphic from '../../utils/polymorphic-type';
2
2
  import { IconType } from '../Icon';
3
3
  import { TooltipProps } from '../Tooltip';
4
- export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
+ export interface IconButtonOwnProps {
5
5
  icon: IconType;
6
6
  label: string;
7
7
  tooltipPlacement?: TooltipProps['placement'];
@@ -9,5 +9,12 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
9
9
  tooltipPortal?: TooltipProps['portal'];
10
10
  variant?: 'primary' | 'secondary' | 'error';
11
11
  }
12
- declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
12
+ declare type PolymorphicIconButton = Polymorphic.ForwardRefComponent<'button', IconButtonOwnProps>;
13
+ /**
14
+ * Unfortunately, eslint does not recognize that this Polymorphic component has a displayName set
15
+ *
16
+ * We might be able to remove this if we upgrade eslint and associated plugins
17
+ * See: https://github.com/dequelabs/cauldron/issues/451
18
+ */
19
+ declare const IconButton: PolymorphicIconButton;
13
20
  export default IconButton;
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  export interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {
4
- label: string;
4
+ label?: string;
5
5
  }
6
- declare function Loader({ label, className, ...other }: LoaderProps): JSX.Element;
6
+ declare function Loader({ className, label, ...other }: LoaderProps): JSX.Element;
7
7
  declare namespace Loader {
8
8
  var propTypes: {
9
- label: PropTypes.Requireable<string>;
10
9
  className: PropTypes.Requireable<string>;
11
10
  };
12
11
  var displayName: string;
@@ -5,7 +5,7 @@ declare const Panel: {
5
5
  ({ className, title, actions, children }: {
6
6
  className?: string | undefined;
7
7
  title?: string | undefined;
8
- actions?: React.ForwardRefExoticComponent<import("../IconButton").IconButtonProps & React.RefAttributes<HTMLButtonElement>>[] | undefined;
8
+ actions?: import("../../utils/polymorphic-type").ForwardRefComponent<"button", import("../IconButton").IconButtonOwnProps>[] | undefined;
9
9
  children: React.ReactNode;
10
10
  }): JSX.Element;
11
11
  displayName: string;
@@ -5,6 +5,7 @@ export interface SideBarProps extends React.HTMLAttributes<HTMLUListElement> {
5
5
  onDismiss: () => void;
6
6
  className?: string;
7
7
  show: boolean;
8
+ navProps: React.HTMLAttributes<HTMLElement>;
8
9
  }
9
10
  interface SideBarState {
10
11
  wide: boolean;
@@ -9,6 +9,7 @@ interface StepWithChildren extends BaseStepProps {
9
9
  }
10
10
  interface StepWithTooltip extends BaseStepProps {
11
11
  tooltip: React.ReactNode;
12
+ tooltipText: string;
12
13
  }
13
14
  declare type StepProps = StepWithChildren | StepWithTooltip;
14
15
  export declare const Step: {
@@ -17,6 +18,7 @@ export declare const Step: {
17
18
  propTypes: {
18
19
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
19
20
  tooltip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
21
+ tooltipText: PropTypes.Requireable<string>;
20
22
  className: PropTypes.Requireable<string>;
21
23
  };
22
24
  };
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import React, { TdHTMLAttributes } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- interface TableCellProps {
3
+ interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
4
4
  children: React.ReactNode;
5
5
  className?: string;
6
6
  }
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import React, { ThHTMLAttributes } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- interface TableHeaderProps {
3
+ interface TableHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
4
4
  children: React.ReactNode;
5
5
  className?: string;
6
6
  }
@@ -1,3 +1,4 @@
1
+ import { Cauldron } from '../../types';
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  declare type TabsProps = {
@@ -5,9 +6,13 @@ declare type TabsProps = {
5
6
  initialActiveIndex?: number;
6
7
  thin?: boolean;
7
8
  className?: string;
9
+ onChange?: ({ activeTabIndex, target }: {
10
+ activeTabIndex: number;
11
+ target: HTMLLIElement | null;
12
+ }) => void;
8
13
  } & Cauldron.LabelProps;
9
14
  declare const Tabs: {
10
- ({ children, thin, initialActiveIndex, className, ...labelProp }: TabsProps): JSX.Element;
15
+ ({ children, thin, initialActiveIndex, className, onChange, ...labelProp }: TabsProps): JSX.Element;
11
16
  displayName: string;
12
17
  propTypes: {
13
18
  children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
@@ -11,7 +11,7 @@ export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {
11
11
  portal?: React.RefObject<HTMLElement> | HTMLElement;
12
12
  hideElementOnHidden?: boolean;
13
13
  }
14
- declare function Tooltip({ id: propId, placement: initialPlacement, children, portal, target, association, variant, show: showProp, hideElementOnHidden, ...props }: TooltipProps): React.ReactPortal | null;
14
+ declare function Tooltip({ id: propId, placement: initialPlacement, children, portal, target, association, variant, show: showProp, hideElementOnHidden, className, ...props }: TooltipProps): React.ReactPortal | null;
15
15
  declare namespace Tooltip {
16
16
  var displayName: string;
17
17
  var propTypes: {
package/lib/index.d.ts CHANGED
@@ -43,6 +43,7 @@ export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetai
43
43
  export { default as Stepper, Step } from './components/Stepper';
44
44
  export { default as Panel } from './components/Panel';
45
45
  export { default as ProgressBar } from './components/ProgressBar';
46
+ export { Address, AddressLine, AddressCityStateZip } from './components/Address';
46
47
  /**
47
48
  * Helpers / Utils
48
49
  */
package/lib/index.js CHANGED
@@ -162,6 +162,7 @@ var iconTypes = [
162
162
  'kabob',
163
163
  'list',
164
164
  'lock',
165
+ 'magnifying-glass',
165
166
  'menu',
166
167
  'new-releases',
167
168
  'new',
@@ -192,8 +193,8 @@ var iconTypes = [
192
193
  function __variableDynamicImportRuntime0__(path) {
193
194
  switch (path) {
194
195
  case './icons/add-user.svg': return Promise.resolve().then(function () { return require('./add-user-075c63a1.js'); });
195
- case './icons/arrow-circle.svg': return Promise.resolve().then(function () { return require('./arrow-circle-7b95a2fd.js'); });
196
- case './icons/arrow.svg': return Promise.resolve().then(function () { return require('./arrow-97011665.js'); });
196
+ case './icons/arrow-circle.svg': return Promise.resolve().then(function () { return require('./arrow-circle-858d89b5.js'); });
197
+ case './icons/arrow.svg': return Promise.resolve().then(function () { return require('./arrow-36f5cb02.js'); });
197
198
  case './icons/arrows-alt.svg': return Promise.resolve().then(function () { return require('./arrows-alt-b91e24b7.js'); });
198
199
  case './icons/bolt.svg': return Promise.resolve().then(function () { return require('./bolt-e44406fd.js'); });
199
200
  case './icons/caution.svg': return Promise.resolve().then(function () { return require('./caution-e048e1bf.js'); });
@@ -203,8 +204,8 @@ function __variableDynamicImportRuntime0__(path) {
203
204
  case './icons/check.svg': return Promise.resolve().then(function () { return require('./check-c2912d5e.js'); });
204
205
  case './icons/checkbox-checked.svg': return Promise.resolve().then(function () { return require('./checkbox-checked-a262e99c.js'); });
205
206
  case './icons/checkbox-unchecked.svg': return Promise.resolve().then(function () { return require('./checkbox-unchecked-2ad5b4ae.js'); });
206
- case './icons/chevron-double.svg': return Promise.resolve().then(function () { return require('./chevron-double-65975fca.js'); });
207
- case './icons/chevron.svg': return Promise.resolve().then(function () { return require('./chevron-064d5f96.js'); });
207
+ case './icons/chevron-double.svg': return Promise.resolve().then(function () { return require('./chevron-double-42e4b50e.js'); });
208
+ case './icons/chevron.svg': return Promise.resolve().then(function () { return require('./chevron-cbfd92ec.js'); });
208
209
  case './icons/close.svg': return Promise.resolve().then(function () { return require('./close-31ce4dcf.js'); });
209
210
  case './icons/code.svg': return Promise.resolve().then(function () { return require('./code-e3365341.js'); });
210
211
  case './icons/copy.svg': return Promise.resolve().then(function () { return require('./copy-d2ade017.js'); });
@@ -224,6 +225,7 @@ function __variableDynamicImportRuntime0__(path) {
224
225
  case './icons/kabob.svg': return Promise.resolve().then(function () { return require('./kabob-692fdc00.js'); });
225
226
  case './icons/list.svg': return Promise.resolve().then(function () { return require('./list-8fbd8209.js'); });
226
227
  case './icons/lock.svg': return Promise.resolve().then(function () { return require('./lock-bd0122db.js'); });
228
+ case './icons/magnifying-glass.svg': return Promise.resolve().then(function () { return require('./magnifying-glass-2907fb77.js'); });
227
229
  case './icons/menu.svg': return Promise.resolve().then(function () { return require('./menu-2f2be7c2.js'); });
228
230
  case './icons/new-releases.svg': return Promise.resolve().then(function () { return require('./new-releases-ac749bdd.js'); });
229
231
  case './icons/new.svg': return Promise.resolve().then(function () { return require('./new-6c3ac7d7.js'); });
@@ -244,7 +246,7 @@ function __variableDynamicImportRuntime0__(path) {
244
246
  case './icons/tag.svg': return Promise.resolve().then(function () { return require('./tag-56c32f4f.js'); });
245
247
  case './icons/target.svg': return Promise.resolve().then(function () { return require('./target-50f179e0.js'); });
246
248
  case './icons/trash.svg': return Promise.resolve().then(function () { return require('./trash-896a3291.js'); });
247
- case './icons/triangle.svg': return Promise.resolve().then(function () { return require('./triangle-51d7723a.js'); });
249
+ case './icons/triangle.svg': return Promise.resolve().then(function () { return require('./triangle-42e0eece.js'); });
248
250
  case './icons/upload.svg': return Promise.resolve().then(function () { return require('./upload-d71f0e44.js'); });
249
251
  default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));
250
252
  }
@@ -1148,11 +1150,11 @@ var SideBar = /** @class */ (function (_super) {
1148
1150
  var _a = this.state, animateClass = _a.animateClass, wide = _a.wide;
1149
1151
  // disabling no-unused-vars to prevent onDismiss from being passed through to dom element
1150
1152
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1151
- var _b = this.props, children = _b.children, className = _b.className, show = _b.show, onDismiss = _b.onDismiss, other = tslib.__rest(_b, ["children", "className", "show", "onDismiss"]);
1153
+ var _b = this.props, children = _b.children, className = _b.className, show = _b.show, onDismiss = _b.onDismiss, navProps = _b.navProps, other = tslib.__rest(_b, ["children", "className", "show", "onDismiss", "navProps"]);
1152
1154
  /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
1153
1155
  return (React__default.createElement(React.Fragment, null,
1154
1156
  React__default.createElement(ClickOutsideListener, { onClickOutside: this.handleClickOutside },
1155
- React__default.createElement("nav", null,
1157
+ React__default.createElement("nav", tslib.__assign({}, navProps),
1156
1158
  React__default.createElement("ul", tslib.__assign({ className: classNames('SideBar', className, animateClass) }, other, { ref: this.navList, onKeyDown: this.onKeyDown }), children))),
1157
1159
  React__default.createElement(Scrim, { show: !wide && show })));
1158
1160
  /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
@@ -1465,7 +1467,7 @@ var fireCustomEvent = function (show, button) {
1465
1467
  };
1466
1468
  function Tooltip(_a) {
1467
1469
  var _this = this;
1468
- var propId = _a.id, _b = _a.placement, initialPlacement = _b === void 0 ? 'auto' : _b, children = _a.children, portal = _a.portal, target = _a.target, _c = _a.association, association = _c === void 0 ? 'aria-describedby' : _c, _d = _a.variant, variant = _d === void 0 ? 'text' : _d, _e = _a.show, showProp = _e === void 0 ? false : _e, _f = _a.hideElementOnHidden, hideElementOnHidden = _f === void 0 ? false : _f, props = tslib.__rest(_a, ["id", "placement", "children", "portal", "target", "association", "variant", "show", "hideElementOnHidden"]);
1470
+ var propId = _a.id, _b = _a.placement, initialPlacement = _b === void 0 ? 'auto' : _b, children = _a.children, portal = _a.portal, target = _a.target, _c = _a.association, association = _c === void 0 ? 'aria-describedby' : _c, _d = _a.variant, variant = _d === void 0 ? 'text' : _d, _e = _a.show, showProp = _e === void 0 ? false : _e, _f = _a.hideElementOnHidden, hideElementOnHidden = _f === void 0 ? false : _f, className = _a.className, props = tslib.__rest(_a, ["id", "placement", "children", "portal", "target", "association", "variant", "show", "hideElementOnHidden", "className"]);
1469
1471
  var id = (propId ? [propId] : nextId.useId(1, 'tooltip'))[0];
1470
1472
  var hovering = React.useRef(false);
1471
1473
  var _g = React.useState(initialPlacement), placement = _g[0], setPlacement = _g[1];
@@ -1586,7 +1588,7 @@ function Tooltip(_a) {
1586
1588
  }
1587
1589
  }, [targetElement, id]);
1588
1590
  return showTooltip || hideElementOnHidden
1589
- ? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--" + placement, {
1591
+ ? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--" + placement, className, {
1590
1592
  TooltipInfo: variant === 'info',
1591
1593
  'Tooltip--hidden': !showTooltip && hideElementOnHidden,
1592
1594
  'Tooltip--big': variant === 'big'
@@ -1615,21 +1617,52 @@ var TooltipContent = function (_a) {
1615
1617
  return (React__default.createElement("div", tslib.__assign({ className: classNames('TooltipContent', className) }, other)));
1616
1618
  };
1617
1619
 
1620
+ /**
1621
+ * Unfortunately, eslint does not recognize that this Polymorphic component has a displayName set
1622
+ *
1623
+ * We might be able to remove this if we upgrade eslint and associated plugins
1624
+ * See: https://github.com/dequelabs/cauldron/issues/451
1625
+ */
1626
+ // eslint-disable-next-line react/display-name
1618
1627
  var IconButton = React.forwardRef(function (_a, ref) {
1619
- var icon = _a.icon, label = _a.label, _b = _a.tooltipPlacement, tooltipPlacement = _b === void 0 ? 'auto' : _b, tooltipVariant = _a.tooltipVariant, tooltipPortal = _a.tooltipPortal, className = _a.className, _c = _a.variant, variant = _c === void 0 ? 'secondary' : _c, disabled = _a.disabled, other = tslib.__rest(_a, ["icon", "label", "tooltipPlacement", "tooltipVariant", "tooltipPortal", "className", "variant", "disabled"]);
1620
- var buttonRef = React.useRef();
1621
- React.useImperativeHandle(ref, function () { return buttonRef.current; });
1628
+ var _b = _a.as, Component = _b === void 0 ? 'button' : _b, icon = _a.icon, label = _a.label, _c = _a.tooltipPlacement, tooltipPlacement = _c === void 0 ? 'auto' : _c, tooltipVariant = _a.tooltipVariant, tooltipPortal = _a.tooltipPortal, className = _a.className, _d = _a.variant, variant = _d === void 0 ? 'secondary' : _d, disabled = _a.disabled, _e = _a.tabIndex, tabIndex = _e === void 0 ? 0 : _e, other = tslib.__rest(_a, ["as", "icon", "label", "tooltipPlacement", "tooltipVariant", "tooltipPortal", "className", "variant", "disabled", "tabIndex"]);
1629
+ var internalRef = React.useRef();
1630
+ React.useImperativeHandle(ref, function () { return internalRef.current; });
1631
+ // Configure additional properties based on the type of the Component
1632
+ // for accessibility
1633
+ var accessibilityProps = {};
1634
+ if (Component === 'button') {
1635
+ accessibilityProps.type = 'button';
1636
+ }
1637
+ else {
1638
+ // We don't need to set an anchor's role, since it would be redundant
1639
+ if (Component !== 'a') {
1640
+ accessibilityProps.role = other.href || other.to ? 'link' : 'button';
1641
+ }
1642
+ if (disabled) {
1643
+ accessibilityProps['aria-disabled'] = disabled;
1644
+ }
1645
+ }
1646
+ React.useEffect(function () {
1647
+ var _a;
1648
+ if (!disabled) {
1649
+ return;
1650
+ }
1651
+ (_a = internalRef.current) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-label', label);
1652
+ }, [disabled]);
1622
1653
  return (React__default.createElement(React__default.Fragment, null,
1623
- React__default.createElement("button", tslib.__assign({ type: 'button', className: classNames(className, {
1654
+ React__default.createElement(Component, tslib.__assign({ className: classNames(className, {
1624
1655
  IconButton: true,
1625
1656
  'IconButton--primary': variant === 'primary',
1626
1657
  'IconButton--secondary': variant === 'secondary',
1627
1658
  'IconButton--error': variant === 'error'
1628
- }), ref: buttonRef, disabled: disabled }, other),
1659
+ }), ref: internalRef, disabled: disabled, tabIndex: disabled ? -1 : tabIndex }, accessibilityProps, other),
1629
1660
  React__default.createElement(Icon, { type: icon })),
1630
- !disabled && (React__default.createElement(Tooltip, { target: buttonRef, placement: tooltipPlacement, variant: tooltipVariant, portal: tooltipPortal, association: "aria-labelledby", hideElementOnHidden: true }, label))));
1661
+ !disabled && (React__default.createElement(Tooltip, { target: internalRef, placement: tooltipPlacement, variant: tooltipVariant, portal: tooltipPortal, association: "aria-labelledby", hideElementOnHidden: true }, label))));
1631
1662
  });
1632
1663
  IconButton.propTypes = {
1664
+ // @ts-expect-error
1665
+ as: PropTypes.elementType,
1633
1666
  // @ts-expect-error
1634
1667
  icon: PropTypes.string.isRequired,
1635
1668
  label: PropTypes.string.isRequired,
@@ -2160,22 +2193,18 @@ Link.propTypes = {
2160
2193
  Link.displayName = 'Link';
2161
2194
 
2162
2195
  function Loader(_a) {
2163
- var label = _a.label, className = _a.className, other = tslib.__rest(_a, ["label", "className"]);
2164
- var props = tslib.__assign(tslib.__assign({}, other), { className: classNames('Loader', className), 'aria-hidden': !label });
2165
- if (label) {
2166
- props.role = 'progressbar';
2167
- props['aria-valuetext'] = label;
2168
- props['aria-busy'] = true;
2169
- props['aria-valuemin'] = 0;
2170
- props['aria-valuemax'] = 100;
2171
- // According to the ARIA 1.2 spec (https://www.w3.org/TR/wai-aria-1.2/#progressbar),
2172
- // the aria-valuenow attribute SHOULD be omitted because the "value" of our progress
2173
- // is "indeterminate".
2196
+ var className = _a.className, label = _a.label, other = tslib.__rest(_a, ["className", "label"]);
2197
+ var props = tslib.__assign(tslib.__assign({}, other), { className: classNames('Loader', className) });
2198
+ if (label === null || label === void 0 ? void 0 : label.length) {
2199
+ props['role'] = 'alert';
2200
+ props.children = React__default.createElement(Offscreen, null, label);
2201
+ }
2202
+ else {
2203
+ props['aria-hidden'] = true;
2174
2204
  }
2175
2205
  return React__default.createElement("div", tslib.__assign({}, props));
2176
2206
  }
2177
2207
  Loader.propTypes = {
2178
- label: PropTypes.string,
2179
2208
  className: PropTypes.string
2180
2209
  };
2181
2210
  Loader.displayName = 'Loader';
@@ -2247,7 +2276,7 @@ var Select = React__default.forwardRef(function (_a, ref) {
2247
2276
  })
2248
2277
  : children),
2249
2278
  React__default.createElement("div", { className: "arrow-down" })),
2250
- React__default.createElement("div", { className: "Error", id: errorId }, error)));
2279
+ error && (React__default.createElement("div", { id: errorId, className: "Error" }, error))));
2251
2280
  /* eslint-disable jsx-a11y/no-onchange */
2252
2281
  });
2253
2282
  Select.displayName = 'Select';
@@ -2294,13 +2323,13 @@ var RadioGroup = function (_a) {
2294
2323
  handleChange(radioValue);
2295
2324
  onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
2296
2325
  }, disabled: disabled, checked: isChecked }, other)),
2326
+ React__default.createElement("label", { htmlFor: id, className: classNames('Field__label', {
2327
+ 'Field__label--disabled': disabled
2328
+ }) }, label),
2297
2329
  React__default.createElement(Icon, { className: classNames('Radio__overlay', {
2298
2330
  'Radio__overlay--focused': isFocused,
2299
2331
  'Radio__overlay--disabled': disabled
2300
- }), type: isChecked ? 'radio-checked' : 'radio-unchecked', "aria-hidden": "true", onClick: function () { return onRadioClick(index); } }),
2301
- React__default.createElement("label", { htmlFor: id, className: classNames('Field__label', {
2302
- 'Field__label--disabled': disabled
2303
- }) }, label)));
2332
+ }), type: isChecked ? 'radio-checked' : 'radio-unchecked', "aria-hidden": "true", onClick: function () { return onRadioClick(index); } })));
2304
2333
  });
2305
2334
  // reset the input refs array
2306
2335
  // refs get clobbered every re-render anyway and this supports "dynamic" radios
@@ -2350,6 +2379,9 @@ var Checkbox = React.forwardRef(function (_a, ref) {
2350
2379
  onChange(e);
2351
2380
  }
2352
2381
  } }, other)),
2382
+ React__default.createElement("label", { className: classNames('Field__label', {
2383
+ 'Field__label--disabled': disabled
2384
+ }), htmlFor: id }, label),
2353
2385
  React__default.createElement(Icon, { className: classNames('Checkbox__overlay', {
2354
2386
  'Checkbox__overlay--disabled': disabled,
2355
2387
  'Checkbox__overlay--focused': focused,
@@ -2362,11 +2394,8 @@ var Checkbox = React.forwardRef(function (_a, ref) {
2362
2394
  else {
2363
2395
  (_b = checkRef.current) === null || _b === void 0 ? void 0 : _b.click();
2364
2396
  }
2365
- } }),
2366
- React__default.createElement("label", { className: classNames('Field__label', {
2367
- 'Field__label--disabled': disabled
2368
- }), htmlFor: id }, label)),
2369
- React__default.createElement("div", { id: errorId, className: "Error" }, error)));
2397
+ } })),
2398
+ error && (React__default.createElement("div", { id: errorId, className: "Error" }, error))));
2370
2399
  });
2371
2400
  Checkbox.displayName = 'Checkbox';
2372
2401
 
@@ -2473,7 +2502,7 @@ var TextField = /** @class */ (function (_super) {
2473
2502
  _this.input = input;
2474
2503
  setRef(fieldRef, input);
2475
2504
  } }, other, inputProps)),
2476
- React__default.createElement("div", { className: "Error", id: this.errorId }, error)));
2505
+ error && (React__default.createElement("div", { className: "Error", id: this.errorId }, error))));
2477
2506
  };
2478
2507
  TextField.prototype.onChange = function (e) {
2479
2508
  var _a, _b;
@@ -8022,8 +8051,9 @@ Tab.propTypes = {
8022
8051
  };
8023
8052
 
8024
8053
  var Tabs = function (_a) {
8025
- var children = _a.children, thin = _a.thin, _b = _a.initialActiveIndex, initialActiveIndex = _b === void 0 ? 0 : _b, className = _a.className, labelProp = tslib.__rest(_a, ["children", "thin", "initialActiveIndex", "className"]);
8054
+ var children = _a.children, thin = _a.thin, _b = _a.initialActiveIndex, initialActiveIndex = _b === void 0 ? 0 : _b, className = _a.className, onChange = _a.onChange, labelProp = tslib.__rest(_a, ["children", "thin", "initialActiveIndex", "className", "onChange"]);
8026
8055
  var _c = React.useState(initialActiveIndex), activeIndex = _c[0], setActiveIndex = _c[1];
8056
+ var tabsRef = React.useRef(null);
8027
8057
  var focusedTabRef = React.useRef(null);
8028
8058
  var tabs = React__default.Children.toArray(children).filter(function (child) { return child.type === Tab; });
8029
8059
  var tabCount = tabs.length;
@@ -8088,10 +8118,13 @@ var Tabs = function (_a) {
8088
8118
  useDidUpdate(function () {
8089
8119
  var _a;
8090
8120
  (_a = focusedTabRef.current) === null || _a === void 0 ? void 0 : _a.focus();
8121
+ if (typeof onChange === 'function') {
8122
+ onChange({ activeTabIndex: activeIndex, target: focusedTabRef.current });
8123
+ }
8091
8124
  }, [activeIndex]);
8092
8125
  return (React__default.createElement("div", { className: classNames('Tabs', className, {
8093
8126
  'Tabs--thin': thin
8094
- }) },
8127
+ }), ref: tabsRef },
8095
8128
  React__default.createElement("ul", tslib.__assign({ role: "tablist", className: "Tablist" }, labelProp, { onKeyDown: handleKeyDown }), tabComponents)));
8096
8129
  };
8097
8130
  Tabs.displayName = 'Tabs';
@@ -8160,7 +8193,7 @@ var Step = function (props) {
8160
8193
  // list items, therefore it is safe to clobber
8161
8194
  // it with the contents of the tooltip in the
8162
8195
  // tab stop's accessible name.
8163
- association: "aria-labelledby" },
8196
+ association: "aria-labelledby", "aria-label": isTooltip(props) ? props.tooltipText : undefined },
8164
8197
  React__default.createElement("div", { className: "Stepper__step-indicator" }))) : (React__default.createElement(React__default.Fragment, null,
8165
8198
  React__default.createElement("div", { className: "Stepper__step-indicator" }),
8166
8199
  'children' in props && (React__default.createElement("div", { className: "Stepper__step-label" }, props.children)))))));
@@ -8169,6 +8202,7 @@ Step.displayName = 'Step';
8169
8202
  Step.propTypes = {
8170
8203
  children: PropTypes.node,
8171
8204
  tooltip: PropTypes.node,
8205
+ tooltipText: PropTypes.string,
8172
8206
  className: PropTypes.string
8173
8207
  };
8174
8208
  var Stepper = function (_a) {
@@ -8203,6 +8237,38 @@ var ProgressBar = React.forwardRef(function (_a, ref) {
8203
8237
  });
8204
8238
  ProgressBar.displayName = 'ProgressBar';
8205
8239
 
8240
+ var Address = function (_a) {
8241
+ var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
8242
+ return (React__default.createElement("address", tslib.__assign({ className: classNames('Address', className) }, other), children));
8243
+ };
8244
+ Address.displayName = 'Address';
8245
+ Address.propTypes = {
8246
+ children: PropTypes.node.isRequired,
8247
+ className: PropTypes.string
8248
+ };
8249
+ var AddressLine = function (_a) {
8250
+ var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
8251
+ return children ? (React__default.createElement("div", tslib.__assign({ className: classNames('Address__line', className) }, other), children)) : null;
8252
+ };
8253
+ AddressLine.displayName = 'AddressLine';
8254
+ AddressLine.propTypes = {
8255
+ children: PropTypes.node,
8256
+ className: PropTypes.string
8257
+ };
8258
+ var AddressCityStateZip = function (_a) {
8259
+ var city = _a.city, state = _a.state, zip = _a.zip, className = _a.className, other = tslib.__rest(_a, ["city", "state", "zip", "className"]);
8260
+ return city || state || zip ? (React__default.createElement("div", tslib.__assign({ className: classNames('Address__city-state-zip', className) }, other), [[city, state].filter(Boolean).join(', '), zip]
8261
+ .filter(Boolean)
8262
+ .join(' '))) : null;
8263
+ };
8264
+ AddressCityStateZip.displayName = 'AddressCityStateZip';
8265
+ AddressCityStateZip.propTypes = {
8266
+ city: PropTypes.node,
8267
+ state: PropTypes.node,
8268
+ zip: PropTypes.node,
8269
+ className: PropTypes.string
8270
+ };
8271
+
8206
8272
  /**
8207
8273
  * Hook to be used similarly to the React.Component#componentDidMount.
8208
8274
  * Executes the provided `effect` when `dependencies` change but does not
@@ -8271,6 +8337,9 @@ ThemeProvider.propTypes = {
8271
8337
  initialTheme: PropTypes.string
8272
8338
  };
8273
8339
 
8340
+ exports.Address = Address;
8341
+ exports.AddressCityStateZip = AddressCityStateZip;
8342
+ exports.AddressLine = AddressLine;
8274
8343
  exports.Alert = Alert;
8275
8344
  exports.AlertActions = AlertActions;
8276
8345
  exports.AlertContent = AlertContent;
@@ -0,0 +1,23 @@
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
+ 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); }
9
+
10
+ var _ref = /*#__PURE__*/React.createElement("path", {
11
+ d: "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z",
12
+ fill: "currentColor"
13
+ });
14
+
15
+ function SvgMagnifyingGlass(props) {
16
+ return /*#__PURE__*/React.createElement("svg", _extends({
17
+ viewBox: "0 0 24 24",
18
+ width: 19,
19
+ height: 19
20
+ }, props), _ref);
21
+ }
22
+
23
+ exports.default = SvgMagnifyingGlass;
@@ -9,18 +9,16 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
9
9
 
10
10
  var _ref = /*#__PURE__*/React.createElement("path", {
11
11
  d: "M7 10l5 5 5-5z",
12
- vectorEffect: "non-scaling-stroke",
13
- fill: "currentColor"
12
+ fill: "currentColor",
13
+ vectorEffect: "non-scaling-stroke"
14
14
  });
15
15
 
16
16
  function SvgTriangle(props) {
17
17
  return /*#__PURE__*/React.createElement("svg", _extends({
18
18
  overflow: "visible",
19
19
  preserveAspectRatio: "none",
20
- viewBox: "0 0 24 24",
21
- width: 32,
22
- height: 32,
23
- transform: "rotate(270)"
20
+ width: 24,
21
+ height: 24
24
22
  }, props), _ref);
25
23
  }
26
24
 
package/lib/types.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export declare namespace Cauldron {
2
+ type LabelProps = {
3
+ 'aria-label': string;
4
+ } | {
5
+ 'aria-labelledby': string;
6
+ };
7
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Based on @radix-ui/polymorphic:
3
+ * https://github.com/radix-ui/primitives/blob/main/packages/react/polymorphic/src/polymorphic.ts
4
+ */
5
+ import * as React from 'react';
6
+ declare type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
7
+ /**
8
+ * Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
9
+ */
10
+ declare type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {};
11
+ /**
12
+ * Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
13
+ */
14
+ declare type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any> ? I : never;
15
+ declare type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<Merge<E extends React.ElementType ? React.ComponentPropsWithRef<E> : never, OwnProps & {
16
+ as?: E;
17
+ }>>;
18
+ interface ForwardRefComponent<IntrinsicElementString, OwnProps = {}
19
+ /**
20
+ * Extends original type to ensure built in React types play nice
21
+ * with polymorphic components still e.g. `React.ElementRef` etc.
22
+ */
23
+ > extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
24
+ /**
25
+ * When `as` prop is passed, use this overload.
26
+ * Merges original own props (without DOM props) and the inferred props
27
+ * from `as` element with the own props taking precendence.
28
+ *
29
+ * We explicitly avoid `React.ElementType` and manually narrow the prop types
30
+ * so that events are typed when using JSX.IntrinsicElements.
31
+ */
32
+ <As = IntrinsicElementString>(props: As extends '' ? {
33
+ as: keyof JSX.IntrinsicElements;
34
+ } : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
35
+ as: As;
36
+ }> : As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
37
+ as: As;
38
+ }> : never): React.ReactElement | null;
39
+ }
40
+ export { ForwardRefComponent, OwnProps, IntrinsicElement, Merge };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "3.0.0",
3
+ "version": "3.0.1-canary.0298c7b0",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -124,4 +124,4 @@
124
124
  "\\.svg$": "<rootDir>/__tests__/svgMock.js"
125
125
  }
126
126
  }
127
- }
127
+ }