@deque/cauldron-react 5.1.0 → 5.2.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.
@@ -3,9 +3,10 @@ import PropTypes from 'prop-types';
3
3
  interface NavItemProps extends React.HTMLAttributes<HTMLLIElement> {
4
4
  children: React.ReactNode;
5
5
  active: boolean;
6
+ 'aria-current'?: 'page' | 'step' | 'location' | true | false;
6
7
  }
7
8
  declare const NavItem: {
8
- ({ children, active, ...other }: NavItemProps): JSX.Element;
9
+ ({ children, active, "aria-current": ariaCurrent, ...other }: NavItemProps): JSX.Element;
9
10
  displayName: string;
10
11
  propTypes: {
11
12
  children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export interface OffscreenProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ export interface OffscreenProps extends React.HTMLAttributes<HTMLSpanElement> {
3
3
  }
4
4
  declare const Offscreen: (props: OffscreenProps) => JSX.Element;
5
5
  export default Offscreen;
@@ -0,0 +1,14 @@
1
+ import React, { HTMLAttributes, ReactNode } from 'react';
2
+ interface PanelProps extends HTMLAttributes<HTMLElement> {
3
+ children: ReactNode;
4
+ heading?: ReactNode | {
5
+ id?: string;
6
+ text: ReactNode;
7
+ level: number | undefined;
8
+ };
9
+ collapsed?: boolean;
10
+ className?: string;
11
+ padding?: boolean;
12
+ }
13
+ declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<HTMLElement>>;
14
+ export default Panel;
@@ -0,0 +1,8 @@
1
+ import React, { ReactNode } from 'react';
2
+ export interface PanelContentProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ children: ReactNode;
4
+ className?: string;
5
+ padding?: boolean;
6
+ }
7
+ declare const PanelContent: React.ForwardRefExoticComponent<PanelContentProps & React.RefAttributes<HTMLDivElement>>;
8
+ export default PanelContent;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ export interface PanelHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ children: ReactNode;
4
+ className?: string;
5
+ }
6
+ declare const PanelHeader: React.ForwardRefExoticComponent<PanelHeaderProps & React.RefAttributes<HTMLDivElement>>;
7
+ export default PanelHeader;
@@ -1,13 +1,5 @@
1
- import React, { HTMLAttributes, ReactNode } from 'react';
2
- interface PanelProps extends HTMLAttributes<HTMLElement> {
3
- children: ReactNode;
4
- heading?: ReactNode | {
5
- id?: string;
6
- text: ReactNode;
7
- level: number | undefined;
8
- };
9
- collapsed?: boolean;
10
- className?: string;
11
- }
12
- declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<HTMLElement>>;
1
+ import Panel from './Panel';
2
+ import PanelContent from './PanelContent';
3
+ import PanelHeader from './PanelHeader';
13
4
  export default Panel;
5
+ export { Panel, PanelContent, PanelHeader };
@@ -15,5 +15,5 @@ export interface SelectProps extends Omit<React.HTMLProps<HTMLSelectElement>, 'c
15
15
  defaultValue?: any;
16
16
  onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
17
17
  }
18
- declare const Select: React.ForwardRefExoticComponent<Pick<SelectProps, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "list" | "step" | "cite" | "data" | "label" | "span" | "summary" | "pattern" | "type" | "key" | "download" | "target" | "name" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "open" | "error" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "encType" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "useMap" | "width" | "wmode" | "wrap" | "options" | "requiredText"> & React.RefAttributes<HTMLSelectElement>>;
18
+ declare const Select: React.ForwardRefExoticComponent<Pick<SelectProps, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "list" | "step" | "cite" | "data" | "label" | "span" | "summary" | "pattern" | "type" | "key" | "download" | "target" | "name" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "open" | "error" | "start" | "content" | "size" | "default" | "wrap" | "multiple" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "encType" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "useMap" | "width" | "wmode" | "options" | "requiredText"> & React.RefAttributes<HTMLSelectElement>>;
19
19
  export default Select;
package/lib/index.d.ts CHANGED
@@ -43,7 +43,7 @@ export { default as Table, TableBody, TableCell, TableHead, TableHeader, TableRo
43
43
  export { default as Tabs, Tab, TabPanel } from './components/Tabs';
44
44
  export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetails } from './components/DescriptionList';
45
45
  export { default as Stepper, Step } from './components/Stepper';
46
- export { default as Panel } from './components/Panel';
46
+ export { default as Panel, PanelHeader, PanelContent } from './components/Panel';
47
47
  export { default as IssuePanel } from './components/IssuePanel';
48
48
  export { default as ProgressBar } from './components/ProgressBar';
49
49
  export { Address, AddressLine, AddressCityStateZip } from './components/Address';
package/lib/index.js CHANGED
@@ -1315,10 +1315,14 @@ NavBar.propTypes = {
1315
1315
  };
1316
1316
 
1317
1317
  var NavItem = function (_a) {
1318
- var children = _a.children, active = _a.active, other = tslib.__rest(_a, ["children", "active"]);
1318
+ var children = _a.children, active = _a.active, _b = _a["aria-current"], ariaCurrent = _b === void 0 ? true : _b, other = tslib.__rest(_a, ["children", "active", 'aria-current']);
1319
+ var additionalProps = {};
1320
+ if (active) {
1321
+ additionalProps['aria-current'] = ariaCurrent;
1322
+ }
1319
1323
  return (React__default.createElement("li", tslib.__assign({ className: classNames('NavItem', {
1320
1324
  'NavItem--active': active
1321
- }) }, other), children));
1325
+ }) }, additionalProps, other), children));
1322
1326
  };
1323
1327
  NavItem.displayName = 'NavItem';
1324
1328
  NavItem.propTypes = {
@@ -8630,7 +8634,7 @@ Stepper.propTypes = {
8630
8634
 
8631
8635
  var Panel = React.forwardRef(function (_a, ref) {
8632
8636
  var _b;
8633
- var children = _a.children, collapsed = _a.collapsed, className = _a.className, heading = _a.heading, other = tslib.__rest(_a, ["children", "collapsed", "className", "heading"]);
8637
+ var children = _a.children, collapsed = _a.collapsed, className = _a.className, heading = _a.heading, _c = _a.padding, padding = _c === void 0 ? true : _c, other = tslib.__rest(_a, ["children", "collapsed", "className", "heading", "padding"]);
8634
8638
  var headingId = !heading
8635
8639
  ? undefined
8636
8640
  : typeof heading === 'object' && 'id' in heading
@@ -8652,6 +8656,7 @@ var Panel = React.forwardRef(function (_a, ref) {
8652
8656
  };
8653
8657
  return (React__default.createElement("section", tslib.__assign({ "aria-labelledby": headingId, className: classNames('Panel', className, (_b = {},
8654
8658
  _b['Panel--collapsed'] = collapsed,
8659
+ _b['Panel--no-padding'] = !padding,
8655
8660
  _b)), ref: ref }, other),
8656
8661
  React__default.createElement(Heading, null),
8657
8662
  children));
@@ -8662,6 +8667,34 @@ Panel.propTypes = {
8662
8667
  children: PropTypes.node.isRequired,
8663
8668
  // @ts-expect-error
8664
8669
  heading: PropTypes.oneOfType([PropTypes.object, PropTypes.node]),
8670
+ className: PropTypes.string,
8671
+ padding: PropTypes.bool,
8672
+ collapsed: PropTypes.bool
8673
+ };
8674
+
8675
+ var PanelContent = React.forwardRef(function (_a, ref) {
8676
+ var _b;
8677
+ var children = _a.children, className = _a.className, _c = _a.padding, padding = _c === void 0 ? true : _c, otherProps = tslib.__rest(_a, ["children", "className", "padding"]);
8678
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Panel__Content', className, (_b = {},
8679
+ _b['Panel__Content--no-padding'] = !padding,
8680
+ _b)), ref: ref }, otherProps), children));
8681
+ });
8682
+ PanelContent.displayName = 'PanelContent';
8683
+ PanelContent.propTypes = {
8684
+ //@ts-expect-error
8685
+ children: PropTypes.node.isRequired,
8686
+ className: PropTypes.string,
8687
+ padding: PropTypes.bool
8688
+ };
8689
+
8690
+ var PanelHeader = React.forwardRef(function (_a, ref) {
8691
+ var children = _a.children, className = _a.className, otherProps = tslib.__rest(_a, ["children", "className"]);
8692
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Panel__Header', className), ref: ref }, otherProps), children));
8693
+ });
8694
+ PanelHeader.displayName = 'PanelHeader';
8695
+ PanelHeader.propTypes = {
8696
+ //@ts-expect-error
8697
+ children: PropTypes.node.isRequired,
8665
8698
  className: PropTypes.string
8666
8699
  };
8667
8700
 
@@ -9134,6 +9167,8 @@ exports.OptionsMenuTrigger = OptionsMenuTrigger;
9134
9167
  exports.OptionsMenuWrapper = OptionsMenuWrapper;
9135
9168
  exports.Pagination = Pagination;
9136
9169
  exports.Panel = Panel;
9170
+ exports.PanelContent = PanelContent;
9171
+ exports.PanelHeader = PanelHeader;
9137
9172
  exports.PanelTrigger = PanelTrigger$1;
9138
9173
  exports.Pointout = Pointout;
9139
9174
  exports.ProgressBar = ProgressBar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "homepage": "https://cauldron.dequelabs.com/",
6
6
  "publishConfig": {