@splunk/react-ui 4.21.0 → 4.21.1

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 (83) 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 +7 -2
  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 +1808 -2084
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -519
  20. package/Color.js +1066 -1069
  21. package/ColumnLayout.js +402 -363
  22. package/ComboBox.js +891 -794
  23. package/Concertina.js +997 -802
  24. package/ControlGroup.js +687 -594
  25. package/Date.js +567 -547
  26. package/DefinitionList.js +308 -234
  27. package/Divider.js +149 -118
  28. package/Dropdown.js +459 -416
  29. package/DualListbox.js +1479 -1541
  30. package/EventListener.js +94 -97
  31. package/File.js +1051 -969
  32. package/FormRows.js +883 -696
  33. package/Heading.js +216 -193
  34. package/Image.js +446 -402
  35. package/JSONTree.js +690 -551
  36. package/Layer.js +437 -410
  37. package/Link.js +336 -255
  38. package/List.js +213 -161
  39. package/Markdown.js +509 -487
  40. package/Menu.js +1105 -1056
  41. package/Message.js +475 -441
  42. package/MessageBar.js +387 -373
  43. package/Modal.js +810 -634
  44. package/ModalLayer.js +326 -243
  45. package/Monogram.js +308 -276
  46. package/Multiselect.js +3550 -3364
  47. package/Number.js +729 -687
  48. package/Paginator.js +510 -449
  49. package/Paragraph.js +145 -112
  50. package/Popover.js +1459 -1432
  51. package/Progress.js +301 -246
  52. package/RadioBar.js +610 -527
  53. package/RadioList.js +483 -444
  54. package/Resize.js +530 -489
  55. package/ResultsMenu.js +494 -455
  56. package/ScreenReaderContent.js +142 -111
  57. package/Scroll.js +595 -456
  58. package/ScrollContainerContext.js +197 -206
  59. package/Search.js +744 -650
  60. package/Select.js +2442 -2345
  61. package/SidePanel.js +390 -284
  62. package/Slider.js +669 -676
  63. package/SlidingPanels.js +639 -503
  64. package/SplitButton.js +464 -367
  65. package/StaticContent.js +161 -133
  66. package/StepBar.js +386 -358
  67. package/Switch.js +710 -640
  68. package/TabBar.js +726 -680
  69. package/TabLayout.js +406 -322
  70. package/Table.js +4842 -4616
  71. package/Text.js +1170 -1138
  72. package/TextArea.js +1102 -1090
  73. package/Tooltip.js +624 -581
  74. package/TransitionOpen.js +489 -422
  75. package/Typography.js +176 -153
  76. package/WaitSpinner.js +230 -206
  77. package/package.json +5 -5
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/useForceUpdate.js +112 -82
  81. package/useKeyPress.js +74 -71
  82. package/usePrevious.js +65 -65
  83. package/useRovingFocus.js +122 -138
package/ColumnLayout.js CHANGED
@@ -1,368 +1,407 @@
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
- Column: () => (/* reexport */ ColumnLayout_Column),
55
- Row: () => (/* reexport */ ColumnLayout_Row),
56
- "default": () => (/* reexport */ ColumnLayout_ColumnLayout)
57
- });
58
-
59
- ;// CONCATENATED MODULE: external "react"
60
- const external_react_namespaceObject = require("react");
61
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
62
- ;// CONCATENATED MODULE: external "prop-types"
63
- const external_prop_types_namespaceObject = require("prop-types");
64
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
65
- ;// CONCATENATED MODULE: external "@splunk/themes/useSplunkTheme"
66
- const useSplunkTheme_namespaceObject = require("@splunk/themes/useSplunkTheme");
67
- var useSplunkTheme_default = /*#__PURE__*/__webpack_require__.n(useSplunkTheme_namespaceObject);
68
- ;// CONCATENATED MODULE: external "lodash/defaults"
69
- const defaults_namespaceObject = require("lodash/defaults");
70
- var defaults_default = /*#__PURE__*/__webpack_require__.n(defaults_namespaceObject);
71
- ;// CONCATENATED MODULE: external "styled-components"
72
- const external_styled_components_namespaceObject = require("styled-components");
73
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
74
- ;// CONCATENATED MODULE: external "@splunk/themes"
75
- const themes_namespaceObject = require("@splunk/themes");
76
- ;// CONCATENATED MODULE: ./src/ColumnLayout/ColumnStyles.ts
77
-
78
-
79
- var Styled = external_styled_components_default().div.withConfig({
80
- displayName: "ColumnStyles__Styled",
81
- componentId: "sc-1pchz98-0"
82
- })(["", ";"], themes_namespaceObject.mixins.reset('block'));
83
-
84
- ;// CONCATENATED MODULE: ./src/utils/types.ts
85
- // see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31245 for details
86
- // regarding the css prop. certain (versions of) libraries included in the compilation
87
- // - such as storybook->emotion - introduce the css prop using a global augmentation,
88
- // which causes the prop to end up in our declaration files (via JSX.IntrinsicElements).
89
- // it's difficult to control all nested dependencies and their types, which is why the
90
- // css prop is omitted in the two prop helpers above - this ensures the css prop isn't
91
- // erroneously included in react-ui's public api.
92
- // see https://github.com/microsoft/TypeScript/pull/12253
93
- // see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html
94
- function assertDefined(val, msg) {
95
- if (val === undefined || val === null) {
96
- throw new Error(msg !== null && msg !== void 0 ? msg : 'Unexpected undefined or null');
97
- }
98
- }
99
-
100
-
101
- ;// CONCATENATED MODULE: ./src/ColumnLayout/Column.tsx
102
- 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); }
103
-
104
- 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; }
105
-
106
- 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; }
107
-
108
-
109
-
110
-
111
-
112
-
113
- var propTypes = {
114
- children: (external_prop_types_default()).node,
115
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
116
-
117
- /** @private. */
118
- gutter: (external_prop_types_default()).number,
119
-
120
- /** @private. */
121
- isFirstChild: (external_prop_types_default()).bool,
122
-
123
- /** @private. */
124
- isLastChild: (external_prop_types_default()).bool,
125
- span: (external_prop_types_default()).number,
126
-
127
- /** @private. */
128
- style: (external_prop_types_default()).object
129
- };
130
-
131
- function Column(_ref) {
132
- var children = _ref.children,
133
- elementRef = _ref.elementRef,
134
- gutter = _ref.gutter,
135
- _ref$span = _ref.span,
136
- span = _ref$span === void 0 ? 1 : _ref$span,
137
- isFirstChild = _ref.isFirstChild,
138
- isLastChild = _ref.isLastChild,
139
- style = _ref.style,
140
- otherProps = _objectWithoutProperties(_ref, ["children", "elementRef", "gutter", "span", "isFirstChild", "isLastChild", "style"]);
141
-
142
- // @docs-props-type ColumnPropsBase
143
- var width = gutter ? "calc((100% - ".concat(11 * gutter, "px) * ").concat(span / 12, " + (").concat(gutter, "px * ").concat(span - 1, "))") : "".concat(100 / 12 * span, "%");
144
- assertDefined(gutter);
145
- var calcStyle = {
146
- marginLeft: isFirstChild ? undefined : gutter / 2,
147
- marginRight: isLastChild ? undefined : gutter / 2,
148
- flex: "".concat(span, " ").concat(span, " auto"),
149
- // may accommodate small rounding errors and dividers
150
- width: width
151
- };
152
- return /*#__PURE__*/external_react_default().createElement(Styled, _extends({
153
- "data-test": "column",
154
- ref: elementRef,
155
- style: defaults_default()({}, style, calcStyle)
156
- }, otherProps), children);
157
- }
158
-
159
- Column.propTypes = propTypes;
160
- /* harmony default export */ const ColumnLayout_Column = (Column);
161
- ;// CONCATENATED MODULE: ./src/ColumnLayout/RowStyles.ts
162
-
163
-
164
- var RowStyles_Styled = external_styled_components_default().div.withConfig({
165
- displayName: "RowStyles__Styled",
166
- componentId: "sc-121ntds-0"
167
- })(["", ";flex-flow:row nowrap;&[data-align-items='start']{align-items:flex-start;}&[data-align-items='end']{align-items:flex-end;}&[data-align-items='center']{align-items:center;}&[data-align-items='stretch']{align-items:stretch;}"], themes_namespaceObject.mixins.reset('flex'));
168
- var StyledDivider = external_styled_components_default().div.withConfig({
169
- displayName: "RowStyles__StyledDivider",
170
- componentId: "sc-121ntds-1"
171
- })(["border-left:1px solid ", ";flex:0 0 1;align-self:stretch;"], (0,themes_namespaceObject.pick)({
172
- prisma: themes_namespaceObject.variables.neutral200,
173
- enterprise: {
174
- light: themes_namespaceObject.variables.gray92,
175
- dark: themes_namespaceObject.variables.gray60
176
- }
177
- }));
178
-
179
- ;// CONCATENATED MODULE: ./src/ColumnLayout/Row.tsx
180
- function Row_extends() { Row_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 Row_extends.apply(this, arguments); }
181
-
182
- function Row_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Row_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; }
183
-
184
- function Row_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; }
185
-
186
-
187
-
188
-
189
-
190
-
191
- var Row_propTypes = {
192
- alignItems: external_prop_types_default().oneOf(['start', 'end', 'center', 'stretch']),
193
- children: (external_prop_types_default()).node,
194
-
195
- /** @private. */
196
- divider: (external_prop_types_default()).bool,
197
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
198
-
199
- /** @private. */
200
- gutter: (external_prop_types_default()).number,
201
-
202
- /** @private. */
203
- isFirstChild: (external_prop_types_default()).bool,
204
-
205
- /** @private. */
206
- isLastChild: (external_prop_types_default()).bool,
207
-
208
- /** @private. */
209
- style: (external_prop_types_default()).object
210
- };
211
-
212
- function Row(_ref) {
213
- var _ref$alignItems = _ref.alignItems,
214
- alignItems = _ref$alignItems === void 0 ? 'stretch' : _ref$alignItems,
215
- children = _ref.children,
216
- divider = _ref.divider,
217
- elementRef = _ref.elementRef,
218
- gutter = _ref.gutter,
219
- isFirstChild = _ref.isFirstChild,
220
- isLastChild = _ref.isLastChild,
221
- style = _ref.style,
222
- otherProps = Row_objectWithoutProperties(_ref, ["alignItems", "children", "divider", "elementRef", "gutter", "isFirstChild", "isLastChild", "style"]);
223
-
224
- // @docs-props-type RowPropsBase
225
- if (false) { var total; }
226
-
227
- var cloneColumn = (0,external_react_namespaceObject.useCallback)(function (column, idx) {
228
- return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(column, {
229
- gutter: gutter,
230
- isFirstChild: idx === 0,
231
- isLastChild: idx === external_react_namespaceObject.Children.count(children) - 1
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 = t => {
12
+ /******/ var r = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(r, {
17
+ a: r
18
+ });
19
+ /******/ return r;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, r) => {
27
+ /******/ for (var n in r) {
28
+ /******/ if (e.o(r, n) && !e.o(t, n)) {
29
+ /******/ Object.defineProperty(t, n, {
30
+ enumerable: true,
31
+ get: r[n]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
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 t = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(t);
62
+ // EXPORTS
63
+ e.d(t, {
64
+ Column: () => /* reexport */ O,
65
+ Row: () => /* reexport */ _,
66
+ default: () => /* reexport */ z
232
67
  });
233
- }, [children, gutter]);
234
- var insertDividers = (0,external_react_namespaceObject.useCallback)(function (acc, row, idx, original) {
235
- acc.push(row);
236
-
237
- if (divider && idx < original.length - 1) {
238
- acc.push( /*#__PURE__*/external_react_default().createElement(StyledDivider, {
239
- key: "".concat(idx, "-divider")
240
- }));
68
+ // CONCATENATED MODULE: external "react"
69
+ const r = require("react");
70
+ var n = e.n(r);
71
+ // CONCATENATED MODULE: external "prop-types"
72
+ const i = require("prop-types");
73
+ var l = e.n(i);
74
+ // CONCATENATED MODULE: external "@splunk/themes/useSplunkTheme"
75
+ const a = require("@splunk/themes/useSplunkTheme");
76
+ var o = e.n(a);
77
+ // CONCATENATED MODULE: external "lodash/defaults"
78
+ const s = require("lodash/defaults");
79
+ var c = e.n(s);
80
+ // CONCATENATED MODULE: external "styled-components"
81
+ const u = require("styled-components");
82
+ var d = e.n(u);
83
+ // CONCATENATED MODULE: external "@splunk/themes"
84
+ const f = require("@splunk/themes");
85
+ // CONCATENATED MODULE: ./src/ColumnLayout/ColumnStyles.ts
86
+ var p = d().div.withConfig({
87
+ displayName: "ColumnStyles__Styled",
88
+ componentId: "sc-1pchz98-0"
89
+ })([ "", ";" ], f.mixins.reset("block"));
90
+ // CONCATENATED MODULE: ./src/utils/types.ts
91
+ // see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31245 for details
92
+ // regarding the css prop. certain (versions of) libraries included in the compilation
93
+ // - such as storybook->emotion - introduce the css prop using a global augmentation,
94
+ // which causes the prop to end up in our declaration files (via JSX.IntrinsicElements).
95
+ // it's difficult to control all nested dependencies and their types, which is why the
96
+ // css prop is omitted in the two prop helpers above - this ensures the css prop isn't
97
+ // erroneously included in react-ui's public api.
98
+ // see https://github.com/microsoft/TypeScript/pull/12253
99
+ // see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html
100
+ function v(e, t) {
101
+ if (e === undefined || e === null) {
102
+ throw new Error(t !== null && t !== void 0 ? t : "Unexpected undefined or null");
103
+ }
241
104
  }
242
-
243
- return acc;
244
- }, [divider]);
245
- assertDefined(gutter);
246
- var gutterStyle = {
247
- marginTop: isFirstChild ? undefined : gutter / 2,
248
- marginBottom: isLastChild ? undefined : gutter / 2
249
- };
250
- var childrenCloned = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement).map(cloneColumn).reduce(insertDividers, []);
251
- return /*#__PURE__*/external_react_default().createElement(RowStyles_Styled, Row_extends({
252
- style: defaults_default()({}, style, gutterStyle),
253
- "data-align-items": alignItems,
254
- "data-test": "row",
255
- ref: elementRef
256
- }, otherProps), childrenCloned);
257
- }
258
-
259
- Row.propTypes = Row_propTypes;
260
- /* harmony default export */ const ColumnLayout_Row = (Row);
261
- ;// CONCATENATED MODULE: ./src/ColumnLayout/ColumnLayoutStyles.ts
262
-
263
-
264
- var ColumnLayoutStyles_Styled = external_styled_components_default().div.withConfig({
265
- displayName: "ColumnLayoutStyles__Styled",
266
- componentId: "sc-3eatxz-0"
267
- })(["", ";flex-direction:column;"], themes_namespaceObject.mixins.reset('flex'));
268
- var ColumnLayoutStyles_StyledDivider = external_styled_components_default().div.withConfig({
269
- displayName: "ColumnLayoutStyles__StyledDivider",
270
- componentId: "sc-3eatxz-1"
271
- })(["border-top:1px solid ", ";height:0;"], (0,themes_namespaceObject.pick)({
272
- prisma: themes_namespaceObject.variables.neutral200,
273
- enterprise: {
274
- light: themes_namespaceObject.variables.gray92,
275
- dark: themes_namespaceObject.variables.gray60
276
- }
277
- }));
278
-
279
- ;// CONCATENATED MODULE: ./src/ColumnLayout/ColumnLayout.tsx
280
- function ColumnLayout_extends() { ColumnLayout_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 ColumnLayout_extends.apply(this, arguments); }
281
-
282
- function ColumnLayout_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = ColumnLayout_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; }
283
-
284
- function ColumnLayout_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; }
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
- var ColumnLayout_propTypes = {
293
- children: (external_prop_types_default()).node,
294
- divider: external_prop_types_default().oneOf(['none', 'vertical', 'horizontal']),
295
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
296
- gutter: (external_prop_types_default()).number
297
- };
298
-
299
- /**
300
- * `ColumnLayout` provides simple API for laying out content into columns. It is based on flexbox
301
- * and has 12 columns.
302
- */
303
- function ColumnLayout(_ref) {
304
- var children = _ref.children,
305
- _ref$divider = _ref.divider,
306
- divider = _ref$divider === void 0 ? 'none' : _ref$divider,
307
- elementRef = _ref.elementRef,
308
- gutterProp = _ref.gutter,
309
- otherProps = ColumnLayout_objectWithoutProperties(_ref, ["children", "divider", "elementRef", "gutter"]);
310
-
311
- // @docs-props-type ColumnLayoutPropsBase
312
- var _useSplunkTheme = useSplunkTheme_default()(),
313
- family = _useSplunkTheme.family,
314
- density = _useSplunkTheme.density;
315
-
316
- var cloneRow = (0,external_react_namespaceObject.useCallback)(function (row, idx) {
317
- var isFirstChild = idx === 0;
318
- var isLastChild = idx === external_react_namespaceObject.Children.count(children) - 1;
319
- var gutter = gutterProp;
320
-
321
- if (gutter === undefined) {
322
- if (family === 'prisma') {
323
- if (density === 'compact') {
324
- gutter = 16;
325
- } else if (density === 'comfortable') {
326
- gutter = 24;
105
+ // CONCATENATED MODULE: ./src/ColumnLayout/Column.tsx
106
+ function m() {
107
+ m = Object.assign || function(e) {
108
+ for (var t = 1; t < arguments.length; t++) {
109
+ var r = arguments[t];
110
+ for (var n in r) {
111
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
112
+ e[n] = r[n];
113
+ }
114
+ }
115
+ }
116
+ return e;
117
+ };
118
+ return m.apply(this, arguments);
119
+ }
120
+ function y(e, t) {
121
+ if (e == null) return {};
122
+ var r = h(e, t);
123
+ var n, i;
124
+ if (Object.getOwnPropertySymbols) {
125
+ var l = Object.getOwnPropertySymbols(e);
126
+ for (i = 0; i < l.length; i++) {
127
+ n = l[i];
128
+ if (t.indexOf(n) >= 0) continue;
129
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
130
+ r[n] = e[n];
131
+ }
327
132
  }
328
- } else if (family === 'enterprise') {
329
- gutter = 30;
330
- }
133
+ return r;
331
134
  }
332
-
333
- return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(row, {
334
- gutter: gutter,
335
- divider: divider === 'vertical',
336
- isFirstChild: isFirstChild,
337
- isLastChild: isLastChild
338
- });
339
- }, [children, density, divider, family, gutterProp]);
340
- var insertDividers = (0,external_react_namespaceObject.useCallback)(function (acc, row, idx, original) {
341
- acc.push(row);
342
-
343
- if (divider === 'horizontal' && idx < original.length - 1) {
344
- acc.push( /*#__PURE__*/external_react_default().createElement(ColumnLayoutStyles_StyledDivider, {
345
- key: "".concat(idx, "-divider")
346
- }));
135
+ function h(e, t) {
136
+ if (e == null) return {};
137
+ var r = {};
138
+ var n = Object.keys(e);
139
+ var i, l;
140
+ for (l = 0; l < n.length; l++) {
141
+ i = n[l];
142
+ if (t.indexOf(i) >= 0) continue;
143
+ r[i] = e[i];
144
+ }
145
+ return r;
146
+ }
147
+ var g = {
148
+ children: l().node,
149
+ elementRef: l().oneOfType([ l().func, l().object ]),
150
+ /** @private. */
151
+ gutter: l().number,
152
+ /** @private. */
153
+ isFirstChild: l().bool,
154
+ /** @private. */
155
+ isLastChild: l().bool,
156
+ span: l().number,
157
+ /** @private. */
158
+ style: l().object
159
+ };
160
+ function b(e) {
161
+ var t = e.children, r = e.elementRef, i = e.gutter, l = e.span, a = l === void 0 ? 1 : l, o = e.isFirstChild, s = e.isLastChild, u = e.style, d = y(e, [ "children", "elementRef", "gutter", "span", "isFirstChild", "isLastChild", "style" ]);
162
+ // @docs-props-type ColumnPropsBase
163
+ var f = i ? "calc((100% - ".concat(11 * i, "px) * ").concat(a / 12, " + (").concat(i, "px * ").concat(a - 1, "))") : "".concat(100 / 12 * a, "%");
164
+ v(i);
165
+ var h = {
166
+ marginLeft: o ? undefined : i / 2,
167
+ marginRight: s ? undefined : i / 2,
168
+ flex: "".concat(a, " ").concat(a, " auto"),
169
+ // may accommodate small rounding errors and dividers
170
+ width: f
171
+ };
172
+
173
+ return n().createElement(p, m({
174
+ "data-test": "column",
175
+ ref: r,
176
+ style: c()({}, u, h)
177
+ }, d), t);
178
+ }
179
+ b.propTypes = g;
180
+ /* harmony default export */ const O = b;
181
+ // CONCATENATED MODULE: ./src/ColumnLayout/RowStyles.ts
182
+ var C = d().div.withConfig({
183
+ displayName: "RowStyles__Styled",
184
+ componentId: "sc-121ntds-0"
185
+ })([ "", ";flex-flow:row nowrap;&[data-align-items='start']{align-items:flex-start;}&[data-align-items='end']{align-items:flex-end;}&[data-align-items='center']{align-items:center;}&[data-align-items='stretch']{align-items:stretch;}" ], f.mixins.reset("flex"));
186
+ var j = d().div.withConfig({
187
+ displayName: "RowStyles__StyledDivider",
188
+ componentId: "sc-121ntds-1"
189
+ })([ "border-left:1px solid ", ";flex:0 0 1;align-self:stretch;" ], (0, f.pick)({
190
+ prisma: f.variables.neutral200,
191
+ enterprise: {
192
+ light: f.variables.gray92,
193
+ dark: f.variables.gray60
194
+ }
195
+ }));
196
+ // CONCATENATED MODULE: ./src/ColumnLayout/Row.tsx
197
+ function w() {
198
+ w = Object.assign || function(e) {
199
+ for (var t = 1; t < arguments.length; t++) {
200
+ var r = arguments[t];
201
+ for (var n in r) {
202
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
203
+ e[n] = r[n];
204
+ }
205
+ }
206
+ }
207
+ return e;
208
+ };
209
+ return w.apply(this, arguments);
210
+ }
211
+ function x(e, t) {
212
+ if (e == null) return {};
213
+ var r = S(e, t);
214
+ var n, i;
215
+ if (Object.getOwnPropertySymbols) {
216
+ var l = Object.getOwnPropertySymbols(e);
217
+ for (i = 0; i < l.length; i++) {
218
+ n = l[i];
219
+ if (t.indexOf(n) >= 0) continue;
220
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
221
+ r[n] = e[n];
222
+ }
223
+ }
224
+ return r;
225
+ }
226
+ function S(e, t) {
227
+ if (e == null) return {};
228
+ var r = {};
229
+ var n = Object.keys(e);
230
+ var i, l;
231
+ for (l = 0; l < n.length; l++) {
232
+ i = n[l];
233
+ if (t.indexOf(i) >= 0) continue;
234
+ r[i] = e[i];
235
+ }
236
+ return r;
237
+ }
238
+ var k = {
239
+ alignItems: l().oneOf([ "start", "end", "center", "stretch" ]),
240
+ children: l().node,
241
+ /** @private. */
242
+ divider: l().bool,
243
+ elementRef: l().oneOfType([ l().func, l().object ]),
244
+ /** @private. */
245
+ gutter: l().number,
246
+ /** @private. */
247
+ isFirstChild: l().bool,
248
+ /** @private. */
249
+ isLastChild: l().bool,
250
+ /** @private. */
251
+ style: l().object
252
+ };
253
+ function R(e) {
254
+ var t = e.alignItems, i = t === void 0 ? "stretch" : t, l = e.children, a = e.divider, o = e.elementRef, s = e.gutter, u = e.isFirstChild, d = e.isLastChild, f = e.style, p = x(e, [ "alignItems", "children", "divider", "elementRef", "gutter", "isFirstChild", "isLastChild", "style" ]);
255
+ // @docs-props-type RowPropsBase
256
+ if (false) {
257
+ var m;
258
+ }
259
+ var y = (0, r.useCallback)((function(e, t) {
260
+
261
+ return (0, r.cloneElement)(e, {
262
+ gutter: s,
263
+ isFirstChild: t === 0,
264
+ isLastChild: t === r.Children.count(l) - 1
265
+ });
266
+ }), [ l, s ]);
267
+ var h = (0, r.useCallback)((function(e, t, r, i) {
268
+ e.push(t);
269
+ if (a && r < i.length - 1) {
270
+ e.push( n().createElement(j, {
271
+ key: "".concat(r, "-divider")
272
+ }));
273
+ }
274
+ return e;
275
+ }), [ a ]);
276
+ v(s);
277
+ var g = {
278
+ marginTop: u ? undefined : s / 2,
279
+ marginBottom: d ? undefined : s / 2
280
+ };
281
+ var b = r.Children.toArray(l).filter(r.isValidElement).map(y).reduce(h, []);
282
+
283
+ return n().createElement(C, w({
284
+ style: c()({}, f, g),
285
+ "data-align-items": i,
286
+ "data-test": "row",
287
+ ref: o
288
+ }, p), b);
289
+ }
290
+ R.propTypes = k;
291
+ /* harmony default export */ const _ = R;
292
+ // CONCATENATED MODULE: ./src/ColumnLayout/ColumnLayoutStyles.ts
293
+ var E = d().div.withConfig({
294
+ displayName: "ColumnLayoutStyles__Styled",
295
+ componentId: "sc-3eatxz-0"
296
+ })([ "", ";flex-direction:column;" ], f.mixins.reset("flex"));
297
+ var P = d().div.withConfig({
298
+ displayName: "ColumnLayoutStyles__StyledDivider",
299
+ componentId: "sc-3eatxz-1"
300
+ })([ "border-top:1px solid ", ";height:0;" ], (0, f.pick)({
301
+ prisma: f.variables.neutral200,
302
+ enterprise: {
303
+ light: f.variables.gray92,
304
+ dark: f.variables.gray60
305
+ }
306
+ }));
307
+ // CONCATENATED MODULE: ./src/ColumnLayout/ColumnLayout.tsx
308
+ function I() {
309
+ I = Object.assign || function(e) {
310
+ for (var t = 1; t < arguments.length; t++) {
311
+ var r = arguments[t];
312
+ for (var n in r) {
313
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
314
+ e[n] = r[n];
315
+ }
316
+ }
317
+ }
318
+ return e;
319
+ };
320
+ return I.apply(this, arguments);
321
+ }
322
+ function L(e, t) {
323
+ if (e == null) return {};
324
+ var r = T(e, t);
325
+ var n, i;
326
+ if (Object.getOwnPropertySymbols) {
327
+ var l = Object.getOwnPropertySymbols(e);
328
+ for (i = 0; i < l.length; i++) {
329
+ n = l[i];
330
+ if (t.indexOf(n) >= 0) continue;
331
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
332
+ r[n] = e[n];
333
+ }
334
+ }
335
+ return r;
336
+ }
337
+ function T(e, t) {
338
+ if (e == null) return {};
339
+ var r = {};
340
+ var n = Object.keys(e);
341
+ var i, l;
342
+ for (l = 0; l < n.length; l++) {
343
+ i = n[l];
344
+ if (t.indexOf(i) >= 0) continue;
345
+ r[i] = e[i];
346
+ }
347
+ return r;
348
+ }
349
+ var F = {
350
+ children: l().node,
351
+ divider: l().oneOf([ "none", "vertical", "horizontal" ]),
352
+ elementRef: l().oneOfType([ l().func, l().object ]),
353
+ gutter: l().number
354
+ };
355
+ /**
356
+ * `ColumnLayout` provides simple API for laying out content into columns. It is based on flexbox
357
+ * and has 12 columns.
358
+ */ function q(e) {
359
+ var t = e.children, i = e.divider, l = i === void 0 ? "none" : i, a = e.elementRef, s = e.gutter, c = L(e, [ "children", "divider", "elementRef", "gutter" ]);
360
+ // @docs-props-type ColumnLayoutPropsBase
361
+ var u = o()(), d = u.family, f = u.density;
362
+ var p = (0, r.useCallback)((function(e, n) {
363
+ var i = n === 0;
364
+ var a = n === r.Children.count(t) - 1;
365
+ var o = s;
366
+ if (o === undefined) {
367
+ if (d === "prisma") {
368
+ if (f === "compact") {
369
+ o = 16;
370
+ } else if (f === "comfortable") {
371
+ o = 24;
372
+ }
373
+ } else if (d === "enterprise") {
374
+ o = 30;
375
+ }
376
+ }
377
+
378
+ return (0, r.cloneElement)(e, {
379
+ gutter: o,
380
+ divider: l === "vertical",
381
+ isFirstChild: i,
382
+ isLastChild: a
383
+ });
384
+ }), [ t, f, l, d, s ]);
385
+ var v = (0, r.useCallback)((function(e, t, r, i) {
386
+ e.push(t);
387
+ if (l === "horizontal" && r < i.length - 1) {
388
+ e.push( n().createElement(P, {
389
+ key: "".concat(r, "-divider")
390
+ }));
391
+ }
392
+ return e;
393
+ }), [ l ]);
394
+ var m = r.Children.toArray(t).filter(r.isValidElement).map(p).reduce(v, []);
395
+
396
+ return n().createElement(E, I({
397
+ "data-test": "column-layout",
398
+ ref: a
399
+ }, c), m);
347
400
  }
348
-
349
- return acc;
350
- }, [divider]);
351
- var childrenCloned = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement).map(cloneRow).reduce(insertDividers, []);
352
- return /*#__PURE__*/external_react_default().createElement(ColumnLayoutStyles_Styled, ColumnLayout_extends({
353
- "data-test": "column-layout",
354
- ref: elementRef
355
- }, otherProps), childrenCloned);
356
- }
357
-
358
- ColumnLayout.propTypes = ColumnLayout_propTypes;
359
- ColumnLayout.Row = ColumnLayout_Row;
360
- ColumnLayout.Column = ColumnLayout_Column;
361
- /* harmony default export */ const ColumnLayout_ColumnLayout = (ColumnLayout);
362
-
363
- ;// CONCATENATED MODULE: ./src/ColumnLayout/index.ts
364
-
365
-
366
- module.exports = __webpack_exports__;
367
- /******/ })()
368
- ;
401
+ q.propTypes = F;
402
+ q.Row = _;
403
+ q.Column = O;
404
+ /* harmony default export */ const z = q;
405
+ // CONCATENATED MODULE: ./src/ColumnLayout/index.ts
406
+ module.exports = t;
407
+ /******/})();