@splunk/react-ui 4.28.1 → 4.28.2

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/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 4.28.2 - March 22, 2024
5
+ ----------
6
+ Bug Fixes:
7
+ * `Table.Row` no longer ignores provided `style` properties (SUI-6156).
8
+
9
+ Typescript:
10
+ * `WaitSpinner`'s `screenReaderText` type includes `null` now (SUI-6081).
11
+
4
12
  4.28.1 - March 21, 2024
5
13
  ----------
6
14
  Bug Fixes:
package/Modal.js CHANGED
@@ -692,6 +692,7 @@
692
692
  }
693
693
  var qe = {
694
694
  children: i().node,
695
+ closeOnClickAway: i().bool,
695
696
  divider: i().oneOf([ "header", "footer", "both", "none" ]),
696
697
  elementRef: i().oneOfType([ i().func, i().object ]),
697
698
  initialFocus: i().oneOfType([ i().object, i().oneOf([ "first", "container" ]) ]),
@@ -700,6 +701,8 @@
700
701
  returnFocus: i().oneOfType([ i().func, i().object ])
701
702
  };
702
703
  var Fe = {
704
+ // TODO: Set to `false` in next major version
705
+ closeOnClickAway: true,
703
706
  divider: "both",
704
707
  initialFocus: "first",
705
708
  open: false
@@ -860,13 +863,16 @@
860
863
  }, {
861
864
  key: "render",
862
865
  value: function e() {
866
+ var t = this.props.closeOnClickAway;
867
+ var r = t ? "interactive" : "visible";
863
868
 
864
869
  return n().createElement(b(), {
865
- open: this.props.open,
866
870
  getDefaultMotionStyle: this.getDefaultMotionStyle,
867
- renderModal: this.renderModal,
868
871
  getMotionStyle: this.getMotionStyle,
869
- onRequestClose: this.handleRequestClose
872
+ onRequestClose: this.handleRequestClose,
873
+ open: this.props.open,
874
+ renderModal: this.renderModal,
875
+ scrim: r
870
876
  });
871
877
  }
872
878
  } ]);
package/ModalLayer.js CHANGED
@@ -9,26 +9,26 @@
9
9
  /******/ (() => {
10
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
11
11
  /******/ e.n = t => {
12
- /******/ var r = t && t.__esModule ?
12
+ /******/ var n = t && t.__esModule ?
13
13
  /******/ () => t["default"]
14
14
  /******/ : () => t
15
15
  /******/;
16
- e.d(r, {
17
- a: r
16
+ e.d(n, {
17
+ a: n
18
18
  });
19
- /******/ return r;
19
+ /******/ return n;
20
20
  /******/ };
21
21
  /******/ })();
22
22
  /******/
23
23
  /******/ /* webpack/runtime/define property getters */
24
24
  /******/ (() => {
25
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, {
26
+ /******/ e.d = (t, n) => {
27
+ /******/ for (var r in n) {
28
+ /******/ if (e.o(n, r) && !e.o(t, r)) {
29
+ /******/ Object.defineProperty(t, r, {
30
30
  enumerable: true,
31
- get: r[n]
31
+ get: n[r]
32
32
  });
33
33
  /******/ }
34
34
  /******/ }
@@ -64,66 +64,66 @@
64
64
  default: () => /* reexport */ E
65
65
  });
66
66
  // CONCATENATED MODULE: external "react"
67
- const r = require("react");
68
- var n = e.n(r);
67
+ const n = require("react");
68
+ var r = e.n(n);
69
69
  // CONCATENATED MODULE: external "prop-types"
70
70
  const o = require("prop-types");
71
71
  var i = e.n(o);
72
72
  // CONCATENATED MODULE: external "@splunk/react-ui/Animation"
73
73
  const a = require("@splunk/react-ui/Animation");
74
74
  // CONCATENATED MODULE: external "@splunk/react-ui/Layer"
75
- const l = require("@splunk/react-ui/Layer");
76
- var u = e.n(l);
75
+ const c = require("@splunk/react-ui/Layer");
76
+ var l = e.n(c);
77
77
  // CONCATENATED MODULE: external "styled-components"
78
- const c = require("styled-components");
79
- var s = e.n(c);
78
+ const u = require("styled-components");
79
+ var s = e.n(u);
80
80
  // CONCATENATED MODULE: external "react-spring"
81
81
  const f = require("react-spring");
82
82
  // CONCATENATED MODULE: external "@splunk/themes"
83
83
  const p = require("@splunk/themes");
84
84
  // CONCATENATED MODULE: ./src/ModalLayer/ModalLayerStyles.ts
85
- var y = (0, c.css)([ "", ";position:fixed;top:0;right:0;bottom:0;left:0;" ], p.mixins.reset("block"));
85
+ var y = (0, u.css)([ "", ";position:fixed;top:0;right:0;bottom:0;left:0;" ], p.mixins.reset("block"));
86
86
  var d = s()(f.animated.div).withConfig({
87
87
  displayName: "ModalLayerStyles__StyledClickAwayOverlay",
88
88
  componentId: "sc-1sa3n1j-0"
89
89
  })([ "", ";background-color:", ";z-index:", ";" ], y, p.variables.backgroundColorScrim, p.variables.zindexModalBackdrop);
90
90
  // CONCATENATED MODULE: ./src/ModalLayer/ModalLayer.tsx
91
- function b(e) {
91
+ function v(e) {
92
92
  "@babel/helpers - typeof";
93
93
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
94
- b = function e(t) {
94
+ v = function e(t) {
95
95
  return typeof t;
96
96
  };
97
97
  } else {
98
- b = function e(t) {
98
+ v = function e(t) {
99
99
  return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
100
100
  };
101
101
  }
102
- return b(e);
102
+ return v(e);
103
103
  }
104
- function v(e, t) {
105
- var r = Object.keys(e);
104
+ function b(e, t) {
105
+ var n = Object.keys(e);
106
106
  if (Object.getOwnPropertySymbols) {
107
- var n = Object.getOwnPropertySymbols(e);
108
- if (t) n = n.filter((function(t) {
107
+ var r = Object.getOwnPropertySymbols(e);
108
+ if (t) r = r.filter((function(t) {
109
109
  return Object.getOwnPropertyDescriptor(e, t).enumerable;
110
110
  }));
111
- r.push.apply(r, n);
111
+ n.push.apply(n, r);
112
112
  }
113
- return r;
113
+ return n;
114
114
  }
115
115
  function m(e) {
116
116
  for (var t = 1; t < arguments.length; t++) {
117
- var r = arguments[t] != null ? arguments[t] : {};
117
+ var n = arguments[t] != null ? arguments[t] : {};
118
118
  if (t % 2) {
119
- v(Object(r), true).forEach((function(t) {
120
- _(e, t, r[t]);
119
+ b(Object(n), true).forEach((function(t) {
120
+ R(e, t, n[t]);
121
121
  }));
122
122
  } else if (Object.getOwnPropertyDescriptors) {
123
- Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
123
+ Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
124
124
  } else {
125
- v(Object(r)).forEach((function(t) {
126
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
125
+ b(Object(n)).forEach((function(t) {
126
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
127
127
  }));
128
128
  }
129
129
  }
@@ -135,17 +135,17 @@
135
135
  }
136
136
  }
137
137
  function h(e, t) {
138
- for (var r = 0; r < t.length; r++) {
139
- var n = t[r];
140
- n.enumerable = n.enumerable || false;
141
- n.configurable = true;
142
- if ("value" in n) n.writable = true;
143
- Object.defineProperty(e, n.key, n);
138
+ for (var n = 0; n < t.length; n++) {
139
+ var r = t[n];
140
+ r.enumerable = r.enumerable || false;
141
+ r.configurable = true;
142
+ if ("value" in r) r.writable = true;
143
+ Object.defineProperty(e, r.key, r);
144
144
  }
145
145
  }
146
- function g(e, t, r) {
146
+ function g(e, t, n) {
147
147
  if (t) h(e.prototype, t);
148
- if (r) h(e, r);
148
+ if (n) h(e, n);
149
149
  return e;
150
150
  }
151
151
  function w(e, t) {
@@ -162,27 +162,27 @@
162
162
  if (t) j(e, t);
163
163
  }
164
164
  function j(e, t) {
165
- j = Object.setPrototypeOf || function e(t, r) {
166
- t.__proto__ = r;
165
+ j = Object.setPrototypeOf || function e(t, n) {
166
+ t.__proto__ = n;
167
167
  return t;
168
168
  };
169
169
  return j(e, t);
170
170
  }
171
171
  function S(e) {
172
172
  var t = A();
173
- return function r() {
174
- var n = C(e), o;
173
+ return function n() {
174
+ var r = _(e), o;
175
175
  if (t) {
176
- var i = C(this).constructor;
177
- o = Reflect.construct(n, arguments, i);
176
+ var i = _(this).constructor;
177
+ o = Reflect.construct(r, arguments, i);
178
178
  } else {
179
- o = n.apply(this, arguments);
179
+ o = r.apply(this, arguments);
180
180
  }
181
181
  return P(this, o);
182
182
  };
183
183
  }
184
184
  function P(e, t) {
185
- if (t && (b(t) === "object" || typeof t === "function")) {
185
+ if (t && (v(t) === "object" || typeof t === "function")) {
186
186
  return t;
187
187
  }
188
188
  return k(e);
@@ -204,82 +204,82 @@
204
204
  return false;
205
205
  }
206
206
  }
207
- function C(e) {
208
- C = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
207
+ function _(e) {
208
+ _ = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
209
209
  return t.__proto__ || Object.getPrototypeOf(t);
210
210
  };
211
- return C(e);
211
+ return _(e);
212
212
  }
213
- function _(e, t, r) {
213
+ function R(e, t, n) {
214
214
  if (t in e) {
215
215
  Object.defineProperty(e, t, {
216
- value: r,
216
+ value: n,
217
217
  enumerable: true,
218
218
  configurable: true,
219
219
  writable: true
220
220
  });
221
221
  } else {
222
- e[t] = r;
222
+ e[t] = n;
223
223
  }
224
224
  return e;
225
225
  }
226
- var R = {
226
+ var q = {
227
227
  childrenInAnimation: i().bool,
228
228
  getDefaultMotionStyle: i().func,
229
229
  getMotionStyle: i().func,
230
230
  onRequestClose: i().func,
231
231
  open: i().bool,
232
232
  renderModal: i().func.isRequired,
233
- useLayerForClickAway: i().bool
233
+ scrim: i().oneOf([ "visible", "hidden", "interactive" ])
234
234
  };
235
- var q = {
235
+ var M = {
236
236
  childrenInAnimation: false,
237
237
  open: false,
238
- useLayerForClickAway: true
238
+ scrim: "interactive"
239
239
  };
240
- var M = function(e) {
241
- w(r, e);
242
- var t = S(r);
243
- function r(e) {
240
+ var C = function(e) {
241
+ w(n, e);
242
+ var t = S(n);
243
+ function n(e) {
244
244
  var o;
245
- O(this, r);
245
+ O(this, n);
246
246
  o = t.call(this, e);
247
- _(k(o), "allowAnimationUpdates", true);
248
- _(k(o), "handleClickAway", (function(e) {
249
- var t, r;
250
- (t = (r = o.props).onRequestClose) === null || t === void 0 ? void 0 : t.call(r, {
247
+ R(k(o), "allowAnimationUpdates", true);
248
+ R(k(o), "handleClickAway", (function(e) {
249
+ var t, n;
250
+ (t = (n = o.props).onRequestClose) === null || t === void 0 ? void 0 : t.call(n, {
251
251
  reason: "clickAway",
252
252
  event: e
253
253
  });
254
254
  }));
255
- _(k(o), "handleAnimationEnd", (function() {
255
+ R(k(o), "handleAnimationEnd", (function() {
256
256
  if (o.allowAnimationUpdates) {
257
257
  o.setState({
258
258
  animating: false
259
259
  });
260
260
  }
261
261
  }));
262
- _(k(o), "renderLayer", (function() {
263
- var e = o.props, t = e.getDefaultMotionStyle, r = e.getMotionStyle, i = e.renderModal, l = e.useLayerForClickAway;
264
- var u = o.props.open || o.state.animating;
262
+ R(k(o), "renderLayer", (function() {
263
+ var e = o.props, t = e.getDefaultMotionStyle, n = e.getMotionStyle, i = e.renderModal, c = e.scrim;
264
+ var l = o.props.open || o.state.animating;
265
265
 
266
- return n().createElement(a.Spring, {
266
+ return r().createElement(a.Spring, {
267
267
  from: m(m({}, t === null || t === void 0 ? void 0 : t()), {}, {
268
268
  overlayOpacity: 0,
269
269
  opacity: 0
270
270
  }),
271
- to: m(m({}, r === null || r === void 0 ? void 0 : r()), {}, {
271
+ to: m(m({}, n === null || n === void 0 ? void 0 : n()), {}, {
272
272
  overlayOpacity: o.props.open ? 1 : 0,
273
273
  opacity: o.props.open ? 1 : 0
274
274
  }),
275
275
  onRest: o.handleAnimationEnd
276
276
  }, (function(e) {
277
277
 
278
- return n().createElement("div", null,
278
+ return r().createElement("div", null,
279
279
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
280
- i(e), u && l && n().createElement(d, {
280
+ i(e), l && (c === "visible" || "interactive") && r().createElement(d, {
281
281
  "data-test": "modal-overlay",
282
- onMouseDown: o.handleClickAway,
282
+ onMouseDown: c === "interactive" ? o.handleClickAway : undefined,
283
283
  key: "clickAway",
284
284
  style: {
285
285
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
@@ -294,7 +294,7 @@
294
294
  };
295
295
  return o;
296
296
  }
297
- g(r, [ {
297
+ g(n, [ {
298
298
  key: "componentWillUnmount",
299
299
  value: function e() {
300
300
  this.allowAnimationUpdates = false;
@@ -305,18 +305,18 @@
305
305
  value: function e() {
306
306
  var t = this.props.open || this.state.animating || this.props.childrenInAnimation;
307
307
 
308
- return n().createElement(u(), {
308
+ return r().createElement(l(), {
309
309
  open: t,
310
310
  closeReasons: [ "escapeKey" ],
311
311
  onRequestClose: this.props.onRequestClose
312
312
  }, t && this.renderLayer());
313
313
  }
314
314
  } ]);
315
- return r;
316
- }(r.Component);
317
- _(M, "propTypes", R);
318
- _(M, "defaultProps", q);
319
- _(M, "getDerivedStateFromProps", (function(e, t) {
315
+ return n;
316
+ }(n.Component);
317
+ R(C, "propTypes", q);
318
+ R(C, "defaultProps", M);
319
+ R(C, "getDerivedStateFromProps", (function(e, t) {
320
320
  if (e.open !== t.prevOpen) {
321
321
  return {
322
322
  animating: true,
@@ -325,7 +325,7 @@
325
325
  }
326
326
  return null;
327
327
  }));
328
- /* harmony default export */ const E = M;
328
+ /* harmony default export */ const E = C;
329
329
  // CONCATENATED MODULE: ./src/ModalLayer/index.ts
330
330
  module.exports = t;
331
331
  /******/})();
package/SidePanel.js CHANGED
@@ -87,43 +87,43 @@
87
87
  // CONCATENATED MODULE: external "@splunk/themes"
88
88
  const m = require("@splunk/themes");
89
89
  // CONCATENATED MODULE: ./src/SidePanel/SidePanelStyles.ts
90
- var h = (0, p.css)([ "", " position:fixed;flex-direction:column;box-shadow:", ";background-color:", ";z-index:", ";" ], m.mixins.reset("flex"), (0,
90
+ var v = (0, p.css)([ "", " position:fixed;flex-direction:column;box-shadow:", ";background-color:", ";z-index:", ";" ], m.mixins.reset("flex"), (0,
91
91
  m.pick)({
92
92
  enterprise: "0 0 12px rgba(0, 0, 0, 0.3)",
93
93
  prisma: m.variables.overlayShadow
94
94
  }), m.variables.backgroundColorSidebar, m.variables.zindexModal);
95
- var v = y()(b()).withConfig({
95
+ var h = y()(b()).withConfig({
96
96
  displayName: "SidePanelStyles__StyledLeftPanelTransitionOpen",
97
97
  componentId: "mtbcuz-0"
98
- })([ "", ";top:0;left:0;height:100vh;" ], h);
98
+ })([ "", ";top:0;left:0;height:100vh;" ], v);
99
99
  var g = y()(b()).withConfig({
100
100
  displayName: "SidePanelStyles__StyledRightPanelTransitionOpen",
101
101
  componentId: "mtbcuz-1"
102
- })([ "", ";right:0;top:0;height:100vh;" ], h);
102
+ })([ "", ";right:0;top:0;height:100vh;" ], v);
103
103
  var O = y()(b()).withConfig({
104
104
  displayName: "SidePanelStyles__StyledTopPanelTransitionOpen",
105
105
  componentId: "mtbcuz-2"
106
- })([ "", ";top:0;left:0;width:100vw;" ], h);
106
+ })([ "", ";top:0;left:0;width:100vw;" ], v);
107
107
  var S = y()(b()).withConfig({
108
108
  displayName: "SidePanelStyles__StyledBottomPanelTransitionOpen",
109
109
  componentId: "mtbcuz-3"
110
- })([ "", ";left:0;bottom:0;width:100vw;" ], h);
110
+ })([ "", ";left:0;bottom:0;width:100vw;" ], v);
111
111
  // CONCATENATED MODULE: ./src/SidePanel/SidePanel.tsx
112
- function w(e) {
112
+ function P(e) {
113
113
  "@babel/helpers - typeof";
114
114
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
115
- w = function e(t) {
115
+ P = function e(t) {
116
116
  return typeof t;
117
117
  };
118
118
  } else {
119
- w = function e(t) {
119
+ P = function e(t) {
120
120
  return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
121
121
  };
122
122
  }
123
- return w(e);
123
+ return P(e);
124
124
  }
125
- function P() {
126
- P = Object.assign || function(e) {
125
+ function w() {
126
+ w = Object.assign || function(e) {
127
127
  for (var t = 1; t < arguments.length; t++) {
128
128
  var r = arguments[t];
129
129
  for (var n in r) {
@@ -134,7 +134,7 @@
134
134
  }
135
135
  return e;
136
136
  };
137
- return P.apply(this, arguments);
137
+ return w.apply(this, arguments);
138
138
  }
139
139
  function j(e) {
140
140
  return k(e) || _(e) || C(e) || A();
@@ -196,7 +196,7 @@
196
196
  throw new TypeError("Cannot call a class as a function");
197
197
  }
198
198
  }
199
- function F(e, t) {
199
+ function R(e, t) {
200
200
  for (var r = 0; r < t.length; r++) {
201
201
  var n = t[r];
202
202
  n.enumerable = n.enumerable || false;
@@ -205,9 +205,9 @@
205
205
  Object.defineProperty(e, n.key, n);
206
206
  }
207
207
  }
208
- function R(e, t, r) {
209
- if (t) F(e.prototype, t);
210
- if (r) F(e, r);
208
+ function F(e, t, r) {
209
+ if (t) R(e.prototype, t);
210
+ if (r) R(e, r);
211
211
  return e;
212
212
  }
213
213
  function M(e, t) {
@@ -231,7 +231,7 @@
231
231
  return N(e, t);
232
232
  }
233
233
  function I(e) {
234
- var t = z();
234
+ var t = L();
235
235
  return function r() {
236
236
  var n = B(e), o;
237
237
  if (t) {
@@ -244,18 +244,18 @@
244
244
  };
245
245
  }
246
246
  function D(e, t) {
247
- if (t && (w(t) === "object" || typeof t === "function")) {
247
+ if (t && (P(t) === "object" || typeof t === "function")) {
248
248
  return t;
249
249
  }
250
- return L(e);
250
+ return z(e);
251
251
  }
252
- function L(e) {
252
+ function z(e) {
253
253
  if (e === void 0) {
254
254
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
255
255
  }
256
256
  return e;
257
257
  }
258
- function z() {
258
+ function L() {
259
259
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
260
260
  if (Reflect.construct.sham) return false;
261
261
  if (typeof Proxy === "function") return true;
@@ -316,17 +316,17 @@
316
316
  var o;
317
317
  q(this, r);
318
318
  o = t.call(this, e);
319
- U(L(o), "handlePanelAnimationEnd", (function() {
319
+ U(z(o), "handlePanelAnimationEnd", (function() {
320
320
  var e, t;
321
321
  o.setState({
322
322
  panelAnimating: false
323
323
  });
324
324
  (e = (t = o.props).onAnimationEnd) === null || e === void 0 ? void 0 : e.call(t);
325
325
  }));
326
- U(L(o), "renderModal", (function() {
326
+ U(z(o), "renderModal", (function() {
327
327
  var e = o.props, t = e.children, i = e.dockPosition, a = e.innerClassName, u = e.innerStyle, s = e.outerClassName, f = e.outerStyle;
328
328
  var p = {
329
- left: v,
329
+ left: h,
330
330
  right: g,
331
331
  top: O,
332
332
  bottom: S
@@ -337,7 +337,7 @@
337
337
  width: "100%"
338
338
  };
339
339
 
340
- return n().createElement(p, P({
340
+ return n().createElement(p, w({
341
341
  animateOnMount: true,
342
342
  animation: H[i],
343
343
  "data-test": "side-panel",
@@ -359,18 +359,19 @@
359
359
  };
360
360
  return o;
361
361
  }
362
- R(r, [ {
362
+ F(r, [ {
363
363
  key: "render",
364
364
  value: function e() {
365
365
  var t = this.props, r = t.open, o = t.onRequestClose, i = t.useLayerForClickAway;
366
366
  var a = this.state.panelAnimating;
367
+ var l = i ? "interactive" : "visible";
367
368
 
368
369
  return n().createElement(f(), {
369
370
  childrenInAnimation: a,
370
371
  onRequestClose: o,
371
372
  open: r,
372
373
  renderModal: this.renderModal,
373
- useLayerForClickAway: i
374
+ scrim: l
374
375
  });
375
376
  }
376
377
  } ]);