@splunk/react-ui 4.21.0 → 4.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/Accordion.js +425 -325
  2. package/Anchor.js +147 -117
  3. package/Animation.js +142 -94
  4. package/AnimationToggle.js +197 -193
  5. package/Box.js +145 -118
  6. package/Breadcrumbs.js +288 -206
  7. package/Button.js +488 -465
  8. package/ButtonGroup.js +160 -128
  9. package/ButtonSimple.js +543 -462
  10. package/CHANGELOG.md +24 -3
  11. package/Calendar.js +1111 -1001
  12. package/Card.js +771 -598
  13. package/CardLayout.js +205 -147
  14. package/Chip.js +509 -488
  15. package/Clickable.js +414 -352
  16. package/CloseButton.js +165 -142
  17. package/Code.js +1807 -2084
  18. package/CollapsiblePanel.js +586 -519
  19. package/Color.js +1068 -1068
  20. package/ColumnLayout.js +402 -363
  21. package/ComboBox.js +903 -794
  22. package/Concertina.js +997 -802
  23. package/ControlGroup.js +687 -594
  24. package/Date.js +567 -547
  25. package/DefinitionList.js +308 -234
  26. package/Divider.js +149 -118
  27. package/Dropdown.js +459 -416
  28. package/DualListbox.js +1479 -1541
  29. package/EventListener.js +94 -97
  30. package/File.js +1051 -969
  31. package/FormRows.js +883 -696
  32. package/Heading.js +216 -193
  33. package/Image.js +446 -402
  34. package/JSONTree.js +690 -551
  35. package/Layer.js +437 -410
  36. package/Link.js +336 -255
  37. package/List.js +213 -161
  38. package/Markdown.js +509 -487
  39. package/Menu.js +1104 -1056
  40. package/Message.js +475 -441
  41. package/MessageBar.js +387 -373
  42. package/Modal.js +810 -634
  43. package/ModalLayer.js +326 -243
  44. package/Monogram.js +308 -276
  45. package/Multiselect.js +3564 -3364
  46. package/Number.js +729 -687
  47. package/Paginator.js +510 -449
  48. package/Paragraph.js +145 -112
  49. package/Popover.js +1459 -1432
  50. package/Progress.js +301 -246
  51. package/RadioBar.js +634 -527
  52. package/RadioList.js +483 -444
  53. package/Resize.js +530 -489
  54. package/ResultsMenu.js +479 -455
  55. package/ScreenReaderContent.js +142 -111
  56. package/Scroll.js +595 -456
  57. package/ScrollContainerContext.js +197 -206
  58. package/Search.js +756 -650
  59. package/Select.js +2446 -2345
  60. package/SidePanel.js +390 -284
  61. package/Slider.js +680 -676
  62. package/SlidingPanels.js +639 -503
  63. package/SplitButton.js +464 -367
  64. package/StaticContent.js +161 -133
  65. package/StepBar.js +386 -358
  66. package/Switch.js +710 -640
  67. package/TabBar.js +741 -680
  68. package/TabLayout.js +406 -322
  69. package/Table.js +4974 -4616
  70. package/Text.js +1170 -1138
  71. package/TextArea.js +1102 -1090
  72. package/Tooltip.js +624 -581
  73. package/TransitionOpen.js +489 -422
  74. package/Typography.js +176 -153
  75. package/WaitSpinner.js +230 -206
  76. package/package.json +7 -7
  77. package/types/src/Color/Color.d.ts +0 -1
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/types/src/RadioBar/RadioBar.d.ts +1 -0
  81. package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
  82. package/types/src/Select/docs/examples/Icons.d.ts +1 -9
  83. package/types/src/Slider/Slider.d.ts +1 -0
  84. package/types/src/TabBar/Tab.d.ts +10 -1
  85. package/types/src/TabBar/TabBar.d.ts +4 -2
  86. package/types/src/Table/Head.d.ts +7 -3
  87. package/types/src/Table/Table.d.ts +3 -2
  88. package/types/src/Table/TableContext.d.ts +2 -0
  89. package/useForceUpdate.js +112 -82
  90. package/useKeyPress.js +74 -71
  91. package/usePrevious.js +65 -65
  92. package/useRovingFocus.js +122 -138
package/Progress.js CHANGED
@@ -1,249 +1,304 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/compat get default export */
8
- /******/ (() => {
9
- /******/ // getDefaultExport function for compatibility with non-harmony modules
10
- /******/ __webpack_require__.n = (module) => {
11
- /******/ var getter = module && module.__esModule ?
12
- /******/ () => (module['default']) :
13
- /******/ () => (module);
14
- /******/ __webpack_require__.d(getter, { a: getter });
15
- /******/ return getter;
16
- /******/ };
17
- /******/ })();
18
- /******/
19
- /******/ /* webpack/runtime/define property getters */
20
- /******/ (() => {
21
- /******/ // define getter functions for harmony exports
22
- /******/ __webpack_require__.d = (exports, definition) => {
23
- /******/ for(var key in definition) {
24
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
- /******/ }
27
- /******/ }
28
- /******/ };
29
- /******/ })();
30
- /******/
31
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
32
- /******/ (() => {
33
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34
- /******/ })();
35
- /******/
36
- /******/ /* webpack/runtime/make namespace object */
37
- /******/ (() => {
38
- /******/ // define __esModule on exports
39
- /******/ __webpack_require__.r = (exports) => {
40
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42
- /******/ }
43
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
44
- /******/ };
45
- /******/ })();
46
- /******/
47
- /************************************************************************/
48
- var __webpack_exports__ = {};
49
- // ESM COMPAT FLAG
50
- __webpack_require__.r(__webpack_exports__);
51
-
52
- // EXPORTS
53
- __webpack_require__.d(__webpack_exports__, {
54
- "default": () => (/* reexport */ Progress_Progress)
55
- });
56
-
57
- ;// CONCATENATED MODULE: external "react"
58
- const external_react_namespaceObject = require("react");
59
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
60
- ;// CONCATENATED MODULE: external "prop-types"
61
- const external_prop_types_namespaceObject = require("prop-types");
62
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
63
- ;// CONCATENATED MODULE: external "lodash/isNumber"
64
- const isNumber_namespaceObject = require("lodash/isNumber");
65
- var isNumber_default = /*#__PURE__*/__webpack_require__.n(isNumber_namespaceObject);
66
- ;// CONCATENATED MODULE: external "@splunk/react-ui/AnimationToggle"
67
- const AnimationToggle_namespaceObject = require("@splunk/react-ui/AnimationToggle");
68
- ;// CONCATENATED MODULE: external "styled-components"
69
- const external_styled_components_namespaceObject = require("styled-components");
70
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
71
- ;// CONCATENATED MODULE: external "tinycolor2"
72
- const external_tinycolor2_namespaceObject = require("tinycolor2");
73
- var external_tinycolor2_default = /*#__PURE__*/__webpack_require__.n(external_tinycolor2_namespaceObject);
74
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
75
- const Tooltip_namespaceObject = require("@splunk/react-ui/Tooltip");
76
- var Tooltip_default = /*#__PURE__*/__webpack_require__.n(Tooltip_namespaceObject);
77
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Box"
78
- const Box_namespaceObject = require("@splunk/react-ui/Box");
79
- var Box_default = /*#__PURE__*/__webpack_require__.n(Box_namespaceObject);
80
- ;// CONCATENATED MODULE: external "@splunk/themes"
81
- const themes_namespaceObject = require("@splunk/themes");
82
- ;// CONCATENATED MODULE: ./src/Progress/ProgressStyles.ts
83
-
84
-
85
-
86
-
87
-
88
- var StyledBox = external_styled_components_default()((Box_default())).withConfig({
89
- displayName: "ProgressStyles__StyledBox",
90
- componentId: "csowex-0"
91
- })(["background-color:", ";"], (0,themes_namespaceObject.pick)({
92
- enterprise: themes_namespaceObject.variables.transparent,
93
- prisma: themes_namespaceObject.variables.neutral200
94
- }));
95
- var StyledTooltip = external_styled_components_default()((Tooltip_default())).withConfig({
96
- displayName: "ProgressStyles__StyledTooltip",
97
- componentId: "csowex-1"
98
- })(["background-color:", ";height:", ";position:relative;overflow:hidden;padding-left:", ";", ";"], (0,themes_namespaceObject.pick)({
99
- enterprise: themes_namespaceObject.variables.accentColorD10,
100
- prisma: (0,themes_namespaceObject.pickVariant)('$type', {
101
- info: themes_namespaceObject.variables.interactiveColorPrimary,
102
- success: themes_namespaceObject.variables.accentColorPositive,
103
- warning: themes_namespaceObject.variables.accentColorWarning,
104
- error: themes_namespaceObject.variables.accentColorNegative
105
- })
106
- }), (0,themes_namespaceObject.pick)({
107
- enterprise: '3px',
108
- prisma: '4px'
109
- }), (0,themes_namespaceObject.pick)({
110
- enterprise: themes_namespaceObject.variables.spacingHalf,
111
- prisma: '10px'
112
- }), function (_ref) {
113
- var $animated = _ref.$animated;
114
- return $animated && (0,external_styled_components_namespaceObject.css)(["transition:width 300ms;"]);
115
- });
116
- var pulse = (0,external_styled_components_namespaceObject.keyframes)(["from{opacity:0;}to{opacity:1;}"]);
117
- var slide = (0,external_styled_components_namespaceObject.keyframes)(["from{background-position:130%;}to{background-position:-30%;}"]);
118
- var StyledPuck = external_styled_components_default().div.withConfig({
119
- displayName: "ProgressStyles__StyledPuck",
120
- componentId: "csowex-2"
121
- })(["height:", ";width:", ";position:absolute;right:0;top:0;background:", ";", ""], (0,themes_namespaceObject.pick)({
122
- enterprise: '3px',
123
- prisma: '4px'
124
- }), (0,themes_namespaceObject.pick)({
125
- enterprise: '300px',
126
- prisma: '100%'
127
- }), (0,themes_namespaceObject.pick)({
128
- enterprise: (0,external_styled_components_namespaceObject.css)(["linear-gradient( 90deg,", ",", ",40%,", ",80%,", " )"], themes_namespaceObject.variables.accentColorD10, themes_namespaceObject.variables.accentColorL10, themes_namespaceObject.variables.accentColorL40, themes_namespaceObject.variables.accentColorL40),
129
- prisma: function prisma(_ref2) {
130
- var $animated = _ref2.$animated;
131
- var primaryColor = (0,themes_namespaceObject.pickVariant)('$type', {
132
- info: themes_namespaceObject.variables.interactiveColorPrimary,
133
- success: themes_namespaceObject.variables.accentColorPositive,
134
- warning: themes_namespaceObject.variables.accentColorWarning,
135
- error: themes_namespaceObject.variables.accentColorNegative
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = r => {
12
+ /******/ var t = r && r.__esModule ?
13
+ /******/ () => r["default"]
14
+ /******/ : () => r
15
+ /******/;
16
+ e.d(t, {
17
+ a: t
18
+ });
19
+ /******/ return t;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (r, t) => {
27
+ /******/ for (var a in t) {
28
+ /******/ if (e.o(t, a) && !e.o(r, a)) {
29
+ /******/ Object.defineProperty(r, a, {
30
+ enumerable: true,
31
+ get: t[a]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ e.r = e => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(e, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var r = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(r);
62
+ // EXPORTS
63
+ e.d(r, {
64
+ default: () => /* reexport */ M
136
65
  });
137
-
138
- if ($animated) {
139
- var highlightColor = (0,themes_namespaceObject.pickVariant)('$type', {
140
- info: themes_namespaceObject.variables.statusColorInfo,
141
- success: themes_namespaceObject.variables.statusColorNormal,
142
- warning: themes_namespaceObject.variables.statusColorMedium,
143
- error: themes_namespaceObject.variables.statusColorHigh
144
- });
145
- return (0,external_styled_components_namespaceObject.css)(["radial-gradient(circle at center,", ",", " 30%);"], highlightColor, primaryColor);
66
+ // CONCATENATED MODULE: external "react"
67
+ const t = require("react");
68
+ var a = e.n(t);
69
+ // CONCATENATED MODULE: external "prop-types"
70
+ const n = require("prop-types");
71
+ var i = e.n(n);
72
+ // CONCATENATED MODULE: external "lodash/isNumber"
73
+ const o = require("lodash/isNumber");
74
+ var s = e.n(o);
75
+ // CONCATENATED MODULE: external "@splunk/react-ui/AnimationToggle"
76
+ const c = require("@splunk/react-ui/AnimationToggle");
77
+ // CONCATENATED MODULE: external "styled-components"
78
+ const l = require("styled-components");
79
+ var u = e.n(l);
80
+ // CONCATENATED MODULE: external "tinycolor2"
81
+ const p = require("tinycolor2");
82
+ var f = e.n(p);
83
+ // CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
84
+ const v = require("@splunk/react-ui/Tooltip");
85
+ var b = e.n(v);
86
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
87
+ const d = require("@splunk/react-ui/Box");
88
+ var m = e.n(d);
89
+ // CONCATENATED MODULE: external "@splunk/themes"
90
+ const y = require("@splunk/themes");
91
+ // CONCATENATED MODULE: ./src/Progress/ProgressStyles.ts
92
+ var g = u()(m()).withConfig({
93
+ displayName: "ProgressStyles__StyledBox",
94
+ componentId: "csowex-0"
95
+ })([ "background-color:", ";" ], (0, y.pick)({
96
+ enterprise: y.variables.transparent,
97
+ prisma: y.variables.neutral200
98
+ }));
99
+ var h = u()(b()).withConfig({
100
+ displayName: "ProgressStyles__StyledTooltip",
101
+ componentId: "csowex-1"
102
+ })([ "background-color:", ";height:", ";position:relative;overflow:hidden;padding-left:", ";", ";" ], (0,
103
+ y.pick)({
104
+ enterprise: y.variables.accentColorD10,
105
+ prisma: (0, y.pickVariant)("$type", {
106
+ info: y.variables.interactiveColorPrimary,
107
+ success: y.variables.accentColorPositive,
108
+ warning: y.variables.accentColorWarning,
109
+ error: y.variables.accentColorNegative
110
+ })
111
+ }), (0, y.pick)({
112
+ enterprise: "3px",
113
+ prisma: "4px"
114
+ }), (0, y.pick)({
115
+ enterprise: y.variables.spacingHalf,
116
+ prisma: "10px"
117
+ }), (function(e) {
118
+ var r = e.$animated;
119
+ return r && (0, l.css)([ "transition:width 300ms;" ]);
120
+ }));
121
+ var k = (0, l.keyframes)([ "from{opacity:0;}to{opacity:1;}" ]);
122
+ var C = (0, l.keyframes)([ "from{background-position:130%;}to{background-position:-30%;}" ]);
123
+ var w = u().div.withConfig({
124
+ displayName: "ProgressStyles__StyledPuck",
125
+ componentId: "csowex-2"
126
+ })([ "height:", ";width:", ";position:absolute;right:0;top:0;background:", ";", "" ], (0,
127
+ y.pick)({
128
+ enterprise: "3px",
129
+ prisma: "4px"
130
+ }), (0, y.pick)({
131
+ enterprise: "300px",
132
+ prisma: "100%"
133
+ }), (0, y.pick)({
134
+ enterprise: (0, l.css)([ "linear-gradient( 90deg,", ",", ",40%,", ",80%,", " )" ], y.variables.accentColorD10, y.variables.accentColorL10, y.variables.accentColorL40, y.variables.accentColorL40),
135
+ prisma: function e(r) {
136
+ var t = r.$animated;
137
+ var a = (0, y.pickVariant)("$type", {
138
+ info: y.variables.interactiveColorPrimary,
139
+ success: y.variables.accentColorPositive,
140
+ warning: y.variables.accentColorWarning,
141
+ error: y.variables.accentColorNegative
142
+ });
143
+ if (t) {
144
+ var n = (0, y.pickVariant)("$type", {
145
+ info: y.variables.statusColorInfo,
146
+ success: y.variables.statusColorNormal,
147
+ warning: y.variables.statusColorMedium,
148
+ error: y.variables.statusColorHigh
149
+ });
150
+ return (0, l.css)([ "radial-gradient(circle at center,", ",", " 30%);" ], n, a);
151
+ }
152
+ return a;
153
+ }
154
+ }), (function(e) {
155
+ return e.$animated && (0, y.pick)({
156
+ enterprise: (0, l.css)([ "animation-duration:1500ms;animation-name:", ";animation-iteration-count:infinite;animation-direction:alternate;" ], k),
157
+ prisma: function r() {
158
+ var t = (0, y.pickVariant)("$type", {
159
+ info: y.variables.statusColorInfo,
160
+ success: y.variables.statusColorNormal,
161
+ warning: y.variables.statusColorMedium,
162
+ error: y.variables.statusColorHigh
163
+ })(e);
164
+ return (0, l.css)([ "background-size:200% 100%;animation:", " 1500ms infinite cubic-bezier(0.33,0,0.67,1);&::after{content:'';display:block;width:60px;background:linear-gradient( to right,rgba(255,255,255,0),", " 70%,rgba(255,255,255,0.75) );height:100%;position:absolute;right:0;}" ], C, f()(t(e)).setAlpha(.75).toRgbString());
165
+ }
166
+ });
167
+ }));
168
+ // CONCATENATED MODULE: ./src/Progress/Progress.tsx
169
+ function O() {
170
+ O = Object.assign || function(e) {
171
+ for (var r = 1; r < arguments.length; r++) {
172
+ var t = arguments[r];
173
+ for (var a in t) {
174
+ if (Object.prototype.hasOwnProperty.call(t, a)) {
175
+ e[a] = t[a];
176
+ }
177
+ }
178
+ }
179
+ return e;
180
+ };
181
+ return O.apply(this, arguments);
146
182
  }
147
-
148
- return primaryColor;
149
- }
150
- }), function (props) {
151
- return props.$animated && (0,themes_namespaceObject.pick)({
152
- enterprise: (0,external_styled_components_namespaceObject.css)(["animation-duration:1500ms;animation-name:", ";animation-iteration-count:infinite;animation-direction:alternate;"], pulse),
153
- prisma: function prisma() {
154
- var accentColor = (0,themes_namespaceObject.pickVariant)('$type', {
155
- info: themes_namespaceObject.variables.statusColorInfo,
156
- success: themes_namespaceObject.variables.statusColorNormal,
157
- warning: themes_namespaceObject.variables.statusColorMedium,
158
- error: themes_namespaceObject.variables.statusColorHigh
159
- })(props);
160
- return (0,external_styled_components_namespaceObject.css)(["background-size:200% 100%;animation:", " 1500ms infinite cubic-bezier(0.33,0,0.67,1);&::after{content:'';display:block;width:60px;background:linear-gradient( to right,rgba(255,255,255,0),", " 70%,rgba(255,255,255,0.75) );height:100%;position:absolute;right:0;}"], slide, external_tinycolor2_default()(accentColor(props)).setAlpha(0.75).toRgbString());
183
+ function S(e, r) {
184
+ return _(e) || $(e, r) || j(e, r) || x();
161
185
  }
162
- });
163
- });
164
-
165
- ;// CONCATENATED MODULE: ./src/Progress/Progress.tsx
166
- 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); }
167
-
168
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
169
-
170
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
171
-
172
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
173
-
174
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
175
-
176
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
177
-
178
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
179
-
180
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
181
-
182
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
183
-
184
-
185
-
186
-
187
-
188
-
189
- var propTypes = {
190
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
191
- percentage: (external_prop_types_default()).number,
192
- tooltip: (external_prop_types_default()).node,
193
- type: external_prop_types_default().oneOf(['info', 'success', 'warning', 'error'])
194
- };
195
-
196
- function Progress(_ref) {
197
- var percentage = _ref.percentage,
198
- tooltip = _ref.tooltip,
199
- _ref$type = _ref.type,
200
- type = _ref$type === void 0 ? 'info' : _ref$type,
201
- otherProps = _objectWithoutProperties(_ref, ["percentage", "tooltip", "type"]);
202
-
203
- // @docs-props-type ProgressPropsBase
204
- if (false) {}
205
-
206
- var _useState = (0,external_react_namespaceObject.useState)(false),
207
- _useState2 = _slicedToArray(_useState, 2),
208
- tooltipOpen = _useState2[0],
209
- setTooltipOpen = _useState2[1];
210
-
211
- var animated = (0,AnimationToggle_namespaceObject.useAnimationToggle)() === 'on';
212
- var handleMouseEnter = (0,external_react_namespaceObject.useCallback)(function () {
213
- setTooltipOpen(true);
214
- }, []);
215
- var handleMouseLeave = (0,external_react_namespaceObject.useCallback)(function () {
216
- setTooltipOpen(false);
217
- }, []);
218
- var content = tooltip || "".concat(percentage, "%");
219
- return /*#__PURE__*/external_react_default().createElement(StyledBox, _extends({
220
- $animated: animated,
221
- "data-test": "progress",
222
- onMouseEnter: handleMouseEnter,
223
- onMouseLeave: handleMouseLeave
224
- }, otherProps), isNumber_default()(percentage) && /*#__PURE__*/external_react_default().createElement(StyledTooltip, {
225
- inline: false,
226
- open: tooltipOpen,
227
- content: content,
228
- style: {
229
- width: "".concat(percentage, "%")
230
- },
231
- role: "progressbar",
232
- "aria-valuenow": percentage,
233
- "aria-valuemin": 0,
234
- "aria-valuemax": 100,
235
- $animated: animated,
236
- $type: type
237
- }, /*#__PURE__*/external_react_default().createElement(StyledPuck, {
238
- $animated: animated,
239
- $type: type
240
- })));
241
- }
242
-
243
- Progress.propTypes = propTypes;
244
- /* harmony default export */ const Progress_Progress = (Progress);
245
- ;// CONCATENATED MODULE: ./src/Progress/index.ts
246
-
247
- module.exports = __webpack_exports__;
248
- /******/ })()
249
- ;
186
+ function x() {
187
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
188
+ }
189
+ function j(e, r) {
190
+ if (!e) return;
191
+ if (typeof e === "string") return P(e, r);
192
+ var t = Object.prototype.toString.call(e).slice(8, -1);
193
+ if (t === "Object" && e.constructor) t = e.constructor.name;
194
+ if (t === "Map" || t === "Set") return Array.from(e);
195
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return P(e, r);
196
+ }
197
+ function P(e, r) {
198
+ if (r == null || r > e.length) r = e.length;
199
+ for (var t = 0, a = new Array(r); t < r; t++) {
200
+ a[t] = e[t];
201
+ }
202
+ return a;
203
+ }
204
+ function $(e, r) {
205
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
206
+ var t = [];
207
+ var a = true;
208
+ var n = false;
209
+ var i = undefined;
210
+ try {
211
+ for (var o = e[Symbol.iterator](), s; !(a = (s = o.next()).done); a = true) {
212
+ t.push(s.value);
213
+ if (r && t.length === r) break;
214
+ }
215
+ } catch (e) {
216
+ n = true;
217
+ i = e;
218
+ } finally {
219
+ try {
220
+ if (!a && o["return"] != null) o["return"]();
221
+ } finally {
222
+ if (n) throw i;
223
+ }
224
+ }
225
+ return t;
226
+ }
227
+ function _(e) {
228
+ if (Array.isArray(e)) return e;
229
+ }
230
+ function q(e, r) {
231
+ if (e == null) return {};
232
+ var t = A(e, r);
233
+ var a, n;
234
+ if (Object.getOwnPropertySymbols) {
235
+ var i = Object.getOwnPropertySymbols(e);
236
+ for (n = 0; n < i.length; n++) {
237
+ a = i[n];
238
+ if (r.indexOf(a) >= 0) continue;
239
+ if (!Object.prototype.propertyIsEnumerable.call(e, a)) continue;
240
+ t[a] = e[a];
241
+ }
242
+ }
243
+ return t;
244
+ }
245
+ function A(e, r) {
246
+ if (e == null) return {};
247
+ var t = {};
248
+ var a = Object.keys(e);
249
+ var n, i;
250
+ for (i = 0; i < a.length; i++) {
251
+ n = a[i];
252
+ if (r.indexOf(n) >= 0) continue;
253
+ t[n] = e[n];
254
+ }
255
+ return t;
256
+ }
257
+ var I = {
258
+ elementRef: i().oneOfType([ i().func, i().object ]),
259
+ percentage: i().number,
260
+ tooltip: i().node,
261
+ type: i().oneOf([ "info", "success", "warning", "error" ])
262
+ };
263
+ function T(e) {
264
+ var r = e.percentage, n = e.tooltip, i = e.type, o = i === void 0 ? "info" : i, l = q(e, [ "percentage", "tooltip", "type" ]);
265
+ // @docs-props-type ProgressPropsBase
266
+ if (false) {}
267
+ var u = (0, t.useState)(false), p = S(u, 2), f = p[0], v = p[1];
268
+ var b = (0, c.useAnimationToggle)() === "on";
269
+ var d = (0, t.useCallback)((function() {
270
+ v(true);
271
+ }), []);
272
+ var m = (0, t.useCallback)((function() {
273
+ v(false);
274
+ }), []);
275
+ var y = n || "".concat(r, "%");
276
+
277
+ return a().createElement(g, O({
278
+ $animated: b,
279
+ "data-test": "progress",
280
+ onMouseEnter: d,
281
+ onMouseLeave: m
282
+ }, l), s()(r) && a().createElement(h, {
283
+ inline: false,
284
+ open: f,
285
+ content: y,
286
+ style: {
287
+ width: "".concat(r, "%")
288
+ },
289
+ role: "progressbar",
290
+ "aria-valuenow": r,
291
+ "aria-valuemin": 0,
292
+ "aria-valuemax": 100,
293
+ $animated: b,
294
+ $type: o
295
+ }, a().createElement(w, {
296
+ $animated: b,
297
+ $type: o
298
+ })));
299
+ }
300
+ T.propTypes = I;
301
+ /* harmony default export */ const M = T;
302
+ // CONCATENATED MODULE: ./src/Progress/index.ts
303
+ module.exports = r;
304
+ /******/})();