@patternfly/react-core 5.0.0-alpha.85 → 5.0.0-alpha.87

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 (247) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/esm/components/AboutModal/package.json +1 -1
  3. package/dist/esm/components/Accordion/package.json +1 -1
  4. package/dist/esm/components/ActionList/package.json +1 -1
  5. package/dist/esm/components/Alert/package.json +1 -1
  6. package/dist/esm/components/Avatar/package.json +1 -1
  7. package/dist/esm/components/BackToTop/package.json +1 -1
  8. package/dist/esm/components/Backdrop/package.json +1 -1
  9. package/dist/esm/components/BackgroundImage/package.json +1 -1
  10. package/dist/esm/components/Badge/package.json +1 -1
  11. package/dist/esm/components/Banner/package.json +1 -1
  12. package/dist/esm/components/Brand/package.json +1 -1
  13. package/dist/esm/components/Breadcrumb/package.json +1 -1
  14. package/dist/esm/components/Button/package.json +1 -1
  15. package/dist/esm/components/CalendarMonth/package.json +1 -1
  16. package/dist/esm/components/Card/package.json +1 -1
  17. package/dist/esm/components/Checkbox/package.json +1 -1
  18. package/dist/esm/components/Chip/package.json +1 -1
  19. package/dist/esm/components/ClipboardCopy/package.json +1 -1
  20. package/dist/esm/components/CodeBlock/package.json +1 -1
  21. package/dist/esm/components/DataList/package.json +1 -1
  22. package/dist/esm/components/DatePicker/package.json +1 -1
  23. package/dist/esm/components/DescriptionList/package.json +1 -1
  24. package/dist/esm/components/Divider/package.json +1 -1
  25. package/dist/esm/components/DragDrop/package.json +1 -1
  26. package/dist/esm/components/Drawer/package.json +1 -1
  27. package/dist/esm/components/Dropdown/package.json +1 -1
  28. package/dist/esm/components/DualListSelector/package.json +1 -1
  29. package/dist/esm/components/EmptyState/package.json +1 -1
  30. package/dist/esm/components/ExpandableSection/package.json +1 -1
  31. package/dist/esm/components/FileUpload/package.json +1 -1
  32. package/dist/esm/components/Form/package.json +1 -1
  33. package/dist/esm/components/FormSelect/package.json +1 -1
  34. package/dist/esm/components/HelperText/package.json +1 -1
  35. package/dist/esm/components/Hint/package.json +1 -1
  36. package/dist/esm/components/Icon/package.json +1 -1
  37. package/dist/esm/components/InputGroup/package.json +1 -1
  38. package/dist/esm/components/JumpLinks/package.json +1 -1
  39. package/dist/esm/components/Label/package.json +1 -1
  40. package/dist/esm/components/LabelGroup/package.json +1 -1
  41. package/dist/esm/components/List/package.json +1 -1
  42. package/dist/esm/components/LoginPage/package.json +1 -1
  43. package/dist/esm/components/Masthead/package.json +1 -1
  44. package/dist/esm/components/Menu/package.json +1 -1
  45. package/dist/esm/components/MenuToggle/package.json +1 -1
  46. package/dist/esm/components/Modal/package.json +1 -1
  47. package/dist/esm/components/MultipleFileUpload/MultipleFileUpload.d.ts +2 -2
  48. package/dist/esm/components/MultipleFileUpload/MultipleFileUpload.d.ts.map +1 -1
  49. package/dist/esm/components/MultipleFileUpload/MultipleFileUpload.js +2 -2
  50. package/dist/esm/components/MultipleFileUpload/MultipleFileUpload.js.map +1 -1
  51. package/dist/esm/components/MultipleFileUpload/package.json +1 -1
  52. package/dist/esm/components/Nav/package.json +1 -1
  53. package/dist/esm/components/NotificationBadge/package.json +1 -1
  54. package/dist/esm/components/NotificationDrawer/package.json +1 -1
  55. package/dist/esm/components/NumberInput/package.json +1 -1
  56. package/dist/esm/components/OverflowMenu/package.json +1 -1
  57. package/dist/esm/components/Page/package.json +1 -1
  58. package/dist/esm/components/Pagination/package.json +1 -1
  59. package/dist/esm/components/Panel/package.json +1 -1
  60. package/dist/esm/components/Popover/package.json +1 -1
  61. package/dist/esm/components/Progress/package.json +1 -1
  62. package/dist/esm/components/ProgressStepper/package.json +1 -1
  63. package/dist/esm/components/Radio/package.json +1 -1
  64. package/dist/esm/components/SearchInput/package.json +1 -1
  65. package/dist/esm/components/Select/package.json +1 -1
  66. package/dist/esm/components/Sidebar/package.json +1 -1
  67. package/dist/esm/components/SimpleList/package.json +1 -1
  68. package/dist/esm/components/Skeleton/package.json +1 -1
  69. package/dist/esm/components/SkipToContent/package.json +1 -1
  70. package/dist/esm/components/Slider/Slider.d.ts +2 -1
  71. package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
  72. package/dist/esm/components/Slider/Slider.js +7 -7
  73. package/dist/esm/components/Slider/Slider.js.map +1 -1
  74. package/dist/esm/components/Slider/package.json +1 -1
  75. package/dist/esm/components/Spinner/package.json +1 -1
  76. package/dist/esm/components/Switch/package.json +1 -1
  77. package/dist/esm/components/Tabs/package.json +1 -1
  78. package/dist/esm/components/Text/package.json +1 -1
  79. package/dist/esm/components/TextArea/package.json +1 -1
  80. package/dist/esm/components/TextInput/package.json +1 -1
  81. package/dist/esm/components/TextInputGroup/package.json +1 -1
  82. package/dist/esm/components/Tile/package.json +1 -1
  83. package/dist/esm/components/TimePicker/package.json +1 -1
  84. package/dist/esm/components/Timestamp/package.json +1 -1
  85. package/dist/esm/components/Title/package.json +1 -1
  86. package/dist/esm/components/ToggleGroup/package.json +1 -1
  87. package/dist/esm/components/Toolbar/package.json +1 -1
  88. package/dist/esm/components/Tooltip/package.json +1 -1
  89. package/dist/esm/components/TreeView/package.json +1 -1
  90. package/dist/esm/components/Truncate/package.json +1 -1
  91. package/dist/esm/components/Wizard/hooks/package.json +1 -1
  92. package/dist/esm/components/Wizard/package.json +1 -1
  93. package/dist/esm/components/package.json +1 -1
  94. package/dist/esm/deprecated/components/ApplicationLauncher/package.json +1 -1
  95. package/dist/esm/deprecated/components/ContextSelector/package.json +1 -1
  96. package/dist/esm/deprecated/components/Dropdown/package.json +1 -1
  97. package/dist/esm/deprecated/components/OptionsMenu/package.json +1 -1
  98. package/dist/esm/deprecated/components/PageHeader/package.json +1 -1
  99. package/dist/esm/deprecated/components/Select/package.json +1 -1
  100. package/dist/esm/deprecated/components/Wizard/package.json +1 -1
  101. package/dist/esm/deprecated/components/package.json +1 -1
  102. package/dist/esm/deprecated/package.json +1 -1
  103. package/dist/esm/helpers/Popper/thirdparty/popper-core/package.json +1 -1
  104. package/dist/esm/helpers/package.json +1 -1
  105. package/dist/esm/layouts/Bullseye/package.json +1 -1
  106. package/dist/esm/layouts/Flex/package.json +1 -1
  107. package/dist/esm/layouts/Gallery/package.json +1 -1
  108. package/dist/esm/layouts/Grid/package.json +1 -1
  109. package/dist/esm/layouts/Level/package.json +1 -1
  110. package/dist/esm/layouts/Split/package.json +1 -1
  111. package/dist/esm/layouts/Stack/package.json +1 -1
  112. package/dist/esm/layouts/package.json +1 -1
  113. package/dist/esm/next/components/package.json +1 -1
  114. package/dist/esm/next/package.json +1 -1
  115. package/dist/esm/package.json +1 -1
  116. package/dist/js/components/AboutModal/package.json +1 -1
  117. package/dist/js/components/Accordion/package.json +1 -1
  118. package/dist/js/components/ActionList/package.json +1 -1
  119. package/dist/js/components/Alert/package.json +1 -1
  120. package/dist/js/components/Avatar/package.json +1 -1
  121. package/dist/js/components/BackToTop/package.json +1 -1
  122. package/dist/js/components/Backdrop/package.json +1 -1
  123. package/dist/js/components/BackgroundImage/package.json +1 -1
  124. package/dist/js/components/Badge/package.json +1 -1
  125. package/dist/js/components/Banner/package.json +1 -1
  126. package/dist/js/components/Brand/package.json +1 -1
  127. package/dist/js/components/Breadcrumb/package.json +1 -1
  128. package/dist/js/components/Button/package.json +1 -1
  129. package/dist/js/components/CalendarMonth/package.json +1 -1
  130. package/dist/js/components/Card/package.json +1 -1
  131. package/dist/js/components/Checkbox/package.json +1 -1
  132. package/dist/js/components/Chip/package.json +1 -1
  133. package/dist/js/components/ClipboardCopy/package.json +1 -1
  134. package/dist/js/components/CodeBlock/package.json +1 -1
  135. package/dist/js/components/DataList/package.json +1 -1
  136. package/dist/js/components/DatePicker/package.json +1 -1
  137. package/dist/js/components/DescriptionList/package.json +1 -1
  138. package/dist/js/components/Divider/package.json +1 -1
  139. package/dist/js/components/DragDrop/package.json +1 -1
  140. package/dist/js/components/Drawer/package.json +1 -1
  141. package/dist/js/components/Dropdown/package.json +1 -1
  142. package/dist/js/components/DualListSelector/package.json +1 -1
  143. package/dist/js/components/EmptyState/package.json +1 -1
  144. package/dist/js/components/ExpandableSection/package.json +1 -1
  145. package/dist/js/components/FileUpload/package.json +1 -1
  146. package/dist/js/components/Form/package.json +1 -1
  147. package/dist/js/components/FormSelect/package.json +1 -1
  148. package/dist/js/components/HelperText/package.json +1 -1
  149. package/dist/js/components/Hint/package.json +1 -1
  150. package/dist/js/components/Icon/package.json +1 -1
  151. package/dist/js/components/InputGroup/package.json +1 -1
  152. package/dist/js/components/JumpLinks/package.json +1 -1
  153. package/dist/js/components/Label/package.json +1 -1
  154. package/dist/js/components/LabelGroup/package.json +1 -1
  155. package/dist/js/components/List/package.json +1 -1
  156. package/dist/js/components/LoginPage/package.json +1 -1
  157. package/dist/js/components/Masthead/package.json +1 -1
  158. package/dist/js/components/Menu/package.json +1 -1
  159. package/dist/js/components/MenuToggle/package.json +1 -1
  160. package/dist/js/components/Modal/package.json +1 -1
  161. package/dist/js/components/MultipleFileUpload/MultipleFileUpload.d.ts +2 -2
  162. package/dist/js/components/MultipleFileUpload/MultipleFileUpload.d.ts.map +1 -1
  163. package/dist/js/components/MultipleFileUpload/MultipleFileUpload.js +2 -2
  164. package/dist/js/components/MultipleFileUpload/MultipleFileUpload.js.map +1 -1
  165. package/dist/js/components/MultipleFileUpload/package.json +1 -1
  166. package/dist/js/components/Nav/package.json +1 -1
  167. package/dist/js/components/NotificationBadge/package.json +1 -1
  168. package/dist/js/components/NotificationDrawer/package.json +1 -1
  169. package/dist/js/components/NumberInput/package.json +1 -1
  170. package/dist/js/components/OverflowMenu/package.json +1 -1
  171. package/dist/js/components/Page/package.json +1 -1
  172. package/dist/js/components/Pagination/package.json +1 -1
  173. package/dist/js/components/Panel/package.json +1 -1
  174. package/dist/js/components/Popover/package.json +1 -1
  175. package/dist/js/components/Progress/package.json +1 -1
  176. package/dist/js/components/ProgressStepper/package.json +1 -1
  177. package/dist/js/components/Radio/package.json +1 -1
  178. package/dist/js/components/SearchInput/package.json +1 -1
  179. package/dist/js/components/Select/package.json +1 -1
  180. package/dist/js/components/Sidebar/package.json +1 -1
  181. package/dist/js/components/SimpleList/package.json +1 -1
  182. package/dist/js/components/Skeleton/package.json +1 -1
  183. package/dist/js/components/SkipToContent/package.json +1 -1
  184. package/dist/js/components/Slider/Slider.d.ts +2 -1
  185. package/dist/js/components/Slider/Slider.d.ts.map +1 -1
  186. package/dist/js/components/Slider/Slider.js +7 -7
  187. package/dist/js/components/Slider/Slider.js.map +1 -1
  188. package/dist/js/components/Slider/package.json +1 -1
  189. package/dist/js/components/Spinner/package.json +1 -1
  190. package/dist/js/components/Switch/package.json +1 -1
  191. package/dist/js/components/Tabs/package.json +1 -1
  192. package/dist/js/components/Text/package.json +1 -1
  193. package/dist/js/components/TextArea/package.json +1 -1
  194. package/dist/js/components/TextInput/package.json +1 -1
  195. package/dist/js/components/TextInputGroup/package.json +1 -1
  196. package/dist/js/components/Tile/package.json +1 -1
  197. package/dist/js/components/TimePicker/package.json +1 -1
  198. package/dist/js/components/Timestamp/package.json +1 -1
  199. package/dist/js/components/Title/package.json +1 -1
  200. package/dist/js/components/ToggleGroup/package.json +1 -1
  201. package/dist/js/components/Toolbar/package.json +1 -1
  202. package/dist/js/components/Tooltip/package.json +1 -1
  203. package/dist/js/components/TreeView/package.json +1 -1
  204. package/dist/js/components/Truncate/package.json +1 -1
  205. package/dist/js/components/Wizard/hooks/package.json +1 -1
  206. package/dist/js/components/Wizard/package.json +1 -1
  207. package/dist/js/components/package.json +1 -1
  208. package/dist/js/deprecated/components/ApplicationLauncher/package.json +1 -1
  209. package/dist/js/deprecated/components/ContextSelector/package.json +1 -1
  210. package/dist/js/deprecated/components/Dropdown/package.json +1 -1
  211. package/dist/js/deprecated/components/OptionsMenu/package.json +1 -1
  212. package/dist/js/deprecated/components/PageHeader/package.json +1 -1
  213. package/dist/js/deprecated/components/Select/package.json +1 -1
  214. package/dist/js/deprecated/components/Wizard/package.json +1 -1
  215. package/dist/js/deprecated/components/package.json +1 -1
  216. package/dist/js/deprecated/package.json +1 -1
  217. package/dist/js/helpers/Popper/thirdparty/popper-core/package.json +1 -1
  218. package/dist/js/helpers/package.json +1 -1
  219. package/dist/js/layouts/Bullseye/package.json +1 -1
  220. package/dist/js/layouts/Flex/package.json +1 -1
  221. package/dist/js/layouts/Gallery/package.json +1 -1
  222. package/dist/js/layouts/Grid/package.json +1 -1
  223. package/dist/js/layouts/Level/package.json +1 -1
  224. package/dist/js/layouts/Split/package.json +1 -1
  225. package/dist/js/layouts/Stack/package.json +1 -1
  226. package/dist/js/layouts/package.json +1 -1
  227. package/dist/js/next/components/package.json +1 -1
  228. package/dist/js/next/package.json +1 -1
  229. package/dist/js/package.json +1 -1
  230. package/dist/umd/react-core.min.js +1 -1
  231. package/package.json +2 -2
  232. package/src/components/MultipleFileUpload/MultipleFileUpload.tsx +3 -3
  233. package/src/components/MultipleFileUpload/examples/MultipleFileUpload.md +14 -0
  234. package/src/components/MultipleFileUpload/examples/MultipleFileUploadBasic.tsx +2 -1
  235. package/src/components/OverflowMenu/examples/OverflowMenuBreakpointOnContainer.tsx +2 -1
  236. package/src/components/Slider/Slider.tsx +15 -7
  237. package/src/components/Slider/examples/Slider.md +26 -0
  238. package/src/components/Slider/examples/SliderActions.tsx +3 -2
  239. package/src/components/Slider/examples/SliderContinuous.tsx +8 -4
  240. package/src/components/Slider/examples/SliderDisabled.tsx +8 -3
  241. package/src/components/Slider/examples/SliderDiscrete.tsx +8 -8
  242. package/src/components/Slider/examples/SliderThumbValueInput.tsx +2 -1
  243. package/src/components/Slider/examples/SliderValueInput.tsx +8 -5
  244. package/src/components/Tabs/examples/Tabs.md +120 -44
  245. package/src/components/Toolbar/examples/Toolbar.md +41 -19
  246. package/src/components/Toolbar/examples/ToolbarItems.tsx +1 -1
  247. package/src/demos/examples/MultipleFileUpload/MultipleFileUploadRejectedFile.tsx +13 -12
@@ -2,7 +2,7 @@
2
2
  id: Tabs
3
3
  section: components
4
4
  cssPrefix: pf-c-tabs
5
- propComponents: ['Tabs', 'Tab', TabAction, 'TabContent', 'TabTitleText', 'TabTitleIcon', 'horizontalOverflowObject']
5
+ propComponents: ['Tabs', 'Tab', 'TabContent', 'TabTitleText', 'TabTitleIcon', 'horizontalOverflowObject', 'TabAction']
6
6
  ouia: true
7
7
  ---
8
8
 
@@ -15,141 +15,217 @@ import ProjectDiagramIcon from '@patternfly/react-icons/dist/esm/icons/project-d
15
15
  import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
16
16
  import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
17
17
 
18
- Most tab variations are available as open (default) or box style tabs. Select the 'isBox' checkbox to preview an example with box styled tabs.
19
- The Tabs items background can be also toggled with 'Tab light variation' checkbox.
20
- Similarly the 'Tab content light variation' checkbox affects the TabContent background.
21
-
22
18
  ## Examples
23
19
 
24
- ### Default
20
+ ### Default tabs
21
+
22
+ A `<Tabs>` component contains multiple `<Tab>` components that may be used to navigate between sets of content within a page.
23
+
24
+ You can adjust a tab in the following ways:
25
+
26
+ - To label a tab with text, pass a `<TabTitleText>` component into the `title` property of a `<Tab>`.
27
+ - To disable a tab, use the `isDisabled` property. Tabs using `isDisabled` are not perceivable or operable by users navigating via assistive technologies.
28
+ - To disable a tab, but keep it perceivable to assistive technology users, use the `isAriaDisabled` property. If a disabled tab has a tooltip, use this property instead of `isDisabled`.
29
+ - To add a tooltip to an aria-disabled tab, use the `tooltip` property.
25
30
 
26
- When passing in a Tooltip component to the Tab component, the Tooltip can also be passed in directly to the `tooltip` prop.
31
+ Most tab variations can either be 'default' or 'boxed':
32
+
33
+ - Default tabs do not have any borders and use a bottom line to distinguish between a selected tab, a hovered tab, and an inactive tab.
34
+ - Boxed tabs are outlined to emphasize the area that a tab spans. To preview boxed tabs in the following examples, select the 'isBox' checkbox, which sets the `isBox` property to true.
27
35
 
28
36
  ```ts file="./TabsDefault.tsx"
29
37
  ```
30
38
 
31
- ### With tooltip react ref
39
+ ### Boxed light tabs
32
40
 
33
- When using a React ref to link a Tooltip to a Tab component via the `reference` prop, you should avoid manually passing in a value of "off" to the `aria-live` prop. Doing so may lead to the tooltip becoming less accessible to assistive technologies.
41
+ To change the background color of boxed tabs, use the `variant` property.
34
42
 
35
- The tooltip should also have the `id` prop passed in. The value given to this prop should then be passed into the tab's `aria-describedby` prop. This ensures a tooltip used with a React ref will be announced by the JAWS and NVDA screen readers.
43
+ The following example passes `variant={isTabsLightScheme ? 'light300' : 'default'}` into the `<Tabs>` component to style the tabs with a lighter color.
36
44
 
37
- ```ts file="./TabsTooltipReactRef.tsx"
45
+ Toggle the tab color by selecting the 'Tabs light variation' checkbox in the following example.
46
+
47
+ ```ts file="./TabsBoxLight.tsx"
38
48
  ```
39
49
 
40
- ### Uncontrolled
50
+ ### Vertical tabs
41
51
 
42
- ```ts file="./TabsUncontrolled.tsx"
52
+ Vertical tabs are placed on the left-hand side of a page or container and may appear in both 'default' and 'boxed' tab variations.
53
+
54
+ To style tabs vertically, use the `isVertical` property.
55
+
56
+ ```ts file="./TabsVertical.tsx"
43
57
  ```
44
58
 
45
- ### Box light variation
59
+ ### Vertical expandable tabs
46
60
 
47
- ```ts file="./TabsBoxLight.tsx"
61
+ Vertical tabs can be made expandable to save space. Users can select the caret to expand a menu and switch between tabs.
62
+
63
+ Expandable tabs can be enabled at different breakpoints. The following example passes `expandable={{ default: 'expandable', md: 'nonExpandable', lg: 'expandable' }}` into the `<Tabs>` component.
64
+
65
+ To flag vertical tabs when they're expanded, use the `isExpanded` property.
66
+
67
+ ```ts file="./TabsVerticalExpandable.tsx"
68
+ ```
69
+
70
+ ### Vertical expandable uncontrolled
71
+
72
+ To flag the default expanded state for uncontrolled tabs, use the `defaultIsExpanded` property.
73
+
74
+ ```ts file="./TabsVerticalExpandableUncontrolled.tsx"
48
75
  ```
49
76
 
50
- ### Default overflow
77
+ ### Default overflow tabs
78
+
79
+ By default, overflow is applied when there are too many tabs for the width of the container they are in. This overflow can be navigated by side-scrolling within the tabs section, or by selecting the left and right arrows.
51
80
 
52
81
  ```ts file="./TabsDefaultOverflow.tsx"
53
82
  ```
54
83
 
55
- ### Horizontal overflow
84
+ ### Horizontal overflow tabs
85
+
86
+ Horizontal overflow can be used instead of the default application. To navigate horizontal overflow tabs users can select the last tab, labeled “more”, to see the overflowed content.
87
+
88
+ To enable horizontal overflow, use the `isOverflowHorizontal` property.
89
+
90
+ In the following example, select the 'Show overflowing tab count' checkbox to add a count of overflow items to the final “more” tab.
56
91
 
57
92
  ```ts file="./TabsHorizontalOverflow.tsx" isBeta
58
93
  ```
59
94
 
60
- ### Vertical
95
+ ### With tooltip react ref
61
96
 
62
- ```ts file="./TabsVertical.tsx"
63
- ```
97
+ When using a React ref to link a tooltip to a tab component via the `reference` property, you should avoid manually passing in a value of "off" to the `aria-live` property. Doing so may cause the tooltip to become less accessible to assistive technologies.
64
98
 
65
- ### Vertical expandable
99
+ The tooltip should also have the `id` property passed in. The value of `id` should be passed into the tab's `aria-describedby` property. This ensures a tooltip used with a React ref will be announced by the JAWS and NVDA screen readers.
66
100
 
67
- ```ts file="./TabsVerticalExpandable.tsx"
101
+ ```ts file="./TabsTooltipReactRef.tsx"
68
102
  ```
69
103
 
70
- ### Vertical expandable uncontrolled
104
+ ### Uncontrolled tabs
71
105
 
72
- ```ts file="./TabsVerticalExpandableUncontrolled.tsx"
106
+ To allow the `<Tabs>` component to manage setting the active tab and displaying correct content itself, use uncontrolled tabs, as shown in the following example.
107
+
108
+
109
+ ```ts file="./TabsUncontrolled.tsx"
73
110
  ```
74
111
 
75
- ### Inset
112
+ ### With adjusted inset
113
+
114
+ To adjust the inset of tabs and visually separate them more, use the `inset` property. You can set the inset to "insetNone", "insetSm", "insetMd", "insetLg", "insetXl", or "inset2xl" at "default", "sm", "md", "lg, "xl, and "2xl" breakpoints.
76
115
 
77
116
  ```ts file="./TabsInset.tsx"
78
117
  ```
79
118
 
80
- ### Page Insets
119
+ ### With page insets
120
+
121
+ To adjust the left padding of tabs, use the `usePageInsets` property. This property aligns the tabs padding with the default padding of the page section, which makes it easier to align tabs with page section content.
81
122
 
82
123
  ```ts file="./TabsPageInsets.tsx"
83
124
  ```
84
125
 
85
- ### Icons and text
126
+ ### With icons and text
127
+
128
+ You can render different content in the `title` property of a tab to add icons and text.
129
+
130
+ To add an icon to a tab, pass a `<TabTitleIcon>` component that contains the icon of your choice into the `title`. To use an icon alongside styled text, keep the text in the `<TabTitleText>` component.
86
131
 
87
132
  ```ts file="./TabsIconAndText.tsx"
88
133
  ```
89
134
 
90
- ### Tabs with sub tabs
135
+ ### Secondary tabs
91
136
 
92
- ```ts file="./TabsSubtabs.tsx"
93
- ```
137
+ Use secondary tabs as "sub tabs" or within other components, like modals. Secondary tabs have less visually prominent styling.
94
138
 
95
- ### Filled
139
+ To apply secondary styling to tabs, use the `isSecondary` property.
96
140
 
97
- ```ts file="TabsFilled.tsx"
141
+ ```ts file="./TabsSubtabs.tsx"
98
142
  ```
99
143
 
100
- ### Filled with icons
144
+ ### Filled tabs with icons
145
+
146
+ To allow tabs to fill the available width of the page section, use the `isFilled` property.
101
147
 
102
148
  ```ts file="./TabsFilledWithIcons.tsx"
103
149
  ```
104
150
 
105
- ### Using the nav element
151
+ ### Tabs linked to nav elements
152
+
153
+ To let tabs link to nav elements, pass `{TabsComponent.nav}` into the `component` property.
154
+
155
+ Nav tabs should use the `href` property to link the tab to the URL of another page or page section. A tab with an `href` will render as an `<a>` instead of a `<button>`.
106
156
 
107
157
  ```ts file="./TabsNav.tsx"
108
158
  ```
109
159
 
110
- ### Sub nav using the nav element
160
+ ### Secondary tabs linked to nav elements
161
+
162
+ Secondary tabs can also link to nav elements.
111
163
 
112
164
  ```ts file="./TabsNavSecondary.tsx"
113
165
  ```
114
166
 
115
- ### Separate content
167
+ ### With separate content
168
+
169
+ If a `<TabContent>` component is defined outside of a `<Tabs>` component, use the `tabContentRef` and `tabContentId` properties
116
170
 
117
171
  ```ts file="./TabsSeparateContent.tsx"
118
172
  ```
119
173
 
120
- ### Tab content with body and padding
174
+ ### With tab content with body and padding
175
+
176
+ To add a content body to a `<TabContent>` component, pass a `<TabContentBody>`. To add padding to the body section, use the `hasPadding` property.
121
177
 
122
178
  ```ts file="./TabsContentWithBodyPadding.tsx"
123
179
  ```
124
180
 
125
181
  ### Children mounting on click
126
182
 
183
+ To mount tab children (add to the DOM) when a tab is clicked, use the `mountOnEnter` property.
184
+
185
+ Note that this property does not create the tab children until the tab is clicked, so they are not preloaded into the DOM.
186
+
127
187
  ```ts file="./TabsChildrenMounting.tsx"
128
188
  ```
129
189
 
130
190
  ### Unmounting invisible children
131
191
 
192
+ To unmount tab children (remove from the DOM) when they are no longer visible, use the `unmountOnExit` property.
193
+
132
194
  ```ts file="./TabsUnmountingInvisibleChildren.tsx"
133
195
  ```
134
196
 
135
- ### Toggled separate content
197
+ ### Toggled tab content
198
+
199
+ You may control tabs from outside of the tabs component. For example, select the "Hide tab 2" button below to make "Tab item 2" invisible.
200
+
201
+ The tab its content should only be mounted when the tab is visible.
136
202
 
137
203
  ```ts file="./TabsToggledSeparateContent.tsx"
138
204
  ```
139
205
 
140
- ### Dynamic
206
+ ### Dynamic tabs
207
+
208
+ To enable closeable tabs, pass the `onClose` property to the `<Tabs>` component. To enable a button that adds new tabs, pass the `onAdd` property to `<Tabs>`.
141
209
 
142
- To enable closeable tabs, pass the `onClose` property to `Tabs`, and to enable the add button, pass the `onAdd` property to `Tabs`. Aria labels may be controlled manually by passing `closeButtonAriaLabel` to `Tab` and `addButtonAriaLabel` to `Tabs`.
210
+ Aria labels may be controlled manually by passing the `closeButtonAriaLabel` property to a `<Tab>` and the `addButtonAriaLabel` property to `<Tabs>`.
143
211
 
144
- ```ts file="./TabsDynamic.tsx"
212
+ ```ts file="./TabsDynamic.tsx"
145
213
  ```
146
214
 
147
- ### Help action
215
+ ### With help action popover
216
+
217
+ You may add a help action to a tab to provide users with additional context in a popover.
218
+
219
+ To render an action beside the tab content, use the `actions` property of a `<Tab>`. Pass a popover and a `<TabsAction>` component into the `actions` property.
148
220
 
149
221
  ```ts file="./TabsHelp.tsx" isBeta
150
222
  ```
151
223
 
152
- ### Help and close actions
224
+ ### With help and close actions
225
+
226
+ To add multiple actions to a tab, create a `<TabAction>` component for each action.
227
+
228
+ The following example passes in both help popover and close actions.
153
229
 
154
230
  ```ts file="./TabsHelpAndClose.tsx" isBeta
155
- ```
231
+ ```
@@ -23,63 +23,83 @@ KebabToggle
23
23
 
24
24
  ## Examples
25
25
 
26
- ### Items
26
+ ### Toolbar items
27
27
 
28
- Toolbar items are individual components that can be placed inside of a toolbar. Buttons or select lists are examples of items. (Note: This example does not demonstrate the desired responsive behavior of the toolbar. That is handled in later examples.)
28
+ A toolbar can contain multiple toolbar items, like filters and buttons.
29
+
30
+ Note: This example does not demonstrate responsive toolbar behavior. Responsive toolbars are shown in the [examples with toggle groups and filters](/components/toolbar#examples-with-toggle-groups-and-filters).
29
31
 
30
32
  ```ts file="./ToolbarItems.tsx"
31
33
 
32
34
  ```
33
35
 
34
- ### Adjusting item spacers
36
+ ### Toolbar item spacers
37
+
38
+ You may adjust the space between toolbar items to arrange them into groups. Read our spacers documentation to learn more about using spacers.
39
+
40
+ Items are spaced “16px” apart by default. To adjust the size of the space between items, use the `spacer` property of each `<ToolbarItem>`. You can set the `spacer` value at multiple breakpoints, including "default", "md", "lg", "xl", and "2xl". Available `spacer` values include "spacerNone", "spacerSm", "spacerMd", or "spacerLg" into each breakpoint.
35
41
 
36
42
  ```ts file="./ToolbarSpacers.tsx"
37
43
 
38
44
  ```
39
45
 
40
- ### Adjusting item widths
46
+ ### Toolbar items with adjusted widths
47
+
48
+ You can adjust the width of toolbar items so that they better fit the size of their container.
49
+
50
+ The default width of a toolbar item is “100px”. To adjust an item’s width, use the `widths` property of the `<ToolbarItem>`. You can set the “px” value at multiple breakpoints, including "default", "sm", "md", "lg, "xl", and "2xl".
41
51
 
42
52
  ```ts file="./ToolbarWidths.tsx"
43
53
 
44
54
  ```
45
55
 
46
- ### Adjusting toolbar inset
56
+ ### With adjusted inset
57
+
58
+ To adjust a toolbar’s inset, use the `inset` property. You can set the inset value at multiple breakpoints, including "default", "md", "lg, "xl", and "2xl". Inset values include “insetNone”, “insetSm”, “insetMd”, “insetLg”, “insetXl”, and “inset2xl”.
47
59
 
48
60
  ```ts file="./ToolbarInsets.tsx"
49
61
 
50
62
  ```
51
63
 
52
- ### Sticky
64
+ ### Sticky toolbar
53
65
 
54
- ```ts file="./ToolbarSticky.tsx"
66
+ To lock a toolbar and prevent it from scrolling with other content, use a sticky toolbar.
67
+
68
+ In the following example, toggle the "is toolbar sticky" checkbox to see the difference between a sticky and non-sticky toolbar.
55
69
 
70
+ ```ts file="./ToolbarSticky.tsx"
56
71
  ```
57
72
 
58
- ### Groups
73
+ ### With groups of items
74
+
75
+ You can group similar items together to create desired associations and to enable items to respond to changes in viewport width together.
59
76
 
60
- Often, it makes sense to group sets of like items to create desired associations and to enable items to respond together to changes in viewport width. (Note: This example does not demonstrate the desired responsive behavior of the toolbar. That is handled in later examples.)
77
+ Note: This example does not demonstrate responsive toolbar behavior. Responsive toolbars are shown in the [examples with toggle groups and filters](/components/toolbar#examples-with-toggle-groups-and-filters).
61
78
 
62
79
  ```ts file="./ToolbarGroups.tsx"
63
80
 
64
81
  ```
65
82
  ## Examples with toggle groups and filters
66
83
 
67
- A toggle group can be used when you want to collapse a set of items into an overlay panel at a certain breakpoint. This allows complex toolbars with multiple items and groups of items to be responsive. A toggle group is useful for containing filter controls, for example. When the toolbar responds to adapt to a mobile viewport, the contents contained in a toggle group will collapse into an overlay panel that can be toggled by clicking the Filter icon.
84
+ The following examples use toggle groups to allow for more responsive and complex toolbars with multiple items and groups of items. To visualize responsive toolbar behavior in the following examples, resize the browser to a smaller screen width.
85
+
68
86
 
69
87
  ### Component managed toggle groups
70
88
 
89
+ A toggle group allows you to collapse a set of items into an overlay panel at a certain breakpoint. For example, when a toggle group contains filter controls, its contents will collapse into an overlay panel when the toolbar adapts to a change in the viewport size. The contents can be toggled by selecting the filter icon in the overlay panel.
90
+
71
91
  ```ts file="./ToolbarComponentManagedToggleGroups.tsx"
72
92
 
73
93
  ```
74
94
 
75
95
  ### Consumer managed toggle groups
76
96
 
77
- If the consumer would prefer to manage the expanded state of the toggle group for smaller screen widths:
97
+ To manually create the expanded state of the toggle group for smaller screen widths:
78
98
 
79
- 1. Add a toggleIsExpanded callback to Toolbar
80
- 2. Pass in a boolean into the isExpanded prop to Toolbar
99
+ 1. Add a `toggleIsExpanded` callback to the toolbar
100
+ 2. Pass a boolean into the `isExpanded` property of the toolbar
81
101
 
82
- - Note: Although the toggle group is aware of the consumer provided breakpoint, the expandable content is not. So if the expandable content is expanded and the screen width surpasses that of the breakpoint, then the expandable content will not know that and will remain open, this case should be considered and handled by the consumer as well.
102
+ Note: The toggle group is aware of the consumer provided breakpoint, the expandable content is not. If the expandable content is expanded and the screen width surpasses that of the breakpoint, the expandable content is not aware of that and will remain open. Be sure to consider and handle this in your implementation.
83
103
 
84
104
  ```ts file="./ToolbarConsumerManagedToggleGroups.tsx"
85
105
 
@@ -87,8 +107,10 @@ If the consumer would prefer to manage the expanded state of the toggle group fo
87
107
 
88
108
  ### With filters
89
109
 
90
- The ToolbarFilter component expects a consumer managed list of applied filters and a delete chip handler to be passed as props. Pass a deleteChipGroup prop to provide both a handler and visual styling to remove all chips in a group. Then the rendering of chips will be handled responsively by the Toolbar
91
- When filters are applied, the toolbar will expand in height to make space for a row of filter chips. Upon clearing the applied filters, the toolbar will collapse to its default height.
110
+ You can add filters to a toolbar to let users filter the content that a toolbar manages. When a toolbar is filtered, it will expand in height to make space for a row of filter chips and a "Clear all filters" button. Upon clearing the applied filters, the toolbar will return to its default height.
111
+
112
+ The `<ToolbarFilter>` component expects applied filters and a delete chip handler to be passed in as properties. Pass in a `deleteChipGroup` property to close the entire chip group. Once close, the rendering of chips will be handled responsively by the toolbar.
113
+
92
114
 
93
115
  ```ts file="./ToolbarWithFilters.tsx"
94
116
 
@@ -96,7 +118,7 @@ When filters are applied, the toolbar will expand in height to make space for a
96
118
 
97
119
  ### With custom chip group content
98
120
 
99
- The chip groups generated by toolbar filters may be further customized through the `customChipGroupContent` property, which will append to the filter chip groups. This property will remove the default `Clear all filters` button.
121
+ To customize the chip groups generated by toolbar filters, use the `customChipGroupContent` property on the `<Toolbar>`. This property will remove the default `clear all filters` button.
100
122
 
101
123
  ```ts file="./ToolbarCustomChipGroupContent.tsx"
102
124
 
@@ -104,8 +126,8 @@ The chip groups generated by toolbar filters may be further customized through t
104
126
 
105
127
  ### Stacked example
106
128
 
107
- There may be situations where all of the required elements simply cannot fit in a single line.
129
+ When all of a toolbar's required elements cannot fit in a single line, you can split toolbar items into multiple rows.
108
130
 
109
131
  ```ts file="./ToolbarStacked.tsx"
110
-
111
132
  ```
133
+
@@ -19,7 +19,7 @@ export const ToolbarItems: React.FunctionComponent = () => {
19
19
  );
20
20
 
21
21
  return (
22
- <Toolbar id="toolbar-items">
22
+ <Toolbar id="toolbar-items-example">
23
23
  <ToolbarContent>{items}</ToolbarContent>
24
24
  </Toolbar>
25
25
  );
@@ -8,6 +8,7 @@ import {
8
8
  Modal,
9
9
  Checkbox
10
10
  } from '@patternfly/react-core';
11
+ import { DropEvent } from 'react-dropzone';
11
12
  import UploadIcon from '@patternfly/react-icons/dist/esm/icons/upload-icon';
12
13
 
13
14
  interface readFile {
@@ -34,7 +35,7 @@ export const MultipleFileUploadBasic: React.FunctionComponent = () => {
34
35
  React.useEffect(() => {
35
36
  if (readFileData.length < currentFiles.length) {
36
37
  setStatusIcon('inProgress');
37
- } else if (readFileData.every(file => file.loadResult === 'success')) {
38
+ } else if (readFileData.every((file) => file.loadResult === 'success')) {
38
39
  setStatusIcon('success');
39
40
  } else {
40
41
  setStatusIcon('danger');
@@ -44,39 +45,39 @@ export const MultipleFileUploadBasic: React.FunctionComponent = () => {
44
45
  // remove files from both state arrays based on their name
45
46
  const removeFiles = (namesOfFilesToRemove: string[]) => {
46
47
  const newCurrentFiles = currentFiles.filter(
47
- currentFile => !namesOfFilesToRemove.some(fileName => fileName === currentFile.name)
48
+ (currentFile) => !namesOfFilesToRemove.some((fileName) => fileName === currentFile.name)
48
49
  );
49
50
 
50
51
  setCurrentFiles(newCurrentFiles);
51
52
 
52
53
  const newReadFiles = readFileData.filter(
53
- readFile => !namesOfFilesToRemove.some(fileName => fileName === readFile.fileName)
54
+ (readFile) => !namesOfFilesToRemove.some((fileName) => fileName === readFile.fileName)
54
55
  );
55
56
 
56
57
  setReadFileData(newReadFiles);
57
58
  };
58
59
 
59
60
  // callback that will be called by the react dropzone with the newly dropped file objects
60
- const handleFileDrop = (droppedFiles: File[]) => {
61
+ const handleFileDrop = (_event: DropEvent, droppedFiles: File[]) => {
61
62
  // identify what, if any, files are re-uploads of already uploaded files
62
- const currentFileNames = currentFiles.map(file => file.name);
63
- const reUploads = droppedFiles.filter(droppedFile => currentFileNames.includes(droppedFile.name));
63
+ const currentFileNames = currentFiles.map((file) => file.name);
64
+ const reUploads = droppedFiles.filter((droppedFile) => currentFileNames.includes(droppedFile.name));
64
65
 
65
66
  /** this promise chain is needed because if the file removal is done at the same time as the file adding react
66
67
  * won't realize that the status items for the re-uploaded files needs to be re-rendered */
67
68
  Promise.resolve()
68
- .then(() => removeFiles(reUploads.map(file => file.name)))
69
- .then(() => setCurrentFiles(prevFiles => [...prevFiles, ...droppedFiles]));
69
+ .then(() => removeFiles(reUploads.map((file) => file.name)))
70
+ .then(() => setCurrentFiles((prevFiles) => [...prevFiles, ...droppedFiles]));
70
71
  };
71
72
 
72
73
  // callback called by the status item when a file is successfully read with the built-in file reader
73
74
  const handleReadSuccess = (data: string, file: File) => {
74
- setReadFileData(prevReadFiles => [...prevReadFiles, { data, fileName: file.name, loadResult: 'success' }]);
75
+ setReadFileData((prevReadFiles) => [...prevReadFiles, { data, fileName: file.name, loadResult: 'success' }]);
75
76
  };
76
77
 
77
78
  // callback called by the status item when a file encounters an error while being read with the built-in file reader
78
79
  const handleReadFail = (error: DOMException, file: File) => {
79
- setReadFileData(prevReadFiles => [
80
+ setReadFileData((prevReadFiles) => [
80
81
  ...prevReadFiles,
81
82
  { loadError: error, fileName: file.name, loadResult: 'danger' }
82
83
  ]);
@@ -95,7 +96,7 @@ export const MultipleFileUploadBasic: React.FunctionComponent = () => {
95
96
  }
96
97
  };
97
98
 
98
- const successfullyReadFileCount = readFileData.filter(fileData => fileData.loadResult === 'success').length;
99
+ const successfullyReadFileCount = readFileData.filter((fileData) => fileData.loadResult === 'success').length;
99
100
 
100
101
  return (
101
102
  <>
@@ -123,7 +124,7 @@ export const MultipleFileUploadBasic: React.FunctionComponent = () => {
123
124
  statusToggleText={`${successfullyReadFileCount} of ${currentFiles.length} files uploaded`}
124
125
  statusToggleIcon={statusIcon}
125
126
  >
126
- {currentFiles.map(file => (
127
+ {currentFiles.map((file) => (
127
128
  <MultipleFileUploadStatusItem
128
129
  file={file}
129
130
  key={file.name}