@splunk/react-ui 4.35.0 → 4.36.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/TabBar.js CHANGED
@@ -74,20 +74,20 @@
74
74
  const o = require("@splunk/ui-utils/keyboard");
75
75
  // CONCATENATED MODULE: external "styled-components"
76
76
  const l = require("styled-components");
77
- var s = e.n(l);
77
+ var c = e.n(l);
78
78
  // CONCATENATED MODULE: external "@splunk/themes"
79
- const c = require("@splunk/themes");
79
+ const s = require("@splunk/themes");
80
80
  // CONCATENATED MODULE: ./src/TabBar/TabBarStyles.ts
81
- var u = s().div.withConfig({
81
+ var u = c().div.withConfig({
82
82
  displayName: "TabBarStyles__Styled",
83
83
  componentId: "sc-1t85fen-0"
84
- })([ "", " position:relative;&::before{content:'';display:block;position:absolute;left:0;top:0;right:0;bottom:0;border:0 solid ", ";}", ";" ], c.mixins.reset("flex"), (0,
85
- c.pick)({
86
- enterprise: c.variables.borderLightColor,
87
- prisma: c.variables.neutral200
88
- }), (0, c.pickVariant)("$layout", {
84
+ })([ "", " position:relative;&::before{content:'';display:block;position:absolute;left:0;top:0;right:0;bottom:0;border:0 solid ", ";}", ";" ], s.mixins.reset("flex"), (0,
85
+ s.pick)({
86
+ enterprise: s.variables.borderLightColor,
87
+ prisma: s.variables.neutral200
88
+ }), (0, s.pickVariant)("$layout", {
89
89
  horizontal: {
90
- prisma: (0, c.pickVariant)("$withUnderline", {
90
+ prisma: (0, s.pickVariant)("$withUnderline", {
91
91
  /* context appearance is only supported for Prisma */
92
92
  true: (0, l.css)([ "&::before{border-bottom-width:1px;}" ])
93
93
  }),
@@ -121,10 +121,10 @@
121
121
  const O = require("@splunk/react-ui/Clickable");
122
122
  var T = e.n(O);
123
123
  // CONCATENATED MODULE: ./src/TabBar/TabStyles.ts
124
- var I = (0, c.pick)({
125
- prisma: (0, l.css)([ "color:", ";" ], c.variables.contentColorActive)
124
+ var I = (0, s.pick)({
125
+ prisma: (0, l.css)([ "color:", ";" ], s.variables.contentColorActive)
126
126
  });
127
- var j = (0, c.pickVariant)("$layout", {
127
+ var j = (0, s.pickVariant)("$layout", {
128
128
  horizontal: {
129
129
  enterprise: (0, l.css)([ "height:3px;" ])
130
130
  },
@@ -132,25 +132,25 @@
132
132
  enterprise: (0, l.css)([ "width:3px;" ])
133
133
  }
134
134
  });
135
- var z = s()(T()).withConfig({
135
+ var z = c()(T()).withConfig({
136
136
  displayName: "TabStyles__StyledClickable",
137
137
  componentId: "sc-1ry8mzj-0"
138
138
  })([ "flex:0 1 auto;display:flow-root;position:relative;line-height:", ";text-align:center;white-space:nowrap;color:", ";&::after{display:block;content:attr(data-title);font-weight:", ";height:0;color:transparent;overflow:hidden;visibility:hidden;}", ";&[aria-selected='true']{cursor:default;", "}&[aria-selected='false']{box-shadow:none;font-weight:", ";&:hover:not([disabled]){", "}&[aria-haspopup='true']{", "}}&:focus{box-shadow:", ";", "}" ], (0,
139
- c.pick)({
139
+ s.pick)({
140
140
  enterprise: "24px",
141
141
  prisma: "20px"
142
- }), c.variables.contentColorDefault, c.variables.fontWeightBold, (0, c.pickVariant)("$layout", {
143
- horizontal: (0, l.css)([ "padding:", ";margin-bottom:1px;" ], (0, c.pick)({
144
- enterprise: (0, c.pickVariant)("$hasMenu", {
142
+ }), s.variables.contentColorDefault, s.variables.fontWeightBold, (0, s.pickVariant)("$layout", {
143
+ horizontal: (0, l.css)([ "padding:", ";margin-bottom:1px;" ], (0, s.pick)({
144
+ enterprise: (0, s.pickVariant)("$hasMenu", {
145
145
  true: "3px 4px 3px 16px",
146
146
  false: "3px 20px"
147
147
  }),
148
148
  prisma: {
149
- comfortable: (0, c.pickVariant)("$hasMenu", {
149
+ comfortable: (0, s.pickVariant)("$hasMenu", {
150
150
  true: "0px 8px 0px 16px",
151
151
  false: "0px 20px"
152
152
  }),
153
- compact: (0, c.pickVariant)("$hasMenu", {
153
+ compact: (0, s.pickVariant)("$hasMenu", {
154
154
  true: "0px 8px 0px 12px",
155
155
  false: "0 16px"
156
156
  })
@@ -161,48 +161,48 @@
161
161
  var t = e.$icon;
162
162
  return t && (0, l.css)([ "text-align:center;" ]);
163
163
  })),
164
- prisma: (0, l.css)([ "width:100%;right:1px;padding:", ";" ], (0, c.pick)({
164
+ prisma: (0, l.css)([ "width:100%;right:1px;padding:", ";" ], (0, s.pick)({
165
165
  comfortable: "0 20px",
166
166
  compact: "0 16px"
167
167
  }))
168
168
  }
169
- }), (0, c.pick)({
170
- enterprise: (0, l.css)([ "font-weight:", ";" ], c.variables.fontWeightBold),
171
- prisma: (0, l.css)([ "color:", ";font-weight:", ";" ], c.variables.contentColorActive, c.variables.fontWeightBold)
172
- }), (0, c.pick)({
169
+ }), (0, s.pick)({
170
+ enterprise: (0, l.css)([ "font-weight:", ";" ], s.variables.fontWeightBold),
171
+ prisma: (0, l.css)([ "color:", ";font-weight:", ";" ], s.variables.contentColorActive, s.variables.fontWeightBold)
172
+ }), (0, s.pick)({
173
173
  enterprise: "normal",
174
- prisma: c.variables.fontWeightSemiBold
175
- }), I, I, c.variables.focusShadowInset, (0, c.pick)({
176
- prisma: (0, l.css)([ "color:", ";" ], c.variables.contentColorActive)
174
+ prisma: s.variables.fontWeightSemiBold
175
+ }), I, I, s.variables.focusShadowInset, (0, s.pick)({
176
+ prisma: (0, l.css)([ "color:", ";" ], s.variables.contentColorActive)
177
177
  }));
178
- var M = s().div.withConfig({
178
+ var E = c().div.withConfig({
179
179
  displayName: "TabStyles__StyledUnderline",
180
180
  componentId: "sc-1ry8mzj-1"
181
181
  })([ "position:absolute;", " ", ";[aria-selected='true'] > &&{background-color:", ";", ";}", ":hover:not([disabled]) > &&{", ";}[aria-selected='false'][aria-haspopup='true'] > &&{", "}" ], (0,
182
- c.pick)({
183
- enterprise: (0, l.css)([ "background:", ";" ], c.variables.borderLightColor)
184
- }), (0, c.pickVariant)("$layout", {
182
+ s.pick)({
183
+ enterprise: (0, l.css)([ "background:", ";" ], s.variables.borderLightColor)
184
+ }), (0, s.pickVariant)("$layout", {
185
185
  horizontal: (0, l.css)([ "height:0;box-sizing:border-box;width:", ";", " transition:height 0.2s;" ], (0,
186
- c.pick)({
186
+ s.pick)({
187
187
  enterprise: "calc(100% - 20px * 2)",
188
188
  prisma: {
189
189
  comfortable: "calc(100% - 20px * 2)",
190
190
  compact: "calc(100% - 16px * 2)"
191
191
  }
192
- }), (0, c.pick)({
192
+ }), (0, s.pick)({
193
193
  enterprise: (0, l.css)([ "bottom:-1px;" ])
194
194
  })),
195
195
  vertical: {
196
196
  enterprise: (0, l.css)([ "width:0;height:calc(100% - 10px * 2);top:10px;right:-1px;transition:width 0.2s;" ]),
197
197
  prisma: (0, l.css)([ "width:1px;height:calc(100% - 10px * 2);top:10px;right:-1px;transition:width 0.2s;box-sizing:border-box;" ])
198
198
  }
199
- }), (0, c.pick)({
200
- enterprise: c.variables.accentColor,
201
- prisma: c.variables.contentColorActive
202
- }), (0, c.pickVariant)("$layout", {
199
+ }), (0, s.pick)({
200
+ enterprise: s.variables.accentColor,
201
+ prisma: s.variables.contentColorActive
202
+ }), (0, s.pickVariant)("$layout", {
203
203
  horizontal: {
204
204
  enterprise: (0, l.css)([ "height:3px;" ]),
205
- prisma: (0, c.pickVariant)("$withUnderline", {
205
+ prisma: (0, s.pickVariant)("$withUnderline", {
206
206
  // context appearance is only supported for Prisma
207
207
  true: (0, l.css)([ "height:1px;" ])
208
208
  })
@@ -214,22 +214,22 @@
214
214
  }),
215
215
  /* sc-sel */
216
216
  z, j, j);
217
- var _ = s().span.withConfig({
217
+ var M = c().span.withConfig({
218
218
  displayName: "TabStyles__StyledMenu",
219
219
  componentId: "sc-1ry8mzj-2"
220
- })([ "display:inline-block;> svg{transform:translateY(-1px);}border-radius:", ";cursor:pointer;", " &:hover{", "}", "[aria-haspopup='true'] &,", ":hover &,", ":focus &{visibility:visible;}" ], c.variables.borderRadius, (0,
221
- c.pickVariant)("$active", {
220
+ })([ "display:inline-block;> svg{transform:translateY(-1px);}border-radius:", ";cursor:pointer;", " &:hover{", "}", "[aria-haspopup='true'] &,", ":hover &,", ":focus &{visibility:visible;}" ], s.variables.borderRadius, (0,
221
+ s.pickVariant)("$active", {
222
222
  false: (0, l.css)([ "visibility:hidden;" ])
223
- }), (0, c.pick)({
223
+ }), (0, s.pick)({
224
224
  enterprise: (0, l.css)([ "color:", ";background-color:", ";border-color:", ";" ], (0,
225
- c.pick)({
226
- light: c.variables.linkColor,
227
- dark: c.variables.white
228
- }), c.variables.backgroundColorHover, (0, c.pick)({
229
- light: c.variables.gray60,
230
- dark: c.variables.borderColor
225
+ s.pick)({
226
+ light: s.variables.linkColor,
227
+ dark: s.variables.white
228
+ }), s.variables.backgroundColorHover, (0, s.pick)({
229
+ light: s.variables.gray60,
230
+ dark: s.variables.borderColor
231
231
  })),
232
- prisma: (0, l.css)([ "background-color:", ";border-color:", ";box-shadow:", ";" ], c.variables.interactiveColorOverlayHover, c.variables.interactiveColorBorderHover, c.variables.hoverShadow)
232
+ prisma: (0, l.css)([ "background-color:", ";border-color:", ";box-shadow:", ";" ], s.variables.interactiveColorOverlayHover, s.variables.interactiveColorBorderHover, s.variables.hoverShadow)
233
233
  }),
234
234
  /* sc-sel */
235
235
  z,
@@ -237,56 +237,56 @@
237
237
  z,
238
238
  /* sc-sel */
239
239
  z);
240
- var E = s().span.withConfig({
240
+ var _ = c().span.withConfig({
241
241
  displayName: "TabStyles__StyledIcon",
242
242
  componentId: "sc-1ry8mzj-3"
243
- })([ "", ";" ], (0, c.pickVariant)("$iconSize", {
243
+ })([ "", ";" ], (0, s.pickVariant)("$iconSize", {
244
244
  inline: (0, l.css)([ "", " text-align:left;padding-right:", ";> svg{transform:translateY(-1px);}" ], (0,
245
- c.pick)({
245
+ s.pick)({
246
246
  prisma: (0, l.css)([ "display:inline-block;width:16px;height:16px;" ])
247
- }), (0, c.pick)({
247
+ }), (0, s.pick)({
248
248
  enterprise: "0.4em",
249
249
  prisma: "8px"
250
250
  })),
251
251
  small: (0, l.css)([ "font-size:24px;height:24px;text-align:center;display:block;padding:4px 0;" ]),
252
252
  large: (0, l.css)([ "font-size:48px;height:48px;text-align:center;display:block;padding:8px 0 0;" ])
253
253
  }));
254
- var P = s().div.withConfig({
254
+ var P = c().div.withConfig({
255
255
  displayName: "TabStyles__StyledLabelAndMenuContainer",
256
256
  componentId: "sc-1ry8mzj-4"
257
257
  })([ "display:flex;align-items:center;justify-content:center;gap:8px;" ]);
258
- var $ = s().div.withConfig({
258
+ var $ = c().div.withConfig({
259
259
  displayName: "TabStyles__StyledLabel",
260
260
  componentId: "sc-1ry8mzj-5"
261
261
  })([ "overflow:hidden;text-overflow:ellipsis;min-width:10px;margin:", ";" ], (0,
262
- c.pick)({
262
+ s.pick)({
263
263
  enterprise: "0",
264
264
  prisma: {
265
265
  comfortable: "16px 0",
266
266
  compact: "10px 0"
267
267
  }
268
268
  }));
269
- var D = s().span.withConfig({
269
+ var R = c().span.withConfig({
270
270
  displayName: "TabStyles__StyledCount",
271
271
  componentId: "sc-1ry8mzj-6"
272
- })([ "display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:", ";margin-inline-start:", ";", " &[disabled]{color:", ";}" ], c.variables.contentColorDefault, (0,
273
- c.pick)({
272
+ })([ "display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:", ";margin-inline-start:", ";", " &[disabled]{color:", ";}" ], s.variables.contentColorDefault, (0,
273
+ s.pick)({
274
274
  enterprise: "inherit",
275
275
  prisma: "10px"
276
- }), (0, c.pick)({
276
+ }), (0, s.pick)({
277
277
  enterprise: "0.4em 0.3em",
278
278
  prisma: "0.4em 0.6em"
279
- }), (0, c.pick)({
279
+ }), (0, s.pick)({
280
280
  enterprise: "0",
281
281
  prisma: "0.3em"
282
- }), (0, c.pick)({
282
+ }), (0, s.pick)({
283
283
  enterprise: (0, l.css)([ "&::before{content:'(';}&::after{content:')';}" ]),
284
- prisma: (0, l.css)([ "background:", ";" ], c.variables.neutral100)
285
- }), c.variables.contentColorDisabled);
286
- var R = s().div.withConfig({
284
+ prisma: (0, l.css)([ "background:", ";" ], s.variables.neutral100)
285
+ }), s.variables.contentColorDisabled);
286
+ var D = c().div.withConfig({
287
287
  displayName: "TabStyles__StyledTooltipContent",
288
288
  componentId: "sc-1ry8mzj-7"
289
- })([ "padding:8px;font-size:", ";" ], c.variables.fontSizeSmall);
289
+ })([ "padding:8px;font-size:", ";" ], s.variables.fontSizeSmall);
290
290
  // CONCATENATED MODULE: ./src/TabBar/TabBarContext.tsx
291
291
  var q = function e() {
292
292
  return undefined;
@@ -579,7 +579,7 @@
579
579
  }, {
580
580
  key: "render",
581
581
  value: function e() {
582
- var t = this.props, r = t.active, i = t.ariaControls, a = t.count, o = t.disabled, l = t.icon, s = t.label, c = t.tabId, u = t.maxCount, p = t.splunkTheme, v = t.to, h = t.tooltip, m = t.menu, x = t.tabKey, w = U(t, [ "active", "ariaControls", "count", "disabled", "icon", "label", "tabId", "maxCount", "splunkTheme", "to", "tooltip", "menu", "tabKey" ]);
582
+ var t = this.props, r = t.active, i = t.ariaControls, a = t.count, o = t.disabled, l = t.icon, c = t.label, s = t.tabId, u = t.maxCount, p = t.splunkTheme, v = t.to, h = t.tooltip, m = t.menu, x = t.tabKey, w = U(t, [ "active", "ariaControls", "count", "disabled", "icon", "label", "tabId", "maxCount", "splunkTheme", "to", "tooltip", "menu", "tabKey" ]);
583
583
  var C = this.state, O = C.anchor, T = C.open;
584
584
  var I = this.context, j = I.appearance, q = I.disabled, A = I.iconSize, V = I.layout, B = I.width, F = I.onMenuOpen, W = I.onMenuClose, L = I.isMenuOpen, H = I.focusedTabKey;
585
585
  var Y = w.style;
@@ -590,7 +590,7 @@
590
590
  width: B
591
591
  } : Y;
592
592
  var Z = p.isEnterprise;
593
- var ee = s ? s.toString() : "";
593
+ var ee = c ? c.toString() : "";
594
594
  var te = a === 0 || a ? "".concat(a === null || a === void 0 ? void 0 : a.toString()) : "";
595
595
  // title is used for CSS styling in TabStyles. labelValue and countValue needs to be included in the title.
596
596
  var re;
@@ -602,7 +602,7 @@
602
602
  re = "".concat(ee, "    ").concat(te);
603
603
  }
604
604
  var ie = H === x && L && !!m;
605
- var ae = n().createElement(_, {
605
+ var ae = n().createElement(M, {
606
606
  $active: r,
607
607
  "data-test": "menu-toggle",
608
608
  tabIndex: -1,
@@ -635,7 +635,7 @@
635
635
  "aria-describedby": m ? this.menuDescription : undefined,
636
636
  "aria-haspopup": ie,
637
637
  "data-test": "tab",
638
- "data-test-tab-id": c,
638
+ "data-test-tab-id": s,
639
639
  "data-test-popover-id": h ? this.popoverId : undefined,
640
640
  $layout: Q,
641
641
  $icon: l && J !== "inline" ? true : undefined,
@@ -656,15 +656,15 @@
656
656
  }), oe( n().createElement($, {
657
657
  "data-test": "label",
658
658
  $withUnderline: j === "navigation"
659
- }, l && n().createElement(E, {
659
+ }, l && n().createElement(_, {
660
660
  $iconSize: J
661
- }, l), s, !m && (a === 0 || a) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(D, {
661
+ }, l), c, !m && (a === 0 || a) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(R, {
662
662
  "data-test": "count",
663
663
  disabled: G
664
664
  }, u ? K(a, u) : a)), !!m && n().createElement(S(), {
665
665
  "aria-hidden": true,
666
666
  id: this.menuDescription
667
- }, (0, f._)("Press Shift + F10 to open the tab’s menu")))), n().createElement(M, {
667
+ }, (0, f._)("Press Shift + F10 to open the tab’s menu")))), n().createElement(E, {
668
668
  $layout: Q,
669
669
  $withUnderline: j === "navigation"
670
670
  }), !o && h && n().createElement(k(), {
@@ -679,7 +679,7 @@
679
679
  id: this.popoverId,
680
680
  open: !!O && T,
681
681
  align: "center"
682
- }, n().createElement(R, null, h)), h && n().createElement(S(), {
682
+ }, n().createElement(D, null, h)), h && n().createElement(S(), {
683
683
  "aria-hidden": "true",
684
684
  id: this.ariaId
685
685
  }, h));
@@ -690,12 +690,12 @@
690
690
  re(ae, "propTypes", ne);
691
691
  re(ae, "defaultProps", ie);
692
692
  re(ae, "contextType", V);
693
- var oe = (0, c.withSplunkTheme)(ae);
693
+ var oe = (0, s.withSplunkTheme)(ae);
694
694
  oe.propTypes = ae.propTypes;
695
695
  /* harmony default export */ const le = oe;
696
696
  // CONCATENATED MODULE: ./src/utils/navigateList.ts
697
697
  // A utility for keyboard navigation of lists
698
- function se(e, t, r) {
698
+ function ce(e, t, r) {
699
699
  for (var n = 0; n < e.length; n += 1) {
700
700
  var i;
701
701
  var a = (n + r) % e.length;
@@ -705,7 +705,7 @@
705
705
  }
706
706
  return e[t];
707
707
  }
708
- function ce(e, t, r) {
708
+ function se(e, t, r) {
709
709
  for (var n = e.length; n > 0; n -= 1) {
710
710
  var i;
711
711
  var a = (n + r) % e.length;
@@ -819,40 +819,46 @@
819
819
  tabWidth: a().number
820
820
  };
821
821
  function ke(e) {
822
- var t = e.activeTabId, i = e.autoActivate, a = e.appearance, l = a === void 0 ? "navigation" : a, s = e.children, c = e.disabled, p = c === void 0 ? false : c, d = e.elementRef, f = e.iconSize, v = f === void 0 ? "inline" : f, b = e.layout, h = b === void 0 ? "horizontal" : b, y = e.onChange, m = e.tabWidth, g = ye(e, [ "activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconSize", "layout", "onChange", "tabWidth" ]);
822
+ var t = e.activeTabId, i = e.autoActivate, a = e.appearance, l = a === void 0 ? "navigation" : a, c = e.children, s = e.disabled, p = s === void 0 ? false : s, d = e.elementRef, f = e.iconSize, v = f === void 0 ? "inline" : f, b = e.layout, h = b === void 0 ? "horizontal" : b, y = e.onChange, m = e.tabWidth, g = ye(e, [ "activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconSize", "layout", "onChange", "tabWidth" ]);
823
823
  // @docs-props-type TabBarPropsBase
824
824
  var x = (0, r.useState)(false), k = pe(x, 2), w = k[0], S = k[1];
825
825
  var C = (0, r.useState)(0), O = pe(C, 2), T = O[0], I = O[1];
826
- var j = (0, r.useRef)([]);
827
- var z = h === "vertical" ? "down" : "right";
828
- var M = h === "vertical" ? "up" : "left";
829
- var _ = (0, r.useCallback)((function(e, t) {
826
+ var j = (0, r.useRef)(T);
827
+ j.current = T;
828
+ var z = (0, r.useRef)("");
829
+ var E = (0, r.useRef)([]);
830
+ var M = h === "vertical" ? "down" : "right";
831
+ var _ = h === "vertical" ? "up" : "left";
832
+ var P = (0, r.useCallback)((function(e, t) {
830
833
  var r = t.tabKey, n = t.tabId;
831
834
  if (r != null) {
832
835
  I(r);
833
836
  }
837
+ if (n != null) {
838
+ z.current = n;
839
+ }
834
840
  if (i) {
835
841
  y === null || y === void 0 ? void 0 : y(e, {
836
842
  selectedTabId: n
837
843
  });
838
844
  }
839
845
  }), [ i, y ]);
840
- var E = (0, r.useCallback)((function(e, t) {
846
+ var $ = (0, r.useCallback)((function(e, t) {
841
847
  y === null || y === void 0 ? void 0 : y(e, {
842
848
  selectedTabId: t.tabId
843
849
  });
844
850
  }), [ y ]);
845
- var P = (0, r.useMemo)((function() {
851
+ var R = (0, r.useMemo)((function() {
846
852
  var e = 0;
847
853
  // reset tabRefs since children are changed
848
- j.current = [];
849
- return r.Children.toArray(s).filter(r.isValidElement).map((function(i) {
854
+ E.current = [];
855
+ return r.Children.toArray(c).filter(r.isValidElement).map((function(i) {
850
856
  // <TabBar> allows non-<Tab> children, pass them through without any modification
851
857
  if (typeof i.type === "string" || i.type.name !== le.name) {
852
858
  return i;
853
859
  }
854
860
  var a = n().createRef();
855
- j.current.push(a);
861
+ E.current.push(a);
856
862
  var o = {
857
863
  active: t === i.props.tabId,
858
864
  tabKey: e,
@@ -862,25 +868,34 @@
862
868
 
863
869
  return (0, r.cloneElement)(i, o);
864
870
  }));
865
- }), [ t, s ]);
866
- var $ = m && m > ge ? m : null;
867
- var D = (0, r.useCallback)((function(e) {
871
+ }), [ t, c ]);
872
+ (0, r.useEffect)((function() {
873
+ R.forEach((function(e, t) {
874
+ // if the focused tab has changed order in the tab bar,
875
+ // then we want to update the focusedTabKey to the new position of the focused tab
876
+ if (z.current != null && z.current === e.props.tabId && j.current !== t) {
877
+ I(t);
878
+ }
879
+ }));
880
+ }), [ R ]);
881
+ var D = m && m > ge ? m : null;
882
+ var q = (0, r.useCallback)((function(e) {
868
883
  var t = (0, o.keycode)(e.nativeEvent);
869
884
  var r;
870
- if (t === z) {
871
- r = se(j.current, T, T + 1);
872
- } else if (t === M) {
873
- r = ce(j.current, T, T - 1);
885
+ if (t === M) {
886
+ r = ce(E.current, T, T + 1);
887
+ } else if (t === _) {
888
+ r = se(E.current, T, T - 1);
874
889
  } else if (t === "home") {
875
- r = se(j.current, T, 0);
890
+ r = ce(E.current, T, 0);
876
891
  } else if (t === "end") {
877
- r = ce(j.current, T, j.current.length - 1);
892
+ r = se(E.current, T, E.current.length - 1);
878
893
  } else if (h === "horizontal" && e.shiftKey && t === "f10") {
879
894
  S((function(e) {
880
895
  if (e) {
881
896
  var t;
882
897
  // if we're closing, we want to shift focus to the tab
883
- var r = j.current[T];
898
+ var r = E.current[T];
884
899
  r === null || r === void 0 ? void 0 : (t = r.current) === null || t === void 0 ? void 0 : t.focus();
885
900
  }
886
901
  return !e;
@@ -893,33 +908,33 @@
893
908
  (n = r.current) === null || n === void 0 ? void 0 : n.focus();
894
909
  e.preventDefault();
895
910
  }
896
- }), [ T, h, z, M ]);
897
- var R = (0, r.useCallback)((function(e) {
911
+ }), [ T, h, M, _ ]);
912
+ var A = (0, r.useCallback)((function(e) {
898
913
  // prevent clicking on the menu icon from changing the active tab
899
914
  e.stopPropagation();
900
915
  S(true);
901
916
  }), []);
902
- var q = (0, r.useCallback)((function(e) {
917
+ var K = (0, r.useCallback)((function(e) {
903
918
  var t = e.event;
904
919
  // prevent content clicks/enter key from changing the active tab
905
920
  t === null || t === void 0 ? void 0 : t.stopPropagation();
906
921
  S(false);
907
922
  }), []);
908
- var A = (0, r.useMemo)((function() {
923
+ var B = (0, r.useMemo)((function() {
909
924
  return {
910
925
  appearance: l,
911
926
  disabled: p,
912
927
  iconSize: v,
913
928
  layout: h,
914
- onClick: E,
915
- onFocus: _,
916
- width: $,
917
- onMenuOpen: R,
918
- onMenuClose: q,
929
+ onClick: $,
930
+ onFocus: P,
931
+ width: D,
932
+ onMenuOpen: A,
933
+ onMenuClose: K,
919
934
  isMenuOpen: w,
920
935
  focusedTabKey: T
921
936
  };
922
- }), [ l, p, T, v, w, h, q, R, E, _, $ ]);
937
+ }), [ l, p, T, v, w, h, K, A, $, P, D ]);
923
938
 
924
939
  return n().createElement(u, ue({
925
940
  "data-tab-layout": h,
@@ -929,10 +944,10 @@
929
944
  ref: d,
930
945
  $layout: h,
931
946
  $withUnderline: l === "navigation",
932
- onKeyDown: D
947
+ onKeyDown: q
933
948
  }, g), n().createElement(V.Provider, {
934
- value: A
935
- }, P));
949
+ value: B
950
+ }, R));
936
951
  }
937
952
  ke.propTypes = xe;
938
953
  ke.Tab = le;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.35.0",
3
+ "version": "4.36.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.",
@@ -15,6 +15,7 @@
15
15
  "eslint:fix": "yarn run eslint --fix",
16
16
  "eslint:ci": "yarn run eslint -f junit -o test-reports/lint-results.xml",
17
17
  "lint": "yarn run eslint && yarn run stylelint",
18
+ "lint:quiet": "yarn run eslint --quiet && yarn run stylelint",
18
19
  "lint:ci": "yarn run eslint:ci && yarn run stylelint",
19
20
  "start": "cross-env NODE_ENV=development webpack --watch",
20
21
  "storybook": "sb dev -p 6006",
@@ -1,6 +1,7 @@
1
1
  import React, { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { AnyTheme } from '@splunk/themes';
4
+ import { ButtonVariant } from './ButtonSimpleStyles';
4
5
  import { ClassComponentProps } from '../utils/types';
5
6
  declare const appearances: ("default" | "flat" | "toggle" | "primary" | "secondary" | "destructive" | "subtle" | "pill")[];
6
7
  type Appearance = typeof appearances[number];
@@ -68,4 +69,5 @@ declare const ButtonSimpleWithTheme: React.ForwardRefExoticComponent<Omit<Pick<P
68
69
  }, "splunkTheme">>;
69
70
  export default ButtonSimpleWithTheme;
70
71
  export type { ButtonSimple as ButtonSimpleWithoutTheme };
72
+ export type { ButtonVariant };
71
73
  export type { ButtonSimplePropsBase };
@@ -106,8 +106,12 @@ interface ComboBoxPropsBase {
106
106
  placeholder?: string;
107
107
  /** Prepend removes rounded borders from the left side. */
108
108
  prepend?: boolean;
109
- /** The size of the text input.
110
- * @themeNotes Supported by the `enterprise` theme only. */
109
+ /**
110
+ * @deprecated
111
+ * This prop is deprecated and will be removed in the next major version.
112
+ * The size of the text input.
113
+ * @themeNotes Supported by the `enterprise` theme only.
114
+ */
111
115
  size?: 'small' | 'medium' | 'large';
112
116
  /** The value of the input. Only applicable in controlled mode. */
113
117
  value?: string;
@@ -118,7 +122,7 @@ interface ComboBoxPropsBase {
118
122
  */
119
123
  virtualization?: number;
120
124
  }
121
- declare const defaultProps: Required<Pick<ComboBoxPropsBase, 'animateLoading' | 'controlledFilter' | 'defaultPlacement' | 'disabled' | 'error' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'placeholder' | 'size'>>;
125
+ declare const defaultProps: Required<Pick<ComboBoxPropsBase, 'animateLoading' | 'controlledFilter' | 'defaultPlacement' | 'disabled' | 'error' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'placeholder'>>;
122
126
  interface ComboBoxPropsBaseControlled extends ComboBoxPropsBase {
123
127
  defaultValue?: never;
124
128
  onChange: ComboBoxChangeHandler;
@@ -152,7 +156,7 @@ declare class ComboBox extends Component<ComboBoxProps, ComboBoxState> {
152
156
  private previousActiveIndex;
153
157
  private textInput;
154
158
  static propTypes: React.WeakValidationMap<ComboBoxProps>;
155
- static defaultProps: Required<Pick<ComboBoxPropsBase, "placeholder" | "disabled" | "size" | "inline" | "error" | "defaultPlacement" | "animateLoading" | "isLoadingOptions" | "menuStyle" | "controlledFilter">>;
159
+ static defaultProps: Required<Pick<ComboBoxPropsBase, "placeholder" | "disabled" | "inline" | "error" | "defaultPlacement" | "animateLoading" | "isLoadingOptions" | "menuStyle" | "controlledFilter">>;
156
160
  static Option: typeof Option;
157
161
  static Divider: typeof Divider;
158
162
  static Heading: typeof Heading;