@iabbb/bds-react 0.38.2 → 0.38.3
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/Button/Button.js +28 -7
- package/Button/Button.js.map +1 -1
- package/Button/index.js +9 -3
- package/Button/index.js.map +1 -1
- package/CallToAction/CallToAction.js +27 -6
- package/CallToAction/CallToAction.js.map +1 -1
- package/CallToAction/index.js +9 -3
- package/CallToAction/index.js.map +1 -1
- package/ErrorSummary/ErrorSummary.js +43 -19
- package/ErrorSummary/ErrorSummary.js.map +1 -1
- package/ErrorSummary/index.js +13 -4
- package/ErrorSummary/index.js.map +1 -1
- package/ErrorSummary/utils.js +4 -1
- package/ErrorSummary/utils.js.map +1 -1
- package/FieldTextInput/FieldTextInput.js +34 -13
- package/FieldTextInput/FieldTextInput.js.map +1 -1
- package/FieldTextInput/index.js +9 -3
- package/FieldTextInput/index.js.map +1 -1
- package/Pagination/Pagination.js +44 -23
- package/Pagination/Pagination.js.map +1 -1
- package/Pagination/index.js +9 -3
- package/Pagination/index.js.map +1 -1
- package/Typography/Typography.js +27 -6
- package/Typography/Typography.js.map +1 -1
- package/Typography/index.js +9 -3
- package/Typography/index.js.map +1 -1
- package/{_rollupPluginBabelHelpers-9e645d4a.js → _rollupPluginBabelHelpers-28932a37.js} +6 -2
- package/_rollupPluginBabelHelpers-28932a37.js.map +1 -0
- package/index.js +20 -9
- package/index.js.map +1 -1
- package/package.json +1 -2
- package/_rollupPluginBabelHelpers-9e645d4a.js.map +0 -1
package/Button/Button.js
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _rollupPluginBabelHelpers = require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
3
24
|
|
|
4
25
|
var _excluded = ["children", "className", "onClick", "preventDoubleClick", "variant"];
|
|
5
26
|
var DEBOUNCE_TIMEOUT_IN_SECONDS = 1;
|
|
6
|
-
var Button = /*#__PURE__*/
|
|
27
|
+
var Button = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
7
28
|
var children = _ref.children,
|
|
8
29
|
className = _ref.className,
|
|
9
30
|
onClick = _ref.onClick,
|
|
@@ -11,8 +32,8 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
11
32
|
preventDoubleClick = _ref$preventDoubleCli === void 0 ? false : _ref$preventDoubleCli,
|
|
12
33
|
_ref$variant = _ref.variant,
|
|
13
34
|
variant = _ref$variant === void 0 ? 'standard' : _ref$variant,
|
|
14
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
-
var debounceClicks =
|
|
35
|
+
props = _rollupPluginBabelHelpers._objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
var debounceClicks = React__namespace.useRef(false);
|
|
16
37
|
var handleClick = function handleClick(event) {
|
|
17
38
|
// 👇 button is not configured to ignore double clicks
|
|
18
39
|
if (!preventDoubleClick) {
|
|
@@ -39,7 +60,7 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
39
60
|
debounceClicks.current = false;
|
|
40
61
|
}, DEBOUNCE_TIMEOUT_IN_SECONDS * 1000);
|
|
41
62
|
};
|
|
42
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/React__namespace.createElement("button", _rollupPluginBabelHelpers._extends({
|
|
43
64
|
className: [variant === 'unstyled' ? 'bds-button-unstyled' : 'bds-button', className].filter(function (x) {
|
|
44
65
|
return x;
|
|
45
66
|
}).join(' '),
|
|
@@ -49,5 +70,5 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
49
70
|
}, props), children);
|
|
50
71
|
});
|
|
51
72
|
|
|
52
|
-
|
|
73
|
+
module.exports = Button;
|
|
53
74
|
//# sourceMappingURL=Button.js.map
|
package/Button/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../src/Button/Button.js"],"sourcesContent":["import * as React from 'react';\n\nconst DEBOUNCE_TIMEOUT_IN_SECONDS = 1;\n\nconst Button = React.forwardRef(\n ({ children, className, onClick, preventDoubleClick = false, variant = 'standard', ...props }, ref) => {\n const debounceClicks = React.useRef(false);\n\n const handleClick = (event) => {\n // 👇 button is not configured to ignore double clicks\n if (!preventDoubleClick) {\n if (onClick) {\n onClick(event);\n }\n\n return;\n }\n\n // 👇 button has been clicked recently, and subsequent clicks are prevented\n if (debounceClicks.current) {\n event.preventDefault();\n return false;\n }\n\n if (onClick) {\n onClick(event);\n }\n\n // 👇 block from double clicks\n debounceClicks.current = true;\n\n // 👇 and remove the block after a given amount of seconds\n setTimeout(() => {\n debounceClicks.current = false;\n }, DEBOUNCE_TIMEOUT_IN_SECONDS * 1000);\n };\n\n return (\n <button\n className={[variant === 'unstyled' ? 'bds-button-unstyled' : 'bds-button', className]\n .filter((x) => x)\n .join(' ')}\n data-type={variant !== 'standard' && variant !== 'unstyled' ? variant : null}\n onClick={handleClick}\n ref={ref}\n {...props}\n >\n {children}\n </button>\n );\n },\n);\n\nexport default Button;\n"],"names":["DEBOUNCE_TIMEOUT_IN_SECONDS","Button","React","forwardRef","_ref","ref","children","className","onClick","_ref$preventDoubleCli","preventDoubleClick","_ref$variant","variant","props","_objectWithoutProperties","_excluded","debounceClicks","useRef","handleClick","event","current","preventDefault","setTimeout","createElement","_extends","filter","x","join"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../src/Button/Button.js"],"sourcesContent":["import * as React from 'react';\n\nconst DEBOUNCE_TIMEOUT_IN_SECONDS = 1;\n\nconst Button = React.forwardRef(\n ({ children, className, onClick, preventDoubleClick = false, variant = 'standard', ...props }, ref) => {\n const debounceClicks = React.useRef(false);\n\n const handleClick = (event) => {\n // 👇 button is not configured to ignore double clicks\n if (!preventDoubleClick) {\n if (onClick) {\n onClick(event);\n }\n\n return;\n }\n\n // 👇 button has been clicked recently, and subsequent clicks are prevented\n if (debounceClicks.current) {\n event.preventDefault();\n return false;\n }\n\n if (onClick) {\n onClick(event);\n }\n\n // 👇 block from double clicks\n debounceClicks.current = true;\n\n // 👇 and remove the block after a given amount of seconds\n setTimeout(() => {\n debounceClicks.current = false;\n }, DEBOUNCE_TIMEOUT_IN_SECONDS * 1000);\n };\n\n return (\n <button\n className={[variant === 'unstyled' ? 'bds-button-unstyled' : 'bds-button', className]\n .filter((x) => x)\n .join(' ')}\n data-type={variant !== 'standard' && variant !== 'unstyled' ? variant : null}\n onClick={handleClick}\n ref={ref}\n {...props}\n >\n {children}\n </button>\n );\n },\n);\n\nexport default Button;\n"],"names":["DEBOUNCE_TIMEOUT_IN_SECONDS","Button","React","forwardRef","_ref","ref","children","className","onClick","_ref$preventDoubleCli","preventDoubleClick","_ref$variant","variant","props","_objectWithoutProperties","_excluded","debounceClicks","useRef","handleClick","event","current","preventDefault","setTimeout","createElement","_extends","filter","x","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,2BAA2B,GAAG,CAAC,CAAA;AAE/BC,IAAAA,MAAM,gBAAGC,gBAAK,CAACC,UAAU,CAC7B,UAAAC,IAAA,EAA+FC,GAAG,EAAK;AAAA,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ACK,OAAO,KAAK,UAAU,GAAG,qBAAqB,GAAG,YAAY,EAAEL,SAAS,CAAC,CAClFkB,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC,CAAA;AAAA,KAAA,CAAC,CAChBC,IAAI,CAAC,GAAG,CAAE;IACb,WAAWf,EAAAA,OAAO,KAAK,UAAU,IAAIA,OAAO,KAAK,UAAU,GAAGA,OAAO,GAAG,IAAK;AAC7EJ,IAAAA,OAAO,EAAEU,WAAY;AACrBb,IAAAA,GAAG,EAAEA,GAAAA;GACDQ,EAAAA,KAAK,CAERP,EAAAA,QACK,CAAC,CAAA;AAEb,CACF;;;;"}
|
package/Button/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Button_Button = require('./Button.js');
|
|
4
|
+
require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
5
|
+
require('react');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
module.exports = Button_Button;
|
|
4
10
|
//# sourceMappingURL=index.js.map
|
package/Button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _rollupPluginBabelHelpers = require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
3
24
|
|
|
4
25
|
var _excluded = ["children", "className", "variant"];
|
|
5
|
-
var CallToAction = /*#__PURE__*/
|
|
26
|
+
var CallToAction = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
6
27
|
var children = _ref.children,
|
|
7
28
|
className = _ref.className,
|
|
8
29
|
_ref$variant = _ref.variant,
|
|
9
30
|
variant = _ref$variant === void 0 ? 'standard' : _ref$variant,
|
|
10
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
-
return /*#__PURE__*/
|
|
31
|
+
props = _rollupPluginBabelHelpers._objectWithoutProperties(_ref, _excluded);
|
|
32
|
+
return /*#__PURE__*/React__namespace.createElement("a", _rollupPluginBabelHelpers._extends({
|
|
12
33
|
className: ['bds-cta', className].filter(function (x) {
|
|
13
34
|
return x;
|
|
14
35
|
}).join(' '),
|
|
@@ -17,5 +38,5 @@ var CallToAction = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
17
38
|
}, props), children);
|
|
18
39
|
});
|
|
19
40
|
|
|
20
|
-
|
|
41
|
+
module.exports = CallToAction;
|
|
21
42
|
//# sourceMappingURL=CallToAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallToAction.js","sources":["../../src/CallToAction/CallToAction.js"],"sourcesContent":["import * as React from 'react';\n\nconst CallToAction = React.forwardRef(({ children, className, variant = 'standard', ...props }, ref) => {\n return (\n <a\n className={['bds-cta', className].filter((x) => x).join(' ')}\n data-type={variant !== 'standard' ? variant : null}\n ref={ref}\n {...props}\n >\n {children}\n </a>\n );\n});\n\nexport default CallToAction;\n"],"names":["CallToAction","React","forwardRef","_ref","ref","children","className","_ref$variant","variant","props","_objectWithoutProperties","_excluded","createElement","_extends","filter","x","join"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CallToAction.js","sources":["../../src/CallToAction/CallToAction.js"],"sourcesContent":["import * as React from 'react';\n\nconst CallToAction = React.forwardRef(({ children, className, variant = 'standard', ...props }, ref) => {\n return (\n <a\n className={['bds-cta', className].filter((x) => x).join(' ')}\n data-type={variant !== 'standard' ? variant : null}\n ref={ref}\n {...props}\n >\n {children}\n </a>\n );\n});\n\nexport default CallToAction;\n"],"names":["CallToAction","React","forwardRef","_ref","ref","children","className","_ref$variant","variant","props","_objectWithoutProperties","_excluded","createElement","_extends","filter","x","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEMA,IAAAA,YAAY,gBAAGC,gBAAK,CAACC,UAAU,CAAC,UAAAC,IAAA,EAA0DC,GAAG,EAAK;AAAA,EAAA,IAA/DC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;IAAAC,YAAA,GAAAJ,IAAA,CAAEK,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,UAAU,GAAAA,YAAA;AAAKE,IAAAA,KAAK,GAAAC,kDAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;AAC1F,EAAA,oBACEV,gBAAA,CAAAW,aAAA,CAAA,GAAA,EAAAC,kCAAA,CAAA;IACEP,SAAS,EAAE,CAAC,SAAS,EAAEA,SAAS,CAAC,CAACQ,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC,CAAA;AAAA,KAAA,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;AAC7D,IAAA,WAAA,EAAWR,OAAO,KAAK,UAAU,GAAGA,OAAO,GAAG,IAAK;AACnDJ,IAAAA,GAAG,EAAEA,GAAAA;GACDK,EAAAA,KAAK,CAERJ,EAAAA,QACA,CAAC,CAAA;AAER,CAAC;;;;"}
|
package/CallToAction/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var CallToAction_CallToAction = require('./CallToAction.js');
|
|
4
|
+
require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
5
|
+
require('react');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
module.exports = CallToAction_CallToAction;
|
|
4
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var ErrorSummary_utils = require('./utils.js');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
4
27
|
|
|
5
28
|
var _excluded = ["className", "errors", "mapNameToId"];
|
|
6
29
|
var FormErrorKey = '_form';
|
|
@@ -12,17 +35,17 @@ function BdsErrorSummary(_ref) {
|
|
|
12
35
|
mapNameToId = _ref$mapNameToId === void 0 ? function (name) {
|
|
13
36
|
return name;
|
|
14
37
|
} : _ref$mapNameToId,
|
|
15
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
var headingId =
|
|
17
|
-
var groupRef =
|
|
18
|
-
|
|
38
|
+
props = _rollupPluginBabelHelpers._objectWithoutProperties(_ref, _excluded);
|
|
39
|
+
var headingId = React__namespace.useId();
|
|
40
|
+
var groupRef = React__namespace.useRef(null);
|
|
41
|
+
React__namespace.useEffect(function () {
|
|
19
42
|
if (!errors || Object.keys(errors).length === 0) return;
|
|
20
43
|
if (!groupRef.current) return;
|
|
21
44
|
groupRef.current.focus();
|
|
22
45
|
}, [errors]);
|
|
23
46
|
if (!errors || Object.keys(errors).length === 0) return null;
|
|
24
47
|
var handleLinkClick = function handleLinkClick(e) {
|
|
25
|
-
var inputId = getFragmentFromUrl(e.currentTarget.href);
|
|
48
|
+
var inputId = ErrorSummary_utils.getFragmentFromUrl(e.currentTarget.href);
|
|
26
49
|
if (!inputId) {
|
|
27
50
|
return;
|
|
28
51
|
}
|
|
@@ -30,7 +53,7 @@ function BdsErrorSummary(_ref) {
|
|
|
30
53
|
if (!input) {
|
|
31
54
|
return;
|
|
32
55
|
}
|
|
33
|
-
var legendOrLabel = getAssociatedLegendOrLabel(input);
|
|
56
|
+
var legendOrLabel = ErrorSummary_utils.getAssociatedLegendOrLabel(input);
|
|
34
57
|
if (!legendOrLabel) {
|
|
35
58
|
return;
|
|
36
59
|
}
|
|
@@ -40,7 +63,7 @@ function BdsErrorSummary(_ref) {
|
|
|
40
63
|
preventScroll: true
|
|
41
64
|
});
|
|
42
65
|
};
|
|
43
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/React__namespace.createElement("bds-error-summary", _rollupPluginBabelHelpers._extends({
|
|
44
67
|
className: ['stack', className].filter(function (x) {
|
|
45
68
|
return x;
|
|
46
69
|
}).join(' '),
|
|
@@ -48,23 +71,23 @@ function BdsErrorSummary(_ref) {
|
|
|
48
71
|
"aria-labelledby": headingId,
|
|
49
72
|
ref: groupRef,
|
|
50
73
|
tabIndex: -1
|
|
51
|
-
}, props), /*#__PURE__*/
|
|
74
|
+
}, props), /*#__PURE__*/React__namespace.createElement("h2", {
|
|
52
75
|
className: "bds-h5",
|
|
53
76
|
id: headingId
|
|
54
|
-
}, /*#__PURE__*/
|
|
77
|
+
}, /*#__PURE__*/React__namespace.createElement("svg", {
|
|
55
78
|
xmlns: "http://www.w3.org/2000/svg",
|
|
56
79
|
viewBox: "0 0 512 512",
|
|
57
80
|
"aria-hidden": "true",
|
|
58
81
|
height: "1em",
|
|
59
82
|
width: "1em",
|
|
60
83
|
fill: "currentColor"
|
|
61
|
-
}, /*#__PURE__*/
|
|
84
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
62
85
|
d: "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z"
|
|
63
|
-
})), "Issue"), /*#__PURE__*/
|
|
86
|
+
})), "Issue"), /*#__PURE__*/React__namespace.createElement("ul", null, Object.keys(errors).map(function (errorKey) {
|
|
64
87
|
var message = errors[errorKey];
|
|
65
88
|
var isFormError = [FINAL_FORM_ERROR, FormErrorKey].includes(errorKey);
|
|
66
89
|
if (isFormError) {
|
|
67
|
-
return /*#__PURE__*/
|
|
90
|
+
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
68
91
|
key: errorKey,
|
|
69
92
|
dangerouslySetInnerHTML: {
|
|
70
93
|
__html: message
|
|
@@ -73,13 +96,13 @@ function BdsErrorSummary(_ref) {
|
|
|
73
96
|
}
|
|
74
97
|
var isArrayField = Array.isArray(message);
|
|
75
98
|
var messages = isArrayField ? message : [message];
|
|
76
|
-
return /*#__PURE__*/
|
|
99
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, {
|
|
77
100
|
key: errorKey
|
|
78
101
|
}, messages.map(function (fieldMessage, index) {
|
|
79
102
|
var inputId = "".concat(mapNameToId(errorKey)).concat(isArrayField ? "[".concat(index, "]") : '');
|
|
80
|
-
return /*#__PURE__*/
|
|
103
|
+
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
81
104
|
key: inputId
|
|
82
|
-
}, /*#__PURE__*/
|
|
105
|
+
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
83
106
|
href: "#".concat(inputId),
|
|
84
107
|
onClick: handleLinkClick
|
|
85
108
|
}, fieldMessage, messages.length > 1 ? " (".concat(index + 1, " of ").concat(messages.length, ")") : undefined));
|
|
@@ -87,5 +110,6 @@ function BdsErrorSummary(_ref) {
|
|
|
87
110
|
})));
|
|
88
111
|
}
|
|
89
112
|
|
|
90
|
-
|
|
113
|
+
exports.FormErrorKey = FormErrorKey;
|
|
114
|
+
exports.default = BdsErrorSummary;
|
|
91
115
|
//# sourceMappingURL=ErrorSummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorSummary.js","sources":["../../src/ErrorSummary/ErrorSummary.js"],"sourcesContent":["import * as React from 'react';\n\nimport { getAssociatedLegendOrLabel, getFragmentFromUrl } from './utils';\n\nexport const FormErrorKey = '_form';\n\nconst FINAL_FORM_ERROR = 'FINAL_FORM/form-error';\n\nexport default function BdsErrorSummary({ className, errors, mapNameToId = (name) => name, ...props }) {\n const headingId = React.useId();\n const groupRef = React.useRef(null);\n\n React.useEffect(() => {\n if (!errors || Object.keys(errors).length === 0) return;\n if (!groupRef.current) return;\n\n groupRef.current.focus();\n }, [errors]);\n\n if (!errors || Object.keys(errors).length === 0) return null;\n\n const handleLinkClick = (e) => {\n const inputId = getFragmentFromUrl(e.currentTarget.href);\n\n if (!inputId) {\n return;\n }\n\n const input = document.getElementById(inputId);\n\n if (!input) {\n return;\n }\n\n const legendOrLabel = getAssociatedLegendOrLabel(input);\n\n if (!legendOrLabel) {\n return;\n }\n\n e.preventDefault();\n\n legendOrLabel.scrollIntoView();\n input.focus({ preventScroll: true });\n };\n\n return (\n <bds-error-summary\n className={['stack', className].filter((x) => x).join(' ')}\n role=\"group\"\n aria-labelledby={headingId}\n ref={groupRef}\n tabIndex={-1}\n {...props}\n >\n <h2 className=\"bds-h5\" id={headingId}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n Issue\n </h2>\n <ul>\n {Object.keys(errors).map((errorKey) => {\n const message = errors[errorKey];\n const isFormError = [FINAL_FORM_ERROR, FormErrorKey].includes(errorKey);\n\n if (isFormError) {\n return <li key={errorKey} dangerouslySetInnerHTML={{ __html: message }} />;\n }\n\n const isArrayField = Array.isArray(message);\n\n const messages = isArrayField ? message : [message];\n\n return (\n <React.Fragment key={errorKey}>\n {messages.map((fieldMessage, index) => {\n const inputId = `${mapNameToId(errorKey)}${isArrayField ? `[${index}]` : ''}`;\n\n return (\n <li key={inputId}>\n <a href={`#${inputId}`} onClick={handleLinkClick}>\n {fieldMessage}\n {messages.length > 1 ? ` (${index + 1} of ${messages.length})` : undefined}\n </a>\n </li>\n );\n })}\n </React.Fragment>\n );\n })}\n </ul>\n </bds-error-summary>\n );\n}\n"],"names":["FormErrorKey","FINAL_FORM_ERROR","BdsErrorSummary","_ref","className","errors","_ref$mapNameToId","mapNameToId","name","props","_objectWithoutProperties","_excluded","headingId","React","useId","groupRef","useRef","useEffect","Object","keys","length","current","focus","handleLinkClick","e","inputId","getFragmentFromUrl","currentTarget","href","input","document","getElementById","legendOrLabel","getAssociatedLegendOrLabel","preventDefault","scrollIntoView","preventScroll","createElement","_extends","filter","x","join","role","ref","tabIndex","id","xmlns","viewBox","height","width","fill","d","map","errorKey","message","isFormError","includes","key","dangerouslySetInnerHTML","__html","isArrayField","Array","isArray","messages","Fragment","fieldMessage","index","concat","onClick","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorSummary.js","sources":["../../src/ErrorSummary/ErrorSummary.js"],"sourcesContent":["import * as React from 'react';\n\nimport { getAssociatedLegendOrLabel, getFragmentFromUrl } from './utils';\n\nexport const FormErrorKey = '_form';\n\nconst FINAL_FORM_ERROR = 'FINAL_FORM/form-error';\n\nexport default function BdsErrorSummary({ className, errors, mapNameToId = (name) => name, ...props }) {\n const headingId = React.useId();\n const groupRef = React.useRef(null);\n\n React.useEffect(() => {\n if (!errors || Object.keys(errors).length === 0) return;\n if (!groupRef.current) return;\n\n groupRef.current.focus();\n }, [errors]);\n\n if (!errors || Object.keys(errors).length === 0) return null;\n\n const handleLinkClick = (e) => {\n const inputId = getFragmentFromUrl(e.currentTarget.href);\n\n if (!inputId) {\n return;\n }\n\n const input = document.getElementById(inputId);\n\n if (!input) {\n return;\n }\n\n const legendOrLabel = getAssociatedLegendOrLabel(input);\n\n if (!legendOrLabel) {\n return;\n }\n\n e.preventDefault();\n\n legendOrLabel.scrollIntoView();\n input.focus({ preventScroll: true });\n };\n\n return (\n <bds-error-summary\n className={['stack', className].filter((x) => x).join(' ')}\n role=\"group\"\n aria-labelledby={headingId}\n ref={groupRef}\n tabIndex={-1}\n {...props}\n >\n <h2 className=\"bds-h5\" id={headingId}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n Issue\n </h2>\n <ul>\n {Object.keys(errors).map((errorKey) => {\n const message = errors[errorKey];\n const isFormError = [FINAL_FORM_ERROR, FormErrorKey].includes(errorKey);\n\n if (isFormError) {\n return <li key={errorKey} dangerouslySetInnerHTML={{ __html: message }} />;\n }\n\n const isArrayField = Array.isArray(message);\n\n const messages = isArrayField ? message : [message];\n\n return (\n <React.Fragment key={errorKey}>\n {messages.map((fieldMessage, index) => {\n const inputId = `${mapNameToId(errorKey)}${isArrayField ? `[${index}]` : ''}`;\n\n return (\n <li key={inputId}>\n <a href={`#${inputId}`} onClick={handleLinkClick}>\n {fieldMessage}\n {messages.length > 1 ? ` (${index + 1} of ${messages.length})` : undefined}\n </a>\n </li>\n );\n })}\n </React.Fragment>\n );\n })}\n </ul>\n </bds-error-summary>\n );\n}\n"],"names":["FormErrorKey","FINAL_FORM_ERROR","BdsErrorSummary","_ref","className","errors","_ref$mapNameToId","mapNameToId","name","props","_objectWithoutProperties","_excluded","headingId","React","useId","groupRef","useRef","useEffect","Object","keys","length","current","focus","handleLinkClick","e","inputId","getFragmentFromUrl","currentTarget","href","input","document","getElementById","legendOrLabel","getAssociatedLegendOrLabel","preventDefault","scrollIntoView","preventScroll","createElement","_extends","filter","x","join","role","ref","tabIndex","id","xmlns","viewBox","height","width","fill","d","map","errorKey","message","isFormError","includes","key","dangerouslySetInnerHTML","__html","isArrayField","Array","isArray","messages","Fragment","fieldMessage","index","concat","onClick","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,IAAMA,YAAY,GAAG,QAAO;AAEnC,IAAMC,gBAAgB,GAAG,uBAAuB,CAAA;AAEjC,SAASC,eAAeA,CAAAC,IAAA,EAAgE;AAAA,EAAA,IAA7DC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAAC,gBAAA,GAAAH,IAAA,CAAEI,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,UAACE,IAAI,EAAA;AAAA,MAAA,OAAKA,IAAI,CAAA;AAAA,KAAA,GAAAF,gBAAA;AAAKG,IAAAA,KAAK,GAAAC,kDAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;AACjG,EAAA,IAAMC,SAAS,GAAGC,gBAAK,CAACC,KAAK,EAAE,CAAA;AAC/B,EAAA,IAAMC,QAAQ,GAAGF,gBAAK,CAACG,MAAM,CAAC,IAAI,CAAC,CAAA;EAEnCH,gBAAK,CAACI,SAAS,CAAC,YAAM;AACpB,IAAA,IAAI,CAACZ,MAAM,IAAIa,MAAM,CAACC,IAAI,CAACd,MAAM,CAAC,CAACe,MAAM,KAAK,CAAC,EAAE,OAAA;AACjD,IAAA,IAAI,CAACL,QAAQ,CAACM,OAAO,EAAE,OAAA;AAEvBN,IAAAA,QAAQ,CAACM,OAAO,CAACC,KAAK,EAAE,CAAA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AACxB,gBAAK,CAACmD,QAAQ,EAAA;AAACP,MAAAA,GAAG,EAAEJ,QAAAA;KAClBU,EAAAA,QAAQ,CAACX,GAAG,CAAC,UAACa,YAAY,EAAEC,KAAK,EAAK;AACrC,MAAA,IAAMzC,OAAO,GAAA0C,EAAAA,CAAAA,MAAA,CAAM5D,WAAW,CAAC8C,QAAQ,CAAC,CAAA,CAAAc,MAAA,CAAGP,YAAY,GAAAO,GAAAA,CAAAA,MAAA,CAAOD,KAAK,EAAA,GAAA,CAAA,GAAM,EAAE,CAAE,CAAA;MAE7E,oBACErD,gBAAA,CAAAwB,aAAA,CAAA,IAAA,EAAA;AAAIoB,QAAAA,GAAG,EAAEhC,OAAAA;OACPZ,eAAAA,gBAAA,CAAAwB,aAAA,CAAA,GAAA,EAAA;AAAGT,QAAAA,IAAI,EAAAuC,GAAAA,CAAAA,MAAA,CAAM1C,OAAO,CAAG;AAAC2C,QAAAA,OAAO,EAAE7C,eAAAA;OAC9B0C,EAAAA,YAAY,EACZF,QAAQ,CAAC3C,MAAM,GAAG,CAAC,GAAA+C,IAAAA,CAAAA,MAAA,CAAQD,KAAK,GAAG,CAAC,EAAA,MAAA,CAAA,CAAAC,MAAA,CAAOJ,QAAQ,CAAC3C,MAAM,EAAA,GAAA,CAAA,GAAMiD,SAChE,CACD,CAAC,CAAA;AAET,KAAC,CACa,CAAC,CAAA;GAEpB,CACC,CACa,CAAC,CAAA;AAExB;;;;;"}
|
package/ErrorSummary/index.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var ErrorSummary_ErrorSummary = require('./ErrorSummary.js');
|
|
6
|
+
require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
7
|
+
require('react');
|
|
8
|
+
require('./utils.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.FormErrorKey = ErrorSummary_ErrorSummary.FormErrorKey;
|
|
13
|
+
exports.default = ErrorSummary_ErrorSummary.default;
|
|
5
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/ErrorSummary/utils.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
1
3
|
function getFragmentFromUrl(url) {
|
|
2
4
|
return url.includes('#') ? url.split('#').pop() : undefined;
|
|
3
5
|
}
|
|
@@ -37,5 +39,6 @@ function getAssociatedLegendOrLabel(input) {
|
|
|
37
39
|
return (_document$querySelect = document.querySelector("label[for='".concat(input.getAttribute('id'), "']"))) !== null && _document$querySelect !== void 0 ? _document$querySelect : input.closest('label');
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
exports.getAssociatedLegendOrLabel = getAssociatedLegendOrLabel;
|
|
43
|
+
exports.getFragmentFromUrl = getFragmentFromUrl;
|
|
41
44
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/ErrorSummary/utils.js"],"sourcesContent":["export function getFragmentFromUrl(url) {\n return url.includes('#') ? url.split('#').pop() : undefined;\n}\n\nexport function getAssociatedLegendOrLabel(input) {\n const fieldset = input.closest('fieldset');\n\n if (fieldset) {\n const legends = fieldset.getElementsByTagName('legend');\n\n if (legends.length) {\n const candidateLegend = legends[0];\n\n // If the input type is radio or checkbox, always use the legend if there\n // is one.\n if (input instanceof HTMLInputElement && (input.type === 'checkbox' || input.type === 'radio')) {\n return candidateLegend;\n }\n\n // For other input types, only scroll to the fieldset’s legend (instead of\n // the label associated with the input) if the input would end up in the\n // top half of the screen.\n //\n // This should avoid situations where the input either ends up off the\n // screen, or obscured by a software keyboard.\n const legendTop = candidateLegend.getBoundingClientRect().top;\n const inputRect = input.getBoundingClientRect();\n\n // If the browser doesn't support Element.getBoundingClientRect().height\n // or window.innerHeight (like IE8), bail and just link to the label.\n if (inputRect.height && window.innerHeight) {\n const inputBottom = inputRect.top + inputRect.height;\n\n if (inputBottom - legendTop < window.innerHeight / 2) {\n return candidateLegend;\n }\n }\n }\n }\n\n return document.querySelector(`label[for='${input.getAttribute('id')}']`) ?? input.closest('label');\n}\n"],"names":["getFragmentFromUrl","url","includes","split","pop","undefined","getAssociatedLegendOrLabel","input","_document$querySelect","fieldset","closest","legends","getElementsByTagName","length","candidateLegend","HTMLInputElement","type","legendTop","getBoundingClientRect","top","inputRect","height","window","innerHeight","inputBottom","document","querySelector","concat","getAttribute"],"mappings":"AAAO,SAASA,kBAAkBA,CAACC,GAAG,EAAE;AACtC,EAAA,OAAOA,GAAG,CAACC,QAAQ,CAAC,GAAG,CAAC,GAAGD,GAAG,CAACE,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE,GAAGC,SAAS,CAAA;AAC7D,CAAA;AAEO,SAASC,0BAA0BA,CAACC,KAAK,EAAE;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAChD,EAAA,IAAMC,QAAQ,GAAGF,KAAK,CAACG,OAAO,CAAC,UAAU,CAAC,CAAA;AAE1C,EAAA,IAAID,QAAQ,EAAE;AACZ,IAAA,IAAME,OAAO,GAAGF,QAAQ,CAACG,oBAAoB,CAAC,QAAQ,CAAC,CAAA;IAEvD,IAAID,OAAO,CAACE,MAAM,EAAE;AAClB,MAAA,IAAMC,eAAe,GAAGH,OAAO,CAAC,CAAC,CAAC,CAAA;;AAElC;AACA;AACA,MAAA,IAAIJ,KAAK,YAAYQ,gBAAgB,KAAKR,KAAK,CAACS,IAAI,KAAK,UAAU,IAAIT,KAAK,CAACS,IAAI,KAAK,OAAO,CAAC,EAAE;AAC9F,QAAA,OAAOF,eAAe,CAAA;AACxB,OAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;MACA,IAAMG,SAAS,GAAGH,eAAe,CAACI,qBAAqB,EAAE,CAACC,GAAG,CAAA;AAC7D,MAAA,IAAMC,SAAS,GAAGb,KAAK,CAACW,qBAAqB,EAAE,CAAA;;AAE/C;AACA;AACA,MAAA,IAAIE,SAAS,CAACC,MAAM,IAAIC,MAAM,CAACC,WAAW,EAAE;QAC1C,IAAMC,WAAW,GAAGJ,SAAS,CAACD,GAAG,GAAGC,SAAS,CAACC,MAAM,CAAA;QAEpD,IAAIG,WAAW,GAAGP,SAAS,GAAGK,MAAM,CAACC,WAAW,GAAG,CAAC,EAAE;AACpD,UAAA,OAAOT,eAAe,CAAA;AACxB,SAAA;AACF,OAAA;AACF,KAAA;AACF,GAAA;EAEA,OAAAN,CAAAA,qBAAA,GAAOiB,QAAQ,CAACC,aAAa,CAAAC,aAAAA,CAAAA,MAAA,CAAepB,KAAK,CAACqB,YAAY,CAAC,IAAI,CAAC,EAAI,IAAA,CAAA,CAAC,MAAApB,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,GAAAA,qBAAA,GAAID,KAAK,CAACG,OAAO,CAAC,OAAO,CAAC,CAAA;AACrG
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/ErrorSummary/utils.js"],"sourcesContent":["export function getFragmentFromUrl(url) {\n return url.includes('#') ? url.split('#').pop() : undefined;\n}\n\nexport function getAssociatedLegendOrLabel(input) {\n const fieldset = input.closest('fieldset');\n\n if (fieldset) {\n const legends = fieldset.getElementsByTagName('legend');\n\n if (legends.length) {\n const candidateLegend = legends[0];\n\n // If the input type is radio or checkbox, always use the legend if there\n // is one.\n if (input instanceof HTMLInputElement && (input.type === 'checkbox' || input.type === 'radio')) {\n return candidateLegend;\n }\n\n // For other input types, only scroll to the fieldset’s legend (instead of\n // the label associated with the input) if the input would end up in the\n // top half of the screen.\n //\n // This should avoid situations where the input either ends up off the\n // screen, or obscured by a software keyboard.\n const legendTop = candidateLegend.getBoundingClientRect().top;\n const inputRect = input.getBoundingClientRect();\n\n // If the browser doesn't support Element.getBoundingClientRect().height\n // or window.innerHeight (like IE8), bail and just link to the label.\n if (inputRect.height && window.innerHeight) {\n const inputBottom = inputRect.top + inputRect.height;\n\n if (inputBottom - legendTop < window.innerHeight / 2) {\n return candidateLegend;\n }\n }\n }\n }\n\n return document.querySelector(`label[for='${input.getAttribute('id')}']`) ?? input.closest('label');\n}\n"],"names":["getFragmentFromUrl","url","includes","split","pop","undefined","getAssociatedLegendOrLabel","input","_document$querySelect","fieldset","closest","legends","getElementsByTagName","length","candidateLegend","HTMLInputElement","type","legendTop","getBoundingClientRect","top","inputRect","height","window","innerHeight","inputBottom","document","querySelector","concat","getAttribute"],"mappings":";;AAAO,SAASA,kBAAkBA,CAACC,GAAG,EAAE;AACtC,EAAA,OAAOA,GAAG,CAACC,QAAQ,CAAC,GAAG,CAAC,GAAGD,GAAG,CAACE,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE,GAAGC,SAAS,CAAA;AAC7D,CAAA;AAEO,SAASC,0BAA0BA,CAACC,KAAK,EAAE;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAChD,EAAA,IAAMC,QAAQ,GAAGF,KAAK,CAACG,OAAO,CAAC,UAAU,CAAC,CAAA;AAE1C,EAAA,IAAID,QAAQ,EAAE;AACZ,IAAA,IAAME,OAAO,GAAGF,QAAQ,CAACG,oBAAoB,CAAC,QAAQ,CAAC,CAAA;IAEvD,IAAID,OAAO,CAACE,MAAM,EAAE;AAClB,MAAA,IAAMC,eAAe,GAAGH,OAAO,CAAC,CAAC,CAAC,CAAA;;AAElC;AACA;AACA,MAAA,IAAIJ,KAAK,YAAYQ,gBAAgB,KAAKR,KAAK,CAACS,IAAI,KAAK,UAAU,IAAIT,KAAK,CAACS,IAAI,KAAK,OAAO,CAAC,EAAE;AAC9F,QAAA,OAAOF,eAAe,CAAA;AACxB,OAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;MACA,IAAMG,SAAS,GAAGH,eAAe,CAACI,qBAAqB,EAAE,CAACC,GAAG,CAAA;AAC7D,MAAA,IAAMC,SAAS,GAAGb,KAAK,CAACW,qBAAqB,EAAE,CAAA;;AAE/C;AACA;AACA,MAAA,IAAIE,SAAS,CAACC,MAAM,IAAIC,MAAM,CAACC,WAAW,EAAE;QAC1C,IAAMC,WAAW,GAAGJ,SAAS,CAACD,GAAG,GAAGC,SAAS,CAACC,MAAM,CAAA;QAEpD,IAAIG,WAAW,GAAGP,SAAS,GAAGK,MAAM,CAACC,WAAW,GAAG,CAAC,EAAE;AACpD,UAAA,OAAOT,eAAe,CAAA;AACxB,SAAA;AACF,OAAA;AACF,KAAA;AACF,GAAA;EAEA,OAAAN,CAAAA,qBAAA,GAAOiB,QAAQ,CAACC,aAAa,CAAAC,aAAAA,CAAAA,MAAA,CAAepB,KAAK,CAACqB,YAAY,CAAC,IAAI,CAAC,EAAI,IAAA,CAAA,CAAC,MAAApB,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,GAAAA,qBAAA,GAAID,KAAK,CAACG,OAAO,CAAC,OAAO,CAAC,CAAA;AACrG;;;;;"}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _rollupPluginBabelHelpers = require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
3
24
|
|
|
4
25
|
var _excluded = ["as", "error", "hint", "id", "isOptional", "label"];
|
|
5
26
|
function FieldTextInput(_ref) {
|
|
@@ -11,31 +32,31 @@ function FieldTextInput(_ref) {
|
|
|
11
32
|
_ref$isOptional = _ref.isOptional,
|
|
12
33
|
isOptional = _ref$isOptional === void 0 ? false : _ref$isOptional,
|
|
13
34
|
label = _ref.label,
|
|
14
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
props = _rollupPluginBabelHelpers._objectWithoutProperties(_ref, _excluded);
|
|
15
36
|
id = (_id = id) !== null && _id !== void 0 ? _id : props.name;
|
|
16
|
-
var errorId =
|
|
17
|
-
var hintId =
|
|
37
|
+
var errorId = React__namespace.useId();
|
|
38
|
+
var hintId = React__namespace.useId();
|
|
18
39
|
var InputComponent = as !== null && as !== void 0 ? as : 'input';
|
|
19
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
20
41
|
className: "bds-text-input stack"
|
|
21
|
-
}, /*#__PURE__*/
|
|
42
|
+
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
22
43
|
htmlFor: id
|
|
23
|
-
}, label, isOptional && ' (optional)'), hint && /*#__PURE__*/
|
|
44
|
+
}, label, isOptional && ' (optional)'), hint && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24
45
|
className: "bds-hint",
|
|
25
46
|
id: hintId
|
|
26
|
-
}, hint), error && /*#__PURE__*/
|
|
47
|
+
}, hint), error && /*#__PURE__*/React__namespace.createElement("span", {
|
|
27
48
|
className: "bds-error",
|
|
28
49
|
id: errorId
|
|
29
|
-
}, /*#__PURE__*/
|
|
50
|
+
}, /*#__PURE__*/React__namespace.createElement("svg", {
|
|
30
51
|
xmlns: "http://www.w3.org/2000/svg",
|
|
31
52
|
viewBox: "0 0 512 512",
|
|
32
53
|
"aria-hidden": "true",
|
|
33
54
|
height: "1em",
|
|
34
55
|
width: "1em",
|
|
35
56
|
fill: "currentColor"
|
|
36
|
-
}, /*#__PURE__*/
|
|
57
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
37
58
|
d: "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z"
|
|
38
|
-
})), error), /*#__PURE__*/
|
|
59
|
+
})), error), /*#__PURE__*/React__namespace.createElement(InputComponent, _rollupPluginBabelHelpers._extends({
|
|
39
60
|
"aria-invalid": error ? true : undefined,
|
|
40
61
|
"aria-describedby": error && hint ? "".concat(hintId, " ").concat(errorId) : error ? errorId : hint ? hintId : undefined,
|
|
41
62
|
"aria-required": isOptional ? undefined : true,
|
|
@@ -43,5 +64,5 @@ function FieldTextInput(_ref) {
|
|
|
43
64
|
}, props)));
|
|
44
65
|
}
|
|
45
66
|
|
|
46
|
-
|
|
67
|
+
module.exports = FieldTextInput;
|
|
47
68
|
//# sourceMappingURL=FieldTextInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTextInput.js","sources":["../../src/FieldTextInput/FieldTextInput.js"],"sourcesContent":["import * as React from 'react';\n\nexport default function FieldTextInput({ as, error, hint, id, isOptional = false, label, ...props }) {\n id = id ?? props.name;\n\n const errorId = React.useId();\n const hintId = React.useId();\n\n const InputComponent = as ?? 'input';\n\n return (\n <div className=\"bds-text-input stack\">\n <label htmlFor={id}>\n {label}\n {isOptional && ' (optional)'}\n </label>\n {hint && (\n <span className=\"bds-hint\" id={hintId}>\n {hint}\n </span>\n )}\n {error && (\n <span className=\"bds-error\" id={errorId}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n {error}\n </span>\n )}\n <InputComponent\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n aria-required={isOptional ? undefined : true}\n id={id}\n {...props}\n />\n </div>\n );\n}\n"],"names":["FieldTextInput","_ref","_id","as","error","hint","id","_ref$isOptional","isOptional","label","props","_objectWithoutProperties","_excluded","name","errorId","React","useId","hintId","InputComponent","createElement","className","htmlFor","xmlns","viewBox","height","width","fill","d","_extends","undefined","concat"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FieldTextInput.js","sources":["../../src/FieldTextInput/FieldTextInput.js"],"sourcesContent":["import * as React from 'react';\n\nexport default function FieldTextInput({ as, error, hint, id, isOptional = false, label, ...props }) {\n id = id ?? props.name;\n\n const errorId = React.useId();\n const hintId = React.useId();\n\n const InputComponent = as ?? 'input';\n\n return (\n <div className=\"bds-text-input stack\">\n <label htmlFor={id}>\n {label}\n {isOptional && ' (optional)'}\n </label>\n {hint && (\n <span className=\"bds-hint\" id={hintId}>\n {hint}\n </span>\n )}\n {error && (\n <span className=\"bds-error\" id={errorId}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n {error}\n </span>\n )}\n <InputComponent\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n aria-required={isOptional ? undefined : true}\n id={id}\n {...props}\n />\n </div>\n );\n}\n"],"names":["FieldTextInput","_ref","_id","as","error","hint","id","_ref$isOptional","isOptional","label","props","_objectWithoutProperties","_excluded","name","errorId","React","useId","hintId","InputComponent","createElement","className","htmlFor","xmlns","viewBox","height","width","fill","d","_extends","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEe,SAASA,cAAcA,CAAAC,IAAA,EAA+D;AAAA,EAAA,IAAAC,GAAA,CAAA;AAAA,EAAA,IAA5DC,EAAE,GAAAF,IAAA,CAAFE,EAAE;IAAEC,KAAK,GAAAH,IAAA,CAALG,KAAK;IAAEC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IAAEC,EAAE,GAAAL,IAAA,CAAFK,EAAE;IAAAC,eAAA,GAAAN,IAAA,CAAEO,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;IAAEE,KAAK,GAAAR,IAAA,CAALQ,KAAK;AAAKC,IAAAA,KAAK,GAAAC,kDAAA,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AC,EAAC,4UAAA;AAA4U,GAAE,CACnV,CAAC,EACLvB,KACG,CACP,eACDW,gBAAA,CAAAI,aAAA,CAACD,cAAc,EAAAU,kCAAA,CAAA;AACb,IAAA,cAAA,EAAcxB,KAAK,GAAG,IAAI,GAAGyB,SAAU;IACvC,kBAAkBzB,EAAAA,KAAK,IAAIC,IAAI,GAAA,EAAA,CAAAyB,MAAA,CAAMb,MAAM,OAAAa,MAAA,CAAIhB,OAAO,CAAKV,GAAAA,KAAK,GAAGU,OAAO,GAAGT,IAAI,GAAGY,MAAM,GAAGY,SAAU;AACvG,IAAA,eAAA,EAAerB,UAAU,GAAGqB,SAAS,GAAG,IAAK;AAC7CvB,IAAAA,EAAE,EAAEA,EAAAA;GACAI,EAAAA,KAAK,CACV,CACE,CAAC,CAAA;AAEV;;;;"}
|
package/FieldTextInput/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var FieldTextInput_FieldTextInput = require('./FieldTextInput.js');
|
|
4
|
+
require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
5
|
+
require('react');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
module.exports = FieldTextInput_FieldTextInput;
|
|
4
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/Pagination/Pagination.js
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _rollupPluginBabelHelpers = require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
3
24
|
|
|
4
25
|
var _excluded = ["buildPageUrl", "className", "currentPage", "onPageClick", "totalPages"];
|
|
5
26
|
function usePages(currentPage, totalPages) {
|
|
6
27
|
var pages = [1, currentPage - 1, currentPage, currentPage + 1, totalPages].filter(function (x) {
|
|
7
28
|
return x >= 1 && x <= totalPages;
|
|
8
29
|
});
|
|
9
|
-
return _toConsumableArray(new Set(pages));
|
|
30
|
+
return _rollupPluginBabelHelpers._toConsumableArray(new Set(pages));
|
|
10
31
|
}
|
|
11
32
|
function Pagination(_ref) {
|
|
12
33
|
var buildPageUrl = _ref.buildPageUrl,
|
|
@@ -14,80 +35,80 @@ function Pagination(_ref) {
|
|
|
14
35
|
currentPage = _ref.currentPage,
|
|
15
36
|
onPageClick = _ref.onPageClick,
|
|
16
37
|
totalPages = _ref.totalPages,
|
|
17
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
props = _rollupPluginBabelHelpers._objectWithoutProperties(_ref, _excluded);
|
|
18
39
|
var pages = usePages(currentPage, totalPages);
|
|
19
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/React__namespace.createElement("nav", _rollupPluginBabelHelpers._extends({
|
|
20
41
|
"aria-label": "pagination",
|
|
21
42
|
className: ['bds-pagination', className].filter(function (x) {
|
|
22
43
|
return x;
|
|
23
44
|
}).join(' ')
|
|
24
|
-
}, props), currentPage !== 1 && /*#__PURE__*/
|
|
45
|
+
}, props), currentPage !== 1 && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("a", {
|
|
25
46
|
href: buildPageUrl(1),
|
|
26
47
|
className: "bds-first-page"
|
|
27
|
-
}, /*#__PURE__*/
|
|
48
|
+
}, /*#__PURE__*/React__namespace.createElement("svg", {
|
|
28
49
|
xmlns: "http://www.w3.org/2000/svg",
|
|
29
50
|
"aria-hidden": "true",
|
|
30
51
|
focusable: "false",
|
|
31
52
|
height: "1em",
|
|
32
53
|
width: "100%",
|
|
33
54
|
viewBox: "0 63.95 512 384.1"
|
|
34
|
-
}, /*#__PURE__*/
|
|
55
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
35
56
|
d: "M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3v83.4l171.5 142.9zM256 352V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29v-64z"
|
|
36
|
-
})), "First"), /*#__PURE__*/
|
|
57
|
+
})), "First"), /*#__PURE__*/React__namespace.createElement("a", {
|
|
37
58
|
"aria-label": "previous",
|
|
38
59
|
href: buildPageUrl(currentPage - 1),
|
|
39
60
|
rel: "prev"
|
|
40
|
-
}, /*#__PURE__*/
|
|
61
|
+
}, /*#__PURE__*/React__namespace.createElement("svg", {
|
|
41
62
|
xmlns: "http://www.w3.org/2000/svg",
|
|
42
63
|
"aria-hidden": "true",
|
|
43
64
|
focusable: "false",
|
|
44
65
|
width: "100%",
|
|
45
66
|
height: "1em",
|
|
46
67
|
viewBox: "0.02 95.9 192.08 320.17"
|
|
47
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
48
69
|
d: "M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6v256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"
|
|
49
|
-
})), "Prev.")), /*#__PURE__*/
|
|
70
|
+
})), "Prev.")), /*#__PURE__*/React__namespace.createElement("ul", null, pages.map(function (page, index) {
|
|
50
71
|
var handlePageClick = function handlePageClick() {
|
|
51
72
|
if (!onPageClick) return;
|
|
52
73
|
onPageClick(page);
|
|
53
74
|
};
|
|
54
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, {
|
|
55
76
|
key: page
|
|
56
|
-
}, /*#__PURE__*/
|
|
77
|
+
}, /*#__PURE__*/React__namespace.createElement("li", null, /*#__PURE__*/React__namespace.createElement("a", {
|
|
57
78
|
"aria-current": page === currentPage ? 'page' : undefined,
|
|
58
79
|
href: buildPageUrl(page),
|
|
59
80
|
onClick: handlePageClick
|
|
60
|
-
}, /*#__PURE__*/
|
|
81
|
+
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
61
82
|
className: "visually-hidden"
|
|
62
|
-
}, "Page"), " ", page)), pages[index + 1] > page + 1 ? /*#__PURE__*/
|
|
83
|
+
}, "Page"), " ", page)), pages[index + 1] > page + 1 ? /*#__PURE__*/React__namespace.createElement("li", {
|
|
63
84
|
"data-overflow": ""
|
|
64
85
|
}, "...") : null);
|
|
65
|
-
})), currentPage !== totalPages && /*#__PURE__*/
|
|
86
|
+
})), currentPage !== totalPages && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("a", {
|
|
66
87
|
href: buildPageUrl(currentPage + 1),
|
|
67
88
|
rel: "next"
|
|
68
|
-
}, "Next", /*#__PURE__*/
|
|
89
|
+
}, "Next", /*#__PURE__*/React__namespace.createElement("svg", {
|
|
69
90
|
xmlns: "http://www.w3.org/2000/svg",
|
|
70
91
|
"aria-hidden": "true",
|
|
71
92
|
focusable: "false",
|
|
72
93
|
viewBox: "63.9 95.9 192.1 320.17",
|
|
73
94
|
width: "100%",
|
|
74
95
|
height: "1em"
|
|
75
|
-
}, /*#__PURE__*/
|
|
96
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
76
97
|
d: "M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9S63.9 115 63.9 128v256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"
|
|
77
|
-
}))), /*#__PURE__*/
|
|
98
|
+
}))), /*#__PURE__*/React__namespace.createElement("a", {
|
|
78
99
|
href: buildPageUrl(totalPages),
|
|
79
100
|
className: "bds-last-page"
|
|
80
|
-
}, "Last", /*#__PURE__*/
|
|
101
|
+
}, "Last", /*#__PURE__*/React__namespace.createElement("svg", {
|
|
81
102
|
xmlns: "http://www.w3.org/2000/svg",
|
|
82
103
|
"aria-hidden": "true",
|
|
83
104
|
focusable: "false",
|
|
84
105
|
width: "100%",
|
|
85
106
|
height: "1em",
|
|
86
107
|
viewBox: "0 63.95 512 384.1"
|
|
87
|
-
}, /*#__PURE__*/
|
|
108
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
88
109
|
d: "M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4L224 214.3v83.4L52.5 440.6zM256 352V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4S256 428.4 256 416v-64z"
|
|
89
110
|
})))));
|
|
90
111
|
}
|
|
91
112
|
|
|
92
|
-
|
|
113
|
+
module.exports = Pagination;
|
|
93
114
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../src/Pagination/Pagination.js"],"sourcesContent":["import * as React from 'react';\n\nfunction usePages(currentPage, totalPages) {\n const pages = [1, currentPage - 1, currentPage, currentPage + 1, totalPages].filter(\n (x) => x >= 1 && x <= totalPages,\n );\n return [...new Set(pages)];\n}\n\nexport default function Pagination({ buildPageUrl, className, currentPage, onPageClick, totalPages, ...props }) {\n const pages = usePages(currentPage, totalPages);\n\n return (\n <nav aria-label=\"pagination\" className={['bds-pagination', className].filter((x) => x).join(' ')} {...props}>\n {currentPage !== 1 && (\n <>\n <a href={buildPageUrl(1)} className=\"bds-first-page\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n height=\"1em\"\n width=\"100%\"\n viewBox=\"0 63.95 512 384.1\"\n >\n <path d=\"M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3v83.4l171.5 142.9zM256 352V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29v-64z\" />\n </svg>\n First\n </a>\n <a aria-label=\"previous\" href={buildPageUrl(currentPage - 1)} rel=\"prev\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n width=\"100%\"\n height=\"1em\"\n viewBox=\"0.02 95.9 192.08 320.17\"\n >\n <path d=\"M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6v256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z\" />\n </svg>\n Prev.\n </a>\n </>\n )}\n <ul>\n {pages.map((page, index) => {\n const handlePageClick = () => {\n if (!onPageClick) return;\n\n onPageClick(page);\n };\n\n return (\n <React.Fragment key={page}>\n <li>\n <a\n aria-current={page === currentPage ? 'page' : undefined}\n href={buildPageUrl(page)}\n onClick={handlePageClick}\n >\n <span className=\"visually-hidden\">Page</span> {page}\n </a>\n </li>\n {pages[index + 1] > page + 1 ? <li data-overflow=\"\">...</li> : null}\n </React.Fragment>\n );\n })}\n </ul>\n {currentPage !== totalPages && (\n <>\n <a href={buildPageUrl(currentPage + 1)} rel=\"next\">\n Next\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"63.9 95.9 192.1 320.17\"\n width=\"100%\"\n height=\"1em\"\n >\n <path d=\"M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9S63.9 115 63.9 128v256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z\" />\n </svg>\n </a>\n <a href={buildPageUrl(totalPages)} className=\"bds-last-page\">\n Last\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n width=\"100%\"\n height=\"1em\"\n viewBox=\"0 63.95 512 384.1\"\n >\n <path d=\"M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4L224 214.3v83.4L52.5 440.6zM256 352V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4S256 428.4 256 416v-64z\" />\n </svg>\n </a>\n </>\n )}\n </nav>\n );\n}\n"],"names":["usePages","currentPage","totalPages","pages","filter","x","_toConsumableArray","Set","Pagination","_ref","buildPageUrl","className","onPageClick","props","_objectWithoutProperties","_excluded","React","createElement","_extends","join","Fragment","href","xmlns","focusable","height","width","viewBox","d","rel","map","page","index","handlePageClick","key","undefined","onClick"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../src/Pagination/Pagination.js"],"sourcesContent":["import * as React from 'react';\n\nfunction usePages(currentPage, totalPages) {\n const pages = [1, currentPage - 1, currentPage, currentPage + 1, totalPages].filter(\n (x) => x >= 1 && x <= totalPages,\n );\n return [...new Set(pages)];\n}\n\nexport default function Pagination({ buildPageUrl, className, currentPage, onPageClick, totalPages, ...props }) {\n const pages = usePages(currentPage, totalPages);\n\n return (\n <nav aria-label=\"pagination\" className={['bds-pagination', className].filter((x) => x).join(' ')} {...props}>\n {currentPage !== 1 && (\n <>\n <a href={buildPageUrl(1)} className=\"bds-first-page\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n height=\"1em\"\n width=\"100%\"\n viewBox=\"0 63.95 512 384.1\"\n >\n <path d=\"M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3v83.4l171.5 142.9zM256 352V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29v-64z\" />\n </svg>\n First\n </a>\n <a aria-label=\"previous\" href={buildPageUrl(currentPage - 1)} rel=\"prev\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n width=\"100%\"\n height=\"1em\"\n viewBox=\"0.02 95.9 192.08 320.17\"\n >\n <path d=\"M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6v256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z\" />\n </svg>\n Prev.\n </a>\n </>\n )}\n <ul>\n {pages.map((page, index) => {\n const handlePageClick = () => {\n if (!onPageClick) return;\n\n onPageClick(page);\n };\n\n return (\n <React.Fragment key={page}>\n <li>\n <a\n aria-current={page === currentPage ? 'page' : undefined}\n href={buildPageUrl(page)}\n onClick={handlePageClick}\n >\n <span className=\"visually-hidden\">Page</span> {page}\n </a>\n </li>\n {pages[index + 1] > page + 1 ? <li data-overflow=\"\">...</li> : null}\n </React.Fragment>\n );\n })}\n </ul>\n {currentPage !== totalPages && (\n <>\n <a href={buildPageUrl(currentPage + 1)} rel=\"next\">\n Next\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"63.9 95.9 192.1 320.17\"\n width=\"100%\"\n height=\"1em\"\n >\n <path d=\"M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9S63.9 115 63.9 128v256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z\" />\n </svg>\n </a>\n <a href={buildPageUrl(totalPages)} className=\"bds-last-page\">\n Last\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n width=\"100%\"\n height=\"1em\"\n viewBox=\"0 63.95 512 384.1\"\n >\n <path d=\"M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4L224 214.3v83.4L52.5 440.6zM256 352V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4S256 428.4 256 416v-64z\" />\n </svg>\n </a>\n </>\n )}\n </nav>\n );\n}\n"],"names":["usePages","currentPage","totalPages","pages","filter","x","_toConsumableArray","Set","Pagination","_ref","buildPageUrl","className","onPageClick","props","_objectWithoutProperties","_excluded","React","createElement","_extends","join","Fragment","href","xmlns","focusable","height","width","viewBox","d","rel","map","page","index","handlePageClick","key","undefined","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAASA,QAAQA,CAACC,WAAW,EAAEC,UAAU,EAAE;EACzC,IAAMC,KAAK,GAAG,CAAC,CAAC,EAAEF,WAAW,GAAG,CAAC,EAAEA,WAAW,EAAEA,WAAW,GAAG,CAAC,EAAEC,UAAU,CAAC,CAACE,MAAM,CACjF,UAACC,CAAC,EAAA;AAAA,IAAA,OAAKA,CAAC,IAAI,CAAC,IAAIA,CAAC,IAAIH,UAAU,CAAA;AAAA,GAClC,CAAC,CAAA;AACD,EAAA,OAAAI,4CAAA,CAAW,IAAIC,GAAG,CAACJ,KAAK,CAAC,CAAA,CAAA;AAC3B,CAAA;AAEe,SAASK,UAAUA,CAAAC,IAAA,EAA8E;AAAA,EAAA,IAA3EC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEV,WAAW,GAAAQ,IAAA,CAAXR,WAAW;IAAEW,WAAW,GAAAH,IAAA,CAAXG,WAAW;IAAEV,UAAU,GAAAO,IAAA,CAAVP,UAAU;AAAKW,IAAAA,KAAK,GAAAC,kDAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA,CAAA;AAC1G,EAAA,IAAMZ,KAAK,GAAGH,QAAQ,CAACC,WAAW,EAAEC,UAAU,CAAC,CAAA;AAE/C,EAAA,oBACEc,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,kCAAA,CAAA;AAAK,IAAA,YAAA,EAAW,YAAY;IAACP,SAAS,EAAE,CAAC,gBAAgB,EAAEA,SAAS,CAAC,CAACP,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAK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AAAA,GAAG,EAAC,MAAA;AAAM,GAAA,EAAC,MAEjD,eAAAZ,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEK,IAAAA,KAAK,EAAC,4BAA4B;AAClC,IAAA,aAAA,EAAY,MAAM;AAClBC,IAAAA,SAAS,EAAC,OAAO;AACjBG,IAAAA,OAAO,EAAC,wBAAwB;AAChCD,IAAAA,KAAK,EAAC,MAAM;AACZD,IAAAA,MAAM,EAAC,KAAA;GAEPR,eAAAA,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC,yJAAA;AAAyJ,GAAE,CAChK,CACJ,CAAC,eACJX,gBAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;AAAGI,IAAAA,IAAI,EAAEX,YAAY,CAACR,UAAU,CAAE;AAACS,IAAAA,SAAS,EAAC,eAAA;AAAe,GAAA,EAAC,MAE3D,eAAAK,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEK,IAAAA,KAAK,EAAC,4BAA4B;AAClC,IAAA,aAAA,EAAY,MAAM;AAClBC,IAAAA,SAAS,EAAC,OAAO;AACjBE,IAAAA,KAAK,EAAC,MAAM;AACZD,IAAAA,MAAM,EAAC,KAAK;AACZE,IAAAA,OAAO,EAAC,mBAAA;GAERV,eAAAA,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC,sSAAA;AAAsS,GAAE,CAC7S,CACJ,CACH,CAED,CAAC,CAAA;AAEV;;;;"}
|
package/Pagination/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Pagination_Pagination = require('./Pagination.js');
|
|
4
|
+
require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
5
|
+
require('react');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
module.exports = Pagination_Pagination;
|
|
4
10
|
//# sourceMappingURL=index.js.map
|
package/Pagination/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/Typography/Typography.js
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _rollupPluginBabelHelpers = require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
3
24
|
|
|
4
25
|
var _excluded = ["className", "component", "variant"];
|
|
5
26
|
var componentMap = {
|
|
@@ -18,14 +39,14 @@ var classMap = {
|
|
|
18
39
|
h5: 'bds-h5',
|
|
19
40
|
body: 'bds-body'
|
|
20
41
|
};
|
|
21
|
-
var Typography = /*#__PURE__*/
|
|
42
|
+
var Typography = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
22
43
|
var className = _ref.className,
|
|
23
44
|
component = _ref.component,
|
|
24
45
|
_ref$variant = _ref.variant,
|
|
25
46
|
variant = _ref$variant === void 0 ? 'body' : _ref$variant,
|
|
26
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
+
props = _rollupPluginBabelHelpers._objectWithoutProperties(_ref, _excluded);
|
|
27
48
|
var Component = component !== null && component !== void 0 ? component : componentMap[variant];
|
|
28
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/React__namespace.createElement(Component, _rollupPluginBabelHelpers._extends({
|
|
29
50
|
className: [classMap[variant], className].filter(function (x) {
|
|
30
51
|
return x;
|
|
31
52
|
}).join(' '),
|
|
@@ -33,5 +54,5 @@ var Typography = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
33
54
|
}, props));
|
|
34
55
|
});
|
|
35
56
|
|
|
36
|
-
|
|
57
|
+
module.exports = Typography;
|
|
37
58
|
//# sourceMappingURL=Typography.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","sources":["../../src/Typography/Typography.js"],"sourcesContent":["import * as React from 'react';\n\nconst componentMap = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n body: 'p',\n};\n\nconst classMap = {\n h1: 'bds-h1',\n h2: 'bds-h2',\n h3: 'bds-h3',\n h4: 'bds-h4',\n h5: 'bds-h5',\n body: 'bds-body',\n};\n\nconst Typography = React.forwardRef(({ className, component, variant = 'body', ...props }, ref) => {\n const Component = component ?? componentMap[variant];\n return <Component className={[classMap[variant], className].filter((x) => x).join(' ')} ref={ref} {...props} />;\n});\n\nexport default Typography;\n"],"names":["componentMap","h1","h2","h3","h4","h5","body","classMap","Typography","React","forwardRef","_ref","ref","className","component","_ref$variant","variant","props","_objectWithoutProperties","_excluded","Component","createElement","_extends","filter","x","join"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Typography.js","sources":["../../src/Typography/Typography.js"],"sourcesContent":["import * as React from 'react';\n\nconst componentMap = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n body: 'p',\n};\n\nconst classMap = {\n h1: 'bds-h1',\n h2: 'bds-h2',\n h3: 'bds-h3',\n h4: 'bds-h4',\n h5: 'bds-h5',\n body: 'bds-body',\n};\n\nconst Typography = React.forwardRef(({ className, component, variant = 'body', ...props }, ref) => {\n const Component = component ?? componentMap[variant];\n return <Component className={[classMap[variant], className].filter((x) => x).join(' ')} ref={ref} {...props} />;\n});\n\nexport default Typography;\n"],"names":["componentMap","h1","h2","h3","h4","h5","body","classMap","Typography","React","forwardRef","_ref","ref","className","component","_ref$variant","variant","props","_objectWithoutProperties","_excluded","Component","createElement","_extends","filter","x","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,YAAY,GAAG;AACnBC,EAAAA,EAAE,EAAE,IAAI;AACRC,EAAAA,EAAE,EAAE,IAAI;AACRC,EAAAA,EAAE,EAAE,IAAI;AACRC,EAAAA,EAAE,EAAE,IAAI;AACRC,EAAAA,EAAE,EAAE,IAAI;AACRC,EAAAA,IAAI,EAAE,GAAA;AACR,CAAC,CAAA;AAED,IAAMC,QAAQ,GAAG;AACfN,EAAAA,EAAE,EAAE,QAAQ;AACZC,EAAAA,EAAE,EAAE,QAAQ;AACZC,EAAAA,EAAE,EAAE,QAAQ;AACZC,EAAAA,EAAE,EAAE,QAAQ;AACZC,EAAAA,EAAE,EAAE,QAAQ;AACZC,EAAAA,IAAI,EAAE,UAAA;AACR,CAAC,CAAA;AAEKE,IAAAA,UAAU,gBAAGC,gBAAK,CAACC,UAAU,CAAC,UAAAC,IAAA,EAAuDC,GAAG,EAAK;AAAA,EAAA,IAA5DC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;IAAAC,YAAA,GAAAJ,IAAA,CAAEK,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,YAAA;AAAKE,IAAAA,KAAK,GAAAC,kDAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;EACrF,IAAMC,SAAS,GAAGN,SAAS,KAATA,IAAAA,IAAAA,SAAS,KAATA,KAAAA,CAAAA,GAAAA,SAAS,GAAId,YAAY,CAACgB,OAAO,CAAC,CAAA;AACpD,EAAA,oBAAOP,gBAAA,CAAAY,aAAA,CAACD,SAAS,EAAAE,kCAAA,CAAA;AAACT,IAAAA,SAAS,EAAE,CAACN,QAAQ,CAACS,OAAO,CAAC,EAAEH,SAAS,CAAC,CAACU,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC,CAAA;AAAA,KAAA,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;AAACb,IAAAA,GAAG,EAAEA,GAAAA;GAASK,EAAAA,KAAK,CAAG,CAAC,CAAA;AACjH,CAAC;;;;"}
|
package/Typography/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Typography_Typography = require('./Typography.js');
|
|
4
|
+
require('../_rollupPluginBabelHelpers-28932a37.js');
|
|
5
|
+
require('react');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
module.exports = Typography_Typography;
|
|
4
10
|
//# sourceMappingURL=index.js.map
|
package/Typography/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
1
3
|
function _extends() {
|
|
2
4
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
3
5
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -65,5 +67,7 @@ function _nonIterableSpread() {
|
|
|
65
67
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
exports._extends = _extends;
|
|
71
|
+
exports._objectWithoutProperties = _objectWithoutProperties;
|
|
72
|
+
exports._toConsumableArray = _toConsumableArray;
|
|
73
|
+
//# sourceMappingURL=_rollupPluginBabelHelpers-28932a37.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_rollupPluginBabelHelpers-28932a37.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Button_Button = require('./Button/Button.js');
|
|
4
|
+
var CallToAction_CallToAction = require('./CallToAction/CallToAction.js');
|
|
5
|
+
var ErrorSummary_ErrorSummary = require('./ErrorSummary/ErrorSummary.js');
|
|
6
|
+
var FieldTextInput_FieldTextInput = require('./FieldTextInput/FieldTextInput.js');
|
|
7
|
+
var Pagination_Pagination = require('./Pagination/Pagination.js');
|
|
8
|
+
var Typography_Typography = require('./Typography/Typography.js');
|
|
9
|
+
require('./_rollupPluginBabelHelpers-28932a37.js');
|
|
10
|
+
require('react');
|
|
11
|
+
require('./ErrorSummary/utils.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.Button = Button_Button;
|
|
16
|
+
exports.CallToAction = CallToAction_CallToAction;
|
|
17
|
+
exports.ErrorSummary = ErrorSummary_ErrorSummary.default;
|
|
18
|
+
exports.FieldTextInput = FieldTextInput_FieldTextInput;
|
|
19
|
+
exports.Pagination = Pagination_Pagination;
|
|
20
|
+
exports.Typography = Typography_Typography;
|
|
10
21
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers-9e645d4a.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|