@splunk/react-ui 5.2.0 → 5.3.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/Avatar.js +57 -52
- package/Box.js +2 -1
- package/CHANGELOG.md +31 -0
- package/Calendar.js +8 -4
- package/Checkbox.d.ts +2 -0
- package/Checkbox.js +350 -0
- package/Code.js +151 -132
- package/CollapsiblePanel.js +184 -210
- package/Color.js +4 -2
- package/ControlGroup.js +2 -1
- package/Date.js +123 -119
- package/DefinitionList.js +100 -77
- package/Dropdown.js +2 -2
- package/DualListbox.js +409 -353
- package/File.js +102 -99
- package/JSONTree.js +317 -303
- package/Link.js +11 -11
- package/MIGRATION.md +27 -0
- package/Markdown.js +162 -151
- package/Menu.js +44 -42
- package/Modal.js +3 -3
- package/Multiselect.js +454 -435
- package/Paginator.js +2 -1
- package/ResultsMenu.js +2 -1
- package/Scroll.js +2 -1
- package/Search.js +131 -127
- package/Select.js +3 -2
- package/Switch.js +197 -229
- package/Table.js +24 -16
- package/Text.js +180 -206
- package/TextArea.js +233 -224
- package/Tooltip.js +144 -139
- package/package.json +9 -10
- package/tsconfig.check-docs.json +8 -0
- package/types/src/Avatar/docs/examples/Basic.d.ts +1 -1
- package/types/src/Checkbox/Checkbox.d.ts +90 -0
- package/types/src/Checkbox/docs/examples/Basic.d.ts +7 -0
- package/types/src/Checkbox/docs/examples/Disabled.d.ts +6 -0
- package/types/src/Checkbox/docs/examples/Error.d.ts +6 -0
- package/types/src/Checkbox/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/Checkbox/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +4 -1
- package/types/src/Code/LineHighlights.d.ts +1 -0
- package/types/src/Code/LineNumbers.d.ts +2 -1
- package/types/src/Code/docs/examples/CustomizeContainer.d.ts +7 -0
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +3 -3
- package/types/src/Date/Date.d.ts +7 -1
- package/types/src/DefinitionList/DefinitionList.d.ts +7 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +1 -1
- package/types/src/DefinitionList/docs/examples/StackedLayout.d.ts +6 -0
- package/types/src/DualListbox/DualListbox.d.ts +1 -1
- package/types/src/DualListbox/Label.d.ts +7 -7
- package/types/src/DualListbox/Listbox.d.ts +2 -2
- package/types/src/DualListbox/ListboxContext.d.ts +1 -1
- package/types/src/File/File.d.ts +7 -1
- package/types/src/JSONTree/JSONTreeItem.d.ts +4 -2
- package/types/src/JSONTree/renderTreeItems.d.ts +2 -1
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +2 -1
- package/types/src/Menu/docs/examples/Dimmed.d.ts +1 -1
- package/types/src/Menu/docs/examples/Disabled.d.ts +1 -0
- package/types/src/Multiselect/Compact.d.ts +7 -1
- package/types/src/Multiselect/Multiselect.d.ts +7 -1
- package/types/src/Multiselect/Normal.d.ts +7 -1
- package/types/src/Search/Search.d.ts +5 -1
- package/types/src/Switch/Switch.d.ts +7 -1
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -10
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -9
- package/types/src/Table/ExpandButton.d.ts +1 -1
- package/types/src/Tooltip/Tooltip.d.ts +14 -1
- package/NonInteractiveCheckbox.js +0 -101
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +0 -12
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +0 -22
- package/types/src/NonInteractiveCheckbox/index.d.ts +0 -1
- package/types/src/Switch/docs/examples/Error.d.ts +0 -6
- package/types/src/Text/IconOutlinedHide.d.ts +0 -3
- package/types/src/Text/IconOutlinedView.d.ts +0 -3
- /package/cypress/{tsconfig.cypress.json → tsconfig.check-cypress.json} +0 -0
package/Menu.js
CHANGED
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
Divider: () => /* reexport */
|
|
64
|
+
Divider: () => /* reexport */ R,
|
|
65
65
|
Heading: () => /* reexport */ Z,
|
|
66
66
|
Item: () => /* reexport */ Se,
|
|
67
|
-
MenuContext: () => /* reexport */
|
|
67
|
+
MenuContext: () => /* reexport */ N,
|
|
68
68
|
default: () => /* reexport */ qe
|
|
69
69
|
});
|
|
70
70
|
// CONCATENATED MODULE: external "react"
|
|
@@ -86,11 +86,11 @@
|
|
|
86
86
|
var v = e.n(d);
|
|
87
87
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
88
88
|
const p = require("@splunk/themes");
|
|
89
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/
|
|
90
|
-
const f = require("@splunk/react-ui/
|
|
89
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Checkbox"
|
|
90
|
+
const f = require("@splunk/react-ui/Checkbox");
|
|
91
91
|
var m = e.n(f);
|
|
92
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/
|
|
93
|
-
const b = require("@splunk/react-ui/
|
|
92
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
93
|
+
const b = require("@splunk/react-ui/Clickable");
|
|
94
94
|
var g = e.n(b);
|
|
95
95
|
// CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
|
|
96
96
|
var y = (0, c.css)([ "", " overflow:inherit;white-space:inherit;text-overflow:inherit;" ], p.mixins.typography("smallBody"));
|
|
@@ -114,11 +114,11 @@
|
|
|
114
114
|
var t = e.endAdornment;
|
|
115
115
|
return t && (0, c.css)([ "padding-left:", ";" ], p.variables.spacingSmall);
|
|
116
116
|
}), p.variables.spacingSmall, p.variables.contentColorMuted);
|
|
117
|
-
var x = u()(
|
|
118
|
-
displayName: "
|
|
117
|
+
var x = u()(m()).withConfig({
|
|
118
|
+
displayName: "ItemStyles__StyledCheckbox",
|
|
119
119
|
componentId: "sc-4kc053-4"
|
|
120
120
|
})([ "min-height:0;padding-right:", ";" ], p.variables.spacingSmall);
|
|
121
|
-
var C = u()(
|
|
121
|
+
var C = u()(g()).withConfig({
|
|
122
122
|
displayName: "ItemStyles__StyledClickable",
|
|
123
123
|
componentId: "sc-4kc053-5"
|
|
124
124
|
})([ "line-height:", ";display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;min-height:", ";padding:", " ", ";", " ", " ", " &:not([disabled],[aria-disabled='true']){&:hover{background:", ";", "}&:active{background:", ";}", "}&:focus{outline:0;box-shadow:", ";background:", ";}&[disabled],&[aria-disabled='true']{color:", ";", ",", ",", ",", "{color:", ";}}" ], p.variables.lineHeightSpacious, p.variables.contentColorActive, p.variables.inputHeight, p.variables.spacingXSmall, p.variables.spacingLarge, (function(e) {
|
|
@@ -126,18 +126,19 @@
|
|
|
126
126
|
return t && !r && (0, c.css)([ "box-shadow:", ";" ], p.variables.focusShadowInset);
|
|
127
127
|
}), (function(e) {
|
|
128
128
|
var t = e.$active;
|
|
129
|
-
return t && (0, c.css)([ "background:", ";font-weight:", ";" ], p.variables.
|
|
129
|
+
return t && (0, c.css)([ "background:", ";font-weight:", ";" ], p.variables.interactiveColorOverlayActive, p.variables.fontWeightBold);
|
|
130
130
|
}), (function(e) {
|
|
131
131
|
var t = e.$isSelectable, r = e.$selectableAppearance, n = e.$selected;
|
|
132
132
|
return t && !n && r === "checkmark" && // Adds whitespace to right to reserve space for checkmark for selectable Items
|
|
133
133
|
// spacingLarge x 3 = padding-left + icon size + padding-right
|
|
134
134
|
(0, c.css)([ "padding-right:calc(", " * 3);" ], p.variables.spacingLarge);
|
|
135
135
|
}), p.variables.interactiveColorOverlayHover, (function(e) {
|
|
136
|
-
var t = e.$
|
|
137
|
-
return t && (0, c.css)([ "background:", ";" ], p.mixins.overlayColors(p.variables.
|
|
136
|
+
var t = e.$active;
|
|
137
|
+
return t && (0, c.css)([ "background:", ";" ], p.mixins.overlayColors(p.variables.interactiveColorOverlayActive, p.variables.interactiveColorOverlayHover));
|
|
138
138
|
}), p.variables.interactiveColorOverlayActive, (function(e) {
|
|
139
|
-
var t = e.$selected;
|
|
140
|
-
return t && (0, c.css)([ "
|
|
139
|
+
var t = e.$selected, r = e.$active;
|
|
140
|
+
return t && (0, c.css)([ "font-weight:", ";", "" ], p.variables.fontWeightSemiBold, r && (0,
|
|
141
|
+
c.css)([ "font-weight:", ";" ], p.variables.fontWeightBold));
|
|
141
142
|
}), p.variables.focusShadowInset, p.variables.interactiveColorOverlayHover, p.variables.contentColorDisabled, /* sc-sel */ h, /* sc-sel */ S, /* sc-sel */ O, /* sc-sel */ k, p.variables.contentColorDisabled);
|
|
142
143
|
var I = u().span.withConfig({
|
|
143
144
|
displayName: "ItemStyles__StyledInnerWrapper",
|
|
@@ -170,7 +171,7 @@
|
|
|
170
171
|
})([ "float:right;padding-left:", ";color:", ";" ], p.variables.spacingSmall, p.variables.contentColorDefault);
|
|
171
172
|
// CONCATENATED MODULE: ./src/Menu/DividerStyles.ts
|
|
172
173
|
// Adds margin if direct sibling is a Menu.Item to provide spacing between Divider and Item
|
|
173
|
-
var
|
|
174
|
+
var A = u()(v()).withConfig({
|
|
174
175
|
displayName: "DividerStyles__Styled",
|
|
175
176
|
componentId: "l3zfh3-0"
|
|
176
177
|
})([ "", " + &,& + ", "{margin-block-start:", ";}" ], C, C, p.variables.spacingSmall);
|
|
@@ -179,7 +180,7 @@
|
|
|
179
180
|
role: "menu",
|
|
180
181
|
preventFocus: false
|
|
181
182
|
});
|
|
182
|
-
/* harmony default export */ const
|
|
183
|
+
/* harmony default export */ const N = D;
|
|
183
184
|
// CONCATENATED MODULE: ./src/Menu/Divider.tsx
|
|
184
185
|
function T() {
|
|
185
186
|
return T = Object.assign ? Object.assign.bind() : function(e) {
|
|
@@ -195,23 +196,22 @@
|
|
|
195
196
|
var q = {};
|
|
196
197
|
/**
|
|
197
198
|
* A non-interactive menu item used to visually separate groups of items in the menu.
|
|
198
|
-
*/ function
|
|
199
|
+
*/ function $(e) {
|
|
199
200
|
var t = T({}, e);
|
|
200
|
-
|
|
201
|
-
var a = (0, r.useContext)(A), i = a.role;
|
|
201
|
+
var a = (0, r.useContext)(N), i = a.role;
|
|
202
202
|
|
|
203
|
-
return n().createElement(
|
|
203
|
+
return n().createElement(A, T({
|
|
204
204
|
"aria-hidden": i === "listbox",
|
|
205
205
|
"data-test": "divider",
|
|
206
206
|
role: "separator"
|
|
207
207
|
}, t));
|
|
208
208
|
}
|
|
209
|
-
|
|
210
|
-
/* Remove the item if it is the first item after filtering */
|
|
211
|
-
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */
|
|
212
|
-
/* Remove the item if it is the last item after filtering. */
|
|
213
|
-
/* Tag the item as Divider */
|
|
214
|
-
/* harmony default export */ const
|
|
209
|
+
$.propTypes = q;
|
|
210
|
+
/* Remove the item if it is the first item after filtering */ $.filterFirst = true;
|
|
211
|
+
/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ $.filterConsecutive = true;
|
|
212
|
+
/* Remove the item if it is the last item after filtering. */ $.filterLast = true;
|
|
213
|
+
/* Tag the item as Divider */ $.as = "Divider";
|
|
214
|
+
/* harmony default export */ const R = $;
|
|
215
215
|
// CONCATENATED MODULE: external "@splunk/react-ui/Heading"
|
|
216
216
|
const H = require("@splunk/react-ui/Heading");
|
|
217
217
|
var F = e.n(H);
|
|
@@ -318,7 +318,8 @@
|
|
|
318
318
|
* A non-interactive `Menu` item used to separate and label groups of `Menu` items.
|
|
319
319
|
*/ function Y(e) {
|
|
320
320
|
var t = e.children, a = e.outerStyle, i = e.title, o = J(e, [ "children", "outerStyle", "title" ]);
|
|
321
|
-
|
|
321
|
+
// @docs-props-type HeadingPropsBase
|
|
322
|
+
var l = (0, r.useContext)(N), s = l.role;
|
|
322
323
|
var c = (0, r.useMemo)((function() {
|
|
323
324
|
return z(z({}, a), {}, {
|
|
324
325
|
margin: 0
|
|
@@ -435,12 +436,12 @@
|
|
|
435
436
|
};
|
|
436
437
|
var ye = (0, se._)("(Opens new window)");
|
|
437
438
|
function he(e) {
|
|
438
|
-
var t = e.active, a = e.children, o = e.description, l = e.descriptionPosition, s = l === void 0 ? "bottom" : l, c = e.disabled, u = e.endAdornment, d = e.elementRef, v = e.hasSubmenu, p = e.itemKey, f = e.matchRanges, m = e.onClick, b = e.onFocus, g = e.openInNewContext, y = e.role, w = e.selectable,
|
|
439
|
+
var t = e.active, a = e.children, o = e.description, l = e.descriptionPosition, s = l === void 0 ? "bottom" : l, c = e.disabled, u = e.endAdornment, d = e.elementRef, v = e.hasSubmenu, p = e.itemKey, f = e.matchRanges, m = e.onClick, b = e.onFocus, g = e.openInNewContext, y = e.role, w = e.selectable, A = e.selectableAppearance, D = A === void 0 ? "checkmark" : A, T = e.selected, q = e.startAdornment, $ = e.to, R = e.truncate, H = me(e, [ "active", "children", "description", "descriptionPosition", "disabled", "endAdornment", "elementRef", "hasSubmenu", "itemKey", "matchRanges", "onClick", "onFocus", "openInNewContext", "role", "selectable", "selectableAppearance", "selected", "startAdornment", "to", "truncate" ]);
|
|
439
440
|
// @docs-props-type ItemPropsBase
|
|
440
|
-
var F = (0, r.useContext)(
|
|
441
|
+
var F = (0, r.useContext)(N), M = F.preventFocus;
|
|
441
442
|
(0, r.useEffect)((function() {
|
|
442
443
|
if (false) {}
|
|
443
|
-
}), [
|
|
444
|
+
}), [ R, s, f, a, T, w, D ]);
|
|
444
445
|
var L = (0, r.useCallback)((function(e) {
|
|
445
446
|
b === null || b === void 0 ? void 0 : b(e, {
|
|
446
447
|
itemKey: p
|
|
@@ -519,16 +520,17 @@
|
|
|
519
520
|
openInNewContext: U,
|
|
520
521
|
role: V,
|
|
521
522
|
tabIndex: M ? -1 : undefined,
|
|
522
|
-
to:
|
|
523
|
-
title:
|
|
523
|
+
to: $,
|
|
524
|
+
title: R && te()(a) ? a : undefined
|
|
524
525
|
}, X, i()(H, "onFocus")), v && n().createElement(j, null, n().createElement(ie(), null)), n().createElement(I, null, w && D === "checkbox" && n().createElement(x, {
|
|
526
|
+
checked: T === "some" ? "indeterminate" : T,
|
|
525
527
|
disabled: !!c,
|
|
526
|
-
|
|
528
|
+
inert: true
|
|
527
529
|
}), q && n().createElement(k, null, q), n().createElement(E, {
|
|
528
530
|
$descriptionBottom: !!J,
|
|
529
|
-
$truncate:
|
|
531
|
+
$truncate: R !== null && R !== void 0 ? R : false
|
|
530
532
|
}, n().createElement(_, {
|
|
531
|
-
$truncate:
|
|
533
|
+
$truncate: R !== null && R !== void 0 ? R : false,
|
|
532
534
|
"data-test": "label"
|
|
533
535
|
}, B, g && n().createElement(n().Fragment, null, n().createElement(pe, null), n().createElement(le(), null, Y))), J && n().createElement(h, {
|
|
534
536
|
"data-test": "description"
|
|
@@ -609,7 +611,7 @@
|
|
|
609
611
|
}
|
|
610
612
|
return r;
|
|
611
613
|
}
|
|
612
|
-
var
|
|
614
|
+
var Ae = {
|
|
613
615
|
children: l().node,
|
|
614
616
|
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
615
617
|
focusMode: l().oneOf([ "roving", "normal", "never" ]),
|
|
@@ -624,7 +626,7 @@
|
|
|
624
626
|
enableHomeEnd: true
|
|
625
627
|
};
|
|
626
628
|
};
|
|
627
|
-
var
|
|
629
|
+
var Ne = function e(t) {
|
|
628
630
|
var r = t.key;
|
|
629
631
|
// Handle special case for tab navigation
|
|
630
632
|
if (r === "Tab" && (0, s.isTabKey)(t)) {
|
|
@@ -635,7 +637,7 @@
|
|
|
635
637
|
function Te(e) {
|
|
636
638
|
var t = e.children, a = e.elementRef, o = e.focusMode, l = o === void 0 ? "roving" : o, c = e.stopScrollPropagation, u = Pe(e, [ "children", "elementRef", "focusMode", "stopScrollPropagation" ]);
|
|
637
639
|
// @docs-props-type MenuPropsBase
|
|
638
|
-
var d = (0, r.useContext)(
|
|
640
|
+
var d = (0, r.useContext)(N), v = d.role, p = v === void 0 ? "menu" : v;
|
|
639
641
|
var f = (0, r.useRef)(null);
|
|
640
642
|
var m = r.Children.toArray(t).filter(r.isValidElement).reduce((function(e, t, r, n) {
|
|
641
643
|
/* Filter out initial Dividers
|
|
@@ -670,7 +672,7 @@
|
|
|
670
672
|
if (e.nativeEvent.metaKey) {
|
|
671
673
|
return;
|
|
672
674
|
}
|
|
673
|
-
var t =
|
|
675
|
+
var t = Ne(e);
|
|
674
676
|
var r = t === "Tab" || t === "tabShift";
|
|
675
677
|
var n = t === "Enter";
|
|
676
678
|
// Allow default behavior for the enter key.
|
|
@@ -709,13 +711,13 @@
|
|
|
709
711
|
stopScrollPropagation: true
|
|
710
712
|
}, i()(u, "tagName")), m) : n().createElement(Ce, _e({}, w, {
|
|
711
713
|
ref: b
|
|
712
|
-
}, u), n().createElement(
|
|
714
|
+
}, u), n().createElement(N.Provider, {
|
|
713
715
|
value: h()
|
|
714
716
|
}, m));
|
|
715
717
|
}
|
|
716
|
-
Te.propTypes =
|
|
718
|
+
Te.propTypes = Ae;
|
|
717
719
|
Te.Item = Se;
|
|
718
|
-
Te.Divider =
|
|
720
|
+
Te.Divider = R;
|
|
719
721
|
Te.Heading = Z;
|
|
720
722
|
/* harmony default export */ const qe = Te;
|
|
721
723
|
// CONCATENATED MODULE: ./src/Menu/index.ts
|
package/Modal.js
CHANGED
|
@@ -216,9 +216,9 @@
|
|
|
216
216
|
var B = g().div.withConfig({
|
|
217
217
|
displayName: "FooterStyles__StyledDiv",
|
|
218
218
|
componentId: "yszcmv-0"
|
|
219
|
-
})([ "flex:0 0 auto;padding:", " ", ";background-color:", ";&
|
|
219
|
+
})([ "flex:0 0 auto;padding:", " ", ";background-color:", ";& >:is(button,a){min-width:80px;}", "" ], w.variables.spacingLarge, w.variables.spacingXLarge, w.variables.backgroundColorDialog, (0,
|
|
220
220
|
w.pickVariant)("$layout", {
|
|
221
|
-
auto: (0, m.css)([ "display:flex;align-items:center;justify-content:flex-end;gap:", ";& > *:is(button,*){flex:0 0 auto;}& >:not(button){margin-right:auto;}&:has(button
|
|
221
|
+
auto: (0, m.css)([ "display:flex;align-items:center;justify-content:flex-end;gap:", ";& > *:is(button,a,*){flex:0 0 auto;}& >:not(button,a){margin-right:auto;}&:has(:is(button,a) +:is(button,a) +:is(button,a)) >:is(button,a):first-child{margin-right:auto;}" ], w.variables.spacingSmall),
|
|
222
222
|
none: (0, m.css)([ "text-align:right;" ])
|
|
223
223
|
}));
|
|
224
224
|
// CONCATENATED MODULE: ./src/Modal/ModalContext.tsx
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
* A styled container for `Modal` header content.
|
|
369
369
|
*/ function le(e) {
|
|
370
370
|
var r = e.children, o = e.icon, i = e.hideCloseButton, a = i === void 0 ? false : i, l = e.title, u = e.subtitle, c = ne(e, [ "children", "icon", "hideCloseButton", "title", "subtitle" ]);
|
|
371
|
-
// @docs-props-type
|
|
371
|
+
// @docs-props-type HeaderPropsBase
|
|
372
372
|
var s = (0, t.useContext)(N), f = s.titleId, d = s.subtitleId, p = s.divider, v = s.onRequestClose;
|
|
373
373
|
var b = p === "both" || p === "header";
|
|
374
374
|
var y = (0, t.isValidElement)(o) && (0, t.cloneElement)(o, {
|