@deque/cauldron-react 4.3.0-canary.ee347cd5 → 4.4.0-canary.2f777a43
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/components/Checkbox/index.d.ts +1 -1
- package/lib/components/Code/index.d.ts +1 -0
- package/lib/components/ExpandCollapsePanel/PanelTrigger.d.ts +6 -1
- package/lib/components/Icon/types.d.ts +1 -1
- package/lib/components/IconButton/index.d.ts +8 -1
- package/lib/components/Loader/index.d.ts +1 -8
- package/lib/components/LoaderOverlay/index.d.ts +1 -0
- package/lib/components/Panel/index.d.ts +4 -13
- package/lib/components/RadioGroup/index.d.ts +2 -2
- package/lib/components/Table/Table.d.ts +2 -6
- package/lib/components/Table/TableBody.d.ts +2 -6
- package/lib/components/Table/TableCell.d.ts +2 -6
- package/lib/components/Table/TableHead.d.ts +2 -6
- package/lib/components/Table/TableHeader.d.ts +5 -5
- package/lib/components/Table/TableRow.d.ts +2 -6
- package/lib/dropper.js +24 -0
- package/lib/index.js +64 -48
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import React, { InputHTMLAttributes, Ref } from 'react';
|
|
|
2
2
|
export interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
id: string;
|
|
4
4
|
label: React.ReactNode;
|
|
5
|
-
labelDescription?:
|
|
5
|
+
labelDescription?: React.ReactNode;
|
|
6
6
|
error?: React.ReactNode;
|
|
7
7
|
customIcon?: React.ReactNode;
|
|
8
8
|
checkboxRef?: Ref<HTMLInputElement>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { IconType } from '../Icon';
|
|
3
4
|
export interface PanelTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
children?: ((props: {
|
|
5
6
|
open: boolean;
|
|
@@ -7,14 +8,18 @@ export interface PanelTriggerProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
7
8
|
open?: boolean;
|
|
8
9
|
fullWidth?: string;
|
|
9
10
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
iconExpanded?: IconType;
|
|
12
|
+
iconCollapsed?: IconType;
|
|
10
13
|
}
|
|
11
|
-
declare function PanelTrigger({ children, className, open, fullWidth, onClick, ...other }: PanelTriggerProps): JSX.Element;
|
|
14
|
+
declare function PanelTrigger({ children, className, open, fullWidth, onClick, iconExpanded, iconCollapsed, ...other }: PanelTriggerProps): JSX.Element;
|
|
12
15
|
declare namespace PanelTrigger {
|
|
13
16
|
var propTypes: {
|
|
14
17
|
children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
15
18
|
open: PropTypes.Requireable<boolean>;
|
|
16
19
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
20
|
className: PropTypes.Requireable<string>;
|
|
21
|
+
iconExpanded: PropTypes.Requireable<string>;
|
|
22
|
+
iconCollapsed: PropTypes.Requireable<string>;
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
25
|
declare const _default: React.MemoExoticComponent<typeof PanelTrigger>;
|
|
@@ -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' | 'magnifying-glass' | 'menu' | 'minus' | 'new-releases' | 'new' | 'no' | 'pencil' | 'plus' | 'question-circle' | 'radio-checked' | 'radio-unchecked' | 'recycle' | 'resend' | 'robot' | 'run-again' | 'save' | 'share' | 'sort-triangle' | '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' | 'dropper' | 'exchange' | 'external-link' | 'eye' | 'filter' | 'flag' | 'gears' | 'grid' | 'hamburger-menu' | 'highlight' | 'info-circle-alt' | 'info-circle' | 'info-square' | 'kabob' | 'list' | 'lock' | 'magnifying-glass' | 'menu' | 'minus' | 'new-releases' | 'new' | 'no' | 'pencil' | 'plus' | 'question-circle' | 'radio-checked' | 'radio-unchecked' | 'recycle' | 'resend' | 'robot' | 'run-again' | 'save' | 'share' | 'sort-triangle' | '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,9 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unfortunately, eslint does not recognize the Polymorphic component has propTypes set
|
|
3
|
+
*
|
|
4
|
+
* We might be able to remove this if we upgrade eslint and associated plugins
|
|
5
|
+
* See: https://github.com/dequelabs/cauldron/issues/451
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
1
8
|
import * as Polymorphic from '../../utils/polymorphic-type';
|
|
2
9
|
import { IconType } from '../Icon';
|
|
3
10
|
import { TooltipProps } from '../Tooltip';
|
|
4
11
|
export interface IconButtonOwnProps {
|
|
5
12
|
icon: IconType;
|
|
6
|
-
label:
|
|
13
|
+
label: React.ReactNode;
|
|
7
14
|
tooltipPlacement?: TooltipProps['placement'];
|
|
8
15
|
tooltipVariant?: TooltipProps['variant'];
|
|
9
16
|
tooltipPortal?: TooltipProps['portal'];
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
export interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
3
|
label?: string;
|
|
5
4
|
variant?: 'large' | 'small';
|
|
6
5
|
}
|
|
7
|
-
declare
|
|
8
|
-
declare namespace Loader {
|
|
9
|
-
var propTypes: {
|
|
10
|
-
className: PropTypes.Requireable<string>;
|
|
11
|
-
};
|
|
12
|
-
var displayName: string;
|
|
13
|
-
}
|
|
6
|
+
declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
7
|
export default Loader;
|
|
@@ -4,6 +4,7 @@ interface LoaderOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
focusOnInitialRender?: boolean;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
+
focusTrap?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare const LoaderOverlay: React.ForwardRefExoticComponent<LoaderOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
10
|
export default LoaderOverlay;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import { HTMLAttributes,
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
3
2
|
interface PanelProps extends HTMLAttributes<HTMLElement> {
|
|
4
3
|
children: ReactNode;
|
|
5
|
-
heading?:
|
|
4
|
+
heading?: ReactNode | {
|
|
6
5
|
id?: string;
|
|
7
|
-
text:
|
|
6
|
+
text: ReactNode;
|
|
8
7
|
level: number | undefined;
|
|
9
8
|
};
|
|
10
9
|
collapsed?: boolean;
|
|
11
10
|
className?: string;
|
|
12
11
|
}
|
|
13
|
-
declare const Panel:
|
|
14
|
-
({ children, collapsed, className, heading, ...other }: PanelProps): JSX.Element;
|
|
15
|
-
displayName: string;
|
|
16
|
-
propTypes: {
|
|
17
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
18
|
-
heading: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
19
|
-
className: PropTypes.Requireable<string>;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
12
|
+
declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<HTMLElement>>;
|
|
22
13
|
export default Panel;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
export interface RadioItem extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
-
label:
|
|
4
|
+
label: React.ReactNode;
|
|
5
5
|
value?: string;
|
|
6
|
-
labelDescription?:
|
|
6
|
+
labelDescription?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
export interface RadioGroupProps {
|
|
9
9
|
name?: string;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TableHTMLAttributes } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
interface TableProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
3
|
declare const Table: {
|
|
8
|
-
({ children, className, ...other }:
|
|
4
|
+
({ children, className, ...other }: TableHTMLAttributes<HTMLTableElement>): JSX.Element;
|
|
9
5
|
displayName: string;
|
|
10
6
|
propTypes: {
|
|
11
7
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
interface TableBodyProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
3
|
declare const TableBody: {
|
|
8
|
-
({ children, className, ...other }:
|
|
4
|
+
({ children, className, ...other }: HTMLAttributes<HTMLTableSectionElement>): JSX.Element;
|
|
9
5
|
displayName: string;
|
|
10
6
|
propTypes: {
|
|
11
7
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TdHTMLAttributes } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
3
|
declare const TableCell: {
|
|
8
|
-
({ children, className, ...other }:
|
|
4
|
+
({ children, className, ...other }: TdHTMLAttributes<HTMLTableCellElement>): JSX.Element;
|
|
9
5
|
displayName: string;
|
|
10
6
|
propTypes: {
|
|
11
7
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
interface TableHeadProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
3
|
declare const TableHead: {
|
|
8
|
-
({ children, className, ...other }:
|
|
4
|
+
({ children, className, ...other }: HTMLAttributes<HTMLTableSectionElement>): JSX.Element;
|
|
9
5
|
displayName: string;
|
|
10
6
|
propTypes: {
|
|
11
7
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ThHTMLAttributes } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
declare type SortDirection = 'ascending' | 'descending' | 'none';
|
|
4
4
|
interface TableHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
5
|
-
children: React.ReactNode;
|
|
6
5
|
sortDirection?: SortDirection;
|
|
7
6
|
onSort?: () => void;
|
|
8
|
-
className?: string;
|
|
9
7
|
sortAscendingAnnouncement?: string;
|
|
10
|
-
|
|
8
|
+
sortDescendingAnnouncement?: string;
|
|
11
9
|
}
|
|
12
10
|
declare const TableHeader: {
|
|
13
|
-
({ children, sortDirection, onSort, className, sortAscendingAnnouncement,
|
|
11
|
+
({ children, sortDirection, onSort, className, sortAscendingAnnouncement, sortDescendingAnnouncement, ...other }: TableHeaderProps): JSX.Element;
|
|
14
12
|
displayName: string;
|
|
15
13
|
propTypes: {
|
|
16
14
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
17
15
|
sortDirection: PropTypes.Requireable<string>;
|
|
18
16
|
onSort: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
17
|
className: PropTypes.Requireable<string>;
|
|
18
|
+
sortAscendingAnnouncement: PropTypes.Requireable<string>;
|
|
19
|
+
sortDescendingAnnouncement: PropTypes.Requireable<string>;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
export default TableHeader;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
interface TableRowProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
3
|
declare const TableRow: {
|
|
8
|
-
({ children, className, ...other }:
|
|
4
|
+
({ children, className, ...other }: HTMLAttributes<HTMLTableRowElement>): JSX.Element;
|
|
9
5
|
displayName: string;
|
|
10
6
|
propTypes: {
|
|
11
7
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
package/lib/dropper.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 SvgDropper = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
overflow: "visible",
|
|
14
|
+
preserveAspectRatio: "none",
|
|
15
|
+
viewBox: "0 0 24 24",
|
|
16
|
+
height: 24,
|
|
17
|
+
width: 24
|
|
18
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
19
|
+
d: "m20.71 5.63-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42zM6.92 19 5 17.08l8.06-8.06 1.92 1.92L6.92 19z",
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
vectorEffect: "non-scaling-stroke"
|
|
22
|
+
})));
|
|
23
|
+
|
|
24
|
+
exports.default = SvgDropper;
|
package/lib/index.js
CHANGED
|
@@ -147,6 +147,7 @@ var iconTypes = [
|
|
|
147
147
|
'code',
|
|
148
148
|
'copy',
|
|
149
149
|
'download',
|
|
150
|
+
'dropper',
|
|
150
151
|
'exchange',
|
|
151
152
|
'external-link',
|
|
152
153
|
'eye',
|
|
@@ -213,6 +214,7 @@ function __variableDynamicImportRuntime0__(path) {
|
|
|
213
214
|
case './icons/code.svg': return Promise.resolve().then(function () { return require('./code.js'); });
|
|
214
215
|
case './icons/copy.svg': return Promise.resolve().then(function () { return require('./copy.js'); });
|
|
215
216
|
case './icons/download.svg': return Promise.resolve().then(function () { return require('./download.js'); });
|
|
217
|
+
case './icons/dropper.svg': return Promise.resolve().then(function () { return require('./dropper.js'); });
|
|
216
218
|
case './icons/exchange.svg': return Promise.resolve().then(function () { return require('./exchange.js'); });
|
|
217
219
|
case './icons/external-link.svg': return Promise.resolve().then(function () { return require('./external-link.js'); });
|
|
218
220
|
case './icons/eye.svg': return Promise.resolve().then(function () { return require('./eye.js'); });
|
|
@@ -1663,13 +1665,6 @@ var IconButton = React.forwardRef(function (_a, ref) {
|
|
|
1663
1665
|
accessibilityProps['aria-disabled'] = disabled;
|
|
1664
1666
|
}
|
|
1665
1667
|
}
|
|
1666
|
-
React.useEffect(function () {
|
|
1667
|
-
var _a;
|
|
1668
|
-
if (!disabled) {
|
|
1669
|
-
return;
|
|
1670
|
-
}
|
|
1671
|
-
(_a = internalRef.current) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-label', label);
|
|
1672
|
-
}, [disabled]);
|
|
1673
1668
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1674
1669
|
React__default.createElement(Component, tslib.__assign({ className: classNames(className, {
|
|
1675
1670
|
IconButton: true,
|
|
@@ -1677,7 +1672,8 @@ var IconButton = React.forwardRef(function (_a, ref) {
|
|
|
1677
1672
|
'IconButton--secondary': variant === 'secondary',
|
|
1678
1673
|
'IconButton--error': variant === 'error'
|
|
1679
1674
|
}), ref: internalRef, disabled: disabled, tabIndex: disabled ? -1 : tabIndex }, accessibilityProps, other),
|
|
1680
|
-
React__default.createElement(Icon, { type: icon })
|
|
1675
|
+
React__default.createElement(Icon, { type: icon }),
|
|
1676
|
+
React__default.createElement(Offscreen, null, label)),
|
|
1681
1677
|
!disabled && (React__default.createElement(Tooltip, { target: internalRef, placement: tooltipPlacement, variant: tooltipVariant, portal: tooltipPortal, association: "aria-labelledby", hideElementOnHidden: true }, label))));
|
|
1682
1678
|
});
|
|
1683
1679
|
IconButton.propTypes = {
|
|
@@ -1685,7 +1681,7 @@ IconButton.propTypes = {
|
|
|
1685
1681
|
as: PropTypes.elementType,
|
|
1686
1682
|
// @ts-expect-error
|
|
1687
1683
|
icon: PropTypes.string.isRequired,
|
|
1688
|
-
label: PropTypes.
|
|
1684
|
+
label: PropTypes.node.isRequired,
|
|
1689
1685
|
// @ts-expect-error
|
|
1690
1686
|
tooltipPlacement: PropTypes.string,
|
|
1691
1687
|
// @ts-expect-error
|
|
@@ -2227,7 +2223,7 @@ Link.propTypes = {
|
|
|
2227
2223
|
};
|
|
2228
2224
|
Link.displayName = 'Link';
|
|
2229
2225
|
|
|
2230
|
-
|
|
2226
|
+
var Loader = React__default.forwardRef(function (_a, ref) {
|
|
2231
2227
|
var className = _a.className, _b = _a.variant, variant = _b === void 0 ? 'small' : _b, label = _a.label, props = tslib.__rest(_a, ["className", "variant", "label"]);
|
|
2232
2228
|
if (label === null || label === void 0 ? void 0 : label.length) {
|
|
2233
2229
|
props['role'] = 'alert';
|
|
@@ -2236,12 +2232,8 @@ function Loader(_a) {
|
|
|
2236
2232
|
else {
|
|
2237
2233
|
props['aria-hidden'] = true;
|
|
2238
2234
|
}
|
|
2239
|
-
return (React__default.createElement("div", tslib.__assign({ className: classNames('Loader', className, variant === 'large'
|
|
2240
|
-
|
|
2241
|
-
: variant === 'small'
|
|
2242
|
-
? 'Loader--small'
|
|
2243
|
-
: '') }, props)));
|
|
2244
|
-
}
|
|
2235
|
+
return (React__default.createElement("div", tslib.__assign({ ref: ref, className: classNames('Loader', className, variant === 'large' && 'Loader--large', variant === 'small' && 'Loader--small') }, props)));
|
|
2236
|
+
});
|
|
2245
2237
|
Loader.propTypes = {
|
|
2246
2238
|
className: PropTypes.string
|
|
2247
2239
|
};
|
|
@@ -2360,7 +2352,7 @@ var RadioGroup = function (_a) {
|
|
|
2360
2352
|
var _a;
|
|
2361
2353
|
handleChange(radioValue);
|
|
2362
2354
|
onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
|
|
2363
|
-
}, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription
|
|
2355
|
+
}, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription ? id + "Desc" : undefined }, other)),
|
|
2364
2356
|
React__default.createElement("label", { htmlFor: id, className: classNames('Field__label', {
|
|
2365
2357
|
'Field__label--disabled': disabled
|
|
2366
2358
|
}) }, label),
|
|
@@ -2600,16 +2592,18 @@ var TextField = /** @class */ (function (_super) {
|
|
|
2600
2592
|
}(React__default.Component));
|
|
2601
2593
|
|
|
2602
2594
|
function PanelTrigger(_a) {
|
|
2603
|
-
var children = _a.children, className = _a.className, open = _a.open, fullWidth = _a.fullWidth, onClick = _a.onClick, other = tslib.__rest(_a, ["children", "className", "open", "fullWidth", "onClick"]);
|
|
2595
|
+
var children = _a.children, className = _a.className, open = _a.open, fullWidth = _a.fullWidth, onClick = _a.onClick, _b = _a.iconExpanded, iconExpanded = _b === void 0 ? 'chevron-down' : _b, _c = _a.iconCollapsed, iconCollapsed = _c === void 0 ? 'chevron-right' : _c, other = tslib.__rest(_a, ["children", "className", "open", "fullWidth", "onClick", "iconExpanded", "iconCollapsed"]);
|
|
2604
2596
|
return (React__default.createElement("button", tslib.__assign({}, other, { className: classNames('ExpandCollapse__trigger', fullWidth ? 'fullWidth' : '', className), type: "button", "aria-expanded": open, onClick: onClick }),
|
|
2605
2597
|
React__default.createElement("div", { className: "ExpandCollapse__trigger-title" }, typeof children === 'function' ? children({ open: !!open }) : children),
|
|
2606
|
-
React__default.createElement(Icon, { type: open ?
|
|
2598
|
+
React__default.createElement(Icon, { type: open ? iconExpanded : iconCollapsed })));
|
|
2607
2599
|
}
|
|
2608
2600
|
PanelTrigger.propTypes = {
|
|
2609
2601
|
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
2610
2602
|
open: PropTypes.bool,
|
|
2611
2603
|
onClick: PropTypes.func,
|
|
2612
|
-
className: PropTypes.string
|
|
2604
|
+
className: PropTypes.string,
|
|
2605
|
+
iconExpanded: PropTypes.string,
|
|
2606
|
+
iconCollapsed: PropTypes.string
|
|
2613
2607
|
};
|
|
2614
2608
|
var PanelTrigger$1 = React__default.memo(PanelTrigger);
|
|
2615
2609
|
|
|
@@ -7984,8 +7978,8 @@ SyntaxHighlighter.registerLanguage('css', css_1);
|
|
|
7984
7978
|
SyntaxHighlighter.registerLanguage('html', xml_1);
|
|
7985
7979
|
SyntaxHighlighter.registerLanguage('yaml', yaml_1);
|
|
7986
7980
|
var Code = function (_a) {
|
|
7987
|
-
var children = _a.children, className = _a.className, props = tslib.__rest(_a, ["children", "className"]);
|
|
7988
|
-
return (React__default.createElement(SyntaxHighlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className) }), children));
|
|
7981
|
+
var children = _a.children, className = _a.className, tabIndex = _a.tabIndex, props = tslib.__rest(_a, ["children", "className", "tabIndex"]);
|
|
7982
|
+
return (React__default.createElement(SyntaxHighlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className), tabIndex: tabIndex }), children));
|
|
7989
7983
|
};
|
|
7990
7984
|
Code.displayName = 'Code';
|
|
7991
7985
|
Code.propTypes = {
|
|
@@ -8023,8 +8017,19 @@ function useSharedRef(ref) {
|
|
|
8023
8017
|
}
|
|
8024
8018
|
|
|
8025
8019
|
var LoaderOverlay = React.forwardRef(function (_a, ref) {
|
|
8026
|
-
var className = _a.className, variant = _a.variant, label = _a.label, children = _a.children, focusOnInitialRender = _a.focusOnInitialRender, other = tslib.__rest(_a, ["className", "variant", "label", "children", "focusOnInitialRender"]);
|
|
8020
|
+
var className = _a.className, variant = _a.variant, label = _a.label, children = _a.children, focusOnInitialRender = _a.focusOnInitialRender, _b = _a.focusTrap, focusTrap = _b === void 0 ? false : _b, other = tslib.__rest(_a, ["className", "variant", "label", "children", "focusOnInitialRender", "focusTrap"]);
|
|
8027
8021
|
var overlayRef = useSharedRef(ref);
|
|
8022
|
+
React.useEffect(function () {
|
|
8023
|
+
var isolator = overlayRef.current
|
|
8024
|
+
? new AriaIsolate(overlayRef.current)
|
|
8025
|
+
: null;
|
|
8026
|
+
if (isolator) {
|
|
8027
|
+
focusTrap ? isolator.activate() : isolator.deactivate();
|
|
8028
|
+
}
|
|
8029
|
+
return function () {
|
|
8030
|
+
isolator === null || isolator === void 0 ? void 0 : isolator.deactivate();
|
|
8031
|
+
};
|
|
8032
|
+
}, [focusTrap, overlayRef.current]);
|
|
8028
8033
|
React.useEffect(function () {
|
|
8029
8034
|
if (!!focusOnInitialRender && overlayRef.current) {
|
|
8030
8035
|
setTimeout(function () {
|
|
@@ -8034,16 +8039,25 @@ var LoaderOverlay = React.forwardRef(function (_a, ref) {
|
|
|
8034
8039
|
}
|
|
8035
8040
|
return;
|
|
8036
8041
|
}, [overlayRef.current]);
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
: ''
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8042
|
+
var Wrapper = focusTrap ? FocusTrap : React__default.Fragment;
|
|
8043
|
+
var wrapperProps = focusTrap
|
|
8044
|
+
? {
|
|
8045
|
+
focusTrapOptions: {
|
|
8046
|
+
fallbackFocus: '.Loader__overlay'
|
|
8047
|
+
}
|
|
8048
|
+
}
|
|
8049
|
+
: {};
|
|
8050
|
+
return (React__default.createElement(Wrapper, tslib.__assign({}, wrapperProps),
|
|
8051
|
+
React__default.createElement("div", tslib.__assign({ className: classNames('Loader__overlay', className, variant === 'large'
|
|
8052
|
+
? 'Loader__overlay--large'
|
|
8053
|
+
: variant === 'small'
|
|
8054
|
+
? 'Loader__overlay--small'
|
|
8055
|
+
: ''), ref: overlayRef, tabIndex: -1 }, other),
|
|
8056
|
+
React__default.createElement("div", { className: "Loader__overlay__loader" },
|
|
8057
|
+
React__default.createElement(Loader, { variant: variant }),
|
|
8058
|
+
React__default.createElement(AxeLoader, null)),
|
|
8059
|
+
label ? (React__default.createElement("span", { className: "Loader__overlay__label" }, label)) : null,
|
|
8060
|
+
children)));
|
|
8047
8061
|
});
|
|
8048
8062
|
LoaderOverlay.propTypes = {
|
|
8049
8063
|
className: PropTypes.string,
|
|
@@ -8123,18 +8137,15 @@ TableHead.propTypes = {
|
|
|
8123
8137
|
};
|
|
8124
8138
|
|
|
8125
8139
|
var TableHeader = function (_a) {
|
|
8126
|
-
var children = _a.children, sortDirection = _a.sortDirection, onSort = _a.onSort, className = _a.className, _b = _a.sortAscendingAnnouncement, sortAscendingAnnouncement = _b === void 0 ? 'sorted ascending' : _b, _c = _a.
|
|
8140
|
+
var children = _a.children, sortDirection = _a.sortDirection, onSort = _a.onSort, className = _a.className, _b = _a.sortAscendingAnnouncement, sortAscendingAnnouncement = _b === void 0 ? 'sorted ascending' : _b, _c = _a.sortDescendingAnnouncement, sortDescendingAnnouncement = _c === void 0 ? 'sorted descending' : _c, other = tslib.__rest(_a, ["children", "sortDirection", "onSort", "className", "sortAscendingAnnouncement", "sortDescendingAnnouncement"]);
|
|
8127
8141
|
// When the sort direction changes, we want to announce the change in a live region
|
|
8128
8142
|
// because changes to the sort value is not widely supported yet
|
|
8129
8143
|
// see: https://a11ysupport.io/tech/aria/aria-sort_attribute
|
|
8130
|
-
var
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
: sortDescendingAnnouncemen);
|
|
8136
|
-
}
|
|
8137
|
-
}, [sortDirection]);
|
|
8144
|
+
var announcement = sortDirection === 'ascending'
|
|
8145
|
+
? sortAscendingAnnouncement
|
|
8146
|
+
: sortDirection === 'descending'
|
|
8147
|
+
? sortDescendingAnnouncement
|
|
8148
|
+
: '';
|
|
8138
8149
|
return (React__default.createElement("th", tslib.__assign({ "aria-sort": sortDirection, className: classNames('TableHeader', className, {
|
|
8139
8150
|
'TableHeader--sort-ascending': sortDirection === 'ascending',
|
|
8140
8151
|
'TableHeader--sort-descending': sortDirection === 'descending'
|
|
@@ -8149,7 +8160,9 @@ TableHeader.propTypes = {
|
|
|
8149
8160
|
children: PropTypes.node.isRequired,
|
|
8150
8161
|
sortDirection: PropTypes.string,
|
|
8151
8162
|
onSort: PropTypes.func,
|
|
8152
|
-
className: PropTypes.string
|
|
8163
|
+
className: PropTypes.string,
|
|
8164
|
+
sortAscendingAnnouncement: PropTypes.string,
|
|
8165
|
+
sortDescendingAnnouncement: PropTypes.string
|
|
8153
8166
|
};
|
|
8154
8167
|
|
|
8155
8168
|
var TableRow = function (_a) {
|
|
@@ -8385,7 +8398,7 @@ Stepper.propTypes = {
|
|
|
8385
8398
|
className: PropTypes.string
|
|
8386
8399
|
};
|
|
8387
8400
|
|
|
8388
|
-
var Panel = function (_a) {
|
|
8401
|
+
var Panel = React.forwardRef(function (_a, ref) {
|
|
8389
8402
|
var _b;
|
|
8390
8403
|
var children = _a.children, collapsed = _a.collapsed, className = _a.className, heading = _a.heading, other = tslib.__rest(_a, ["children", "collapsed", "className", "heading"]);
|
|
8391
8404
|
var headingId = !heading
|
|
@@ -8397,19 +8410,22 @@ var Panel = function (_a) {
|
|
|
8397
8410
|
if (!headingId) {
|
|
8398
8411
|
return null;
|
|
8399
8412
|
}
|
|
8400
|
-
var HeadingComponent = "h" + (
|
|
8413
|
+
var HeadingComponent = "h" + (heading &&
|
|
8414
|
+
typeof heading === 'object' &&
|
|
8415
|
+
'level' in heading &&
|
|
8416
|
+
!!heading.level
|
|
8401
8417
|
? heading.level
|
|
8402
8418
|
: 2);
|
|
8403
|
-
return (React__default.createElement(HeadingComponent, { id: headingId, className: "Panel__Heading" }, typeof heading === 'object' && 'text' in heading
|
|
8419
|
+
return (React__default.createElement(HeadingComponent, { id: headingId, className: "Panel__Heading" }, heading && typeof heading === 'object' && 'text' in heading
|
|
8404
8420
|
? heading.text
|
|
8405
8421
|
: heading));
|
|
8406
8422
|
};
|
|
8407
8423
|
return (React__default.createElement("section", tslib.__assign({ "aria-labelledby": headingId, className: classNames('Panel', className, (_b = {},
|
|
8408
8424
|
_b['Panel--collapsed'] = collapsed,
|
|
8409
|
-
_b)) }, other),
|
|
8425
|
+
_b)), ref: ref }, other),
|
|
8410
8426
|
React__default.createElement(Heading, null),
|
|
8411
8427
|
children));
|
|
8412
|
-
};
|
|
8428
|
+
});
|
|
8413
8429
|
Panel.displayName = 'Panel';
|
|
8414
8430
|
Panel.propTypes = {
|
|
8415
8431
|
children: PropTypes.node.isRequired,
|