@splunk/react-ui 4.30.0 → 4.31.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 4.31.0 - May 16, 2024
5
+ ----------
6
+ New Features:
7
+ * `Divider` has a new `decorative` prop for disabling the default semantics of `role="separator"`.
8
+
9
+ Bug Fixes:
10
+ * `SidePanel` incorrectly rendered the overlay mask when `useLayerForClickAway={false}`. This has been fixed (SUI-6260).
11
+
4
12
  4.30.0 - May 6, 2024
5
13
  ----------
6
14
  New Features:
package/Divider.js CHANGED
@@ -24,11 +24,11 @@
24
24
  /******/ (() => {
25
25
  /******/ // define getter functions for harmony exports
26
26
  /******/ e.d = (r, t) => {
27
- /******/ for (var o in t) {
28
- /******/ if (e.o(t, o) && !e.o(r, o)) {
29
- /******/ Object.defineProperty(r, o, {
27
+ /******/ for (var n in t) {
28
+ /******/ if (e.o(t, n) && !e.o(r, n)) {
29
+ /******/ Object.defineProperty(r, n, {
30
30
  enumerable: true,
31
- get: t[o]
31
+ get: t[n]
32
32
  });
33
33
  /******/ }
34
34
  /******/ }
@@ -61,89 +61,140 @@
61
61
  e.r(r);
62
62
  // EXPORTS
63
63
  e.d(r, {
64
- default: () => /* reexport */ v
64
+ default: () => /* reexport */ j
65
65
  });
66
66
  // CONCATENATED MODULE: external "react"
67
67
  const t = require("react");
68
- var o = e.n(t);
68
+ var n = e.n(t);
69
69
  // CONCATENATED MODULE: external "prop-types"
70
- const n = require("prop-types");
71
- var i = e.n(n);
70
+ const o = require("prop-types");
71
+ var i = e.n(o);
72
72
  // CONCATENATED MODULE: external "styled-components"
73
73
  const a = require("styled-components");
74
74
  var l = e.n(a);
75
75
  // CONCATENATED MODULE: external "@splunk/themes"
76
- const s = require("@splunk/themes");
76
+ const c = require("@splunk/themes");
77
77
  // CONCATENATED MODULE: ./src/Divider/DividerStyles.ts
78
- var c = l().hr.withConfig({
78
+ var u = l().hr.withConfig({
79
79
  displayName: "DividerStyles__StyledRule",
80
80
  componentId: "gl6kyz-0"
81
- })([ "", ";", ";border-color:", ";" ], s.mixins.reset("block"), (0, s.pickVariant)("$orientation", {
81
+ })([ "", ";", ";border-color:", ";" ], c.mixins.reset("block"), (0, c.pickVariant)("$orientation", {
82
82
  horizontal: (0, a.css)([ "border-top-style:solid;border-width:1px;" ]),
83
83
  vertical: (0, a.css)([ "display:inline;border-left-style:solid;border-width:1px;" ])
84
- }), (0, s.pick)({
85
- enterprise: s.variables.borderColor,
86
- prisma: s.variables.neutral200
84
+ }), (0, c.pick)({
85
+ enterprise: c.variables.borderColor,
86
+ prisma: c.variables.neutral200
87
87
  }));
88
88
  // CONCATENATED MODULE: ./src/Divider/Divider.tsx
89
- function u() {
90
- u = Object.assign || function(e) {
89
+ function s() {
90
+ s = Object.assign || function(e) {
91
91
  for (var r = 1; r < arguments.length; r++) {
92
92
  var t = arguments[r];
93
- for (var o in t) {
94
- if (Object.prototype.hasOwnProperty.call(t, o)) {
95
- e[o] = t[o];
93
+ for (var n in t) {
94
+ if (Object.prototype.hasOwnProperty.call(t, n)) {
95
+ e[n] = t[n];
96
96
  }
97
97
  }
98
98
  }
99
99
  return e;
100
100
  };
101
- return u.apply(this, arguments);
101
+ return s.apply(this, arguments);
102
102
  }
103
- function p(e, r) {
103
+ function f(e, r) {
104
+ var t = Object.keys(e);
105
+ if (Object.getOwnPropertySymbols) {
106
+ var n = Object.getOwnPropertySymbols(e);
107
+ if (r) n = n.filter((function(r) {
108
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
109
+ }));
110
+ t.push.apply(t, n);
111
+ }
112
+ return t;
113
+ }
114
+ function p(e) {
115
+ for (var r = 1; r < arguments.length; r++) {
116
+ var t = arguments[r] != null ? arguments[r] : {};
117
+ if (r % 2) {
118
+ f(Object(t), true).forEach((function(r) {
119
+ b(e, r, t[r]);
120
+ }));
121
+ } else if (Object.getOwnPropertyDescriptors) {
122
+ Object.defineProperties(e, Object.getOwnPropertyDescriptors(t));
123
+ } else {
124
+ f(Object(t)).forEach((function(r) {
125
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
126
+ }));
127
+ }
128
+ }
129
+ return e;
130
+ }
131
+ function b(e, r, t) {
132
+ if (r in e) {
133
+ Object.defineProperty(e, r, {
134
+ value: t,
135
+ enumerable: true,
136
+ configurable: true,
137
+ writable: true
138
+ });
139
+ } else {
140
+ e[r] = t;
141
+ }
142
+ return e;
143
+ }
144
+ function d(e, r) {
104
145
  if (e == null) return {};
105
- var t = f(e, r);
106
- var o, n;
146
+ var t = y(e, r);
147
+ var n, o;
107
148
  if (Object.getOwnPropertySymbols) {
108
149
  var i = Object.getOwnPropertySymbols(e);
109
- for (n = 0; n < i.length; n++) {
110
- o = i[n];
111
- if (r.indexOf(o) >= 0) continue;
112
- if (!Object.prototype.propertyIsEnumerable.call(e, o)) continue;
113
- t[o] = e[o];
150
+ for (o = 0; o < i.length; o++) {
151
+ n = i[o];
152
+ if (r.indexOf(n) >= 0) continue;
153
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
154
+ t[n] = e[n];
114
155
  }
115
156
  }
116
157
  return t;
117
158
  }
118
- function f(e, r) {
159
+ function y(e, r) {
119
160
  if (e == null) return {};
120
161
  var t = {};
121
- var o = Object.keys(e);
122
- var n, i;
123
- for (i = 0; i < o.length; i++) {
124
- n = o[i];
125
- if (r.indexOf(n) >= 0) continue;
126
- t[n] = e[n];
162
+ var n = Object.keys(e);
163
+ var o, i;
164
+ for (i = 0; i < n.length; i++) {
165
+ o = n[i];
166
+ if (r.indexOf(o) >= 0) continue;
167
+ t[o] = e[o];
127
168
  }
128
169
  return t;
129
170
  }
130
- var d = {
171
+ var v = {
131
172
  elementRef: i().oneOfType([ i().func, i().object ]),
173
+ decorative: i().bool,
132
174
  orientation: i().oneOf([ "horizontal", "vertical" ])
133
175
  };
134
- function y(e) {
135
- var r = e.elementRef, t = e.orientation, n = t === void 0 ? "horizontal" : t, i = p(e, [ "elementRef", "orientation" ]);
176
+ function O(e) {
177
+ var r = e.elementRef, t = e.decorative, o = t === void 0 ? false : t, i = e.orientation, a = i === void 0 ? "horizontal" : i, l = d(e, [ "elementRef", "decorative", "orientation" ]);
136
178
  // @docs-props-type DividerPropsBase
137
-
138
- return o().createElement(c, u({
179
+ var c = p({
139
180
  "data-test": "divider",
140
181
  ref: r,
141
- "aria-orientation": n,
142
- $orientation: n
143
- }, i));
182
+ $orientation: a
183
+ }, l);
184
+ // aria-orientation is not needed when decorative and div is used to have no semantics
185
+ if (o) {
186
+
187
+ return n().createElement(u, s({
188
+ as: "div"
189
+ }, c));
190
+ }
191
+
192
+ return n().createElement(u, s({
193
+ "aria-orientation": a
194
+ }, c));
144
195
  }
145
- y.propTypes = d;
146
- /* harmony default export */ const v = y;
196
+ O.propTypes = v;
197
+ /* harmony default export */ const j = O;
147
198
  // CONCATENATED MODULE: ./src/Divider/index.ts
148
199
  module.exports = r;
149
200
  /******/})();
package/Link.js CHANGED
@@ -111,7 +111,7 @@
111
111
  var k = f()(S()).withConfig({
112
112
  displayName: "LinkStyles__StyledClickable",
113
113
  componentId: "sc-1hhltcf-0"
114
- })([ "", ";color:", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;border-radius:", ";&:not([disabled],[aria-disabled='true']){cursor:pointer;", ";&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}}&[disabled],&[aria-disabled='true']{color:", ";}&::-moz-focus-inner{border:0;padding:0;}" ], v.mixins.reset("inline"), (0,
114
+ })([ "", ";color:", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;border-radius:", ";&:not([disabled],[aria-disabled='true']){cursor:pointer;", ";&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}}&[disabled],&[aria-disabled='true']{color:", ";}" ], v.mixins.reset("inline"), (0,
115
115
  v.pick)({
116
116
  enterprise: v.variables.linkColor,
117
117
  prisma: v.variables.interactiveColorPrimary
@@ -217,11 +217,11 @@
217
217
  return I(e, t);
218
218
  }
219
219
  function N(e) {
220
- var t = z();
220
+ var t = A();
221
221
  return function n() {
222
- var r = A(e), o;
222
+ var r = L(e), o;
223
223
  if (t) {
224
- var i = A(this).constructor;
224
+ var i = L(this).constructor;
225
225
  o = Reflect.construct(r, arguments, i);
226
226
  } else {
227
227
  o = r.apply(this, arguments);
@@ -241,7 +241,7 @@
241
241
  }
242
242
  return e;
243
243
  }
244
- function z() {
244
+ function A() {
245
245
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
246
246
  if (Reflect.construct.sham) return false;
247
247
  if (typeof Proxy === "function") return true;
@@ -252,13 +252,13 @@
252
252
  return false;
253
253
  }
254
254
  }
255
- function A(e) {
256
- A = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
255
+ function L(e) {
256
+ L = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
257
257
  return t.__proto__ || Object.getPrototypeOf(t);
258
258
  };
259
- return A(e);
259
+ return L(e);
260
260
  }
261
- function L(e, t, n) {
261
+ function z(e, t, n) {
262
262
  if (t in e) {
263
263
  Object.defineProperty(e, t, {
264
264
  value: n,
@@ -298,8 +298,8 @@
298
298
  o[i] = arguments[i];
299
299
  }
300
300
  e = t.call.apply(t, [ this ].concat(o));
301
- L(D(e), "component", null);
302
- L(D(e), "handleMount", (function(t) {
301
+ z(D(e), "component", null);
302
+ z(D(e), "handleMount", (function(t) {
303
303
  e.component = t;
304
304
  }));
305
305
  return e;
@@ -333,9 +333,9 @@
333
333
  } ]);
334
334
  return n;
335
335
  }(n.Component);
336
- L(H, "propTypes", B);
337
- L(H, "defaultProps", F);
338
- L(H, u.legacyRefMode, true);
336
+ z(H, "propTypes", B);
337
+ z(H, "defaultProps", F);
338
+ z(H, u.legacyRefMode, true);
339
339
  /* harmony default export */ const J = H;
340
340
  // CONCATENATED MODULE: ./src/Link/index.ts
341
341
  module.exports = t;
package/ModalLayer.js CHANGED
@@ -262,6 +262,7 @@
262
262
  R(k(o), "renderLayer", (function() {
263
263
  var e = o.props, t = e.getDefaultMotionStyle, n = e.getMotionStyle, i = e.renderModal, c = e.scrim;
264
264
  var l = o.props.open || o.state.animating;
265
+ var u = l && c !== "hidden";
265
266
 
266
267
  return r().createElement(a.Spring, {
267
268
  from: m(m({}, t === null || t === void 0 ? void 0 : t()), {}, {
@@ -277,7 +278,7 @@
277
278
 
278
279
  return r().createElement("div", null,
279
280
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
280
- i(e), l && (c === "visible" || "interactive") && r().createElement(d, {
281
+ i(e), u && r().createElement(d, {
281
282
  "data-test": "modal-overlay",
282
283
  onMouseDown: c === "interactive" ? o.handleClickAway : undefined,
283
284
  key: "clickAway",
package/SidePanel.js CHANGED
@@ -364,7 +364,7 @@
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
+ var l = i ? "interactive" : "hidden";
368
368
 
369
369
  return n().createElement(f(), {
370
370
  childrenInAnimation: a,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.30.0",
3
+ "version": "4.31.0",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -61,9 +61,9 @@
61
61
  "@babel/core": "^7.2.0",
62
62
  "@babel/plugin-transform-runtime": "^7.18.6",
63
63
  "@splunk/babel-preset": "^4.0.0",
64
- "@splunk/docs-gen": "1.0.0-beta.9",
64
+ "@splunk/docs-gen": "1.0.0-beta.10",
65
65
  "@splunk/eslint-config": "^4.0.0",
66
- "@splunk/react-docs": "1.0.0-beta.13",
66
+ "@splunk/react-docs": "1.0.0-beta.14",
67
67
  "@splunk/stylelint-config": "^4.0.0",
68
68
  "@splunk/test-runner-utils": "^0.4.1",
69
69
  "@splunk/webpack-configs": "^7.0.2",
@@ -8,12 +8,17 @@ interface DividerPropsBase {
8
8
  elementRef?: React.Ref<HTMLHRElement>;
9
9
  /** Sets the orientation of this `Divider`. */
10
10
  orientation?: 'horizontal' | 'vertical';
11
+ /**
12
+ * Remove semantics of the divider.
13
+ */
14
+ decorative?: boolean;
11
15
  }
12
- type DividerProps = ComponentProps<DividerPropsBase, 'hr'>;
13
- declare function Divider({ elementRef, orientation, ...otherProps }: DividerProps): JSX.Element;
16
+ type DividerProps = ComponentProps<DividerPropsBase, 'hr' | 'div'>;
17
+ declare function Divider({ elementRef, decorative, orientation, ...otherProps }: DividerProps): JSX.Element;
14
18
  declare namespace Divider {
15
19
  var propTypes: {
16
20
  elementRef: PropTypes.Requireable<object>;
21
+ decorative: PropTypes.Requireable<boolean>;
17
22
  orientation: PropTypes.Requireable<string>;
18
23
  };
19
24
  }
@@ -0,0 +1,2 @@
1
+ declare function Decorative(): JSX.Element;
2
+ export default Decorative;
@@ -1,2 +0,0 @@
1
- declare function AriaHidden(): JSX.Element;
2
- export default AriaHidden;