@deque/cauldron-react 4.6.0 → 4.7.0-canary.942ce561
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/clipboard.js +24 -0
- package/lib/components/Accordion/Accordion.d.ts +5 -3
- package/lib/components/ExpandCollapsePanel/ExpandCollapsePanel.d.ts +1 -1
- package/lib/components/ExpandCollapsePanel/PanelTrigger.d.ts +3 -1
- package/lib/components/Icon/types.d.ts +1 -1
- package/lib/components/Pagination/Pagination.d.ts +5 -4
- package/lib/components/Pagination/usePagination.d.ts +1 -0
- package/lib/components/Toast/index.d.ts +3 -0
- package/lib/components/TwoColumnPanel/TwoColumnPanel.d.ts +1 -0
- package/lib/export-solid.js +24 -0
- package/lib/index.js +47 -28
- package/lib/question-circle-alt.js +24 -0
- package/package.json +3 -3
package/lib/clipboard.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 SvgClipboard = 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: "M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z",
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
vectorEffect: "non-scaling-stroke"
|
|
22
|
+
})));
|
|
23
|
+
|
|
24
|
+
exports.default = SvgClipboard;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ExpandCollapsePanelProps } from '../ExpandCollapsePanel';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
export interface AccordionTriggerProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
5
|
-
children: React.
|
|
5
|
+
children: React.ReactNode;
|
|
6
6
|
heading?: React.ReactElement | {
|
|
7
7
|
level: string | undefined;
|
|
8
8
|
};
|
|
@@ -12,7 +12,9 @@ declare const AccordionTrigger: {
|
|
|
12
12
|
displayName: string;
|
|
13
13
|
propTypes: {
|
|
14
14
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
15
|
-
heading: PropTypes.Requireable<
|
|
15
|
+
heading: PropTypes.Requireable<PropTypes.InferProps<{
|
|
16
|
+
level: PropTypes.Requireable<number>;
|
|
17
|
+
}>>;
|
|
16
18
|
};
|
|
17
19
|
};
|
|
18
20
|
interface AccordionContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -31,7 +33,7 @@ interface AccordionProps extends ExpandCollapsePanelProps {
|
|
|
31
33
|
children: React.ReactNode;
|
|
32
34
|
}
|
|
33
35
|
declare const Accordion: {
|
|
34
|
-
({ children }: AccordionProps): JSX.Element | null;
|
|
36
|
+
({ children, open, onToggle, animationTiming, ...props }: AccordionProps): JSX.Element | null;
|
|
35
37
|
displayName: string;
|
|
36
38
|
propTypes: {
|
|
37
39
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -4,7 +4,7 @@ export interface ExpandCollapsePanelProps extends React.HTMLAttributes<HTMLDivEl
|
|
|
4
4
|
open?: boolean;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
animationTiming?: number | boolean;
|
|
7
|
-
onToggle
|
|
7
|
+
onToggle?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
8
8
|
}
|
|
9
9
|
interface ExpandCollapsePanelState {
|
|
10
10
|
controlled: boolean;
|
|
@@ -21,7 +21,9 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
21
21
|
open: PropTypes.Requireable<boolean>;
|
|
22
22
|
iconExpanded: PropTypes.Requireable<string>;
|
|
23
23
|
iconCollapsed: PropTypes.Requireable<string>;
|
|
24
|
-
heading: PropTypes.Requireable<
|
|
24
|
+
heading: PropTypes.Requireable<PropTypes.InferProps<{
|
|
25
|
+
level: PropTypes.Requireable<number>;
|
|
26
|
+
}>>;
|
|
25
27
|
};
|
|
26
28
|
displayName: string;
|
|
27
29
|
}>;
|
|
@@ -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' | 'dropper' | 'exchange' | 'external-link' | 'eye' | 'filter-solid' | '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' | 'play' | 'plus' | 'question-circle' | 'radio-checked' | 'radio-unchecked' | 'recycle-square' | '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' | 'clipboard' | 'close' | 'code' | 'copy' | 'download' | 'dropper' | 'exchange' | 'export-solid' | 'external-link' | 'eye' | 'filter-solid' | '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' | 'play' | 'plus' | 'question-circle-alt' | 'question-circle' | 'radio-checked' | 'radio-unchecked' | 'recycle-square' | '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[];
|
|
@@ -9,11 +9,12 @@ interface Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
9
9
|
previousPageLabel?: string;
|
|
10
10
|
nextPageLabel?: string;
|
|
11
11
|
lastPageLabel?: string;
|
|
12
|
-
onNextPageClick?: () => void;
|
|
13
|
-
onPreviousPageClick?: () => void;
|
|
14
|
-
onFirstPageClick?: () => void;
|
|
15
|
-
onLastPageClick?: () => void;
|
|
12
|
+
onNextPageClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
onPreviousPageClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
|
+
onFirstPageClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
15
|
+
onLastPageClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
16
16
|
tooltipPlacement?: Placement;
|
|
17
|
+
thin?: boolean;
|
|
17
18
|
className?: string;
|
|
18
19
|
}
|
|
19
20
|
declare const Pagination: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -16,6 +16,7 @@ interface PageStatus {
|
|
|
16
16
|
currentPage: number;
|
|
17
17
|
pageStart: number;
|
|
18
18
|
pageEnd: number;
|
|
19
|
+
setCurrentPage: (page: number) => void;
|
|
19
20
|
}
|
|
20
21
|
export declare const usePagination: ({ totalItems, initialPageSize, initialPage }: Options) => {
|
|
21
22
|
pagination: PaginationResults;
|
|
@@ -8,6 +8,7 @@ export interface ToastProps {
|
|
|
8
8
|
toastRef: React.Ref<HTMLDivElement>;
|
|
9
9
|
focus?: boolean;
|
|
10
10
|
show?: boolean;
|
|
11
|
+
dismissible?: boolean;
|
|
11
12
|
children: React.ReactNode;
|
|
12
13
|
}
|
|
13
14
|
interface ToastState {
|
|
@@ -24,6 +25,7 @@ export default class Toast extends React.Component<ToastProps, ToastState> {
|
|
|
24
25
|
toastRef: () => void;
|
|
25
26
|
focus: boolean;
|
|
26
27
|
show: boolean;
|
|
28
|
+
dismissible: boolean;
|
|
27
29
|
};
|
|
28
30
|
static propTypes: {
|
|
29
31
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -35,6 +37,7 @@ export default class Toast extends React.Component<ToastProps, ToastState> {
|
|
|
35
37
|
}>>;
|
|
36
38
|
focus: PropTypes.Requireable<boolean>;
|
|
37
39
|
show: PropTypes.Requireable<boolean>;
|
|
40
|
+
dismissible: PropTypes.Requireable<boolean>;
|
|
38
41
|
};
|
|
39
42
|
static displayName: string;
|
|
40
43
|
private el;
|
|
@@ -5,6 +5,7 @@ interface TwoColumnPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
showCollapsedPanelLabel?: string;
|
|
6
6
|
hideCollapsedPanelLabel?: string;
|
|
7
7
|
skipLink?: SkipLink;
|
|
8
|
+
collapsedMediaQuery?: string;
|
|
8
9
|
}
|
|
9
10
|
declare const TwoColumnPanel: React.ForwardRefExoticComponent<TwoColumnPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
11
|
export default TwoColumnPanel;
|
|
@@ -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 SvgExportSolid = 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: "M16.47 18.47c-.26.25-.67.24-.92-.02a.649.649 0 0 1 .02-.92.649.649 0 0 1 1.1.47c0 .18-.08.35-.2.47zm2.66 0c-.26.25-.67.24-.92-.02a.649.649 0 0 1 .02-.92.649.649 0 0 1 1.1.47c0 .18-.07.35-.2.47zm1.54-2.8c0-.55-.45-1-1-1h-4.84l-1.42 1.42c-.78.78-2.05.78-2.83 0l-1.4-1.42H4.34c-.55 0-1 .45-1 1V19c0 .55.45 1 1 1h15.32c.55 0 1-.45 1-1v-3.34l.01.01zm-4-6.33H14V4.67a.692.692 0 0 0-.68-.67h-2.66a.69.69 0 0 0-.67.67v4.66H7.34a.628.628 0 0 0-.62.41c-.13.25-.06.55.15.73l4.66 4.66c.25.26.66.27.92.02l.02-.02 4.66-4.66c.21-.18.28-.48.15-.73a.62.62 0 0 0-.63-.41l.02.01z",
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
vectorEffect: "non-scaling-stroke"
|
|
22
|
+
})));
|
|
23
|
+
|
|
24
|
+
exports.default = SvgExportSolid;
|
package/lib/index.js
CHANGED
|
@@ -143,12 +143,14 @@ var iconTypes = [
|
|
|
143
143
|
'chevron-down',
|
|
144
144
|
'chevron-left',
|
|
145
145
|
'chevron-right',
|
|
146
|
+
'clipboard',
|
|
146
147
|
'close',
|
|
147
148
|
'code',
|
|
148
149
|
'copy',
|
|
149
150
|
'download',
|
|
150
151
|
'dropper',
|
|
151
152
|
'exchange',
|
|
153
|
+
'export-solid',
|
|
152
154
|
'external-link',
|
|
153
155
|
'eye',
|
|
154
156
|
'filter-solid',
|
|
@@ -173,6 +175,7 @@ var iconTypes = [
|
|
|
173
175
|
'pencil',
|
|
174
176
|
'play',
|
|
175
177
|
'plus',
|
|
178
|
+
'question-circle-alt',
|
|
176
179
|
'question-circle',
|
|
177
180
|
'radio-checked',
|
|
178
181
|
'radio-unchecked',
|
|
@@ -213,12 +216,14 @@ function __variableDynamicImportRuntime0__(path) {
|
|
|
213
216
|
case './icons/checkbox-unchecked.svg': return Promise.resolve().then(function () { return require('./checkbox-unchecked.js'); });
|
|
214
217
|
case './icons/chevron-double.svg': return Promise.resolve().then(function () { return require('./chevron-double.js'); });
|
|
215
218
|
case './icons/chevron.svg': return Promise.resolve().then(function () { return require('./chevron.js'); });
|
|
219
|
+
case './icons/clipboard.svg': return Promise.resolve().then(function () { return require('./clipboard.js'); });
|
|
216
220
|
case './icons/close.svg': return Promise.resolve().then(function () { return require('./close.js'); });
|
|
217
221
|
case './icons/code.svg': return Promise.resolve().then(function () { return require('./code.js'); });
|
|
218
222
|
case './icons/copy.svg': return Promise.resolve().then(function () { return require('./copy.js'); });
|
|
219
223
|
case './icons/download.svg': return Promise.resolve().then(function () { return require('./download.js'); });
|
|
220
224
|
case './icons/dropper.svg': return Promise.resolve().then(function () { return require('./dropper.js'); });
|
|
221
225
|
case './icons/exchange.svg': return Promise.resolve().then(function () { return require('./exchange.js'); });
|
|
226
|
+
case './icons/export-solid.svg': return Promise.resolve().then(function () { return require('./export-solid.js'); });
|
|
222
227
|
case './icons/external-link.svg': return Promise.resolve().then(function () { return require('./external-link.js'); });
|
|
223
228
|
case './icons/eye.svg': return Promise.resolve().then(function () { return require('./eye.js'); });
|
|
224
229
|
case './icons/filter-solid.svg': return Promise.resolve().then(function () { return require('./filter-solid.js'); });
|
|
@@ -243,6 +248,7 @@ function __variableDynamicImportRuntime0__(path) {
|
|
|
243
248
|
case './icons/pencil.svg': return Promise.resolve().then(function () { return require('./pencil.js'); });
|
|
244
249
|
case './icons/play.svg': return Promise.resolve().then(function () { return require('./play.js'); });
|
|
245
250
|
case './icons/plus.svg': return Promise.resolve().then(function () { return require('./plus.js'); });
|
|
251
|
+
case './icons/question-circle-alt.svg': return Promise.resolve().then(function () { return require('./question-circle-alt.js'); });
|
|
246
252
|
case './icons/question-circle.svg': return Promise.resolve().then(function () { return require('./question-circle.js'); });
|
|
247
253
|
case './icons/radio-checked.svg': return Promise.resolve().then(function () { return require('./radio-checked.js'); });
|
|
248
254
|
case './icons/radio-unchecked.svg': return Promise.resolve().then(function () { return require('./radio-unchecked.js'); });
|
|
@@ -330,7 +336,9 @@ PanelTrigger.propTypes = {
|
|
|
330
336
|
open: PropTypes.bool,
|
|
331
337
|
iconExpanded: PropTypes.string,
|
|
332
338
|
iconCollapsed: PropTypes.string,
|
|
333
|
-
heading: PropTypes.
|
|
339
|
+
heading: PropTypes.shape({
|
|
340
|
+
level: PropTypes.number
|
|
341
|
+
})
|
|
334
342
|
};
|
|
335
343
|
PanelTrigger.displayName = 'PanelTrigger';
|
|
336
344
|
var PanelTrigger$1 = React__default.memo(PanelTrigger);
|
|
@@ -357,8 +365,8 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
|
|
|
357
365
|
};
|
|
358
366
|
_this.panel = React__default.createRef();
|
|
359
367
|
_this.handleToggle = function (e) {
|
|
360
|
-
var
|
|
361
|
-
var
|
|
368
|
+
var _a = _this.props.onToggle, onToggle = _a === void 0 ? function () { } : _a;
|
|
369
|
+
var _b = _this.state, isOpen = _b.isOpen, controlled = _b.controlled;
|
|
362
370
|
onToggle(e);
|
|
363
371
|
if (!controlled) {
|
|
364
372
|
_this.setState({ isOpen: !isOpen, isAnimating: true });
|
|
@@ -473,9 +481,12 @@ var AccordionContent = function (_a) {
|
|
|
473
481
|
return (React__default.createElement("div", tslib.__assign({ className: classNames('Accordion__panel', className) }, otherProps), children));
|
|
474
482
|
};
|
|
475
483
|
var Accordion = function (_a) {
|
|
476
|
-
var children = _a.children;
|
|
484
|
+
var children = _a.children, open = _a.open, onToggle = _a.onToggle, animationTiming = _a.animationTiming, props = tslib.__rest(_a, ["children", "open", "onToggle", "animationTiming"]);
|
|
477
485
|
var childrenArray = React__default.Children.toArray(children);
|
|
478
|
-
var trigger = childrenArray.find(function (child) {
|
|
486
|
+
var trigger = childrenArray.find(function (child) {
|
|
487
|
+
return typeof child === 'string' ||
|
|
488
|
+
child.type === AccordionTrigger;
|
|
489
|
+
});
|
|
479
490
|
var panelElement = childrenArray.find(function (child) {
|
|
480
491
|
return typeof child === 'string' ||
|
|
481
492
|
child.type === AccordionContent;
|
|
@@ -491,8 +502,8 @@ var Accordion = function (_a) {
|
|
|
491
502
|
}
|
|
492
503
|
var _b = trigger.props, triggerClassName = _b.className, triggerProps = tslib.__rest(_b, ["className"]);
|
|
493
504
|
var elementId = nextId.useId();
|
|
494
|
-
return (React__default.createElement("div", { className: "Accordion" },
|
|
495
|
-
React__default.createElement(ExpandCollapsePanel, tslib.__assign({ id: panelElement.props.id || "".concat(elementId, "-panel") }, panelElement.props),
|
|
505
|
+
return (React__default.createElement("div", tslib.__assign({ className: "Accordion" }, props),
|
|
506
|
+
React__default.createElement(ExpandCollapsePanel, tslib.__assign({ id: panelElement.props.id || "".concat(elementId, "-panel"), open: open, onToggle: onToggle, animationTiming: animationTiming }, panelElement.props),
|
|
496
507
|
React__default.createElement(PanelTrigger$1, tslib.__assign({ iconCollapsed: "triangle-right", iconExpanded: "triangle-down", className: classNames('Accordion__trigger', trigger.props.className), "aria-controls": panelElement.props.id || "".concat(elementId, "-panel"), heading: trigger.props.heading }, trigger.props), trigger),
|
|
497
508
|
panelElement)));
|
|
498
509
|
};
|
|
@@ -505,7 +516,9 @@ Accordion.propTypes = {
|
|
|
505
516
|
};
|
|
506
517
|
AccordionTrigger.propTypes = {
|
|
507
518
|
children: PropTypes.node,
|
|
508
|
-
heading: PropTypes.
|
|
519
|
+
heading: PropTypes.shape({
|
|
520
|
+
level: PropTypes.number
|
|
521
|
+
})
|
|
509
522
|
};
|
|
510
523
|
AccordionContent.propTypes = {
|
|
511
524
|
children: PropTypes.node.isRequired,
|
|
@@ -2326,7 +2339,7 @@ var Toast = /** @class */ (function (_super) {
|
|
|
2326
2339
|
var _a = this.props, type = _a.type, children = _a.children,
|
|
2327
2340
|
// prevent `onDismiss` from being passed-through to DOM
|
|
2328
2341
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2329
|
-
onDismiss = _a.onDismiss, dismissText = _a.dismissText, toastRef = _a.toastRef, focus = _a.focus, show = _a.show, otherProps = tslib.__rest(_a, ["type", "children", "onDismiss", "dismissText", "toastRef", "focus", "show"]);
|
|
2342
|
+
onDismiss = _a.onDismiss, dismissText = _a.dismissText, toastRef = _a.toastRef, focus = _a.focus, show = _a.show, dismissible = _a.dismissible, otherProps = tslib.__rest(_a, ["type", "children", "onDismiss", "dismissText", "toastRef", "focus", "show", "dismissible"]);
|
|
2330
2343
|
var scrim = type === 'action-needed' && show ? (React__default.createElement("div", { className: "Scrim--light Scrim--show Scrim--fade-in" })) : null;
|
|
2331
2344
|
var defaultProps = {
|
|
2332
2345
|
tabIndex: -1,
|
|
@@ -2343,7 +2356,7 @@ var Toast = /** @class */ (function (_super) {
|
|
|
2343
2356
|
React__default.createElement("div", { className: "Toast__message" },
|
|
2344
2357
|
React__default.createElement(Icon, { type: typeMap[type].icon }),
|
|
2345
2358
|
React__default.createElement("div", { className: "Toast__message-content" }, children)),
|
|
2346
|
-
type !== 'action-needed' && (React__default.createElement("button", { type: "button", className: 'Toast__dismiss', "aria-label": dismissText, onClick: this.dismissToast },
|
|
2359
|
+
type !== 'action-needed' && dismissible && (React__default.createElement("button", { type: "button", className: 'Toast__dismiss', "aria-label": dismissText, onClick: this.dismissToast },
|
|
2347
2360
|
React__default.createElement(Icon, { type: "close" })))),
|
|
2348
2361
|
scrim));
|
|
2349
2362
|
};
|
|
@@ -2394,7 +2407,8 @@ var Toast = /** @class */ (function (_super) {
|
|
|
2394
2407
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2395
2408
|
toastRef: function () { },
|
|
2396
2409
|
focus: true,
|
|
2397
|
-
show: false
|
|
2410
|
+
show: false,
|
|
2411
|
+
dismissible: true
|
|
2398
2412
|
};
|
|
2399
2413
|
Toast.propTypes = {
|
|
2400
2414
|
// the ui to be added as the message of the toast
|
|
@@ -2413,7 +2427,9 @@ var Toast = /** @class */ (function (_super) {
|
|
|
2413
2427
|
// whether or not to focus the toast
|
|
2414
2428
|
focus: PropTypes.bool,
|
|
2415
2429
|
// whether or not to show the toast
|
|
2416
|
-
show: PropTypes.bool
|
|
2430
|
+
show: PropTypes.bool,
|
|
2431
|
+
// whether or not the toast is dismissible
|
|
2432
|
+
dismissible: PropTypes.bool
|
|
2417
2433
|
};
|
|
2418
2434
|
Toast.displayName = 'Toast';
|
|
2419
2435
|
return Toast;
|
|
@@ -8352,7 +8368,6 @@ var Tabs = function (_a) {
|
|
|
8352
8368
|
var children = _a.children, thin = _a.thin, _b = _a.orientation, orientation = _b === void 0 ? 'horizontal' : _b, _c = _a.initialActiveIndex, initialActiveIndex = _c === void 0 ? 0 : _c, className = _a.className, onChange = _a.onChange, labelProp = tslib.__rest(_a, ["children", "thin", "orientation", "initialActiveIndex", "className", "onChange"]);
|
|
8353
8369
|
var _d = tslib.__read(React.useState(initialActiveIndex), 2), activeIndex = _d[0], setActiveIndex = _d[1];
|
|
8354
8370
|
var tabsRef = React.useRef(null);
|
|
8355
|
-
var focusedTabRef = React.useRef(null);
|
|
8356
8371
|
var tabs = React__default.Children.toArray(children).filter(function (child) { return child.type === Tab; });
|
|
8357
8372
|
var tabCount = tabs.length;
|
|
8358
8373
|
var handleClick = function (index) {
|
|
@@ -8425,14 +8440,15 @@ var Tabs = function (_a) {
|
|
|
8425
8440
|
}, [activeIndex]);
|
|
8426
8441
|
var config = tslib.__assign((_a = { id: id, className: classNames('Tab', {
|
|
8427
8442
|
'Tab--active': selected
|
|
8428
|
-
}), tabIndex: index === activeIndex ? 0 : -1 }, _a['aria-controls'] = (_b = target.current) === null || _b === void 0 ? void 0 : _b.id, _a['aria-selected'] = selected, _a.
|
|
8443
|
+
}), tabIndex: index === activeIndex ? 0 : -1 }, _a['aria-controls'] = (_b = target.current) === null || _b === void 0 ? void 0 : _b.id, _a['aria-selected'] = selected, _a.onClick = function () { return handleClick(index); }, _a), other);
|
|
8429
8444
|
return React__default.cloneElement(child, config);
|
|
8430
8445
|
});
|
|
8431
8446
|
useDidUpdate(function () {
|
|
8432
8447
|
var _a;
|
|
8433
|
-
(_a =
|
|
8448
|
+
var activeTab = (_a = tabsRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(':scope > [role="tablist"] > [aria-selected="true"]');
|
|
8449
|
+
activeTab === null || activeTab === void 0 ? void 0 : activeTab.focus();
|
|
8434
8450
|
if (typeof onChange === 'function') {
|
|
8435
|
-
onChange({ activeTabIndex: activeIndex, target:
|
|
8451
|
+
onChange({ activeTabIndex: activeIndex, target: activeTab });
|
|
8436
8452
|
}
|
|
8437
8453
|
}, [activeIndex]);
|
|
8438
8454
|
return (React__default.createElement("div", { className: classNames('Tabs', className, {
|
|
@@ -8635,16 +8651,18 @@ AddressCityStateZip.propTypes = {
|
|
|
8635
8651
|
};
|
|
8636
8652
|
|
|
8637
8653
|
var Pagination = React__default.forwardRef(function (_a, ref) {
|
|
8638
|
-
var totalItems = _a.totalItems, _b = _a.itemsPerPage, itemsPerPage = _b === void 0 ? 10 : _b, _c = _a.currentPage, currentPage = _c === void 0 ? 1 : _c, statusLabel = _a.statusLabel, _d = _a.firstPageLabel, firstPageLabel = _d === void 0 ? 'First page' : _d, _e = _a.previousPageLabel, previousPageLabel = _e === void 0 ? 'Previous page' : _e, _f = _a.nextPageLabel, nextPageLabel = _f === void 0 ? 'Next page' : _f, _g = _a.lastPageLabel, lastPageLabel = _g === void 0 ? 'Last page' : _g, _h = _a.tooltipPlacement, tooltipPlacement = _h === void 0 ? 'bottom' : _h, onNextPageClick = _a.onNextPageClick, onPreviousPageClick = _a.onPreviousPageClick, onFirstPageClick = _a.onFirstPageClick, onLastPageClick = _a.onLastPageClick, className = _a.className, other = tslib.__rest(_a, ["totalItems", "itemsPerPage", "currentPage", "statusLabel", "firstPageLabel", "previousPageLabel", "nextPageLabel", "lastPageLabel", "tooltipPlacement", "onNextPageClick", "onPreviousPageClick", "onFirstPageClick", "onLastPageClick", "className"]);
|
|
8654
|
+
var totalItems = _a.totalItems, _b = _a.itemsPerPage, itemsPerPage = _b === void 0 ? 10 : _b, _c = _a.currentPage, currentPage = _c === void 0 ? 1 : _c, statusLabel = _a.statusLabel, _d = _a.firstPageLabel, firstPageLabel = _d === void 0 ? 'First page' : _d, _e = _a.previousPageLabel, previousPageLabel = _e === void 0 ? 'Previous page' : _e, _f = _a.nextPageLabel, nextPageLabel = _f === void 0 ? 'Next page' : _f, _g = _a.lastPageLabel, lastPageLabel = _g === void 0 ? 'Last page' : _g, _h = _a.tooltipPlacement, tooltipPlacement = _h === void 0 ? 'bottom' : _h, onNextPageClick = _a.onNextPageClick, onPreviousPageClick = _a.onPreviousPageClick, onFirstPageClick = _a.onFirstPageClick, onLastPageClick = _a.onLastPageClick, className = _a.className, _j = _a.thin, thin = _j === void 0 ? false : _j, other = tslib.__rest(_a, ["totalItems", "itemsPerPage", "currentPage", "statusLabel", "firstPageLabel", "previousPageLabel", "nextPageLabel", "lastPageLabel", "tooltipPlacement", "onNextPageClick", "onPreviousPageClick", "onFirstPageClick", "onLastPageClick", "className", "thin"]);
|
|
8639
8655
|
var itemStart = currentPage * itemsPerPage - itemsPerPage + 1;
|
|
8640
8656
|
var itemEnd = Math.min(itemStart + itemsPerPage - 1, totalItems);
|
|
8641
8657
|
var isLastPage = itemEnd === totalItems;
|
|
8642
8658
|
var isFirstPage = currentPage === 1;
|
|
8643
|
-
return (React__default.createElement("div", tslib.__assign({ ref: ref, className: classNames('Pagination', className
|
|
8659
|
+
return (React__default.createElement("div", tslib.__assign({ ref: ref, className: classNames('Pagination', className, {
|
|
8660
|
+
'Pagination--thin': thin
|
|
8661
|
+
}) }, other),
|
|
8644
8662
|
React__default.createElement("ul", null,
|
|
8645
|
-
React__default.createElement("li", null, isFirstPage ? (React__default.createElement(TooltipTabstop, { hideElementOnHidden: true, association: "aria-labelledby", tooltip: firstPageLabel, placement: tooltipPlacement },
|
|
8663
|
+
React__default.createElement("li", null, isFirstPage ? (React__default.createElement(TooltipTabstop, { className: "IconButton", hideElementOnHidden: true, association: "aria-labelledby", tooltip: firstPageLabel, placement: tooltipPlacement },
|
|
8646
8664
|
React__default.createElement(Icon, { type: "chevron-double-left" }))) : (React__default.createElement(IconButton, { icon: "chevron-double-left", tooltipPlacement: tooltipPlacement, label: firstPageLabel, onClick: onFirstPageClick }))),
|
|
8647
|
-
React__default.createElement("li", null, isFirstPage ? (React__default.createElement(TooltipTabstop, { hideElementOnHidden: true, association: "aria-labelledby", tooltip: previousPageLabel, placement: tooltipPlacement },
|
|
8665
|
+
React__default.createElement("li", null, isFirstPage ? (React__default.createElement(TooltipTabstop, { className: "IconButton", hideElementOnHidden: true, association: "aria-labelledby", tooltip: previousPageLabel, placement: tooltipPlacement },
|
|
8648
8666
|
React__default.createElement(Icon, { type: "chevron-left" }))) : (React__default.createElement(IconButton, { icon: "chevron-left", tooltipPlacement: tooltipPlacement, label: previousPageLabel, onClick: onPreviousPageClick }))),
|
|
8649
8667
|
React__default.createElement("li", null,
|
|
8650
8668
|
React__default.createElement("span", { role: "log", "aria-atomic": "true" }, statusLabel || (React__default.createElement("span", null,
|
|
@@ -8655,9 +8673,9 @@ var Pagination = React__default.forwardRef(function (_a, ref) {
|
|
|
8655
8673
|
React__default.createElement("strong", null, itemEnd),
|
|
8656
8674
|
" of ",
|
|
8657
8675
|
React__default.createElement("strong", null, totalItems))))),
|
|
8658
|
-
React__default.createElement("li", null, isLastPage ? (React__default.createElement(TooltipTabstop, { hideElementOnHidden: true, association: "aria-labelledby", tooltip: nextPageLabel, placement: tooltipPlacement },
|
|
8676
|
+
React__default.createElement("li", null, isLastPage ? (React__default.createElement(TooltipTabstop, { className: "IconButton", hideElementOnHidden: true, association: "aria-labelledby", tooltip: nextPageLabel, placement: tooltipPlacement },
|
|
8659
8677
|
React__default.createElement(Icon, { type: "chevron-right" }))) : (React__default.createElement(IconButton, { icon: "chevron-right", tooltipPlacement: tooltipPlacement, label: nextPageLabel, onClick: onNextPageClick }))),
|
|
8660
|
-
React__default.createElement("li", null, isLastPage ? (React__default.createElement(TooltipTabstop, { hideElementOnHidden: true, association: "aria-labelledby", tooltip: lastPageLabel, placement: tooltipPlacement },
|
|
8678
|
+
React__default.createElement("li", null, isLastPage ? (React__default.createElement(TooltipTabstop, { className: "IconButton", hideElementOnHidden: true, association: "aria-labelledby", tooltip: lastPageLabel, placement: tooltipPlacement },
|
|
8661
8679
|
React__default.createElement(Icon, { type: "chevron-double-right" }))) : (React__default.createElement(IconButton, { icon: "chevron-double-right", tooltipPlacement: tooltipPlacement, label: lastPageLabel, onClick: onLastPageClick }))))));
|
|
8662
8680
|
});
|
|
8663
8681
|
Pagination.displayName = 'Pagination';
|
|
@@ -8702,7 +8720,8 @@ var usePagination = function (_a) {
|
|
|
8702
8720
|
var pageStatus = {
|
|
8703
8721
|
currentPage: currentPage,
|
|
8704
8722
|
pageStart: pageStart,
|
|
8705
|
-
pageEnd: pageEnd
|
|
8723
|
+
pageEnd: pageEnd,
|
|
8724
|
+
setCurrentPage: setCurrentPage
|
|
8706
8725
|
};
|
|
8707
8726
|
return { pagination: pagination, pageStatus: pageStatus };
|
|
8708
8727
|
};
|
|
@@ -8762,10 +8781,10 @@ var ColumnRight = React.forwardRef(function (_a, ref) {
|
|
|
8762
8781
|
ColumnRight.displayName = 'ColumnRight';
|
|
8763
8782
|
|
|
8764
8783
|
var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
8765
|
-
var className = _a.className, children = _a.children, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? false : _b, _c = _a.showCollapsedPanelLabel, showCollapsedPanelLabel = _c === void 0 ? 'Show Panel' : _c, _d = _a.hideCollapsedPanelLabel, hideCollapsedPanelLabel = _d === void 0 ? 'Hide Panel' : _d, _e = _a.skipLink, skipLink = _e === void 0 ? null : _e, props = tslib.__rest(_a, ["className", "children", "initialCollapsed", "showCollapsedPanelLabel", "hideCollapsedPanelLabel", "skipLink"]);
|
|
8766
|
-
var
|
|
8767
|
-
var
|
|
8768
|
-
var
|
|
8784
|
+
var className = _a.className, children = _a.children, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? false : _b, _c = _a.showCollapsedPanelLabel, showCollapsedPanelLabel = _c === void 0 ? 'Show Panel' : _c, _d = _a.hideCollapsedPanelLabel, hideCollapsedPanelLabel = _d === void 0 ? 'Hide Panel' : _d, _e = _a.skipLink, skipLink = _e === void 0 ? null : _e, _f = _a.collapsedMediaQuery, collapsedMediaQuery = _f === void 0 ? '(max-width: 45rem)' : _f, props = tslib.__rest(_a, ["className", "children", "initialCollapsed", "showCollapsedPanelLabel", "hideCollapsedPanelLabel", "skipLink", "collapsedMediaQuery"]);
|
|
8785
|
+
var _g = tslib.__read(React.useState(initialCollapsed), 2), isCollapsed = _g[0], setCollapsed = _g[1];
|
|
8786
|
+
var _h = tslib.__read(React.useState(false), 2), isFocusTrap = _h[0], setIsFocusTrap = _h[1];
|
|
8787
|
+
var _j = tslib.__read(React.useState(!initialCollapsed), 2), showPanel = _j[0], setShowPanel = _j[1];
|
|
8769
8788
|
var toggleButtonRef = React.useRef(null);
|
|
8770
8789
|
var closeButtonRef = React.useRef(null);
|
|
8771
8790
|
var columnLeftRef = React.useRef(null);
|
|
@@ -8839,7 +8858,7 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
|
8839
8858
|
}, [columnLeftRef.current, isCollapsed]);
|
|
8840
8859
|
// When the collapsable panel starts to overlay content, it needs to become a focus trap and collapsed by default
|
|
8841
8860
|
React.useLayoutEffect(function () {
|
|
8842
|
-
var mediaQueryList = matchMedia(
|
|
8861
|
+
var mediaQueryList = matchMedia(collapsedMediaQuery);
|
|
8843
8862
|
var handleMatch = function (matches) {
|
|
8844
8863
|
setIsFocusTrap(matches);
|
|
8845
8864
|
var collapsed = matches ? true : isCollapsed;
|
|
@@ -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 SvgQuestionCircleAlt = 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: "M13.07 14.93a.34.34 0 0 0-.24-.09h-1.66c-.18-.01-.32.13-.33.31v1.69c-.01.18.13.32.31.33h1.69c.18.01.32-.13.33-.31v-1.69a.31.31 0 0 0-.1-.24zM15.83 10c-.01-.88-.43-1.71-1.14-2.23-.69-.59-1.57-.92-2.48-.93-1.48-.05-2.88.72-3.63 2-.05.07-.07.16-.05.24.01.08.05.16.12.21l1.12.85c.06.04.13.06.2.06.1 0 .2-.04.26-.12.24-.32.52-.61.83-.86.3-.2.65-.29 1-.28.36 0 .71.11 1 .31.27.15.44.43.45.74.01.2-.08.39-.23.51-.24.18-.5.33-.78.45l-.5.21c-.15.08-.29.17-.43.27-.16.1-.29.23-.41.37-.11.15-.19.32-.25.49-.07.22-.11.44-.11.67v.71c-.01.18.13.32.31.33h1.69c.18.01.32-.13.33-.31V13.33c0-.11.05-.22.12-.3.08-.1.17-.18.27-.25l.48-.29c.27-.15.47-.27.62-.37.19-.14.37-.29.54-.46.21-.2.37-.45.47-.72.12-.3.19-.62.2-.94zm-1.24-4.13a6.57 6.57 0 0 1 3.55 3.55 6.54 6.54 0 0 1 0 5.17 6.57 6.57 0 0 1-3.55 3.55 6.54 6.54 0 0 1-5.17 0 6.57 6.57 0 0 1-3.55-3.55 6.54 6.54 0 0 1 0-5.17c.66-1.6 1.94-2.88 3.54-3.55 1.65-.71 3.53-.71 5.18 0zM18.92 8A8.016 8.016 0 0 0 16 5.08 7.798 7.798 0 0 0 12 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 0 0 4 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 0 0 20 12c.01-1.41-.37-2.79-1.08-4z",
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
vectorEffect: "non-scaling-stroke"
|
|
22
|
+
})));
|
|
23
|
+
|
|
24
|
+
exports.default = SvgQuestionCircleAlt;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deque/cauldron-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0-canary.942ce561",
|
|
4
4
|
"description": "Fully accessible react components library for Deque Cauldron",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-router-dom": "^5.1.2",
|
|
81
81
|
"rollup": "^2.23.0",
|
|
82
82
|
"sinon": "^10.0.0",
|
|
83
|
-
"ts-node": "^10.
|
|
83
|
+
"ts-node": "^10.9.1",
|
|
84
84
|
"typescript": "^4.7.3"
|
|
85
85
|
},
|
|
86
86
|
"repository": {
|
|
@@ -125,4 +125,4 @@
|
|
|
125
125
|
"\\.svg$": "<rootDir>/__tests__/svgMock.js"
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
}
|
|
128
|
+
}
|