@patternfly/react-core 4.234.3 → 4.234.4

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.
@@ -9334,76 +9334,6 @@ label.pf-c-check, .pf-c-check__label,
9334
9334
  --pf-c-helper-text__item-text--m-success--Color: var(--pf-global--success-color--100);
9335
9335
  }
9336
9336
 
9337
- .pf-c-hint {
9338
- --pf-c-hint--GridRowGap: var(--pf-global--spacer--md);
9339
- --pf-c-hint--PaddingTop: var(--pf-global--spacer--lg);
9340
- --pf-c-hint--PaddingRight: var(--pf-global--spacer--lg);
9341
- --pf-c-hint--PaddingBottom: var(--pf-global--spacer--lg);
9342
- --pf-c-hint--PaddingLeft: var(--pf-global--spacer--lg);
9343
- --pf-c-hint--BackgroundColor: var(--pf-global--palette--blue-50);
9344
- --pf-c-hint--BorderColor: var(--pf-global--palette--blue-100);
9345
- --pf-c-hint--BorderWidth: var(--pf-global--BorderWidth--sm);
9346
- --pf-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm);
9347
- --pf-c-hint--Color: var(--pf-global--Color--100);
9348
- --pf-c-hint__title--FontSize: var(--pf-global--FontSize--lg);
9349
- --pf-c-hint__body--FontSize: var(--pf-global--FontSize--md);
9350
- --pf-c-hint__footer--child--MarginRight: var(--pf-global--spacer--md);
9351
- --pf-c-hint__actions--MarginLeft: var(--pf-global--spacer--2xl);
9352
- --pf-c-hint__actions--c-dropdown--MarginTop: calc(var(--pf-global--spacer--form-element) * -1);
9353
- display: grid;
9354
- grid-template-columns: 1fr auto;
9355
- grid-row-gap: var(--pf-c-hint--GridRowGap);
9356
- padding: var(--pf-c-hint--PaddingTop) var(--pf-c-hint--PaddingRight) var(--pf-c-hint--PaddingBottom) var(--pf-c-hint--PaddingLeft);
9357
- color: var(--pf-c-hint--Color);
9358
- background-color: var(--pf-c-hint--BackgroundColor);
9359
- border: var(--pf-c-hint--BorderWidth) solid var(--pf-c-hint--BorderColor);
9360
- box-shadow: var(--pf-c-hint--BoxShadow);
9361
- }
9362
-
9363
- .pf-c-hint .pf-c-button.pf-m-link.pf-m-inline {
9364
- text-align: left;
9365
- white-space: normal;
9366
- }
9367
-
9368
- .pf-c-hint__actions {
9369
- display: inline-grid;
9370
- grid-auto-flow: column;
9371
- margin-left: var(--pf-c-hint__actions--MarginLeft);
9372
- text-align: right;
9373
- grid-column: 2;
9374
- grid-row: 1;
9375
- }
9376
-
9377
- .pf-c-hint__actions .pf-c-dropdown .pf-c-dropdown__toggle.pf-m-plain {
9378
- margin-top: var(--pf-c-hint__actions--c-dropdown--MarginTop);
9379
- }
9380
-
9381
- .pf-c-hint__actions + .pf-c-hint__body {
9382
- grid-column: 1;
9383
- }
9384
-
9385
- .pf-c-hint__title {
9386
- font-size: var(--pf-c-hint__title--FontSize);
9387
- }
9388
-
9389
- .pf-c-hint__body {
9390
- grid-column: 1/-1;
9391
- font-size: var(--pf-c-hint__body--FontSize);
9392
- }
9393
-
9394
- .pf-c-hint__footer {
9395
- grid-column: 1/-1;
9396
- }
9397
-
9398
- .pf-c-hint__footer > :not(:last-child) {
9399
- margin-right: var(--pf-c-hint__footer--child--MarginRight);
9400
- }
9401
-
9402
- :where(.pf-theme-dark) .pf-c-hint {
9403
- --pf-c-hint--BackgroundColor: var(--pf-global--BackgroundColor--400);
9404
- --pf-c-hint--BorderColor: var(--pf-global--BorderColor--300);
9405
- }
9406
-
9407
9337
  .pf-c-input-group {
9408
9338
  --pf-global--Color--100: var(--pf-global--Color--dark-100);
9409
9339
  --pf-global--Color--200: var(--pf-global--Color--dark-200);
@@ -10761,6 +10691,76 @@ button.pf-c-label__content:focus {
10761
10691
  display: none;
10762
10692
  }
10763
10693
 
10694
+ .pf-c-hint {
10695
+ --pf-c-hint--GridRowGap: var(--pf-global--spacer--md);
10696
+ --pf-c-hint--PaddingTop: var(--pf-global--spacer--lg);
10697
+ --pf-c-hint--PaddingRight: var(--pf-global--spacer--lg);
10698
+ --pf-c-hint--PaddingBottom: var(--pf-global--spacer--lg);
10699
+ --pf-c-hint--PaddingLeft: var(--pf-global--spacer--lg);
10700
+ --pf-c-hint--BackgroundColor: var(--pf-global--palette--blue-50);
10701
+ --pf-c-hint--BorderColor: var(--pf-global--palette--blue-100);
10702
+ --pf-c-hint--BorderWidth: var(--pf-global--BorderWidth--sm);
10703
+ --pf-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm);
10704
+ --pf-c-hint--Color: var(--pf-global--Color--100);
10705
+ --pf-c-hint__title--FontSize: var(--pf-global--FontSize--lg);
10706
+ --pf-c-hint__body--FontSize: var(--pf-global--FontSize--md);
10707
+ --pf-c-hint__footer--child--MarginRight: var(--pf-global--spacer--md);
10708
+ --pf-c-hint__actions--MarginLeft: var(--pf-global--spacer--2xl);
10709
+ --pf-c-hint__actions--c-dropdown--MarginTop: calc(var(--pf-global--spacer--form-element) * -1);
10710
+ display: grid;
10711
+ grid-template-columns: 1fr auto;
10712
+ grid-row-gap: var(--pf-c-hint--GridRowGap);
10713
+ padding: var(--pf-c-hint--PaddingTop) var(--pf-c-hint--PaddingRight) var(--pf-c-hint--PaddingBottom) var(--pf-c-hint--PaddingLeft);
10714
+ color: var(--pf-c-hint--Color);
10715
+ background-color: var(--pf-c-hint--BackgroundColor);
10716
+ border: var(--pf-c-hint--BorderWidth) solid var(--pf-c-hint--BorderColor);
10717
+ box-shadow: var(--pf-c-hint--BoxShadow);
10718
+ }
10719
+
10720
+ .pf-c-hint .pf-c-button.pf-m-link.pf-m-inline {
10721
+ text-align: left;
10722
+ white-space: normal;
10723
+ }
10724
+
10725
+ .pf-c-hint__actions {
10726
+ display: inline-grid;
10727
+ grid-auto-flow: column;
10728
+ margin-left: var(--pf-c-hint__actions--MarginLeft);
10729
+ text-align: right;
10730
+ grid-column: 2;
10731
+ grid-row: 1;
10732
+ }
10733
+
10734
+ .pf-c-hint__actions .pf-c-dropdown .pf-c-dropdown__toggle.pf-m-plain {
10735
+ margin-top: var(--pf-c-hint__actions--c-dropdown--MarginTop);
10736
+ }
10737
+
10738
+ .pf-c-hint__actions + .pf-c-hint__body {
10739
+ grid-column: 1;
10740
+ }
10741
+
10742
+ .pf-c-hint__title {
10743
+ font-size: var(--pf-c-hint__title--FontSize);
10744
+ }
10745
+
10746
+ .pf-c-hint__body {
10747
+ grid-column: 1/-1;
10748
+ font-size: var(--pf-c-hint__body--FontSize);
10749
+ }
10750
+
10751
+ .pf-c-hint__footer {
10752
+ grid-column: 1/-1;
10753
+ }
10754
+
10755
+ .pf-c-hint__footer > :not(:last-child) {
10756
+ margin-right: var(--pf-c-hint__footer--child--MarginRight);
10757
+ }
10758
+
10759
+ :where(.pf-theme-dark) .pf-c-hint {
10760
+ --pf-c-hint--BackgroundColor: var(--pf-global--BackgroundColor--400);
10761
+ --pf-c-hint--BorderColor: var(--pf-global--BorderColor--300);
10762
+ }
10763
+
10764
10764
  .pf-c-list {
10765
10765
  --pf-c-list--PaddingLeft: var(--pf-global--spacer--lg);
10766
10766
  --pf-c-list--nested--MarginTop: var(--pf-global--spacer--sm);
@@ -27446,6 +27446,18 @@ label.pf-c-tree-view__node-text {
27446
27446
  grid-gap: var(--pf-l-grid--m-gutter--GridGap);
27447
27447
  }
27448
27448
 
27449
+ .pf-l-level {
27450
+ --pf-l-level--m-gutter--MarginRight: var(--pf-global--gutter);
27451
+ display: flex;
27452
+ flex-wrap: wrap;
27453
+ align-items: center;
27454
+ justify-content: space-between;
27455
+ }
27456
+
27457
+ .pf-l-level.pf-m-gutter > *:not(:last-child) {
27458
+ margin-right: var(--pf-l-level--m-gutter--MarginRight);
27459
+ }
27460
+
27449
27461
  .pf-l-split {
27450
27462
  --pf-l-split--m-gutter--MarginRight: var(--pf-global--gutter);
27451
27463
  display: flex;
@@ -27465,18 +27477,6 @@ label.pf-c-tree-view__node-text {
27465
27477
  margin-right: var(--pf-l-split--m-gutter--MarginRight);
27466
27478
  }
27467
27479
 
27468
- .pf-l-level {
27469
- --pf-l-level--m-gutter--MarginRight: var(--pf-global--gutter);
27470
- display: flex;
27471
- flex-wrap: wrap;
27472
- align-items: center;
27473
- justify-content: space-between;
27474
- }
27475
-
27476
- .pf-l-level.pf-m-gutter > *:not(:last-child) {
27477
- margin-right: var(--pf-l-level--m-gutter--MarginRight);
27478
- }
27479
-
27480
27480
  .pf-l-stack {
27481
27481
  --pf-l-stack--m-gutter--MarginBottom: var(--pf-global--gutter);
27482
27482
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.234.3",
3
+ "version": "4.234.4",
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",
@@ -50,9 +50,9 @@
50
50
  "generate": "node scripts/copyStyles.js"
51
51
  },
52
52
  "dependencies": {
53
- "@patternfly/react-icons": "^4.85.3",
54
- "@patternfly/react-styles": "^4.84.3",
55
- "@patternfly/react-tokens": "^4.86.3",
53
+ "@patternfly/react-icons": "^4.85.4",
54
+ "@patternfly/react-styles": "^4.84.4",
55
+ "@patternfly/react-tokens": "^4.86.4",
56
56
  "focus-trap": "6.9.2",
57
57
  "react-dropzone": "9.0.0",
58
58
  "tippy.js": "5.1.2",
@@ -76,5 +76,5 @@
76
76
  "react": "^16.8.0 || ^17.0.0",
77
77
  "react-dom": "^16.8.0 || ^17.0.0"
78
78
  },
79
- "gitHead": "f996263c7d744850e33d19bacb6fd19d109dc1af"
79
+ "gitHead": "e81e03d5ab610e49b5ce0a3cacaef33f90ae514e"
80
80
  }
@@ -9,101 +9,130 @@ ouia: true
9
9
  import pfLogo from './pfLogo.svg';
10
10
  import pfLogoSmall from './pf-logo-small.svg';
11
11
 
12
- ## Examples
13
12
 
14
- ### Basic
13
+ ## Examples
14
+
15
+ ### Basic cards
16
+
17
+ Basic cards typically have a `<CardTitle>`, `<CardBody>` and `<CardFooter>`. You may omit these components as needed, but it is recommended to at least include a `<CardBody>` to provide details about the card item.
15
18
 
16
19
  ```ts file='./CardBasic.tsx'
17
20
  ```
18
21
 
19
- ### With modifiers
22
+ ### Modifiers
23
+
24
+ You can further modify the styling of the card's content by using the properties outlined below. In this example, you can enable each modifier by selecting its respective checkbox.
25
+
26
+ Most modifiers can be used in combination with each other, except for `isCompact` and `isLarge`, since they are contradictory.
20
27
 
21
28
  ```ts file='./CardWithModifiers.tsx'
22
29
  ```
23
30
 
24
- ### With image and actions
31
+ | Modifier | Description |
32
+ | --- | --- |
33
+ | isCompact | Modifies the card to include compact styling. Should not be used with isLarge. |
34
+ | isFlat | Modifies the card to include flat styling. |
35
+ | isRounded | Modifies the card to include rounded border styling. |
36
+ | isLarge | Modifies the card to be large. Should not be used with isCompact. |
37
+ | isFullHeight | Modifies the card so that it fills the total available height of its container. |
38
+ | isPlain | Modifies the card to include plain styling, which removes the border and background. |
25
39
 
26
- ```ts file='./CardWithImageAndActions.tsx'
27
- ```
28
40
 
29
- ### Header in card head
41
+ ### Header images and actions
30
42
 
31
- ```ts file='./CardHeaderInCardHead.tsx'
32
- ```
43
+ You can include header images within `<CardHeaderMain>` and header actions within `<CardActions>`. The following example includes an image using the [Brand](/components/brand) component, and also includes a kebab dropdown and a checkbox in `<CardActions>`.
33
44
 
34
- ### Only actions in card head (no header/footer)
45
+ `<CardActions>` includes the `hasNoOffset` property, which is `false` by default. When `hasNoOffset` is `false`, a negative margin is applied to help align default-sized card titles with `<CardActions>`.
35
46
 
36
- ```ts file='./CardOnlyActionsInCardHead.tsx'
37
- ```
47
+ You may use `hasNoOffset` to remove this negative margin, which better aligns `<CardActions>` in implementations that use large card titles or tall header images, for example.
38
48
 
39
- ### Only image in card head
49
+ Select the "actions hasNoOffset" checkbox in the example below to illustrate this behavior.
40
50
 
41
- ```ts file='./CardOnlyImageInCardHead.tsx'
51
+ ```ts file='./CardWithImageAndActions.tsx'
42
52
  ```
43
53
 
44
- ### With no footer
54
+ ### Title inline with images and actions
45
55
 
46
- ```ts file='./CardWithNoFooter.tsx'
56
+ Moving `<CardTitle>` within the `<CardHeader>` will style it inline with any images or actions.
57
+
58
+ ```ts file='./CardHeaderInCardHead.tsx'
47
59
  ```
48
60
 
49
- ### With no header
61
+ ### Card header without title
50
62
 
51
- ```ts file='./CardWithNoHeader.tsx'
63
+ `<CardActions>` can be placed in the card header even without a `<CardTitle>`.
64
+
65
+ Images can also be placed in the card header within `<CardHeaderMain>` without a `<CardTitle>`.
66
+
67
+ ```ts file='./CardOnlyActionsInCardHead.tsx'
52
68
  ```
53
69
 
54
- ### With only a body section
70
+ ### With HTML heading element
71
+
72
+ You may use the `component` property to place the card's title within an HTML heading element.
55
73
 
56
- ```ts file='./CardWithOnlyBodySection.tsx'
74
+ ```ts file='./CardWithHeadingElement.tsx'
57
75
  ```
58
76
 
59
77
  ### With multiple body sections
60
78
 
79
+ You may use multiple body sections to visually separate blocks of content.
80
+
61
81
  ```ts file='./CardWithMultipleBodySections.tsx'
62
82
  ```
63
83
 
64
- ### With only a body section that fills
84
+ ### With a primary body section that fills
85
+
86
+ `<CardBody>` sections will fill the available height of the card when `isFilled` equals `{true}`, which is the default value. Set `isFilled` to `{false}` to disable this behavior for one or more body sections. The remaining available height of the card will be split between any `<CardBody>` section that does not set `isFilled` to `{false}`.
87
+
88
+ A common use case of this is to set all but one body section to `isFilled={false}` so that a primary body section fills the available space of the card as seen in the example below. This example has 3 `<CardBody>` sections, two of which set `isFilled` to `{false}`. The third `<CardBody>` fills the remaining height of the card.
65
89
 
66
90
  ```ts file='./CardWithBodySectionFills.tsx'
67
91
  ```
68
92
 
69
- ### Selectable
93
+ ### Selectable cards
94
+
95
+ Selectable cards can only be selected one at a time, and are intended for use with [primary-detail layout](/demos/primary-detail).
70
96
 
71
97
  ```ts file='./CardSelectable.tsx'
72
98
  ```
73
99
 
74
- ### Selectable accessibility highlight
100
+ ### Legacy selectable cards
101
+
102
+ The following example shows a legacy implementation of selectable cards. This example uses the `isSelectable` property instead of `isSelectableRaised`, which is the current recommendation for implementation. `isSelectable` applies selectable styling, but does not apply raised styling on hover and selection as `isSelectableRaised` does.
103
+
104
+ ```ts file='./CardLegacySelectable.tsx'
105
+ ```
75
106
 
76
- This example demonstrates how the `hasSelectableInput` and `onSelectableInputChange` props improve accessibility for selectable cards.
107
+ ### Selectable card accessibility features
77
108
 
78
- The first card sets `hasSelectableInput` to true, which renders a checkbox input that is only visible to, and navigable by, screen readers. This input communicates to assistive technology users that a card is selectable, and if so, it communicates the current selection state as well.
109
+ The following cards demonstrate how the `hasSelectableInput` and `onSelectableInputChange` properties improve accessibility for selectable cards.
79
110
 
80
- By default this input will have an aria-label that corresponds to the title given to the card if using the card title component. If you don't use the card title component in your selectable card, you must pass a custom aria-label for this input using the `selectableInputAriaLabel` prop.
111
+ The first card sets `hasSelectableInput` to true, which renders a checkbox input that is only visible to, and navigable by, screen readers. This input communicates to assistive technology users that a card is selectable, and if so, also communicates the current selection state.
81
112
 
82
- The first card also (by passing an onchange callback to `onSelectableInputChange`) enables the selection/deselection of the associated card by checking/unchecking the checkbox input.
113
+ By default, this input will have an aria-label that corresponds to the `<CardTitle>`. If this isn't defined, then you must pass a custom aria-label using the `selectableInputAriaLabel` property.
83
114
 
84
- The second card does not set `hasSelectableInput` to true, so the input is not rendered. It does not communicate to screen reader users that it is selectable or if it is currently selected.
115
+ The first card passes an onChange callback to `onSelectableInputChange` to enable the selection/deselection of the associated card via checkbox input.
85
116
 
86
- To best understand this example it is encouraged that you navigate both of these cards using a screen reader.
117
+ The second card does not set `hasSelectableInput` to true, so neither the input nor the selection state is communicated to users of assistive technologies.
118
+
119
+ We recommend navigating this example using a screen reader to best understand both cards.
87
120
 
88
121
  ```ts file='./CardSelectableA11yHighlight.tsx'
89
122
  ```
90
123
 
91
- ### With heading element
124
+ ### Expandable cards
92
125
 
93
- ```ts file='./CardWithHeadingElement.tsx'
94
- ```
126
+ A card can be made expandable using the `isExpanded` property. In the collapsed state, only the card header is shown, and the user can click the caret to view the rest of the card content.
95
127
 
96
- ### Expandable
128
+ Place any content that you want to be hidden within the `<CardExpandableContent>` component.
97
129
 
98
130
  ```ts file='./CardExpandable.tsx'
99
131
  ```
100
132
 
101
133
  ### Expandable with icon
102
134
 
103
- ```ts file='./CardExpandableWithIcon.tsx'
104
- ```
105
-
106
- ### Legacy selectable
135
+ An image can be placed in the card header to show users an icon beside the expansion caret.
107
136
 
108
- ```ts file='./CardLegacySelectable.tsx'
137
+ ```ts file='./CardExpandableWithIcon.tsx'
109
138
  ```
@@ -18,6 +18,8 @@ import chart_color_red_100 from '@patternfly/react-tokens/dist/esm/chart_color_r
18
18
 
19
19
  ### Horizontal card grid
20
20
 
21
+ The following demo shows how you may use a `<Grid>` within a card for scenarios that require multiple subsections.
22
+
21
23
  ```js
22
24
  import React from 'react';
23
25
  import {
@@ -263,6 +265,8 @@ class CardGridDemo extends React.Component {
263
265
 
264
266
  ### Horizontal split
265
267
 
268
+ The following demo shows how you may utilize `<Grid>` to split a card into two halves, one with an image, and one with text content.
269
+
266
270
  ```js
267
271
  import React from 'react';
268
272
  import { Card, CardTitle, CardBody, CardFooter, Grid, GridItem, Button } from '@patternfly/react-core';