@splunk/react-ui 5.7.0 → 5.8.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 (138) hide show
  1. package/Accordion.js +6 -6
  2. package/Box.js +83 -34
  3. package/CHANGELOG.md +34 -0
  4. package/CollapsiblePanel.js +11 -11
  5. package/ComboBox.js +31 -27
  6. package/ControlGroup.js +92 -91
  7. package/DefinitionList.js +9 -9
  8. package/Drawer.d.ts +2 -0
  9. package/Drawer.js +679 -0
  10. package/DualListbox.js +1 -1
  11. package/JSONTree.js +73 -72
  12. package/Link.js +2 -2
  13. package/MIGRATION.md +10 -0
  14. package/Menu.js +338 -240
  15. package/Modal.js +127 -109
  16. package/Multiselect.js +437 -351
  17. package/Paginator.js +14 -12
  18. package/Popover.js +4 -1
  19. package/README.md +11 -0
  20. package/RadioBar.js +1 -1
  21. package/Search.js +103 -88
  22. package/Select.js +42 -40
  23. package/SelectBase.js +374 -328
  24. package/SidePanel.js +346 -167
  25. package/SlidingPanels.js +11 -11
  26. package/StepBar.js +7 -7
  27. package/Switch.js +5 -5
  28. package/Text.js +24 -24
  29. package/TextArea.js +7 -7
  30. package/TransitionOpen.js +204 -185
  31. package/docs-llm/Accordion.md +267 -0
  32. package/docs-llm/Anchor Menu.md +115 -0
  33. package/docs-llm/Anchor.md +54 -0
  34. package/docs-llm/AnimationToggle.md +254 -0
  35. package/docs-llm/Avatar.md +298 -0
  36. package/docs-llm/Badge.md +212 -0
  37. package/docs-llm/Breadcrumbs.md +306 -0
  38. package/docs-llm/Button Group.md +53 -0
  39. package/docs-llm/Button.md +361 -0
  40. package/docs-llm/Card Layout.md +286 -0
  41. package/docs-llm/Card.md +619 -0
  42. package/docs-llm/Checkbox.md +218 -0
  43. package/docs-llm/Chip.md +291 -0
  44. package/docs-llm/Clickable.md +160 -0
  45. package/docs-llm/Code.md +292 -0
  46. package/docs-llm/Collapsible Panel.md +744 -0
  47. package/docs-llm/Color.md +253 -0
  48. package/docs-llm/Column Layout.md +391 -0
  49. package/docs-llm/Combo Box.md +540 -0
  50. package/docs-llm/Control Group.md +594 -0
  51. package/docs-llm/Date.md +270 -0
  52. package/docs-llm/Definition List.md +278 -0
  53. package/docs-llm/Divider.md +216 -0
  54. package/docs-llm/Drawer.md +414 -0
  55. package/docs-llm/Dropdown.md +472 -0
  56. package/docs-llm/Dual Listbox.md +325 -0
  57. package/docs-llm/File.md +653 -0
  58. package/docs-llm/Form Rows.md +374 -0
  59. package/docs-llm/Heading.md +179 -0
  60. package/docs-llm/Image.md +109 -0
  61. package/docs-llm/JSON Tree.md +260 -0
  62. package/docs-llm/Layer.md +74 -0
  63. package/docs-llm/Layout.md +50 -0
  64. package/docs-llm/Link.md +318 -0
  65. package/docs-llm/List.md +189 -0
  66. package/docs-llm/Markdown.md +179 -0
  67. package/docs-llm/Menu.md +735 -0
  68. package/docs-llm/Message Bar.md +236 -0
  69. package/docs-llm/Message.md +248 -0
  70. package/docs-llm/Modal.md +443 -0
  71. package/docs-llm/Monogram.md +159 -0
  72. package/docs-llm/Multiselect.md +937 -0
  73. package/docs-llm/Number.md +298 -0
  74. package/docs-llm/Paginator.md +395 -0
  75. package/docs-llm/Paragraph.md +148 -0
  76. package/docs-llm/Phone Number.md +254 -0
  77. package/docs-llm/Popover.md +166 -0
  78. package/docs-llm/Progress.md +141 -0
  79. package/docs-llm/Radio Bar.md +303 -0
  80. package/docs-llm/Radio List.md +350 -0
  81. package/docs-llm/Resize.md +362 -0
  82. package/docs-llm/Screen Reader Content.md +73 -0
  83. package/docs-llm/Scroll Container Context.md +155 -0
  84. package/docs-llm/Scroll.md +152 -0
  85. package/docs-llm/Search.md +381 -0
  86. package/docs-llm/Select.md +985 -0
  87. package/docs-llm/Side Panel.md +777 -0
  88. package/docs-llm/Slider.md +339 -0
  89. package/docs-llm/Sliding Panels.md +340 -0
  90. package/docs-llm/Split Button.md +295 -0
  91. package/docs-llm/Static Content.md +90 -0
  92. package/docs-llm/Step Bar.md +292 -0
  93. package/docs-llm/Switch.md +268 -0
  94. package/docs-llm/Tab Bar.md +439 -0
  95. package/docs-llm/Tab Layout.md +398 -0
  96. package/docs-llm/Table.md +2642 -0
  97. package/docs-llm/Text Area.md +253 -0
  98. package/docs-llm/Text.md +339 -0
  99. package/docs-llm/Tooltip.md +325 -0
  100. package/docs-llm/Transition Open.md +406 -0
  101. package/docs-llm/Tree.md +586 -0
  102. package/docs-llm/Typography.md +125 -0
  103. package/docs-llm/Wait Spinner.md +121 -0
  104. package/docs-llm/llms.txt +97 -0
  105. package/package.json +6 -5
  106. package/types/src/Box/Box.d.ts +2 -10
  107. package/types/src/Drawer/Body.d.ts +17 -0
  108. package/types/src/Drawer/Drawer.d.ts +114 -0
  109. package/types/src/Drawer/DrawerContext.d.ts +11 -0
  110. package/types/src/Drawer/Footer.d.ts +25 -0
  111. package/types/src/Drawer/Header.d.ts +41 -0
  112. package/types/src/Drawer/docs/examples/Basic.d.ts +6 -0
  113. package/types/src/Drawer/docs/examples/ContainerPosition.d.ts +7 -0
  114. package/types/src/Drawer/docs/examples/InitialFocus.d.ts +9 -0
  115. package/types/src/Drawer/docs/examples/InlinePosition.d.ts +7 -0
  116. package/types/src/Drawer/docs/examples/PagePosition.d.ts +7 -0
  117. package/types/src/Drawer/index.d.ts +2 -0
  118. package/types/src/JSONTree/JSONTree.d.ts +12 -5
  119. package/types/src/JSONTree/renderTreeItems.d.ts +2 -1
  120. package/types/src/Menu/Item.d.ts +2 -1
  121. package/types/src/Menu/docs/examples/SelectableCheckbox.d.ts +7 -0
  122. package/types/src/Modal/Modal.d.ts +1 -2
  123. package/types/src/Select/Option.d.ts +6 -3
  124. package/types/src/Select/Select.d.ts +8 -5
  125. package/types/src/Select/docs/examples/Dimmed.d.ts +7 -0
  126. package/types/src/SelectBase/OptionBase.d.ts +6 -3
  127. package/types/src/SelectBase/SelectBase.d.ts +8 -3
  128. package/types/src/SidePanel/SidePanel.d.ts +43 -2
  129. package/types/src/SidePanel/docs/examples/DockLayout.d.ts +17 -0
  130. package/types/src/SidePanel/docs/examples/InitialFocus.d.ts +9 -0
  131. package/types/src/TransitionOpen/TransitionOpen.d.ts +29 -4
  132. package/types/src/useKeyPress/index.d.ts +9 -2
  133. package/types/src/useOnClickOutside/index.d.ts +2 -0
  134. package/types/src/useOnClickOutside/useOnClickOutside.d.ts +4 -0
  135. package/useKeyPress.js +23 -18
  136. package/useOnClickOutside.d.ts +2 -0
  137. package/useOnClickOutside.js +79 -0
  138. package/types/src/RadioList/docs/examples/Row.d.ts +0 -6
@@ -0,0 +1,744 @@
1
+ # Collapsible Panel
2
+
3
+ ## Overview
4
+
5
+
6
+ > Image: Illustration of a group of accordion components with the second accordion expanded to show its content.
7
+
8
+
9
+ ## When to use this component
10
+ - When you have a large amount of non-essential content to show, and want to allow people to have control over the content visibility
11
+ - When you want to progressively disclose information or provide step-by-step guidance
12
+ - When you want to group related content and optimize space and information density
13
+ - When you are showing content on a small screen to reduce scrolling
14
+
15
+ ## When to use another component
16
+ - If the content is critical and should always be visible, use a `List` or display the content without requiring user interaction.
17
+ - If there are only one or two sections, it is better to display the content without requiring user interaction.
18
+ - For information that needs to be viewed, grouped, or compared across categories use a `Table`.
19
+
20
+ ```mermaid
21
+ graph TD
22
+ accDescr: Decision tree that guides on when to use the CollapsiblePanel component or something else
23
+ A(Is it critical content that should always be visible?) -- Yes --- B(List)
24
+ A -- No --- C(Is there a lot of content?)
25
+ C -- Yes --- D(Tab)
26
+ C -- No --- E(Collapsible panel)
27
+ ```
28
+
29
+ ### Check out
30
+ - [List][1]
31
+ - [Table][2]
32
+ - [Tab Bar][3]
33
+
34
+ ## Behaviors
35
+ `CollapsiblePanel` supports either having a single or multiple panels expanded at a time.
36
+
37
+ ### Multiple panels
38
+ Expand and collapse multiple panels at a time.
39
+ > Image: Illustration of a `CollapsiblePanel` group with multiple expanded panels
40
+
41
+
42
+ ### Single panel
43
+ Expand and collapse only one panel at a time.
44
+ > Image: Illustration of a `CollapsiblePanel` group with only a single expanded panel
45
+
46
+
47
+ ## Usage
48
+
49
+ ### Limit content
50
+ Avoid filling `Collapsible Panel` with lots of content. Instead, use small, digestible chunks for the user.
51
+
52
+ > Image: Heart eye example with digestible amount of content next to a grimacing face example of an accordion with too much content
53
+
54
+
55
+ ### Order panels logically
56
+ Order panels logically, according to the specific reading order.
57
+
58
+ > Image: Heart eye example with Collapsible panel label in sequential order 1 - 4 next to a grimacing face example where the Collapsible panel are out of order 2, 1, 4, 3
59
+
60
+
61
+ ## Content guidelines
62
+
63
+ ### Panel title:
64
+ - Write a concise title that describes the associated body content so the user can decide whether to read the body content.
65
+ - Use sentence-style capitalization and capitalize the first word and proper nouns only.
66
+ - Don’t use punctuation such as periods, commas, or exclamation marks.
67
+
68
+ ### Panel body:
69
+ - Split body content into small paragraphs to improve readability.
70
+ - Write in complete sentences with end punctuation.
71
+
72
+ [1]: ./List
73
+ [2]: ./Table
74
+ [3]: ./TabBar
75
+
76
+ ## Examples
77
+
78
+
79
+ ### Uncontrolled
80
+
81
+ ```typescript
82
+ import React from 'react';
83
+
84
+ import CollapsiblePanel from '@splunk/react-ui/CollapsiblePanel';
85
+ import P from '@splunk/react-ui/Paragraph';
86
+
87
+
88
+ function BasicUncontrolled() {
89
+ return (
90
+ <CollapsiblePanel title="Introduction to Splunk Enterprise">
91
+ <P>
92
+ Splunk Enterprise makes it simple to collect, analyze and act upon the untapped
93
+ value of the big data generated by your technology infrastructure, security systems
94
+ and business applications—giving you the insights to drive operational performance
95
+ and business results. Splunk Enterprise monitors and analyzes machine data from any
96
+ source to deliver Operational Intelligence to optimize your IT, security and
97
+ business performance. With intuitive analysis features, machine learning, packaged
98
+ applications and open APIs, Splunk Enterprise is a flexible platform that scales
99
+ from focused use cases to an enterprise-wide analytics backbone.
100
+ </P>
101
+ </CollapsiblePanel>
102
+ );
103
+ }
104
+
105
+ export default BasicUncontrolled;
106
+ ```
107
+
108
+
109
+
110
+ ### Controlled
111
+
112
+ ```typescript
113
+ import React, { useState } from 'react';
114
+
115
+ import CollapsiblePanel from '@splunk/react-ui/CollapsiblePanel';
116
+ import P from '@splunk/react-ui/Paragraph';
117
+
118
+
119
+ function BasicControlled() {
120
+ const [open, setOpen] = useState(false);
121
+
122
+ const handleChange = () => {
123
+ setOpen(!open);
124
+ };
125
+
126
+ return (
127
+ <CollapsiblePanel
128
+ title="Introduction to Splunk Enterprise"
129
+ onChange={handleChange}
130
+ open={open}
131
+ description="Splunk products"
132
+ >
133
+ <P>
134
+ Splunk Enterprise makes it simple to collect, analyze and act upon the untapped
135
+ value of the big data generated by your technology infrastructure, security systems
136
+ and business applications—giving you the insights to drive operational performance
137
+ and business results. Splunk Enterprise monitors and analyzes machine data from any
138
+ source to deliver Operational Intelligence to optimize your IT, security and
139
+ business performance. With intuitive analysis features, machine learning, packaged
140
+ applications and open APIs, Splunk Enterprise is a flexible platform that scales
141
+ from focused use cases to an enterprise-wide analytics backbone.
142
+ </P>
143
+ </CollapsiblePanel>
144
+ );
145
+ }
146
+
147
+ export default BasicControlled;
148
+ ```
149
+
150
+
151
+
152
+ ### Disabled
153
+
154
+ If a CollapsiblePanel is passed disabled the default behavior is to render as "dimmed". This ensures the panel is still discoverable and can receive focus, but cannot be activated by the user. Actions that are passed are not disabled within a dimmed panel. If necessary, a CollapsiblePanel can be completely disabled by setting disabled="disabled".
155
+
156
+ ```typescript
157
+ import React from 'react';
158
+
159
+ import Clone from '@splunk/react-icons/enterprise/Clone';
160
+ import MoreVertical from '@splunk/react-icons/enterprise/MoreVertical';
161
+ import Refresh from '@splunk/react-icons/enterprise/Refresh';
162
+ import Remove from '@splunk/react-icons/enterprise/Remove';
163
+ import Button from '@splunk/react-ui/Button';
164
+ import CollapsiblePanel from '@splunk/react-ui/CollapsiblePanel';
165
+ import Dropdown from '@splunk/react-ui/Dropdown';
166
+ import Menu from '@splunk/react-ui/Menu';
167
+ import P from '@splunk/react-ui/Paragraph';
168
+ import { _ } from '@splunk/ui-utils/i18n';
169
+
170
+
171
+ function Dimmed() {
172
+ const title = (
173
+ <div style={{ display: 'flex', width: 140, alignItems: 'center' }}>Splunk products</div>
174
+ );
175
+
176
+ const actionsToggle = (
177
+ <Button
178
+ disabled="dimmed"
179
+ appearance="secondary"
180
+ data-test="actions-toggle"
181
+ icon={<MoreVertical width="16px" height="16px" screenReaderText={_('Actions')} />}
182
+ style={{ marginLeft: 10 }}
183
+ />
184
+ );
185
+
186
+ const actions = (
187
+ <div
188
+ style={{
189
+ position: 'relative',
190
+ width: '100%',
191
+ display: 'flex',
192
+ justifyContent: 'flex-end',
193
+ }}
194
+ >
195
+ <div style={{ flex: '0 0 auto' }}>
196
+ <Dropdown defaultPlacement="right" toggle={actionsToggle}>
197
+ <Menu>
198
+ <Menu.Item startAdornment={<Refresh width="16px" height="16px" />}>
199
+ Refresh
200
+ </Menu.Item>
201
+ <Menu.Divider />
202
+ <Menu.Item startAdornment={<Clone width="16px" height="16px" />}>
203
+ Duplicate
204
+ </Menu.Item>
205
+ <Menu.Item startAdornment={<Remove width="16px" height="16px" />}>
206
+ Delete
207
+ </Menu.Item>
208
+ </Menu>
209
+ </Dropdown>
210
+ </div>
211
+ </div>
212
+ );
213
+
214
+ return (
215
+ <>
216
+ <CollapsiblePanel
217
+ panelId={1}
218
+ disabled="dimmed"
219
+ title="Introduction to Splunk Enterprise"
220
+ >
221
+ <P>
222
+ Splunk Enterprise makes it simple to collect, analyze and act upon the untapped
223
+ value of the big data generated by your technology infrastructure, security
224
+ systems and business applications—giving you the insights to drive operational
225
+ performance and business results. Splunk Enterprise monitors and analyzes
226
+ machine data from any source to deliver Operational Intelligence to optimize
227
+ your IT, security and business performance. With intuitive analysis features,
228
+ machine learning, packaged applications and open APIs, Splunk Enterprise is a
229
+ flexible platform that scales from focused use cases to an enterprise-wide
230
+ analytics backbone.
231
+ </P>
232
+ </CollapsiblePanel>
233
+ <CollapsiblePanel
234
+ panelId={2}
235
+ disabled="dimmed"
236
+ defaultOpen
237
+ title="Introduction to Splunk Enterprise"
238
+ >
239
+ <P>
240
+ Splunk Enterprise makes it simple to collect, analyze and act upon the untapped
241
+ value of the big data generated by your technology infrastructure, security
242
+ systems and business applications—giving you the insights to drive operational
243
+ performance and business results. Splunk Enterprise monitors and analyzes
244
+ machine data from any source to deliver Operational Intelligence to optimize
245
+ your IT, security and business performance. With intuitive analysis features,
246
+ machine learning, packaged applications and open APIs, Splunk Enterprise is a
247
+ flexible platform that scales from focused use cases to an enterprise-wide
248
+ analytics backbone.
249
+ </P>
250
+ </CollapsiblePanel>
251
+ <CollapsiblePanel disabled="dimmed" title={title} actions={actions}>
252
+ <P>
253
+ Splunk Security modernizes security operations and protects businesses with
254
+ data, analytics, automation and end-to-end integrations. Splunk Observability
255
+ solves problems in seconds with end-to-end visibility across infrastructure,
256
+ applications and digital customer experience. Splunk Cloud provides
257
+ cloud-powered insights for petabyte-scale data analytics across the hybrid cloud
258
+ with Splunk as a service.
259
+ </P>
260
+ </CollapsiblePanel>
261
+ </>
262
+ );
263
+ }
264
+
265
+ export default Dimmed;
266
+ ```
267
+
268
+
269
+
270
+ ### Multiple uncontrolled
271
+
272
+ ```typescript
273
+ import React from 'react';
274
+
275
+ import CollapsiblePanel from '@splunk/react-ui/CollapsiblePanel';
276
+ import P from '@splunk/react-ui/Paragraph';
277
+
278
+
279
+ function MultiUncontrolled() {
280
+ return (
281
+ <div>
282
+ <CollapsiblePanel title="Plan to migrate to Splunk Cloud Platform">
283
+ <P>
284
+ Download the Splunk Cloud Migration Assessment (SCMA) app to analyze your
285
+ on-premises or BYOL Splunk Enterprise deployment. Determine if you’re looking at
286
+ a hybrid or full migration approach, and prepare your environment.
287
+ </P>
288
+ </CollapsiblePanel>
289
+ <CollapsiblePanel title="Migrate to Splunk Cloud Platform">
290
+ <P>
291
+ Start the actual migration process by optimizing and moving data sources,
292
+ searches, users, apps and knowledge objects. This is a multi-step process that
293
+ will require the right resources and expertise.
294
+ </P>
295
+ </CollapsiblePanel>
296
+ <CollapsiblePanel title="Validate with System and User Acceptance Testing">
297
+ <P>
298
+ Test and tune use cases and workflows. Make sure search and user priming
299
+ artifacts, user preferences, and historical data are accounted for through
300
+ System and User Acceptance Testing.
301
+ </P>
302
+ </CollapsiblePanel>
303
+ </div>
304
+ );
305
+ }
306
+
307
+ export default MultiUncontrolled;
308
+ ```
309
+
310
+
311
+
312
+ ### Multiple controlled
313
+
314
+ ```typescript
315
+ import React, { useState } from 'react';
316
+
317
+ import { includes, xor } from 'lodash';
318
+
319
+ import CollapsiblePanel, { CollapsiblePanelChangeHandler } from '@splunk/react-ui/CollapsiblePanel';
320
+ import P from '@splunk/react-ui/Paragraph';
321
+
322
+
323
+ function MultiControlled() {
324
+ const [open, setOpen] = useState<(string | number | undefined)[]>([]);
325
+
326
+ const handleChange: CollapsiblePanelChangeHandler = (event, { panelId }) => {
327
+ setOpen(xor(open, [panelId]));
328
+ };
329
+
330
+ return (
331
+ <>
332
+ <CollapsiblePanel
333
+ panelId={1}
334
+ title="Plan to migrate to Splunk Cloud Platform"
335
+ onChange={handleChange}
336
+ open={includes(open, 1)}
337
+ >
338
+ <P>
339
+ Download the Splunk Cloud Migration Assessment (SCMA) app to analyze your
340
+ on-premises or BYOL Splunk Enterprise deployment. Determine if you’re looking at
341
+ a hybrid or full migration approach, and prepare your environment.
342
+ </P>
343
+ </CollapsiblePanel>
344
+ <CollapsiblePanel
345
+ panelId={2}
346
+ title="Migrate to Splunk Cloud Platform"
347
+ onChange={handleChange}
348
+ open={includes(open, 2)}
349
+ >
350
+ <P>
351
+ Start the actual migration process by optimizing and moving data sources,
352
+ searches, users, apps and knowledge objects. This is a multi-step process that
353
+ will require the right resources and expertise.
354
+ </P>
355
+ </CollapsiblePanel>
356
+ <CollapsiblePanel
357
+ panelId={3}
358
+ title="Validate with System and User Acceptance Testing"
359
+ onChange={handleChange}
360
+ open={includes(open, 3)}
361
+ >
362
+ <P>
363
+ Test and tune use cases and workflows. Make sure search and user priming
364
+ artifacts, user preferences, and historical data are accounted for through
365
+ System and User Acceptance Testing.
366
+ </P>
367
+ </CollapsiblePanel>
368
+ </>
369
+ );
370
+ }
371
+
372
+ export default MultiControlled;
373
+ ```
374
+
375
+
376
+
377
+ ### Actions
378
+
379
+ Adding clickable items in the header.
380
+
381
+ ```typescript
382
+ import React, { useState } from 'react';
383
+
384
+ import Clone from '@splunk/react-icons/enterprise/Clone';
385
+ import Filter from '@splunk/react-icons/enterprise/Filter';
386
+ import MoreVertical from '@splunk/react-icons/enterprise/MoreVertical';
387
+ import Refresh from '@splunk/react-icons/enterprise/Refresh';
388
+ import Remove from '@splunk/react-icons/enterprise/Remove';
389
+ import Button from '@splunk/react-ui/Button';
390
+ import CollapsiblePanel from '@splunk/react-ui/CollapsiblePanel';
391
+ import Dropdown from '@splunk/react-ui/Dropdown';
392
+ import Layout from '@splunk/react-ui/Layout';
393
+ import Menu from '@splunk/react-ui/Menu';
394
+ import P from '@splunk/react-ui/Paragraph';
395
+ import Search from '@splunk/react-ui/Search';
396
+ import { _ } from '@splunk/ui-utils/i18n';
397
+
398
+
399
+ function Actions() {
400
+ const [open, setOpen] = useState(true);
401
+
402
+ const handleChange = () => {
403
+ setOpen(!open);
404
+ };
405
+
406
+ const title = (
407
+ <div style={{ display: 'flex', width: 140, alignItems: 'center' }}>Splunk products</div>
408
+ );
409
+
410
+ const actionsToggle = (
411
+ <Button
412
+ appearance="secondary"
413
+ data-test="actions-toggle"
414
+ icon={<MoreVertical width="16px" height="16px" screenReaderText={_('Actions')} />}
415
+ />
416
+ );
417
+
418
+ const actions = (
419
+ <Layout>
420
+ <Button icon={<Filter />} />
421
+ <Search inline />
422
+ <Dropdown defaultPlacement="right" toggle={actionsToggle}>
423
+ <Menu>
424
+ <Menu.Item startAdornment={<Refresh width="16px" height="16px" />}>
425
+ Refresh
426
+ </Menu.Item>
427
+ <Menu.Divider />
428
+ <Menu.Item startAdornment={<Clone width="16px" height="16px" />}>
429
+ Duplicate
430
+ </Menu.Item>
431
+ <Menu.Item startAdornment={<Remove width="16px" height="16px" />}>
432
+ Delete
433
+ </Menu.Item>
434
+ </Menu>
435
+ </Dropdown>
436
+ </Layout>
437
+ );
438
+
439
+ return (
440
+ <CollapsiblePanel title={title} actions={actions} onChange={handleChange} open={open}>
441
+ <P>
442
+ Splunk Security modernizes security operations and protects businesses with data,
443
+ analytics, automation and end-to-end integrations. Splunk Observability solves
444
+ problems in seconds with end-to-end visibility across infrastructure, applications
445
+ and digital customer experience. Splunk Cloud provides cloud-powered insights for
446
+ petabyte-scale data analytics across the hybrid cloud with Splunk as a service.
447
+ </P>
448
+ </CollapsiblePanel>
449
+ );
450
+ }
451
+
452
+ export default Actions;
453
+ ```
454
+
455
+
456
+
457
+ ### Subtle
458
+
459
+ Use appearance="subtle" when you need a Collapsible Panel that has less visual weight.
460
+
461
+ ```typescript
462
+ import React, { useState } from 'react';
463
+
464
+ import CollapsiblePanel from '@splunk/react-ui/CollapsiblePanel';
465
+ import P from '@splunk/react-ui/Paragraph';
466
+
467
+
468
+ function Subtle() {
469
+ const [open, setOpen] = useState(false);
470
+
471
+ const handleChange = () => {
472
+ setOpen(!open);
473
+ };
474
+
475
+ return (
476
+ <CollapsiblePanel
477
+ title="Introduction to Splunk Enterprise"
478
+ onChange={handleChange}
479
+ open={open}
480
+ appearance="subtle"
481
+ >
482
+ <P>
483
+ Splunk Enterprise makes it simple to collect, analyze and act upon the untapped
484
+ value of the big data generated by your technology infrastructure, security systems
485
+ and business applications—giving you the insights to drive operational performance
486
+ and business results. Splunk Enterprise monitors and analyzes machine data from any
487
+ source to deliver Operational Intelligence to optimize your IT, security and
488
+ business performance. With intuitive analysis features, machine learning, packaged
489
+ applications and open APIs, Splunk Enterprise is a flexible platform that scales
490
+ from focused use cases to an enterprise-wide analytics backbone.
491
+ </P>
492
+ </CollapsiblePanel>
493
+ );
494
+ }
495
+
496
+ export default Subtle;
497
+ ```
498
+
499
+
500
+
501
+ ### SingleOpenPanelGroup uncontrolled
502
+
503
+ Expands and collapses only one panel at a time. Takes a defaultOpenPanelId prop.
504
+
505
+ ```typescript
506
+ import React from 'react';
507
+
508
+ import CollapsiblePanel, { SingleOpenPanelGroup } from '@splunk/react-ui/CollapsiblePanel';
509
+ import P from '@splunk/react-ui/Paragraph';
510
+
511
+
512
+ function SingleOpenPanelGroupUncontrolled() {
513
+ return (
514
+ <SingleOpenPanelGroup defaultOpenPanelId={2}>
515
+ <CollapsiblePanel panelId={1} title="What is Splunk Enterprise?">
516
+ <P>
517
+ Splunk Enterprise monitors and analyzes machine data from any source to deliver
518
+ Operational Intelligence to optimize IT, security and business performance. With
519
+ intuitive analysis features, machine learning, packaged applications and open
520
+ APIs, Splunk Enterprise is a flexible platform that scales from focused use
521
+ cases to an enterprise-wide analytics backbone.
522
+ </P>
523
+ </CollapsiblePanel>
524
+ <CollapsiblePanel panelId={2} title="What is Splunk Security?">
525
+ <P>
526
+ Splunk Security modernizes security operations and protects businesses with
527
+ data, analytics, automation and end-to-end integrations.
528
+ </P>
529
+ </CollapsiblePanel>
530
+ <CollapsiblePanel panelId={3} title="What is Splunk Observability?">
531
+ <P>
532
+ Splunk Observability solves problems in seconds with end-to-end visibility
533
+ across infrastructure, applications and digital customer experience.
534
+ </P>
535
+ </CollapsiblePanel>
536
+ </SingleOpenPanelGroup>
537
+ );
538
+ }
539
+
540
+ export default SingleOpenPanelGroupUncontrolled;
541
+ ```
542
+
543
+
544
+
545
+ ### SingleOpenPanelGroup controlled
546
+
547
+ Expands and collapses only one panel at a time. Note: the open prop on individual Panels is ignored when SingleOpenPanelGroup is used.
548
+
549
+ ```typescript
550
+ import React, { useState } from 'react';
551
+
552
+ import CollapsiblePanel, {
553
+ SingleOpenPanelGroup,
554
+ SingleOpenPanelGroupChangeHandler,
555
+ } from '@splunk/react-ui/CollapsiblePanel';
556
+ import P from '@splunk/react-ui/Paragraph';
557
+
558
+
559
+ function SingleOpenPanelGroupControlled() {
560
+ const [openPanelId, setOpenPanelId] = useState<string | number | null | undefined>(2);
561
+
562
+ const handleChange: SingleOpenPanelGroupChangeHandler = (
563
+ e,
564
+ { action, panelId: panelValue }
565
+ ) => {
566
+ setOpenPanelId(action === 'open' ? panelValue : null);
567
+ };
568
+
569
+ return (
570
+ <SingleOpenPanelGroup openPanelId={openPanelId} onChange={handleChange}>
571
+ <CollapsiblePanel panelId={1} title="What is Splunk Enterprise?">
572
+ <P>
573
+ Splunk Enterprise monitors and analyzes machine data from any source to deliver
574
+ Operational Intelligence to optimize IT, security and business performance. With
575
+ intuitive analysis features, machine learning, packaged applications and open
576
+ APIs, Splunk Enterprise is a flexible platform that scales from focused use
577
+ cases to an enterprise-wide analytics backbone.
578
+ </P>
579
+ </CollapsiblePanel>
580
+ <CollapsiblePanel panelId={2} title="What is Splunk Security?">
581
+ <P>
582
+ Splunk Security modernizes security operations and protects businesses with
583
+ data, analytics, automation and end-to-end integrations.
584
+ </P>
585
+ </CollapsiblePanel>
586
+ <CollapsiblePanel panelId={3} title="What is Splunk Observability?">
587
+ <P>
588
+ Splunk Observability solves problems in seconds with end-to-end visibility
589
+ across infrastructure, applications and digital customer experience.
590
+ </P>
591
+ </CollapsiblePanel>
592
+ </SingleOpenPanelGroup>
593
+ );
594
+ }
595
+
596
+ export default SingleOpenPanelGroupControlled;
597
+ ```
598
+
599
+
600
+
601
+ ### SingleOpenPanelGroup inset
602
+
603
+ Inset adds padding to the Collapsible Panel.
604
+
605
+ ```typescript
606
+ import React, { useState } from 'react';
607
+
608
+ import CollapsiblePanel, {
609
+ SingleOpenPanelGroup,
610
+ SingleOpenPanelGroupChangeHandler,
611
+ } from '@splunk/react-ui/CollapsiblePanel';
612
+ import P from '@splunk/react-ui/Paragraph';
613
+
614
+
615
+ function SingleOpenPanelGroupInset() {
616
+ const [openPanelId, setOpenPanelId] = useState<string | number | null | undefined>(1);
617
+
618
+ const handleChange: SingleOpenPanelGroupChangeHandler = (
619
+ e,
620
+ { action, panelId: panelValue }
621
+ ) => {
622
+ setOpenPanelId(action === 'open' ? panelValue : null);
623
+ };
624
+
625
+ return (
626
+ <SingleOpenPanelGroup openPanelId={openPanelId} onChange={handleChange}>
627
+ <CollapsiblePanel panelId={1} title="Overview" inset>
628
+ <P>
629
+ Splunk Enterprise makes it simple to collect, analyze and act upon the untapped
630
+ value of the big data generated by your technology infrastructure, security
631
+ systems and business applications—giving you the insights to drive operational
632
+ performance and business results.
633
+ </P>
634
+ </CollapsiblePanel>
635
+ <CollapsiblePanel panelId={2} title="How Splunk Enterprise works" inset={false}>
636
+ <P>
637
+ Splunk Enterprise monitors and analyzes machine data from any source to deliver
638
+ Operational Intelligence to optimize your IT, security and business performance.
639
+ With intuitive analysis features, machine learning, packaged applications and
640
+ open APIs, Splunk Enterprise is a flexible platform that scales from focused use
641
+ cases to an enterprise-wide analytics backbone.
642
+ </P>
643
+ </CollapsiblePanel>
644
+ </SingleOpenPanelGroup>
645
+ );
646
+ }
647
+
648
+ export default SingleOpenPanelGroupInset;
649
+ ```
650
+
651
+
652
+
653
+
654
+ ## API
655
+
656
+
657
+ ### CollapsiblePanel API
658
+
659
+ #### Props
660
+
661
+ | Name | Type | Required | Default | Description |
662
+ |------|------|------|------|------|
663
+ | actions | React.ReactNode | no | | Renders the toggle button and interactive elements separate from `title`, reserving the `title` prop for text only. |
664
+ | appearance | 'default' \| 'subtle' | no | 'default' | Changes the style of the panel. |
665
+ | children | React.ReactNode | no | | |
666
+ | defaultOpen | boolean | no | undefined | Sets the initial state of a panel to expanded. Incompatible with `open`. Use `open` or `defaultOpen`, not both. Incompatible with `SingleOpenPanelGroup` and will be ignored for any children in `SingleOpenPanelGroup`. |
667
+ | description | string | no | | Displays right-aligned text in the title bar of the `panel`. |
668
+ | disabled | boolean \| 'dimmed' \| 'disabled' | no | | Prevents the panel from expanding or collapsing. |
669
+ | elementRef | React.Ref<HTMLDivElement> | no | | A React ref which is set to the DOM element when the component mounts and null when it unmounts. |
670
+ | headingLevel | number | no | | Sets the `aria-level` of a panel to make heading level fit the outline of the page. If set, the heading element contains `role="heading"`. |
671
+ | innerBodyStyles | React.CSSProperties | no | | Style object applied to `TransitionOpen` inner styles. |
672
+ | inset | boolean | no | true | By default, adds padding to panel content. If set to false, renders panel content without padding. |
673
+ | onChange | CollapsiblePanelChangeHandler | no | | Invoked on a change of the open panel. Callback is passed the `panelId` of the `CollapsiblePanel` that originated the expand request and the `action` ("open" or "close") |
674
+ | open | boolean | no | | Controls the expanded state of a panel. Incompatible with `defaultOpen`. Use `open` or `defaultOpen`, not both. Incompatible with `SingleOpenPanelGroup` and will be ignored for any children in `SingleOpenPanelGroup`. |
675
+ | overflow | string | no | 'auto' | Controls how panel overflow is handled. Default is `auto`, allowing fixed-height Accordions to scroll their content if the panel is too high to fit properly. Any value allowed by the CSS `overflow` property is permitted, as is `null` (which will use the CSS default of "visible"). |
676
+ | panelId | string \| number | no | | Identifies a specific panel. Splunk UI uses `panelId` for callbacks and managing expanded and collapsed states. |
677
+ | renderChildrenWhenCollapsed | boolean | no | | When true, children are always rendered whether collapsed or not. Setting this to `true` can improve the performance of expanding panels at the cost of initial loading performance. |
678
+ | title | React.ReactNode | yes | | Displays the name of the panel in its title bar. |
679
+
680
+ #### Types
681
+
682
+ | Name | Type | Description |
683
+ |------|------|------|
684
+ | CollapsiblePanelChangeHandler | ( event: React.MouseEvent<HTMLButtonElement>, data: { action: 'open' \| 'close'; panelId?: string \| number; reason: 'toggleClick'; } ) => void | |
685
+
686
+
687
+
688
+ ### SingleOpenPanelGroup API
689
+
690
+ #### Props
691
+
692
+ | Name | Type | Required | Default | Description |
693
+ |------|------|------|------|------|
694
+ | children | React.ReactNode | no | | Must be `CollapsiblePanel`. |
695
+ | defaultOpenPanelId | string \| number | no | | Sets the panel to expand on the initial render. Use only when using `SingleOpenPanelGroup` as an uncontrolled component. Must match the `panelId` of one of the `CollapsiblePanel` children. |
696
+ | elementRef | React.Ref<HTMLDivElement> | no | | A React ref which is set to the DOM element when the component mounts and null when it unmounts. |
697
+ | inset | boolean | no | true | By default, adds padding to panel content. If set to false, renders panel content without padding. |
698
+ | onChange | SingleOpenPanelGroupChangeHandler | no | | Invoked on a change of the open panel. Callback is passed the `panelId` of the `CollapsiblePanel` that originated the expand request and the `action` ("open" or "close") |
699
+ | openPanelId | string \| number \| null | no | | Indicates the `panelId` of the currently expanded `CollapsiblePanel`. Use only when using `SingleOpenPanelGroup` as a controlled component. |
700
+
701
+ #### Types
702
+
703
+ | Name | Type | Description |
704
+ |------|------|------|
705
+ | SingleOpenPanelGroupChangeHandler | ( event: React.MouseEvent<HTMLButtonElement>, data: { action: 'open' \| 'close'; panelId?: string \| number; reason: 'toggleClick'; } ) => void | |
706
+
707
+
708
+
709
+
710
+
711
+ ## Accessibility
712
+
713
+ ## Visual Design
714
+ - Color contrast ratio **MUST** be:
715
+ - &gt= 4.5:1 for normal text: 14 pt (typically 18.66px) and bold or larger [SC 1.4.3][1]
716
+ - &gt= 3:1 for large text: 18 pt (typically 24px) or larger [SC 1.4.3][1]
717
+ - &gt= 3:1 for arrow icon against `CollapsiblePanel` header background [SC 1.4.11][2]
718
+ - Focus State: If the focus ring has a radius of [SC 1.4.11][2]
719
+ - &lt 3px: &gt= 4.5.1 between button &lt&gt focus &lt&gt background
720
+ - &gt 3px: &gt= 3.1 button button &lt&gt focus &lt&gt background
721
+
722
+ ## Content
723
+ - `CollapsiblePanel` titles **SHOULD** be between 60-80 characters; any more can lose a user's attention or negatively impact neurodivergent users
724
+
725
+ ## States
726
+ - Color contrast does not apply to a disabled panels
727
+
728
+ ## Interaction Design
729
+ - **MUST** have keyboard navigation [SC 2.1][3]
730
+ - <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move through `CollapsiblePanel` headers OR when open, any interactive elements within the panel
731
+ - <kbd>Space</kbd> and <kbd>Enter</kbd> to collapse or expand the `CollapsiblePanel` header when focused. In addition, any interactive elements within the panel that are focused
732
+
733
+ ## Implementation
734
+ - `CollapsiblePanel` header(summary) **MUST** be kept in the parent/trigger attribute, while all details are kept in the child attribute
735
+ - Screen reader **MUST** announce when panel is focused [SC 4.1.2][4]
736
+ - Header title
737
+ - Announcement should be made when user successfully closes or expands panel
738
+
739
+ [1]: https://www.w3.org/TR/WCAG21/#contrast-minimum
740
+ [2]: https://www.w3.org/TR/WCAG21/#non-text-contrast
741
+ [3]: https://www.w3.org/TR/WCAG21/#keyboard-accessible
742
+ [4]: https://www.w3.org/TR/WCAG21/#name-role-value
743
+
744
+