@splunk/react-ui 5.0.0-beta.3 → 5.0.0-beta.5
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/Accordion.js +185 -243
- package/Animation.js +2 -2
- package/Button.js +4 -2
- package/ButtonSimple.js +47 -41
- package/CHANGELOG.md +15 -2
- package/CHANGELOG.v5.mdx +73 -0
- package/Calendar.js +352 -469
- package/Card.js +163 -162
- package/Chip.js +171 -356
- package/Clickable.js +79 -76
- package/Code.js +19 -12
- package/Color.js +32 -32
- package/ComboBox.js +9 -7
- package/Date.js +160 -184
- package/DualListbox.js +549 -612
- package/File.js +546 -408
- package/FormRows.js +170 -157
- package/Image.js +124 -251
- package/JSONTree.js +496 -521
- package/Layer.js +162 -97
- package/Layout.d.ts +2 -0
- package/Link.js +20 -13
- package/MIGRATION.v5.mdx +48 -1
- package/Markdown.js +1 -1
- package/Menu.js +1 -1
- package/Message.js +132 -177
- package/MessageBar.js +121 -290
- package/Modal.js +2 -2
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1982 -2334
- package/NonInteractiveCheckbox.js +29 -117
- package/Number.js +114 -114
- package/Popover.js +328 -326
- package/Progress.js +68 -54
- package/RadioBar.js +139 -136
- package/RadioList.js +67 -65
- package/Resize.js +377 -265
- package/ResultsMenu.js +573 -661
- package/Scroll.js +2 -2
- package/ScrollContainerContext.js +13 -9
- package/Search.js +1 -1
- package/Select.js +364 -361
- package/SidePanel.js +17 -21
- package/Slider.js +494 -372
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +39 -25
- package/StepBar.js +3 -3
- package/Switch.js +136 -129
- package/TabBar.js +598 -466
- package/TabLayout.js +34 -34
- package/Table.js +1648 -1479
- package/Text.js +51 -50
- package/TextArea.js +280 -154
- package/Tooltip.js +413 -563
- package/TransitionOpen.js +2 -2
- package/Tree.js +2 -2
- package/Typography.js +30 -28
- package/WaitSpinner.js +6 -11
- package/cypress/support/commands.ts +14 -4
- package/cypress/support/index.d.ts +1 -1
- package/package.json +9 -11
- package/stubs-splunkui.d.ts +0 -4
- package/types/src/Accordion/Accordion.d.ts +14 -21
- package/types/src/Accordion/AccordionContext.d.ts +0 -1
- package/types/src/Animation/Animation.d.ts +2 -3
- package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
- package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
- package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
- package/types/src/Button/Button.d.ts +1 -1
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Calendar/Calendar.d.ts +2 -2
- package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
- package/types/src/Calendar/Day.d.ts +8 -4
- package/types/src/Card/Card.d.ts +3 -1
- package/types/src/Card/Header.d.ts +2 -0
- package/types/src/Card/docs/examples/HeadingTitle.d.ts +3 -0
- package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
- package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
- package/types/src/Clickable/Clickable.d.ts +12 -4
- package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
- package/types/src/ComboBox/ComboBox.d.ts +3 -3
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
- package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
- package/types/src/DualListbox/DualListbox.d.ts +5 -1
- package/types/src/File/File.d.ts +4 -4
- package/types/src/File/FileContext.d.ts +0 -1
- package/types/src/File/Item.d.ts +11 -3
- package/types/src/File/ItemIcon.d.ts +2 -1
- package/types/src/File/docs/examples/Disabled.d.ts +2 -2
- package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
- package/types/src/File/docs/examples/Multi.d.ts +2 -2
- package/types/src/File/docs/examples/Single.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +4 -4
- package/types/src/FormRows/FormRowsContext.d.ts +1 -2
- package/types/src/FormRows/SortableRow.d.ts +1 -1
- package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
- package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
- package/types/src/Image/Image.d.ts +1 -4
- package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
- package/types/src/Layout/Layout.d.ts +1 -0
- package/types/src/Link/Link.d.ts +4 -0
- package/types/src/Link/icons/External.d.ts +1 -2
- package/types/src/Menu/Divider.d.ts +1 -1
- package/types/src/Menu/MenuContext.d.ts +0 -1
- package/types/src/Message/Message.d.ts +1 -1
- package/types/src/MessageBar/MessageBar.d.ts +6 -2
- package/types/src/Modal/ModalContext.d.ts +0 -1
- package/types/src/Multiselect/Compact.d.ts +46 -21
- package/types/src/Multiselect/Multiselect.d.ts +69 -36
- package/types/src/Multiselect/Normal.d.ts +45 -62
- package/types/src/Multiselect/Option.d.ts +42 -18
- package/types/src/Multiselect/docs/examples/Children.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Error.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -22
- package/types/src/Multiselect/docs/examples/Headings.d.ts +2 -1
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -25
- package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -9
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +8 -7
- package/types/src/Number/docs/examples/Basic.d.ts +2 -2
- package/types/src/Number/docs/examples/Limits.d.ts +2 -2
- package/types/src/Number/docs/examples/Locale.d.ts +2 -2
- package/types/src/Popover/Popover.d.ts +1 -1
- package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
- package/types/src/RadioBar/RadioBar.d.ts +1 -1
- package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
- package/types/src/RadioList/RadioListContext.d.ts +0 -1
- package/types/src/ResultsMenu/ResultsMenu.d.ts +23 -34
- package/types/src/Scroll/Inner.d.ts +1 -1
- package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Search/Search.d.ts +2 -2
- package/types/src/Select/SelectBase.d.ts +4 -4
- package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
- package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
- package/types/src/SlidingPanels/Panel.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
- package/types/src/SplitButton/Item.d.ts +15 -2
- package/types/src/StepBar/Step.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +1 -1
- package/types/src/StepBar/StepBarContext.d.ts +0 -1
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
- package/types/src/TabBar/Tab.d.ts +12 -5
- package/types/src/TabBar/TabBar.d.ts +11 -7
- package/types/src/TabBar/TabBarContext.d.ts +8 -3
- package/types/src/TabLayout/TabLayout.d.ts +8 -5
- package/types/src/Table/Head.d.ts +4 -15
- package/types/src/Table/HeadCell.d.ts +23 -25
- package/types/src/Table/HeadDropdownCell.d.ts +23 -26
- package/types/src/Table/HeadInner.d.ts +4 -10
- package/types/src/Table/Row.d.ts +6 -6
- package/types/src/Table/Table.d.ts +3 -8
- package/types/src/Table/TableContext.d.ts +0 -1
- package/types/src/Tooltip/Tooltip.d.ts +26 -58
- package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Tree/TreeContext.d.ts +0 -1
- package/types/src/Typography/Typography.d.ts +27 -22
- package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
- package/types/src/utils/types.d.ts +2 -3
- package/useResizeObserver.js +26 -19
- package/types/src/Date/Icon.d.ts +0 -3
- package/types/src/Image/icons/Cross.d.ts +0 -3
- package/types/src/TabBar/docs/examples/IconsAbove.d.ts +0 -3
- package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +0 -3
- package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
- package/types/src/Tooltip/InfoIcon.d.ts +0 -4
- /package/types/src/TabBar/docs/examples/{IconsLeft.d.ts → Icons.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{VerticalIconsLeft.d.ts → VerticalIcons.d.ts} +0 -0
package/Layer.js
CHANGED
|
@@ -73,28 +73,28 @@
|
|
|
73
73
|
e.r(t);
|
|
74
74
|
// EXPORTS
|
|
75
75
|
e.d(t, {
|
|
76
|
-
LayerContext: () => /* reexport */
|
|
77
|
-
LayerStackContext: () => /* reexport */
|
|
78
|
-
LayerStackGlobalProvider: () => /* reexport */
|
|
79
|
-
default: () => /* reexport */
|
|
76
|
+
LayerContext: () => /* reexport */ b,
|
|
77
|
+
LayerStackContext: () => /* reexport */ g,
|
|
78
|
+
LayerStackGlobalProvider: () => /* reexport */ E,
|
|
79
|
+
default: () => /* reexport */ G
|
|
80
80
|
});
|
|
81
81
|
// CONCATENATED MODULE: external "react"
|
|
82
82
|
const n = require("react");
|
|
83
83
|
var r = e.n(n);
|
|
84
84
|
// CONCATENATED MODULE: external "react-dom"
|
|
85
|
-
const
|
|
85
|
+
const o = require("react-dom");
|
|
86
86
|
// CONCATENATED MODULE: external "prop-types"
|
|
87
|
-
const
|
|
88
|
-
var i = e.n(
|
|
87
|
+
const a = require("prop-types");
|
|
88
|
+
var i = e.n(a);
|
|
89
89
|
// CONCATENATED MODULE: external "lodash/includes"
|
|
90
|
-
const
|
|
91
|
-
var
|
|
90
|
+
const u = require("lodash/includes");
|
|
91
|
+
var l = e.n(u);
|
|
92
92
|
// CONCATENATED MODULE: external "lodash/last"
|
|
93
93
|
const c = require("lodash/last");
|
|
94
94
|
var s = e.n(c);
|
|
95
95
|
// CONCATENATED MODULE: external "lodash/pull"
|
|
96
|
-
const
|
|
97
|
-
var
|
|
96
|
+
const f = require("lodash/pull");
|
|
97
|
+
var d = e.n(f);
|
|
98
98
|
// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
|
|
99
99
|
const v = require("@splunk/react-ui/EventListener");
|
|
100
100
|
var y = e.n(v);
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
* depend on it, such as `Modal`) uses to determine the order of open layers.
|
|
110
110
|
* @public
|
|
111
111
|
*/
|
|
112
|
-
var
|
|
113
|
-
var
|
|
112
|
+
var g = r().createContext([]);
|
|
113
|
+
var b = r().createContext({});
|
|
114
114
|
var C = {
|
|
115
115
|
children: i().node,
|
|
116
116
|
name: i().string,
|
|
@@ -122,37 +122,37 @@
|
|
|
122
122
|
* A `LayerStackContext` provider that stores a shared layer stack using a global variable.
|
|
123
123
|
* Applications should only use this provider if there's a known need to support multiple
|
|
124
124
|
* instances of this library on the same page.
|
|
125
|
-
*/ function
|
|
126
|
-
var
|
|
127
|
-
if (!
|
|
128
|
-
|
|
125
|
+
*/ function E(t) {
|
|
126
|
+
var o = t.children, a = t.name, i = a === void 0 ? "__splunkui_layer_instances__" : a, u = t.scope, l = u === void 0 ? typeof window !== "undefined" ? window : e.g : u, c = t.separateStackingContexts, s = c === void 0 ? false : c;
|
|
127
|
+
if (!l[i]) {
|
|
128
|
+
l[i] = [];
|
|
129
129
|
// eslint-disable-line no-param-reassign
|
|
130
130
|
}
|
|
131
|
-
var
|
|
131
|
+
var f = (0, n.useMemo)((function() {
|
|
132
132
|
return {
|
|
133
133
|
separateStackingContexts: s
|
|
134
134
|
};
|
|
135
135
|
}), [ s ]);
|
|
136
136
|
|
|
137
|
-
return r().createElement(
|
|
138
|
-
value:
|
|
139
|
-
}, r().createElement(
|
|
140
|
-
value:
|
|
141
|
-
},
|
|
137
|
+
return r().createElement(g.Provider, {
|
|
138
|
+
value: l[i]
|
|
139
|
+
}, r().createElement(b.Provider, {
|
|
140
|
+
value: f
|
|
141
|
+
}, o));
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
E.propTypes = C;
|
|
144
144
|
// CONCATENATED MODULE: external "styled-components"
|
|
145
|
-
const
|
|
146
|
-
var
|
|
145
|
+
const S = require("styled-components");
|
|
146
|
+
var k = e.n(S);
|
|
147
147
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
148
|
-
const
|
|
148
|
+
const w = require("@splunk/themes");
|
|
149
149
|
// CONCATENATED MODULE: ./src/Layer/LayerStyles.ts
|
|
150
|
-
var
|
|
150
|
+
var T = k().div.withConfig({
|
|
151
151
|
displayName: "LayerStyles__StyledLayer",
|
|
152
152
|
componentId: "ii6psl-0"
|
|
153
153
|
})([ "", "" ], (function(e) {
|
|
154
154
|
var t = e.$separateStackingContexts;
|
|
155
|
-
return t && (0,
|
|
155
|
+
return t && (0, S.css)([ "isolation:isolate;position:relative;z-index:", ";" ], w.variables.zindexLayer);
|
|
156
156
|
}));
|
|
157
157
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
158
158
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
@@ -210,102 +210,167 @@
|
|
|
210
210
|
search: ""
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
function
|
|
213
|
+
function x() {
|
|
214
214
|
var e = typeof document !== "undefined" ? document : q;
|
|
215
215
|
return e;
|
|
216
216
|
}
|
|
217
|
+
var A = x();
|
|
218
|
+
/* harmony default export */ const L = /* unused pure expression or super */ null && A;
|
|
219
|
+
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
220
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
221
|
+
var _ = {
|
|
222
|
+
document: q,
|
|
223
|
+
navigator: {
|
|
224
|
+
userAgent: ""
|
|
225
|
+
},
|
|
226
|
+
location: {
|
|
227
|
+
hash: "",
|
|
228
|
+
host: "",
|
|
229
|
+
hostname: "",
|
|
230
|
+
href: "",
|
|
231
|
+
origin: "",
|
|
232
|
+
pathname: "",
|
|
233
|
+
protocol: "",
|
|
234
|
+
search: ""
|
|
235
|
+
},
|
|
236
|
+
history: {
|
|
237
|
+
replaceState: function e() {},
|
|
238
|
+
pushState: function e() {},
|
|
239
|
+
go: function e() {},
|
|
240
|
+
back: function e() {}
|
|
241
|
+
},
|
|
242
|
+
CustomEvent: function e() {
|
|
243
|
+
return this;
|
|
244
|
+
},
|
|
245
|
+
addEventListener: function e() {},
|
|
246
|
+
removeEventListener: function e() {},
|
|
247
|
+
getComputedStyle: function e() {
|
|
248
|
+
return {
|
|
249
|
+
getPropertyValue: function e() {
|
|
250
|
+
return "";
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
Image: function e() {},
|
|
255
|
+
Date: function e() {},
|
|
256
|
+
screen: {},
|
|
257
|
+
setTimeout: function e() {},
|
|
258
|
+
clearTimeout: function e() {},
|
|
259
|
+
matchMedia: function e() {
|
|
260
|
+
return {};
|
|
261
|
+
},
|
|
262
|
+
requestAnimationFrame: function e(t) {
|
|
263
|
+
if (typeof setTimeout === "undefined") {
|
|
264
|
+
t();
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
return setTimeout(t, 0);
|
|
268
|
+
},
|
|
269
|
+
cancelAnimationFrame: function e(t) {
|
|
270
|
+
if (typeof setTimeout === "undefined") {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
clearTimeout(t);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
function j() {
|
|
277
|
+
var e = typeof window !== "undefined" ? window : _;
|
|
278
|
+
return e;
|
|
279
|
+
}
|
|
280
|
+
var O = j();
|
|
281
|
+
/* harmony default export */ const P = O;
|
|
217
282
|
// CONCATENATED MODULE: ./src/Layer/Layer.tsx
|
|
218
|
-
function
|
|
219
|
-
return
|
|
283
|
+
function M(e, t) {
|
|
284
|
+
return D(e) || F(e, t) || N(e, t) || I();
|
|
220
285
|
}
|
|
221
|
-
function
|
|
286
|
+
function I() {
|
|
222
287
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
223
288
|
}
|
|
224
|
-
function
|
|
289
|
+
function N(e, t) {
|
|
225
290
|
if (e) {
|
|
226
|
-
if ("string" == typeof e) return
|
|
291
|
+
if ("string" == typeof e) return R(e, t);
|
|
227
292
|
var n = {}.toString.call(e).slice(8, -1);
|
|
228
|
-
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
293
|
+
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? R(e, t) : void 0;
|
|
229
294
|
}
|
|
230
295
|
}
|
|
231
|
-
function
|
|
296
|
+
function R(e, t) {
|
|
232
297
|
(null == t || t > e.length) && (t = e.length);
|
|
233
298
|
for (var n = 0, r = Array(t); n < t; n++) {
|
|
234
299
|
r[n] = e[n];
|
|
235
300
|
}
|
|
236
301
|
return r;
|
|
237
302
|
}
|
|
238
|
-
function
|
|
303
|
+
function F(e, t) {
|
|
239
304
|
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
240
305
|
if (null != n) {
|
|
241
|
-
var r,
|
|
306
|
+
var r, o, a, i, u = [], l = !0, c = !1;
|
|
242
307
|
try {
|
|
243
|
-
if (
|
|
308
|
+
if (a = (n = n.call(e)).next, 0 === t) {
|
|
244
309
|
if (Object(n) !== n) return;
|
|
245
|
-
|
|
246
|
-
} else for (;!(
|
|
310
|
+
l = !1;
|
|
311
|
+
} else for (;!(l = (r = a.call(n)).done) && (u.push(r.value), u.length !== t); l = !0) {
|
|
247
312
|
}
|
|
248
313
|
} catch (e) {
|
|
249
|
-
c = !0,
|
|
314
|
+
c = !0, o = e;
|
|
250
315
|
} finally {
|
|
251
316
|
try {
|
|
252
|
-
if (!
|
|
317
|
+
if (!l && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
|
|
253
318
|
} finally {
|
|
254
|
-
if (c) throw
|
|
319
|
+
if (c) throw o;
|
|
255
320
|
}
|
|
256
321
|
}
|
|
257
|
-
return
|
|
322
|
+
return u;
|
|
258
323
|
}
|
|
259
324
|
}
|
|
260
|
-
function
|
|
325
|
+
function D(e) {
|
|
261
326
|
if (Array.isArray(e)) return e;
|
|
262
327
|
}
|
|
263
328
|
/** @public */
|
|
264
|
-
/** @public */ var
|
|
265
|
-
var
|
|
329
|
+
/** @public */ var K = [ "clickAway", "escapeKey" ];
|
|
330
|
+
var $ = {
|
|
266
331
|
children: i().node,
|
|
267
|
-
closeReasons: i().arrayOf(i().oneOf(
|
|
332
|
+
closeReasons: i().arrayOf(i().oneOf(K)),
|
|
268
333
|
onRequestClose: i().func,
|
|
269
334
|
open: i().bool
|
|
270
335
|
};
|
|
271
|
-
var
|
|
336
|
+
var z = {
|
|
272
337
|
passive: true
|
|
273
338
|
};
|
|
274
339
|
// we need a custom type here in order to set layerContainer as a property
|
|
275
|
-
var
|
|
276
|
-
var
|
|
277
|
-
var v = (0, n.useContext)(
|
|
278
|
-
var C = (0, n.useContext)(
|
|
279
|
-
var
|
|
280
|
-
var
|
|
340
|
+
var B = function e(t) {
|
|
341
|
+
var a = t.children, i = t.closeReasons, u = i === void 0 ? K : i, c = t.open, f = t.onRequestClose;
|
|
342
|
+
var v = (0, n.useContext)(b), p = v.separateStackingContexts;
|
|
343
|
+
var C = (0, n.useContext)(g);
|
|
344
|
+
var E = (0, n.useRef)(null);
|
|
345
|
+
var S = (0, n.useState)((0, h.createGUID)()), k = M(S, 1), w = k[0];
|
|
281
346
|
var q = m()(c);
|
|
282
347
|
(0, n.useEffect)((function() {
|
|
283
348
|
if (c && !q) {
|
|
284
|
-
C.push(
|
|
349
|
+
C.push(w);
|
|
285
350
|
} else if (q && !c) {
|
|
286
|
-
|
|
351
|
+
d()(C, w);
|
|
287
352
|
}
|
|
288
|
-
}), [
|
|
353
|
+
}), [ w, C, c, q ]);
|
|
289
354
|
// it is not part of the previous useEffect because it needs to be equivalent to componentWillUnmount
|
|
290
355
|
// the previous useEffect will get re-run every time open and prevOpen change which is not what we want
|
|
291
356
|
(0, n.useEffect)((function() {
|
|
292
357
|
return function() {
|
|
293
|
-
|
|
358
|
+
d()(C, w);
|
|
294
359
|
};
|
|
295
|
-
}), [
|
|
360
|
+
}), [ w, C ]);
|
|
296
361
|
if (!e.layerContainer) {
|
|
297
|
-
var
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
e.layerContainer =
|
|
362
|
+
var A = x();
|
|
363
|
+
var L = A.createElement("div");
|
|
364
|
+
L.setAttribute("data-test", "layer-container");
|
|
365
|
+
A.body.appendChild(L);
|
|
366
|
+
e.layerContainer = L;
|
|
302
367
|
}
|
|
303
368
|
// the fullscreen API does not render elements outside the fullscreen element
|
|
304
369
|
// Layer renders in document.body, which means that anything using Layer will not render in fullscreen
|
|
305
370
|
// this code moves the layer container into the fullscreen element, ensuring that it will render
|
|
306
|
-
var
|
|
371
|
+
var _ = (0, n.useCallback)((function() {
|
|
307
372
|
if (e.layerContainer) {
|
|
308
|
-
var t =
|
|
373
|
+
var t = x();
|
|
309
374
|
if (t.fullscreenElement != null) {
|
|
310
375
|
t.fullscreenElement.appendChild(e.layerContainer);
|
|
311
376
|
} else {
|
|
@@ -313,69 +378,69 @@
|
|
|
313
378
|
}
|
|
314
379
|
}
|
|
315
380
|
}), []);
|
|
316
|
-
var
|
|
381
|
+
var j = (0, n.useCallback)((function(e) {
|
|
317
382
|
var t = e.nativeEvent;
|
|
318
|
-
|
|
383
|
+
E.current = t;
|
|
319
384
|
}), []);
|
|
320
|
-
var
|
|
385
|
+
var O = (0, n.useCallback)((function(e) {
|
|
321
386
|
// clicks inside the layer should not be considered clickAways
|
|
322
|
-
if (!c || !
|
|
387
|
+
if (!c || !l()(u, "clickAway") || E.current === e) {
|
|
323
388
|
return;
|
|
324
389
|
}
|
|
325
|
-
|
|
390
|
+
f === null || f === void 0 ? void 0 : f({
|
|
326
391
|
event: e,
|
|
327
392
|
reason: "clickAway"
|
|
328
393
|
});
|
|
329
|
-
}), [
|
|
394
|
+
}), [ u, c, f ]);
|
|
330
395
|
var I = (0, n.useCallback)((function(e) {
|
|
331
|
-
if (c && e.key === "Escape" && s()(C) ===
|
|
332
|
-
|
|
396
|
+
if (c && e.key === "Escape" && s()(C) === w && l()(u, "escapeKey")) {
|
|
397
|
+
f === null || f === void 0 ? void 0 : f({
|
|
333
398
|
event: e,
|
|
334
399
|
reason: "escapeKey"
|
|
335
400
|
});
|
|
336
401
|
}
|
|
337
|
-
}), [
|
|
338
|
-
var
|
|
339
|
-
target:
|
|
402
|
+
}), [ u, w, C, c, f ]);
|
|
403
|
+
var N = r().createElement(y(), {
|
|
404
|
+
target: P,
|
|
340
405
|
eventType: "fullscreenchange",
|
|
341
|
-
listener:
|
|
406
|
+
listener: _,
|
|
342
407
|
key: "fullScreenChange"
|
|
343
408
|
});
|
|
344
409
|
if (c) {
|
|
345
|
-
var
|
|
410
|
+
var R = (0, o.createPortal)( r().createElement(T, {
|
|
346
411
|
$separateStackingContexts: p,
|
|
347
412
|
"data-test": "layer",
|
|
348
|
-
onMouseDown:
|
|
349
|
-
onTouchStart:
|
|
350
|
-
},
|
|
413
|
+
onMouseDown: j,
|
|
414
|
+
onTouchStart: j
|
|
415
|
+
}, a), e.layerContainer);
|
|
351
416
|
|
|
352
417
|
return r().createElement(r().Fragment, null, r().createElement(y(), {
|
|
353
|
-
target:
|
|
418
|
+
target: P,
|
|
354
419
|
eventType: "keydown",
|
|
355
420
|
listener: I,
|
|
356
421
|
key: "eventListenerKeydown"
|
|
357
422
|
}), r().createElement(y(), {
|
|
358
|
-
target:
|
|
423
|
+
target: P,
|
|
359
424
|
eventType: "mousedown",
|
|
360
|
-
listener:
|
|
425
|
+
listener: O,
|
|
361
426
|
key: "eventListenerMouseDown"
|
|
362
427
|
}), r().createElement(y(), {
|
|
363
|
-
target:
|
|
428
|
+
target: P,
|
|
364
429
|
eventType: "touchstart",
|
|
365
|
-
listener:
|
|
430
|
+
listener: O,
|
|
366
431
|
key: "eventListenerTouchStart",
|
|
367
|
-
options:
|
|
368
|
-
}),
|
|
432
|
+
options: z
|
|
433
|
+
}), N, R);
|
|
369
434
|
}
|
|
370
435
|
// the fragment has to be present to avoid type issues with React 18
|
|
371
436
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
372
437
|
|
|
373
|
-
return r().createElement(r().Fragment, null,
|
|
438
|
+
return r().createElement(r().Fragment, null, N);
|
|
374
439
|
};
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
/* harmony default export */ const
|
|
440
|
+
B.propTypes = $;
|
|
441
|
+
B.layerContainer = null;
|
|
442
|
+
B.possibleCloseReasons = K;
|
|
443
|
+
/* harmony default export */ const G = B;
|
|
379
444
|
// CONCATENATED MODULE: ./src/Layer/index.ts
|
|
380
445
|
module.exports = t;
|
|
381
446
|
/******/})();
|
package/Layout.d.ts
ADDED
package/Link.js
CHANGED
|
@@ -89,10 +89,10 @@
|
|
|
89
89
|
})([ "vertical-align:text-bottom;margin-left:", ";" ], f.variables.spacingXSmall);
|
|
90
90
|
/* harmony default export */ const v = b;
|
|
91
91
|
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
92
|
-
const
|
|
93
|
-
var
|
|
92
|
+
const g = require("@splunk/react-ui/Clickable");
|
|
93
|
+
var m = e.n(g);
|
|
94
94
|
// CONCATENATED MODULE: ./src/Link/LinkStyles.ts
|
|
95
|
-
var
|
|
95
|
+
var h = d()(m()).withConfig({
|
|
96
96
|
displayName: "LinkStyles__StyledClickable",
|
|
97
97
|
componentId: "sc-1hhltcf-0"
|
|
98
98
|
})([ "", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;color:", ";", " &:not([disabled],[aria-disabled='true']){cursor:pointer;&:hover,&:active,&:focus{color:", ";text-decoration:underline;text-decoration-thickness:2px;}&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}}&[disabled],&[aria-disabled='true']{color:", ";}" ], f.mixins.reset("inline"), f.variables.contentColorLink, (0,
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
standalone: (0, c.css)([ "font-weight:", ";" ], f.variables.fontWeightSemiBold)
|
|
102
102
|
}), f.variables.contentColorLink, f.variables.focusShadow, f.variables.contentColorDisabled);
|
|
103
103
|
// CONCATENATED MODULE: ./src/Link/Link.tsx
|
|
104
|
-
function
|
|
105
|
-
return
|
|
104
|
+
function y() {
|
|
105
|
+
return y = Object.assign ? Object.assign.bind() : function(e) {
|
|
106
106
|
for (var n = 1; n < arguments.length; n++) {
|
|
107
107
|
var t = arguments[n];
|
|
108
108
|
for (var r in t) {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
return e;
|
|
113
|
-
},
|
|
113
|
+
}, y.apply(null, arguments);
|
|
114
114
|
}
|
|
115
115
|
function w(e, n) {
|
|
116
116
|
if (null == e) return {};
|
|
@@ -146,20 +146,27 @@
|
|
|
146
146
|
/**
|
|
147
147
|
* `Link` is a simple method for configuring `Button` for inline links. For more complex behaviors,
|
|
148
148
|
* see the `Button` documentation.
|
|
149
|
-
*/ var k = r().forwardRef((function(e,
|
|
150
|
-
|
|
149
|
+
*/ var k = r().forwardRef((function(e,
|
|
150
|
+
// SUI-7623 - needs to be specified for react-docgen versions less than 7.1.0
|
|
151
|
+
n) {
|
|
152
|
+
var t = e.appearance, o = t === void 0 ? "inline" : t, a = e.children, i = e.disabled, s = i === void 0 ? false : i, c = e.elementRef, d = e.openInNewContext, u = d === void 0 ? false : d, p = e.tag, f = p === void 0 ? "a" : p, b = e.to, g = w(e, [ "appearance", "children", "disabled", "elementRef", "openInNewContext", "tag", "to" ]);
|
|
151
153
|
// @docs-props-type LinkPropsBase
|
|
152
|
-
var
|
|
154
|
+
var m = typeof u === "string" ? u : S;
|
|
155
|
+
// Ensure `Link` always renders as an `a` (unless overriden by `tag`) by passing a value to Clickable,
|
|
156
|
+
// using '' if disabled or the to is not passed.
|
|
157
|
+
var O = s && "" || b && b || "";
|
|
153
158
|
|
|
154
|
-
return r().createElement(
|
|
159
|
+
return r().createElement(h, y({
|
|
155
160
|
"data-test": "link",
|
|
156
|
-
disabled: s,
|
|
161
|
+
disabled: s ? "disabled" : undefined,
|
|
157
162
|
elementRef: c,
|
|
158
163
|
openInNewContext: !!u,
|
|
159
164
|
$appearance: o,
|
|
160
165
|
ref: n,
|
|
161
|
-
to:
|
|
162
|
-
},
|
|
166
|
+
to: O
|
|
167
|
+
}, g, {
|
|
168
|
+
tag: f
|
|
169
|
+
}), a, u && r().createElement(r().Fragment, null, r().createElement(v, null), r().createElement(l(), null, m)));
|
|
163
170
|
}));
|
|
164
171
|
k.propTypes = x;
|
|
165
172
|
/* harmony default export */ const C = k;
|
package/MIGRATION.v5.mdx
CHANGED
|
@@ -207,7 +207,7 @@ Components that formerly supported class focus methods (`Color`, `Link`, `Menu`,
|
|
|
207
207
|
### Migration steps
|
|
208
208
|
- Convert all usage of `ref` to `elementRef`.
|
|
209
209
|
- For `Number` and `Text`: Replace all usage of the class `focus` method with passing a `ref` to the `inputRef` prop and calling `inputRef.current.focus()`.
|
|
210
|
-
- For `Button`, `Color`, `Link`, `Menu`, `Select.Option`, `SplitButton.Item`, and `TabBar.Tab`: Replace all usage of the class `focus` method with passing a `ref` to the `elementRef` prop and calling `elementRef.current.focus()`.
|
|
210
|
+
- For `Button`, `Color`, `Link`, `Menu`, `Multiselect.Option`, `Select.Option`, `SplitButton.Item`, and `TabBar.Tab`: Replace all usage of the class `focus` method with passing a `ref` to the `elementRef` prop and calling `elementRef.current.focus()`.
|
|
211
211
|
- For `Table.HeadDropdownCell`: Replace all usage of the class `focus` method with passing a `ref` to the `buttonRef` prop and calling `buttonRef.current.focus()`.
|
|
212
212
|
- For `Switch`: Replace all usage of the class `focus` method with passing a `ref` to the `toggleRef` prop and calling `toggleRef.current.focus()`.
|
|
213
213
|
- For `Slider`: Replace all usage of the class `focus` method with passing a `ref` to the `thumbRef` prop and calling `thumbRef.current.focus()`.
|
|
@@ -261,6 +261,18 @@ This difference can cause confusion and conflict with accessibility expectations
|
|
|
261
261
|
#### Migration steps
|
|
262
262
|
- Replace Select with appearance="link" by using either appearance="default" or appearance="subtle", depending on design requirements.
|
|
263
263
|
|
|
264
|
+
### Deprecated `TabBar` and `TabLayout`'s `iconPosition` prop
|
|
265
|
+
|
|
266
|
+
#### Change
|
|
267
|
+
`TabBar` and `TabLayouts`'s `iconPosition` prop is deprecated and will be removed in the next major version.
|
|
268
|
+
|
|
269
|
+
#### Context
|
|
270
|
+
`TabBar`'s `iconPosition="above"` value is deprecated because stacking an icon above text creates a vertical layout that’s harder to scan quickly, especially when multiple `Tab`s are present. The added vertical space can make the `TabBar` taller and more visually crowded, reducing the clarity and simplicity that `TabBar`s are supposed to offer.
|
|
271
|
+
Due to this `TabBar`'s `iconPosition` would only have the value of `left` remaining thus there is no longer a need for the `iconPosition` prop to specify icon positioning. Because `TabLayout` uses `TabBar` its matching prop is deprecated as well.
|
|
272
|
+
|
|
273
|
+
#### Migration steps
|
|
274
|
+
- Remove any setting of `TabBar` or `TabLayout`'s `iconPosition` prop and instead allow its default behavior of left icon positioning to take effect when icons are passed.
|
|
275
|
+
|
|
264
276
|
### Deprecated `Multiselect`'s `selectAllAppearance="buttongroup"` value
|
|
265
277
|
|
|
266
278
|
#### Change
|
|
@@ -437,3 +449,38 @@ Pass a `ref` that refers to an HTML Element to the `anchor` prop.
|
|
|
437
449
|
### Migration steps
|
|
438
450
|
|
|
439
451
|
Replace all usage of `Switch`'s test hook `[data-test="button"]` with `[data-test="toggle"]`.
|
|
452
|
+
|
|
453
|
+
## `TabBar`'s `tabWidth` prop has been removed
|
|
454
|
+
|
|
455
|
+
### Change
|
|
456
|
+
`TabBar`'s `tabWidth` prop has been removed. A new `maxTabWidth` prop has been added to support some use cases previously supported by the `tabWidth` prop.
|
|
457
|
+
|
|
458
|
+
### Context
|
|
459
|
+
In previous versions `TabBar.Tab`s could have their width statically set by passing the `tabWidth` prop to the `TabBar`. However, the updated design for `TabBar` has responsive widths for `TabBar.Tab`s so setting a static tab width is no longer supported.
|
|
460
|
+
|
|
461
|
+
### Migration steps
|
|
462
|
+
There are were two possible use cases for `tabWidth`:
|
|
463
|
+
|
|
464
|
+
1) If you desire each `Tab` to not exceed a certain width, use `maxTabWidth`.
|
|
465
|
+
2) If you desire each `Tab` to be the exact same width, we recommend against this - please reach out to us if you have a specific use case in mind.
|
|
466
|
+
|
|
467
|
+
## Deprecated `Card.Header`'s `anchor` prop
|
|
468
|
+
|
|
469
|
+
### Change
|
|
470
|
+
|
|
471
|
+
`Card.Header`'s `anchor` prop has been deprecated and will be removed in the next major version.
|
|
472
|
+
|
|
473
|
+
### Context
|
|
474
|
+
|
|
475
|
+
Card titles need to be headings when there is content underneath to satisfy accessibility requirement WCAG 1.3.1.
|
|
476
|
+
The recommended way to do this is to pass the `Heading` component into the `title` prop.
|
|
477
|
+
|
|
478
|
+
The anchor prop leads to visual issues when non-text content (such as a Heading is passed to the `title` attribute).
|
|
479
|
+
To avoid this and because the functionality of the `anchor` prop can be achieved by passing the `Anchor` component to the `title` prop,
|
|
480
|
+
we have deprecated the `anchor` prop.
|
|
481
|
+
|
|
482
|
+
### Migration steps
|
|
483
|
+
Replace all usage of the `anchor` prop with passing in the `Anchor` component to the `title` prop:
|
|
484
|
+
```jsx
|
|
485
|
+
<Card.Header title={<Anchor name="Title">Title</Anchor>} />
|
|
486
|
+
```
|
package/Markdown.js
CHANGED
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
var E = a().code.withConfig({
|
|
180
180
|
displayName: "MarkdownStyles__StyledCodeInline",
|
|
181
181
|
componentId: "sc-1xadih-1"
|
|
182
|
-
})([ "", ";font-family:", ";background-color:", ";" ], k.mixins.reset("inline"), k.variables.monoFontFamily, k.variables.neutral100);
|
|
182
|
+
})([ "", ";font-size:inherit;font-family:", ";background-color:", ";" ], k.mixins.reset("inline"), k.variables.monoFontFamily, k.variables.neutral100);
|
|
183
183
|
var R = a().blockquote.withConfig({
|
|
184
184
|
displayName: "MarkdownStyles__StyledHint",
|
|
185
185
|
componentId: "sc-1xadih-2"
|
package/Menu.js
CHANGED
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
var C = d()(g()).withConfig({
|
|
120
120
|
displayName: "ItemStyles__StyledNonInteractiveCheckbox",
|
|
121
121
|
componentId: "sc-4kc053-4"
|
|
122
|
-
})([ "padding-right:", ";" ], f.variables.spacingSmall);
|
|
122
|
+
})([ "min-height:0;padding-right:", ";" ], f.variables.spacingSmall);
|
|
123
123
|
var I = d()(b()).withConfig({
|
|
124
124
|
displayName: "ItemStyles__StyledClickable",
|
|
125
125
|
componentId: "sc-4kc053-5"
|