@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.
Files changed (94) hide show
  1. package/Accordion.js +59 -59
  2. package/Avatar.js +20 -20
  3. package/Breadcrumbs.js +46 -46
  4. package/Button.js +24 -24
  5. package/CHANGELOG.md +21 -2
  6. package/Calendar.js +69 -69
  7. package/Card.js +68 -68
  8. package/Chip.js +16 -16
  9. package/Clickable.js +29 -29
  10. package/Code.js +654 -519
  11. package/CollapsiblePanel.js +112 -112
  12. package/Color.js +107 -107
  13. package/ColumnLayout.js +35 -35
  14. package/ComboBox.js +190 -206
  15. package/ControlGroup.js +128 -120
  16. package/Date.js +148 -146
  17. package/DefinitionList.js +26 -26
  18. package/DualListbox.js +701 -717
  19. package/File.js +403 -403
  20. package/FormRows.js +66 -63
  21. package/Image.js +15 -15
  22. package/JSONTree.js +458 -357
  23. package/Layer.js +60 -72
  24. package/Markdown.js +66 -66
  25. package/Menu.js +44 -44
  26. package/Modal.js +49 -49
  27. package/ModalLayer.js +6 -6
  28. package/Monogram.js +16 -16
  29. package/Multiselect.js +622 -624
  30. package/Number.js +100 -100
  31. package/Paginator.js +7 -7
  32. package/Popover.js +453 -407
  33. package/Progress.js +12 -12
  34. package/Prose.js +6 -6
  35. package/RadioBar.js +180 -166
  36. package/RadioList.js +80 -79
  37. package/ResultsMenu.js +15 -15
  38. package/Scroll.js +50 -50
  39. package/Search.js +148 -164
  40. package/Select.js +668 -670
  41. package/Slider.js +30 -30
  42. package/SlidingPanels.js +24 -24
  43. package/SplitButton.js +50 -50
  44. package/StepBar.js +100 -100
  45. package/Switch.js +45 -45
  46. package/TabBar.js +196 -196
  47. package/TabLayout.js +16 -16
  48. package/Table.js +1207 -1193
  49. package/Text.js +65 -65
  50. package/TextArea.js +108 -93
  51. package/Tooltip.js +203 -197
  52. package/Tree.js +464 -366
  53. package/package.json +6 -6
  54. package/stubs-dependencies.d.ts +0 -70
  55. package/stubs-splunkui.d.ts +4 -0
  56. package/types/src/Code/Code.d.ts +17 -1
  57. package/types/src/Code/LineHighlights.d.ts +11 -0
  58. package/types/src/Code/LineNumbers.d.ts +6 -0
  59. package/types/src/Code/docs/examples/LineHighlights.d.ts +3 -0
  60. package/types/src/Code/docs/examples/LineNumbers.d.ts +3 -0
  61. package/types/src/Code/docs/examples/LineNumbersCustomStart.d.ts +3 -0
  62. package/types/src/Date/Date.d.ts +6 -1
  63. package/types/src/DefinitionList/DefinitionList.d.ts +6 -6
  64. package/types/src/FormRows/FormRows.d.ts +1 -1
  65. package/types/src/JSONTree/JSONTreeItem.d.ts +5 -2
  66. package/types/src/Markdown/Markdown.d.ts +1 -1
  67. package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +1 -1
  68. package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +1 -1
  69. package/types/src/Markdown/renderers/index.d.ts +1 -1
  70. package/types/src/Popover/Popover.d.ts +1 -1
  71. package/types/src/RadioBar/Option.d.ts +1 -1
  72. package/types/src/RadioBar/RadioBar.d.ts +13 -6
  73. package/types/src/RadioBar/RadioBarContext.d.ts +4 -2
  74. package/types/src/RadioList/RadioList.d.ts +2 -1
  75. package/types/src/ScreenReaderContent/docs/examples/SkipLink.d.ts +3 -0
  76. package/types/src/Scroll/Inner.d.ts +1 -1
  77. package/types/src/Select/Option.d.ts +1 -1
  78. package/types/src/Select/Select.d.ts +1 -1
  79. package/types/src/Slider/docs/examples/Controlled.d.ts +1 -1
  80. package/types/src/TabLayout/Panel.d.ts +0 -1
  81. package/types/src/Table/Head.d.ts +1 -0
  82. package/types/src/Table/HeadCell.d.ts +2 -3
  83. package/types/src/Table/HeadDropdownCell.d.ts +2 -2
  84. package/types/src/Table/HeadInner.d.ts +4 -4
  85. package/types/src/Table/KeyboardSensor.d.ts +1 -1
  86. package/types/src/Table/RowDragCell.d.ts +1 -1
  87. package/types/src/Tooltip/Tooltip.d.ts +10 -5
  88. package/types/src/Tree/Item.d.ts +63 -0
  89. package/types/src/Tree/Tree.d.ts +13 -6
  90. package/types/src/Tree/TreeContext.d.ts +1 -1
  91. package/types/src/Tree/index.d.ts +1 -1
  92. package/types/src/useControlled/useControlled.d.ts +3 -1
  93. package/useControlled.js +29 -13
  94. package/types/src/Tree/TreeItem.d.ts +0 -44
package/File.js CHANGED
@@ -61,275 +61,341 @@
61
61
  e.r(n);
62
62
  // EXPORTS
63
63
  e.d(n, {
64
- Item: () => /* reexport */ Sn,
64
+ Item: () => /* reexport */ Pn,
65
65
  default: () => /* reexport */ er
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
68
  const r = require("react");
69
69
  var t = e.n(r);
70
- // CONCATENATED MODULE: external "prop-types"
71
- const a = require("prop-types");
72
- var i = e.n(a);
73
70
  // CONCATENATED MODULE: external "lodash/debounce"
74
- const o = require("lodash/debounce");
75
- var l = e.n(o);
71
+ const a = require("lodash/debounce");
72
+ var i = e.n(a);
76
73
  // CONCATENATED MODULE: external "lodash/isString"
77
- const s = require("lodash/isString");
78
- var c = e.n(s);
74
+ const o = require("lodash/isString");
75
+ var l = e.n(o);
79
76
  // CONCATENATED MODULE: external "lodash/toUpper"
80
- const u = require("lodash/toUpper");
77
+ const s = require("lodash/toUpper");
78
+ var c = e.n(s);
79
+ // CONCATENATED MODULE: external "prop-types"
80
+ const u = require("prop-types");
81
81
  var d = e.n(u);
82
82
  // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
83
83
  const p = require("@splunk/react-ui/EventListener");
84
84
  var f = e.n(p);
85
- // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
86
- const v = require("@splunk/ui-utils/i18n");
87
85
  // CONCATENATED MODULE: external "@splunk/ui-utils/format"
88
- const m = require("@splunk/ui-utils/format");
86
+ const v = require("@splunk/ui-utils/format");
87
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
88
+ const m = require("@splunk/ui-utils/i18n");
89
89
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
90
90
  const y = require("@splunk/ui-utils/id");
91
- // CONCATENATED MODULE: external "@splunk/react-icons/Cross"
92
- const b = require("@splunk/react-icons/Cross");
93
- var g = e.n(b);
94
- // CONCATENATED MODULE: external "@splunk/react-icons/TrashCanCross"
95
- const h = require("@splunk/react-icons/TrashCanCross");
96
- var k = e.n(h);
97
- // CONCATENATED MODULE: external "@splunk/react-icons/ArrowsCircularDouble"
98
- const S = require("@splunk/react-icons/ArrowsCircularDouble");
99
- var q = e.n(S);
100
91
  // CONCATENATED MODULE: ./src/File/FileContext.tsx
101
- var w = (0, r.createContext)({
92
+ var b = (0, r.createContext)({
102
93
  disabled: false
103
94
  });
104
- w.displayName = "File";
105
- /* harmony default export */ const C = w;
95
+ b.displayName = "File";
96
+ /* harmony default export */ const g = b;
97
+ // CONCATENATED MODULE: external "styled-components"
98
+ const h = require("styled-components");
99
+ var k = e.n(h);
100
+ // CONCATENATED MODULE: external "@splunk/react-icons/ArrowBroadUnderbarUp"
101
+ const S = require("@splunk/react-icons/ArrowBroadUnderbarUp");
102
+ var q = e.n(S);
103
+ // CONCATENATED MODULE: external "@splunk/themes"
104
+ const w = require("@splunk/themes");
105
+ // CONCATENATED MODULE: ./src/File/FileStyles.ts
106
+ var C = "24px";
107
+ var F = "150px";
108
+ var x = k().input.withConfig({
109
+ displayName: "FileStyles__StyledInput",
110
+ componentId: "sc-1wyh4cf-0"
111
+ })([ "&[type='file']{width:0.1px;height:0.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;}" ]);
112
+ /* wraps the drop target box and the list of files */ var E = k().div.withConfig({
113
+ displayName: "FileStyles__StyledFileWrapper",
114
+ componentId: "sc-1wyh4cf-1"
115
+ })([ "display:flex;flex-direction:column;gap:", ";" ], w.variables.spacingSmall);
116
+ var I = k()(q()).withConfig({
117
+ displayName: "FileStyles__StyledUploadIcon",
118
+ componentId: "sc-1wyh4cf-2"
119
+ })([ "width:", ";height:", ";fill:", ";" ], C, C, w.variables.contentColorActive);
120
+ var _ = k().div.withConfig({
121
+ displayName: "FileStyles__StyledInstructionText",
122
+ componentId: "sc-1wyh4cf-3"
123
+ })([ "", ";" ], w.mixins.typography("body", {
124
+ color: "active",
125
+ weight: "semiBold"
126
+ }));
127
+ var R = k().div.withConfig({
128
+ displayName: "FileStyles__StyledFileTypeSupportMessage",
129
+ componentId: "sc-1wyh4cf-4"
130
+ })([ "color:", ";text-align:center;" ], w.variables.contentColorDefault);
131
+ var O = k().div.withConfig({
132
+ displayName: "FileStyles__StyledDropTarget",
133
+ componentId: "sc-1wyh4cf-5"
134
+ })([ "", ";flex-direction:column;align-items:center;justify-content:center;min-height:", ";gap:", ";padding:", ";border-radius:", ";cursor:pointer;", " ", " ", " ", " ", " ", " ", "" ], w.mixins.reset("flex"), F, w.variables.spacingXSmall, w.variables.spacingSmall, w.variables.borderRadius, (function(e) {
135
+ var n = e.$disabled;
136
+ return !n && (0, h.css)([ "&:hover{background-color:", ";", "{color:", ";}", "{fill:", ";}}" ], w.variables.actionColorBackgroundSubtleHover, /* sc-sel */ _, w.variables.contentColorAccentStrong, /* sc-sel */ I, w.variables.contentColorAccentStrong);
137
+ }), (function(e) {
138
+ var n = e.$screenMode;
139
+ return n === "normal" && (0, h.css)([ "border:", " dashed ", ";" ], w.variables.inputBorderWidth, w.variables.borderColor);
140
+ }), (function(e) {
141
+ var n = e.$dragOver, r = e.$focused, t = e.$error;
142
+ return (n || r && !t) && (0, h.css)([ "", "{color:", ";}", "{fill:", ";}" ], /* sc-sel */ _, w.variables.contentColorAccentStrong, /* sc-sel */ I, w.variables.contentColorAccentStrong);
143
+ }), (function(e) {
144
+ var n = e.$dragOver;
145
+ return n && (0, h.css)([ "background-color:", ";" ], w.variables.actionColorBackgroundSubtleHover);
146
+ }), (function(e) {
147
+ var n = e.$focused;
148
+ return n && (0, h.css)([ "box-shadow:", ";" ], w.variables.focusShadow);
149
+ }), (function(e) {
150
+ var n = e.$disabled;
151
+ return n && (0, h.css)([ "border-color:", ";cursor:not-allowed;", ",", "{color:", ";}", "{fill:", ";}" ], w.variables.borderColorWeak, /* sc-sel */ _, /* sc-sel */ R, w.variables.contentColorDisabled, /* sc-sel */ I, w.variables.contentColorDisabled);
152
+ }), (function(e) {
153
+ var n = e.$error, r = e.$dragOver;
154
+ return n && !r && (0, h.css)([ "border-color:", ";" ], w.variables.interactiveColorAccentError);
155
+ }));
156
+ var A = k().div.withConfig({
157
+ displayName: "FileStyles__StyledHelp",
158
+ componentId: "sc-1wyh4cf-6"
159
+ })([ "", ";" ], w.mixins.typography("smallBody"));
160
+ var T = k().div.withConfig({
161
+ displayName: "FileStyles__StyledWindowDrop",
162
+ componentId: "sc-1wyh4cf-7"
163
+ })([ "position:fixed;top:0;left:0;right:0;bottom:0;z-index:", " + 10;" ], w.variables.zindexModal);
164
+ var P = k().div.withConfig({
165
+ displayName: "FileStyles__StyledFileList",
166
+ componentId: "sc-1wyh4cf-8"
167
+ })([ "display:flex;flex-direction:column;gap:", ";" ], w.variables.spacingXSmall);
168
+ // CONCATENATED MODULE: external "@splunk/react-icons/ArrowsCircularDouble"
169
+ const j = require("@splunk/react-icons/ArrowsCircularDouble");
170
+ var N = e.n(j);
171
+ // CONCATENATED MODULE: external "@splunk/react-icons/Cross"
172
+ const D = require("@splunk/react-icons/Cross");
173
+ var M = e.n(D);
174
+ // CONCATENATED MODULE: external "@splunk/react-icons/TrashCanCross"
175
+ const $ = require("@splunk/react-icons/TrashCanCross");
176
+ var B = e.n($);
106
177
  // CONCATENATED MODULE: external "@splunk/react-icons/FileAiff"
107
- const F = require("@splunk/react-icons/FileAiff");
108
- var x = e.n(F);
178
+ const L = require("@splunk/react-icons/FileAiff");
179
+ var X = e.n(L);
109
180
  // CONCATENATED MODULE: external "@splunk/react-icons/FileCss"
110
- const E = require("@splunk/react-icons/FileCss");
111
- var I = e.n(E);
181
+ const U = require("@splunk/react-icons/FileCss");
182
+ var W = e.n(U);
112
183
  // CONCATENATED MODULE: external "@splunk/react-icons/FileCsv"
113
- const _ = require("@splunk/react-icons/FileCsv");
114
- var R = e.n(_);
184
+ const z = require("@splunk/react-icons/FileCsv");
185
+ var H = e.n(z);
115
186
  // CONCATENATED MODULE: external "@splunk/react-icons/FileDat"
116
- const O = require("@splunk/react-icons/FileDat");
117
- var A = e.n(O);
187
+ const J = require("@splunk/react-icons/FileDat");
188
+ var G = e.n(J);
118
189
  // CONCATENATED MODULE: external "@splunk/react-icons/FileDb"
119
- const T = require("@splunk/react-icons/FileDb");
120
- var P = e.n(T);
190
+ const V = require("@splunk/react-icons/FileDb");
191
+ var Z = e.n(V);
121
192
  // CONCATENATED MODULE: external "@splunk/react-icons/FileDbf"
122
- const j = require("@splunk/react-icons/FileDbf");
123
- var N = e.n(j);
193
+ const K = require("@splunk/react-icons/FileDbf");
194
+ var Q = e.n(K);
124
195
  // CONCATENATED MODULE: external "@splunk/react-icons/FileDoc"
125
- const D = require("@splunk/react-icons/FileDoc");
126
- var M = e.n(D);
196
+ const Y = require("@splunk/react-icons/FileDoc");
197
+ var ee = e.n(Y);
127
198
  // CONCATENATED MODULE: external "@splunk/react-icons/FileEps"
128
- const $ = require("@splunk/react-icons/FileEps");
129
- var B = e.n($);
199
+ const ne = require("@splunk/react-icons/FileEps");
200
+ var re = e.n(ne);
130
201
  // CONCATENATED MODULE: external "@splunk/react-icons/FileFig"
131
- const L = require("@splunk/react-icons/FileFig");
132
- var X = e.n(L);
202
+ const te = require("@splunk/react-icons/FileFig");
203
+ var ae = e.n(te);
133
204
  // CONCATENATED MODULE: external "@splunk/react-icons/FileGif"
134
- const U = require("@splunk/react-icons/FileGif");
135
- var W = e.n(U);
205
+ const ie = require("@splunk/react-icons/FileGif");
206
+ var oe = e.n(ie);
136
207
  // CONCATENATED MODULE: external "@splunk/react-icons/FileHtm"
137
- const z = require("@splunk/react-icons/FileHtm");
138
- var H = e.n(z);
208
+ const le = require("@splunk/react-icons/FileHtm");
209
+ var se = e.n(le);
139
210
  // CONCATENATED MODULE: external "@splunk/react-icons/FileHtml"
140
- const J = require("@splunk/react-icons/FileHtml");
141
- var G = e.n(J);
211
+ const ce = require("@splunk/react-icons/FileHtml");
212
+ var ue = e.n(ce);
142
213
  // CONCATENATED MODULE: external "@splunk/react-icons/FileIco"
143
- const V = require("@splunk/react-icons/FileIco");
144
- var Z = e.n(V);
214
+ const de = require("@splunk/react-icons/FileIco");
215
+ var pe = e.n(de);
145
216
  // CONCATENATED MODULE: external "@splunk/react-icons/FileJpg"
146
- const K = require("@splunk/react-icons/FileJpg");
147
- var Q = e.n(K);
217
+ const fe = require("@splunk/react-icons/FileJpg");
218
+ var ve = e.n(fe);
148
219
  // CONCATENATED MODULE: external "@splunk/react-icons/FileJs"
149
- const Y = require("@splunk/react-icons/FileJs");
150
- var ee = e.n(Y);
220
+ const me = require("@splunk/react-icons/FileJs");
221
+ var ye = e.n(me);
151
222
  // CONCATENATED MODULE: external "@splunk/react-icons/FileJson"
152
- const ne = require("@splunk/react-icons/FileJson");
153
- var re = e.n(ne);
223
+ const be = require("@splunk/react-icons/FileJson");
224
+ var ge = e.n(be);
154
225
  // CONCATENATED MODULE: external "@splunk/react-icons/FileJsx"
155
- const te = require("@splunk/react-icons/FileJsx");
156
- var ae = e.n(te);
226
+ const he = require("@splunk/react-icons/FileJsx");
227
+ var ke = e.n(he);
157
228
  // CONCATENATED MODULE: external "@splunk/react-icons/FileLog"
158
- const ie = require("@splunk/react-icons/FileLog");
159
- var oe = e.n(ie);
229
+ const Se = require("@splunk/react-icons/FileLog");
230
+ var qe = e.n(Se);
160
231
  // CONCATENATED MODULE: external "@splunk/react-icons/FileMid"
161
- const le = require("@splunk/react-icons/FileMid");
162
- var se = e.n(le);
232
+ const we = require("@splunk/react-icons/FileMid");
233
+ var Ce = e.n(we);
163
234
  // CONCATENATED MODULE: external "@splunk/react-icons/FileMp3"
164
- const ce = require("@splunk/react-icons/FileMp3");
165
- var ue = e.n(ce);
235
+ const Fe = require("@splunk/react-icons/FileMp3");
236
+ var xe = e.n(Fe);
166
237
  // CONCATENATED MODULE: external "@splunk/react-icons/FileMp4"
167
- const de = require("@splunk/react-icons/FileMp4");
168
- var pe = e.n(de);
238
+ const Ee = require("@splunk/react-icons/FileMp4");
239
+ var Ie = e.n(Ee);
169
240
  // CONCATENATED MODULE: external "@splunk/react-icons/FileMpg"
170
- const fe = require("@splunk/react-icons/FileMpg");
171
- var ve = e.n(fe);
241
+ const _e = require("@splunk/react-icons/FileMpg");
242
+ var Re = e.n(_e);
172
243
  // CONCATENATED MODULE: external "@splunk/react-icons/FilePdf"
173
- const me = require("@splunk/react-icons/FilePdf");
174
- var ye = e.n(me);
244
+ const Oe = require("@splunk/react-icons/FilePdf");
245
+ var Ae = e.n(Oe);
175
246
  // CONCATENATED MODULE: external "@splunk/react-icons/FilePhp"
176
- const be = require("@splunk/react-icons/FilePhp");
177
- var ge = e.n(be);
247
+ const Te = require("@splunk/react-icons/FilePhp");
248
+ var Pe = e.n(Te);
178
249
  // CONCATENATED MODULE: external "@splunk/react-icons/FilePng"
179
- const he = require("@splunk/react-icons/FilePng");
180
- var ke = e.n(he);
250
+ const je = require("@splunk/react-icons/FilePng");
251
+ var Ne = e.n(je);
181
252
  // CONCATENATED MODULE: external "@splunk/react-icons/FilePpt"
182
- const Se = require("@splunk/react-icons/FilePpt");
183
- var qe = e.n(Se);
253
+ const De = require("@splunk/react-icons/FilePpt");
254
+ var Me = e.n(De);
184
255
  // CONCATENATED MODULE: external "@splunk/react-icons/FileRar"
185
- const we = require("@splunk/react-icons/FileRar");
186
- var Ce = e.n(we);
256
+ const $e = require("@splunk/react-icons/FileRar");
257
+ var Be = e.n($e);
187
258
  // CONCATENATED MODULE: external "@splunk/react-icons/FileRtf"
188
- const Fe = require("@splunk/react-icons/FileRtf");
189
- var xe = e.n(Fe);
259
+ const Le = require("@splunk/react-icons/FileRtf");
260
+ var Xe = e.n(Le);
190
261
  // CONCATENATED MODULE: external "@splunk/react-icons/FileSql"
191
- const Ee = require("@splunk/react-icons/FileSql");
192
- var Ie = e.n(Ee);
262
+ const Ue = require("@splunk/react-icons/FileSql");
263
+ var We = e.n(Ue);
193
264
  // CONCATENATED MODULE: external "@splunk/react-icons/FileSvg"
194
- const _e = require("@splunk/react-icons/FileSvg");
195
- var Re = e.n(_e);
265
+ const ze = require("@splunk/react-icons/FileSvg");
266
+ var He = e.n(ze);
196
267
  // CONCATENATED MODULE: external "@splunk/react-icons/FileText"
197
- const Oe = require("@splunk/react-icons/FileText");
198
- var Ae = e.n(Oe);
268
+ const Je = require("@splunk/react-icons/FileText");
269
+ var Ge = e.n(Je);
199
270
  // CONCATENATED MODULE: external "@splunk/react-icons/FileTGZ"
200
- const Te = require("@splunk/react-icons/FileTGZ");
201
- var Pe = e.n(Te);
271
+ const Ve = require("@splunk/react-icons/FileTGZ");
272
+ var Ze = e.n(Ve);
202
273
  // CONCATENATED MODULE: external "@splunk/react-icons/FileTiff"
203
- const je = require("@splunk/react-icons/FileTiff");
204
- var Ne = e.n(je);
274
+ const Ke = require("@splunk/react-icons/FileTiff");
275
+ var Qe = e.n(Ke);
205
276
  // CONCATENATED MODULE: external "@splunk/react-icons/FileWav"
206
- const De = require("@splunk/react-icons/FileWav");
207
- var Me = e.n(De);
277
+ const Ye = require("@splunk/react-icons/FileWav");
278
+ var en = e.n(Ye);
208
279
  // CONCATENATED MODULE: external "@splunk/react-icons/FileXls"
209
- const $e = require("@splunk/react-icons/FileXls");
210
- var Be = e.n($e);
280
+ const nn = require("@splunk/react-icons/FileXls");
281
+ var rn = e.n(nn);
211
282
  // CONCATENATED MODULE: external "@splunk/react-icons/FileXml"
212
- const Le = require("@splunk/react-icons/FileXml");
213
- var Xe = e.n(Le);
283
+ const tn = require("@splunk/react-icons/FileXml");
284
+ var an = e.n(tn);
214
285
  // CONCATENATED MODULE: external "@splunk/react-icons/FileZip"
215
- const Ue = require("@splunk/react-icons/FileZip");
216
- var We = e.n(Ue);
286
+ const on = require("@splunk/react-icons/FileZip");
287
+ var ln = e.n(on);
217
288
  // CONCATENATED MODULE: external "@splunk/react-icons/Paperclip"
218
- const ze = require("@splunk/react-icons/Paperclip");
219
- var He = e.n(ze);
220
- // CONCATENATED MODULE: external "styled-components"
221
- const Je = require("styled-components");
222
- var Ge = e.n(Je);
223
- // CONCATENATED MODULE: external "@splunk/react-ui/Progress"
224
- const Ve = require("@splunk/react-ui/Progress");
225
- var Ze = e.n(Ve);
226
- // CONCATENATED MODULE: external "@splunk/themes"
227
- const Ke = require("@splunk/themes");
228
- // CONCATENATED MODULE: external "@splunk/react-ui/Button"
229
- const Qe = require("@splunk/react-ui/Button");
230
- var Ye = e.n(Qe);
289
+ const sn = require("@splunk/react-icons/Paperclip");
290
+ var cn = e.n(sn);
231
291
  // CONCATENATED MODULE: external "@splunk/react-icons/FileRipped"
232
- const en = require("@splunk/react-icons/FileRipped");
233
- var nn = e.n(en);
292
+ const un = require("@splunk/react-icons/FileRipped");
293
+ var dn = e.n(un);
294
+ // CONCATENATED MODULE: external "@splunk/react-ui/Button"
295
+ const pn = require("@splunk/react-ui/Button");
296
+ var fn = e.n(pn);
297
+ // CONCATENATED MODULE: external "@splunk/react-ui/Progress"
298
+ const vn = require("@splunk/react-ui/Progress");
299
+ var mn = e.n(vn);
234
300
  // CONCATENATED MODULE: ./src/File/ItemStyles.ts
235
- var rn = Ge().div.withConfig({
301
+ var yn = k().div.withConfig({
236
302
  displayName: "ItemStyles__StyledItemWrapper",
237
303
  componentId: "sc-1fsk3kr-0"
238
- })([ "", ";flex-direction:column;gap:", ";" ], Ke.mixins.reset("flex"), Ke.variables.spacingXSmall);
239
- var tn = Ge().div.withConfig({
304
+ })([ "", ";flex-direction:column;gap:", ";" ], w.mixins.reset("flex"), w.variables.spacingXSmall);
305
+ var bn = k().div.withConfig({
240
306
  displayName: "ItemStyles__StyledItem",
241
307
  componentId: "sc-1fsk3kr-1"
242
- })([ "display:flex;align-items:center;max-width:400px;padding:", " ", ";gap:", ";color:", ";", " ", ";& *:is(button){flex:none;}" ], Ke.variables.spacingXSmall, Ke.variables.spacingSmall, Ke.variables.spacingXSmall, Ke.variables.contentColorActive, (function(e) {
308
+ })([ "display:flex;align-items:center;max-width:400px;padding:", " ", ";gap:", ";color:", ";", " ", ";& *:is(button){flex:none;}" ], w.variables.spacingXSmall, w.variables.spacingSmall, w.variables.spacingXSmall, w.variables.contentColorActive, (function(e) {
243
309
  var n = e.$inProgress;
244
- return n && (0, Je.css)([ "color:", ";" ], Ke.variables.contentColorDefault);
310
+ return n && (0, h.css)([ "color:", ";" ], w.variables.contentColorDefault);
245
311
  }), (function(e) {
246
312
  var n = e.$disabled;
247
- return n && (0, Je.css)([ "cursor:not-allowed;color:", ";" ], Ke.variables.contentColorDisabled);
313
+ return n && (0, h.css)([ "cursor:not-allowed;color:", ";" ], w.variables.contentColorDisabled);
248
314
  }));
249
- var an = Ge()(nn()).withConfig({
315
+ var gn = k()(dn()).withConfig({
250
316
  displayName: "ItemStyles__StyledErrorIcon",
251
317
  componentId: "sc-1fsk3kr-2"
252
- })([ "fill:", ";" ], Ke.variables.contentColorNegative);
253
- var on = "28px";
254
- var ln = Ge().div.withConfig({
318
+ })([ "fill:", ";" ], w.variables.contentColorNegative);
319
+ var hn = "28px";
320
+ var kn = k().div.withConfig({
255
321
  displayName: "ItemStyles__StyledIcon",
256
322
  componentId: "sc-1fsk3kr-3"
257
- })([ "display:grid;justify-content:center;align-items:center;&:has(img){height:", ";width:", ";& img{max-width:", ";max-height:", ";}}" ], on, on, on, on);
258
- var sn = Ge().div.withConfig({
323
+ })([ "display:grid;justify-content:center;align-items:center;&:has(img){height:", ";width:", ";& img{max-width:", ";max-height:", ";}}" ], hn, hn, hn, hn);
324
+ var Sn = k().div.withConfig({
259
325
  displayName: "ItemStyles__StyledLabel",
260
326
  componentId: "sc-1fsk3kr-4"
261
327
  })([ "overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1 0 0;" ]);
262
- var cn = Ge()(Ze()).withConfig({
328
+ var qn = k()(mn()).withConfig({
263
329
  displayName: "ItemStyles__StyledProgress",
264
330
  componentId: "sc-1fsk3kr-5"
265
331
  })([ "width:80px;height:6px;" ]);
266
- var un = Ge()(Ye()).withConfig({
332
+ var wn = k()(fn()).withConfig({
267
333
  displayName: "ItemStyles__StyledButton",
268
334
  componentId: "sc-1fsk3kr-6"
269
- })([ "&:not([disabled],[aria-disabled='true']){color:", ";}" ], Ke.variables.contentColorActive);
270
- var dn = Ge().div.withConfig({
335
+ })([ "&:not([disabled],[aria-disabled='true']){color:", ";}" ], w.variables.contentColorActive);
336
+ var Cn = k().div.withConfig({
271
337
  displayName: "ItemStyles__StyledErrorText",
272
338
  componentId: "sc-1fsk3kr-7"
273
- })([ "", ";color:", ";padding:", ";" ], Ke.mixins.typography("smallBody"), Ke.variables.contentColorNegative, Ke.variables.spacingXSmall);
339
+ })([ "", ";color:", ";padding:", ";" ], w.mixins.typography("smallBody"), w.variables.contentColorNegative, w.variables.spacingXSmall);
274
340
  // CONCATENATED MODULE: ./src/File/ItemIcon.tsx
275
- var pn = {
276
- aif: x(),
277
- aiff: x(),
278
- css: I(),
279
- csv: R(),
280
- dat: A(),
281
- db: P(),
282
- dbf: N(),
283
- doc: M(),
284
- eps: B(),
285
- fig: X(),
286
- gif: W(),
287
- htm: H(),
288
- html: G(),
289
- ico: Z(),
290
- jpg: Q(),
291
- js: ee(),
292
- json: re(),
293
- jsx: ae(),
294
- log: oe(),
295
- mid: se(),
296
- mp3: ue(),
297
- mp4: pe(),
298
- mpg: ve(),
299
- pdf: ye(),
300
- php: ge(),
301
- png: ke(),
302
- ppt: qe(),
303
- rar: Ce(),
304
- rtf: xe(),
305
- sql: Ie(),
306
- svg: Re(),
307
- txt: Ae(),
308
- tgz: Pe(),
309
- tiff: Ne(),
310
- wav: Me(),
311
- xls: Be(),
312
- xml: Xe(),
313
- zip: We()
341
+ var Fn = {
342
+ aif: X(),
343
+ aiff: X(),
344
+ css: W(),
345
+ csv: H(),
346
+ dat: G(),
347
+ db: Z(),
348
+ dbf: Q(),
349
+ doc: ee(),
350
+ eps: re(),
351
+ fig: ae(),
352
+ gif: oe(),
353
+ htm: se(),
354
+ html: ue(),
355
+ ico: pe(),
356
+ jpg: ve(),
357
+ js: ye(),
358
+ json: ge(),
359
+ jsx: ke(),
360
+ log: qe(),
361
+ mid: Ce(),
362
+ mp3: xe(),
363
+ mp4: Ie(),
364
+ mpg: Re(),
365
+ pdf: Ae(),
366
+ php: Pe(),
367
+ png: Ne(),
368
+ ppt: Me(),
369
+ rar: Be(),
370
+ rtf: Xe(),
371
+ sql: We(),
372
+ svg: He(),
373
+ txt: Ge(),
374
+ tgz: Ze(),
375
+ tiff: Qe(),
376
+ wav: en(),
377
+ xls: rn(),
378
+ xml: an(),
379
+ zip: ln()
314
380
  };
315
- var fn = function e(n) {
381
+ var xn = function e(n) {
316
382
  var r;
317
383
  var a = n.name, i = a === void 0 ? "" : a, o = n.icon;
318
384
  /* if custom icon passed in use it */ if (o) {
319
385
 
320
- return t().createElement(ln, null, o);
386
+ return t().createElement(kn, null, o);
321
387
  }
322
388
  var l = ((r = i.split(".").pop()) === null || r === void 0 ? void 0 : r.toLowerCase()) || "";
323
- var s = pn[l] || He();
389
+ var s = Fn[l] || cn();
324
390
 
325
391
  return t().createElement(s, {
326
392
  "aria-hidden": "true"
327
393
  });
328
394
  };
329
- /* harmony default export */ const vn = fn;
395
+ /* harmony default export */ const En = xn;
330
396
  // CONCATENATED MODULE: ./src/File/Item.tsx
331
- function mn() {
332
- return mn = Object.assign ? Object.assign.bind() : function(e) {
397
+ function In() {
398
+ return In = Object.assign ? Object.assign.bind() : function(e) {
333
399
  for (var n = 1; n < arguments.length; n++) {
334
400
  var r = arguments[n];
335
401
  for (var t in r) {
@@ -337,11 +403,11 @@
337
403
  }
338
404
  }
339
405
  return e;
340
- }, mn.apply(null, arguments);
406
+ }, In.apply(null, arguments);
341
407
  }
342
- function yn(e, n) {
408
+ function _n(e, n) {
343
409
  if (null == e) return {};
344
- var r, t, a = bn(e, n);
410
+ var r, t, a = Rn(e, n);
345
411
  if (Object.getOwnPropertySymbols) {
346
412
  var i = Object.getOwnPropertySymbols(e);
347
413
  for (t = 0; t < i.length; t++) {
@@ -350,7 +416,7 @@
350
416
  }
351
417
  return a;
352
418
  }
353
- function bn(e, n) {
419
+ function Rn(e, n) {
354
420
  if (null == e) return {};
355
421
  var r = {};
356
422
  for (var t in e) {
@@ -361,166 +427,100 @@
361
427
  }
362
428
  return r;
363
429
  }
364
- var gn = {
365
- disabled: i().bool,
366
- elementRef: i().oneOfType([ i().func, i().object ]),
367
- error: i().bool,
430
+ var On = {
431
+ disabled: d().bool,
432
+ elementRef: d().oneOfType([ d().func, d().object ]),
433
+ error: d().bool,
368
434
  /** @private */
369
- icon: i().node,
435
+ icon: d().node,
370
436
  /** @private */
371
- index: i().number,
372
- itemId: i().any,
373
- name: i().string.isRequired,
437
+ index: d().number,
438
+ itemId: d().any,
439
+ name: d().string.isRequired,
374
440
  /** If the uploadPercentage is 0, the item is assumed to be queued. If the upload is complete or
375
441
  * not applicable, uploadPercentage must be undefined. */
376
- uploadPercentage: i().number
442
+ uploadPercentage: d().number
377
443
  };
378
- var hn = t().createElement(an, {
444
+ var An = t().createElement(gn, {
379
445
  variant: "filled"
380
446
  });
381
- function kn(e) {
382
- var n = e.disabled, a = e.elementRef, i = e.error, o = i === void 0 ? false : i, l = e.icon, s = e.itemId, c = e.name, u = e.index, d = u === void 0 ? 0 : u, p = e.uploadPercentage, f = yn(e, [ "disabled", "elementRef", "error", "icon", "itemId", "name", "index", "uploadPercentage" ]);
447
+ function Tn(e) {
448
+ var n = e.disabled, a = e.elementRef, i = e.error, o = i === void 0 ? false : i, l = e.icon, s = e.itemId, c = e.name, u = e.index, d = u === void 0 ? 0 : u, p = e.uploadPercentage, f = _n(e, [ "disabled", "elementRef", "error", "icon", "itemId", "name", "index", "uploadPercentage" ]);
383
449
  // @docs-props-type ItemPropsBase
384
- var y = (0, r.useContext)(w), b = y.onRequestRemove;
450
+ var y = (0, r.useContext)(b), g = y.onRequestRemove;
385
451
  var h = (0, r.useCallback)((function(e) {
386
452
  e.preventDefault();
387
- b === null || b === void 0 ? void 0 : b({
453
+ g === null || g === void 0 ? void 0 : g({
388
454
  itemId: s,
389
455
  name: c,
390
456
  index: d
391
457
  });
392
- }), [ b, s, c, d ]);
393
- var S = (0, r.useContext)(w), C = S.onRequestRetry;
394
- var F = (0, r.useCallback)((function(e) {
458
+ }), [ g, s, c, d ]);
459
+ var k = (0, r.useContext)(b), S = k.onRequestRetry;
460
+ var q = (0, r.useCallback)((function(e) {
395
461
  e.preventDefault();
396
- C === null || C === void 0 ? void 0 : C({
462
+ S === null || S === void 0 ? void 0 : S({
397
463
  itemId: s,
398
464
  name: c,
399
465
  index: d
400
466
  });
401
- }), [ C, s, c, d ]);
402
- var x = (0, r.useContext)(w), E = x.disabled;
403
- var I = (0, m.sprintf)((0, v._)('Remove "%(filename)s"'), {
467
+ }), [ S, s, c, d ]);
468
+ var w = (0, r.useContext)(b), C = w.disabled;
469
+ var F = (0, v.sprintf)((0, m._)('Remove "%(filename)s"'), {
404
470
  filename: c
405
471
  });
406
- var _ = (0, m.sprintf)((0, v._)('Retry "%(filename)s"'), {
472
+ var x = (0, v.sprintf)((0, m._)('Retry "%(filename)s"'), {
407
473
  filename: c
408
474
  });
409
- var R = (0, m.sprintf)((0, v._)('Uploading "%(filename)s"'), {
475
+ var E = (0, v.sprintf)((0, m._)('Uploading "%(filename)s"'), {
410
476
  filename: c
411
477
  });
412
- var O = (0, v._)("Remove");
413
- var A = n !== undefined ? n : E;
414
- var T = p !== undefined && p > 0;
415
- var P = o ? hn : t().createElement(vn, {
478
+ var I = (0, m._)("Remove");
479
+ var _ = n !== undefined ? n : C;
480
+ var R = p !== undefined && p > 0;
481
+ var O = o ? An : t().createElement(En, {
416
482
  name: c,
417
483
  icon: l
418
484
  });
419
485
 
420
- return t().createElement(rn, null, t().createElement(tn, mn({
486
+ return t().createElement(yn, null, t().createElement(bn, In({
421
487
  "data-test": "item",
422
- "data-test-disabled": A ? "disabled" : undefined,
488
+ "data-test-disabled": _ ? "disabled" : undefined,
423
489
  "data-test-error": o,
424
490
  ref: a
425
491
  }, f, {
426
- $disabled: A,
427
- $inProgress: T
428
- }), P, t().createElement(sn, {
492
+ $disabled: _,
493
+ $inProgress: R
494
+ }), O, t().createElement(Sn, {
429
495
  "data-test": "label"
430
- }, c), T && t().createElement(t().Fragment, null, t().createElement(cn, {
496
+ }, c), R && t().createElement(t().Fragment, null, t().createElement(qn, {
431
497
  percentage: p,
432
- "aria-label": R
433
- }), t().createElement("span", null, p, "%")), C && o && t().createElement(un, {
498
+ "aria-label": E
499
+ }), t().createElement("span", null, p, "%")), S && o && t().createElement(wn, {
434
500
  "data-test": "retry",
435
- onClick: F,
436
- "aria-label": _,
501
+ onClick: q,
502
+ "aria-label": x,
437
503
  appearance: "subtle"
438
- }, t().createElement(q(), {
439
- "aria-label": (0, v._)("Retry")
440
- })), !A && (p === undefined && !o ? t().createElement(un, {
504
+ }, t().createElement(N(), {
505
+ "aria-label": (0, m._)("Retry")
506
+ })), !_ && (p === undefined && !o ? t().createElement(wn, {
441
507
  "data-test": "remove",
442
508
  onClick: h,
443
- "aria-label": I,
509
+ "aria-label": F,
444
510
  appearance: "subtle"
445
- }, t().createElement(k(), {
446
- "aria-label": O
447
- })) : t().createElement(un, {
511
+ }, t().createElement(B(), {
512
+ "aria-label": I
513
+ })) : t().createElement(wn, {
448
514
  "data-test": "remove",
449
515
  onClick: h,
450
- "aria-label": I,
516
+ "aria-label": F,
451
517
  appearance: "subtle"
452
- }, t().createElement(g(), {
453
- "aria-label": O
454
- })))), o && t().createElement(dn, null, (0, v._)("Something went wrong.")));
518
+ }, t().createElement(M(), {
519
+ "aria-label": I
520
+ })))), o && t().createElement(Cn, null, (0, m._)("Something went wrong.")));
455
521
  }
456
- kn.propTypes = gn;
457
- /* harmony default export */ const Sn = kn;
458
- // CONCATENATED MODULE: external "@splunk/react-icons/ArrowBroadUnderbarUp"
459
- const qn = require("@splunk/react-icons/ArrowBroadUnderbarUp");
460
- var wn = e.n(qn);
461
- // CONCATENATED MODULE: ./src/File/FileStyles.ts
462
- var Cn = "24px";
463
- var Fn = "150px";
464
- var xn = Ge().input.withConfig({
465
- displayName: "FileStyles__StyledInput",
466
- componentId: "sc-1wyh4cf-0"
467
- })([ "&[type='file']{width:0.1px;height:0.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;}" ]);
468
- /* wraps the drop target box and the list of files */ var En = Ge().div.withConfig({
469
- displayName: "FileStyles__StyledFileWrapper",
470
- componentId: "sc-1wyh4cf-1"
471
- })([ "display:flex;flex-direction:column;gap:", ";" ], Ke.variables.spacingSmall);
472
- var In = Ge()(wn()).withConfig({
473
- displayName: "FileStyles__StyledUploadIcon",
474
- componentId: "sc-1wyh4cf-2"
475
- })([ "width:", ";height:", ";fill:", ";" ], Cn, Cn, Ke.variables.contentColorActive);
476
- var _n = Ge().div.withConfig({
477
- displayName: "FileStyles__StyledInstructionText",
478
- componentId: "sc-1wyh4cf-3"
479
- })([ "", ";" ], Ke.mixins.typography("body", {
480
- color: "active",
481
- weight: "semiBold"
482
- }));
483
- var Rn = Ge().div.withConfig({
484
- displayName: "FileStyles__StyledFileTypeSupportMessage",
485
- componentId: "sc-1wyh4cf-4"
486
- })([ "color:", ";text-align:center;" ], Ke.variables.contentColorDefault);
487
- var On = Ge().div.withConfig({
488
- displayName: "FileStyles__StyledDropTarget",
489
- componentId: "sc-1wyh4cf-5"
490
- })([ "", ";flex-direction:column;align-items:center;justify-content:center;min-height:", ";gap:", ";padding:", ";border-radius:", ";cursor:pointer;", " ", " ", " ", " ", " ", " ", "" ], Ke.mixins.reset("flex"), Fn, Ke.variables.spacingXSmall, Ke.variables.spacingSmall, Ke.variables.borderRadius, (function(e) {
491
- var n = e.$disabled;
492
- return !n && (0, Je.css)([ "&:hover{background-color:", ";", "{color:", ";}", "{fill:", ";}}" ], Ke.variables.actionColorBackgroundSubtleHover, /* sc-sel */ _n, Ke.variables.contentColorAccentStrong, /* sc-sel */ In, Ke.variables.contentColorAccentStrong);
493
- }), (function(e) {
494
- var n = e.$screenMode;
495
- return n === "normal" && (0, Je.css)([ "border:", " dashed ", ";" ], Ke.variables.inputBorderWidth, Ke.variables.borderColor);
496
- }), (function(e) {
497
- var n = e.$dragOver, r = e.$focused, t = e.$error;
498
- return (n || r && !t) && (0, Je.css)([ "", "{color:", ";}", "{fill:", ";}" ], /* sc-sel */ _n, Ke.variables.contentColorAccentStrong, /* sc-sel */ In, Ke.variables.contentColorAccentStrong);
499
- }), (function(e) {
500
- var n = e.$dragOver;
501
- return n && (0, Je.css)([ "background-color:", ";" ], Ke.variables.actionColorBackgroundSubtleHover);
502
- }), (function(e) {
503
- var n = e.$focused;
504
- return n && (0, Je.css)([ "box-shadow:", ";" ], Ke.variables.focusShadow);
505
- }), (function(e) {
506
- var n = e.$disabled;
507
- return n && (0, Je.css)([ "border-color:", ";cursor:not-allowed;", ",", "{color:", ";}", "{fill:", ";}" ], Ke.variables.borderColorWeak, /* sc-sel */ _n, /* sc-sel */ Rn, Ke.variables.contentColorDisabled, /* sc-sel */ In, Ke.variables.contentColorDisabled);
508
- }), (function(e) {
509
- var n = e.$error, r = e.$dragOver;
510
- return n && !r && (0, Je.css)([ "border-color:", ";" ], Ke.variables.interactiveColorAccentError);
511
- }));
512
- var An = Ge().div.withConfig({
513
- displayName: "FileStyles__StyledHelp",
514
- componentId: "sc-1wyh4cf-6"
515
- })([ "", ";" ], Ke.mixins.typography("smallBody"));
516
- var Tn = Ge().div.withConfig({
517
- displayName: "FileStyles__StyledWindowDrop",
518
- componentId: "sc-1wyh4cf-7"
519
- })([ "position:fixed;top:0;left:0;right:0;bottom:0;z-index:", " + 10;" ], Ke.variables.zindexModal);
520
- var Pn = Ge().div.withConfig({
521
- displayName: "FileStyles__StyledFileList",
522
- componentId: "sc-1wyh4cf-8"
523
- })([ "display:flex;flex-direction:column;gap:", ";" ], Ke.variables.spacingXSmall);
522
+ Tn.propTypes = On;
523
+ /* harmony default export */ const Pn = Tn;
524
524
  // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
525
525
  /* eslint-disable @typescript-eslint/no-empty-function */
526
526
  var jn = {
@@ -727,181 +727,181 @@
727
727
  }
728
728
  /** @public */
729
729
  /** @public */ var Qn = {
730
- accept: i().string,
731
- allowMultiple: i().bool,
732
- children: i().node,
733
- disabled: i().bool,
734
- dropAnywhere: i().bool,
735
- elementRef: i().oneOfType([ i().func, i().object ]),
736
- fullscreen: i().bool,
737
- error: i().bool,
738
- help: i().node,
739
- name: i().string,
740
- onRequestAdd: i().func,
741
- onRequestRemove: i().func,
742
- onRequestRetry: i().func,
730
+ accept: d().string,
731
+ allowMultiple: d().bool,
732
+ children: d().node,
733
+ disabled: d().bool,
734
+ dropAnywhere: d().bool,
735
+ elementRef: d().oneOfType([ d().func, d().object ]),
736
+ fullscreen: d().bool,
737
+ error: d().bool,
738
+ help: d().node,
739
+ name: d().string,
740
+ onRequestAdd: d().func,
741
+ onRequestRemove: d().func,
742
+ onRequestRetry: d().func,
743
743
  /** @private. */
744
- required: i().bool,
745
- supportsMessage: i().node
744
+ required: d().bool,
745
+ supportsMessage: d().node
746
746
  };
747
747
  /**
748
748
  * File provides the ability to accept files and present uploaded files. It does not provide
749
749
  * file readers, only a reference to the file. This can be used to post binary content, or
750
750
  * upload using an array buffer.
751
751
  */ function Yn(e) {
752
- var n = e.accept, a = e.allowMultiple, i = e.children, o = e.disabled, s = e.dropAnywhere, u = e.elementRef, p = e.error, b = e.fullscreen, g = e.help, h = e.name, k = e.onRequestAdd, S = e.onRequestRemove, q = e.onRequestRetry, w = e.required, F = e.supportsMessage, x = Zn(e, [ "accept", "allowMultiple", "children", "disabled", "dropAnywhere", "elementRef", "error", "fullscreen", "help", "name", "onRequestAdd", "onRequestRemove", "onRequestRetry", "required", "supportsMessage" ]);
752
+ var n = e.accept, a = e.allowMultiple, o = e.children, s = e.disabled, u = e.dropAnywhere, d = e.elementRef, p = e.error, b = e.fullscreen, h = e.help, k = e.name, S = e.onRequestAdd, q = e.onRequestRemove, w = e.onRequestRetry, C = e.required, F = e.supportsMessage, j = Zn(e, [ "accept", "allowMultiple", "children", "disabled", "dropAnywhere", "elementRef", "error", "fullscreen", "help", "name", "onRequestAdd", "onRequestRemove", "onRequestRetry", "required", "supportsMessage" ]);
753
753
  // @docs-props-type FilePropsBase
754
- var E = (0, r.useState)(false), I = Wn(E, 2), _ = I[0], R = I[1];
755
- var O = (0, r.useState)(false), A = Wn(O, 2), T = A[0], P = A[1];
754
+ var N = (0, r.useState)(false), D = Wn(N, 2), M = D[0], $ = D[1];
755
+ var B = (0, r.useState)(false), L = Wn(B, 2), X = L[0], U = L[1];
756
756
  /* Each time a file is uploaded this is incremented and used to generate the
757
- * file input's key. In this way we get a new input without a value. */ var j = (0,
758
- r.useState)(0), N = Wn(j, 2), D = N[0], M = N[1];
759
- var $ = (0, y.createDOMID)();
760
- var B = (0, r.useCallback)((function(e) {
757
+ * file input's key. In this way we get a new input without a value. */ var W = (0,
758
+ r.useState)(0), z = Wn(W, 2), H = z[0], J = z[1];
759
+ var G = (0, y.createDOMID)();
760
+ var V = (0, r.useCallback)((function(e) {
761
761
  if (e !== undefined && e.length > 0) {
762
762
  var n = Array.from(e);
763
- k === null || k === void 0 ? void 0 : k(a ? n : [ n[0] ], {
764
- name: h
763
+ S === null || S === void 0 ? void 0 : S(a ? n : [ n[0] ], {
764
+ name: k
765
765
  });
766
766
  } else {
767
- k === null || k === void 0 ? void 0 : k([], {
768
- name: h
767
+ S === null || S === void 0 ? void 0 : S([], {
768
+ name: k
769
769
  });
770
770
  }
771
- M((function(e) {
771
+ J((function(e) {
772
772
  return e + 1;
773
773
  }));
774
- }), [ a, h, k ]);
775
- var L = (0, r.useCallback)((function(e) {
774
+ }), [ a, k, S ]);
775
+ var Z = (0, r.useCallback)((function(e) {
776
776
  var n;
777
- B((n = e.currentTarget.files) !== null && n !== void 0 ? n : undefined);
778
- }), [ B ]);
779
- var X = (0, r.useCallback)((function() {
780
- P(true);
777
+ V((n = e.currentTarget.files) !== null && n !== void 0 ? n : undefined);
778
+ }), [ V ]);
779
+ var K = (0, r.useCallback)((function() {
780
+ U(true);
781
781
  }), []);
782
- var U = (0, r.useCallback)((function() {
783
- P(false);
782
+ var Q = (0, r.useCallback)((function() {
783
+ U(false);
784
784
  }), []);
785
- var W = (0, r.useCallback)((function(e) {
786
- if (!_) {
787
- R(true);
785
+ var Y = (0, r.useCallback)((function(e) {
786
+ if (!M) {
787
+ $(true);
788
788
  }
789
789
  e.preventDefault();
790
- }), [ _ ]);
791
- var z = (0, r.useMemo)((function() {
792
- return l()((function() {
793
- return R(false);
790
+ }), [ M ]);
791
+ var ee = (0, r.useMemo)((function() {
792
+ return i()((function() {
793
+ return $(false);
794
794
  }), 300);
795
- }), [ R ]);
796
- var H = (0, r.useCallback)((function(e) {
795
+ }), [ $ ]);
796
+ var ne = (0, r.useCallback)((function(e) {
797
797
  var n;
798
798
  e.preventDefault();
799
- z();
800
- B((n = e.dataTransfer) === null || n === void 0 ? void 0 : n.files);
801
- }), [ B, z ]);
802
- var J = (0, r.useCallback)((function(e) {
799
+ ee();
800
+ V((n = e.dataTransfer) === null || n === void 0 ? void 0 : n.files);
801
+ }), [ V, ee ]);
802
+ var re = (0, r.useCallback)((function(e) {
803
803
  var n = e.name, r = e.index, t = e.itemId;
804
- q === null || q === void 0 ? void 0 : q({
804
+ w === null || w === void 0 ? void 0 : w({
805
805
  event: e,
806
806
  filename: n,
807
807
  index: r,
808
808
  itemId: t,
809
- name: h
809
+ name: k
810
810
  });
811
- }), [ h, q ]);
812
- var G = (0, r.useCallback)((function(e) {
811
+ }), [ k, w ]);
812
+ var te = (0, r.useCallback)((function(e) {
813
813
  var n = e.name, r = e.index, t = e.itemId;
814
- S === null || S === void 0 ? void 0 : S({
814
+ q === null || q === void 0 ? void 0 : q({
815
815
  event: e,
816
816
  filename: n,
817
817
  index: r,
818
818
  itemId: t,
819
- name: h
819
+ name: k
820
820
  });
821
- }), [ h, S ]);
822
- var V = r.Children.toArray(i).filter(r.isValidElement).map((function(e, n) {
821
+ }), [ k, q ]);
822
+ var ae = r.Children.toArray(o).filter(r.isValidElement).map((function(e, n) {
823
823
 
824
824
  return (0, r.cloneElement)(e, {
825
825
  index: n,
826
826
  key: e.key || e.props.itemId || "item-".concat(n)
827
827
  });
828
828
  }));
829
- var Z = b || s;
830
- var K = Z || o;
831
- var Q = Z && !o;
832
- var Y = o ? false : _ || false;
833
- var ee = b ? "full" : "normal";
834
- var ne = c()(n) && d()(n.split(",").join(", "));
835
- var re = Z ? (0, v._)("Drop your file anywhere or click this area to upload") : (0,
836
- v._)("Click or drag file to this area to upload");
837
- var te = F;
838
- if (!te) {
839
- te = n ? (0, m.sprintf)((0, v._)("Supports %(fileTypes)s"), {
840
- fileTypes: ne
841
- }) : (0, v._)("Supports all file types");
829
+ var ie = b || u;
830
+ var oe = ie || s;
831
+ var le = ie && !s;
832
+ var se = s ? false : M || false;
833
+ var ce = b ? "full" : "normal";
834
+ var ue = l()(n) && c()(n.split(",").join(", "));
835
+ var de = ie ? (0, m._)("Drop your file anywhere or click this area to upload") : (0,
836
+ m._)("Click or drag file to this area to upload");
837
+ var pe = F;
838
+ if (!pe) {
839
+ pe = n ? (0, v.sprintf)((0, m._)("Supports %(fileTypes)s"), {
840
+ fileTypes: ue
841
+ }) : (0, m._)("Supports all file types");
842
842
  }
843
- var ae = (0, r.useMemo)((function() {
843
+ var fe = (0, r.useMemo)((function() {
844
844
  return {
845
- disabled: !!o,
846
- onRequestRemove: S ? G : undefined,
847
- onRequestRetry: q ? J : undefined
845
+ disabled: !!s,
846
+ onRequestRemove: q ? te : undefined,
847
+ onRequestRetry: w ? re : undefined
848
848
  };
849
- }), [ o, G, J, S, q ]);
849
+ }), [ s, te, re, q, w ]);
850
850
 
851
- return t().createElement(En, Un({
852
- ref: u,
851
+ return t().createElement(E, Un({
852
+ ref: d,
853
853
  "data-test": "file",
854
- "data-test-disabled": o ? "disabled" : undefined,
854
+ "data-test-disabled": s ? "disabled" : undefined,
855
855
  "data-test-error": !!p
856
- }, x), t().createElement("label", {
857
- htmlFor: $,
856
+ }, j), t().createElement("label", {
857
+ htmlFor: G,
858
858
  "data-test": "file-label"
859
- }, t().createElement(On, {
859
+ }, t().createElement(O, {
860
860
  "data-test": "file-drop-target",
861
- onDragOver: K ? undefined : W,
862
- onDragLeave: K ? undefined : z,
863
- onDrop: K ? undefined : H,
864
- $disabled: !!o,
865
- $dragOver: Y,
861
+ onDragOver: oe ? undefined : Y,
862
+ onDragLeave: oe ? undefined : ee,
863
+ onDrop: oe ? undefined : ne,
864
+ $disabled: !!s,
865
+ $dragOver: se,
866
866
  $error: !!p,
867
- $screenMode: ee,
868
- $focused: T
869
- }, t().createElement(In, {
870
- $screenMode: ee
871
- }), t().createElement(xn, {
867
+ $screenMode: ce,
868
+ $focused: X
869
+ }, t().createElement(I, {
870
+ $screenMode: ce
871
+ }), t().createElement(x, {
872
872
  accept: n,
873
873
  "data-test": "file-input",
874
- disabled: o,
875
- id: $,
876
- key: "file-input-".concat(D),
874
+ disabled: s,
875
+ id: G,
876
+ key: "file-input-".concat(H),
877
877
  multiple: a || undefined,
878
- onBlur: U,
879
- onChange: L,
880
- onFocus: X,
881
- required: w,
878
+ onBlur: Q,
879
+ onChange: Z,
880
+ onFocus: K,
881
+ required: C,
882
882
  type: "file"
883
- }), t().createElement(_n, null, re), t().createElement(Rn, {
883
+ }), t().createElement(_, null, de), t().createElement(R, {
884
884
  "data-test": "file-supports"
885
- }, te), Q && _ && t().createElement(Tn, {
885
+ }, pe), le && M && t().createElement(T, {
886
886
  "data-test": "file-window-drop",
887
- onDragLeave: z
888
- }), Q && t().createElement(t().Fragment, null, t().createElement(f(), {
887
+ onDragLeave: ee
888
+ }), le && t().createElement(t().Fragment, null, t().createElement(f(), {
889
889
  target: Xn,
890
890
  eventType: "dragover",
891
- listener: W
891
+ listener: Y
892
892
  }), t().createElement(f(), {
893
893
  target: Xn,
894
894
  eventType: "drop",
895
- listener: H
896
- })))), !o && g && t().createElement(An, {
895
+ listener: ne
896
+ })))), !s && h && t().createElement(A, {
897
897
  "data-test": "help"
898
- }, g), t().createElement(C.Provider, {
899
- value: ae
900
- }, t().createElement(Pn, null, V)));
898
+ }, h), t().createElement(g.Provider, {
899
+ value: fe
900
+ }, t().createElement(P, null, ae)));
901
901
  }
902
902
  Yn.propTypes = Qn;
903
903
  Yn.componentType = "File";
904
- Yn.Item = Sn;
904
+ Yn.Item = Pn;
905
905
  /* harmony default export */ const er = Yn;
906
906
  // CONCATENATED MODULE: ./src/File/index.ts
907
907
  module.exports = n;