@deque/cauldron-react 4.2.0-canary.bda75210 → 4.2.1-canary.d1539456
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/Icon/types.d.ts +1 -1
- package/lib/index.js +29 -9
- package/lib/minus.js +25 -0
- package/lib/utils/useSharedRef.d.ts +16 -0
- package/package.json +1 -1
|
@@ -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' | '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' | '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[];
|
package/lib/index.js
CHANGED
|
@@ -164,6 +164,7 @@ var iconTypes = [
|
|
|
164
164
|
'lock',
|
|
165
165
|
'magnifying-glass',
|
|
166
166
|
'menu',
|
|
167
|
+
'minus',
|
|
167
168
|
'new-releases',
|
|
168
169
|
'new',
|
|
169
170
|
'no',
|
|
@@ -229,6 +230,7 @@ function __variableDynamicImportRuntime0__(path) {
|
|
|
229
230
|
case './icons/lock.svg': return Promise.resolve().then(function () { return require('./lock.js'); });
|
|
230
231
|
case './icons/magnifying-glass.svg': return Promise.resolve().then(function () { return require('./magnifying-glass.js'); });
|
|
231
232
|
case './icons/menu.svg': return Promise.resolve().then(function () { return require('./menu.js'); });
|
|
233
|
+
case './icons/minus.svg': return Promise.resolve().then(function () { return require('./minus.js'); });
|
|
232
234
|
case './icons/new-releases.svg': return Promise.resolve().then(function () { return require('./new-releases.js'); });
|
|
233
235
|
case './icons/new.svg': return Promise.resolve().then(function () { return require('./new.js'); });
|
|
234
236
|
case './icons/no.svg': return Promise.resolve().then(function () { return require('./no.js'); });
|
|
@@ -1421,8 +1423,9 @@ var SkipLink = /** @class */ (function (_super) {
|
|
|
1421
1423
|
return (React__default.createElement("nav", tslib.__assign({ className: classNames('SkipLink', currentClass) }, other),
|
|
1422
1424
|
React__default.createElement("a", { href: target, className: "SkipLink__link", onClick: this.onClick, onFocus: this.onFocus, onBlur: this.onBlur },
|
|
1423
1425
|
React__default.createElement("span", { className: "SkipLink__item--first" }, skipText),
|
|
1424
|
-
"
|
|
1425
|
-
|
|
1426
|
+
React__default.createElement("span", { className: "SkipLink__item--second" },
|
|
1427
|
+
React__default.createElement(Icon, { type: "triangle-right" }),
|
|
1428
|
+
targetText))));
|
|
1426
1429
|
};
|
|
1427
1430
|
SkipLink.prototype.onClick = function () {
|
|
1428
1431
|
if (!isBrowser()) {
|
|
@@ -7997,9 +8000,31 @@ function AxeLoader() {
|
|
|
7997
8000
|
React__default.createElement("path", { fill: "currentColor", d: "M379 549.9h-27.6v-16.7c-7.4 13.5-22.8 20.2-39 20.2-37.1 0-58.9-28.9-58.9-61.6 0-36.5 26.4-61.4 58.9-61.4 21.1 0 34 11.2 39 20.5V434H379v115.9zm-97.8-57.4c0 14.3 10.3 35.2 35.2 35.2 15.4 0 25.5-8 30.8-18.6 2.7-5.1 4-10.5 4.4-16.2.2-5.5-.8-11.2-3.2-16.2-4.9-11-15.6-20.5-32.3-20.5-22.4 0-35 18.1-35 36.1v.2zM436.2 488.9l-39-54.8h33.3l22.6 35.6 22.6-35.6h32.9l-38.8 54.8 43.2 61h-34L453.1 510l-26.2 39.9h-33.5l42.8-61z" })));
|
|
7998
8001
|
}
|
|
7999
8002
|
|
|
8000
|
-
|
|
8003
|
+
/**
|
|
8004
|
+
* When a component needs to track an internal ref on a component that has a
|
|
8005
|
+
* forwarded ref, useSharedRef will return a MutableRefObject<T> that will
|
|
8006
|
+
* correctly invoke the parent ref as well providing an internal ref.
|
|
8007
|
+
*
|
|
8008
|
+
* @example
|
|
8009
|
+
* React.forwardRef(function Component({ children }, ref) {
|
|
8010
|
+
* const internalRef = useSharedRef<HTMLElement>(ref)
|
|
8011
|
+
* if (internalRef.current) {
|
|
8012
|
+
* // do something with the internal ref...
|
|
8013
|
+
* }
|
|
8014
|
+
* return (<div ref={internalRef}>...</div>)
|
|
8015
|
+
* })
|
|
8016
|
+
*/
|
|
8017
|
+
function useSharedRef(ref) {
|
|
8018
|
+
var internalRef = React.useRef();
|
|
8019
|
+
React.useEffect(function () {
|
|
8020
|
+
setRef(ref, internalRef.current);
|
|
8021
|
+
}, [ref]);
|
|
8022
|
+
return internalRef;
|
|
8023
|
+
}
|
|
8024
|
+
|
|
8025
|
+
var LoaderOverlay = React.forwardRef(function (_a, ref) {
|
|
8001
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"]);
|
|
8002
|
-
var overlayRef =
|
|
8027
|
+
var overlayRef = useSharedRef(ref);
|
|
8003
8028
|
React.useEffect(function () {
|
|
8004
8029
|
if (!!focusOnInitialRender && overlayRef.current) {
|
|
8005
8030
|
setTimeout(function () {
|
|
@@ -8009,11 +8034,6 @@ var LoaderOverlay = React__default.forwardRef(function (_a, ref) {
|
|
|
8009
8034
|
}
|
|
8010
8035
|
return;
|
|
8011
8036
|
}, [overlayRef.current]);
|
|
8012
|
-
React.useEffect(function () {
|
|
8013
|
-
if (typeof ref === 'function') {
|
|
8014
|
-
ref(overlayRef.current);
|
|
8015
|
-
}
|
|
8016
|
-
}, [ref]);
|
|
8017
8037
|
return (React__default.createElement("div", tslib.__assign({ className: classNames('Loader__overlay', className, variant === 'large'
|
|
8018
8038
|
? 'Loader__overlay--large'
|
|
8019
8039
|
: variant === 'small'
|
package/lib/minus.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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 SvgMinus = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
overflow: "visible",
|
|
15
|
+
preserveAspectRatio: "none",
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
height: 24,
|
|
18
|
+
width: 24
|
|
19
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
d: "M19 13H5v-2h14v2z",
|
|
21
|
+
vectorEffect: "non-scaling-stroke",
|
|
22
|
+
fill: "currentColor"
|
|
23
|
+
})));
|
|
24
|
+
|
|
25
|
+
exports.default = SvgMinus;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MutableRefObject, Ref } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* When a component needs to track an internal ref on a component that has a
|
|
4
|
+
* forwarded ref, useSharedRef will return a MutableRefObject<T> that will
|
|
5
|
+
* correctly invoke the parent ref as well providing an internal ref.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* React.forwardRef(function Component({ children }, ref) {
|
|
9
|
+
* const internalRef = useSharedRef<HTMLElement>(ref)
|
|
10
|
+
* if (internalRef.current) {
|
|
11
|
+
* // do something with the internal ref...
|
|
12
|
+
* }
|
|
13
|
+
* return (<div ref={internalRef}>...</div>)
|
|
14
|
+
* })
|
|
15
|
+
*/
|
|
16
|
+
export default function useSharedRef<T>(ref: Ref<T>): MutableRefObject<T>;
|