@splunk/react-ui 4.39.0 → 4.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/Calendar.js +548 -744
  3. package/Card.js +3 -1
  4. package/Chip.js +133 -125
  5. package/ControlGroup.js +27 -30
  6. package/Date.js +158 -161
  7. package/FormRows.js +93 -97
  8. package/Link.js +21 -19
  9. package/MIGRATION.mdx +54 -2
  10. package/Menu.js +1 -1
  11. package/Message.js +136 -123
  12. package/MessageBar.js +59 -57
  13. package/Multiselect.js +2985 -3085
  14. package/Number.js +23 -18
  15. package/Popover.js +2 -1
  16. package/RadioBar.js +19 -15
  17. package/ResultsMenu.js +1208 -1028
  18. package/Select.js +1906 -1998
  19. package/Slider.js +346 -300
  20. package/SlidingPanels.js +166 -148
  21. package/SplitButton.d.ts +2 -0
  22. package/TabBar.js +193 -175
  23. package/TabLayout.js +16 -10
  24. package/Table.js +236 -227
  25. package/TransitionOpen.js +44 -65
  26. package/WaitSpinner.js +1 -1
  27. package/package.json +2 -2
  28. package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -1
  29. package/types/src/Calendar/Calendar.d.ts +28 -30
  30. package/types/src/Calendar/MonthHeader.d.ts +12 -22
  31. package/types/src/Card/Card.d.ts +1 -0
  32. package/types/src/Card/Footer.d.ts +1 -0
  33. package/types/src/Chip/Chip.d.ts +3 -6
  34. package/types/src/Color/Color.d.ts +2 -2
  35. package/types/src/ComboBox/ComboBox.d.ts +1 -1
  36. package/types/src/Date/Date.d.ts +18 -19
  37. package/types/src/File/File.d.ts +1 -1
  38. package/types/src/FormRows/FormRows.d.ts +5 -60
  39. package/types/src/FormRows/Row.d.ts +1 -1
  40. package/types/src/Link/Link.d.ts +7 -0
  41. package/types/src/Link/index.d.ts +1 -0
  42. package/types/src/Menu/Item.d.ts +1 -1
  43. package/types/src/Menu/Menu.d.ts +1 -1
  44. package/types/src/Multiselect/Compact.d.ts +1 -1
  45. package/types/src/Multiselect/Multiselect.d.ts +1 -1
  46. package/types/src/Multiselect/Normal.d.ts +1 -1
  47. package/types/src/Multiselect/Option.d.ts +1 -1
  48. package/types/src/Number/Number.d.ts +2 -2
  49. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  50. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  51. package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +2 -0
  52. package/types/src/Search/Option.d.ts +1 -1
  53. package/types/src/Select/Option.d.ts +5 -1
  54. package/types/src/Select/OptionBase.d.ts +41 -23
  55. package/types/src/Select/Select.d.ts +3 -1
  56. package/types/src/Select/SelectAllOption.d.ts +8 -4
  57. package/types/src/Select/SelectBase.d.ts +76 -66
  58. package/types/src/Select/docs/examples/Appearance.d.ts +0 -2
  59. package/types/src/Slider/Slider.d.ts +7 -16
  60. package/types/src/SlidingPanels/SlidingPanels.d.ts +4 -3
  61. package/types/src/TabBar/TabBar.d.ts +10 -2
  62. package/types/src/TabBar/TabBarContext.d.ts +1 -0
  63. package/types/src/TabBar/docs/examples/IconsAbove.d.ts +2 -0
  64. package/types/src/TabBar/docs/examples/IconsLeft.d.ts +2 -0
  65. package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +2 -0
  66. package/types/src/TabBar/docs/examples/VerticalIconsLeft.d.ts +2 -0
  67. package/types/src/TabLayout/TabLayout.d.ts +4 -2
  68. package/types/src/Table/Cell.d.ts +0 -2
  69. package/types/src/Table/HeadInner.d.ts +5 -1
  70. package/types/src/Table/Row.d.ts +0 -2
  71. package/types/src/Table/Table.d.ts +0 -2
  72. package/types/src/Table/docs/examples/Complex.d.ts +14 -3
  73. package/types/src/Text/Text.d.ts +2 -2
  74. package/types/src/TextArea/TextArea.d.ts +2 -2
  75. package/types/src/Typography/Typography.d.ts +4 -2
  76. package/types/src/WaitSpinner/WaitSpinner.d.ts +0 -1
  77. package/types/src/useControlled/index.d.ts +2 -0
  78. package/types/src/useControlled/useControlled.d.ts +21 -0
  79. package/types/src/useResizeObserver/index.d.ts +2 -0
  80. package/types/src/useResizeObserver/useResizeObserver.d.ts +12 -0
  81. package/useControlled.js +112 -0
  82. package/useKeyPress.d.ts +2 -0
  83. package/useResizeObserver.d.ts +2 -0
  84. package/useResizeObserver.js +137 -0
  85. package/types/src/Chip/docs/examples/Basic.d.ts +0 -2
  86. package/types/src/Chip/docs/examples/prisma/Appearance.d.ts +0 -2
  87. package/types/src/Color/docs/examples/prisma/Controlled.d.ts +0 -2
  88. package/types/src/Color/docs/examples/prisma/ThemeVariables.d.ts +0 -1
  89. package/types/src/Color/docs/examples/prisma/Uncontrolled.d.ts +0 -2
  90. package/types/src/Dropdown/docs/examples/prisma/Basic.d.ts +0 -2
  91. package/types/src/Dropdown/docs/examples/prisma/BasicMenu.d.ts +0 -2
  92. package/types/src/Dropdown/docs/examples/prisma/ControlledDropdown.d.ts +0 -2
  93. package/types/src/Dropdown/docs/examples/prisma/Dialog.d.ts +0 -2
  94. package/types/src/Dropdown/docs/examples/prisma/OtherToggles.d.ts +0 -2
  95. package/types/src/Dropdown/docs/examples/prisma/ScrollingMenu.d.ts +0 -2
  96. package/types/src/File/docs/examples/prisma/Disabled.d.ts +0 -12
  97. package/types/src/Message/docs/examples/Title.d.ts +0 -2
  98. package/types/src/TabBar/docs/examples/IconsInline.d.ts +0 -2
  99. package/types/src/TabBar/docs/examples/IconsSmall.d.ts +0 -2
  100. package/types/src/TabBar/docs/examples/VerticalSmallIcons.d.ts +0 -2
  101. package/types/src/Table/docs/examples/prisma/Complex.d.ts +0 -48
  102. package/types/src/WaitSpinner/docs/examples/prisma/Basic.d.ts +0 -2
  103. /package/types/src/Color/docs/examples/{prisma/CustomizedPalette.d.ts → CustomizedPalette.d.ts} +0 -0
  104. /package/types/src/Color/docs/examples/{prisma/HideInput.d.ts → HideInput.d.ts} +0 -0
  105. /package/types/src/Table/docs/examples/{prisma/RowActions.d.ts → RowActions.d.ts} +0 -0
package/TabBar.js CHANGED
@@ -61,7 +61,7 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- Tab: () => /* reexport */ se,
64
+ Tab: () => /* reexport */ ce,
65
65
  default: () => /* reexport */ Ce
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
@@ -74,20 +74,20 @@
74
74
  const a = require("@splunk/ui-utils/keyboard");
75
75
  // CONCATENATED MODULE: external "styled-components"
76
76
  const l = require("styled-components");
77
- var c = e.n(l);
77
+ var s = e.n(l);
78
78
  // CONCATENATED MODULE: external "@splunk/themes"
79
- const s = require("@splunk/themes");
79
+ const c = require("@splunk/themes");
80
80
  // CONCATENATED MODULE: ./src/TabBar/TabBarStyles.ts
81
- var u = c().div.withConfig({
81
+ var u = s().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 ", ";}", ";" ], s.mixins.reset("flex"), (0,
85
- s.pick)({
86
- enterprise: s.variables.borderLightColor,
87
- prisma: s.variables.neutral200
88
- }), (0, s.pickVariant)("$layout", {
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", {
89
89
  horizontal: {
90
- prisma: (0, s.pickVariant)("$withUnderline", {
90
+ prisma: (0, c.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, s.pick)({
125
- prisma: (0, l.css)([ "color:", ";" ], s.variables.contentColorActive)
124
+ var I = (0, c.pick)({
125
+ prisma: (0, l.css)([ "color:", ";" ], c.variables.contentColorActive)
126
126
  });
127
- var j = (0, s.pickVariant)("$layout", {
127
+ var j = (0, c.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 = c()(T()).withConfig({
135
+ var P = s()(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
- s.pick)({
139
+ c.pick)({
140
140
  enterprise: "24px",
141
141
  prisma: "20px"
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", {
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", {
145
145
  true: "3px 4px 3px 16px",
146
146
  false: "3px 20px"
147
147
  }),
148
148
  prisma: {
149
- comfortable: (0, s.pickVariant)("$hasMenu", {
149
+ comfortable: (0, c.pickVariant)("$hasMenu", {
150
150
  true: "0px 8px 0px 16px",
151
151
  false: "0px 20px"
152
152
  }),
153
- compact: (0, s.pickVariant)("$hasMenu", {
153
+ compact: (0, c.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, s.pick)({
164
+ prisma: (0, l.css)([ "width:100%;right:1px;padding:", ";" ], (0, c.pick)({
165
165
  comfortable: "0 20px",
166
166
  compact: "0 16px"
167
167
  }))
168
168
  }
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)({
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)({
173
173
  enterprise: "normal",
174
- prisma: s.variables.fontWeightSemiBold
175
- }), I, I, s.variables.focusShadowInset, (0, s.pick)({
176
- prisma: (0, l.css)([ "color:", ";" ], s.variables.contentColorActive)
174
+ prisma: c.variables.fontWeightSemiBold
175
+ }), I, I, c.variables.focusShadowInset, (0, c.pick)({
176
+ prisma: (0, l.css)([ "color:", ";" ], c.variables.contentColorActive)
177
177
  }));
178
- var E = c().div.withConfig({
178
+ var z = s().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
- s.pick)({
183
- enterprise: (0, l.css)([ "background:", ";" ], s.variables.borderLightColor)
184
- }), (0, s.pickVariant)("$layout", {
182
+ c.pick)({
183
+ enterprise: (0, l.css)([ "background:", ";" ], c.variables.borderLightColor)
184
+ }), (0, c.pickVariant)("$layout", {
185
185
  horizontal: (0, l.css)([ "height:0;box-sizing:border-box;width:", ";", " transition:height 0.2s;" ], (0,
186
- s.pick)({
186
+ c.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, s.pick)({
192
+ }), (0, c.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, s.pick)({
200
- enterprise: s.variables.accentColor,
201
- prisma: s.variables.contentColorActive
202
- }), (0, s.pickVariant)("$layout", {
199
+ }), (0, c.pick)({
200
+ enterprise: c.variables.accentColor,
201
+ prisma: c.variables.contentColorActive
202
+ }), (0, c.pickVariant)("$layout", {
203
203
  horizontal: {
204
204
  enterprise: (0, l.css)([ "height:3px;" ]),
205
- prisma: (0, s.pickVariant)("$withUnderline", {
205
+ prisma: (0, c.pickVariant)("$withUnderline", {
206
206
  // context appearance is only supported for Prisma
207
207
  true: (0, l.css)([ "height:1px;" ])
208
208
  })
@@ -211,85 +211,88 @@
211
211
  enterprise: (0, l.css)([ "width:3px;" ]),
212
212
  prisma: (0, l.css)([ "width:1px;" ])
213
213
  }
214
- }), /* sc-sel */ z, j, j);
215
- var M = c().span.withConfig({
214
+ }), /* sc-sel */ P, j, j);
215
+ var E = s().span.withConfig({
216
216
  displayName: "TabStyles__StyledMenu",
217
217
  componentId: "sc-1ry8mzj-2"
218
- })([ "display:inline-block;> svg{transform:translateY(-1px);}border-radius:", ";cursor:pointer;", " &:hover{", "}", "[aria-haspopup='true'] &,", ":hover &,", ":focus &{visibility:visible;}" ], s.variables.borderRadius, (0,
219
- s.pickVariant)("$active", {
218
+ })([ "display:inline-block;> svg{transform:translateY(-1px);}border-radius:", ";cursor:pointer;", " &:hover{", "}", "[aria-haspopup='true'] &,", ":hover &,", ":focus &{visibility:visible;}" ], c.variables.borderRadius, (0,
219
+ c.pickVariant)("$active", {
220
220
  false: (0, l.css)([ "visibility:hidden;" ])
221
- }), (0, s.pick)({
221
+ }), (0, c.pick)({
222
222
  enterprise: (0, l.css)([ "color:", ";background-color:", ";border-color:", ";" ], (0,
223
- s.pick)({
224
- light: s.variables.linkColor,
225
- dark: s.variables.white
226
- }), s.variables.backgroundColorHover, (0, s.pick)({
227
- light: s.variables.gray60,
228
- dark: s.variables.borderColor
223
+ c.pick)({
224
+ light: c.variables.linkColor,
225
+ dark: c.variables.white
226
+ }), c.variables.backgroundColorHover, (0, c.pick)({
227
+ light: c.variables.gray60,
228
+ dark: c.variables.borderColor
229
229
  })),
230
- prisma: (0, l.css)([ "background-color:", ";border-color:", ";box-shadow:", ";" ], s.variables.interactiveColorOverlayHover, s.variables.interactiveColorBorderHover, s.variables.hoverShadow)
231
- }), /* sc-sel */ z, /* sc-sel */ z, /* sc-sel */ z);
232
- var _ = c().span.withConfig({
230
+ prisma: (0, l.css)([ "background-color:", ";border-color:", ";box-shadow:", ";" ], c.variables.interactiveColorOverlayHover, c.variables.interactiveColorBorderHover, c.variables.hoverShadow)
231
+ }), /* sc-sel */ P, /* sc-sel */ P, /* sc-sel */ P);
232
+ var M = s().span.withConfig({
233
233
  displayName: "TabStyles__StyledIcon",
234
234
  componentId: "sc-1ry8mzj-3"
235
- })([ "", ";" ], (0, s.pickVariant)("$iconSize", {
236
- inline: (0, l.css)([ "", " text-align:left;padding-right:", ";> svg{transform:translateY(-1px);}" ], (0,
237
- s.pick)({
238
- prisma: (0, l.css)([ "display:inline-block;width:16px;height:16px;" ])
239
- }), (0, s.pick)({
235
+ })([ "", " ", ";" ], (0, c.pickVariant)("$iconPosition", {
236
+ above: (0, l.css)([ "display:block;text-align:center;" ]),
237
+ left: (0, l.css)([ "text-align:left;padding-right:", ";> svg{transform:translateY(-1px);}" ], (0,
238
+ c.pick)({
240
239
  enterprise: "0.4em",
241
240
  prisma: "8px"
241
+ }))
242
+ }), (0, c.pickVariant)("$iconSize", {
243
+ inline: (0, l.css)([ "", "" ], (0, c.pick)({
244
+ prisma: (0, l.css)([ "display:inline-block;width:16px;height:16px;" ])
242
245
  })),
243
- small: (0, l.css)([ "font-size:24px;height:24px;text-align:center;display:block;padding:4px 0;" ]),
244
- large: (0, l.css)([ "font-size:48px;height:48px;text-align:center;display:block;padding:8px 0 0;" ])
246
+ small: (0, l.css)([ "font-size:24px;height:24px;padding:4px 0;" ]),
247
+ large: (0, l.css)([ "font-size:48px;height:48px;padding:8px 0 0;" ])
245
248
  }));
246
- var P = c().div.withConfig({
249
+ var _ = s().div.withConfig({
247
250
  displayName: "TabStyles__StyledLabelAndMenuContainer",
248
251
  componentId: "sc-1ry8mzj-4"
249
252
  })([ "display:flex;align-items:center;justify-content:center;gap:8px;" ]);
250
- var $ = c().div.withConfig({
253
+ var $ = s().div.withConfig({
251
254
  displayName: "TabStyles__StyledLabel",
252
255
  componentId: "sc-1ry8mzj-5"
253
256
  })([ "overflow:hidden;text-overflow:ellipsis;min-width:10px;margin:", ";" ], (0,
254
- s.pick)({
257
+ c.pick)({
255
258
  enterprise: "0",
256
259
  prisma: {
257
260
  comfortable: "16px 0",
258
261
  compact: "10px 0"
259
262
  }
260
263
  }));
261
- var D = c().span.withConfig({
264
+ var D = s().span.withConfig({
262
265
  displayName: "TabStyles__StyledCount",
263
266
  componentId: "sc-1ry8mzj-6"
264
- })([ "display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:", ";margin-inline-start:", ";", " &[disabled]{color:", ";}" ], s.variables.contentColorDefault, (0,
265
- s.pick)({
267
+ })([ "display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:", ";margin-inline-start:", ";", " &[disabled]{color:", ";}" ], c.variables.contentColorDefault, (0,
268
+ c.pick)({
266
269
  enterprise: "inherit",
267
270
  prisma: "10px"
268
- }), (0, s.pick)({
271
+ }), (0, c.pick)({
269
272
  enterprise: "0.4em 0.3em",
270
273
  prisma: "0.4em 0.6em"
271
- }), (0, s.pick)({
274
+ }), (0, c.pick)({
272
275
  enterprise: "0",
273
276
  prisma: "0.3em"
274
- }), (0, s.pick)({
277
+ }), (0, c.pick)({
275
278
  enterprise: (0, l.css)([ "&::before{content:'(';}&::after{content:')';}" ]),
276
- prisma: (0, l.css)([ "background:", ";" ], s.variables.neutral100)
277
- }), s.variables.contentColorDisabled);
278
- var R = c().div.withConfig({
279
+ prisma: (0, l.css)([ "background:", ";" ], c.variables.neutral100)
280
+ }), c.variables.contentColorDisabled);
281
+ var R = s().div.withConfig({
279
282
  displayName: "TabStyles__StyledTooltipContent",
280
283
  componentId: "sc-1ry8mzj-7"
281
- })([ "padding:8px;font-size:", ";" ], s.variables.fontSizeSmall);
284
+ })([ "padding:8px;font-size:", ";" ], c.variables.fontSizeSmall);
282
285
  // CONCATENATED MODULE: ./src/TabBar/TabBarContext.tsx
283
286
  var q = function e() {
284
287
  return undefined;
285
288
  };
286
- var A = (0, r.createContext)({
289
+ var V = (0, r.createContext)({
287
290
  onMenuOpen: q,
288
291
  onMenuClose: q,
289
292
  isMenuOpen: false
290
293
  });
291
- A.displayName = "TabBar";
292
- /* harmony default export */ const V = A;
294
+ V.displayName = "TabBar";
295
+ /* harmony default export */ const A = V;
293
296
  // CONCATENATED MODULE: ./src/utils/getCountValue.ts
294
297
  // A utility for max count
295
298
  var K = function e(t, r) {
@@ -551,69 +554,71 @@
551
554
  }, {
552
555
  key: "render",
553
556
  value: function e() {
554
- var t = this.props, r = t.active, i = t.ariaControls, o = t.count, a = 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" ]);
557
+ var t = this.props, r = t.active, i = t.ariaControls, o = t.count, a = 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" ]);
555
558
  var C = this.state, O = C.anchor, T = C.open;
556
- var I = this.context, j = I.appearance, q = I.disabled, A = I.iconSize, V = I.layout, B = I.width, N = I.onMenuOpen, W = I.onMenuClose, L = I.isMenuOpen, H = I.focusedTabKey;
557
- var Y = w.style;
558
- var G = q || a || false;
559
- var J = A || "inline";
560
- var Q = V || "horizontal";
561
- var X = B ? {
562
- width: B
563
- } : Y;
564
- var Z = p.isEnterprise;
565
- var ee = c ? c.toString() : "";
566
- var te = o === 0 || o ? "".concat(o === null || o === void 0 ? void 0 : o.toString()) : "";
567
- // title is used for CSS styling in TabStyles. labelValue and countValue needs to be included in the title.
568
- var re;
569
- if (Z) {
570
- // countValue needs unicode space for width to not change after it's clicked.
571
- var ne = te ? "(".concat(te, ")  ") : "";
572
- re = "".concat(ee, " ").concat(ne);
573
- } else {
574
- re = "".concat(ee, "    ").concat(te);
559
+ var I = this.context, j = I.appearance, q = I.disabled, V = I.iconPosition, A = V === void 0 ? "above" : V, B = I.iconSize, N = I.layout, W = N === void 0 ? "horizontal" : N, L = I.width, H = I.onMenuOpen, Y = I.onMenuClose, G = I.isMenuOpen, J = I.focusedTabKey;
560
+ var Q = w.style;
561
+ var X = q || a || false;
562
+ var Z = L ? {
563
+ width: L
564
+ } : Q;
565
+ var ee = p.isEnterprise;
566
+ var te = "";
567
+ // SUI-6877: if the label isn't a string, don't attempt to do this since it'll just be wrong
568
+ if (s && typeof s === "string") {
569
+ var re = s ? s.toString() : "";
570
+ var ne = o === 0 || o ? "".concat(o === null || o === void 0 ? void 0 : o.toString()) : "";
571
+ // titleValue is used for CSS styling in TabStyles. labelValue and countValue needs to be included in the title.
572
+ if (ee) {
573
+ // countValue needs unicode space for width to not change after it's clicked.
574
+ var ie = ne ? "(".concat(ne, ")  ") : "";
575
+ te = "".concat(re, " ").concat(ie);
576
+ } else {
577
+ te = "".concat(re, "    ").concat(ne);
578
+ }
575
579
  }
576
- var ie = H === x && L && !!m;
577
- var oe = n().createElement(M, {
580
+ var oe = J === x && G && !!m;
581
+ var ae = n().createElement(E, {
578
582
  $active: r,
579
583
  "data-test": "menu-toggle",
580
584
  tabIndex: -1,
581
585
  onFocus: this.handleFocusMenuToggle
582
- }, Z ? n().createElement(g(), {
586
+ }, ee ? n().createElement(g(), {
583
587
  size: 1.1
584
588
  }) : n().createElement(b(), null));
585
- var ae = function e(t) {
589
+ var le = function e(t) {
586
590
  // if there is no menu, or if we are not in horizontal, do not render menu container
587
- if (!m || Q !== "horizontal") {
591
+ if (!m || W !== "horizontal") {
588
592
  return t;
589
593
  }
590
594
 
591
- return n().createElement(P, null, t, n().createElement(y(), {
592
- toggle: oe,
595
+ return n().createElement(_, null, t, n().createElement(y(), {
596
+ toggle: ae,
593
597
  align: "center",
594
- onRequestOpen: N,
595
- onRequestClose: W,
596
- open: ie
598
+ onRequestOpen: H,
599
+ onRequestClose: Y,
600
+ open: oe
597
601
  }, m));
598
602
  };
599
603
 
600
604
  // TODO: Fix the ts error: https://splunk.atlassian.net/browse/SUI-5569
601
605
  // eslint-disable-next-line
602
606
  // @ts-ignore-next-line
603
- return n().createElement(z, F({
607
+ return n().createElement(P, F({
604
608
  "aria-controls": i,
605
609
  "aria-selected": r,
606
610
  "aria-labelledby": this.ariaId,
607
611
  "aria-describedby": m ? this.menuDescription : undefined,
608
- "aria-haspopup": ie,
612
+ "aria-haspopup": oe,
609
613
  "data-test": "tab",
610
- "data-test-tab-id": s,
614
+ "data-test-tab-id": c,
611
615
  "data-test-popover-id": h ? this.popoverId : undefined,
612
- $layout: Q,
613
- $icon: l && J !== "inline" ? true : undefined,
614
- disabled: G,
615
- style: X,
616
- elementRef: this.handleMount
616
+ $layout: W,
617
+ $icon: l && B !== "inline" ? true : undefined,
618
+ disabled: X,
619
+ style: Z,
620
+ elementRef: this.handleMount,
621
+ "data-title": te
617
622
  }, d()(w, "elementRef"), {
618
623
  onClick: this.handleClick,
619
624
  onFocus: this.handleFocus,
@@ -622,22 +627,22 @@
622
627
  onMouseLeave: this.handleTooltipClose,
623
628
  role: "tab",
624
629
  tabIndex: r ? undefined : -1,
625
- "data-title": re,
626
630
  to: v,
627
631
  $hasMenu: !!m
628
- }), ae( n().createElement($, {
632
+ }), le( n().createElement($, {
629
633
  "data-test": "label",
630
634
  $withUnderline: j === "navigation"
631
- }, l && n().createElement(_, {
632
- $iconSize: J
633
- }, l), c, !m && (o === 0 || o) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(D, {
635
+ }, l && n().createElement(M, {
636
+ $iconPosition: A,
637
+ $iconSize: B
638
+ }, l), s, !m && (o === 0 || o) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(D, {
634
639
  "data-test": "count",
635
- disabled: G
640
+ disabled: X
636
641
  }, u ? K(o, u) : o)), !!m && n().createElement(S(), {
637
642
  "aria-hidden": true,
638
643
  id: this.menuDescription
639
- }, (0, f._)("Press Shift + F10 to open the tab’s menu")))), n().createElement(E, {
640
- $layout: Q,
644
+ }, (0, f._)("Press Shift + F10 to open the tab’s menu")))), n().createElement(z, {
645
+ $layout: W,
641
646
  $withUnderline: j === "navigation"
642
647
  }), !a && h && n().createElement(k(), {
643
648
  role: "tooltip",
@@ -647,7 +652,7 @@
647
652
  },
648
653
  appearance: "inverted",
649
654
  closeReasons: [ "offScreen", "escapeKey" ],
650
- defaultPlacement: Q === "vertical" ? "right" : "above",
655
+ defaultPlacement: W === "vertical" ? "right" : "above",
651
656
  id: this.popoverId,
652
657
  open: !!O && T,
653
658
  align: "center"
@@ -661,10 +666,10 @@
661
666
  }(r.Component);
662
667
  re(le, "propTypes", oe);
663
668
  re(le, "defaultProps", ae);
664
- re(le, "contextType", V);
665
- var ce = (0, s.withSplunkTheme)(le);
666
- ce.propTypes = le.propTypes;
667
- /* harmony default export */ const se = ce;
669
+ re(le, "contextType", A);
670
+ var se = (0, c.withSplunkTheme)(le);
671
+ se.propTypes = le.propTypes;
672
+ /* harmony default export */ const ce = se;
668
673
  // CONCATENATED MODULE: ./src/utils/navigateList.ts
669
674
  // A utility for keyboard navigation of lists
670
675
  function ue(e, t, r) {
@@ -722,20 +727,20 @@
722
727
  function ye(e, t) {
723
728
  var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
724
729
  if (null != r) {
725
- var n, i, o, a, l = [], c = !0, s = !1;
730
+ var n, i, o, a, l = [], s = !0, c = !1;
726
731
  try {
727
732
  if (o = (r = r.call(e)).next, 0 === t) {
728
733
  if (Object(r) !== r) return;
729
- c = !1;
730
- } else for (;!(c = (n = o.call(r)).done) && (l.push(n.value), l.length !== t); c = !0) {
734
+ s = !1;
735
+ } else for (;!(s = (n = o.call(r)).done) && (l.push(n.value), l.length !== t); s = !0) {
731
736
  }
732
737
  } catch (e) {
733
- s = !0, i = e;
738
+ c = !0, i = e;
734
739
  } finally {
735
740
  try {
736
- if (!c && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
741
+ if (!s && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
737
742
  } finally {
738
- if (s) throw i;
743
+ if (c) throw i;
739
744
  }
740
745
  }
741
746
  return l;
@@ -776,30 +781,42 @@
776
781
  /** @private */
777
782
  disabled: o().bool,
778
783
  elementRef: o().oneOfType([ o().func, o().object ]),
784
+ iconPosition: o().oneOf([ "above", "left" ]),
779
785
  iconSize: o().oneOf([ "inline", "small", "large" ]),
780
786
  layout: o().oneOf([ "horizontal", "vertical" ]),
781
787
  onChange: o().func,
782
788
  tabWidth: o().number
783
789
  };
784
790
  function Se(e) {
785
- var t = e.activeTabId, i = e.autoActivate, o = e.appearance, l = o === void 0 ? "navigation" : o, 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 = ge(e, [ "activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconSize", "layout", "onChange", "tabWidth" ]);
791
+ var t = e.activeTabId, i = e.autoActivate, o = e.appearance, l = o === void 0 ? "navigation" : o, s = e.children, c = e.disabled, p = c === void 0 ? false : c, d = e.elementRef, f = e.iconPosition, v = e.iconSize, b = e.layout, h = b === void 0 ? "horizontal" : b, y = e.onChange, m = e.tabWidth, g = ge(e, [ "activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconPosition", "iconSize", "layout", "onChange", "tabWidth" ]);
786
792
  // @docs-props-type TabBarPropsBase
787
793
  var x = (0, r.useState)(false), k = fe(x, 2), w = k[0], S = k[1];
788
794
  var C = (0, r.useState)(0), O = fe(C, 2), T = O[0], I = O[1];
789
795
  var j = (0, r.useRef)(T);
790
796
  j.current = T;
791
- var z = (0, r.useRef)("");
792
- var E = (0, r.useRef)([]);
793
- var M = h === "vertical" ? "down" : "right";
794
- var _ = h === "vertical" ? "up" : "left";
797
+ var P = (0, r.useRef)("");
798
+ var z = (0, r.useRef)([]);
799
+ var E = h === "vertical" ? "down" : "right";
800
+ var M = h === "vertical" ? "up" : "left";
801
+ if (false) {}
802
+ var _ = f;
803
+ var $;
795
804
  if (false) {}
796
- var P = (0, r.useCallback)((function(e, t) {
805
+ if (_ == null) {
806
+ $ = v;
807
+ if (v != null) {
808
+ _ = v === "inline" ? "left" : "above";
809
+ } else {
810
+ _ = "left";
811
+ }
812
+ } else if (false) {}
813
+ var D = (0, r.useCallback)((function(e, t) {
797
814
  var r = t.tabKey, n = t.tabId;
798
815
  if (r != null) {
799
816
  I(r);
800
817
  }
801
818
  if (n != null) {
802
- z.current = n;
819
+ P.current = n;
803
820
  }
804
821
  if (i) {
805
822
  y === null || y === void 0 ? void 0 : y(e, {
@@ -807,22 +824,22 @@
807
824
  });
808
825
  }
809
826
  }), [ i, y ]);
810
- var $ = (0, r.useCallback)((function(e, t) {
827
+ var R = (0, r.useCallback)((function(e, t) {
811
828
  y === null || y === void 0 ? void 0 : y(e, {
812
829
  selectedTabId: t.tabId
813
830
  });
814
831
  }), [ y ]);
815
- var D = (0, r.useMemo)((function() {
832
+ var q = (0, r.useMemo)((function() {
816
833
  var e = 0;
817
834
  // reset tabRefs since children are changed
818
- E.current = [];
819
- return r.Children.toArray(c).filter(r.isValidElement).map((function(i) {
835
+ z.current = [];
836
+ return r.Children.toArray(s).filter(r.isValidElement).map((function(i) {
820
837
  // <TabBar> allows non-<Tab> children, pass them through without any modification
821
- if (typeof i.type === "string" || i.type.name !== se.name) {
838
+ if (typeof i.type === "string" || i.type.name !== ce.name) {
822
839
  return i;
823
840
  }
824
841
  var o = n().createRef();
825
- E.current.push(o);
842
+ z.current.push(o);
826
843
  var a = {
827
844
  active: t === i.props.tabId,
828
845
  tabKey: e,
@@ -832,34 +849,34 @@
832
849
 
833
850
  return (0, r.cloneElement)(i, a);
834
851
  }));
835
- }), [ t, c ]);
852
+ }), [ t, s ]);
836
853
  (0, r.useEffect)((function() {
837
- D.forEach((function(e, t) {
854
+ q.forEach((function(e, t) {
838
855
  // if the focused tab has changed order in the tab bar,
839
856
  // then we want to update the focusedTabKey to the new position of the focused tab
840
- if (z.current != null && z.current === e.props.tabId && j.current !== t) {
857
+ if (P.current != null && P.current === e.props.tabId && j.current !== t) {
841
858
  I(t);
842
859
  }
843
860
  }));
844
- }), [ D ]);
845
- var R = m && m > ke ? m : null;
846
- var q = (0, r.useCallback)((function(e) {
861
+ }), [ q ]);
862
+ var V = m && m > ke ? m : null;
863
+ var K = (0, r.useCallback)((function(e) {
847
864
  var t = (0, a.keycode)(e.nativeEvent);
848
865
  var r;
849
- if (t === M) {
850
- r = ue(E.current, T, T + 1);
851
- } else if (t === _) {
852
- r = pe(E.current, T, T - 1);
866
+ if (t === E) {
867
+ r = ue(z.current, T, T + 1);
868
+ } else if (t === M) {
869
+ r = pe(z.current, T, T - 1);
853
870
  } else if (t === "home") {
854
- r = ue(E.current, T, 0);
871
+ r = ue(z.current, T, 0);
855
872
  } else if (t === "end") {
856
- r = pe(E.current, T, E.current.length - 1);
873
+ r = pe(z.current, T, z.current.length - 1);
857
874
  } else if (h === "horizontal" && e.shiftKey && t === "f10") {
858
875
  S((function(e) {
859
876
  if (e) {
860
877
  var t;
861
878
  // if we're closing, we want to shift focus to the tab
862
- var r = E.current[T];
879
+ var r = z.current[T];
863
880
  r === null || r === void 0 ? void 0 : (t = r.current) === null || t === void 0 ? void 0 : t.focus();
864
881
  }
865
882
  return !e;
@@ -872,33 +889,34 @@
872
889
  (n = r.current) === null || n === void 0 ? void 0 : n.focus();
873
890
  e.preventDefault();
874
891
  }
875
- }), [ T, h, M, _ ]);
876
- var A = (0, r.useCallback)((function(e) {
892
+ }), [ T, h, E, M ]);
893
+ var B = (0, r.useCallback)((function(e) {
877
894
  // prevent clicking on the menu icon from changing the active tab
878
895
  e.stopPropagation();
879
896
  S(true);
880
897
  }), []);
881
- var K = (0, r.useCallback)((function(e) {
898
+ var N = (0, r.useCallback)((function(e) {
882
899
  var t = e.event;
883
900
  // prevent content clicks/enter key from changing the active tab
884
901
  t === null || t === void 0 ? void 0 : t.stopPropagation();
885
902
  S(false);
886
903
  }), []);
887
- var B = (0, r.useMemo)((function() {
904
+ var F = (0, r.useMemo)((function() {
888
905
  return {
889
906
  appearance: l,
890
907
  disabled: p,
891
- iconSize: v,
908
+ iconPosition: _,
909
+ iconSize: $,
892
910
  layout: h,
893
- onClick: $,
894
- onFocus: P,
895
- width: R,
896
- onMenuOpen: A,
897
- onMenuClose: K,
911
+ onClick: R,
912
+ onFocus: D,
913
+ width: V,
914
+ onMenuOpen: B,
915
+ onMenuClose: N,
898
916
  isMenuOpen: w,
899
917
  focusedTabKey: T
900
918
  };
901
- }), [ l, p, T, v, w, h, K, A, $, P, R ]);
919
+ }), [ l, p, T, _, $, w, h, N, B, R, D, V ]);
902
920
 
903
921
  return n().createElement(u, de({
904
922
  "data-tab-layout": h,
@@ -908,13 +926,13 @@
908
926
  ref: d,
909
927
  $layout: h,
910
928
  $withUnderline: l === "navigation",
911
- onKeyDown: q
912
- }, g), n().createElement(V.Provider, {
913
- value: B
914
- }, D));
929
+ onKeyDown: K
930
+ }, g), n().createElement(A.Provider, {
931
+ value: F
932
+ }, q));
915
933
  }
916
934
  Se.propTypes = we;
917
- Se.Tab = se;
935
+ Se.Tab = ce;
918
936
  /* harmony default export */ const Ce = Se;
919
937
  // CONCATENATED MODULE: ./src/TabBar/index.ts
920
938
  module.exports = t;