@patternfly/react-core 4.231.9 → 4.232.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 +27 -0
- package/dist/esm/deprecated/components/index.d.ts +2 -0
- package/dist/esm/deprecated/components/index.d.ts.map +1 -0
- package/dist/esm/deprecated/components/index.js +2 -0
- package/dist/esm/deprecated/components/index.js.map +1 -0
- package/dist/esm/deprecated/index.d.ts +2 -0
- package/dist/esm/deprecated/index.d.ts.map +1 -0
- package/dist/esm/deprecated/index.js +2 -0
- package/dist/esm/deprecated/index.js.map +1 -0
- package/dist/esm/next/components/index.d.ts +2 -0
- package/dist/esm/next/components/index.d.ts.map +1 -0
- package/dist/esm/next/components/index.js +2 -0
- package/dist/esm/next/components/index.js.map +1 -0
- package/dist/esm/next/index.d.ts +2 -0
- package/dist/esm/next/index.d.ts.map +1 -0
- package/dist/esm/next/index.js +2 -0
- package/dist/esm/next/index.js.map +1 -0
- package/dist/js/deprecated/components/index.d.ts +2 -0
- package/dist/js/deprecated/components/index.d.ts.map +1 -0
- package/dist/js/deprecated/components/index.js +5 -0
- package/dist/js/deprecated/components/index.js.map +1 -0
- package/dist/js/deprecated/index.d.ts +2 -0
- package/dist/js/deprecated/index.d.ts.map +1 -0
- package/dist/js/deprecated/index.js +5 -0
- package/dist/js/deprecated/index.js.map +1 -0
- package/dist/js/next/components/index.d.ts +2 -0
- package/dist/js/next/components/index.d.ts.map +1 -0
- package/dist/js/next/components/index.js +5 -0
- package/dist/js/next/components/index.js.map +1 -0
- package/dist/js/next/index.d.ts +2 -0
- package/dist/js/next/index.d.ts.map +1 -0
- package/dist/js/next/index.js +5 -0
- package/dist/js/next/index.js.map +1 -0
- package/dist/umd/react-core.css +193 -193
- package/package.json +21 -5
- package/src/components/Tabs/__tests__/OverflowTab.test.tsx +403 -0
- package/src/components/Tabs/__tests__/__snapshots__/OverflowTab.test.tsx.snap +89 -0
- package/src/deprecated/components/index.ts +1 -0
- package/src/deprecated/index.ts +1 -0
- package/src/next/components/index.ts +1 -0
- package/src/next/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
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.232.2 (2022-08-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 4.232.1 (2022-08-16)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# 4.232.0 (2022-08-16)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* Allow for 'next' and 'deprecated' react-core subpaths ([#7824](https://github.com/patternfly/patternfly-react/issues/7824)) ([0e68bd3](https://github.com/patternfly/patternfly-react/commit/0e68bd349e9a8b4b08bb8b777358dcde41d5462f))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## 4.231.9 (2022-08-15)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @patternfly/react-core
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/deprecated/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/deprecated/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/deprecated/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/deprecated/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/next/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/next/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/deprecated/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/deprecated/components/index.ts"],"names":[],"mappings":";;;AAAA,6CAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/deprecated/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/deprecated/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":";;;AAAA,6CAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/next/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/next/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B"}
|
package/dist/umd/react-core.css
CHANGED
|
@@ -3206,116 +3206,6 @@ button.pf-c-breadcrumb__link {
|
|
|
3206
3206
|
--pf-c-card--m-selectable-raised--active--BoxShadow: var(--pf-global--BoxShadow--lg);
|
|
3207
3207
|
}
|
|
3208
3208
|
|
|
3209
|
-
.pf-c-clipboard-copy {
|
|
3210
|
-
--pf-c-clipboard-copy__toggle-icon--Transition: .2s ease-in 0s;
|
|
3211
|
-
--pf-c-clipboard-copy--m-expanded__toggle-icon--Rotate: 90deg;
|
|
3212
|
-
--pf-c-clipboard-copy__expandable-content--PaddingTop: var(--pf-global--spacer--md);
|
|
3213
|
-
--pf-c-clipboard-copy__expandable-content--PaddingRight: var(--pf-global--spacer--md);
|
|
3214
|
-
--pf-c-clipboard-copy__expandable-content--PaddingBottom: var(--pf-global--spacer--md);
|
|
3215
|
-
--pf-c-clipboard-copy__expandable-content--PaddingLeft: var(--pf-global--spacer--md);
|
|
3216
|
-
--pf-c-clipboard-copy__expandable-content--BackgroundColor: var(--pf-global--BackgroundColor--light-100);
|
|
3217
|
-
--pf-c-clipboard-copy__expandable-content--BorderTopWidth: 0;
|
|
3218
|
-
--pf-c-clipboard-copy__expandable-content--BorderRightWidth: var(--pf-global--BorderWidth--sm);
|
|
3219
|
-
--pf-c-clipboard-copy__expandable-content--BorderBottomWidth: var(--pf-global--BorderWidth--sm);
|
|
3220
|
-
--pf-c-clipboard-copy__expandable-content--BorderLeftWidth: var(--pf-global--BorderWidth--sm);
|
|
3221
|
-
--pf-c-clipboard-copy__expandable-content--BorderColor: var(--pf-global--BorderColor--100);
|
|
3222
|
-
--pf-c-clipboard-copy__expandable-content--OutlineOffset: calc(-1 * var(--pf-global--spacer--xs));
|
|
3223
|
-
--pf-c-clipboard-copy--m-inline--PaddingTop: 0;
|
|
3224
|
-
--pf-c-clipboard-copy--m-inline--PaddingBottom: 0;
|
|
3225
|
-
--pf-c-clipboard-copy--m-inline--PaddingLeft: var(--pf-global--spacer--xs);
|
|
3226
|
-
--pf-c-clipboard-copy--m-inline--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
3227
|
-
--pf-c-clipboard-copy__text--m-code--FontFamily: var(--pf-global--FontFamily--monospace);
|
|
3228
|
-
--pf-c-clipboard-copy__text--m-code--FontSize: var(--pf-global--FontSize--sm);
|
|
3229
|
-
--pf-c-clipboard-copy__actions-item--MarginTop: calc(-1 * var(--pf-global--spacer--form-element));
|
|
3230
|
-
--pf-c-clipboard-copy__actions-item--MarginBottom: calc(-1 * var(--pf-global--spacer--form-element));
|
|
3231
|
-
--pf-c-clipboard-copy__actions-item--button--PaddingTop: var(--pf-global--spacer--xs);
|
|
3232
|
-
--pf-c-clipboard-copy__actions-item--button--PaddingRight: var(--pf-global--spacer--sm);
|
|
3233
|
-
--pf-c-clipboard-copy__actions-item--button--PaddingBottom: var(--pf-global--spacer--xs);
|
|
3234
|
-
--pf-c-clipboard-copy__actions-item--button--PaddingLeft: var(--pf-global--spacer--sm);
|
|
3235
|
-
}
|
|
3236
|
-
|
|
3237
|
-
.pf-c-clipboard-copy.pf-m-expanded .pf-c-clipboard-copy__toggle-icon {
|
|
3238
|
-
transform: rotate(var(--pf-c-clipboard-copy--m-expanded__toggle-icon--Rotate));
|
|
3239
|
-
}
|
|
3240
|
-
|
|
3241
|
-
.pf-c-clipboard-copy.pf-m-inline {
|
|
3242
|
-
display: inline;
|
|
3243
|
-
padding-top: var(--pf-c-clipboard-copy--m-inline--PaddingTop);
|
|
3244
|
-
padding-bottom: var(--pf-c-clipboard-copy--m-inline--PaddingBottom);
|
|
3245
|
-
padding-left: var(--pf-c-clipboard-copy--m-inline--PaddingLeft);
|
|
3246
|
-
white-space: nowrap;
|
|
3247
|
-
background-color: var(--pf-c-clipboard-copy--m-inline--BackgroundColor);
|
|
3248
|
-
}
|
|
3249
|
-
|
|
3250
|
-
.pf-c-clipboard-copy.pf-m-inline.pf-m-block {
|
|
3251
|
-
display: block;
|
|
3252
|
-
}
|
|
3253
|
-
|
|
3254
|
-
.pf-c-clipboard-copy__group {
|
|
3255
|
-
display: flex;
|
|
3256
|
-
}
|
|
3257
|
-
|
|
3258
|
-
.pf-c-clipboard-copy__group > * + * {
|
|
3259
|
-
margin-left: -1px;
|
|
3260
|
-
}
|
|
3261
|
-
|
|
3262
|
-
.pf-c-clipboard-copy__toggle-icon {
|
|
3263
|
-
transition: var(--pf-c-clipboard-copy__toggle-icon--Transition);
|
|
3264
|
-
}
|
|
3265
|
-
|
|
3266
|
-
.pf-c-clipboard-copy__expandable-content {
|
|
3267
|
-
padding: var(--pf-c-clipboard-copy__expandable-content--PaddingTop) var(--pf-c-clipboard-copy__expandable-content--PaddingRight) var(--pf-c-clipboard-copy__expandable-content--PaddingBottom) var(--pf-c-clipboard-copy__expandable-content--PaddingLeft);
|
|
3268
|
-
word-wrap: break-word;
|
|
3269
|
-
background-color: var(--pf-c-clipboard-copy__expandable-content--BackgroundColor);
|
|
3270
|
-
background-clip: padding-box;
|
|
3271
|
-
border: solid var(--pf-c-clipboard-copy__expandable-content--BorderColor);
|
|
3272
|
-
border-width: var(--pf-c-clipboard-copy__expandable-content--BorderTopWidth) var(--pf-c-clipboard-copy__expandable-content--BorderRightWidth) var(--pf-c-clipboard-copy__expandable-content--BorderBottomWidth) var(--pf-c-clipboard-copy__expandable-content--BorderLeftWidth);
|
|
3273
|
-
box-shadow: var(--pf-c-clipboard-copy__expandable-content--BoxShadow);
|
|
3274
|
-
}
|
|
3275
|
-
|
|
3276
|
-
.pf-c-clipboard-copy__expandable-content pre {
|
|
3277
|
-
white-space: pre-wrap;
|
|
3278
|
-
}
|
|
3279
|
-
|
|
3280
|
-
.pf-c-clipboard-copy__text {
|
|
3281
|
-
word-break: break-word;
|
|
3282
|
-
white-space: normal;
|
|
3283
|
-
}
|
|
3284
|
-
|
|
3285
|
-
.pf-c-clipboard-copy__text.pf-m-code {
|
|
3286
|
-
font-family: var(--pf-c-clipboard-copy__text--m-code--FontFamily);
|
|
3287
|
-
font-size: var(--pf-c-clipboard-copy__text--m-code--FontSize);
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
.pf-c-clipboard-copy__actions {
|
|
3291
|
-
display: inline-flex;
|
|
3292
|
-
}
|
|
3293
|
-
|
|
3294
|
-
.pf-c-clipboard-copy__actions-item {
|
|
3295
|
-
margin-top: calc(-1 * var(--pf-c-clipboard-copy__actions-item--button--PaddingTop));
|
|
3296
|
-
margin-bottom: calc(-1 * var(--pf-c-clipboard-copy__actions-item--button--PaddingBottom));
|
|
3297
|
-
}
|
|
3298
|
-
|
|
3299
|
-
.pf-c-clipboard-copy__actions-item .pf-c-button {
|
|
3300
|
-
--pf-c-button--PaddingTop: var(--pf-c-clipboard-copy__actions-item--button--PaddingTop);
|
|
3301
|
-
--pf-c-button--PaddingRight: var(--pf-c-clipboard-copy__actions-item--button--PaddingRight);
|
|
3302
|
-
--pf-c-button--PaddingBottom: var(--pf-c-clipboard-copy__actions-item--button--PaddingBottom);
|
|
3303
|
-
--pf-c-button--PaddingLeft: var(--pf-c-clipboard-copy__actions-item--button--PaddingLeft);
|
|
3304
|
-
}
|
|
3305
|
-
|
|
3306
|
-
:where(.pf-theme-dark) .pf-c-clipboard-copy {
|
|
3307
|
-
--pf-c-clipboard-copy__expandable-content--BackgroundColor: var(--pf-global--BackgroundColor--400);
|
|
3308
|
-
}
|
|
3309
|
-
|
|
3310
|
-
:where(.pf-theme-dark) .pf-c-clipboard-copy__group > * + * {
|
|
3311
|
-
margin-left: 0;
|
|
3312
|
-
border-left: 1px solid var(--pf-global--palette--black-700) !important;
|
|
3313
|
-
}
|
|
3314
|
-
|
|
3315
|
-
:where(.pf-theme-dark) .pf-c-clipboard-copy__expandable-content {
|
|
3316
|
-
border: 0;
|
|
3317
|
-
}
|
|
3318
|
-
|
|
3319
3209
|
.pf-c-check {
|
|
3320
3210
|
--pf-c-check--GridGap: var(--pf-global--spacer--xs) var(--pf-global--spacer--sm);
|
|
3321
3211
|
--pf-c-check__label--disabled--Color: var(--pf-global--disabled-color--100);
|
|
@@ -3378,89 +3268,6 @@ label.pf-c-check, .pf-c-check__label,
|
|
|
3378
3268
|
cursor: not-allowed;
|
|
3379
3269
|
}
|
|
3380
3270
|
|
|
3381
|
-
.pf-c-chip-group {
|
|
3382
|
-
--pf-global--Color--100: var(--pf-global--Color--dark-100);
|
|
3383
|
-
--pf-global--Color--200: var(--pf-global--Color--dark-200);
|
|
3384
|
-
--pf-global--BorderColor--100: var(--pf-global--BorderColor--dark-100);
|
|
3385
|
-
--pf-global--primary-color--100: var(--pf-global--primary-color--dark-100);
|
|
3386
|
-
--pf-global--link--Color: var(--pf-global--link--Color--dark);
|
|
3387
|
-
--pf-global--link--Color--hover: var(--pf-global--link--Color--dark--hover);
|
|
3388
|
-
--pf-global--BackgroundColor--100: var(--pf-global--BackgroundColor--light-100);
|
|
3389
|
-
}
|
|
3390
|
-
|
|
3391
|
-
.pf-c-chip-group {
|
|
3392
|
-
color: var(--pf-global--Color--100);
|
|
3393
|
-
--pf-c-chip-group__list--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
|
|
3394
|
-
--pf-c-chip-group__list--MarginRight: calc(var(--pf-global--spacer--xs) * -1);
|
|
3395
|
-
--pf-c-chip-group--m-category--PaddingTop: var(--pf-global--spacer--xs);
|
|
3396
|
-
--pf-c-chip-group--m-category--PaddingRight: var(--pf-global--spacer--xs);
|
|
3397
|
-
--pf-c-chip-group--m-category--PaddingBottom: var(--pf-global--spacer--xs);
|
|
3398
|
-
--pf-c-chip-group--m-category--PaddingLeft: var(--pf-global--spacer--sm);
|
|
3399
|
-
--pf-c-chip-group--m-category--BorderRadius: var(--pf-global--BorderRadius--sm);
|
|
3400
|
-
--pf-c-chip-group--m-category--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
3401
|
-
--pf-c-chip-group__label--MarginRight: var(--pf-global--spacer--sm);
|
|
3402
|
-
--pf-c-chip-group__label--FontSize: var(--pf-global--FontSize--sm);
|
|
3403
|
-
--pf-c-chip-group__label--MaxWidth: 18ch;
|
|
3404
|
-
--pf-c-chip-group__close--MarginTop: calc(var(--pf-global--spacer--xs) * -1);
|
|
3405
|
-
--pf-c-chip-group__close--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
|
|
3406
|
-
--pf-c-chip-group__list-item--MarginRight: var(--pf-global--spacer--xs);
|
|
3407
|
-
--pf-c-chip-group__list-item--MarginBottom: var(--pf-global--spacer--xs);
|
|
3408
|
-
max-width: 100%;
|
|
3409
|
-
}
|
|
3410
|
-
|
|
3411
|
-
.pf-c-chip-group.pf-m-category {
|
|
3412
|
-
padding-top: var(--pf-c-chip-group--m-category--PaddingTop);
|
|
3413
|
-
padding-right: var(--pf-c-chip-group--m-category--PaddingRight);
|
|
3414
|
-
padding-bottom: var(--pf-c-chip-group--m-category--PaddingBottom);
|
|
3415
|
-
padding-left: var(--pf-c-chip-group--m-category--PaddingLeft);
|
|
3416
|
-
background-color: var(--pf-c-chip-group--m-category--BackgroundColor);
|
|
3417
|
-
border-radius: var(--pf-c-chip-group--m-category--BorderRadius);
|
|
3418
|
-
}
|
|
3419
|
-
|
|
3420
|
-
.pf-c-chip-group__main {
|
|
3421
|
-
display: flex;
|
|
3422
|
-
flex: 1;
|
|
3423
|
-
flex-wrap: wrap;
|
|
3424
|
-
align-items: baseline;
|
|
3425
|
-
min-width: 0;
|
|
3426
|
-
}
|
|
3427
|
-
|
|
3428
|
-
.pf-c-chip-group__list {
|
|
3429
|
-
margin-right: var(--pf-c-chip-group__list--MarginRight);
|
|
3430
|
-
margin-bottom: var(--pf-c-chip-group__list--MarginBottom);
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
|
-
.pf-c-chip-group,
|
|
3434
|
-
.pf-c-chip-group__list {
|
|
3435
|
-
display: inline-flex;
|
|
3436
|
-
flex-wrap: wrap;
|
|
3437
|
-
align-items: center;
|
|
3438
|
-
min-width: 0;
|
|
3439
|
-
}
|
|
3440
|
-
|
|
3441
|
-
.pf-c-chip-group__list-item {
|
|
3442
|
-
display: inline-flex;
|
|
3443
|
-
min-width: 0;
|
|
3444
|
-
margin-right: var(--pf-c-chip-group__list-item--MarginRight);
|
|
3445
|
-
margin-bottom: var(--pf-c-chip-group__list-item--MarginBottom);
|
|
3446
|
-
}
|
|
3447
|
-
|
|
3448
|
-
.pf-c-chip-group__label {
|
|
3449
|
-
overflow: hidden;
|
|
3450
|
-
text-overflow: ellipsis;
|
|
3451
|
-
white-space: nowrap;
|
|
3452
|
-
max-width: var(--pf-c-chip-group__label--MaxWidth);
|
|
3453
|
-
margin-right: var(--pf-c-chip-group__label--MarginRight);
|
|
3454
|
-
font-size: var(--pf-c-chip-group__label--FontSize);
|
|
3455
|
-
}
|
|
3456
|
-
|
|
3457
|
-
.pf-c-chip-group__close {
|
|
3458
|
-
display: flex;
|
|
3459
|
-
align-self: flex-start;
|
|
3460
|
-
margin-top: var(--pf-c-chip-group__close--MarginTop);
|
|
3461
|
-
margin-bottom: var(--pf-c-chip-group__close--MarginBottom);
|
|
3462
|
-
}
|
|
3463
|
-
|
|
3464
3271
|
.pf-c-chip {
|
|
3465
3272
|
--pf-global--Color--100: var(--pf-global--Color--dark-100);
|
|
3466
3273
|
--pf-global--Color--200: var(--pf-global--Color--dark-200);
|
|
@@ -3573,6 +3380,199 @@ label.pf-c-check, .pf-c-check__label,
|
|
|
3573
3380
|
--pf-c-chip--m-draggable--BackgroundColor: var(--pf-global--palette--black-600);
|
|
3574
3381
|
}
|
|
3575
3382
|
|
|
3383
|
+
.pf-c-chip-group {
|
|
3384
|
+
--pf-global--Color--100: var(--pf-global--Color--dark-100);
|
|
3385
|
+
--pf-global--Color--200: var(--pf-global--Color--dark-200);
|
|
3386
|
+
--pf-global--BorderColor--100: var(--pf-global--BorderColor--dark-100);
|
|
3387
|
+
--pf-global--primary-color--100: var(--pf-global--primary-color--dark-100);
|
|
3388
|
+
--pf-global--link--Color: var(--pf-global--link--Color--dark);
|
|
3389
|
+
--pf-global--link--Color--hover: var(--pf-global--link--Color--dark--hover);
|
|
3390
|
+
--pf-global--BackgroundColor--100: var(--pf-global--BackgroundColor--light-100);
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3393
|
+
.pf-c-chip-group {
|
|
3394
|
+
color: var(--pf-global--Color--100);
|
|
3395
|
+
--pf-c-chip-group__list--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
|
|
3396
|
+
--pf-c-chip-group__list--MarginRight: calc(var(--pf-global--spacer--xs) * -1);
|
|
3397
|
+
--pf-c-chip-group--m-category--PaddingTop: var(--pf-global--spacer--xs);
|
|
3398
|
+
--pf-c-chip-group--m-category--PaddingRight: var(--pf-global--spacer--xs);
|
|
3399
|
+
--pf-c-chip-group--m-category--PaddingBottom: var(--pf-global--spacer--xs);
|
|
3400
|
+
--pf-c-chip-group--m-category--PaddingLeft: var(--pf-global--spacer--sm);
|
|
3401
|
+
--pf-c-chip-group--m-category--BorderRadius: var(--pf-global--BorderRadius--sm);
|
|
3402
|
+
--pf-c-chip-group--m-category--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
3403
|
+
--pf-c-chip-group__label--MarginRight: var(--pf-global--spacer--sm);
|
|
3404
|
+
--pf-c-chip-group__label--FontSize: var(--pf-global--FontSize--sm);
|
|
3405
|
+
--pf-c-chip-group__label--MaxWidth: 18ch;
|
|
3406
|
+
--pf-c-chip-group__close--MarginTop: calc(var(--pf-global--spacer--xs) * -1);
|
|
3407
|
+
--pf-c-chip-group__close--MarginBottom: calc(var(--pf-global--spacer--xs) * -1);
|
|
3408
|
+
--pf-c-chip-group__list-item--MarginRight: var(--pf-global--spacer--xs);
|
|
3409
|
+
--pf-c-chip-group__list-item--MarginBottom: var(--pf-global--spacer--xs);
|
|
3410
|
+
max-width: 100%;
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3413
|
+
.pf-c-chip-group.pf-m-category {
|
|
3414
|
+
padding-top: var(--pf-c-chip-group--m-category--PaddingTop);
|
|
3415
|
+
padding-right: var(--pf-c-chip-group--m-category--PaddingRight);
|
|
3416
|
+
padding-bottom: var(--pf-c-chip-group--m-category--PaddingBottom);
|
|
3417
|
+
padding-left: var(--pf-c-chip-group--m-category--PaddingLeft);
|
|
3418
|
+
background-color: var(--pf-c-chip-group--m-category--BackgroundColor);
|
|
3419
|
+
border-radius: var(--pf-c-chip-group--m-category--BorderRadius);
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
.pf-c-chip-group__main {
|
|
3423
|
+
display: flex;
|
|
3424
|
+
flex: 1;
|
|
3425
|
+
flex-wrap: wrap;
|
|
3426
|
+
align-items: baseline;
|
|
3427
|
+
min-width: 0;
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
.pf-c-chip-group__list {
|
|
3431
|
+
margin-right: var(--pf-c-chip-group__list--MarginRight);
|
|
3432
|
+
margin-bottom: var(--pf-c-chip-group__list--MarginBottom);
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
.pf-c-chip-group,
|
|
3436
|
+
.pf-c-chip-group__list {
|
|
3437
|
+
display: inline-flex;
|
|
3438
|
+
flex-wrap: wrap;
|
|
3439
|
+
align-items: center;
|
|
3440
|
+
min-width: 0;
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
.pf-c-chip-group__list-item {
|
|
3444
|
+
display: inline-flex;
|
|
3445
|
+
min-width: 0;
|
|
3446
|
+
margin-right: var(--pf-c-chip-group__list-item--MarginRight);
|
|
3447
|
+
margin-bottom: var(--pf-c-chip-group__list-item--MarginBottom);
|
|
3448
|
+
}
|
|
3449
|
+
|
|
3450
|
+
.pf-c-chip-group__label {
|
|
3451
|
+
overflow: hidden;
|
|
3452
|
+
text-overflow: ellipsis;
|
|
3453
|
+
white-space: nowrap;
|
|
3454
|
+
max-width: var(--pf-c-chip-group__label--MaxWidth);
|
|
3455
|
+
margin-right: var(--pf-c-chip-group__label--MarginRight);
|
|
3456
|
+
font-size: var(--pf-c-chip-group__label--FontSize);
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
.pf-c-chip-group__close {
|
|
3460
|
+
display: flex;
|
|
3461
|
+
align-self: flex-start;
|
|
3462
|
+
margin-top: var(--pf-c-chip-group__close--MarginTop);
|
|
3463
|
+
margin-bottom: var(--pf-c-chip-group__close--MarginBottom);
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
.pf-c-clipboard-copy {
|
|
3467
|
+
--pf-c-clipboard-copy__toggle-icon--Transition: .2s ease-in 0s;
|
|
3468
|
+
--pf-c-clipboard-copy--m-expanded__toggle-icon--Rotate: 90deg;
|
|
3469
|
+
--pf-c-clipboard-copy__expandable-content--PaddingTop: var(--pf-global--spacer--md);
|
|
3470
|
+
--pf-c-clipboard-copy__expandable-content--PaddingRight: var(--pf-global--spacer--md);
|
|
3471
|
+
--pf-c-clipboard-copy__expandable-content--PaddingBottom: var(--pf-global--spacer--md);
|
|
3472
|
+
--pf-c-clipboard-copy__expandable-content--PaddingLeft: var(--pf-global--spacer--md);
|
|
3473
|
+
--pf-c-clipboard-copy__expandable-content--BackgroundColor: var(--pf-global--BackgroundColor--light-100);
|
|
3474
|
+
--pf-c-clipboard-copy__expandable-content--BorderTopWidth: 0;
|
|
3475
|
+
--pf-c-clipboard-copy__expandable-content--BorderRightWidth: var(--pf-global--BorderWidth--sm);
|
|
3476
|
+
--pf-c-clipboard-copy__expandable-content--BorderBottomWidth: var(--pf-global--BorderWidth--sm);
|
|
3477
|
+
--pf-c-clipboard-copy__expandable-content--BorderLeftWidth: var(--pf-global--BorderWidth--sm);
|
|
3478
|
+
--pf-c-clipboard-copy__expandable-content--BorderColor: var(--pf-global--BorderColor--100);
|
|
3479
|
+
--pf-c-clipboard-copy__expandable-content--OutlineOffset: calc(-1 * var(--pf-global--spacer--xs));
|
|
3480
|
+
--pf-c-clipboard-copy--m-inline--PaddingTop: 0;
|
|
3481
|
+
--pf-c-clipboard-copy--m-inline--PaddingBottom: 0;
|
|
3482
|
+
--pf-c-clipboard-copy--m-inline--PaddingLeft: var(--pf-global--spacer--xs);
|
|
3483
|
+
--pf-c-clipboard-copy--m-inline--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
3484
|
+
--pf-c-clipboard-copy__text--m-code--FontFamily: var(--pf-global--FontFamily--monospace);
|
|
3485
|
+
--pf-c-clipboard-copy__text--m-code--FontSize: var(--pf-global--FontSize--sm);
|
|
3486
|
+
--pf-c-clipboard-copy__actions-item--MarginTop: calc(-1 * var(--pf-global--spacer--form-element));
|
|
3487
|
+
--pf-c-clipboard-copy__actions-item--MarginBottom: calc(-1 * var(--pf-global--spacer--form-element));
|
|
3488
|
+
--pf-c-clipboard-copy__actions-item--button--PaddingTop: var(--pf-global--spacer--xs);
|
|
3489
|
+
--pf-c-clipboard-copy__actions-item--button--PaddingRight: var(--pf-global--spacer--sm);
|
|
3490
|
+
--pf-c-clipboard-copy__actions-item--button--PaddingBottom: var(--pf-global--spacer--xs);
|
|
3491
|
+
--pf-c-clipboard-copy__actions-item--button--PaddingLeft: var(--pf-global--spacer--sm);
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
.pf-c-clipboard-copy.pf-m-expanded .pf-c-clipboard-copy__toggle-icon {
|
|
3495
|
+
transform: rotate(var(--pf-c-clipboard-copy--m-expanded__toggle-icon--Rotate));
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
.pf-c-clipboard-copy.pf-m-inline {
|
|
3499
|
+
display: inline;
|
|
3500
|
+
padding-top: var(--pf-c-clipboard-copy--m-inline--PaddingTop);
|
|
3501
|
+
padding-bottom: var(--pf-c-clipboard-copy--m-inline--PaddingBottom);
|
|
3502
|
+
padding-left: var(--pf-c-clipboard-copy--m-inline--PaddingLeft);
|
|
3503
|
+
white-space: nowrap;
|
|
3504
|
+
background-color: var(--pf-c-clipboard-copy--m-inline--BackgroundColor);
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3507
|
+
.pf-c-clipboard-copy.pf-m-inline.pf-m-block {
|
|
3508
|
+
display: block;
|
|
3509
|
+
}
|
|
3510
|
+
|
|
3511
|
+
.pf-c-clipboard-copy__group {
|
|
3512
|
+
display: flex;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
.pf-c-clipboard-copy__group > * + * {
|
|
3516
|
+
margin-left: -1px;
|
|
3517
|
+
}
|
|
3518
|
+
|
|
3519
|
+
.pf-c-clipboard-copy__toggle-icon {
|
|
3520
|
+
transition: var(--pf-c-clipboard-copy__toggle-icon--Transition);
|
|
3521
|
+
}
|
|
3522
|
+
|
|
3523
|
+
.pf-c-clipboard-copy__expandable-content {
|
|
3524
|
+
padding: var(--pf-c-clipboard-copy__expandable-content--PaddingTop) var(--pf-c-clipboard-copy__expandable-content--PaddingRight) var(--pf-c-clipboard-copy__expandable-content--PaddingBottom) var(--pf-c-clipboard-copy__expandable-content--PaddingLeft);
|
|
3525
|
+
word-wrap: break-word;
|
|
3526
|
+
background-color: var(--pf-c-clipboard-copy__expandable-content--BackgroundColor);
|
|
3527
|
+
background-clip: padding-box;
|
|
3528
|
+
border: solid var(--pf-c-clipboard-copy__expandable-content--BorderColor);
|
|
3529
|
+
border-width: var(--pf-c-clipboard-copy__expandable-content--BorderTopWidth) var(--pf-c-clipboard-copy__expandable-content--BorderRightWidth) var(--pf-c-clipboard-copy__expandable-content--BorderBottomWidth) var(--pf-c-clipboard-copy__expandable-content--BorderLeftWidth);
|
|
3530
|
+
box-shadow: var(--pf-c-clipboard-copy__expandable-content--BoxShadow);
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
.pf-c-clipboard-copy__expandable-content pre {
|
|
3534
|
+
white-space: pre-wrap;
|
|
3535
|
+
}
|
|
3536
|
+
|
|
3537
|
+
.pf-c-clipboard-copy__text {
|
|
3538
|
+
word-break: break-word;
|
|
3539
|
+
white-space: normal;
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
.pf-c-clipboard-copy__text.pf-m-code {
|
|
3543
|
+
font-family: var(--pf-c-clipboard-copy__text--m-code--FontFamily);
|
|
3544
|
+
font-size: var(--pf-c-clipboard-copy__text--m-code--FontSize);
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
.pf-c-clipboard-copy__actions {
|
|
3548
|
+
display: inline-flex;
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3551
|
+
.pf-c-clipboard-copy__actions-item {
|
|
3552
|
+
margin-top: calc(-1 * var(--pf-c-clipboard-copy__actions-item--button--PaddingTop));
|
|
3553
|
+
margin-bottom: calc(-1 * var(--pf-c-clipboard-copy__actions-item--button--PaddingBottom));
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
.pf-c-clipboard-copy__actions-item .pf-c-button {
|
|
3557
|
+
--pf-c-button--PaddingTop: var(--pf-c-clipboard-copy__actions-item--button--PaddingTop);
|
|
3558
|
+
--pf-c-button--PaddingRight: var(--pf-c-clipboard-copy__actions-item--button--PaddingRight);
|
|
3559
|
+
--pf-c-button--PaddingBottom: var(--pf-c-clipboard-copy__actions-item--button--PaddingBottom);
|
|
3560
|
+
--pf-c-button--PaddingLeft: var(--pf-c-clipboard-copy__actions-item--button--PaddingLeft);
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
:where(.pf-theme-dark) .pf-c-clipboard-copy {
|
|
3564
|
+
--pf-c-clipboard-copy__expandable-content--BackgroundColor: var(--pf-global--BackgroundColor--400);
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
:where(.pf-theme-dark) .pf-c-clipboard-copy__group > * + * {
|
|
3568
|
+
margin-left: 0;
|
|
3569
|
+
border-left: 1px solid var(--pf-global--palette--black-700) !important;
|
|
3570
|
+
}
|
|
3571
|
+
|
|
3572
|
+
:where(.pf-theme-dark) .pf-c-clipboard-copy__expandable-content {
|
|
3573
|
+
border: 0;
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
3576
|
.pf-c-code-block {
|
|
3577
3577
|
--pf-c-code-block--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
3578
3578
|
--pf-c-code-block__header--BorderBottomWidth: var(--pf-global--BorderWidth--sm);
|
package/package.json
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.232.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",
|
|
7
7
|
"types": "dist/esm/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/esm/index.js",
|
|
10
|
+
"./next": "./dist/esm/next/index.js",
|
|
11
|
+
"./deprecated": "./dist/esm/deprecated/index.js",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"typesVersions": {
|
|
15
|
+
"*": {
|
|
16
|
+
"next": [
|
|
17
|
+
"dist/esm/next/index.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"deprecated": [
|
|
20
|
+
"dist/esm/deprecated/index.d.ts"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
8
24
|
"patternfly:src": "src/",
|
|
9
25
|
"sideEffects": [
|
|
10
26
|
"*.css",
|
|
@@ -34,9 +50,9 @@
|
|
|
34
50
|
"generate": "node scripts/copyStyles.js"
|
|
35
51
|
},
|
|
36
52
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.
|
|
38
|
-
"@patternfly/react-styles": "^4.
|
|
39
|
-
"@patternfly/react-tokens": "^4.
|
|
53
|
+
"@patternfly/react-icons": "^4.83.2",
|
|
54
|
+
"@patternfly/react-styles": "^4.82.2",
|
|
55
|
+
"@patternfly/react-tokens": "^4.84.2",
|
|
40
56
|
"focus-trap": "6.9.2",
|
|
41
57
|
"react-dropzone": "9.0.0",
|
|
42
58
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +76,5 @@
|
|
|
60
76
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
77
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
78
|
},
|
|
63
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "585189d1c581fbdcb89a1874f49bf4a090618792"
|
|
64
80
|
}
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { OverflowTab } from '../OverflowTab';
|
|
6
|
+
import { TabsContext } from '../TabsContext';
|
|
7
|
+
|
|
8
|
+
jest.mock('../../../helpers', () => ({
|
|
9
|
+
Popper: ({ trigger, popper, isVisible, popperMatchesTriggerWidth, appendTo }) => (
|
|
10
|
+
<div data-testid="popper-mock">
|
|
11
|
+
<div data-testid="trigger">{trigger}</div>
|
|
12
|
+
<div data-testid="popper">{isVisible && popper}</div>
|
|
13
|
+
<p>Popper matches trigger width: {`${popperMatchesTriggerWidth}`}</p>
|
|
14
|
+
<p>Append to class name: {appendTo && `${appendTo.className}`}</p>
|
|
15
|
+
</div>
|
|
16
|
+
)
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
jest.mock('../../Menu', () => {
|
|
20
|
+
const { forwardRef } = jest.requireActual('react');
|
|
21
|
+
return {
|
|
22
|
+
Menu: forwardRef((props: { children; onSelect }, ref) => (
|
|
23
|
+
<div data-testid="menu-mock" ref={ref}>
|
|
24
|
+
{props.children}
|
|
25
|
+
<button onClick={() => props.onSelect('mouseEvent', 1, 'fakeRef')}>Select</button>
|
|
26
|
+
</div>
|
|
27
|
+
)),
|
|
28
|
+
MenuContent: ({ children }) => <div data-testid="menu-content-mock">{children}</div>,
|
|
29
|
+
MenuList: ({ children }) => <ul data-testid="menu-list-mock">{children}</ul>,
|
|
30
|
+
MenuItem: ({ children, itemId, isSelected }) => (
|
|
31
|
+
<>
|
|
32
|
+
<li id={`${itemId}-menu-item-mock`}>
|
|
33
|
+
{children}
|
|
34
|
+
<p>Selected: {`${isSelected}`}</p>
|
|
35
|
+
</li>
|
|
36
|
+
</>
|
|
37
|
+
)
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const tabsContextDefaultProps = {
|
|
42
|
+
variant: 'default' as 'default',
|
|
43
|
+
mountOnEnter: false,
|
|
44
|
+
unmountOnExit: false,
|
|
45
|
+
localActiveKey: '',
|
|
46
|
+
uniqueId: '',
|
|
47
|
+
handleTabClick: () => null,
|
|
48
|
+
handleTabClose: undefined
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
test('Renders', () => {
|
|
52
|
+
render(
|
|
53
|
+
<div data-testid="overflow-tab-container">
|
|
54
|
+
<OverflowTab />
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
expect(screen.getByTestId('overflow-tab-container').firstChild).toBeVisible();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('Renders with the passed aria label', () => {
|
|
62
|
+
render(<OverflowTab aria-label="Overflow tab label test" />);
|
|
63
|
+
|
|
64
|
+
expect(screen.getByRole('presentation')).toHaveAccessibleName('Overflow tab label test');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('Renders with inherited element props spread to the component', () => {
|
|
68
|
+
render(
|
|
69
|
+
<>
|
|
70
|
+
<OverflowTab aria-labelledby="labelling-id" />
|
|
71
|
+
<p id="labelling-id">Label</p>
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
expect(screen.getByRole('presentation')).toHaveAccessibleName('Label');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('Renders with class names pf-m-overflow and pf-c-tabs__item on the presentation element', () => {
|
|
79
|
+
render(<OverflowTab />);
|
|
80
|
+
|
|
81
|
+
expect(screen.getByRole('presentation')).toHaveClass('pf-m-overflow');
|
|
82
|
+
expect(screen.getByRole('presentation')).toHaveClass('pf-c-tabs__item');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('Renders with class pf-c-tabs__link on the tab element', () => {
|
|
86
|
+
render(<OverflowTab />);
|
|
87
|
+
|
|
88
|
+
expect(screen.getByRole('tab')).toHaveClass('pf-c-tabs__link');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test("Renders with class pf-c-tabs__link-toggle-icon on the img element's container", () => {
|
|
92
|
+
render(<OverflowTab />);
|
|
93
|
+
|
|
94
|
+
expect(screen.getByRole('img', { hidden: true }).parentElement).toHaveClass('pf-c-tabs__link-toggle-icon');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test('Renders with custom class names provided via prop', () => {
|
|
98
|
+
render(<OverflowTab className="test-class" />);
|
|
99
|
+
|
|
100
|
+
expect(screen.getByRole('presentation')).toHaveClass('test-class');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test('Renders without pf-m-expanded on the tab element by default', () => {
|
|
104
|
+
render(<OverflowTab />);
|
|
105
|
+
|
|
106
|
+
expect(screen.getByRole('tab')).not.toHaveClass('pf-m-expanded');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
test('Renders with pf-m-expanded on the tab element once clicked', () => {
|
|
110
|
+
render(<OverflowTab />);
|
|
111
|
+
|
|
112
|
+
const overflowTab = screen.getByRole('tab');
|
|
113
|
+
|
|
114
|
+
userEvent.click(overflowTab);
|
|
115
|
+
|
|
116
|
+
expect(overflowTab).toHaveClass('pf-m-expanded');
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test('Renders without pf-m-current on the presentation element by default', () => {
|
|
120
|
+
render(<OverflowTab />);
|
|
121
|
+
|
|
122
|
+
expect(screen.getByRole('presentation')).not.toHaveClass('pf-m-current');
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('Renders without pf-m-current when the overflowingTabs does not include the tab indicated by localActiveKey via a context', () => {
|
|
126
|
+
render(
|
|
127
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 0 }}>
|
|
128
|
+
<OverflowTab overflowingTabs={[{ title: 'tabTitle', eventKey: 1 }]} />
|
|
129
|
+
</TabsContext.Provider>
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
expect(screen.getByRole('presentation')).not.toHaveClass('pf-m-current');
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test("Renders with pf-m-current when TabContext's localActiveKey matches an overflowingTabs' eventKey", () => {
|
|
136
|
+
render(
|
|
137
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 1 }}>
|
|
138
|
+
<OverflowTab overflowingTabs={[{ title: 'Tab one', eventKey: 1 }]} />
|
|
139
|
+
</TabsContext.Provider>
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
expect(screen.getByRole('presentation')).toHaveClass('pf-m-current');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('Does not render tabs passed via overflowingTabs when not expanded', () => {
|
|
146
|
+
render(
|
|
147
|
+
<OverflowTab
|
|
148
|
+
overflowingTabs={[
|
|
149
|
+
{ title: 'Tab one', eventKey: 1 },
|
|
150
|
+
{ title: 'Tab two', eventKey: 2 }
|
|
151
|
+
]}
|
|
152
|
+
/>
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
expect(screen.queryByText('Tab one')).not.toBeInTheDocument();
|
|
156
|
+
expect(screen.queryByText('Tab two')).not.toBeInTheDocument();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test('Renders tabs passed via overflowingTabs when expanded', () => {
|
|
160
|
+
render(
|
|
161
|
+
<OverflowTab
|
|
162
|
+
overflowingTabs={[
|
|
163
|
+
{ title: 'Tab one', eventKey: 1 },
|
|
164
|
+
{ title: 'Tab two', eventKey: 2 }
|
|
165
|
+
]}
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
userEvent.click(screen.getByRole('tab', { name: 'More' }));
|
|
170
|
+
|
|
171
|
+
expect(screen.getByText('Tab one')).toBeVisible();
|
|
172
|
+
expect(screen.getByText('Tab two')).toBeVisible();
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
test('Closes the overflowing tabs menu when a tab is selected', () => {
|
|
176
|
+
render(
|
|
177
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 0 }}>
|
|
178
|
+
<OverflowTab
|
|
179
|
+
overflowingTabs={[
|
|
180
|
+
{ title: 'Tab one', eventKey: 1, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> },
|
|
181
|
+
{ title: 'Tab two', eventKey: 2, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> }
|
|
182
|
+
]}
|
|
183
|
+
/>
|
|
184
|
+
</TabsContext.Provider>
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
userEvent.click(screen.getByRole('tab', { name: 'More' }));
|
|
188
|
+
|
|
189
|
+
// rather than actually clicking a menu item here we click the Select button provided via our Menu mock to keep the mocks simpler
|
|
190
|
+
userEvent.click(screen.getByRole('button', { name: 'Select' }));
|
|
191
|
+
|
|
192
|
+
expect(screen.queryByText('Tab two')).not.toBeInTheDocument();
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
test('Closes the overflowing tabs menu when the user clicks outside of the menu', () => {
|
|
196
|
+
render(
|
|
197
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 0 }}>
|
|
198
|
+
<OverflowTab
|
|
199
|
+
overflowingTabs={[
|
|
200
|
+
{ title: 'Tab one', eventKey: 1, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> },
|
|
201
|
+
{ title: 'Tab two', eventKey: 2, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> }
|
|
202
|
+
]}
|
|
203
|
+
/>
|
|
204
|
+
</TabsContext.Provider>
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
userEvent.click(screen.getByRole('tab', { name: 'More' }));
|
|
208
|
+
|
|
209
|
+
userEvent.click(document.body);
|
|
210
|
+
|
|
211
|
+
expect(screen.queryByText('Tab two')).not.toBeInTheDocument();
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test('Calls the onTabClick callback provided via context when a tab is clicked', () => {
|
|
215
|
+
const mockHandleTabClick = jest.fn();
|
|
216
|
+
|
|
217
|
+
render(
|
|
218
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, handleTabClick: mockHandleTabClick }}>
|
|
219
|
+
<OverflowTab
|
|
220
|
+
overflowingTabs={[
|
|
221
|
+
{ title: 'Tab one', eventKey: 1, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> }
|
|
222
|
+
]}
|
|
223
|
+
/>
|
|
224
|
+
</TabsContext.Provider>
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
userEvent.click(screen.getByRole('tab', { name: 'More' }));
|
|
228
|
+
|
|
229
|
+
// rather than actually clicking a menu item here we click the Select button provided via our Menu mock to keep the mocks simpler
|
|
230
|
+
userEvent.click(screen.getByRole('button', { name: 'Select' }));
|
|
231
|
+
|
|
232
|
+
expect(mockHandleTabClick).toHaveBeenCalledTimes(1);
|
|
233
|
+
expect(mockHandleTabClick).toHaveBeenCalledWith('mouseEvent', 1, 'fakeRef');
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
test('Does not show the overflowing tab count by default', () => {
|
|
237
|
+
render(
|
|
238
|
+
<OverflowTab
|
|
239
|
+
overflowingTabs={[
|
|
240
|
+
{ title: 'Tab one', eventKey: 1 },
|
|
241
|
+
{ title: 'Tab two', eventKey: 2 }
|
|
242
|
+
]}
|
|
243
|
+
/>
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
expect(screen.queryByRole('tab', { name: 'More (2)' })).not.toBeInTheDocument();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test('Shows the overflowing tab count when showTabCount is true', () => {
|
|
250
|
+
render(
|
|
251
|
+
<OverflowTab
|
|
252
|
+
overflowingTabs={[
|
|
253
|
+
{ title: 'Tab one', eventKey: 1 },
|
|
254
|
+
{ title: 'Tab two', eventKey: 2 }
|
|
255
|
+
]}
|
|
256
|
+
showTabCount
|
|
257
|
+
/>
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
expect(screen.getByRole('tab', { name: 'More (2)' })).toBeVisible();
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
test('Uses "More" as the default overflow tab title', () => {
|
|
264
|
+
render(<OverflowTab />);
|
|
265
|
+
|
|
266
|
+
expect(screen.getByRole('tab')).toHaveTextContent('More');
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
test('Uses the selected tab title as the overflow tab title rather than the default title when a tab is selected', () => {
|
|
270
|
+
render(
|
|
271
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 1 }}>
|
|
272
|
+
<OverflowTab
|
|
273
|
+
overflowingTabs={[
|
|
274
|
+
{ title: 'Tab one', eventKey: 1, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> }
|
|
275
|
+
]}
|
|
276
|
+
/>
|
|
277
|
+
</TabsContext.Provider>
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
expect(screen.getByRole('tab')).toHaveTextContent('Tab one');
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
test('Uses custom overflow tab title text provided via defaultTitleText', () => {
|
|
284
|
+
render(<OverflowTab defaultTitleText="Test" />);
|
|
285
|
+
|
|
286
|
+
expect(screen.getByRole('tab')).toHaveTextContent('Test');
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
test('Uses the selected tab title as the overflow tab title rather than the defaultTitleText when a tab is selected', () => {
|
|
290
|
+
render(
|
|
291
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 1 }}>
|
|
292
|
+
<OverflowTab
|
|
293
|
+
overflowingTabs={[
|
|
294
|
+
{ title: 'Tab one', eventKey: 1, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> }
|
|
295
|
+
]}
|
|
296
|
+
defaultTitleText="Test"
|
|
297
|
+
/>
|
|
298
|
+
</TabsContext.Provider>
|
|
299
|
+
);
|
|
300
|
+
|
|
301
|
+
expect(screen.getByRole('tab')).toHaveTextContent('Tab one');
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
test('Does not have an aria label on the tab by default', () => {
|
|
305
|
+
render(<OverflowTab />);
|
|
306
|
+
|
|
307
|
+
expect(screen.getByRole('tab')).not.toHaveAttribute('aria-label');
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
test('Renders with the toggleAriaLabel as an aria label on the tab', () => {
|
|
311
|
+
render(<OverflowTab toggleAriaLabel="Test aria label" />);
|
|
312
|
+
|
|
313
|
+
expect(screen.getByRole('tab')).toHaveAttribute('aria-label', 'Test aria label');
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
test('Renders the tab with aria-haspopup=menu', () => {
|
|
317
|
+
render(<OverflowTab />);
|
|
318
|
+
|
|
319
|
+
expect(screen.getByRole('tab')).toHaveAttribute('aria-haspopup', 'menu');
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
test('Renders the tab with aria-expanded set to false by default', () => {
|
|
323
|
+
render(<OverflowTab />);
|
|
324
|
+
|
|
325
|
+
expect(screen.getByRole('tab')).toHaveAttribute('aria-expanded', 'false');
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
test('Renders the tab with aria-expanded set to true when the menu is opened', () => {
|
|
329
|
+
render(<OverflowTab />);
|
|
330
|
+
|
|
331
|
+
const overflowTab = screen.getByRole('tab');
|
|
332
|
+
|
|
333
|
+
userEvent.click(overflowTab);
|
|
334
|
+
|
|
335
|
+
expect(overflowTab).toHaveAttribute('aria-expanded', 'true');
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
test('Passes Popper popperMatchesTriggerWidth set to false', () => {
|
|
339
|
+
render(<OverflowTab />);
|
|
340
|
+
|
|
341
|
+
// This assertion relies on the structure of the Popper mock to verify the correct props are being sent to Popper
|
|
342
|
+
expect(screen.getByText('Popper matches trigger width: false')).toBeVisible();
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
test('Passes Popper an appendTo value of the presentation element', () => {
|
|
346
|
+
render(<OverflowTab />);
|
|
347
|
+
|
|
348
|
+
userEvent.click(screen.getByRole('tab'));
|
|
349
|
+
|
|
350
|
+
// This assertion relies on the structure of the Popper mock to verify the correct props are being sent to Popper
|
|
351
|
+
expect(screen.getByText('Append to class name: pf-c-tabs__item pf-m-overflow')).toBeVisible();
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
test('Does not render an overflowing tab as a selected menu item by default', () => {
|
|
355
|
+
render(
|
|
356
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 0 }}>
|
|
357
|
+
<OverflowTab
|
|
358
|
+
overflowingTabs={[
|
|
359
|
+
{ title: 'Tab one', eventKey: 1, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> }
|
|
360
|
+
]}
|
|
361
|
+
/>
|
|
362
|
+
</TabsContext.Provider>
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
userEvent.click(screen.getByRole('tab'));
|
|
366
|
+
|
|
367
|
+
// This assertion relies on the structure of the Popper mock to verify the correct props are being sent to Popper
|
|
368
|
+
expect(screen.queryByText('Selected: true')).not.toBeInTheDocument();
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
test('Renders an overflowing tab as a selected menu item when its key matches the localActiveKey provided via context', () => {
|
|
372
|
+
render(
|
|
373
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 1 }}>
|
|
374
|
+
<OverflowTab
|
|
375
|
+
overflowingTabs={[
|
|
376
|
+
{ title: 'Tab one', eventKey: 1, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> }
|
|
377
|
+
]}
|
|
378
|
+
/>
|
|
379
|
+
</TabsContext.Provider>
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
userEvent.click(screen.getByRole('tab'));
|
|
383
|
+
|
|
384
|
+
// This assertion relies on the structure of the Popper mock to verify the correct props are being sent to Popper
|
|
385
|
+
expect(screen.getByText('Selected: true')).toBeVisible();
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
test('Matches snapshot when expanded', () => {
|
|
389
|
+
const { asFragment } = render(
|
|
390
|
+
<TabsContext.Provider value={{ ...tabsContextDefaultProps, localActiveKey: 1 }}>
|
|
391
|
+
<OverflowTab
|
|
392
|
+
overflowingTabs={[
|
|
393
|
+
{ title: 'Tab one', eventKey: 1, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> },
|
|
394
|
+
{ title: 'Tab two', eventKey: 2, tabContentRef: ('fakeRef' as unknown) as React.RefObject<any> }
|
|
395
|
+
]}
|
|
396
|
+
/>
|
|
397
|
+
</TabsContext.Provider>
|
|
398
|
+
);
|
|
399
|
+
|
|
400
|
+
userEvent.click(screen.getByRole('tab'));
|
|
401
|
+
|
|
402
|
+
expect(asFragment()).toMatchSnapshot();
|
|
403
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Matches snapshot when expanded 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
data-testid="popper-mock"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
data-testid="trigger"
|
|
10
|
+
>
|
|
11
|
+
<li
|
|
12
|
+
class="pf-c-tabs__item pf-m-overflow pf-m-current"
|
|
13
|
+
role="presentation"
|
|
14
|
+
>
|
|
15
|
+
<button
|
|
16
|
+
aria-expanded="true"
|
|
17
|
+
aria-haspopup="menu"
|
|
18
|
+
class="pf-c-tabs__link pf-m-expanded"
|
|
19
|
+
role="tab"
|
|
20
|
+
>
|
|
21
|
+
<span
|
|
22
|
+
class="pf-c-tabs__item-text"
|
|
23
|
+
>
|
|
24
|
+
Tab one
|
|
25
|
+
</span>
|
|
26
|
+
<span
|
|
27
|
+
class="pf-c-tabs__link-toggle-icon"
|
|
28
|
+
>
|
|
29
|
+
<svg
|
|
30
|
+
aria-hidden="true"
|
|
31
|
+
fill="currentColor"
|
|
32
|
+
height="1em"
|
|
33
|
+
role="img"
|
|
34
|
+
style="vertical-align: -0.125em;"
|
|
35
|
+
viewBox="0 0 256 512"
|
|
36
|
+
width="1em"
|
|
37
|
+
>
|
|
38
|
+
<path
|
|
39
|
+
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"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
</span>
|
|
43
|
+
</button>
|
|
44
|
+
</li>
|
|
45
|
+
</div>
|
|
46
|
+
<div
|
|
47
|
+
data-testid="popper"
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
data-testid="menu-mock"
|
|
51
|
+
>
|
|
52
|
+
<div
|
|
53
|
+
data-testid="menu-content-mock"
|
|
54
|
+
>
|
|
55
|
+
<ul
|
|
56
|
+
data-testid="menu-list-mock"
|
|
57
|
+
>
|
|
58
|
+
<li
|
|
59
|
+
id="1-menu-item-mock"
|
|
60
|
+
>
|
|
61
|
+
Tab one
|
|
62
|
+
<p>
|
|
63
|
+
Selected: true
|
|
64
|
+
</p>
|
|
65
|
+
</li>
|
|
66
|
+
<li
|
|
67
|
+
id="2-menu-item-mock"
|
|
68
|
+
>
|
|
69
|
+
Tab two
|
|
70
|
+
<p>
|
|
71
|
+
Selected: false
|
|
72
|
+
</p>
|
|
73
|
+
</li>
|
|
74
|
+
</ul>
|
|
75
|
+
</div>
|
|
76
|
+
<button>
|
|
77
|
+
Select
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<p>
|
|
82
|
+
Popper matches trigger width: false
|
|
83
|
+
</p>
|
|
84
|
+
<p>
|
|
85
|
+
Append to class name: pf-c-tabs__item pf-m-overflow pf-m-current
|
|
86
|
+
</p>
|
|
87
|
+
</div>
|
|
88
|
+
</DocumentFragment>
|
|
89
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|