@patternfly/react-core 4.273.0 → 4.273.2
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.
- package/CHANGELOG.md +19 -0
- package/components/Tabs/TabAction.d.ts +0 -2
- package/components/Tabs/TabAction.d.ts.map +1 -1
- package/components/Tabs/TabAction.js +3 -3
- package/components/Tabs/TabAction.js.map +1 -1
- package/dist/esm/components/Tabs/TabAction.d.ts +0 -2
- package/dist/esm/components/Tabs/TabAction.d.ts.map +1 -1
- package/dist/esm/components/Tabs/TabAction.js +3 -3
- package/dist/esm/components/Tabs/TabAction.js.map +1 -1
- package/dist/js/components/Tabs/TabAction.d.ts +0 -2
- package/dist/js/components/Tabs/TabAction.d.ts.map +1 -1
- package/dist/js/components/Tabs/TabAction.js +3 -3
- package/dist/js/components/Tabs/TabAction.js.map +1 -1
- package/dist/styles/assets/pficon/pficon.scss +6 -0
- package/dist/styles/assets/pficon/pficon.woff +0 -0
- package/dist/styles/assets/pficon/pficon.woff2 +0 -0
- package/dist/styles/base-no-reset.css +5 -0
- package/dist/styles/base.css +5 -0
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +6 -6
- package/src/components/Tabs/TabAction.tsx +1 -4
- package/src/components/Tabs/examples/Tabs.md +1 -1
- package/src/components/Tabs/examples/TabsHelp.tsx +0 -1
- package/src/components/Tabs/examples/TabsHelpAndClose.tsx +1 -1
- package/src/next/components/Dropdown/examples/Dropdown.md +18 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.273.
|
|
3
|
+
"version": "4.273.2",
|
|
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",
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
"subpaths": "node scripts/copySubpaths.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@patternfly/react-icons": "^4.93.
|
|
49
|
-
"@patternfly/react-styles": "^4.92.
|
|
50
|
-
"@patternfly/react-tokens": "^4.94.
|
|
48
|
+
"@patternfly/react-icons": "^4.93.4",
|
|
49
|
+
"@patternfly/react-styles": "^4.92.4",
|
|
50
|
+
"@patternfly/react-tokens": "^4.94.4",
|
|
51
51
|
"focus-trap": "6.9.2",
|
|
52
52
|
"react-dropzone": "9.0.0",
|
|
53
53
|
"tippy.js": "5.1.2",
|
|
54
54
|
"tslib": "^2.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@patternfly/patternfly": "4.
|
|
57
|
+
"@patternfly/patternfly": "4.224.0",
|
|
58
58
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
59
59
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
60
60
|
"@rollup/plugin-replace": "^3.0.0",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react": "^16.8 || ^17 || ^18",
|
|
72
72
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "f4d6511036d4a2a16d2ddae15a23fa80188dfc22"
|
|
75
75
|
}
|
|
@@ -11,8 +11,6 @@ export interface TabActionProps extends Omit<React.HTMLProps<HTMLButtonElement>,
|
|
|
11
11
|
className?: string;
|
|
12
12
|
/** Click callback for tab action button */
|
|
13
13
|
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
14
|
-
/** Flag indicating if the tab action is a help action */
|
|
15
|
-
isHelpAction?: boolean;
|
|
16
14
|
/** Flag indicating if the tab action is disabled */
|
|
17
15
|
isDisabled?: boolean;
|
|
18
16
|
/** Accessible label for the tab action */
|
|
@@ -25,7 +23,6 @@ const TabActionBase: React.FunctionComponent<TabActionProps> = ({
|
|
|
25
23
|
children,
|
|
26
24
|
className,
|
|
27
25
|
onClick,
|
|
28
|
-
isHelpAction,
|
|
29
26
|
isDisabled,
|
|
30
27
|
'aria-label': ariaLabel = 'Tab action',
|
|
31
28
|
innerRef,
|
|
@@ -34,7 +31,7 @@ const TabActionBase: React.FunctionComponent<TabActionProps> = ({
|
|
|
34
31
|
ouiaSafe,
|
|
35
32
|
...props
|
|
36
33
|
}: TabActionProps) => (
|
|
37
|
-
<span className={css(styles.tabsItemAction,
|
|
34
|
+
<span className={css(styles.tabsItemAction, className)}>
|
|
38
35
|
<Button
|
|
39
36
|
ref={innerRef}
|
|
40
37
|
type="button"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
id: Tabs
|
|
3
3
|
section: components
|
|
4
4
|
cssPrefix: pf-c-tabs
|
|
5
|
-
propComponents: ['Tabs', 'Tab', 'TabContent', 'TabTitleText', 'TabTitleIcon', 'horizontalOverflowObject']
|
|
5
|
+
propComponents: ['Tabs', 'Tab', TabAction, 'TabContent', 'TabTitleText', 'TabTitleIcon', 'horizontalOverflowObject']
|
|
6
6
|
ouia: true
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -65,7 +65,7 @@ export const TabsHelpAndClose: React.FunctionComponent = () => {
|
|
|
65
65
|
title={<TabTitleText>{tab}</TabTitleText>}
|
|
66
66
|
actions={
|
|
67
67
|
<>
|
|
68
|
-
<TabAction
|
|
68
|
+
<TabAction aria-label={`Help for ${tab}`} ref={ref}>
|
|
69
69
|
<HelpIcon />
|
|
70
70
|
</TabAction>
|
|
71
71
|
<TabAction aria-label={`Close ${tab}`} onClick={e => onClose(e, index)} isDisabled={tabs.length === 1}>
|
|
@@ -10,22 +10,36 @@ import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-ico
|
|
|
10
10
|
|
|
11
11
|
## Examples
|
|
12
12
|
|
|
13
|
-
### Basic
|
|
13
|
+
### Basic dropdowns
|
|
14
|
+
Basic dropdowns present users with a menu of items upon clicking a dropdown toggle.
|
|
15
|
+
|
|
16
|
+
A `<Dropdown>` uses a [menu toggle](/components/menu-toggle), which is passed to the `toggle` property, as well as a `<DropdownList>` with multiple `<DropdownItem>` components. To allow a dropdown to change the open state of the menu, pass the `isOpen` property into the `onOpenChange` callback.
|
|
17
|
+
|
|
18
|
+
The following example shows a few different states of dropdown items. As shown in this example, dropdown items may:
|
|
19
|
+
- Use the `isDisabled` property to disable an item.
|
|
20
|
+
- Use the `onClick` property to trigger a callback for an action.
|
|
21
|
+
|
|
22
|
+
This example also uses a `<Divider>` which passes in `key=”separator”` to split the menu into 2 sections with a horizontal line.
|
|
14
23
|
|
|
15
24
|
```ts file="./DropdownBasic.tsx"
|
|
16
25
|
```
|
|
17
26
|
|
|
18
27
|
### With kebab toggle
|
|
19
28
|
|
|
29
|
+
To style a dropdown menu's toggle with a kebab icon, pass a "plain" `<MenuToggle>` to the `toggle` property. When there isn't enough space for a labeled button, a kebab icon can be used to toggle the dropdown menu open or closed.
|
|
30
|
+
|
|
20
31
|
```ts file="./DropdownWithKebabToggle.tsx"
|
|
21
32
|
```
|
|
22
33
|
|
|
23
|
-
### With groups
|
|
34
|
+
### With groups of items
|
|
35
|
+
To group sets of related dropdown items together, use a `<DropdownGroup>`. When more than 1 `<DropdownGroup>` is created in a menu, use the `label` and `labelHeadingLevel` properties to assign a name and heading level to each group.
|
|
24
36
|
|
|
25
37
|
```ts file="./DropdownWithGroups.tsx"
|
|
26
38
|
```
|
|
27
39
|
|
|
28
|
-
### With descriptions
|
|
40
|
+
### With item descriptions
|
|
41
|
+
|
|
42
|
+
To provide users with more context about a `<DropdownItem>`, pass a short message to `description` property. As shown in the example below, an item's description will appear below its label.
|
|
29
43
|
|
|
30
44
|
```ts file="./DropdownWithDescriptions.tsx"
|
|
31
|
-
```
|
|
45
|
+
```
|