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