@splunk/react-ui 4.32.0 → 4.34.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 (80) hide show
  1. package/Button.js +59 -65
  2. package/ButtonGroup.js +20 -23
  3. package/ButtonSimple.js +374 -339
  4. package/CHANGELOG.md +54 -0
  5. package/Card.js +56 -44
  6. package/Chip.js +2 -6
  7. package/Clickable.js +21 -19
  8. package/CollapsiblePanel.js +281 -264
  9. package/Color.js +88 -86
  10. package/Concertina.js +7 -7
  11. package/ControlGroup.js +18 -18
  12. package/DualListbox.js +8 -11
  13. package/File.js +25 -30
  14. package/FormRows.js +232 -210
  15. package/Image.js +13 -13
  16. package/JSONTree.js +22 -22
  17. package/MIGRATION.mdx +99 -0
  18. package/Markdown.js +12 -12
  19. package/Menu.js +505 -719
  20. package/Message.js +205 -204
  21. package/MessageBar.js +104 -104
  22. package/Modal.js +158 -133
  23. package/Multiselect.js +81 -70
  24. package/Paginator.js +8 -8
  25. package/Popover.js +53 -54
  26. package/Progress.js +45 -46
  27. package/RadioBar.js +117 -115
  28. package/RadioList.js +8 -5
  29. package/ResultsMenu.js +256 -261
  30. package/Search.js +21 -24
  31. package/Select.js +265 -246
  32. package/Slider.js +9 -9
  33. package/SplitButton.js +1 -4
  34. package/StaticContent.js +1 -1
  35. package/StepBar.js +1 -1
  36. package/Switch.js +169 -171
  37. package/TabBar.js +14 -6
  38. package/Table.js +65 -67
  39. package/Text.js +30 -37
  40. package/TextArea.js +162 -163
  41. package/Tooltip.js +1 -1
  42. package/package.json +9 -9
  43. package/stubs-splunkui.d.ts +11 -0
  44. package/types/src/Button/Button.d.ts +4 -4
  45. package/types/src/ButtonSimple/ButtonSimple.d.ts +8 -6
  46. package/types/src/ButtonSimple/mixin.d.ts +2 -2
  47. package/types/src/Card/Card.d.ts +3 -1
  48. package/types/src/Card/Header.d.ts +22 -3
  49. package/types/src/Clickable/Clickable.d.ts +3 -2
  50. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +5 -0
  51. package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +1 -3
  52. package/types/src/Date/Date.d.ts +2 -2
  53. package/types/src/Menu/Item.d.ts +3 -1
  54. package/types/src/Menu/Menu.d.ts +16 -21
  55. package/types/src/Menu/MenuContext.d.ts +3 -2
  56. package/types/src/Number/Number.d.ts +2 -2
  57. package/types/src/RadioBar/Option.d.ts +4 -1
  58. package/types/src/RadioBar/RadioBar.d.ts +6 -4
  59. package/types/src/RadioBar/docs/examples/MenuBar.d.ts +2 -0
  60. package/types/src/ResultsMenu/ResultsMenu.d.ts +5 -22
  61. package/types/src/Select/Select.d.ts +8 -4
  62. package/types/src/Select/SelectBase.d.ts +8 -4
  63. package/types/src/Slider/Slider.d.ts +2 -2
  64. package/types/src/Table/Body.d.ts +0 -4
  65. package/types/src/Text/docs/examples/Basic.d.ts +1 -9
  66. package/types/src/Text/docs/examples/Error.d.ts +2 -10
  67. package/types/src/Text/docs/examples/Inline.d.ts +1 -9
  68. package/types/src/Text/docs/examples/Multiline.d.ts +1 -9
  69. package/types/src/Text/docs/examples/Password.d.ts +1 -9
  70. package/types/src/Text/docs/examples/Search.d.ts +1 -9
  71. package/useRovingFocus.js +26 -40
  72. package/types/src/Button/docs/examples/prisma/Basic.d.ts +0 -2
  73. package/types/src/Button/docs/examples/prisma/Block.d.ts +0 -2
  74. package/types/src/Button/docs/examples/prisma/Disabled.d.ts +0 -2
  75. package/types/src/Button/docs/examples/prisma/Icons.d.ts +0 -2
  76. package/types/src/Button/docs/examples/prisma/Menus.d.ts +0 -2
  77. package/types/src/Button/docs/examples/prisma/To.d.ts +0 -2
  78. package/types/src/Button/docs/examples/prisma/Truncated.d.ts +0 -2
  79. package/types/src/Select/docs/examples/prisma/Appearance.d.ts +0 -14
  80. /package/types/src/{Button/docs/examples/prisma → Clickable/docs/examples}/Dimmed.d.ts +0 -0
@@ -61,15 +61,15 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- SingleOpenPanelGroup: () => /* reexport */ se,
65
- default: () => /* reexport */ we
64
+ SingleOpenPanelGroup: () => /* reexport */ ce,
65
+ default: () => /* reexport */ je
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
68
  const n = require("react");
69
69
  var r = e.n(n);
70
70
  // CONCATENATED MODULE: external "lodash/has"
71
- const o = require("lodash/has");
72
- var a = e.n(o);
71
+ const a = require("lodash/has");
72
+ var o = e.n(a);
73
73
  // CONCATENATED MODULE: external "lodash/keys"
74
74
  const i = require("lodash/keys");
75
75
  var l = e.n(i);
@@ -80,223 +80,233 @@
80
80
  const p = require("prop-types");
81
81
  var u = e.n(p);
82
82
  // CONCATENATED MODULE: external "@splunk/react-ui/TransitionOpen"
83
- const f = require("@splunk/react-ui/TransitionOpen");
84
- var d = e.n(f);
83
+ const d = require("@splunk/react-ui/TransitionOpen");
84
+ var f = e.n(d);
85
85
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
86
86
  const b = require("@splunk/ui-utils/id");
87
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
88
+ const v = require("@splunk/ui-utils/i18n");
87
89
  // CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
88
- const v = require("@splunk/react-ui/usePrevious");
89
- var m = e.n(v);
90
+ const m = require("@splunk/react-ui/usePrevious");
91
+ var y = e.n(m);
90
92
  // CONCATENATED MODULE: external "styled-components"
91
- const y = require("styled-components");
92
- var h = e.n(y);
93
+ const h = require("styled-components");
94
+ var g = e.n(h);
93
95
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
94
- const g = require("@splunk/react-ui/Box");
95
- var k = e.n(g);
96
+ const k = require("@splunk/react-ui/Box");
97
+ var C = e.n(k);
96
98
  // CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
97
- const C = require("@splunk/react-ui/ButtonSimple");
98
- var x = e.n(C);
99
+ const x = require("@splunk/react-ui/ButtonSimple");
100
+ var O = e.n(x);
99
101
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
100
- const O = require("@splunk/react-ui/Clickable");
101
- var S = e.n(O);
102
+ const S = require("@splunk/react-ui/Clickable");
103
+ var I = e.n(S);
102
104
  // CONCATENATED MODULE: external "@splunk/themes"
103
- const I = require("@splunk/themes");
105
+ const P = require("@splunk/themes");
104
106
  // CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
105
- const P = require("@splunk/react-icons/ChevronRight");
106
- var w = e.n(P);
107
+ const w = require("@splunk/react-icons/ChevronRight");
108
+ var j = e.n(w);
107
109
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
108
- const j = require("@splunk/react-icons/enterprise/ChevronRight");
109
- var E = e.n(j);
110
- // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
111
- const _ = require("@splunk/ui-utils/i18n");
110
+ const E = require("@splunk/react-icons/enterprise/ChevronRight");
111
+ var _ = e.n(E);
112
112
  // CONCATENATED MODULE: ./src/CollapsiblePanel/icons/ExpandPanel.tsx
113
113
  var q = {
114
- className: u().string,
115
- open: u().bool
114
+ className: u().string
116
115
  };
117
116
  var R = function e(t) {
118
- var n = t.className, o = t.open;
119
- var a = (0, I.useSplunkTheme)(), i = a.isEnterprise;
120
- var l = o ? (0, _._)("Panel is open") : (0, _._)("Panel is closed");
121
- return i ? r().createElement(E(), {
117
+ var n = t.className;
118
+ var a = (0, P.useSplunkTheme)(), o = a.isEnterprise;
119
+ return o ? r().createElement(_(), {
122
120
  className: n,
123
121
  hideDefaultTooltip: true,
124
- screenReaderText: l
125
- }) : r().createElement(w(), {
126
- "aria-label": l,
122
+ screenReaderText: null
123
+ }) : r().createElement(j(), {
127
124
  className: n
128
125
  });
129
126
  };
130
127
  R.propTypes = q;
131
128
  /* harmony default export */ const A = R;
132
129
  // CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanelStyles.ts
133
- var T = h()(k()).withConfig({
130
+ var D = g()(C()).withConfig({
134
131
  displayName: "CollapsiblePanelStyles__StyledBox",
135
132
  componentId: "sc-1phikbp-0"
136
- })([ "display:flex;flex-direction:column;flex-shrink:1;min-height:", ";", ";& + &{margin-top:", ";}" ], (0,
137
- I.pick)({
138
- enterprise: (0, y.css)([ "calc(", " + 12px)" ], I.variables.lineHeight),
133
+ })([ "display:flex;flex-direction:column;flex-shrink:1;", ";", ";& + &{margin-top:", ";}" ], (0,
134
+ P.pick)({
135
+ enterprise: (0, h.css)([ "min-height:calc(", " + 12px);" ], P.variables.lineHeight),
139
136
  prisma: {
140
- comfortable: "56px",
141
- compact: "48px"
137
+ comfortable: (0, h.css)([ "min-height:56px;" ]),
138
+ compact: (0, h.css)([ "min-height:48px;" ])
142
139
  }
143
- }), (0, I.pick)({
144
- prisma: (0, y.css)([ "background-color:", ";" ], I.variables.backgroundColorSection)
145
- }), (0, I.pick)({
140
+ }), (0, P.pick)({
141
+ prisma: (0, h.css)([ "background-color:", ";" ], P.variables.backgroundColorSection)
142
+ }), (0, P.pick)({
146
143
  enterprise: "2px",
147
144
  prisma: "1px"
148
145
  }));
149
- var D = h()(k()).withConfig({
146
+ var T = g()(C()).withConfig({
150
147
  displayName: "CollapsiblePanelStyles__StyledSingleOpenPanelGroupBox",
151
148
  componentId: "sc-1phikbp-1"
152
- })([ "", ";flex-direction:column;margin-bottom:0;", "" ], I.mixins.reset("flex"), (0,
153
- I.pick)({
154
- enterprise: (0, y.css)([ "background:", ";" ], I.variables.backgroundColor)
149
+ })([ "", ";flex-direction:column;margin-bottom:0;", "" ], P.mixins.reset("flex"), (0,
150
+ P.pick)({
151
+ enterprise: (0, h.css)([ "background:", ";" ], P.variables.backgroundColor)
155
152
  }));
156
153
  /*
157
154
  these styles are consistent for both regular and titleWithActions, but applied to different elements
158
155
  * in regular mode, they're on the SVG's span wrapper
159
156
  * in titleWithActionsMode, they're on the button
160
157
  applying them directly to the icon wrapper doesn't work because Enterprise has 1px border around the button
161
- */ var N = (0, y.css)([ "min-width:", ";" ], (0, I.pick)({
158
+ */ var N = (0, h.css)([ "min-width:", ";" ], (0, P.pick)({
162
159
  enterprise: "20px",
163
160
  prisma: "35px"
164
161
  }));
165
- var W = h().span.withConfig({
162
+ var X = g().span.withConfig({
166
163
  displayName: "CollapsiblePanelStyles__StyledIconWrapper",
167
164
  componentId: "sc-1phikbp-2"
168
165
  })([ "display:inline-block;flex:0 auto;", "" ], N);
169
- var B = h().div.withConfig({
166
+ var W = g().div.withConfig({
170
167
  displayName: "CollapsiblePanelStyles__StyledTitleWithActions",
171
168
  componentId: "sc-1phikbp-3"
172
169
  })([ "display:flex;flex-shrink:0;border-bottom:0;position:relative;padding:", ";transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;color:", ";", " ", "" ], (0,
173
- I.pick)({
174
- enterprise: (0, y.css)([ "", " ", " ", " ", "" ], I.variables.spacingXSmall, I.variables.spacingSmall, I.variables.spacingXSmall, I.variables.spacingXSmall),
170
+ P.pick)({
171
+ enterprise: (0, h.css)([ "", " ", " ", " ", "" ], P.variables.spacingXSmall, P.variables.spacingSmall, P.variables.spacingXSmall, P.variables.spacingXSmall),
175
172
  prisma: {
176
173
  comfortable: "8px 10px 8px 11px",
177
174
  compact: "8px 10px 8px 11px"
178
175
  }
179
- }), (0, I.pick)({
180
- enterprise: I.variables.textColor,
181
- prisma: I.variables.contentColorActive
182
- }), (0, I.pick)({
183
- prisma: (0, y.css)([ "background-color:", ";" ], I.variables.interactiveColorBackground),
176
+ }), (0, P.pick)({
177
+ enterprise: P.variables.textColor,
178
+ prisma: P.variables.contentColorActive
179
+ }), (0, P.pick)({
180
+ prisma: (0, h.css)([ "background-color:", ";" ], P.variables.interactiveColorBackground),
184
181
  enterprise: {
185
- dark: (0, y.css)([ "background-color:", ";" ], I.variables.gray45),
186
- light: (0, y.css)([ "background-color:", ";" ], I.variables.gray96)
182
+ dark: (0, h.css)([ "background-color:", ";" ], P.variables.gray45),
183
+ light: (0, h.css)([ "background-color:", ";" ], P.variables.gray96)
187
184
  }
188
185
  }), (function(e) {
189
186
  var t = e.$disabled;
190
- return t && (0, y.css)([ "cursor:default;color:", ";" ], (0, I.pick)({
191
- enterprise: I.variables.contentColorDefault,
192
- prisma: I.variables.contentColorDisabled
187
+ return t && (0, h.css)([ "cursor:default;color:", ";" ], (0, P.pick)({
188
+ enterprise: P.variables.contentColorDefault,
189
+ prisma: P.variables.contentColorDisabled
193
190
  }));
194
191
  }));
195
- var $ = h()(x()).withConfig({
192
+ var B = g()(O()).withConfig({
196
193
  displayName: "CollapsiblePanelStyles__StyledToggleButton",
197
194
  componentId: "sc-1phikbp-4"
198
195
  })([ "flex:0 auto;padding:0;", "" ], N);
199
- var M = h()(S()).withConfig({
196
+ var L = g()(I()).withConfig({
200
197
  displayName: "CollapsiblePanelStyles__StyledTitleClickable",
201
198
  componentId: "sc-1phikbp-5"
202
- })([ "width:100%;flex-shrink:0;border-bottom:0;cursor:pointer;position:relative;display:flex;transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;padding:", ";color:", ";", " ", " &[disabled]{cursor:default;color:", ";}&:focus:not([disabled]),&:active:not([disabled]){color:", ";box-shadow:", ";}&:hover:not([disabled]){color:", ";background-color:", ";}" ], (0,
203
- I.pick)({
199
+ })([ "width:100%;flex-shrink:0;border-bottom:0;cursor:pointer;position:relative;display:flex;transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;padding:", ";color:", ";", " ", " &[disabled]{cursor:default;color:", ";}&:focus:not([disabled]),&:active:not([disabled]){color:", ";box-shadow:", ";z-index:1;}&:hover:not([disabled]){color:", ";background-color:", ";}" ], (0,
200
+ P.pick)({
204
201
  enterprise: "6px 30px 6px 5px",
205
202
  prisma: {
206
203
  comfortable: "18px 20px 18px 11px",
207
204
  compact: "14px 20px 14px 11px"
208
205
  }
209
- }), (0, I.pick)({
210
- enterprise: I.variables.textColor,
211
- prisma: I.variables.contentColorActive
212
- }), (0, I.pick)({
213
- prisma: (0, y.css)([ "background-color:", ";" ], I.variables.interactiveColorBackground)
214
- }), (0, I.pickVariant)("$open", {
206
+ }), (0, P.pick)({
207
+ enterprise: P.variables.textColor,
208
+ prisma: P.variables.contentColorActive
209
+ }), (0, P.pick)({
210
+ prisma: (0, h.css)([ "background-color:", ";" ], P.variables.interactiveColorBackground)
211
+ }), (0, P.pickVariant)("$open", {
215
212
  false: {
216
213
  enterprise: {
217
- dark: (0, y.css)([ "background-color:", ";" ], I.variables.gray45),
218
- light: (0, y.css)([ "background-color:", ";" ], I.variables.gray96)
214
+ dark: (0, h.css)([ "background-color:", ";" ], P.variables.gray45),
215
+ light: (0, h.css)([ "background-color:", ";" ], P.variables.gray96)
219
216
  }
220
217
  }
221
- }), (0, I.pick)({
222
- enterprise: I.variables.contentColorDefault,
223
- prisma: I.variables.contentColorDisabled
224
- }), (0, I.pick)({
225
- enterprise: I.variables.textColor,
226
- prisma: I.variables.contentColorActive
227
- }), I.variables.focusShadowInset, (0, I.pick)({
228
- enterprise: I.variables.textColor,
229
- prisma: I.variables.contentColorActive
230
- }), (0, I.pick)({
218
+ }), (0, P.pick)({
219
+ enterprise: P.variables.contentColorDefault,
220
+ prisma: P.variables.contentColorDisabled
221
+ }), (0, P.pick)({
222
+ enterprise: P.variables.textColor,
223
+ prisma: P.variables.contentColorActive
224
+ }), P.variables.focusShadow, (0, P.pick)({
225
+ enterprise: P.variables.textColor,
226
+ prisma: P.variables.contentColorActive
227
+ }), (0, P.pick)({
231
228
  enterprise: {
232
- light: I.variables.gray92,
233
- dark: I.variables.gray30
229
+ light: P.variables.gray92,
230
+ dark: P.variables.gray30
234
231
  },
235
- prisma: I.mixins.overlayColors(I.variables.interactiveColorBackground, I.variables.interactiveColorOverlayHover)
232
+ prisma: P.mixins.overlayColors(P.variables.interactiveColorBackground, P.variables.interactiveColorOverlayHover)
236
233
  }));
237
- var H = h().span.withConfig({
234
+ var $ = g().span.withConfig({
238
235
  displayName: "CollapsiblePanelStyles__StyledHeadingContent",
239
236
  componentId: "sc-1phikbp-6"
240
237
  })([ "display:flex;justify-content:space-between;margin-left:", ";flex:1 1 auto;", " ", "" ], (0,
241
- I.pick)({
238
+ P.pick)({
242
239
  enterprise: "5px",
243
240
  prisma: "6px"
244
- }), (0, I.pick)({
245
- prisma: (0, y.css)([ "font-weight:", ";" ], I.variables.fontWeightSemiBold)
241
+ }), (0, P.pick)({
242
+ prisma: (0, h.css)([ "font-weight:", ";" ], P.variables.fontWeightSemiBold)
246
243
  }), (function(e) {
247
244
  var t = e.$titleWithActions;
248
- return t && (0, y.css)([ "min-height:", ";" ], (0, I.pick)({
245
+ return t && (0, h.css)([ "min-height:", ";" ], (0, P.pick)({
249
246
  prisma: {
250
- comfortable: "40px",
251
- compact: "32px"
247
+ comfortable: P.variables.spacingXXXLarge,
248
+ compact: P.variables.spacingXXLarge
252
249
  }
253
250
  }));
254
251
  }));
255
- var L = h().span.withConfig({
256
- displayName: "CollapsiblePanelStyles__StyledDescription",
252
+ var M = g().span.withConfig({
253
+ displayName: "CollapsiblePanelStyles__StyledHeadingActions",
257
254
  componentId: "sc-1phikbp-7"
258
- })([ "font-size:", ";margin-left:", ";" ], I.variables.fontSizeSmall, (0, I.pick)({
259
- enterprise: I.variables.spacingHalf,
260
- prisma: I.variables.spacingLarge
255
+ })([ "min-height:", ";flex:1 0 auto;" ], (0, P.pick)({
256
+ prisma: {
257
+ comfortable: P.variables.spacingXXXLarge,
258
+ compact: P.variables.spacingXXLarge
259
+ }
261
260
  }));
262
- var G = h().div.withConfig({
263
- displayName: "CollapsiblePanelStyles__StyledInsetWrapper",
261
+ var G = g().span.withConfig({
262
+ displayName: "CollapsiblePanelStyles__StyledDescription",
264
263
  componentId: "sc-1phikbp-8"
265
- })([ "", ";padding:", ";" ], I.mixins.reset("block"), (0, I.pickVariant)("$inset", {
266
- true: (0, I.pick)({
264
+ })([ "font-size:", ";margin-left:", ";" ], P.variables.fontSizeSmall, (0, P.pick)({
265
+ enterprise: P.variables.spacingSmall,
266
+ prisma: P.variables.spacingLarge
267
+ }));
268
+ var H = g().div.withConfig({
269
+ displayName: "CollapsiblePanelStyles__StyledInsetWrapper",
270
+ componentId: "sc-1phikbp-9"
271
+ })([ "", ";padding:", ";" ], P.mixins.reset("block"), (0, P.pickVariant)("$inset", {
272
+ true: (0, P.pick)({
267
273
  enterprise: {
268
- compact: I.variables.spacingQuarter,
269
- comfortable: I.variables.spacingHalf
274
+ compact: P.variables.spacingXSmall,
275
+ comfortable: P.variables.spacingSmall
270
276
  },
271
277
  prisma: {
272
- compact: I.variables.spacingMedium,
273
- comfortable: I.variables.spacingXLarge
278
+ compact: P.variables.spacingMedium,
279
+ comfortable: P.variables.spacingXLarge
274
280
  }
275
281
  }),
276
282
  false: 0
277
283
  }));
278
- var U = h()(A).withConfig({
284
+ var U = g()(A).withConfig({
279
285
  displayName: "CollapsiblePanelStyles__StyledExpandPanelIcon",
280
- componentId: "sc-1phikbp-9"
286
+ componentId: "sc-1phikbp-10"
281
287
  })([ "transition:transform ", ";", ";", " width:100%;vertical-align:", ";" ], (0,
282
- I.pick)({
288
+ P.pick)({
283
289
  enterprise: "300ms",
284
290
  prisma: "200ms"
285
- }), (0, I.pick)({
286
- prisma: (0, y.css)([ "color:", ";[disabled] &{color:inherit;}" ], I.variables.contentColorDefault)
291
+ }), (0, P.pick)({
292
+ enterprise: (0, h.css)([ "[disabled] &{color:", ";}" ], (0, P.pick)({
293
+ dark: P.variables.contentColorDefault,
294
+ light: P.variables.contentColorDisabled
295
+ })),
296
+ prisma: (0, h.css)([ "color:", ";[disabled] &{color:inherit;}" ], P.variables.contentColorDefault)
287
297
  }), (function(e) {
288
298
  var t = e.open;
289
- return t && (0, y.css)([ "transform:rotate(90deg);" ]);
290
- }), (0, I.pick)({
299
+ return t && (0, h.css)([ "transform:rotate(90deg);" ]);
300
+ }), (0, P.pick)({
291
301
  enterprise: "baseline",
292
302
  prisma: "text-bottom"
293
303
  }));
294
304
  // CONCATENATED MODULE: ./src/CollapsiblePanel/SingleOpenPanelGroupContext.tsx
295
- var X = (0, n.createContext)({});
296
- /* harmony default export */ const V = X;
305
+ var z = (0, n.createContext)({});
306
+ /* harmony default export */ const V = z;
297
307
  // CONCATENATED MODULE: ./src/CollapsiblePanel/SingleOpenPanelGroup.tsx
298
- function z() {
299
- z = Object.assign || function(e) {
308
+ function F() {
309
+ F = Object.assign || function(e) {
300
310
  for (var t = 1; t < arguments.length; t++) {
301
311
  var n = arguments[t];
302
312
  for (var r in n) {
@@ -307,75 +317,75 @@
307
317
  }
308
318
  return e;
309
319
  };
310
- return z.apply(this, arguments);
320
+ return F.apply(this, arguments);
311
321
  }
312
- function Q(e) {
313
- return K(e) || J(e) || ee(e) || F();
322
+ function J(e) {
323
+ return Y(e) || Q(e) || te(e) || K();
314
324
  }
315
- function F() {
325
+ function K() {
316
326
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
317
327
  }
318
- function J(e) {
328
+ function Q(e) {
319
329
  if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
320
330
  }
321
- function K(e) {
322
- if (Array.isArray(e)) return te(e);
331
+ function Y(e) {
332
+ if (Array.isArray(e)) return ne(e);
323
333
  }
324
- function Y(e, t) {
325
- return re(e) || ne(e, t) || ee(e, t) || Z();
334
+ function Z(e, t) {
335
+ return ae(e) || re(e, t) || te(e, t) || ee();
326
336
  }
327
- function Z() {
337
+ function ee() {
328
338
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
329
339
  }
330
- function ee(e, t) {
340
+ function te(e, t) {
331
341
  if (!e) return;
332
- if (typeof e === "string") return te(e, t);
342
+ if (typeof e === "string") return ne(e, t);
333
343
  var n = Object.prototype.toString.call(e).slice(8, -1);
334
344
  if (n === "Object" && e.constructor) n = e.constructor.name;
335
345
  if (n === "Map" || n === "Set") return Array.from(e);
336
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return te(e, t);
346
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ne(e, t);
337
347
  }
338
- function te(e, t) {
348
+ function ne(e, t) {
339
349
  if (t == null || t > e.length) t = e.length;
340
350
  for (var n = 0, r = new Array(t); n < t; n++) {
341
351
  r[n] = e[n];
342
352
  }
343
353
  return r;
344
354
  }
345
- function ne(e, t) {
355
+ function re(e, t) {
346
356
  if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
347
357
  var n = [];
348
358
  var r = true;
349
- var o = false;
350
- var a = undefined;
359
+ var a = false;
360
+ var o = undefined;
351
361
  try {
352
362
  for (var i = e[Symbol.iterator](), l; !(r = (l = i.next()).done); r = true) {
353
363
  n.push(l.value);
354
364
  if (t && n.length === t) break;
355
365
  }
356
366
  } catch (e) {
357
- o = true;
358
- a = e;
367
+ a = true;
368
+ o = e;
359
369
  } finally {
360
370
  try {
361
371
  if (!r && i["return"] != null) i["return"]();
362
372
  } finally {
363
- if (o) throw a;
373
+ if (a) throw o;
364
374
  }
365
375
  }
366
376
  return n;
367
377
  }
368
- function re(e) {
378
+ function ae(e) {
369
379
  if (Array.isArray(e)) return e;
370
380
  }
371
381
  function oe(e, t) {
372
382
  if (e == null) return {};
373
- var n = ae(e, t);
374
- var r, o;
383
+ var n = ie(e, t);
384
+ var r, a;
375
385
  if (Object.getOwnPropertySymbols) {
376
- var a = Object.getOwnPropertySymbols(e);
377
- for (o = 0; o < a.length; o++) {
378
- r = a[o];
386
+ var o = Object.getOwnPropertySymbols(e);
387
+ for (a = 0; a < o.length; a++) {
388
+ r = o[a];
379
389
  if (t.indexOf(r) >= 0) continue;
380
390
  if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
381
391
  n[r] = e[r];
@@ -383,19 +393,19 @@
383
393
  }
384
394
  return n;
385
395
  }
386
- function ae(e, t) {
396
+ function ie(e, t) {
387
397
  if (e == null) return {};
388
398
  var n = {};
389
399
  var r = Object.keys(e);
390
- var o, a;
391
- for (a = 0; a < r.length; a++) {
392
- o = r[a];
393
- if (t.indexOf(o) >= 0) continue;
394
- n[o] = e[o];
400
+ var a, o;
401
+ for (o = 0; o < r.length; o++) {
402
+ a = r[o];
403
+ if (t.indexOf(a) >= 0) continue;
404
+ n[a] = e[a];
395
405
  }
396
406
  return n;
397
407
  }
398
- /** @public */ var ie = {
408
+ /** @public */ var le = {
399
409
  children: u().node,
400
410
  defaultOpenPanelId: u().any,
401
411
  elementRef: u().oneOfType([ u().func, u().object ]),
@@ -403,26 +413,26 @@
403
413
  onChange: u().func,
404
414
  openPanelId: u().any
405
415
  };
406
- function le(e) {
416
+ function se(e) {
407
417
  // @docs-props-type SingleOpenPanelGroupPropsBase
408
- var t = e.children, o = e.defaultOpenPanelId, i = e.elementRef, l = e.inset, s = l === void 0 ? false : l, p = e.onChange, u = e.openPanelId, f = oe(e, [ "children", "defaultOpenPanelId", "elementRef", "inset", "onChange", "openPanelId" ]);
409
- var d = a()(e, "openPanelId");
410
- var b = m()(o);
411
- var v = !d ? o : undefined;
412
- var y = (0, n.useState)(v), h = Y(y, 2), g = h[0], k = h[1];
418
+ var t = e.children, a = e.defaultOpenPanelId, i = e.elementRef, l = e.inset, s = l === void 0 ? false : l, p = e.onChange, u = e.openPanelId, d = oe(e, [ "children", "defaultOpenPanelId", "elementRef", "inset", "onChange", "openPanelId" ]);
419
+ var f = o()(e, "openPanelId");
420
+ var b = y()(a);
421
+ var v = !f ? a : undefined;
422
+ var m = (0, n.useState)(v), h = Z(m, 2), g = h[0], k = h[1];
413
423
  var C = function e() {
414
- var t = d ? u : g;
424
+ var t = f ? u : g;
415
425
  return t;
416
426
  };
417
427
  var x = (0, n.useCallback)((function(e, t) {
418
428
  var n = t.panelId;
419
429
  var r = C();
420
- var o = r === n ? null : n;
421
- if (!d) {
422
- k(o);
430
+ var a = r === n ? null : n;
431
+ if (!f) {
432
+ k(a);
423
433
  }
424
434
  p === null || p === void 0 ? void 0 : p(e, t);
425
- }), [ u, d, g, C, p ]);
435
+ }), [ u, f, g, C, p ]);
426
436
  (0, n.useEffect)((function() {
427
437
  if (false) {}
428
438
  // In this functional component, we want the dependencies to be [], but when we do that
@@ -431,46 +441,46 @@
431
441
  }), []);
432
442
  (0, n.useEffect)((function() {
433
443
  if (false) {}
434
- }), [ b, d ]);
444
+ }), [ b, f ]);
435
445
  (0, n.useEffect)((function() {
436
446
  if (false) {}
437
- }), [ b, o ]);
447
+ }), [ b, a ]);
438
448
  var O = n.Children.toArray(t).filter(n.isValidElement);
439
449
  // remove false, null, 0, etc
440
450
  var S = (0, n.useMemo)((function() {
441
451
  return {
442
452
  onChange: x,
443
- openPanelId: d ? u : g,
453
+ openPanelId: f ? u : g,
444
454
  inset: s
445
455
  };
446
- }), [ x, d, s, u, g ]);
456
+ }), [ x, f, s, u, g ]);
447
457
 
448
- return r().createElement(D, z({
458
+ return r().createElement(T, F({
449
459
  "data-test": "single-open-panel-group",
450
460
  "data-test-open-panel-id": u,
451
461
  elementRef: i
452
- }, c().apply(void 0, [ f ].concat(Q(Object.keys(ie))))), r().createElement(V.Provider, {
462
+ }, c().apply(void 0, [ d ].concat(J(Object.keys(le))))), r().createElement(V.Provider, {
453
463
  value: S
454
464
  }, O));
455
465
  }
456
- le.propTypes = ie;
457
- /* harmony default export */ const se = le;
466
+ se.propTypes = le;
467
+ /* harmony default export */ const ce = se;
458
468
  // CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanel.tsx
459
- function ce(e) {
469
+ function pe(e) {
460
470
  "@babel/helpers - typeof";
461
471
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
462
- ce = function e(t) {
472
+ pe = function e(t) {
463
473
  return typeof t;
464
474
  };
465
475
  } else {
466
- ce = function e(t) {
476
+ pe = function e(t) {
467
477
  return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
468
478
  };
469
479
  }
470
- return ce(e);
480
+ return pe(e);
471
481
  }
472
- function pe() {
473
- pe = Object.assign || function(e) {
482
+ function ue() {
483
+ ue = Object.assign || function(e) {
474
484
  for (var t = 1; t < arguments.length; t++) {
475
485
  var n = arguments[t];
476
486
  for (var r in n) {
@@ -481,9 +491,9 @@
481
491
  }
482
492
  return e;
483
493
  };
484
- return pe.apply(this, arguments);
494
+ return ue.apply(this, arguments);
485
495
  }
486
- function ue(e, t) {
496
+ function de(e, t) {
487
497
  var n = Object.keys(e);
488
498
  if (Object.getOwnPropertySymbols) {
489
499
  var r = Object.getOwnPropertySymbols(e);
@@ -498,25 +508,25 @@
498
508
  for (var t = 1; t < arguments.length; t++) {
499
509
  var n = arguments[t] != null ? arguments[t] : {};
500
510
  if (t % 2) {
501
- ue(Object(n), true).forEach((function(t) {
502
- Oe(e, t, n[t]);
511
+ de(Object(n), true).forEach((function(t) {
512
+ Se(e, t, n[t]);
503
513
  }));
504
514
  } else if (Object.getOwnPropertyDescriptors) {
505
515
  Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
506
516
  } else {
507
- ue(Object(n)).forEach((function(t) {
517
+ de(Object(n)).forEach((function(t) {
508
518
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
509
519
  }));
510
520
  }
511
521
  }
512
522
  return e;
513
523
  }
514
- function de(e, t) {
524
+ function be(e, t) {
515
525
  if (!(e instanceof t)) {
516
526
  throw new TypeError("Cannot call a class as a function");
517
527
  }
518
528
  }
519
- function be(e, t) {
529
+ function ve(e, t) {
520
530
  for (var n = 0; n < t.length; n++) {
521
531
  var r = t[n];
522
532
  r.enumerable = r.enumerable || false;
@@ -525,12 +535,12 @@
525
535
  Object.defineProperty(e, r.key, r);
526
536
  }
527
537
  }
528
- function ve(e, t, n) {
529
- if (t) be(e.prototype, t);
530
- if (n) be(e, n);
538
+ function me(e, t, n) {
539
+ if (t) ve(e.prototype, t);
540
+ if (n) ve(e, n);
531
541
  return e;
532
542
  }
533
- function me(e, t) {
543
+ function ye(e, t) {
534
544
  if (typeof t !== "function" && t !== null) {
535
545
  throw new TypeError("Super expression must either be null or a function");
536
546
  }
@@ -541,41 +551,41 @@
541
551
  configurable: true
542
552
  }
543
553
  });
544
- if (t) ye(e, t);
554
+ if (t) he(e, t);
545
555
  }
546
- function ye(e, t) {
547
- ye = Object.setPrototypeOf || function e(t, n) {
556
+ function he(e, t) {
557
+ he = Object.setPrototypeOf || function e(t, n) {
548
558
  t.__proto__ = n;
549
559
  return t;
550
560
  };
551
- return ye(e, t);
561
+ return he(e, t);
552
562
  }
553
- function he(e) {
554
- var t = Ce();
563
+ function ge(e) {
564
+ var t = xe();
555
565
  return function n() {
556
- var r = xe(e), o;
566
+ var r = Oe(e), a;
557
567
  if (t) {
558
- var a = xe(this).constructor;
559
- o = Reflect.construct(r, arguments, a);
568
+ var o = Oe(this).constructor;
569
+ a = Reflect.construct(r, arguments, o);
560
570
  } else {
561
- o = r.apply(this, arguments);
571
+ a = r.apply(this, arguments);
562
572
  }
563
- return ge(this, o);
573
+ return ke(this, a);
564
574
  };
565
575
  }
566
- function ge(e, t) {
567
- if (t && (ce(t) === "object" || typeof t === "function")) {
576
+ function ke(e, t) {
577
+ if (t && (pe(t) === "object" || typeof t === "function")) {
568
578
  return t;
569
579
  }
570
- return ke(e);
580
+ return Ce(e);
571
581
  }
572
- function ke(e) {
582
+ function Ce(e) {
573
583
  if (e === void 0) {
574
584
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
575
585
  }
576
586
  return e;
577
587
  }
578
- function Ce() {
588
+ function xe() {
579
589
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
580
590
  if (Reflect.construct.sham) return false;
581
591
  if (typeof Proxy === "function") return true;
@@ -586,13 +596,13 @@
586
596
  return false;
587
597
  }
588
598
  }
589
- function xe(e) {
590
- xe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
599
+ function Oe(e) {
600
+ Oe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
591
601
  return t.__proto__ || Object.getPrototypeOf(t);
592
602
  };
593
- return xe(e);
603
+ return Oe(e);
594
604
  }
595
- function Oe(e, t, n) {
605
+ function Se(e, t, n) {
596
606
  if (t in e) {
597
607
  Object.defineProperty(e, t, {
598
608
  value: n,
@@ -605,8 +615,9 @@
605
615
  }
606
616
  return e;
607
617
  }
608
- var Se = {
618
+ var Ie = {
609
619
  innerBodyStyles: u().object,
620
+ actions: u().node,
610
621
  children: u().node,
611
622
  defaultOpen: u().bool,
612
623
  description: u().string,
@@ -624,43 +635,43 @@
624
635
  title: u().node.isRequired,
625
636
  titleWithActions: u().bool
626
637
  };
627
- var Ie = {
638
+ var Pe = {
628
639
  disabled: false,
629
640
  overflow: "auto",
630
641
  renderChildrenWhenCollapsed: false,
631
642
  titleWithActions: false,
632
643
  inset: false
633
644
  };
634
- var Pe = function(e) {
635
- me(n, e);
636
- var t = he(n);
645
+ var we = function(e) {
646
+ ye(n, e);
647
+ var t = ge(n);
637
648
  // @docs-props-type CollapsiblePanelPropsBase
638
649
  function n(e) {
639
650
  var r;
640
- de(this, n);
651
+ be(this, n);
641
652
  r = t.call(this, e);
642
- Oe(ke(r), "controlledExternally", void 0);
643
- Oe(ke(r), "containerId", void 0);
644
- Oe(ke(r), "toggleId", void 0);
645
- Oe(ke(r), "handleRequestClose", (function(e) {
646
- var t = r.props, n = t.panelId, o = t.onRequestClose;
647
- o === null || o === void 0 ? void 0 : o({
653
+ Se(Ce(r), "controlledExternally", void 0);
654
+ Se(Ce(r), "containerId", void 0);
655
+ Se(Ce(r), "toggleId", void 0);
656
+ Se(Ce(r), "handleRequestClose", (function(e) {
657
+ var t = r.props, n = t.panelId, a = t.onRequestClose;
658
+ a === null || a === void 0 ? void 0 : a({
648
659
  event: e,
649
660
  panelId: n,
650
661
  reason: "toggleClick"
651
662
  });
652
663
  }));
653
- Oe(ke(r), "handleRequestOpen", (function(e) {
654
- var t = r.props, n = t.panelId, o = t.onRequestOpen;
655
- o === null || o === void 0 ? void 0 : o({
664
+ Se(Ce(r), "handleRequestOpen", (function(e) {
665
+ var t = r.props, n = t.panelId, a = t.onRequestOpen;
666
+ a === null || a === void 0 ? void 0 : a({
656
667
  event: e,
657
668
  panelId: n,
658
669
  reason: "toggleClick"
659
670
  });
660
671
  }));
661
- Oe(ke(r), "handleChange", (function(e) {
672
+ Se(Ce(r), "handleChange", (function(e) {
662
673
  var t, n;
663
- var o = r.props, a = o.panelId, i = o.onChange;
674
+ var a = r.props, o = a.panelId, i = a.onChange;
664
675
  var l = r.isOpen();
665
676
  if (!r.isControlled()) {
666
677
  r.setState({
@@ -670,12 +681,12 @@
670
681
  }
671
682
  var s = l ? "close" : "open";
672
683
  i === null || i === void 0 ? void 0 : i(e, {
673
- panelId: a,
684
+ panelId: o,
674
685
  reason: "toggleClick",
675
686
  action: s
676
687
  });
677
688
  (t = (n = r.context).onChange) === null || t === void 0 ? void 0 : t.call(n, e, {
678
- panelId: a,
689
+ panelId: o,
679
690
  reason: "toggleClick",
680
691
  action: s
681
692
  });
@@ -686,12 +697,12 @@
686
697
  r.handleRequestOpen(e);
687
698
  }
688
699
  }));
689
- Oe(ke(r), "handleAnimationEnd", (function() {
700
+ Se(Ce(r), "handleAnimationEnd", (function() {
690
701
  r.setState({
691
702
  animating: false
692
703
  });
693
704
  }));
694
- r.controlledExternally = a()(e, "open");
705
+ r.controlledExternally = o()(e, "open");
695
706
  r.state = fe(fe({}, !r.isControlled() ? {
696
707
  open: e.defaultOpen || false
697
708
  } : undefined), {}, {
@@ -699,12 +710,13 @@
699
710
  });
700
711
  if (false) {}
701
712
  if (false) {}
713
+ if (false) {}
702
714
  r.containerId = "container-".concat((0, b.createGUID)());
703
715
  r.toggleId = "toggle-".concat((0, b.createGUID)());
704
716
  return r;
705
717
  }
706
718
  // Only testing this in the scenario of a SingleOpenPanelGroup.
707
- ve(n, [ {
719
+ me(n, [ {
708
720
  key: "componentDidMount",
709
721
  value: function e() {
710
722
  if (false) {}
@@ -740,68 +752,73 @@
740
752
  }, {
741
753
  key: "render",
742
754
  value: function e() {
743
- var t = this.props, o = t.innerBodyStyles, a = t.children, i = t.description, s = t.disabled, p = t.elementRef, u = t.headingLevel, f = t.overflow, b = t.renderChildrenWhenCollapsed, v = t.title, m = t.titleWithActions, y = t.inset;
744
- var h = this.state.animating;
745
- var g = this.isOpen();
746
- var k = {
747
- disabled: s,
755
+ var t = this.props, a = t.innerBodyStyles, o = t.actions, i = t.children, s = t.description, p = t.disabled, u = t.elementRef, d = t.headingLevel, m = t.overflow, y = t.renderChildrenWhenCollapsed, h = t.title, g = t.titleWithActions, k = t.inset;
756
+ var C = this.state.animating;
757
+ var x = (0, b.createDOMID)("panel-toggle");
758
+ var O = this.isOpen();
759
+ var S = {
760
+ disabled: p,
748
761
  onClick: this.handleChange,
749
762
  id: this.toggleId,
750
763
  "aria-controls": this.containerId,
751
- "aria-expanded": g,
752
- $open: !!g,
764
+ "aria-expanded": O,
765
+ $open: !!O,
753
766
  "data-test": "toggle"
754
767
  };
755
768
 
756
- return r().createElement(T, pe({
769
+ return r().createElement(D, ue({
757
770
  "data-test": "collapsible-panel",
758
- elementRef: p
759
- }, c()(this.props, l()(n.propTypes))), m ? r().createElement(B, {
760
- $disabled: s
761
- }, r().createElement($, pe({}, k, {
762
- appearance: "pill"
763
- }), r().createElement(U, {
764
- open: !!g
765
- })), r().createElement(H, {
766
- $titleWithActions: m,
767
- "data-test": "title"
768
- }, v)) :
771
+ elementRef: u
772
+ }, c()(this.props, l()(n.propTypes))), g || o != null ? r().createElement(W, {
773
+ $disabled: p
774
+ }, r().createElement(B, ue({
775
+ appearance: "pill",
776
+ "aria-label": (0, v._)("Panel"),
777
+ "aria-labelledby": x
778
+ }, S), r().createElement(U, {
779
+ open: !!O
780
+ })), r().createElement($, {
781
+ $titleWithActions: g,
782
+ "data-test": "title",
783
+ id: o != null ? x : undefined
784
+ }, h), o != null && r().createElement(M, null, o)) :
769
785
 
770
786
  /* Clickable component is not allowed to have role="heading" so it is wrapped with a span */
771
787
  r().createElement("span", {
772
788
  "data-test": "heading",
773
- role: u ? "heading" : undefined,
774
- "aria-level": u
775
- }, r().createElement(M, k, r().createElement(W, null, r().createElement(U, {
776
- open: !!g
777
- })), r().createElement(H, null, r().createElement("span", {
789
+ role: d ? "heading" : undefined,
790
+ "aria-level": d
791
+ }, r().createElement(L, S, r().createElement(X, null, r().createElement(U, {
792
+ open: !!O
793
+ })), r().createElement($, null, r().createElement("span", {
778
794
  "data-test": "title"
779
- }, v), i && r().createElement(L, {
795
+ }, h), s && r().createElement(G, {
780
796
  "data-test": "description"
781
- }, i)))), r().createElement(d(), {
797
+ }, s)))), r().createElement(f(), {
782
798
  outerId: this.containerId,
783
799
  "aria-labelledby": this.toggleId,
784
800
  "data-test": "body",
785
801
  outerStyle: {
786
- overflow: h ? "hidden" : f
802
+ overflow: C ? "hidden" : m
787
803
  },
788
804
  innerStyle: fe({
789
805
  tableLayout: "fixed"
790
- }, o),
791
- open: g,
806
+ }, a),
807
+ open: O,
792
808
  onAnimationEnd: this.handleAnimationEnd,
793
- renderChildrenWhenCollapsed: b
794
- }, r().createElement(G, {
795
- $inset: y
796
- }, a)));
809
+ role: o != null ? "region" : undefined,
810
+ renderChildrenWhenCollapsed: y
811
+ }, r().createElement(H, {
812
+ $inset: k
813
+ }, i)));
797
814
  }
798
815
  } ]);
799
816
  return n;
800
817
  }(n.Component);
801
- Oe(Pe, "propTypes", Se);
802
- Oe(Pe, "defaultProps", Ie);
803
- Oe(Pe, "contextType", V);
804
- /* harmony default export */ const we = Pe;
818
+ Se(we, "propTypes", Ie);
819
+ Se(we, "defaultProps", Pe);
820
+ Se(we, "contextType", V);
821
+ /* harmony default export */ const je = we;
805
822
  // CONCATENATED MODULE: ./src/CollapsiblePanel/index.ts
806
823
  module.exports = t;
807
824
  /******/})();