@patternfly/react-core 4.221.11 → 4.221.12
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 +8 -0
- package/dist/umd/react-core.css +144 -144
- package/dist/umd/react-core.min.css +70 -70
- package/package.json +5 -5
- package/src/components/ExpandableSection/examples/ExpandableSection.md +7 -187
- package/src/components/ExpandableSection/examples/ExpandableSectionBasic.tsx +16 -0
- package/src/components/ExpandableSection/examples/ExpandableSectionCustomToggle.tsx +29 -0
- package/src/components/ExpandableSection/examples/ExpandableSectionDetached.tsx +26 -0
- package/src/components/ExpandableSection/examples/ExpandableSectionDisclosure.tsx +22 -0
- package/src/components/ExpandableSection/examples/ExpandableSectionIndented.tsx +21 -0
- package/src/components/ExpandableSection/examples/ExpandableSectionUncontrolled.tsx +8 -0
- package/src/components/ExpandableSection/examples/ExpandableSectionUncontrolledDynamicToggleText.tsx +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.221.12 (2022-06-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## 4.221.11 (2022-06-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @patternfly/react-core
|
package/dist/umd/react-core.css
CHANGED
|
@@ -9951,6 +9951,150 @@ label.pf-c-input-group__text {
|
|
|
9951
9951
|
--pf-c-sidebar__panel--FlexBasis: 100%;
|
|
9952
9952
|
}
|
|
9953
9953
|
}
|
|
9954
|
+
.pf-c-label-group {
|
|
9955
|
+
--pf-c-label-group__list--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
|
|
9956
|
+
--pf-c-label-group__list--MarginRight: calc(var(--pf-global--spacer--xs) * -1);
|
|
9957
|
+
--pf-c-label-group--m-category--PaddingTop: var(--pf-global--spacer--xs);
|
|
9958
|
+
--pf-c-label-group--m-category--PaddingRight: var(--pf-global--spacer--xs);
|
|
9959
|
+
--pf-c-label-group--m-category--PaddingBottom: var(--pf-global--spacer--xs);
|
|
9960
|
+
--pf-c-label-group--m-category--PaddingLeft: var(--pf-global--spacer--sm);
|
|
9961
|
+
--pf-c-label-group--m-vertical--m-category--PaddingRight: var(--pf-global--spacer--sm);
|
|
9962
|
+
--pf-c-label-group--m-category--BorderRadius: var(--pf-global--BorderRadius--sm);
|
|
9963
|
+
--pf-c-label-group--m-category--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
9964
|
+
--pf-c-label-group--m-category--BorderColor: var(--pf-global--BorderColor--300);
|
|
9965
|
+
--pf-c-label-group--m-category--BackgroundColor: var(--pf-global--BackgroundColor--100);
|
|
9966
|
+
--pf-c-label-group__label--MarginRight: var(--pf-global--spacer--sm);
|
|
9967
|
+
--pf-c-label-group__label--MarginBottom: 0;
|
|
9968
|
+
--pf-c-label-group--m-vertical__label--MarginBottom: var(--pf-global--spacer--sm);
|
|
9969
|
+
--pf-c-label-group__label--FontSize: var(--pf-global--FontSize--sm);
|
|
9970
|
+
--pf-c-label-group__label--MaxWidth: 18ch;
|
|
9971
|
+
--pf-c-label-group__close--MarginTop: calc(var(--pf-global--spacer--xs) * -1);
|
|
9972
|
+
--pf-c-label-group__close--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
|
|
9973
|
+
--pf-c-label-group--m-vertical__close--MarginTop: calc(var(--pf-global--spacer--form-element) * -1);
|
|
9974
|
+
--pf-c-label-group--m-vertical__close--MarginRight: calc(var(--pf-global--spacer--form-element) * -1);
|
|
9975
|
+
--pf-c-label-group--m-vertical__close--MarginLeft: var(--pf-global--spacer--sm);
|
|
9976
|
+
--pf-c-label-group--m-vertical__close--c-button--PaddingRight: var(--pf-global--spacer--sm);
|
|
9977
|
+
--pf-c-label-group--m-vertical__close--c-button--PaddingLeft: var(--pf-global--spacer--sm);
|
|
9978
|
+
--pf-c-label-group__list-item--MarginRight: var(--pf-global--spacer--xs);
|
|
9979
|
+
--pf-c-label-group__list-item--MarginBottom: var(--pf-global--spacer--xs);
|
|
9980
|
+
--pf-c-label-group__textarea--MinWidth: 12.5rem;
|
|
9981
|
+
--pf-c-label-group__textarea--PaddingTop: 0.125rem;
|
|
9982
|
+
--pf-c-label-group__textarea--PaddingRight: var(--pf-global--spacer--xs);
|
|
9983
|
+
--pf-c-label-group__textarea--PaddingBottom: 0;
|
|
9984
|
+
--pf-c-label-group__textarea--PaddingLeft: var(--pf-global--spacer--xs);
|
|
9985
|
+
display: inline-flex;
|
|
9986
|
+
align-items: center;
|
|
9987
|
+
}
|
|
9988
|
+
|
|
9989
|
+
.pf-c-label-group.pf-m-category {
|
|
9990
|
+
padding-top: var(--pf-c-label-group--m-category--PaddingTop);
|
|
9991
|
+
padding-right: var(--pf-c-label-group--m-category--PaddingRight);
|
|
9992
|
+
padding-bottom: var(--pf-c-label-group--m-category--PaddingBottom);
|
|
9993
|
+
padding-left: var(--pf-c-label-group--m-category--PaddingLeft);
|
|
9994
|
+
background-color: var(--pf-c-label-group--m-category--BackgroundColor);
|
|
9995
|
+
border: var(--pf-c-label-group--m-category--BorderWidth) solid var(--pf-c-label-group--m-category--BorderColor);
|
|
9996
|
+
border-radius: var(--pf-c-label-group--m-category--BorderRadius);
|
|
9997
|
+
}
|
|
9998
|
+
|
|
9999
|
+
.pf-c-label-group.pf-m-vertical {
|
|
10000
|
+
--pf-c-label-group__list--MarginRight: 0;
|
|
10001
|
+
--pf-c-label-group__list--MarginBottom: 0;
|
|
10002
|
+
--pf-c-label-group__list-item--MarginRight: 0;
|
|
10003
|
+
--pf-c-label-group__label--MarginRight: 0;
|
|
10004
|
+
--pf-c-label-group__label--MarginBottom: var(--pf-c-label-group--m-vertical__label--MarginBottom);
|
|
10005
|
+
--pf-c-label-group__close--MarginTop: var(--pf-c-label-group--m-vertical__close--MarginTop);
|
|
10006
|
+
--pf-c-label-group__close--MarginLeft: var(--pf-c-label-group--m-vertical__close--MarginLeft);
|
|
10007
|
+
--pf-c-label-group__close--MarginBottom: 0;
|
|
10008
|
+
--pf-c-label-group__close--MarginRight: var(--pf-c-label-group--m-vertical__close--MarginRight);
|
|
10009
|
+
--pf-c-label-group--m-category--PaddingRight: var(--pf-c-label-group--m-vertical--m-category--PaddingRight);
|
|
10010
|
+
}
|
|
10011
|
+
|
|
10012
|
+
.pf-c-label-group.pf-m-vertical.pf-c-label-group {
|
|
10013
|
+
align-items: flex-start;
|
|
10014
|
+
}
|
|
10015
|
+
|
|
10016
|
+
.pf-c-label-group.pf-m-vertical .pf-c-label-group__list {
|
|
10017
|
+
flex-direction: column;
|
|
10018
|
+
align-items: flex-start;
|
|
10019
|
+
}
|
|
10020
|
+
|
|
10021
|
+
.pf-c-label-group.pf-m-vertical .pf-c-label-group__main {
|
|
10022
|
+
flex-direction: column;
|
|
10023
|
+
}
|
|
10024
|
+
|
|
10025
|
+
.pf-c-label-group.pf-m-vertical .pf-c-label-group__list-item:last-child {
|
|
10026
|
+
--pf-c-label-group__list-item--MarginBottom: 0;
|
|
10027
|
+
}
|
|
10028
|
+
|
|
10029
|
+
.pf-c-label-group.pf-m-vertical .pf-c-label-group__close .pf-c-button {
|
|
10030
|
+
--pf-c-button--PaddingLeft: var(--pf-c-label-group--m-vertical__close--c-button--PaddingLeft);
|
|
10031
|
+
--pf-c-button--PaddingRight: var(--pf-c-label-group--m-vertical__close--c-button--PaddingRight);
|
|
10032
|
+
}
|
|
10033
|
+
|
|
10034
|
+
.pf-c-label-group.pf-m-editable,
|
|
10035
|
+
.pf-c-label-group.pf-m-editable .pf-c-label-group__main,
|
|
10036
|
+
.pf-c-label-group.pf-m-editable .pf-c-label-group__list {
|
|
10037
|
+
display: flex;
|
|
10038
|
+
}
|
|
10039
|
+
|
|
10040
|
+
.pf-c-label-group.pf-m-editable .pf-c-label-group__main,
|
|
10041
|
+
.pf-c-label-group.pf-m-editable .pf-c-label-group__list,
|
|
10042
|
+
.pf-c-label-group.pf-m-editable .pf-c-label-group__list-item.pf-m-textarea,
|
|
10043
|
+
.pf-c-label-group.pf-m-editable .pf-c-label-group__textarea {
|
|
10044
|
+
flex: 1;
|
|
10045
|
+
}
|
|
10046
|
+
|
|
10047
|
+
.pf-c-label-group__main {
|
|
10048
|
+
display: flex;
|
|
10049
|
+
flex: 1;
|
|
10050
|
+
flex-wrap: wrap;
|
|
10051
|
+
align-items: baseline;
|
|
10052
|
+
}
|
|
10053
|
+
|
|
10054
|
+
.pf-c-label-group__list {
|
|
10055
|
+
display: inline-flex;
|
|
10056
|
+
flex-wrap: wrap;
|
|
10057
|
+
margin-right: var(--pf-c-label-group__list--MarginRight);
|
|
10058
|
+
margin-bottom: var(--pf-c-label-group__list--MarginBottom);
|
|
10059
|
+
}
|
|
10060
|
+
|
|
10061
|
+
.pf-c-label-group__list-item {
|
|
10062
|
+
display: inline-flex;
|
|
10063
|
+
margin-right: var(--pf-c-label-group__list-item--MarginRight);
|
|
10064
|
+
margin-bottom: var(--pf-c-label-group__list-item--MarginBottom);
|
|
10065
|
+
}
|
|
10066
|
+
|
|
10067
|
+
.pf-c-label-group__label {
|
|
10068
|
+
overflow: hidden;
|
|
10069
|
+
text-overflow: ellipsis;
|
|
10070
|
+
white-space: nowrap;
|
|
10071
|
+
max-width: var(--pf-c-label-group__label--MaxWidth);
|
|
10072
|
+
margin-right: var(--pf-c-label-group__label--MarginRight);
|
|
10073
|
+
margin-bottom: var(--pf-c-label-group__label--MarginBottom);
|
|
10074
|
+
font-size: var(--pf-c-label-group__label--FontSize);
|
|
10075
|
+
}
|
|
10076
|
+
|
|
10077
|
+
.pf-c-label-group__close {
|
|
10078
|
+
margin-top: var(--pf-c-label-group__close--MarginTop);
|
|
10079
|
+
margin-right: var(--pf-c-label-group__close--MarginRight);
|
|
10080
|
+
margin-bottom: var(--pf-c-label-group__close--MarginBottom);
|
|
10081
|
+
margin-left: var(--pf-c-label-group__close--MarginLeft);
|
|
10082
|
+
}
|
|
10083
|
+
|
|
10084
|
+
.pf-c-label-group__textarea {
|
|
10085
|
+
min-width: var(--pf-c-label-group__textarea--MinWidth);
|
|
10086
|
+
padding: var(--pf-c-label-group__textarea--PaddingTop) var(--pf-c-label-group__textarea--PaddingRight) var(--pf-c-label-group__textarea--PaddingBottom) var(--pf-c-label-group__textarea--PaddingLeft);
|
|
10087
|
+
white-space: nowrap;
|
|
10088
|
+
resize: none;
|
|
10089
|
+
border: 0;
|
|
10090
|
+
-ms-overflow-style: none;
|
|
10091
|
+
scrollbar-width: none;
|
|
10092
|
+
}
|
|
10093
|
+
|
|
10094
|
+
.pf-c-label-group__textarea::-webkit-scrollbar {
|
|
10095
|
+
display: none;
|
|
10096
|
+
}
|
|
10097
|
+
|
|
9954
10098
|
.pf-c-label {
|
|
9955
10099
|
--pf-c-label--PaddingTop: var(--pf-global--spacer--xs);
|
|
9956
10100
|
--pf-c-label--PaddingRight: var(--pf-global--spacer--sm);
|
|
@@ -10414,150 +10558,6 @@ button.pf-c-label__content:focus {
|
|
|
10414
10558
|
--pf-c-label--m-outline--m-cyan__content--link--focus--before--BorderColor: var(--pf-global--palette--cyan-100);
|
|
10415
10559
|
}
|
|
10416
10560
|
|
|
10417
|
-
.pf-c-label-group {
|
|
10418
|
-
--pf-c-label-group__list--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
|
|
10419
|
-
--pf-c-label-group__list--MarginRight: calc(var(--pf-global--spacer--xs) * -1);
|
|
10420
|
-
--pf-c-label-group--m-category--PaddingTop: var(--pf-global--spacer--xs);
|
|
10421
|
-
--pf-c-label-group--m-category--PaddingRight: var(--pf-global--spacer--xs);
|
|
10422
|
-
--pf-c-label-group--m-category--PaddingBottom: var(--pf-global--spacer--xs);
|
|
10423
|
-
--pf-c-label-group--m-category--PaddingLeft: var(--pf-global--spacer--sm);
|
|
10424
|
-
--pf-c-label-group--m-vertical--m-category--PaddingRight: var(--pf-global--spacer--sm);
|
|
10425
|
-
--pf-c-label-group--m-category--BorderRadius: var(--pf-global--BorderRadius--sm);
|
|
10426
|
-
--pf-c-label-group--m-category--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
10427
|
-
--pf-c-label-group--m-category--BorderColor: var(--pf-global--BorderColor--300);
|
|
10428
|
-
--pf-c-label-group--m-category--BackgroundColor: var(--pf-global--BackgroundColor--100);
|
|
10429
|
-
--pf-c-label-group__label--MarginRight: var(--pf-global--spacer--sm);
|
|
10430
|
-
--pf-c-label-group__label--MarginBottom: 0;
|
|
10431
|
-
--pf-c-label-group--m-vertical__label--MarginBottom: var(--pf-global--spacer--sm);
|
|
10432
|
-
--pf-c-label-group__label--FontSize: var(--pf-global--FontSize--sm);
|
|
10433
|
-
--pf-c-label-group__label--MaxWidth: 18ch;
|
|
10434
|
-
--pf-c-label-group__close--MarginTop: calc(var(--pf-global--spacer--xs) * -1);
|
|
10435
|
-
--pf-c-label-group__close--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
|
|
10436
|
-
--pf-c-label-group--m-vertical__close--MarginTop: calc(var(--pf-global--spacer--form-element) * -1);
|
|
10437
|
-
--pf-c-label-group--m-vertical__close--MarginRight: calc(var(--pf-global--spacer--form-element) * -1);
|
|
10438
|
-
--pf-c-label-group--m-vertical__close--MarginLeft: var(--pf-global--spacer--sm);
|
|
10439
|
-
--pf-c-label-group--m-vertical__close--c-button--PaddingRight: var(--pf-global--spacer--sm);
|
|
10440
|
-
--pf-c-label-group--m-vertical__close--c-button--PaddingLeft: var(--pf-global--spacer--sm);
|
|
10441
|
-
--pf-c-label-group__list-item--MarginRight: var(--pf-global--spacer--xs);
|
|
10442
|
-
--pf-c-label-group__list-item--MarginBottom: var(--pf-global--spacer--xs);
|
|
10443
|
-
--pf-c-label-group__textarea--MinWidth: 12.5rem;
|
|
10444
|
-
--pf-c-label-group__textarea--PaddingTop: 0.125rem;
|
|
10445
|
-
--pf-c-label-group__textarea--PaddingRight: var(--pf-global--spacer--xs);
|
|
10446
|
-
--pf-c-label-group__textarea--PaddingBottom: 0;
|
|
10447
|
-
--pf-c-label-group__textarea--PaddingLeft: var(--pf-global--spacer--xs);
|
|
10448
|
-
display: inline-flex;
|
|
10449
|
-
align-items: center;
|
|
10450
|
-
}
|
|
10451
|
-
|
|
10452
|
-
.pf-c-label-group.pf-m-category {
|
|
10453
|
-
padding-top: var(--pf-c-label-group--m-category--PaddingTop);
|
|
10454
|
-
padding-right: var(--pf-c-label-group--m-category--PaddingRight);
|
|
10455
|
-
padding-bottom: var(--pf-c-label-group--m-category--PaddingBottom);
|
|
10456
|
-
padding-left: var(--pf-c-label-group--m-category--PaddingLeft);
|
|
10457
|
-
background-color: var(--pf-c-label-group--m-category--BackgroundColor);
|
|
10458
|
-
border: var(--pf-c-label-group--m-category--BorderWidth) solid var(--pf-c-label-group--m-category--BorderColor);
|
|
10459
|
-
border-radius: var(--pf-c-label-group--m-category--BorderRadius);
|
|
10460
|
-
}
|
|
10461
|
-
|
|
10462
|
-
.pf-c-label-group.pf-m-vertical {
|
|
10463
|
-
--pf-c-label-group__list--MarginRight: 0;
|
|
10464
|
-
--pf-c-label-group__list--MarginBottom: 0;
|
|
10465
|
-
--pf-c-label-group__list-item--MarginRight: 0;
|
|
10466
|
-
--pf-c-label-group__label--MarginRight: 0;
|
|
10467
|
-
--pf-c-label-group__label--MarginBottom: var(--pf-c-label-group--m-vertical__label--MarginBottom);
|
|
10468
|
-
--pf-c-label-group__close--MarginTop: var(--pf-c-label-group--m-vertical__close--MarginTop);
|
|
10469
|
-
--pf-c-label-group__close--MarginLeft: var(--pf-c-label-group--m-vertical__close--MarginLeft);
|
|
10470
|
-
--pf-c-label-group__close--MarginBottom: 0;
|
|
10471
|
-
--pf-c-label-group__close--MarginRight: var(--pf-c-label-group--m-vertical__close--MarginRight);
|
|
10472
|
-
--pf-c-label-group--m-category--PaddingRight: var(--pf-c-label-group--m-vertical--m-category--PaddingRight);
|
|
10473
|
-
}
|
|
10474
|
-
|
|
10475
|
-
.pf-c-label-group.pf-m-vertical.pf-c-label-group {
|
|
10476
|
-
align-items: flex-start;
|
|
10477
|
-
}
|
|
10478
|
-
|
|
10479
|
-
.pf-c-label-group.pf-m-vertical .pf-c-label-group__list {
|
|
10480
|
-
flex-direction: column;
|
|
10481
|
-
align-items: flex-start;
|
|
10482
|
-
}
|
|
10483
|
-
|
|
10484
|
-
.pf-c-label-group.pf-m-vertical .pf-c-label-group__main {
|
|
10485
|
-
flex-direction: column;
|
|
10486
|
-
}
|
|
10487
|
-
|
|
10488
|
-
.pf-c-label-group.pf-m-vertical .pf-c-label-group__list-item:last-child {
|
|
10489
|
-
--pf-c-label-group__list-item--MarginBottom: 0;
|
|
10490
|
-
}
|
|
10491
|
-
|
|
10492
|
-
.pf-c-label-group.pf-m-vertical .pf-c-label-group__close .pf-c-button {
|
|
10493
|
-
--pf-c-button--PaddingLeft: var(--pf-c-label-group--m-vertical__close--c-button--PaddingLeft);
|
|
10494
|
-
--pf-c-button--PaddingRight: var(--pf-c-label-group--m-vertical__close--c-button--PaddingRight);
|
|
10495
|
-
}
|
|
10496
|
-
|
|
10497
|
-
.pf-c-label-group.pf-m-editable,
|
|
10498
|
-
.pf-c-label-group.pf-m-editable .pf-c-label-group__main,
|
|
10499
|
-
.pf-c-label-group.pf-m-editable .pf-c-label-group__list {
|
|
10500
|
-
display: flex;
|
|
10501
|
-
}
|
|
10502
|
-
|
|
10503
|
-
.pf-c-label-group.pf-m-editable .pf-c-label-group__main,
|
|
10504
|
-
.pf-c-label-group.pf-m-editable .pf-c-label-group__list,
|
|
10505
|
-
.pf-c-label-group.pf-m-editable .pf-c-label-group__list-item.pf-m-textarea,
|
|
10506
|
-
.pf-c-label-group.pf-m-editable .pf-c-label-group__textarea {
|
|
10507
|
-
flex: 1;
|
|
10508
|
-
}
|
|
10509
|
-
|
|
10510
|
-
.pf-c-label-group__main {
|
|
10511
|
-
display: flex;
|
|
10512
|
-
flex: 1;
|
|
10513
|
-
flex-wrap: wrap;
|
|
10514
|
-
align-items: baseline;
|
|
10515
|
-
}
|
|
10516
|
-
|
|
10517
|
-
.pf-c-label-group__list {
|
|
10518
|
-
display: inline-flex;
|
|
10519
|
-
flex-wrap: wrap;
|
|
10520
|
-
margin-right: var(--pf-c-label-group__list--MarginRight);
|
|
10521
|
-
margin-bottom: var(--pf-c-label-group__list--MarginBottom);
|
|
10522
|
-
}
|
|
10523
|
-
|
|
10524
|
-
.pf-c-label-group__list-item {
|
|
10525
|
-
display: inline-flex;
|
|
10526
|
-
margin-right: var(--pf-c-label-group__list-item--MarginRight);
|
|
10527
|
-
margin-bottom: var(--pf-c-label-group__list-item--MarginBottom);
|
|
10528
|
-
}
|
|
10529
|
-
|
|
10530
|
-
.pf-c-label-group__label {
|
|
10531
|
-
overflow: hidden;
|
|
10532
|
-
text-overflow: ellipsis;
|
|
10533
|
-
white-space: nowrap;
|
|
10534
|
-
max-width: var(--pf-c-label-group__label--MaxWidth);
|
|
10535
|
-
margin-right: var(--pf-c-label-group__label--MarginRight);
|
|
10536
|
-
margin-bottom: var(--pf-c-label-group__label--MarginBottom);
|
|
10537
|
-
font-size: var(--pf-c-label-group__label--FontSize);
|
|
10538
|
-
}
|
|
10539
|
-
|
|
10540
|
-
.pf-c-label-group__close {
|
|
10541
|
-
margin-top: var(--pf-c-label-group__close--MarginTop);
|
|
10542
|
-
margin-right: var(--pf-c-label-group__close--MarginRight);
|
|
10543
|
-
margin-bottom: var(--pf-c-label-group__close--MarginBottom);
|
|
10544
|
-
margin-left: var(--pf-c-label-group__close--MarginLeft);
|
|
10545
|
-
}
|
|
10546
|
-
|
|
10547
|
-
.pf-c-label-group__textarea {
|
|
10548
|
-
min-width: var(--pf-c-label-group__textarea--MinWidth);
|
|
10549
|
-
padding: var(--pf-c-label-group__textarea--PaddingTop) var(--pf-c-label-group__textarea--PaddingRight) var(--pf-c-label-group__textarea--PaddingBottom) var(--pf-c-label-group__textarea--PaddingLeft);
|
|
10550
|
-
white-space: nowrap;
|
|
10551
|
-
resize: none;
|
|
10552
|
-
border: 0;
|
|
10553
|
-
-ms-overflow-style: none;
|
|
10554
|
-
scrollbar-width: none;
|
|
10555
|
-
}
|
|
10556
|
-
|
|
10557
|
-
.pf-c-label-group__textarea::-webkit-scrollbar {
|
|
10558
|
-
display: none;
|
|
10559
|
-
}
|
|
10560
|
-
|
|
10561
10561
|
.pf-c-list {
|
|
10562
10562
|
--pf-c-list--PaddingLeft: var(--pf-global--spacer--lg);
|
|
10563
10563
|
--pf-c-list--nested--MarginTop: var(--pf-global--spacer--sm);
|
|
@@ -9135,6 +9135,76 @@ label.pf-c-check, .pf-c-check__label,
|
|
|
9135
9135
|
--pf-c-helper-text__item-text--m-success--Color: var(--pf-global--success-color--100);
|
|
9136
9136
|
}
|
|
9137
9137
|
|
|
9138
|
+
.pf-c-hint {
|
|
9139
|
+
--pf-c-hint--GridRowGap: var(--pf-global--spacer--md);
|
|
9140
|
+
--pf-c-hint--PaddingTop: var(--pf-global--spacer--lg);
|
|
9141
|
+
--pf-c-hint--PaddingRight: var(--pf-global--spacer--lg);
|
|
9142
|
+
--pf-c-hint--PaddingBottom: var(--pf-global--spacer--lg);
|
|
9143
|
+
--pf-c-hint--PaddingLeft: var(--pf-global--spacer--lg);
|
|
9144
|
+
--pf-c-hint--BackgroundColor: var(--pf-global--palette--blue-50);
|
|
9145
|
+
--pf-c-hint--BorderColor: var(--pf-global--palette--blue-100);
|
|
9146
|
+
--pf-c-hint--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
9147
|
+
--pf-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm);
|
|
9148
|
+
--pf-c-hint--Color: var(--pf-global--Color--100);
|
|
9149
|
+
--pf-c-hint__title--FontSize: var(--pf-global--FontSize--lg);
|
|
9150
|
+
--pf-c-hint__body--FontSize: var(--pf-global--FontSize--md);
|
|
9151
|
+
--pf-c-hint__footer--child--MarginRight: var(--pf-global--spacer--md);
|
|
9152
|
+
--pf-c-hint__actions--MarginLeft: var(--pf-global--spacer--2xl);
|
|
9153
|
+
--pf-c-hint__actions--c-dropdown--MarginTop: calc(var(--pf-global--spacer--form-element) * -1);
|
|
9154
|
+
display: grid;
|
|
9155
|
+
grid-template-columns: 1fr auto;
|
|
9156
|
+
grid-row-gap: var(--pf-c-hint--GridRowGap);
|
|
9157
|
+
padding: var(--pf-c-hint--PaddingTop) var(--pf-c-hint--PaddingRight) var(--pf-c-hint--PaddingBottom) var(--pf-c-hint--PaddingLeft);
|
|
9158
|
+
color: var(--pf-c-hint--Color);
|
|
9159
|
+
background-color: var(--pf-c-hint--BackgroundColor);
|
|
9160
|
+
border: var(--pf-c-hint--BorderWidth) solid var(--pf-c-hint--BorderColor);
|
|
9161
|
+
box-shadow: var(--pf-c-hint--BoxShadow);
|
|
9162
|
+
}
|
|
9163
|
+
|
|
9164
|
+
.pf-c-hint .pf-c-button.pf-m-link.pf-m-inline {
|
|
9165
|
+
text-align: left;
|
|
9166
|
+
white-space: normal;
|
|
9167
|
+
}
|
|
9168
|
+
|
|
9169
|
+
.pf-c-hint__actions {
|
|
9170
|
+
display: inline-grid;
|
|
9171
|
+
grid-auto-flow: column;
|
|
9172
|
+
margin-left: var(--pf-c-hint__actions--MarginLeft);
|
|
9173
|
+
text-align: right;
|
|
9174
|
+
grid-column: 2;
|
|
9175
|
+
grid-row: 1;
|
|
9176
|
+
}
|
|
9177
|
+
|
|
9178
|
+
.pf-c-hint__actions .pf-c-dropdown .pf-c-dropdown__toggle.pf-m-plain {
|
|
9179
|
+
margin-top: var(--pf-c-hint__actions--c-dropdown--MarginTop);
|
|
9180
|
+
}
|
|
9181
|
+
|
|
9182
|
+
.pf-c-hint__actions + .pf-c-hint__body {
|
|
9183
|
+
grid-column: 1;
|
|
9184
|
+
}
|
|
9185
|
+
|
|
9186
|
+
.pf-c-hint__title {
|
|
9187
|
+
font-size: var(--pf-c-hint__title--FontSize);
|
|
9188
|
+
}
|
|
9189
|
+
|
|
9190
|
+
.pf-c-hint__body {
|
|
9191
|
+
grid-column: 1/-1;
|
|
9192
|
+
font-size: var(--pf-c-hint__body--FontSize);
|
|
9193
|
+
}
|
|
9194
|
+
|
|
9195
|
+
.pf-c-hint__footer {
|
|
9196
|
+
grid-column: 1/-1;
|
|
9197
|
+
}
|
|
9198
|
+
|
|
9199
|
+
.pf-c-hint__footer > :not(:last-child) {
|
|
9200
|
+
margin-right: var(--pf-c-hint__footer--child--MarginRight);
|
|
9201
|
+
}
|
|
9202
|
+
|
|
9203
|
+
:where(.pf-theme-dark) .pf-c-hint {
|
|
9204
|
+
--pf-c-hint--BackgroundColor: var(--pf-global--BackgroundColor--400);
|
|
9205
|
+
--pf-c-hint--BorderColor: var(--pf-global--BorderColor--300);
|
|
9206
|
+
}
|
|
9207
|
+
|
|
9138
9208
|
.pf-c-input-group {
|
|
9139
9209
|
--pf-global--Color--100: var(--pf-global--Color--dark-100);
|
|
9140
9210
|
--pf-global--Color--200: var(--pf-global--Color--dark-200);
|
|
@@ -9237,76 +9307,6 @@ label.pf-c-input-group__text {
|
|
|
9237
9307
|
--pf-c-input-group__text--BackgroundColor: transparent;
|
|
9238
9308
|
}
|
|
9239
9309
|
|
|
9240
|
-
.pf-c-hint {
|
|
9241
|
-
--pf-c-hint--GridRowGap: var(--pf-global--spacer--md);
|
|
9242
|
-
--pf-c-hint--PaddingTop: var(--pf-global--spacer--lg);
|
|
9243
|
-
--pf-c-hint--PaddingRight: var(--pf-global--spacer--lg);
|
|
9244
|
-
--pf-c-hint--PaddingBottom: var(--pf-global--spacer--lg);
|
|
9245
|
-
--pf-c-hint--PaddingLeft: var(--pf-global--spacer--lg);
|
|
9246
|
-
--pf-c-hint--BackgroundColor: var(--pf-global--palette--blue-50);
|
|
9247
|
-
--pf-c-hint--BorderColor: var(--pf-global--palette--blue-100);
|
|
9248
|
-
--pf-c-hint--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
9249
|
-
--pf-c-hint--BoxShadow: var(--pf-global--BoxShadow--sm);
|
|
9250
|
-
--pf-c-hint--Color: var(--pf-global--Color--100);
|
|
9251
|
-
--pf-c-hint__title--FontSize: var(--pf-global--FontSize--lg);
|
|
9252
|
-
--pf-c-hint__body--FontSize: var(--pf-global--FontSize--md);
|
|
9253
|
-
--pf-c-hint__footer--child--MarginRight: var(--pf-global--spacer--md);
|
|
9254
|
-
--pf-c-hint__actions--MarginLeft: var(--pf-global--spacer--2xl);
|
|
9255
|
-
--pf-c-hint__actions--c-dropdown--MarginTop: calc(var(--pf-global--spacer--form-element) * -1);
|
|
9256
|
-
display: grid;
|
|
9257
|
-
grid-template-columns: 1fr auto;
|
|
9258
|
-
grid-row-gap: var(--pf-c-hint--GridRowGap);
|
|
9259
|
-
padding: var(--pf-c-hint--PaddingTop) var(--pf-c-hint--PaddingRight) var(--pf-c-hint--PaddingBottom) var(--pf-c-hint--PaddingLeft);
|
|
9260
|
-
color: var(--pf-c-hint--Color);
|
|
9261
|
-
background-color: var(--pf-c-hint--BackgroundColor);
|
|
9262
|
-
border: var(--pf-c-hint--BorderWidth) solid var(--pf-c-hint--BorderColor);
|
|
9263
|
-
box-shadow: var(--pf-c-hint--BoxShadow);
|
|
9264
|
-
}
|
|
9265
|
-
|
|
9266
|
-
.pf-c-hint .pf-c-button.pf-m-link.pf-m-inline {
|
|
9267
|
-
text-align: left;
|
|
9268
|
-
white-space: normal;
|
|
9269
|
-
}
|
|
9270
|
-
|
|
9271
|
-
.pf-c-hint__actions {
|
|
9272
|
-
display: inline-grid;
|
|
9273
|
-
grid-auto-flow: column;
|
|
9274
|
-
margin-left: var(--pf-c-hint__actions--MarginLeft);
|
|
9275
|
-
text-align: right;
|
|
9276
|
-
grid-column: 2;
|
|
9277
|
-
grid-row: 1;
|
|
9278
|
-
}
|
|
9279
|
-
|
|
9280
|
-
.pf-c-hint__actions .pf-c-dropdown .pf-c-dropdown__toggle.pf-m-plain {
|
|
9281
|
-
margin-top: var(--pf-c-hint__actions--c-dropdown--MarginTop);
|
|
9282
|
-
}
|
|
9283
|
-
|
|
9284
|
-
.pf-c-hint__actions + .pf-c-hint__body {
|
|
9285
|
-
grid-column: 1;
|
|
9286
|
-
}
|
|
9287
|
-
|
|
9288
|
-
.pf-c-hint__title {
|
|
9289
|
-
font-size: var(--pf-c-hint__title--FontSize);
|
|
9290
|
-
}
|
|
9291
|
-
|
|
9292
|
-
.pf-c-hint__body {
|
|
9293
|
-
grid-column: 1/-1;
|
|
9294
|
-
font-size: var(--pf-c-hint__body--FontSize);
|
|
9295
|
-
}
|
|
9296
|
-
|
|
9297
|
-
.pf-c-hint__footer {
|
|
9298
|
-
grid-column: 1/-1;
|
|
9299
|
-
}
|
|
9300
|
-
|
|
9301
|
-
.pf-c-hint__footer > :not(:last-child) {
|
|
9302
|
-
margin-right: var(--pf-c-hint__footer--child--MarginRight);
|
|
9303
|
-
}
|
|
9304
|
-
|
|
9305
|
-
:where(.pf-theme-dark) .pf-c-hint {
|
|
9306
|
-
--pf-c-hint--BackgroundColor: var(--pf-global--BackgroundColor--400);
|
|
9307
|
-
--pf-c-hint--BorderColor: var(--pf-global--BorderColor--300);
|
|
9308
|
-
}
|
|
9309
|
-
|
|
9310
9310
|
.pf-c-jump-links {
|
|
9311
9311
|
--pf-c-jump-links__list--Display: flex;
|
|
9312
9312
|
--pf-c-jump-links__list--Visibility: visible;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.221.
|
|
3
|
+
"version": "4.221.12",
|
|
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",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.72.
|
|
38
|
-
"@patternfly/react-styles": "^4.71.
|
|
39
|
-
"@patternfly/react-tokens": "^4.73.
|
|
37
|
+
"@patternfly/react-icons": "^4.72.12",
|
|
38
|
+
"@patternfly/react-styles": "^4.71.12",
|
|
39
|
+
"@patternfly/react-tokens": "^4.73.12",
|
|
40
40
|
"focus-trap": "6.9.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "b8e574fd78b7216e72082488152e8031a1e5761a"
|
|
64
64
|
}
|
|
@@ -11,217 +11,37 @@ import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle
|
|
|
11
11
|
|
|
12
12
|
### Basic
|
|
13
13
|
|
|
14
|
-
```
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import { ExpandableSection } from '@patternfly/react-core';
|
|
17
|
-
|
|
18
|
-
class SimpleExpandableSection extends React.Component {
|
|
19
|
-
constructor(props) {
|
|
20
|
-
super(props);
|
|
21
|
-
this.state = {
|
|
22
|
-
isExpanded: false
|
|
23
|
-
};
|
|
24
|
-
this.onToggle = isExpanded => {
|
|
25
|
-
this.setState({
|
|
26
|
-
isExpanded
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
const { isExpanded } = this.state;
|
|
33
|
-
return (
|
|
34
|
-
<ExpandableSection
|
|
35
|
-
toggleText={isExpanded ? 'Show less' : 'Show more'}
|
|
36
|
-
onToggle={this.onToggle}
|
|
37
|
-
isExpanded={isExpanded}
|
|
38
|
-
>
|
|
39
|
-
This content is visible only when the component is expanded.
|
|
40
|
-
</ExpandableSection>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
14
|
+
```ts file="ExpandableSectionBasic.tsx"
|
|
44
15
|
```
|
|
45
16
|
|
|
46
17
|
### Uncontrolled
|
|
47
18
|
|
|
48
|
-
```
|
|
49
|
-
import React from 'react';
|
|
50
|
-
import { ExpandableSection } from '@patternfly/react-core';
|
|
51
|
-
|
|
52
|
-
<ExpandableSection toggleText="Show more">
|
|
53
|
-
This content is visible only when the component is expanded.
|
|
54
|
-
</ExpandableSection>;
|
|
19
|
+
```ts file="ExpandableSectionUncontrolled.tsx"
|
|
55
20
|
```
|
|
56
21
|
|
|
57
22
|
### Uncontrolled with dynamic toggle text
|
|
58
23
|
|
|
59
|
-
```
|
|
60
|
-
import React from 'react';
|
|
61
|
-
import { ExpandableSection } from '@patternfly/react-core';
|
|
62
|
-
|
|
63
|
-
<ExpandableSection toggleTextExpanded="Show less" toggleTextCollapsed="Show more">
|
|
64
|
-
This content is visible only when the component is expanded.
|
|
65
|
-
</ExpandableSection>;
|
|
24
|
+
```ts file="ExpandableSectionUncontrolledDynamicToggleText.tsx"
|
|
66
25
|
```
|
|
67
26
|
|
|
68
27
|
### Detached
|
|
69
28
|
|
|
70
|
-
```
|
|
71
|
-
import React from 'react';
|
|
72
|
-
import { ExpandableSection, ExpandableSectionToggle, Stack, StackItem } from '@patternfly/react-core';
|
|
73
|
-
|
|
74
|
-
class DetachedExpandableSection extends React.Component {
|
|
75
|
-
constructor(props) {
|
|
76
|
-
super(props);
|
|
77
|
-
this.state = {
|
|
78
|
-
isExpanded: false
|
|
79
|
-
};
|
|
80
|
-
this.onToggle = isExpanded => {
|
|
81
|
-
this.setState({
|
|
82
|
-
isExpanded
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
render() {
|
|
88
|
-
const { isExpanded } = this.state;
|
|
89
|
-
const contentId = 'detached-toggle-content';
|
|
90
|
-
return (
|
|
91
|
-
<Stack hasGutter>
|
|
92
|
-
<StackItem>
|
|
93
|
-
<ExpandableSection isExpanded={isExpanded} isDetached contentId={contentId}>
|
|
94
|
-
This content is visible only when the component is expanded.
|
|
95
|
-
</ExpandableSection>
|
|
96
|
-
</StackItem>
|
|
97
|
-
<StackItem>
|
|
98
|
-
<ExpandableSectionToggle
|
|
99
|
-
isExpanded={isExpanded}
|
|
100
|
-
onToggle={this.onToggle}
|
|
101
|
-
contentId={contentId}
|
|
102
|
-
direction="up"
|
|
103
|
-
>
|
|
104
|
-
{isExpanded ? 'Show less' : 'Show more'}
|
|
105
|
-
</ExpandableSectionToggle>
|
|
106
|
-
</StackItem>
|
|
107
|
-
</Stack>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
29
|
+
```ts file="ExpandableSectionDetached.tsx"
|
|
111
30
|
```
|
|
112
31
|
|
|
113
32
|
### Disclosure variation
|
|
114
33
|
|
|
115
|
-
```
|
|
116
|
-
import React from 'react';
|
|
117
|
-
import { ExpandableSection } from '@patternfly/react-core';
|
|
118
|
-
|
|
119
|
-
class DisclosureExpandableSection extends React.Component {
|
|
120
|
-
constructor(props) {
|
|
121
|
-
super(props);
|
|
122
|
-
this.state = {
|
|
123
|
-
isExpanded: false
|
|
124
|
-
};
|
|
125
|
-
this.onToggle = isExpanded => {
|
|
126
|
-
this.setState({
|
|
127
|
-
isExpanded
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
render() {
|
|
133
|
-
const { isExpanded } = this.state;
|
|
134
|
-
return (
|
|
135
|
-
<ExpandableSection
|
|
136
|
-
toggleText={isExpanded ? 'Show less' : 'Show more'}
|
|
137
|
-
onToggle={this.onToggle}
|
|
138
|
-
isExpanded={isExpanded}
|
|
139
|
-
displaySize="large"
|
|
140
|
-
isWidthLimited
|
|
141
|
-
>
|
|
142
|
-
This content is visible only when the component is expanded.
|
|
143
|
-
</ExpandableSection>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
34
|
+
```ts file="ExpandableSectionDisclosure.tsx"
|
|
147
35
|
```
|
|
148
36
|
|
|
149
37
|
### Indented
|
|
150
38
|
|
|
151
|
-
```
|
|
152
|
-
import React from 'react';
|
|
153
|
-
import { ExpandableSection } from '@patternfly/react-core';
|
|
154
|
-
|
|
155
|
-
class SimpleExpandableSection extends React.Component {
|
|
156
|
-
constructor(props) {
|
|
157
|
-
super(props);
|
|
158
|
-
this.state = {
|
|
159
|
-
isExpanded: false
|
|
160
|
-
};
|
|
161
|
-
this.onToggle = isExpanded => {
|
|
162
|
-
this.setState({
|
|
163
|
-
isExpanded
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
render() {
|
|
169
|
-
const { isExpanded } = this.state;
|
|
170
|
-
return (
|
|
171
|
-
<ExpandableSection
|
|
172
|
-
toggleText={isExpanded ? 'Show less' : 'Show more'}
|
|
173
|
-
onToggle={this.onToggle}
|
|
174
|
-
isExpanded={isExpanded}
|
|
175
|
-
isIndented={true}
|
|
176
|
-
>
|
|
177
|
-
This content is visible only when the component is expanded.
|
|
178
|
-
</ExpandableSection>
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
39
|
+
```ts file="ExpandableSectionIndented.tsx"
|
|
182
40
|
```
|
|
183
41
|
|
|
184
42
|
### With custom toggle content
|
|
185
43
|
|
|
186
44
|
By using the `toggleContent` prop, you can pass in content other than a simple string such as an icon or a badge. When passing in custom content in this way, you should not pass in any interactive element such as a button.
|
|
187
45
|
|
|
188
|
-
```
|
|
189
|
-
import React from "react";
|
|
190
|
-
import { ExpandableSection, Badge } from "@patternfly/react-core";
|
|
191
|
-
import CheckCircleIcon from "@patternfly/react-icons/dist/esm/icons/check-circle-icon";
|
|
192
|
-
|
|
193
|
-
class CustomExpandableSection extends React.Component {
|
|
194
|
-
constructor(props) {
|
|
195
|
-
super(props);
|
|
196
|
-
this.state = {
|
|
197
|
-
isExpanded: false
|
|
198
|
-
};
|
|
199
|
-
this.onToggle = (isExpanded) => {
|
|
200
|
-
this.setState({
|
|
201
|
-
isExpanded
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
render() {
|
|
207
|
-
const { isExpanded } = this.state;
|
|
208
|
-
return (
|
|
209
|
-
<ExpandableSection
|
|
210
|
-
toggleContent={
|
|
211
|
-
<div>
|
|
212
|
-
<span>You can also use icons </span>
|
|
213
|
-
<CheckCircleIcon />
|
|
214
|
-
<span> or badges </span>
|
|
215
|
-
<Badge isRead={true}>4</Badge>
|
|
216
|
-
<span> !</span>
|
|
217
|
-
</div>
|
|
218
|
-
}
|
|
219
|
-
onToggle={this.onToggle}
|
|
220
|
-
isExpanded={isExpanded}
|
|
221
|
-
>
|
|
222
|
-
This content is visible only when the component is expanded.
|
|
223
|
-
</ExpandableSection>
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
46
|
+
```ts file="ExpandableSectionCustomToggle.tsx"
|
|
227
47
|
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExpandableSection } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ExpandableSectionBasic: React.FunctionComponent = () => {
|
|
5
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
6
|
+
|
|
7
|
+
const onToggle = (isExpanded: boolean) => {
|
|
8
|
+
setIsExpanded(isExpanded);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<ExpandableSection toggleText={isExpanded ? 'Show less' : 'Show more'} onToggle={onToggle} isExpanded={isExpanded}>
|
|
13
|
+
This content is visible only when the component is expanded.
|
|
14
|
+
</ExpandableSection>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExpandableSection, Badge } from '@patternfly/react-core';
|
|
3
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
4
|
+
|
|
5
|
+
export const ExpandableSectionCustomToggle: React.FunctionComponent = () => {
|
|
6
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
7
|
+
|
|
8
|
+
const onToggle = (isExpanded: boolean) => {
|
|
9
|
+
setIsExpanded(isExpanded);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<ExpandableSection
|
|
14
|
+
toggleContent={
|
|
15
|
+
<div>
|
|
16
|
+
<span>You can also use icons </span>
|
|
17
|
+
<CheckCircleIcon />
|
|
18
|
+
<span> or badges </span>
|
|
19
|
+
<Badge isRead={true}>4</Badge>
|
|
20
|
+
<span> !</span>
|
|
21
|
+
</div>
|
|
22
|
+
}
|
|
23
|
+
onToggle={onToggle}
|
|
24
|
+
isExpanded={isExpanded}
|
|
25
|
+
>
|
|
26
|
+
This content is visible only when the component is expanded.
|
|
27
|
+
</ExpandableSection>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExpandableSection, ExpandableSectionToggle, Stack, StackItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ExpandableSectionDetached: React.FunctionComponent = () => {
|
|
5
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
6
|
+
|
|
7
|
+
const onToggle = (isExpanded: boolean) => {
|
|
8
|
+
setIsExpanded(isExpanded);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const contentId = 'detached-toggle-content';
|
|
12
|
+
return (
|
|
13
|
+
<Stack hasGutter>
|
|
14
|
+
<StackItem>
|
|
15
|
+
<ExpandableSection isExpanded={isExpanded} isDetached contentId={contentId}>
|
|
16
|
+
This content is visible only when the component is expanded.
|
|
17
|
+
</ExpandableSection>
|
|
18
|
+
</StackItem>
|
|
19
|
+
<StackItem>
|
|
20
|
+
<ExpandableSectionToggle isExpanded={isExpanded} onToggle={onToggle} contentId={contentId} direction="up">
|
|
21
|
+
{isExpanded ? 'Show less' : 'Show more'}
|
|
22
|
+
</ExpandableSectionToggle>
|
|
23
|
+
</StackItem>
|
|
24
|
+
</Stack>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExpandableSection } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ExpandableSectionDisclosure: React.FunctionComponent = () => {
|
|
5
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
6
|
+
|
|
7
|
+
const onToggle = (isExpanded: boolean) => {
|
|
8
|
+
setIsExpanded(isExpanded);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<ExpandableSection
|
|
13
|
+
toggleText={isExpanded ? 'Show less' : 'Show more'}
|
|
14
|
+
onToggle={onToggle}
|
|
15
|
+
isExpanded={isExpanded}
|
|
16
|
+
displaySize="large"
|
|
17
|
+
isWidthLimited
|
|
18
|
+
>
|
|
19
|
+
This content is visible only when the component is expanded.
|
|
20
|
+
</ExpandableSection>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExpandableSection } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ExpandableSectionIndented: React.FunctionComponent = () => {
|
|
5
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
6
|
+
|
|
7
|
+
const onToggle = (isExpanded: boolean) => {
|
|
8
|
+
setIsExpanded(isExpanded);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<ExpandableSection
|
|
13
|
+
toggleText={isExpanded ? 'Show less' : 'Show more'}
|
|
14
|
+
onToggle={onToggle}
|
|
15
|
+
isExpanded={isExpanded}
|
|
16
|
+
isIndented
|
|
17
|
+
>
|
|
18
|
+
This content is visible only when the component is expanded.
|
|
19
|
+
</ExpandableSection>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExpandableSection } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ExpandableSectionUncontrolled: React.FunctionComponent = () => (
|
|
5
|
+
<ExpandableSection toggleText="Show more">
|
|
6
|
+
This content is visible only when the component is expanded.
|
|
7
|
+
</ExpandableSection>
|
|
8
|
+
);
|
package/src/components/ExpandableSection/examples/ExpandableSectionUncontrolledDynamicToggleText.tsx
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExpandableSection } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ExpandableSectionUncontrolledDynamicToggle: React.FunctionComponent = () => (
|
|
5
|
+
<ExpandableSection toggleTextExpanded="Show less" toggleTextCollapsed="Show more">
|
|
6
|
+
This content is visible only when the component is expanded.
|
|
7
|
+
</ExpandableSection>
|
|
8
|
+
);
|