@patternfly/react-core 5.1.1-prerelease.12 → 5.1.1-prerelease.14

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 (198) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/components/package.json +1 -1
  3. package/deprecated/package.json +1 -1
  4. package/dist/dynamic/components/AboutModal/package.json +1 -1
  5. package/dist/dynamic/components/Accordion/package.json +1 -1
  6. package/dist/dynamic/components/ActionList/package.json +1 -1
  7. package/dist/dynamic/components/Alert/package.json +1 -1
  8. package/dist/dynamic/components/Avatar/package.json +1 -1
  9. package/dist/dynamic/components/BackToTop/package.json +1 -1
  10. package/dist/dynamic/components/Backdrop/package.json +1 -1
  11. package/dist/dynamic/components/BackgroundImage/package.json +1 -1
  12. package/dist/dynamic/components/Badge/package.json +1 -1
  13. package/dist/dynamic/components/Banner/package.json +1 -1
  14. package/dist/dynamic/components/Brand/package.json +1 -1
  15. package/dist/dynamic/components/Breadcrumb/package.json +1 -1
  16. package/dist/dynamic/components/Button/package.json +1 -1
  17. package/dist/dynamic/components/CalendarMonth/package.json +1 -1
  18. package/dist/dynamic/components/Card/package.json +1 -1
  19. package/dist/dynamic/components/Checkbox/package.json +1 -1
  20. package/dist/dynamic/components/Chip/package.json +1 -1
  21. package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
  22. package/dist/dynamic/components/CodeBlock/package.json +1 -1
  23. package/dist/dynamic/components/DataList/package.json +1 -1
  24. package/dist/dynamic/components/DatePicker/package.json +1 -1
  25. package/dist/dynamic/components/DescriptionList/package.json +1 -1
  26. package/dist/dynamic/components/Divider/package.json +1 -1
  27. package/dist/dynamic/components/DragDrop/package.json +1 -1
  28. package/dist/dynamic/components/Drawer/package.json +1 -1
  29. package/dist/dynamic/components/Dropdown/package.json +1 -1
  30. package/dist/dynamic/components/DualListSelector/package.json +1 -1
  31. package/dist/dynamic/components/EmptyState/package.json +1 -1
  32. package/dist/dynamic/components/ExpandableSection/package.json +1 -1
  33. package/dist/dynamic/components/FileUpload/package.json +1 -1
  34. package/dist/dynamic/components/Form/package.json +1 -1
  35. package/dist/dynamic/components/FormSelect/package.json +1 -1
  36. package/dist/dynamic/components/HelperText/package.json +1 -1
  37. package/dist/dynamic/components/Hint/package.json +1 -1
  38. package/dist/dynamic/components/Icon/package.json +1 -1
  39. package/dist/dynamic/components/InputGroup/package.json +1 -1
  40. package/dist/dynamic/components/JumpLinks/package.json +1 -1
  41. package/dist/dynamic/components/Label/package.json +1 -1
  42. package/dist/dynamic/components/List/package.json +1 -1
  43. package/dist/dynamic/components/LoginPage/package.json +1 -1
  44. package/dist/dynamic/components/Masthead/package.json +1 -1
  45. package/dist/dynamic/components/Menu/package.json +1 -1
  46. package/dist/dynamic/components/MenuToggle/package.json +1 -1
  47. package/dist/dynamic/components/Modal/package.json +1 -1
  48. package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
  49. package/dist/dynamic/components/Nav/package.json +1 -1
  50. package/dist/dynamic/components/NotificationBadge/package.json +1 -1
  51. package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
  52. package/dist/dynamic/components/NumberInput/package.json +1 -1
  53. package/dist/dynamic/components/OverflowMenu/package.json +1 -1
  54. package/dist/dynamic/components/Page/package.json +1 -1
  55. package/dist/dynamic/components/Pagination/package.json +1 -1
  56. package/dist/dynamic/components/Panel/package.json +1 -1
  57. package/dist/dynamic/components/Popover/package.json +1 -1
  58. package/dist/dynamic/components/Progress/package.json +1 -1
  59. package/dist/dynamic/components/ProgressStepper/package.json +1 -1
  60. package/dist/dynamic/components/Radio/package.json +1 -1
  61. package/dist/dynamic/components/SearchInput/package.json +1 -1
  62. package/dist/dynamic/components/Select/package.json +1 -1
  63. package/dist/dynamic/components/Sidebar/package.json +1 -1
  64. package/dist/dynamic/components/SimpleList/package.json +1 -1
  65. package/dist/dynamic/components/Skeleton/package.json +1 -1
  66. package/dist/dynamic/components/SkipToContent/package.json +1 -1
  67. package/dist/dynamic/components/Slider/package.json +1 -1
  68. package/dist/dynamic/components/Spinner/package.json +1 -1
  69. package/dist/dynamic/components/Switch/package.json +1 -1
  70. package/dist/dynamic/components/Tabs/package.json +1 -1
  71. package/dist/dynamic/components/Text/package.json +1 -1
  72. package/dist/dynamic/components/TextArea/package.json +1 -1
  73. package/dist/dynamic/components/TextInput/package.json +1 -1
  74. package/dist/dynamic/components/TextInputGroup/package.json +1 -1
  75. package/dist/dynamic/components/Tile/package.json +1 -1
  76. package/dist/dynamic/components/TimePicker/package.json +1 -1
  77. package/dist/dynamic/components/Timestamp/package.json +1 -1
  78. package/dist/dynamic/components/Title/package.json +1 -1
  79. package/dist/dynamic/components/ToggleGroup/package.json +1 -1
  80. package/dist/dynamic/components/Toolbar/package.json +1 -1
  81. package/dist/dynamic/components/Tooltip/package.json +1 -1
  82. package/dist/dynamic/components/TreeView/package.json +1 -1
  83. package/dist/dynamic/components/Truncate/package.json +1 -1
  84. package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
  85. package/dist/dynamic/components/Wizard/package.json +1 -1
  86. package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
  87. package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
  88. package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
  89. package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
  90. package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
  91. package/dist/dynamic/deprecated/components/Select/package.json +1 -1
  92. package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
  93. package/dist/dynamic/deprecated/components/package.json +1 -1
  94. package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
  95. package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
  96. package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
  97. package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
  98. package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
  99. package/dist/dynamic/helpers/constants/package.json +1 -1
  100. package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
  101. package/dist/dynamic/helpers/favorites/package.json +1 -1
  102. package/dist/dynamic/helpers/fileUtils/package.json +1 -1
  103. package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
  104. package/dist/dynamic/helpers/package.json +1 -1
  105. package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
  106. package/dist/dynamic/helpers/typeUtils/package.json +1 -1
  107. package/dist/dynamic/helpers/useInterval/package.json +1 -1
  108. package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
  109. package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
  110. package/dist/dynamic/helpers/util/package.json +1 -1
  111. package/dist/dynamic/layouts/Bullseye/package.json +1 -1
  112. package/dist/dynamic/layouts/Flex/package.json +1 -1
  113. package/dist/dynamic/layouts/Gallery/package.json +1 -1
  114. package/dist/dynamic/layouts/Grid/package.json +1 -1
  115. package/dist/dynamic/layouts/Level/package.json +1 -1
  116. package/dist/dynamic/layouts/Split/package.json +1 -1
  117. package/dist/dynamic/layouts/Stack/package.json +1 -1
  118. package/dist/dynamic/next/components/package.json +1 -1
  119. package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
  120. package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +1 -1
  121. package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
  122. package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js +1 -1
  123. package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
  124. package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.d.ts.map +1 -1
  125. package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js +5 -2
  126. package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
  127. package/dist/esm/components/Drawer/Drawer.d.ts +3 -3
  128. package/dist/esm/components/Drawer/Drawer.d.ts.map +1 -1
  129. package/dist/esm/components/Drawer/Drawer.js +3 -3
  130. package/dist/esm/components/Drawer/Drawer.js.map +1 -1
  131. package/dist/esm/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
  132. package/dist/esm/components/Drawer/DrawerPanelContent.js +77 -26
  133. package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
  134. package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
  135. package/dist/esm/components/Modal/ModalContent.js +3 -1
  136. package/dist/esm/components/Modal/ModalContent.js.map +1 -1
  137. package/dist/esm/components/Slider/SliderStep.d.ts.map +1 -1
  138. package/dist/esm/components/Slider/SliderStep.js +2 -1
  139. package/dist/esm/components/Slider/SliderStep.js.map +1 -1
  140. package/dist/esm/components/TextInput/TextInput.d.ts +3 -1
  141. package/dist/esm/components/TextInput/TextInput.d.ts.map +1 -1
  142. package/dist/esm/components/TextInput/TextInput.js +8 -7
  143. package/dist/esm/components/TextInput/TextInput.js.map +1 -1
  144. package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
  145. package/dist/js/components/ClipboardCopy/ClipboardCopy.js +1 -1
  146. package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
  147. package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.js +1 -1
  148. package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
  149. package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.d.ts.map +1 -1
  150. package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js +5 -2
  151. package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
  152. package/dist/js/components/Drawer/Drawer.d.ts +3 -3
  153. package/dist/js/components/Drawer/Drawer.d.ts.map +1 -1
  154. package/dist/js/components/Drawer/Drawer.js +3 -3
  155. package/dist/js/components/Drawer/Drawer.js.map +1 -1
  156. package/dist/js/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
  157. package/dist/js/components/Drawer/DrawerPanelContent.js +77 -26
  158. package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
  159. package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
  160. package/dist/js/components/Modal/ModalContent.js +3 -1
  161. package/dist/js/components/Modal/ModalContent.js.map +1 -1
  162. package/dist/js/components/Slider/SliderStep.d.ts.map +1 -1
  163. package/dist/js/components/Slider/SliderStep.js +2 -1
  164. package/dist/js/components/Slider/SliderStep.js.map +1 -1
  165. package/dist/js/components/TextInput/TextInput.d.ts +3 -1
  166. package/dist/js/components/TextInput/TextInput.d.ts.map +1 -1
  167. package/dist/js/components/TextInput/TextInput.js +8 -7
  168. package/dist/js/components/TextInput/TextInput.js.map +1 -1
  169. package/dist/umd/react-core.min.js +3 -3
  170. package/helpers/package.json +1 -1
  171. package/layouts/package.json +1 -1
  172. package/next/package.json +1 -1
  173. package/package.json +2 -2
  174. package/src/components/Checkbox/examples/Checkbox.md +8 -2
  175. package/src/components/Checkbox/examples/CheckboxControlled.tsx +18 -16
  176. package/src/components/ClipboardCopy/ClipboardCopy.tsx +1 -0
  177. package/src/components/ClipboardCopy/ClipboardCopyExpanded.tsx +1 -1
  178. package/src/components/ClipboardCopy/ClipboardCopyToggle.tsx +5 -2
  179. package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyExpanded.test.tsx.snap +3 -1
  180. package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap +16 -12
  181. package/src/components/Drawer/Drawer.tsx +6 -6
  182. package/src/components/Drawer/DrawerPanelContent.tsx +72 -26
  183. package/src/components/Drawer/examples/Drawer.md +12 -12
  184. package/src/components/Drawer/examples/{DrawerInlinePanelRight.tsx → DrawerInlinePanelEnd.tsx} +1 -1
  185. package/src/components/Drawer/examples/{DrawerInlinePanelLeft.tsx → DrawerInlinePanelStart.tsx} +2 -2
  186. package/src/components/Drawer/examples/{DrawerPanelLeft.tsx → DrawerPanelEnd.tsx} +2 -2
  187. package/src/components/Drawer/examples/{DrawerPanelRight.tsx → DrawerPanelStart.tsx} +2 -2
  188. package/src/components/Drawer/examples/{DrawerResizableOnRight.tsx → DrawerResizableAtEnd.tsx} +3 -3
  189. package/src/components/Drawer/examples/{DrawerResizableOnLeft.tsx → DrawerResizableAtStart.tsx} +2 -2
  190. package/src/components/Modal/ModalContent.tsx +4 -6
  191. package/src/components/Slider/SliderStep.tsx +2 -1
  192. package/src/components/TextInput/TextInput.tsx +11 -7
  193. package/src/components/TextInput/__tests__/TextInput.test.tsx +16 -1
  194. package/src/components/TextInput/__tests__/__snapshots__/TextInput.test.tsx.snap +2 -1
  195. package/src/components/TextInput/examples/TextInput.md +2 -2
  196. package/src/components/TextInput/examples/{TextInputLeftTruncated.tsx → TextInputStartTruncated.tsx} +3 -3
  197. package/src/demos/DataListDemo.md +7 -4
  198. package/src/components/Checkbox/examples/checkbox.css +0 -3
@@ -1 +1 @@
1
- {"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"5.1.1-prerelease.11","private":true}
1
+ {"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"5.1.1-prerelease.13","private":true}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"5.1.1-prerelease.11","private":true}
1
+ {"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"5.1.1-prerelease.13","private":true}
package/next/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"5.1.1-prerelease.11","private":true}
1
+ {"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"5.1.1-prerelease.13","private":true}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "5.1.1-prerelease.12",
3
+ "version": "5.1.1-prerelease.14",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -70,5 +70,5 @@
70
70
  "react": "^17 || ^18",
71
71
  "react-dom": "^17 || ^18"
72
72
  },
73
- "gitHead": "f856af105070fec983e76afa262b37aa99737e63"
73
+ "gitHead": "e27aac2f35e0a8bb16fa5397eb5ef841b3ecc578"
74
74
  }
@@ -6,46 +6,52 @@ cssPrefix: pf-v5-c-check
6
6
  propComponents: ['Checkbox']
7
7
  ---
8
8
 
9
- import './checkbox.css';
10
-
11
9
  ## Examples
12
10
 
13
11
  ### Controlled
14
12
 
15
13
  ```ts file='./CheckboxControlled.tsx'
14
+
16
15
  ```
17
16
 
18
17
  ### Uncontrolled
19
18
 
20
19
  ```ts file='./CheckboxUncontrolled.tsx'
20
+
21
21
  ```
22
22
 
23
23
  ### Disabled
24
24
 
25
25
  ```ts file='./CheckboxDisabled.tsx'
26
+
26
27
  ```
27
28
 
28
29
  ### Checkbox with description
29
30
 
30
31
  ```ts file='./CheckboxWithDescription.tsx'
32
+
31
33
  ```
32
34
 
33
35
  ### Checkbox with body
34
36
 
35
37
  ```ts file='./CheckboxWithBody.tsx'
38
+
36
39
  ```
37
40
 
38
41
  ### Checkbox with description and body
39
42
 
40
43
  ```ts file='./CheckboxWithDescriptionBody.tsx'
44
+
41
45
  ```
42
46
 
43
47
  ### Standalone input
44
48
 
45
49
  ```ts file='./CheckboxStandaloneInput.tsx'
50
+
46
51
  ```
47
52
 
48
53
  ### Required input
49
54
 
50
55
  ```ts file='./CheckboxRequired.tsx'
56
+
51
57
  ```
@@ -49,22 +49,24 @@ export const CheckboxControlled: React.FunctionComponent = () => {
49
49
  onChange={handleChange}
50
50
  id="controlled-check-1"
51
51
  name="check1"
52
- />
53
- <Checkbox
54
- className="nested"
55
- label="Child CheckBox 1"
56
- isChecked={isChecked2}
57
- onChange={handleChange}
58
- id="controlled-check-2"
59
- name="check2"
60
- />
61
- <Checkbox
62
- className="nested"
63
- label="Child CheckBox 2"
64
- isChecked={isChecked3}
65
- onChange={handleChange}
66
- id="controlled-check-3"
67
- name="check3"
52
+ body={
53
+ <>
54
+ <Checkbox
55
+ label="Child CheckBox 1"
56
+ isChecked={isChecked2}
57
+ onChange={handleChange}
58
+ id="controlled-check-2"
59
+ name="check2"
60
+ />
61
+ <Checkbox
62
+ label="Child CheckBox 2"
63
+ isChecked={isChecked3}
64
+ onChange={handleChange}
65
+ id="controlled-check-3"
66
+ name="check3"
67
+ />
68
+ </>
69
+ }
68
70
  />
69
71
  <Checkbox
70
72
  label="Controlled CheckBox"
@@ -242,6 +242,7 @@ class ClipboardCopy extends React.Component<ClipboardCopyProps, ClipboardCopySta
242
242
  value={this.state.text as string | number}
243
243
  id={`text-input-${id}`}
244
244
  aria-label={textAriaLabel}
245
+ {...(isCode && { dir: 'ltr' })}
245
246
  />
246
247
  <ClipboardCopyButton
247
248
  exitDelay={exitDelay}
@@ -36,7 +36,7 @@ class ClipboardCopyExpanded extends React.Component<ClipboardCopyExpandedProps>
36
36
  contentEditable={!isReadOnly}
37
37
  {...props}
38
38
  >
39
- {isCode ? <pre>{children}</pre> : children}
39
+ {isCode ? <pre dir="ltr">{children}</pre> : children}
40
40
  </div>
41
41
  );
42
42
  }
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
+ import styles from '@patternfly/react-styles/css/components/ClipboardCopy/clipboard-copy';
3
+ import { css } from '@patternfly/react-styles';
2
4
  import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
3
- import AngleDownIcon from '@patternfly/react-icons/dist/esm/icons/angle-down-icon';
4
5
  import { Button } from '../Button';
5
6
 
6
7
  export interface ClipboardCopyToggleProps
@@ -31,7 +32,9 @@ export const ClipboardCopyToggle: React.FunctionComponent<ClipboardCopyTogglePro
31
32
  aria-expanded={isExpanded}
32
33
  {...props}
33
34
  >
34
- {isExpanded ? <AngleDownIcon aria-hidden="true" /> : <AngleRightIcon aria-hidden="true" />}
35
+ <div className={css(styles.clipboardCopyToggleIcon)}>
36
+ <AngleRightIcon aria-hidden="true" />
37
+ </div>
35
38
  </Button>
36
39
  );
37
40
  ClipboardCopyToggle.displayName = 'ClipboardCopyToggle';
@@ -7,7 +7,9 @@ exports[`expanded code content render 1`] = `
7
7
  contenteditable="true"
8
8
  id="id-1"
9
9
  >
10
- <pre>
10
+ <pre
11
+ dir="ltr"
12
+ >
11
13
  {
12
14
  "name": "@patternfly/react-core",
13
15
  "version": "1.33.2"
@@ -15,19 +15,23 @@ exports[`ClipboardCopyToggle toggle button render 1`] = `
15
15
  id="my-id"
16
16
  type="button"
17
17
  >
18
- <svg
19
- aria-hidden="true"
20
- class="pf-v5-svg"
21
- fill="currentColor"
22
- height="1em"
23
- role="img"
24
- viewBox="0 0 256 512"
25
- width="1em"
18
+ <div
19
+ class="pf-v5-c-clipboard-copy__toggle-icon"
26
20
  >
27
- <path
28
- d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
29
- />
30
- </svg>
21
+ <svg
22
+ aria-hidden="true"
23
+ class="pf-v5-svg"
24
+ fill="currentColor"
25
+ height="1em"
26
+ role="img"
27
+ viewBox="0 0 256 512"
28
+ width="1em"
29
+ >
30
+ <path
31
+ d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
32
+ />
33
+ </svg>
34
+ </div>
31
35
  </button>
32
36
  </DocumentFragment>
33
37
  `;
@@ -11,7 +11,7 @@ export enum DrawerColorVariant {
11
11
  export interface DrawerProps extends React.HTMLProps<HTMLDivElement> {
12
12
  /** Additional classes added to the Drawer. */
13
13
  className?: string;
14
- /** Content rendered in the left hand panel */
14
+ /** Content rendered in the drawer panel */
15
15
  children?: React.ReactNode;
16
16
  /** Indicates if the drawer is expanded */
17
17
  isExpanded?: boolean;
@@ -19,8 +19,8 @@ export interface DrawerProps extends React.HTMLProps<HTMLDivElement> {
19
19
  isInline?: boolean;
20
20
  /** Indicates if the drawer will always show both content and panel. */
21
21
  isStatic?: boolean;
22
- /** Position of the drawer panel */
23
- position?: 'left' | 'right' | 'bottom';
22
+ /** Position of the drawer panel. left and right are deprecated, use start and end instead. */
23
+ position?: 'start' | 'end' | 'bottom' | 'left' | 'right';
24
24
  /** Callback when drawer panel is expanded after waiting 250ms for animation to complete. */
25
25
  onExpand?: (event: KeyboardEvent | React.MouseEvent | React.TransitionEvent) => void;
26
26
  }
@@ -39,7 +39,7 @@ export const DrawerContext = React.createContext<Partial<DrawerContextProps>>({
39
39
  isExpanded: false,
40
40
  isStatic: false,
41
41
  onExpand: () => {},
42
- position: 'right',
42
+ position: 'end',
43
43
  drawerRef: null,
44
44
  drawerContentRef: null,
45
45
  isInline: false
@@ -51,7 +51,7 @@ export const Drawer: React.FunctionComponent<DrawerProps> = ({
51
51
  isExpanded = false,
52
52
  isInline = false,
53
53
  isStatic = false,
54
- position = 'right',
54
+ position = 'end',
55
55
  onExpand = () => {},
56
56
  ...props
57
57
  }: DrawerProps) => {
@@ -66,7 +66,7 @@ export const Drawer: React.FunctionComponent<DrawerProps> = ({
66
66
  isExpanded && styles.modifiers.expanded,
67
67
  isInline && styles.modifiers.inline,
68
68
  isStatic && styles.modifiers.static,
69
- position === 'left' && styles.modifiers.panelLeft,
69
+ (position === 'left' || position === 'start') && styles.modifiers.panelLeft,
70
70
  position === 'bottom' && styles.modifiers.panelBottom,
71
71
  className
72
72
  )}
@@ -87,8 +87,8 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
87
87
  const previouslyFocusedElement = React.useRef(null);
88
88
  let currWidth: number = 0;
89
89
  let panelRect: DOMRect;
90
- let right: number;
91
- let left: number;
90
+ let end: number;
91
+ let start: number;
92
92
  let bottom: number;
93
93
  let setInitialVals: boolean = true;
94
94
 
@@ -108,23 +108,52 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
108
108
  const calcValueNow = () => {
109
109
  let splitterPos;
110
110
  let drawerSize;
111
+ const isRTL = window.getComputedStyle(panel.current).getPropertyValue('direction') === 'rtl';
111
112
 
112
- if (isInline && position === 'right') {
113
- splitterPos = panel.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
114
- drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
115
- } else if (isInline && position === 'left') {
116
- splitterPos = splitterRef.current.getBoundingClientRect().right - panel.current.getBoundingClientRect().left;
117
- drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
118
- } else if (position === 'right') {
119
- splitterPos =
120
- drawerContentRef.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
121
- drawerSize =
122
- drawerContentRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
123
- } else if (position === 'left') {
124
- splitterPos =
125
- splitterRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
126
- drawerSize =
127
- drawerContentRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
113
+ if (isInline && (position === 'end' || position === 'right')) {
114
+ if (isRTL) {
115
+ splitterPos = panel.current.getBoundingClientRect().left - splitterRef.current.getBoundingClientRect().right;
116
+ drawerSize = drawerRef.current.getBoundingClientRect().left - drawerRef.current.getBoundingClientRect().right;
117
+ } else {
118
+ splitterPos = panel.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
119
+ drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
120
+ }
121
+ } else if (isInline && (position === 'start' || position === 'left')) {
122
+ if (isRTL) {
123
+ splitterPos = splitterRef.current.getBoundingClientRect().left - panel.current.getBoundingClientRect().right;
124
+ drawerSize = drawerRef.current.getBoundingClientRect().left - drawerRef.current.getBoundingClientRect().right;
125
+ } else {
126
+ splitterPos = splitterRef.current.getBoundingClientRect().right - panel.current.getBoundingClientRect().left;
127
+ drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
128
+ }
129
+ } else if (position === 'end' || position === 'right') {
130
+ if (isRTL) {
131
+ splitterPos =
132
+ drawerContentRef.current.getBoundingClientRect().left - splitterRef.current.getBoundingClientRect().right;
133
+ drawerSize =
134
+ drawerContentRef.current.getBoundingClientRect().left -
135
+ drawerContentRef.current.getBoundingClientRect().right;
136
+ } else {
137
+ splitterPos =
138
+ drawerContentRef.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
139
+ drawerSize =
140
+ drawerContentRef.current.getBoundingClientRect().right -
141
+ drawerContentRef.current.getBoundingClientRect().left;
142
+ }
143
+ } else if (position === 'start' || position === 'left') {
144
+ if (isRTL) {
145
+ splitterPos =
146
+ splitterRef.current.getBoundingClientRect().left - drawerContentRef.current.getBoundingClientRect().right;
147
+ drawerSize =
148
+ drawerContentRef.current.getBoundingClientRect().left -
149
+ drawerContentRef.current.getBoundingClientRect().right;
150
+ } else {
151
+ splitterPos =
152
+ splitterRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
153
+ drawerSize =
154
+ drawerContentRef.current.getBoundingClientRect().right -
155
+ drawerContentRef.current.getBoundingClientRect().left;
156
+ }
128
157
  } else if (position === 'bottom') {
129
158
  splitterPos =
130
159
  drawerContentRef.current.getBoundingClientRect().bottom - splitterRef.current.getBoundingClientRect().top;
@@ -166,6 +195,8 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
166
195
  };
167
196
 
168
197
  const handleControlMove = (e: MouseEvent | TouchEvent, controlPosition: number) => {
198
+ const isRTL = window.getComputedStyle(panel.current).getPropertyValue('direction') === 'rtl';
199
+
169
200
  e.stopPropagation();
170
201
  if (!isResizing) {
171
202
  return;
@@ -173,17 +204,22 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
173
204
 
174
205
  if (setInitialVals) {
175
206
  panelRect = panel.current.getBoundingClientRect();
176
- right = panelRect.right;
177
- left = panelRect.left;
207
+ if (isRTL) {
208
+ start = panelRect.right;
209
+ end = panelRect.left;
210
+ } else {
211
+ end = panelRect.right;
212
+ start = panelRect.left;
213
+ }
178
214
  bottom = panelRect.bottom;
179
215
  setInitialVals = false;
180
216
  }
181
217
  const mousePos = controlPosition;
182
218
  let newSize = 0;
183
- if (position === 'right') {
184
- newSize = right - mousePos;
185
- } else if (position === 'left') {
186
- newSize = mousePos - left;
219
+ if (position === 'end' || position === 'right') {
220
+ newSize = isRTL ? mousePos - end : end - mousePos;
221
+ } else if (position === 'start' || position === 'left') {
222
+ newSize = isRTL ? start - mousePos : mousePos - start;
187
223
  } else {
188
224
  newSize = bottom - mousePos;
189
225
  }
@@ -225,6 +261,8 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
225
261
  const callbackMouseUp = React.useCallback(handleMouseup, []);
226
262
 
227
263
  const handleKeys = (e: React.KeyboardEvent) => {
264
+ const isRTL = window.getComputedStyle(panel.current).getPropertyValue('direction') === 'rtl';
265
+
228
266
  const key = e.key;
229
267
  if (
230
268
  key !== 'Escape' &&
@@ -248,9 +286,17 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
248
286
  newSize = position === 'bottom' ? panelRect.height : panelRect.width;
249
287
  let delta = 0;
250
288
  if (key === 'ArrowRight') {
251
- delta = position === 'left' ? increment : -increment;
289
+ if (isRTL) {
290
+ delta = position === 'left' || position === 'start' ? -increment : increment;
291
+ } else {
292
+ delta = position === 'left' || position === 'start' ? increment : -increment;
293
+ }
252
294
  } else if (key === 'ArrowLeft') {
253
- delta = position === 'left' ? -increment : increment;
295
+ if (isRTL) {
296
+ delta = position === 'left' || position === 'start' ? increment : -increment;
297
+ } else {
298
+ delta = position === 'left' || position === 'start' ? -increment : increment;
299
+ }
254
300
  } else if (key === 'ArrowUp') {
255
301
  delta = increment;
256
302
  } else if (key === 'ArrowDown') {
@@ -26,15 +26,15 @@ section: components
26
26
 
27
27
  ```
28
28
 
29
- ### Panel on right
29
+ ### Panel at end
30
30
 
31
- ```ts file="./DrawerPanelRight.tsx"
31
+ ```ts file="./DrawerPanelEnd.tsx"
32
32
 
33
33
  ```
34
34
 
35
- ### Panel on left
35
+ ### Panel at start
36
36
 
37
- ```ts file="./DrawerPanelLeft.tsx"
37
+ ```ts file="./DrawerPanelStart.tsx"
38
38
 
39
39
  ```
40
40
 
@@ -50,15 +50,15 @@ section: components
50
50
 
51
51
  ```
52
52
 
53
- ### Inline panel on right
53
+ ### Inline panel at end
54
54
 
55
- ```ts file="./DrawerInlinePanelRight.tsx"
55
+ ```ts file="./DrawerInlinePanelEnd.tsx"
56
56
 
57
57
  ```
58
58
 
59
- ### Inline panel on left
59
+ ### Inline panel at start
60
60
 
61
- ```ts file="./DrawerInlinePanelLeft.tsx"
61
+ ```ts file="./DrawerInlinePanelStart.tsx"
62
62
 
63
63
  ```
64
64
 
@@ -100,15 +100,15 @@ section: components
100
100
 
101
101
  ```
102
102
 
103
- ### Resizable on right
103
+ ### Resizable at end
104
104
 
105
- ```ts file="DrawerResizableOnRight.tsx"
105
+ ```ts file="DrawerResizableAtEnd.tsx"
106
106
 
107
107
  ```
108
108
 
109
- ### Resizable on left
109
+ ### Resizable at start
110
110
 
111
- ```ts file="DrawerResizableOnLeft.tsx"
111
+ ```ts file="DrawerResizableAtStart.tsx"
112
112
 
113
113
  ```
114
114
 
@@ -10,7 +10,7 @@ import {
10
10
  Button
11
11
  } from '@patternfly/react-core';
12
12
 
13
- export const DrawerInlinePanelRight: React.FunctionComponent = () => {
13
+ export const DrawerInlinePanelEnd: React.FunctionComponent = () => {
14
14
  const [isExpanded, setIsExpanded] = React.useState(false);
15
15
  const drawerRef = React.useRef<HTMLDivElement>();
16
16
 
@@ -10,7 +10,7 @@ import {
10
10
  Button
11
11
  } from '@patternfly/react-core';
12
12
 
13
- export const DrawerInlinePanelLeft: React.FunctionComponent = () => {
13
+ export const DrawerInlinePanelStart: React.FunctionComponent = () => {
14
14
  const [isExpanded, setIsExpanded] = React.useState(false);
15
15
  const drawerRef = React.useRef<HTMLDivElement>();
16
16
 
@@ -47,7 +47,7 @@ export const DrawerInlinePanelLeft: React.FunctionComponent = () => {
47
47
  <Button aria-expanded={isExpanded} onClick={onClick}>
48
48
  Toggle drawer
49
49
  </Button>
50
- <Drawer isExpanded={isExpanded} isInline position="left" onExpand={onExpand}>
50
+ <Drawer isExpanded={isExpanded} isInline position="start" onExpand={onExpand}>
51
51
  <DrawerContent panelContent={panelContent}>
52
52
  <DrawerContentBody>{drawerContent}</DrawerContentBody>
53
53
  </DrawerContent>
@@ -10,7 +10,7 @@ import {
10
10
  Button
11
11
  } from '@patternfly/react-core';
12
12
 
13
- export const DrawerPanelLeft: React.FunctionComponent = () => {
13
+ export const DrawerPanelEnd: React.FunctionComponent = () => {
14
14
  const [isExpanded, setIsExpanded] = React.useState(false);
15
15
  const drawerRef = React.useRef<HTMLDivElement>();
16
16
 
@@ -47,7 +47,7 @@ export const DrawerPanelLeft: React.FunctionComponent = () => {
47
47
  <Button aria-expanded={isExpanded} onClick={onClick}>
48
48
  Toggle drawer
49
49
  </Button>
50
- <Drawer isExpanded={isExpanded} position="left" onExpand={onExpand}>
50
+ <Drawer isExpanded={isExpanded} position="end" onExpand={onExpand}>
51
51
  <DrawerContent panelContent={panelContent}>
52
52
  <DrawerContentBody>{drawerContent}</DrawerContentBody>
53
53
  </DrawerContent>
@@ -10,7 +10,7 @@ import {
10
10
  Button
11
11
  } from '@patternfly/react-core';
12
12
 
13
- export const DrawerPanelRight: React.FunctionComponent = () => {
13
+ export const DrawerPanelStart: React.FunctionComponent = () => {
14
14
  const [isExpanded, setIsExpanded] = React.useState(false);
15
15
  const drawerRef = React.useRef<HTMLDivElement>();
16
16
 
@@ -47,7 +47,7 @@ export const DrawerPanelRight: React.FunctionComponent = () => {
47
47
  <Button aria-expanded={isExpanded} onClick={onClick}>
48
48
  Toggle drawer
49
49
  </Button>
50
- <Drawer isExpanded={isExpanded} position="right" onExpand={onExpand}>
50
+ <Drawer isExpanded={isExpanded} position="start" onExpand={onExpand}>
51
51
  <DrawerContent panelContent={panelContent}>
52
52
  <DrawerContentBody>{drawerContent}</DrawerContentBody>
53
53
  </DrawerContent>
@@ -10,7 +10,7 @@ import {
10
10
  Button
11
11
  } from '@patternfly/react-core';
12
12
 
13
- export const DrawerResizableOnRight: React.FunctionComponent = () => {
13
+ export const DrawerResizableAtEnd: React.FunctionComponent = () => {
14
14
  const [isExpanded, setIsExpanded] = React.useState(false);
15
15
  const drawerRef = React.useRef<HTMLDivElement>();
16
16
 
@@ -32,7 +32,7 @@ export const DrawerResizableOnRight: React.FunctionComponent = () => {
32
32
  };
33
33
 
34
34
  const panelContent = (
35
- <DrawerPanelContent isResizable onResize={onResize} id="right-resize-panel" defaultSize={'500px'} minSize={'150px'}>
35
+ <DrawerPanelContent isResizable onResize={onResize} id="end-resize-panel" defaultSize={'500px'} minSize={'150px'}>
36
36
  <DrawerHead>
37
37
  <span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
38
38
  drawer-panel
@@ -52,7 +52,7 @@ export const DrawerResizableOnRight: React.FunctionComponent = () => {
52
52
  <Button aria-expanded={isExpanded} onClick={onClick}>
53
53
  Toggle drawer
54
54
  </Button>
55
- <Drawer isExpanded={isExpanded} onExpand={onExpand} position="right">
55
+ <Drawer isExpanded={isExpanded} onExpand={onExpand} position="end">
56
56
  <DrawerContent panelContent={panelContent}>
57
57
  <DrawerContentBody>{drawerContent}</DrawerContentBody>
58
58
  </DrawerContent>
@@ -10,7 +10,7 @@ import {
10
10
  Button
11
11
  } from '@patternfly/react-core';
12
12
 
13
- export const DrawerResizableOnLeft: React.FunctionComponent = () => {
13
+ export const DrawerResizableAtStart: React.FunctionComponent = () => {
14
14
  const [isExpanded, setIsExpanded] = React.useState(false);
15
15
  const drawerRef = React.useRef<HTMLDivElement>();
16
16
 
@@ -47,7 +47,7 @@ export const DrawerResizableOnLeft: React.FunctionComponent = () => {
47
47
  <Button aria-expanded={isExpanded} onClick={onClick}>
48
48
  Toggle drawer
49
49
  </Button>
50
- <Drawer isExpanded={isExpanded} onExpand={onExpand} position="left">
50
+ <Drawer isExpanded={isExpanded} onExpand={onExpand} position="start">
51
51
  <DrawerContent panelContent={panelContent}>
52
52
  <DrawerContentBody>{drawerContent}</DrawerContentBody>
53
53
  </DrawerContent>
@@ -148,15 +148,13 @@ export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
148
148
 
149
149
  const defaultModalBodyAriaRole = bodyAriaLabel ? 'region' : undefined;
150
150
 
151
+ const hasNoDescription = !description && !ariaDescribedby;
152
+ const id = hasNoDescription ? descriptorId : undefined;
153
+
151
154
  const modalBody = hasNoBodyWrapper ? (
152
155
  children
153
156
  ) : (
154
- <ModalBoxBody
155
- aria-label={bodyAriaLabel}
156
- role={bodyAriaRole || defaultModalBodyAriaRole}
157
- {...props}
158
- {...(!description && !ariaDescribedby && { id: descriptorId })}
159
- >
157
+ <ModalBoxBody aria-label={bodyAriaLabel} role={bodyAriaRole || defaultModalBodyAriaRole} {...props} id={id}>
160
158
  {children}
161
159
  </ModalBoxBody>
162
160
  );
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import styles from '@patternfly/react-styles/css/components/Slider/slider';
3
3
  import { css } from '@patternfly/react-styles';
4
+ import sliderStepLeft from '@patternfly/react-tokens/dist/esm/c_slider__step_Left';
4
5
 
5
6
  export interface SliderStepProps extends Omit<React.HTMLProps<HTMLDivElement>, 'label'> {
6
7
  /** Additional classes added to the slider step. */
@@ -26,7 +27,7 @@ export const SliderStep: React.FunctionComponent<SliderStepProps> = ({
26
27
  isActive = false,
27
28
  ...props
28
29
  }: SliderStepProps) => {
29
- const style = { '--pf-v5-c-slider__step--Left': `${value}%` } as React.CSSProperties;
30
+ const style = { [sliderStepLeft.name]: `${value ? value : sliderStepLeft.value}%` } as React.CSSProperties;
30
31
  return (
31
32
  <div className={css(styles.sliderStep, isActive && styles.modifiers.active, className)} style={style} {...props}>
32
33
  {!isTickHidden && <div className={css(styles.sliderStepTick)} />}