@splunk/react-ui 5.0.0 → 5.1.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/Accordion.js +59 -59
- package/Avatar.js +20 -20
- package/Breadcrumbs.js +46 -46
- package/Button.js +24 -24
- package/CHANGELOG.md +21 -2
- package/Calendar.js +69 -69
- package/Card.js +68 -68
- package/Chip.js +16 -16
- package/Clickable.js +29 -29
- package/Code.js +654 -519
- package/CollapsiblePanel.js +112 -112
- package/Color.js +107 -107
- package/ColumnLayout.js +35 -35
- package/ComboBox.js +190 -206
- package/ControlGroup.js +128 -120
- package/Date.js +148 -146
- package/DefinitionList.js +26 -26
- package/DualListbox.js +701 -717
- package/File.js +403 -403
- package/FormRows.js +66 -63
- package/Image.js +15 -15
- package/JSONTree.js +458 -357
- package/Layer.js +60 -72
- package/Markdown.js +66 -66
- package/Menu.js +44 -44
- package/Modal.js +49 -49
- package/ModalLayer.js +6 -6
- package/Monogram.js +16 -16
- package/Multiselect.js +622 -624
- package/Number.js +100 -100
- package/Paginator.js +7 -7
- package/Popover.js +453 -407
- package/Progress.js +12 -12
- package/Prose.js +6 -6
- package/RadioBar.js +180 -166
- package/RadioList.js +80 -79
- package/ResultsMenu.js +15 -15
- package/Scroll.js +50 -50
- package/Search.js +148 -164
- package/Select.js +668 -670
- package/Slider.js +30 -30
- package/SlidingPanels.js +24 -24
- package/SplitButton.js +50 -50
- package/StepBar.js +100 -100
- package/Switch.js +45 -45
- package/TabBar.js +196 -196
- package/TabLayout.js +16 -16
- package/Table.js +1207 -1193
- package/Text.js +65 -65
- package/TextArea.js +108 -93
- package/Tooltip.js +203 -197
- package/Tree.js +464 -366
- package/package.json +6 -6
- package/stubs-dependencies.d.ts +0 -70
- package/stubs-splunkui.d.ts +4 -0
- package/types/src/Code/Code.d.ts +17 -1
- package/types/src/Code/LineHighlights.d.ts +11 -0
- package/types/src/Code/LineNumbers.d.ts +6 -0
- package/types/src/Code/docs/examples/LineHighlights.d.ts +3 -0
- package/types/src/Code/docs/examples/LineNumbers.d.ts +3 -0
- package/types/src/Code/docs/examples/LineNumbersCustomStart.d.ts +3 -0
- package/types/src/Date/Date.d.ts +6 -1
- package/types/src/DefinitionList/DefinitionList.d.ts +6 -6
- package/types/src/FormRows/FormRows.d.ts +1 -1
- package/types/src/JSONTree/JSONTreeItem.d.ts +5 -2
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +1 -1
- package/types/src/Markdown/renderers/index.d.ts +1 -1
- package/types/src/Popover/Popover.d.ts +1 -1
- package/types/src/RadioBar/Option.d.ts +1 -1
- package/types/src/RadioBar/RadioBar.d.ts +13 -6
- package/types/src/RadioBar/RadioBarContext.d.ts +4 -2
- package/types/src/RadioList/RadioList.d.ts +2 -1
- package/types/src/ScreenReaderContent/docs/examples/SkipLink.d.ts +3 -0
- package/types/src/Scroll/Inner.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Slider/docs/examples/Controlled.d.ts +1 -1
- package/types/src/TabLayout/Panel.d.ts +0 -1
- package/types/src/Table/Head.d.ts +1 -0
- package/types/src/Table/HeadCell.d.ts +2 -3
- package/types/src/Table/HeadDropdownCell.d.ts +2 -2
- package/types/src/Table/HeadInner.d.ts +4 -4
- package/types/src/Table/KeyboardSensor.d.ts +1 -1
- package/types/src/Table/RowDragCell.d.ts +1 -1
- package/types/src/Tooltip/Tooltip.d.ts +10 -5
- package/types/src/Tree/Item.d.ts +63 -0
- package/types/src/Tree/Tree.d.ts +13 -6
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/types/src/Tree/index.d.ts +1 -1
- package/types/src/useControlled/useControlled.d.ts +3 -1
- package/useControlled.js +29 -13
- package/types/src/Tree/TreeItem.d.ts +0 -44
package/FormRows.js
CHANGED
|
@@ -82,66 +82,66 @@
|
|
|
82
82
|
});
|
|
83
83
|
u.displayName = "FormRows";
|
|
84
84
|
/* harmony default export */ const d = u;
|
|
85
|
-
// CONCATENATED MODULE: external "@splunk/react-icons/TrashCanCross"
|
|
86
|
-
const c = require("@splunk/react-icons/TrashCanCross");
|
|
87
|
-
var f = e.n(c);
|
|
88
85
|
// CONCATENATED MODULE: external "styled-components"
|
|
89
|
-
const
|
|
90
|
-
var
|
|
86
|
+
const c = require("styled-components");
|
|
87
|
+
var f = e.n(c);
|
|
91
88
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
92
|
-
const
|
|
93
|
-
var
|
|
89
|
+
const v = require("@splunk/react-ui/Button");
|
|
90
|
+
var m = e.n(v);
|
|
94
91
|
// CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
|
|
95
|
-
const
|
|
96
|
-
var
|
|
92
|
+
const p = require("@splunk/react-ui/ButtonSimple");
|
|
93
|
+
var b = e.n(p);
|
|
97
94
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
98
|
-
const
|
|
95
|
+
const g = require("@splunk/themes");
|
|
99
96
|
// CONCATENATED MODULE: ./src/FormRows/FormRowsStyles.ts
|
|
100
|
-
var
|
|
101
|
-
var
|
|
97
|
+
var y = (0, c.css)([ "width:", ";height:", ";" ], g.variables.inputHeight, g.variables.inputHeight);
|
|
98
|
+
var h = f()(b()).withConfig({
|
|
102
99
|
displayName: "FormRowsStyles__StyledDragButton",
|
|
103
100
|
componentId: "sc-1j4j7h3-0"
|
|
104
|
-
})([ "", ";grid-column:drag-handle;cursor:move;user-select:none;-webkit-user-drag:element;" ],
|
|
105
|
-
var
|
|
101
|
+
})([ "", ";grid-column:drag-handle;cursor:move;user-select:none;-webkit-user-drag:element;" ], y);
|
|
102
|
+
var w = f()(b()).withConfig({
|
|
106
103
|
displayName: "FormRowsStyles__StyledRemoveButton",
|
|
107
104
|
componentId: "sc-1j4j7h3-1"
|
|
108
|
-
})([ "", ";grid-column:remove-button;" ],
|
|
109
|
-
var
|
|
105
|
+
})([ "", ";grid-column:remove-button;" ], y);
|
|
106
|
+
var R = f().div.withConfig({
|
|
110
107
|
displayName: "FormRowsStyles__StyledDiv",
|
|
111
108
|
componentId: "sc-1j4j7h3-2"
|
|
112
|
-
})([ "", ";justify-content:start;&:has(", "):has(", "){grid-template-columns:[drag-handle] min-content [content] minmax(auto,1fr) [remove-button] min-content;}&:has(", "){grid-template-columns:[drag-handle] min-content [content] minmax(auto,1fr);}&:has(", "){grid-template-columns:[content] minmax(auto,1fr) [remove-button] min-content;}grid-template-columns:[content] minmax(auto,1fr);column-gap:", ";row-gap:", ";" ],
|
|
113
|
-
var
|
|
109
|
+
})([ "", ";justify-content:start;&:has(", "):has(", "){grid-template-columns:[drag-handle] min-content [content] minmax(auto,1fr) [remove-button] min-content;}&:has(", "){grid-template-columns:[drag-handle] min-content [content] minmax(auto,1fr);}&:has(", "){grid-template-columns:[content] minmax(auto,1fr) [remove-button] min-content;}grid-template-columns:[content] minmax(auto,1fr);column-gap:", ";row-gap:", ";" ], g.mixins.reset("grid"), h, w, h, w, g.variables.spacingSmall, g.variables.spacingXSmall);
|
|
110
|
+
var S = f().div.withConfig({
|
|
114
111
|
displayName: "FormRowsStyles__StyledHeader",
|
|
115
112
|
componentId: "sc-1j4j7h3-3"
|
|
116
|
-
})([ "", ";grid-column:content;" ],
|
|
113
|
+
})([ "", ";grid-column:content;" ], g.mixins.typography("largeBody", {
|
|
117
114
|
color: "active"
|
|
118
115
|
}));
|
|
119
|
-
var
|
|
120
|
-
var
|
|
116
|
+
var O = (0, c.css)([ "grid-column:content;width:min-content;margin-block-start:", ";" ], g.variables.spacingXSmall);
|
|
117
|
+
var x = f()(m()).withConfig({
|
|
121
118
|
displayName: "FormRowsStyles__StyledAddRowButton",
|
|
122
119
|
componentId: "sc-1j4j7h3-4"
|
|
123
|
-
})([ "", ";" ],
|
|
124
|
-
var
|
|
120
|
+
})([ "", ";" ], O);
|
|
121
|
+
var j = f().div.withConfig({
|
|
125
122
|
displayName: "FormRowsStyles__StyledMenuWrapper",
|
|
126
123
|
componentId: "sc-1j4j7h3-5"
|
|
127
|
-
})([ "", ";" ],
|
|
128
|
-
var
|
|
124
|
+
})([ "", ";" ], O);
|
|
125
|
+
var C = f().div.withConfig({
|
|
129
126
|
displayName: "FormRowsStyles__StyledInputWrapper",
|
|
130
127
|
componentId: "sc-1j4j7h3-6"
|
|
131
|
-
})([ "display:flex;gap:", ";" ],
|
|
132
|
-
var
|
|
128
|
+
})([ "display:flex;gap:", ";" ], g.variables.spacingXSmall);
|
|
129
|
+
var E = function e(n) {
|
|
133
130
|
return n ? "drag-handle" : "content";
|
|
134
131
|
};
|
|
135
|
-
/* Row includes drag handle, input, and remove button */ var
|
|
132
|
+
/* Row includes drag handle, input, and remove button */ var k = f().div.withConfig({
|
|
136
133
|
displayName: "FormRowsStyles__StyledRow",
|
|
137
134
|
componentId: "sc-1j4j7h3-7"
|
|
138
|
-
})([ "", ";grid-template-columns:subgrid;grid-column:", " / -1;padding:", " 0;border-radius:", ";&.sorting{z-index:calc(", " + 1);}&:focus{outline:0;}", "" ],
|
|
135
|
+
})([ "", ";grid-template-columns:subgrid;grid-column:", " / -1;padding:", " 0;border-radius:", ";&.sorting{z-index:calc(", " + 1);}&:focus{outline:0;}", "" ], g.mixins.reset("grid"), (function(e) {
|
|
139
136
|
var n = e.$sortable;
|
|
140
|
-
return
|
|
141
|
-
}),
|
|
137
|
+
return E(n);
|
|
138
|
+
}), g.variables.spacingXSmall, g.variables.borderRadius, g.variables.zindexPopover, (function(e) {
|
|
142
139
|
var n = e.$sortable;
|
|
143
|
-
return n && (0,
|
|
140
|
+
return n && (0, c.css)([ "&:has(", ":active,", ":focus){background:", ";}&:not(:has(", ")){padding-inline-end:", ";}" ], h, h, g.variables.interactiveColorOverlayDrag, w, g.variables.spacingXSmall);
|
|
144
141
|
}));
|
|
142
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/TrashCanCross"
|
|
143
|
+
const q = require("@splunk/react-icons/TrashCanCross");
|
|
144
|
+
var P = e.n(q);
|
|
145
145
|
// CONCATENATED MODULE: ./src/FormRows/RowInternal.tsx
|
|
146
146
|
function I() {
|
|
147
147
|
return I = Object.assign ? Object.assign.bind() : function(e) {
|
|
@@ -184,38 +184,38 @@
|
|
|
184
184
|
style: a().object,
|
|
185
185
|
value: a().node
|
|
186
186
|
};
|
|
187
|
-
var
|
|
188
|
-
var
|
|
187
|
+
var M = (0, s._)("Remove row");
|
|
188
|
+
var T = t().forwardRef((function(e, n) {
|
|
189
189
|
var o = e.children, a = e.index, i = e.onRequestRemove, l = e.renderDragHandle, s = _(e, [ "children", "index", "onRequestRemove", "renderDragHandle" ]);
|
|
190
|
-
var u = (0, r.useContext)(d), c = u.disabledRemoveButton,
|
|
191
|
-
var
|
|
190
|
+
var u = (0, r.useContext)(d), c = u.disabledRemoveButton, f = u.hasOnRequestAdd, v = u.sortable;
|
|
191
|
+
var m = (0, r.useCallback)((function(e) {
|
|
192
192
|
// FormRows remove functionality doesn't work without an index, but index is not a required prop. FormRows will throw an error
|
|
193
193
|
// when rows are sortable and/or removable and index is not provided.
|
|
194
194
|
i === null || i === void 0 ? void 0 : i(e, {
|
|
195
195
|
index: a !== null && a !== void 0 ? a : 0
|
|
196
196
|
});
|
|
197
197
|
}), [ i, a ]);
|
|
198
|
-
var
|
|
198
|
+
var p = i !== undefined;
|
|
199
199
|
(0, r.useEffect)((function() {
|
|
200
200
|
if (false) {}
|
|
201
201
|
if (false) {}
|
|
202
202
|
if (false) {}
|
|
203
|
-
}), [
|
|
203
|
+
}), [ f, p, v, a ]);
|
|
204
204
|
|
|
205
|
-
return t().createElement(
|
|
206
|
-
$sortable:
|
|
205
|
+
return t().createElement(k, I({
|
|
206
|
+
$sortable: v,
|
|
207
207
|
"data-test": "row",
|
|
208
208
|
ref: n
|
|
209
|
-
}, s), l && l(), t().createElement(
|
|
209
|
+
}, s), l && l(), t().createElement(C, null, o), p && t().createElement(w, {
|
|
210
210
|
appearance: "subtle",
|
|
211
|
-
"aria-label":
|
|
211
|
+
"aria-label": M,
|
|
212
212
|
"data-test": "remove",
|
|
213
213
|
disabled: c,
|
|
214
|
-
onClick:
|
|
215
|
-
}, t().createElement(
|
|
214
|
+
onClick: m
|
|
215
|
+
}, t().createElement(P(), null)));
|
|
216
216
|
}));
|
|
217
|
-
|
|
218
|
-
/* harmony default export */ const N =
|
|
217
|
+
T.propTypes = A;
|
|
218
|
+
/* harmony default export */ const N = T;
|
|
219
219
|
// CONCATENATED MODULE: external "@dnd-kit/sortable"
|
|
220
220
|
const B = require("@dnd-kit/sortable");
|
|
221
221
|
// CONCATENATED MODULE: external "@dnd-kit/utilities"
|
|
@@ -292,37 +292,40 @@
|
|
|
292
292
|
// when rows are sortable and/or removable and index is not provided.
|
|
293
293
|
id: (a !== null && a !== void 0 ? a : 0) + 1
|
|
294
294
|
}), s = l.attributes, u = l.listeners, c = l.setActivatorNodeRef, f = l.setNodeRef, v = l.transform, m = l.transition;
|
|
295
|
-
var p = {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
295
|
+
var p = (0, r.useMemo)((function() {
|
|
296
|
+
return {
|
|
297
|
+
// CSS.Translate outputs only translate3d(x, y, 0), ignoring scale or rotation, so dragged items maintain their original size and shape. Using CSS.Transform here can incorrectly apply scale properties that will cause the element to scale or skew on drag.
|
|
298
|
+
transform: F.CSS.Translate.toString(v),
|
|
299
|
+
transition: m
|
|
300
|
+
};
|
|
301
|
+
}), [ v, m ]);
|
|
302
|
+
var b = (0, r.useCallback)((function(e) {
|
|
303
|
+
f(e);
|
|
304
|
+
L(n, e);
|
|
305
|
+
}), [ f, n ]);
|
|
303
306
|
var g = (0, r.useContext)(d), y = g.onKeyDown;
|
|
304
|
-
var
|
|
307
|
+
var w = (0, r.useCallback)((function(e) {
|
|
305
308
|
// FormRows drag functionality doesn't work without an index, but index is not a required prop. FormRows will throw an error
|
|
306
309
|
// when rows are sortable and/or removable and index is not provided.
|
|
307
310
|
y === null || y === void 0 ? void 0 : y(e, {
|
|
308
311
|
index: a !== null && a !== void 0 ? a : 0
|
|
309
312
|
});
|
|
310
313
|
}), [ y, a ]);
|
|
311
|
-
var
|
|
314
|
+
var R = (0, r.useCallback)((function() {
|
|
312
315
|
|
|
313
|
-
return t().createElement(
|
|
316
|
+
return t().createElement(h, K({
|
|
314
317
|
appearance: "subtle",
|
|
315
318
|
"aria-label": W,
|
|
316
319
|
"data-test": "drag-handle",
|
|
317
|
-
onKeyDown:
|
|
320
|
+
onKeyDown: w,
|
|
318
321
|
ref: c
|
|
319
322
|
}, u), t().createElement(X(), null));
|
|
320
|
-
}), [
|
|
323
|
+
}), [ w, u, c ]);
|
|
321
324
|
|
|
322
325
|
return t().createElement(N, K({
|
|
323
326
|
index: a,
|
|
324
327
|
ref: b,
|
|
325
|
-
renderDragHandle:
|
|
328
|
+
renderDragHandle: R,
|
|
326
329
|
style: p
|
|
327
330
|
}, i, s), o);
|
|
328
331
|
}));
|
|
@@ -618,7 +621,7 @@
|
|
|
618
621
|
var b = f !== undefined && !i;
|
|
619
622
|
var g = c !== undefined;
|
|
620
623
|
|
|
621
|
-
return t().createElement(
|
|
624
|
+
return t().createElement(R, se({
|
|
622
625
|
ref: l,
|
|
623
626
|
"data-test": "form-rows"
|
|
624
627
|
}, v), t().createElement(d.Provider, {
|
|
@@ -629,9 +632,9 @@
|
|
|
629
632
|
hasOnRequestAdd: g,
|
|
630
633
|
sortable: b
|
|
631
634
|
}
|
|
632
|
-
}, s && t().createElement(
|
|
635
|
+
}, s && t().createElement(S, null, s), t().createElement(le, {
|
|
633
636
|
onSortEnd: p
|
|
634
|
-
}, a), u && t().createElement(
|
|
637
|
+
}, a), u && t().createElement(j, null, u) || g && t().createElement(x, {
|
|
635
638
|
disabled: i,
|
|
636
639
|
appearance: "secondary",
|
|
637
640
|
"data-test": "add-row",
|
package/Image.js
CHANGED
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
// CONCATENATED MODULE: external "react"
|
|
68
68
|
const t = require("react");
|
|
69
69
|
var n = e.n(t);
|
|
70
|
-
// CONCATENATED MODULE: external "prop-types"
|
|
71
|
-
const a = require("prop-types");
|
|
72
|
-
var o = e.n(a);
|
|
73
70
|
// CONCATENATED MODULE: external "lodash/endsWith"
|
|
74
|
-
const
|
|
75
|
-
var
|
|
71
|
+
const a = require("lodash/endsWith");
|
|
72
|
+
var o = e.n(a);
|
|
76
73
|
// CONCATENATED MODULE: external "lodash/toLower"
|
|
77
|
-
const
|
|
74
|
+
const l = require("lodash/toLower");
|
|
75
|
+
var i = e.n(l);
|
|
76
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
77
|
+
const u = require("prop-types");
|
|
78
78
|
var s = e.n(u);
|
|
79
79
|
// CONCATENATED MODULE: external "@splunk/react-ui/File"
|
|
80
80
|
const c = require("@splunk/react-ui/File");
|
|
@@ -164,18 +164,18 @@
|
|
|
164
164
|
return t;
|
|
165
165
|
}
|
|
166
166
|
/** @public */ var S = {
|
|
167
|
-
allowExtensions:
|
|
168
|
-
defaultFilename:
|
|
169
|
-
defaultImageDataURI:
|
|
170
|
-
disabled:
|
|
171
|
-
dropAnywhere:
|
|
172
|
-
elementRef:
|
|
173
|
-
error:
|
|
174
|
-
onImageChange:
|
|
167
|
+
allowExtensions: s().arrayOf(s().string),
|
|
168
|
+
defaultFilename: s().string,
|
|
169
|
+
defaultImageDataURI: s().string,
|
|
170
|
+
disabled: s().bool,
|
|
171
|
+
dropAnywhere: s().bool,
|
|
172
|
+
elementRef: s().oneOfType([ s().func, s().object ]),
|
|
173
|
+
error: s().bool,
|
|
174
|
+
onImageChange: s().func
|
|
175
175
|
};
|
|
176
176
|
var R = function e(r, t) {
|
|
177
177
|
return !!r && t.some((function(e) {
|
|
178
|
-
return
|
|
178
|
+
return o()(i()(r), ".".concat(i()(e)));
|
|
179
179
|
}));
|
|
180
180
|
};
|
|
181
181
|
var E = new FileReader;
|