@patternfly/react-core 4.198.22 → 4.199.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/umd/react-core.min.css +219 -219
- package/package.json +5 -5
- package/src/components/Checkbox/examples/Checkbox.md +11 -115
- package/src/components/Checkbox/examples/CheckboxControlled.tsx +78 -0
- package/src/components/Checkbox/examples/CheckboxDisabled.tsx +9 -0
- package/src/components/Checkbox/examples/CheckboxStandaloneInput.tsx +6 -0
- package/src/components/Checkbox/examples/CheckboxUncontrolled.tsx +9 -0
- package/src/components/Checkbox/examples/CheckboxWithBody.tsx +6 -0
- package/src/components/Checkbox/examples/CheckboxWithDescription.tsx +10 -0
- package/src/components/Checkbox/examples/CheckboxWithDescriptionBody.tsx +11 -0
- package/src/components/Chip/examples/Chip.md +1 -73
- package/src/components/Chip/examples/ChipDefault.tsx +68 -0
- package/src/components/ChipGroup/examples/ChipGroup.md +6 -134
- package/src/components/ChipGroup/examples/ChipGroupInline.tsx +28 -0
- package/src/components/ChipGroup/examples/ChipGroupRemovableCategories.tsx +46 -0
- package/src/components/ChipGroup/examples/ChipGroupWithCategories.tsx +28 -0
- package/src/layouts/Flex/examples/Flex.md +1 -1
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.199.2 (2022-03-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 4.199.1 (2022-03-16)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# 4.199.0 (2022-03-15)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **CodeEditor:** 6226 size to fit height ([#7033](https://github.com/patternfly/patternfly-react/issues/7033)) ([f18abd3](https://github.com/patternfly/patternfly-react/commit/f18abd3020e04ee6602fd168d503f43cc0de649e))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## 4.198.22 (2022-03-14)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @patternfly/react-core
|
|
@@ -17310,225 +17310,6 @@ label.pf-c-radio, .pf-c-radio__label,
|
|
|
17310
17310
|
left: var(--pf-c-skip-to-content--focus--Left);
|
|
17311
17311
|
}
|
|
17312
17312
|
|
|
17313
|
-
.pf-c-slider {
|
|
17314
|
-
--pf-c-slider--value: 0;
|
|
17315
|
-
--pf-c-slider__rail--PaddingTop: var(--pf-global--spacer--md);
|
|
17316
|
-
--pf-c-slider__rail--PaddingBottom: var(--pf-global--spacer--md);
|
|
17317
|
-
--pf-c-slider__rail-track--Height: 0.25rem;
|
|
17318
|
-
--pf-c-slider__rail-track--before--base--BackgroundColor: var(--pf-global--BorderColor--100);
|
|
17319
|
-
--pf-c-slider__rail-track--before--fill--BackgroundColor: var(--pf-global--active-color--300);
|
|
17320
|
-
--pf-c-slider__rail-track--before--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
17321
|
-
--pf-c-slider__rail-track--before--fill--BackgroundColor--gradient-stop: var(--pf-c-slider--value);
|
|
17322
|
-
--pf-c-slider__steps--FontSize: var(--pf-global--FontSize--sm);
|
|
17323
|
-
--pf-c-slider__steps--Height: var(--pf-c-slider__steps--FontSize);
|
|
17324
|
-
--pf-c-slider__step-tick--Top: var(--pf-global--spacer--md);
|
|
17325
|
-
--pf-c-slider__step-tick--Width: 0.25rem;
|
|
17326
|
-
--pf-c-slider__step-tick--Height: 0.25rem;
|
|
17327
|
-
--pf-c-slider__step-tick--BackgroundColor: var(--pf-global--BorderColor--200);
|
|
17328
|
-
--pf-c-slider__step-tick--TranslateX: -50%;
|
|
17329
|
-
--pf-c-slider__step-tick--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
17330
|
-
--pf-c-slider__step--m-active__slider-tick--BackgroundColor: var(--pf-global--primary-color--100);
|
|
17331
|
-
--pf-c-slider__step--first-child__step-tick--TranslateX: 0;
|
|
17332
|
-
--pf-c-slider__step--last-child__step-tick--TranslateX: -100%;
|
|
17333
|
-
--pf-c-slider__step-label--TranslateX: -50%;
|
|
17334
|
-
--pf-c-slider__step-label--Top: calc(var(--pf-global--spacer--xl) + var(--pf-c-slider__rail-track--Height));
|
|
17335
|
-
--pf-c-slider__step--first-child__step-label--TranslateX: 0;
|
|
17336
|
-
--pf-c-slider__step--last-child__step-label--TranslateX: -100%;
|
|
17337
|
-
--pf-c-slider__thumb--Top: calc(var(--pf-c-slider__rail-track--Height) / 2 + var(--pf-global--spacer--md));
|
|
17338
|
-
--pf-c-slider__thumb--Width: 1rem;
|
|
17339
|
-
--pf-c-slider__thumb--Height: 1rem;
|
|
17340
|
-
--pf-c-slider__thumb--Left: var(--pf-c-slider--value);
|
|
17341
|
-
--pf-c-slider__thumb--BackgroundColor: var(--pf-global--primary-color--100);
|
|
17342
|
-
--pf-c-slider__thumb--TranslateX: -50%;
|
|
17343
|
-
--pf-c-slider__thumb--TranslateY: -50%;
|
|
17344
|
-
--pf-c-slider__thumb--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
17345
|
-
--pf-c-slider__thumb--BoxShadow--base:
|
|
17346
|
-
0 0 0 2px var(--pf-global--BackgroundColor--100),
|
|
17347
|
-
0 0 0 3px var(--pf-global--primary-color--100);
|
|
17348
|
-
--pf-c-slider__thumb--hover--BoxShadow: var(--pf-c-slider__thumb--BoxShadow--base);
|
|
17349
|
-
--pf-c-slider__thumb--focus--BoxShadow: var(--pf-c-slider__thumb--BoxShadow--base);
|
|
17350
|
-
--pf-c-slider__thumb--active--BoxShadow:
|
|
17351
|
-
var(--pf-c-slider__thumb--BoxShadow--base),
|
|
17352
|
-
0 0 2px 5px var(--pf-global--active-color--200);
|
|
17353
|
-
--pf-c-slider__thumb--before--Width: var(--pf-global--target-size--MinWidth);
|
|
17354
|
-
--pf-c-slider__thumb--before--Height: var(--pf-global--target-size--MinHeight);
|
|
17355
|
-
--pf-c-slider__thumb--before--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
17356
|
-
--pf-c-slider__thumb--before--TranslateX: -50%;
|
|
17357
|
-
--pf-c-slider__thumb--before--TranslateY: -50%;
|
|
17358
|
-
--pf-c-slider__value--MarginLeft: var(--pf-global--spacer--md);
|
|
17359
|
-
--pf-c-slider__value--c-form-control--width-base: 3.5ch;
|
|
17360
|
-
--pf-c-slider__value--c-form-control--width-chars: 3;
|
|
17361
|
-
--pf-c-slider__value--c-form-control--Width: calc(var(--pf-c-slider__value--c-form-control--width-base) + (var(--pf-c-slider__value--c-form-control--width-chars) * 1ch));
|
|
17362
|
-
--pf-c-slider__value--m-floating--TranslateX: -50%;
|
|
17363
|
-
--pf-c-slider__value--m-floating--TranslateY: -100%;
|
|
17364
|
-
--pf-c-slider__value--m-floating--Left: var(--pf-c-slider--value);
|
|
17365
|
-
--pf-c-slider__value--m-floating--ZIndex: var(--pf-global--ZIndex--sm);
|
|
17366
|
-
--pf-c-slider__actions--MarginRight: var(--pf-global--spacer--sm);
|
|
17367
|
-
--pf-c-slider__main--actions--MarginLeft: var(--pf-global--spacer--sm);
|
|
17368
|
-
--pf-c-slider--m-disabled__rail-track--before--fill--BackgroundColor: var(--pf-global--palette--black-500);
|
|
17369
|
-
--pf-c-slider--m-disabled__step--m-active__slider-tick--BackgroundColor: var(--pf-global--palette--black-700);
|
|
17370
|
-
--pf-c-slider--m-disabled__thumb--BackgroundColor: var(--pf-global--palette--black-700);
|
|
17371
|
-
display: flex;
|
|
17372
|
-
}
|
|
17373
|
-
|
|
17374
|
-
.pf-c-slider.pf-m-disabled {
|
|
17375
|
-
--pf-c-slider__rail-track--before--fill--BackgroundColor: var(--pf-c-slider--m-disabled__rail-track--before--fill--BackgroundColor);
|
|
17376
|
-
--pf-c-slider__step--m-active__slider-tick--BackgroundColor: var(--pf-c-slider--m-disabled__step--m-active__slider-tick--BackgroundColor);
|
|
17377
|
-
--pf-c-slider__thumb--BackgroundColor: var(--pf-c-slider--m-disabled__thumb--BackgroundColor);
|
|
17378
|
-
}
|
|
17379
|
-
|
|
17380
|
-
.pf-c-slider.pf-m-disabled .pf-c-slider__rail,
|
|
17381
|
-
.pf-c-slider.pf-m-disabled .pf-c-slider__thumb {
|
|
17382
|
-
cursor: not-allowed;
|
|
17383
|
-
}
|
|
17384
|
-
|
|
17385
|
-
.pf-c-slider.pf-m-disabled .pf-c-slider__thumb {
|
|
17386
|
-
--pf-c-slider__thumb--BoxShadow: none;
|
|
17387
|
-
}
|
|
17388
|
-
|
|
17389
|
-
.pf-c-slider__main {
|
|
17390
|
-
position: relative;
|
|
17391
|
-
flex-grow: 1;
|
|
17392
|
-
}
|
|
17393
|
-
|
|
17394
|
-
.pf-c-slider__rail {
|
|
17395
|
-
padding-top: var(--pf-c-slider__rail--PaddingTop);
|
|
17396
|
-
padding-bottom: var(--pf-c-slider__rail--PaddingBottom);
|
|
17397
|
-
}
|
|
17398
|
-
|
|
17399
|
-
.pf-c-slider__rail-track {
|
|
17400
|
-
position: relative;
|
|
17401
|
-
height: var(--pf-c-slider__rail-track--Height);
|
|
17402
|
-
}
|
|
17403
|
-
|
|
17404
|
-
.pf-c-slider__rail-track::before {
|
|
17405
|
-
position: absolute;
|
|
17406
|
-
top: 0;
|
|
17407
|
-
right: 0;
|
|
17408
|
-
bottom: 0;
|
|
17409
|
-
left: 0;
|
|
17410
|
-
content: "";
|
|
17411
|
-
background: linear-gradient(to right, var(--pf-c-slider__rail-track--before--fill--BackgroundColor), var(--pf-c-slider__rail-track--before--fill--BackgroundColor) var(--pf-c-slider__rail-track--before--fill--BackgroundColor--gradient-stop), var(--pf-c-slider__rail-track--before--base--BackgroundColor) var(--pf-c-slider__rail-track--before--fill--BackgroundColor--gradient-stop));
|
|
17412
|
-
border-radius: var(--pf-c-slider__rail-track--before--BorderRadius);
|
|
17413
|
-
}
|
|
17414
|
-
|
|
17415
|
-
.pf-c-slider__steps {
|
|
17416
|
-
height: var(--pf-c-slider__steps--Height);
|
|
17417
|
-
font-size: var(--pf-c-slider__steps--FontSize);
|
|
17418
|
-
line-height: 1;
|
|
17419
|
-
}
|
|
17420
|
-
|
|
17421
|
-
.pf-c-slider__step {
|
|
17422
|
-
position: absolute;
|
|
17423
|
-
top: 0;
|
|
17424
|
-
left: var(--pf-c-slider__step--Left);
|
|
17425
|
-
content: "";
|
|
17426
|
-
}
|
|
17427
|
-
|
|
17428
|
-
.pf-c-slider__step.pf-m-active {
|
|
17429
|
-
--pf-c-slider__step-tick--BackgroundColor: var(--pf-c-slider__step--m-active__slider-tick--BackgroundColor);
|
|
17430
|
-
}
|
|
17431
|
-
|
|
17432
|
-
.pf-c-slider__step:first-child {
|
|
17433
|
-
--pf-c-slider__step-tick--TranslateX: var(--pf-c-slider__step--first-child__step-tick--TranslateX);
|
|
17434
|
-
--pf-c-slider__step-label--TranslateX: var(--pf-c-slider__step--first-child__step-label--TranslateX);
|
|
17435
|
-
}
|
|
17436
|
-
|
|
17437
|
-
.pf-c-slider__step:last-child {
|
|
17438
|
-
--pf-c-slider__step-tick--TranslateX: var(--pf-c-slider__step--last-child__step-tick--TranslateX);
|
|
17439
|
-
--pf-c-slider__step-label--TranslateX: var(--pf-c-slider__step--last-child__step-label--TranslateX);
|
|
17440
|
-
}
|
|
17441
|
-
|
|
17442
|
-
.pf-c-slider__step-tick {
|
|
17443
|
-
position: absolute;
|
|
17444
|
-
top: var(--pf-c-slider__step-tick--Top);
|
|
17445
|
-
left: 0;
|
|
17446
|
-
width: var(--pf-c-slider__step-tick--Width);
|
|
17447
|
-
height: var(--pf-c-slider__step-tick--Height);
|
|
17448
|
-
background-color: var(--pf-c-slider__step-tick--BackgroundColor);
|
|
17449
|
-
border-radius: var(--pf-c-slider__step-tick--BorderRadius);
|
|
17450
|
-
transform: translateX(var(--pf-c-slider__step-tick--TranslateX));
|
|
17451
|
-
}
|
|
17452
|
-
|
|
17453
|
-
.pf-c-slider__step-label {
|
|
17454
|
-
position: absolute;
|
|
17455
|
-
top: var(--pf-c-slider__step-label--Top);
|
|
17456
|
-
transform: translateX(var(--pf-c-slider__step-label--TranslateX));
|
|
17457
|
-
}
|
|
17458
|
-
|
|
17459
|
-
.pf-c-slider__thumb {
|
|
17460
|
-
position: absolute;
|
|
17461
|
-
top: var(--pf-c-slider__thumb--Top);
|
|
17462
|
-
left: var(--pf-c-slider__thumb--Left);
|
|
17463
|
-
width: var(--pf-c-slider__thumb--Width);
|
|
17464
|
-
height: var(--pf-c-slider__thumb--Height);
|
|
17465
|
-
cursor: pointer;
|
|
17466
|
-
background-color: var(--pf-c-slider__thumb--BackgroundColor);
|
|
17467
|
-
border-radius: var(--pf-c-slider__thumb--BorderRadius);
|
|
17468
|
-
box-shadow: var(--pf-c-slider__thumb--BoxShadow);
|
|
17469
|
-
transform: translate(var(--pf-c-slider__thumb--TranslateX), var(--pf-c-slider__thumb--TranslateY));
|
|
17470
|
-
}
|
|
17471
|
-
|
|
17472
|
-
.pf-c-slider__thumb::before {
|
|
17473
|
-
position: absolute;
|
|
17474
|
-
top: 50%;
|
|
17475
|
-
left: 50%;
|
|
17476
|
-
width: var(--pf-c-slider__thumb--before--Width);
|
|
17477
|
-
height: var(--pf-c-slider__thumb--before--Height);
|
|
17478
|
-
content: "";
|
|
17479
|
-
border-radius: var(--pf-c-slider__thumb--before--BorderRadius);
|
|
17480
|
-
transform: translate(var(--pf-c-slider__thumb--before--TranslateX), var(--pf-c-slider__thumb--before--TranslateY));
|
|
17481
|
-
}
|
|
17482
|
-
|
|
17483
|
-
.pf-c-slider__thumb:hover {
|
|
17484
|
-
--pf-c-slider__thumb--BoxShadow: var(--pf-c-slider__thumb--hover--BoxShadow);
|
|
17485
|
-
}
|
|
17486
|
-
|
|
17487
|
-
.pf-c-slider__thumb:focus {
|
|
17488
|
-
--pf-c-slider__thumb--BoxShadow: var(--pf-c-slider__thumb--focus--BoxShadow);
|
|
17489
|
-
outline: 0;
|
|
17490
|
-
}
|
|
17491
|
-
|
|
17492
|
-
.pf-c-slider__thumb:active {
|
|
17493
|
-
--pf-c-slider__thumb--BoxShadow: var(--pf-c-slider__thumb--active--BoxShadow);
|
|
17494
|
-
}
|
|
17495
|
-
|
|
17496
|
-
.pf-c-slider__value {
|
|
17497
|
-
margin-left: var(--pf-c-slider__value--MarginLeft);
|
|
17498
|
-
}
|
|
17499
|
-
|
|
17500
|
-
.pf-c-slider__value.pf-m-floating {
|
|
17501
|
-
--pf-c-slider__value--MarginLeft: 0;
|
|
17502
|
-
position: absolute;
|
|
17503
|
-
top: 0;
|
|
17504
|
-
left: var(--pf-c-slider__value--m-floating--Left);
|
|
17505
|
-
z-index: var(--pf-c-slider__value--m-floating--ZIndex);
|
|
17506
|
-
transform: translate(var(--pf-c-slider__value--m-floating--TranslateX), var(--pf-c-slider__value--m-floating--TranslateY));
|
|
17507
|
-
}
|
|
17508
|
-
|
|
17509
|
-
.pf-c-slider__value.pf-m-floating .pf-c-input-group {
|
|
17510
|
-
align-items: center;
|
|
17511
|
-
}
|
|
17512
|
-
|
|
17513
|
-
.pf-c-slider__value.pf-m-floating .pf-c-input-group__text {
|
|
17514
|
-
position: absolute;
|
|
17515
|
-
left: 100%;
|
|
17516
|
-
}
|
|
17517
|
-
|
|
17518
|
-
.pf-c-slider__value .pf-c-form-control {
|
|
17519
|
-
width: var(--pf-c-slider__value--c-form-control--Width);
|
|
17520
|
-
}
|
|
17521
|
-
|
|
17522
|
-
.pf-c-slider__actions {
|
|
17523
|
-
display: flex;
|
|
17524
|
-
margin-right: var(--pf-c-slider__actions--MarginRight);
|
|
17525
|
-
}
|
|
17526
|
-
|
|
17527
|
-
.pf-c-slider__main ~ .pf-c-slider__actions {
|
|
17528
|
-
--pf-c-slider__actions--MarginRight: 0;
|
|
17529
|
-
margin-left: var(--pf-c-slider__main--actions--MarginLeft);
|
|
17530
|
-
}
|
|
17531
|
-
|
|
17532
17313
|
.pf-c-spinner {
|
|
17533
17314
|
--pf-c-spinner--diameter: var(--pf-global--icon--FontSize--xl);
|
|
17534
17315
|
--pf-c-spinner--Width: var(--pf-c-spinner--diameter);
|
|
@@ -17758,6 +17539,225 @@ svg.pf-c-spinner.pf-m-xl {
|
|
|
17758
17539
|
transform: rotate(720deg);
|
|
17759
17540
|
}
|
|
17760
17541
|
}
|
|
17542
|
+
.pf-c-slider {
|
|
17543
|
+
--pf-c-slider--value: 0;
|
|
17544
|
+
--pf-c-slider__rail--PaddingTop: var(--pf-global--spacer--md);
|
|
17545
|
+
--pf-c-slider__rail--PaddingBottom: var(--pf-global--spacer--md);
|
|
17546
|
+
--pf-c-slider__rail-track--Height: 0.25rem;
|
|
17547
|
+
--pf-c-slider__rail-track--before--base--BackgroundColor: var(--pf-global--BorderColor--100);
|
|
17548
|
+
--pf-c-slider__rail-track--before--fill--BackgroundColor: var(--pf-global--active-color--300);
|
|
17549
|
+
--pf-c-slider__rail-track--before--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
17550
|
+
--pf-c-slider__rail-track--before--fill--BackgroundColor--gradient-stop: var(--pf-c-slider--value);
|
|
17551
|
+
--pf-c-slider__steps--FontSize: var(--pf-global--FontSize--sm);
|
|
17552
|
+
--pf-c-slider__steps--Height: var(--pf-c-slider__steps--FontSize);
|
|
17553
|
+
--pf-c-slider__step-tick--Top: var(--pf-global--spacer--md);
|
|
17554
|
+
--pf-c-slider__step-tick--Width: 0.25rem;
|
|
17555
|
+
--pf-c-slider__step-tick--Height: 0.25rem;
|
|
17556
|
+
--pf-c-slider__step-tick--BackgroundColor: var(--pf-global--BorderColor--200);
|
|
17557
|
+
--pf-c-slider__step-tick--TranslateX: -50%;
|
|
17558
|
+
--pf-c-slider__step-tick--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
17559
|
+
--pf-c-slider__step--m-active__slider-tick--BackgroundColor: var(--pf-global--primary-color--100);
|
|
17560
|
+
--pf-c-slider__step--first-child__step-tick--TranslateX: 0;
|
|
17561
|
+
--pf-c-slider__step--last-child__step-tick--TranslateX: -100%;
|
|
17562
|
+
--pf-c-slider__step-label--TranslateX: -50%;
|
|
17563
|
+
--pf-c-slider__step-label--Top: calc(var(--pf-global--spacer--xl) + var(--pf-c-slider__rail-track--Height));
|
|
17564
|
+
--pf-c-slider__step--first-child__step-label--TranslateX: 0;
|
|
17565
|
+
--pf-c-slider__step--last-child__step-label--TranslateX: -100%;
|
|
17566
|
+
--pf-c-slider__thumb--Top: calc(var(--pf-c-slider__rail-track--Height) / 2 + var(--pf-global--spacer--md));
|
|
17567
|
+
--pf-c-slider__thumb--Width: 1rem;
|
|
17568
|
+
--pf-c-slider__thumb--Height: 1rem;
|
|
17569
|
+
--pf-c-slider__thumb--Left: var(--pf-c-slider--value);
|
|
17570
|
+
--pf-c-slider__thumb--BackgroundColor: var(--pf-global--primary-color--100);
|
|
17571
|
+
--pf-c-slider__thumb--TranslateX: -50%;
|
|
17572
|
+
--pf-c-slider__thumb--TranslateY: -50%;
|
|
17573
|
+
--pf-c-slider__thumb--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
17574
|
+
--pf-c-slider__thumb--BoxShadow--base:
|
|
17575
|
+
0 0 0 2px var(--pf-global--BackgroundColor--100),
|
|
17576
|
+
0 0 0 3px var(--pf-global--primary-color--100);
|
|
17577
|
+
--pf-c-slider__thumb--hover--BoxShadow: var(--pf-c-slider__thumb--BoxShadow--base);
|
|
17578
|
+
--pf-c-slider__thumb--focus--BoxShadow: var(--pf-c-slider__thumb--BoxShadow--base);
|
|
17579
|
+
--pf-c-slider__thumb--active--BoxShadow:
|
|
17580
|
+
var(--pf-c-slider__thumb--BoxShadow--base),
|
|
17581
|
+
0 0 2px 5px var(--pf-global--active-color--200);
|
|
17582
|
+
--pf-c-slider__thumb--before--Width: var(--pf-global--target-size--MinWidth);
|
|
17583
|
+
--pf-c-slider__thumb--before--Height: var(--pf-global--target-size--MinHeight);
|
|
17584
|
+
--pf-c-slider__thumb--before--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
17585
|
+
--pf-c-slider__thumb--before--TranslateX: -50%;
|
|
17586
|
+
--pf-c-slider__thumb--before--TranslateY: -50%;
|
|
17587
|
+
--pf-c-slider__value--MarginLeft: var(--pf-global--spacer--md);
|
|
17588
|
+
--pf-c-slider__value--c-form-control--width-base: 3.5ch;
|
|
17589
|
+
--pf-c-slider__value--c-form-control--width-chars: 3;
|
|
17590
|
+
--pf-c-slider__value--c-form-control--Width: calc(var(--pf-c-slider__value--c-form-control--width-base) + (var(--pf-c-slider__value--c-form-control--width-chars) * 1ch));
|
|
17591
|
+
--pf-c-slider__value--m-floating--TranslateX: -50%;
|
|
17592
|
+
--pf-c-slider__value--m-floating--TranslateY: -100%;
|
|
17593
|
+
--pf-c-slider__value--m-floating--Left: var(--pf-c-slider--value);
|
|
17594
|
+
--pf-c-slider__value--m-floating--ZIndex: var(--pf-global--ZIndex--sm);
|
|
17595
|
+
--pf-c-slider__actions--MarginRight: var(--pf-global--spacer--sm);
|
|
17596
|
+
--pf-c-slider__main--actions--MarginLeft: var(--pf-global--spacer--sm);
|
|
17597
|
+
--pf-c-slider--m-disabled__rail-track--before--fill--BackgroundColor: var(--pf-global--palette--black-500);
|
|
17598
|
+
--pf-c-slider--m-disabled__step--m-active__slider-tick--BackgroundColor: var(--pf-global--palette--black-700);
|
|
17599
|
+
--pf-c-slider--m-disabled__thumb--BackgroundColor: var(--pf-global--palette--black-700);
|
|
17600
|
+
display: flex;
|
|
17601
|
+
}
|
|
17602
|
+
|
|
17603
|
+
.pf-c-slider.pf-m-disabled {
|
|
17604
|
+
--pf-c-slider__rail-track--before--fill--BackgroundColor: var(--pf-c-slider--m-disabled__rail-track--before--fill--BackgroundColor);
|
|
17605
|
+
--pf-c-slider__step--m-active__slider-tick--BackgroundColor: var(--pf-c-slider--m-disabled__step--m-active__slider-tick--BackgroundColor);
|
|
17606
|
+
--pf-c-slider__thumb--BackgroundColor: var(--pf-c-slider--m-disabled__thumb--BackgroundColor);
|
|
17607
|
+
}
|
|
17608
|
+
|
|
17609
|
+
.pf-c-slider.pf-m-disabled .pf-c-slider__rail,
|
|
17610
|
+
.pf-c-slider.pf-m-disabled .pf-c-slider__thumb {
|
|
17611
|
+
cursor: not-allowed;
|
|
17612
|
+
}
|
|
17613
|
+
|
|
17614
|
+
.pf-c-slider.pf-m-disabled .pf-c-slider__thumb {
|
|
17615
|
+
--pf-c-slider__thumb--BoxShadow: none;
|
|
17616
|
+
}
|
|
17617
|
+
|
|
17618
|
+
.pf-c-slider__main {
|
|
17619
|
+
position: relative;
|
|
17620
|
+
flex-grow: 1;
|
|
17621
|
+
}
|
|
17622
|
+
|
|
17623
|
+
.pf-c-slider__rail {
|
|
17624
|
+
padding-top: var(--pf-c-slider__rail--PaddingTop);
|
|
17625
|
+
padding-bottom: var(--pf-c-slider__rail--PaddingBottom);
|
|
17626
|
+
}
|
|
17627
|
+
|
|
17628
|
+
.pf-c-slider__rail-track {
|
|
17629
|
+
position: relative;
|
|
17630
|
+
height: var(--pf-c-slider__rail-track--Height);
|
|
17631
|
+
}
|
|
17632
|
+
|
|
17633
|
+
.pf-c-slider__rail-track::before {
|
|
17634
|
+
position: absolute;
|
|
17635
|
+
top: 0;
|
|
17636
|
+
right: 0;
|
|
17637
|
+
bottom: 0;
|
|
17638
|
+
left: 0;
|
|
17639
|
+
content: "";
|
|
17640
|
+
background: linear-gradient(to right, var(--pf-c-slider__rail-track--before--fill--BackgroundColor), var(--pf-c-slider__rail-track--before--fill--BackgroundColor) var(--pf-c-slider__rail-track--before--fill--BackgroundColor--gradient-stop), var(--pf-c-slider__rail-track--before--base--BackgroundColor) var(--pf-c-slider__rail-track--before--fill--BackgroundColor--gradient-stop));
|
|
17641
|
+
border-radius: var(--pf-c-slider__rail-track--before--BorderRadius);
|
|
17642
|
+
}
|
|
17643
|
+
|
|
17644
|
+
.pf-c-slider__steps {
|
|
17645
|
+
height: var(--pf-c-slider__steps--Height);
|
|
17646
|
+
font-size: var(--pf-c-slider__steps--FontSize);
|
|
17647
|
+
line-height: 1;
|
|
17648
|
+
}
|
|
17649
|
+
|
|
17650
|
+
.pf-c-slider__step {
|
|
17651
|
+
position: absolute;
|
|
17652
|
+
top: 0;
|
|
17653
|
+
left: var(--pf-c-slider__step--Left);
|
|
17654
|
+
content: "";
|
|
17655
|
+
}
|
|
17656
|
+
|
|
17657
|
+
.pf-c-slider__step.pf-m-active {
|
|
17658
|
+
--pf-c-slider__step-tick--BackgroundColor: var(--pf-c-slider__step--m-active__slider-tick--BackgroundColor);
|
|
17659
|
+
}
|
|
17660
|
+
|
|
17661
|
+
.pf-c-slider__step:first-child {
|
|
17662
|
+
--pf-c-slider__step-tick--TranslateX: var(--pf-c-slider__step--first-child__step-tick--TranslateX);
|
|
17663
|
+
--pf-c-slider__step-label--TranslateX: var(--pf-c-slider__step--first-child__step-label--TranslateX);
|
|
17664
|
+
}
|
|
17665
|
+
|
|
17666
|
+
.pf-c-slider__step:last-child {
|
|
17667
|
+
--pf-c-slider__step-tick--TranslateX: var(--pf-c-slider__step--last-child__step-tick--TranslateX);
|
|
17668
|
+
--pf-c-slider__step-label--TranslateX: var(--pf-c-slider__step--last-child__step-label--TranslateX);
|
|
17669
|
+
}
|
|
17670
|
+
|
|
17671
|
+
.pf-c-slider__step-tick {
|
|
17672
|
+
position: absolute;
|
|
17673
|
+
top: var(--pf-c-slider__step-tick--Top);
|
|
17674
|
+
left: 0;
|
|
17675
|
+
width: var(--pf-c-slider__step-tick--Width);
|
|
17676
|
+
height: var(--pf-c-slider__step-tick--Height);
|
|
17677
|
+
background-color: var(--pf-c-slider__step-tick--BackgroundColor);
|
|
17678
|
+
border-radius: var(--pf-c-slider__step-tick--BorderRadius);
|
|
17679
|
+
transform: translateX(var(--pf-c-slider__step-tick--TranslateX));
|
|
17680
|
+
}
|
|
17681
|
+
|
|
17682
|
+
.pf-c-slider__step-label {
|
|
17683
|
+
position: absolute;
|
|
17684
|
+
top: var(--pf-c-slider__step-label--Top);
|
|
17685
|
+
transform: translateX(var(--pf-c-slider__step-label--TranslateX));
|
|
17686
|
+
}
|
|
17687
|
+
|
|
17688
|
+
.pf-c-slider__thumb {
|
|
17689
|
+
position: absolute;
|
|
17690
|
+
top: var(--pf-c-slider__thumb--Top);
|
|
17691
|
+
left: var(--pf-c-slider__thumb--Left);
|
|
17692
|
+
width: var(--pf-c-slider__thumb--Width);
|
|
17693
|
+
height: var(--pf-c-slider__thumb--Height);
|
|
17694
|
+
cursor: pointer;
|
|
17695
|
+
background-color: var(--pf-c-slider__thumb--BackgroundColor);
|
|
17696
|
+
border-radius: var(--pf-c-slider__thumb--BorderRadius);
|
|
17697
|
+
box-shadow: var(--pf-c-slider__thumb--BoxShadow);
|
|
17698
|
+
transform: translate(var(--pf-c-slider__thumb--TranslateX), var(--pf-c-slider__thumb--TranslateY));
|
|
17699
|
+
}
|
|
17700
|
+
|
|
17701
|
+
.pf-c-slider__thumb::before {
|
|
17702
|
+
position: absolute;
|
|
17703
|
+
top: 50%;
|
|
17704
|
+
left: 50%;
|
|
17705
|
+
width: var(--pf-c-slider__thumb--before--Width);
|
|
17706
|
+
height: var(--pf-c-slider__thumb--before--Height);
|
|
17707
|
+
content: "";
|
|
17708
|
+
border-radius: var(--pf-c-slider__thumb--before--BorderRadius);
|
|
17709
|
+
transform: translate(var(--pf-c-slider__thumb--before--TranslateX), var(--pf-c-slider__thumb--before--TranslateY));
|
|
17710
|
+
}
|
|
17711
|
+
|
|
17712
|
+
.pf-c-slider__thumb:hover {
|
|
17713
|
+
--pf-c-slider__thumb--BoxShadow: var(--pf-c-slider__thumb--hover--BoxShadow);
|
|
17714
|
+
}
|
|
17715
|
+
|
|
17716
|
+
.pf-c-slider__thumb:focus {
|
|
17717
|
+
--pf-c-slider__thumb--BoxShadow: var(--pf-c-slider__thumb--focus--BoxShadow);
|
|
17718
|
+
outline: 0;
|
|
17719
|
+
}
|
|
17720
|
+
|
|
17721
|
+
.pf-c-slider__thumb:active {
|
|
17722
|
+
--pf-c-slider__thumb--BoxShadow: var(--pf-c-slider__thumb--active--BoxShadow);
|
|
17723
|
+
}
|
|
17724
|
+
|
|
17725
|
+
.pf-c-slider__value {
|
|
17726
|
+
margin-left: var(--pf-c-slider__value--MarginLeft);
|
|
17727
|
+
}
|
|
17728
|
+
|
|
17729
|
+
.pf-c-slider__value.pf-m-floating {
|
|
17730
|
+
--pf-c-slider__value--MarginLeft: 0;
|
|
17731
|
+
position: absolute;
|
|
17732
|
+
top: 0;
|
|
17733
|
+
left: var(--pf-c-slider__value--m-floating--Left);
|
|
17734
|
+
z-index: var(--pf-c-slider__value--m-floating--ZIndex);
|
|
17735
|
+
transform: translate(var(--pf-c-slider__value--m-floating--TranslateX), var(--pf-c-slider__value--m-floating--TranslateY));
|
|
17736
|
+
}
|
|
17737
|
+
|
|
17738
|
+
.pf-c-slider__value.pf-m-floating .pf-c-input-group {
|
|
17739
|
+
align-items: center;
|
|
17740
|
+
}
|
|
17741
|
+
|
|
17742
|
+
.pf-c-slider__value.pf-m-floating .pf-c-input-group__text {
|
|
17743
|
+
position: absolute;
|
|
17744
|
+
left: 100%;
|
|
17745
|
+
}
|
|
17746
|
+
|
|
17747
|
+
.pf-c-slider__value .pf-c-form-control {
|
|
17748
|
+
width: var(--pf-c-slider__value--c-form-control--Width);
|
|
17749
|
+
}
|
|
17750
|
+
|
|
17751
|
+
.pf-c-slider__actions {
|
|
17752
|
+
display: flex;
|
|
17753
|
+
margin-right: var(--pf-c-slider__actions--MarginRight);
|
|
17754
|
+
}
|
|
17755
|
+
|
|
17756
|
+
.pf-c-slider__main ~ .pf-c-slider__actions {
|
|
17757
|
+
--pf-c-slider__actions--MarginRight: 0;
|
|
17758
|
+
margin-left: var(--pf-c-slider__main--actions--MarginLeft);
|
|
17759
|
+
}
|
|
17760
|
+
|
|
17761
17761
|
.pf-c-switch {
|
|
17762
17762
|
--pf-c-switch--FontSize: var(--pf-global--FontSize--md);
|
|
17763
17763
|
--pf-c-switch__label--PaddingLeft: var(--pf-global--spacer--md);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.199.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",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.
|
|
38
|
-
"@patternfly/react-styles": "^4.
|
|
39
|
-
"@patternfly/react-tokens": "^4.
|
|
37
|
+
"@patternfly/react-icons": "^4.50.2",
|
|
38
|
+
"@patternfly/react-styles": "^4.49.2",
|
|
39
|
+
"@patternfly/react-tokens": "^4.51.2",
|
|
40
40
|
"focus-trap": "6.2.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": "57da79b104a7ac151b99b79933cf164ed611cc7d"
|
|
64
64
|
}
|
|
@@ -8,142 +8,38 @@ propComponents: ['Checkbox']
|
|
|
8
8
|
import './checkbox.css';
|
|
9
9
|
|
|
10
10
|
## Examples
|
|
11
|
+
|
|
11
12
|
### Controlled
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import { Checkbox } from '@patternfly/react-core';
|
|
15
|
-
|
|
16
|
-
class ControlledCheckbox extends React.Component {
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super(props);
|
|
19
|
-
this.state = {
|
|
20
|
-
check1: false,
|
|
21
|
-
check2: false,
|
|
22
|
-
check3: false,
|
|
23
|
-
check4: false
|
|
24
|
-
};
|
|
25
|
-
this.handleChange = (checked, event) => {
|
|
26
|
-
const target = event.target;
|
|
27
|
-
const value = target.type === 'checkbox' ? target.checked : target.value;
|
|
28
|
-
const name = target.name;
|
|
29
|
-
this.setState({ [name]: value });
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
componentDidUpdate(_prevProps, prevState) {
|
|
34
|
-
if (prevState.check1 !== this.state.check1 && this.state.check1 !== null) {
|
|
35
|
-
this.setState({
|
|
36
|
-
check2: this.state.check1,
|
|
37
|
-
check3: this.state.check1,
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (prevState.check2 !== this.state.check2 || prevState.check3 !== this.state.check3) {
|
|
42
|
-
this.setState({
|
|
43
|
-
check1: (this.state.check2 && this.state.check3) || (this.state.check2 || this.state.check3 ? null : false)
|
|
44
|
-
})
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
render() {
|
|
49
|
-
return (
|
|
50
|
-
<React.Fragment>
|
|
51
|
-
<Checkbox
|
|
52
|
-
label="Parent CheckBox"
|
|
53
|
-
isChecked={this.state.check1}
|
|
54
|
-
onChange={this.handleChange}
|
|
55
|
-
aria-label="controlled checkbox example"
|
|
56
|
-
id="check-1"
|
|
57
|
-
name="check1"
|
|
58
|
-
/>
|
|
59
|
-
<Checkbox
|
|
60
|
-
className="nested"
|
|
61
|
-
label="Child CheckBox 1"
|
|
62
|
-
isChecked={this.state.check2}
|
|
63
|
-
onChange={this.handleChange}
|
|
64
|
-
aria-label="controlled checkbox example"
|
|
65
|
-
id="check-2"
|
|
66
|
-
name="check2"
|
|
67
|
-
/>
|
|
68
|
-
<Checkbox
|
|
69
|
-
className="nested"
|
|
70
|
-
label="Child CheckBox 2"
|
|
71
|
-
isChecked={this.state.check3}
|
|
72
|
-
onChange={this.handleChange}
|
|
73
|
-
aria-label="controlled checkbox example"
|
|
74
|
-
id="check-3"
|
|
75
|
-
name="check3"
|
|
76
|
-
/>
|
|
77
|
-
<Checkbox
|
|
78
|
-
label="Controlled CheckBox"
|
|
79
|
-
isChecked={this.state.check4}
|
|
80
|
-
onChange={this.handleChange}
|
|
81
|
-
aria-label="controlled checkbox example"
|
|
82
|
-
id="check-4"
|
|
83
|
-
name="check4"
|
|
84
|
-
/>
|
|
85
|
-
</React.Fragment>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
13
|
+
|
|
14
|
+
```ts file='./CheckboxControlled.tsx'
|
|
89
15
|
```
|
|
90
16
|
|
|
91
17
|
### Uncontrolled
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
import { Checkbox } from '@patternfly/react-core';
|
|
95
|
-
|
|
96
|
-
<React.Fragment>
|
|
97
|
-
<Checkbox label="Uncontrolled CheckBox" aria-label="uncontrolled checkbox example" id="check-5" />
|
|
98
|
-
<Checkbox label="Uncontrolled CheckBox" aria-label="uncontrolled checkbox example" id="check-6" />
|
|
99
|
-
</React.Fragment>
|
|
18
|
+
|
|
19
|
+
```ts file='./CheckboxUncontrolled.tsx'
|
|
100
20
|
```
|
|
101
21
|
|
|
102
22
|
### Disabled
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
import { Checkbox } from '@patternfly/react-core';
|
|
106
|
-
|
|
107
|
-
<React.Fragment>
|
|
108
|
-
<Checkbox
|
|
109
|
-
id="check-7"
|
|
110
|
-
label="Disabled CheckBox"
|
|
111
|
-
aria-label="disabled checked checkbox example"
|
|
112
|
-
defaultChecked
|
|
113
|
-
isDisabled
|
|
114
|
-
/>{' '}
|
|
115
|
-
<Checkbox id="check-8" label="Disabled CheckBox" aria-label="disabled checkbox example" isDisabled />
|
|
116
|
-
</React.Fragment>
|
|
23
|
+
|
|
24
|
+
```ts file='./CheckboxDisabled.tsx'
|
|
117
25
|
```
|
|
118
26
|
|
|
119
27
|
### Checkbox with description
|
|
120
|
-
```js
|
|
121
|
-
import React from 'react';
|
|
122
|
-
import { Checkbox } from '@patternfly/react-core';
|
|
123
28
|
|
|
124
|
-
|
|
29
|
+
```ts file='./CheckboxWithDescription.tsx'
|
|
125
30
|
```
|
|
126
31
|
|
|
127
32
|
### Checkbox with body
|
|
128
|
-
```js
|
|
129
|
-
import React from 'react';
|
|
130
|
-
import { Checkbox } from '@patternfly/react-core';
|
|
131
33
|
|
|
132
|
-
|
|
34
|
+
```ts file='./CheckboxWithBody.tsx'
|
|
133
35
|
```
|
|
134
36
|
|
|
135
37
|
### Checkbox with description and body
|
|
136
|
-
```js
|
|
137
|
-
import React from 'react';
|
|
138
|
-
import { Checkbox } from '@patternfly/react-core';
|
|
139
38
|
|
|
140
|
-
|
|
39
|
+
```ts file='./CheckboxWithDescriptionBody.tsx'
|
|
141
40
|
```
|
|
142
41
|
|
|
143
42
|
### Standalone input
|
|
144
|
-
```js
|
|
145
|
-
import React from 'react';
|
|
146
|
-
import { Checkbox } from '@patternfly/react-core';
|
|
147
43
|
|
|
148
|
-
|
|
44
|
+
```ts file='./CheckboxStandaloneInput.tsx'
|
|
149
45
|
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Checkbox } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const CheckboxControlled: React.FunctionComponent = () => {
|
|
5
|
+
const [isChecked1, setIsChecked1] = React.useState<boolean>(false);
|
|
6
|
+
const [isChecked2, setIsChecked2] = React.useState<boolean>(false);
|
|
7
|
+
const [isChecked3, setIsChecked3] = React.useState<boolean>(false);
|
|
8
|
+
const [isChecked4, setIsChecked4] = React.useState<boolean>(false);
|
|
9
|
+
|
|
10
|
+
const handleChange = (checked: boolean, event: React.FormEvent<HTMLInputElement>) => {
|
|
11
|
+
const target = event.currentTarget;
|
|
12
|
+
const name = target.name;
|
|
13
|
+
|
|
14
|
+
switch (name) {
|
|
15
|
+
case 'check1':
|
|
16
|
+
setIsChecked1(checked);
|
|
17
|
+
break;
|
|
18
|
+
case 'check2':
|
|
19
|
+
setIsChecked2(checked);
|
|
20
|
+
break;
|
|
21
|
+
case 'check3':
|
|
22
|
+
setIsChecked3(checked);
|
|
23
|
+
break;
|
|
24
|
+
case 'check4':
|
|
25
|
+
setIsChecked4(checked);
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
console.log(name);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (isChecked1 !== null) {
|
|
35
|
+
setIsChecked2(isChecked1);
|
|
36
|
+
setIsChecked3(isChecked1);
|
|
37
|
+
}
|
|
38
|
+
}, [isChecked1]);
|
|
39
|
+
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
setIsChecked1((isChecked2 && isChecked3) || (isChecked2 || isChecked3 ? null : false));
|
|
42
|
+
}, [isChecked2, isChecked3]);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<React.Fragment>
|
|
46
|
+
<Checkbox
|
|
47
|
+
label="Parent CheckBox"
|
|
48
|
+
isChecked={isChecked1}
|
|
49
|
+
onChange={handleChange}
|
|
50
|
+
id="controlled-check-1"
|
|
51
|
+
name="check1"
|
|
52
|
+
/>
|
|
53
|
+
<Checkbox
|
|
54
|
+
className="nested"
|
|
55
|
+
label="Child CheckBox 1"
|
|
56
|
+
isChecked={isChecked2}
|
|
57
|
+
onChange={handleChange}
|
|
58
|
+
id="controlled-check-2"
|
|
59
|
+
name="check2"
|
|
60
|
+
/>
|
|
61
|
+
<Checkbox
|
|
62
|
+
className="nested"
|
|
63
|
+
label="Child CheckBox 2"
|
|
64
|
+
isChecked={isChecked3}
|
|
65
|
+
onChange={handleChange}
|
|
66
|
+
id="controlled-check-3"
|
|
67
|
+
name="check3"
|
|
68
|
+
/>
|
|
69
|
+
<Checkbox
|
|
70
|
+
label="Controlled CheckBox"
|
|
71
|
+
isChecked={isChecked4}
|
|
72
|
+
onChange={handleChange}
|
|
73
|
+
id="controlled-check-4"
|
|
74
|
+
name="check4"
|
|
75
|
+
/>
|
|
76
|
+
</React.Fragment>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Checkbox } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const CheckboxDisabled: React.FunctionComponent = () => (
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
<Checkbox id="disabled-check-1" label="Disabled CheckBox 1" defaultChecked isDisabled />
|
|
7
|
+
<Checkbox id="disabled-check-2" label="Disabled CheckBox 2" isDisabled />
|
|
8
|
+
</React.Fragment>
|
|
9
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Checkbox } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const CheckboxUncontrolled: React.FunctionComponent = () => (
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
<Checkbox label="Uncontrolled CheckBox 1" id="uncontrolled-check-1" />
|
|
7
|
+
<Checkbox label="Uncontrolled CheckBox 2" id="uncontrolled-check-2" />
|
|
8
|
+
</React.Fragment>
|
|
9
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Checkbox } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const CheckboxWithDescription: React.FunctionComponent = () => (
|
|
5
|
+
<Checkbox
|
|
6
|
+
id="description-check-1"
|
|
7
|
+
label="Checkbox with description"
|
|
8
|
+
description="Single-tenant cloud service hosted and managed by Red Hat that offers high-availability enterprise-grade clusters in a virtual private cloud on AWS or GCP."
|
|
9
|
+
/>
|
|
10
|
+
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Checkbox } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const CheckboxWithDescriptionBody: React.FunctionComponent = () => (
|
|
5
|
+
<Checkbox
|
|
6
|
+
id="description-body-check"
|
|
7
|
+
label="Checkbox with description and body"
|
|
8
|
+
description="Single-tenant cloud service hosted and managed by Red Hat that offers high-availability enterprise-grade clusters in a virtual private cloud on AWS or GCP."
|
|
9
|
+
body="This is where custom content goes."
|
|
10
|
+
/>
|
|
11
|
+
);
|
|
@@ -10,77 +10,5 @@ ouia: true
|
|
|
10
10
|
|
|
11
11
|
### Default
|
|
12
12
|
|
|
13
|
-
```
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import { Badge, Chip } from '@patternfly/react-core';
|
|
16
|
-
|
|
17
|
-
class SingleChip extends React.Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.state = {
|
|
21
|
-
chip: {
|
|
22
|
-
name: 'Chip 1'
|
|
23
|
-
},
|
|
24
|
-
longchip: {
|
|
25
|
-
name: 'Really long chip that goes on and on'
|
|
26
|
-
},
|
|
27
|
-
badgechip: {
|
|
28
|
-
name: 'Chip',
|
|
29
|
-
isRead: true,
|
|
30
|
-
count: 7
|
|
31
|
-
},
|
|
32
|
-
readonlychip: {
|
|
33
|
-
name: 'Read-only chip'
|
|
34
|
-
},
|
|
35
|
-
overflowchip: {
|
|
36
|
-
name: 'Overflow chip'
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
this.deleteItem = id => {
|
|
40
|
-
this.setState({ [id]: null });
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
const { chip, longchip, badgechip, readonlychip, overflowchip } = this.state;
|
|
46
|
-
return (
|
|
47
|
-
<React.Fragment>
|
|
48
|
-
{chip && (
|
|
49
|
-
<React.Fragment>
|
|
50
|
-
<Chip key="chip1" onClick={() => this.deleteItem('chip')}>
|
|
51
|
-
{chip.name}
|
|
52
|
-
</Chip>
|
|
53
|
-
<br /> <br />
|
|
54
|
-
</React.Fragment>
|
|
55
|
-
)}
|
|
56
|
-
{longchip && (
|
|
57
|
-
<React.Fragment>
|
|
58
|
-
<Chip key="chip2" onClick={() => this.deleteItem('longchip')}>
|
|
59
|
-
{longchip.name}
|
|
60
|
-
</Chip>
|
|
61
|
-
<br /> <br />
|
|
62
|
-
</React.Fragment>
|
|
63
|
-
)}
|
|
64
|
-
{badgechip && (
|
|
65
|
-
<React.Fragment>
|
|
66
|
-
<Chip key="chip3" onClick={() => this.deleteItem('badgechip')}>
|
|
67
|
-
{badgechip.name}
|
|
68
|
-
<Badge isRead={badgechip.isRead}>{badgechip.count}</Badge>
|
|
69
|
-
</Chip>
|
|
70
|
-
<br /> <br />
|
|
71
|
-
</React.Fragment>
|
|
72
|
-
)}
|
|
73
|
-
<Chip key="chip4" onClick={() => this.deleteItem('readonlychip')} isReadOnly>
|
|
74
|
-
{readonlychip.name}
|
|
75
|
-
</Chip>
|
|
76
|
-
<br /> <br />
|
|
77
|
-
{overflowchip && (
|
|
78
|
-
<Chip key="chip5" component="button" onClick={() => this.deleteItem('overflowchip')} isOverflowChip>
|
|
79
|
-
{overflowchip.name}
|
|
80
|
-
</Chip>
|
|
81
|
-
)}
|
|
82
|
-
</React.Fragment>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
13
|
+
```ts file='./ChipDefault.tsx'
|
|
86
14
|
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Badge, Chip } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ChipDefault: React.FunctionComponent = () => {
|
|
5
|
+
const [chips, setChips] = React.useState({
|
|
6
|
+
chip: {
|
|
7
|
+
name: 'Chip 1'
|
|
8
|
+
},
|
|
9
|
+
longchip: {
|
|
10
|
+
name: 'Really long chip that goes on and on'
|
|
11
|
+
},
|
|
12
|
+
badgechip: {
|
|
13
|
+
name: 'Chip',
|
|
14
|
+
isRead: true,
|
|
15
|
+
count: 7
|
|
16
|
+
},
|
|
17
|
+
readonlychip: {
|
|
18
|
+
name: 'Read-only chip'
|
|
19
|
+
},
|
|
20
|
+
overflowchip: {
|
|
21
|
+
name: 'Overflow chip'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const deleteItem = (id: string) => {
|
|
26
|
+
setChips({ ...chips, [id]: null });
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const { chip, longchip, badgechip, readonlychip, overflowchip } = chips;
|
|
30
|
+
return (
|
|
31
|
+
<React.Fragment>
|
|
32
|
+
{chip && (
|
|
33
|
+
<React.Fragment>
|
|
34
|
+
<Chip key="chip1" onClick={() => deleteItem('chip')}>
|
|
35
|
+
{chip.name}
|
|
36
|
+
</Chip>
|
|
37
|
+
<br /> <br />
|
|
38
|
+
</React.Fragment>
|
|
39
|
+
)}
|
|
40
|
+
{longchip && (
|
|
41
|
+
<React.Fragment>
|
|
42
|
+
<Chip key="chip2" onClick={() => deleteItem('longchip')}>
|
|
43
|
+
{longchip.name}
|
|
44
|
+
</Chip>
|
|
45
|
+
<br /> <br />
|
|
46
|
+
</React.Fragment>
|
|
47
|
+
)}
|
|
48
|
+
{badgechip && (
|
|
49
|
+
<React.Fragment>
|
|
50
|
+
<Chip key="chip3" onClick={() => deleteItem('badgechip')}>
|
|
51
|
+
{badgechip.name}
|
|
52
|
+
<Badge isRead={badgechip.isRead}>{badgechip.count}</Badge>
|
|
53
|
+
</Chip>
|
|
54
|
+
<br /> <br />
|
|
55
|
+
</React.Fragment>
|
|
56
|
+
)}
|
|
57
|
+
<Chip key="chip4" onClick={() => deleteItem('readonlychip')} isReadOnly>
|
|
58
|
+
{readonlychip.name}
|
|
59
|
+
</Chip>
|
|
60
|
+
<br /> <br />
|
|
61
|
+
{overflowchip && (
|
|
62
|
+
<Chip key="chip5" component="button" onClick={() => deleteItem('overflowchip')} isOverflowChip>
|
|
63
|
+
{overflowchip.name}
|
|
64
|
+
</Chip>
|
|
65
|
+
)}
|
|
66
|
+
</React.Fragment>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
@@ -8,145 +8,17 @@ ouia: true
|
|
|
8
8
|
|
|
9
9
|
## Examples
|
|
10
10
|
|
|
11
|
-
### Simple inline
|
|
11
|
+
### Simple inline
|
|
12
12
|
|
|
13
|
-
```
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import { Chip, ChipGroup } from '@patternfly/react-core';
|
|
16
|
-
|
|
17
|
-
class SimpleInlineChipGroup extends React.Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.state = {
|
|
21
|
-
chips: ['Chip one', 'Really long chip that goes on and on', 'Chip three', 'Chip four', 'Chip five']
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
this.deleteItem = id => {
|
|
25
|
-
const copyOfChips = this.state.chips;
|
|
26
|
-
const index = copyOfChips.indexOf(id);
|
|
27
|
-
if (index !== -1) {
|
|
28
|
-
copyOfChips.splice(index, 1);
|
|
29
|
-
this.setState({ chips: copyOfChips });
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
render() {
|
|
35
|
-
const { chips } = this.state;
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<ChipGroup>
|
|
39
|
-
{chips.map(currentChip => (
|
|
40
|
-
<Chip key={currentChip} onClick={() => this.deleteItem(currentChip)}>
|
|
41
|
-
{currentChip}
|
|
42
|
-
</Chip>
|
|
43
|
-
))}
|
|
44
|
-
</ChipGroup>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
13
|
+
```ts file='./ChipGroupInline.tsx'
|
|
48
14
|
```
|
|
49
15
|
|
|
50
|
-
###
|
|
51
|
-
|
|
52
|
-
```js
|
|
53
|
-
import React from 'react';
|
|
54
|
-
import { Chip, ChipGroup } from '@patternfly/react-core';
|
|
55
|
-
|
|
56
|
-
class SimpleCategoryChipGroup extends React.Component {
|
|
57
|
-
constructor(props) {
|
|
58
|
-
super(props);
|
|
59
|
-
this.state = {
|
|
60
|
-
chips: ['Chip one', 'Chip two', 'Chip three', 'Chip four', 'Chip five']
|
|
61
|
-
};
|
|
62
|
-
this.deleteItem = id => {
|
|
63
|
-
const copyOfChips = this.state.chips;
|
|
64
|
-
const index = copyOfChips.indexOf(id);
|
|
65
|
-
if (index !== -1) {
|
|
66
|
-
copyOfChips.splice(index, 1);
|
|
67
|
-
this.setState({ chips: copyOfChips });
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
render() {
|
|
73
|
-
const { chips } = this.state;
|
|
16
|
+
### With categories
|
|
74
17
|
|
|
75
|
-
|
|
76
|
-
<ChipGroup categoryName="Category one">
|
|
77
|
-
{chips.map(currentChip => (
|
|
78
|
-
<Chip key={currentChip} onClick={() => this.deleteItem(currentChip)}>
|
|
79
|
-
{currentChip}
|
|
80
|
-
</Chip>
|
|
81
|
-
))}
|
|
82
|
-
</ChipGroup>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
18
|
+
```ts file='./ChipGroupWithCategories.tsx'
|
|
86
19
|
```
|
|
87
20
|
|
|
88
|
-
###
|
|
89
|
-
|
|
90
|
-
```js
|
|
91
|
-
import React from 'react';
|
|
92
|
-
import { Chip, ChipGroup } from '@patternfly/react-core';
|
|
93
|
-
|
|
94
|
-
class CategoryChipGroupRemovable extends React.Component {
|
|
95
|
-
constructor(props) {
|
|
96
|
-
super(props);
|
|
97
|
-
this.state = {
|
|
98
|
-
chips: ['Chip one', 'Chip two', 'Chip three'],
|
|
99
|
-
chips2: ['Chip one', 'Chip two', 'Chip three', 'Chip 4']
|
|
100
|
-
};
|
|
101
|
-
this.deleteItem = id => {
|
|
102
|
-
const copyOfChips = this.state.chips;
|
|
103
|
-
const index = copyOfChips.indexOf(id);
|
|
104
|
-
if (index !== -1) {
|
|
105
|
-
copyOfChips.splice(index, 1);
|
|
106
|
-
this.setState({ chips: copyOfChips });
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
this.deleteItem2 = id => {
|
|
111
|
-
const copyOfChips = this.state.chips2;
|
|
112
|
-
const index = copyOfChips.indexOf(id);
|
|
113
|
-
if (index !== -1) {
|
|
114
|
-
copyOfChips.splice(index, 1);
|
|
115
|
-
this.setState({ chips2: copyOfChips });
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
this.deleteCategory = () => {
|
|
120
|
-
this.setState({ chips: [] });
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
this.deleteCategory2 = () => {
|
|
124
|
-
this.setState({ chips2: [] });
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
render() {
|
|
129
|
-
const { chips, chips2 } = this.state;
|
|
21
|
+
### With removable categories
|
|
130
22
|
|
|
131
|
-
|
|
132
|
-
<React.Fragment>
|
|
133
|
-
<ChipGroup categoryName="Category one" isClosable onClick={this.deleteCategory}>
|
|
134
|
-
{chips.map(currentChip => (
|
|
135
|
-
<Chip key={currentChip} onClick={() => this.deleteItem(currentChip)}>
|
|
136
|
-
{currentChip}
|
|
137
|
-
</Chip>
|
|
138
|
-
))}
|
|
139
|
-
</ChipGroup>
|
|
140
|
-
<br /> <br />
|
|
141
|
-
<ChipGroup categoryName="Category two has a very long name" isClosable onClick={this.deleteCategory2}>
|
|
142
|
-
{chips2.map(currentChip => (
|
|
143
|
-
<Chip key={currentChip} onClick={() => this.deleteItem2(currentChip)}>
|
|
144
|
-
{currentChip}
|
|
145
|
-
</Chip>
|
|
146
|
-
))}
|
|
147
|
-
</ChipGroup>
|
|
148
|
-
</React.Fragment>
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
23
|
+
```ts file='./ChipGroupRemovableCategories.tsx'
|
|
152
24
|
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Chip, ChipGroup } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ChipGroupInline: React.FunctionComponent = () => {
|
|
5
|
+
const [chips, setChips] = React.useState([
|
|
6
|
+
'Chip one',
|
|
7
|
+
'Really long chip that goes on and on',
|
|
8
|
+
'Chip three',
|
|
9
|
+
'Chip four',
|
|
10
|
+
'Chip five'
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const deleteItem = (id: string) => {
|
|
14
|
+
const copyOfChips = [...chips];
|
|
15
|
+
const filteredCopy = copyOfChips.filter(chip => chip !== id);
|
|
16
|
+
setChips(filteredCopy);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<ChipGroup>
|
|
21
|
+
{chips.map(currentChip => (
|
|
22
|
+
<Chip key={currentChip} onClick={() => deleteItem(currentChip)}>
|
|
23
|
+
{currentChip}
|
|
24
|
+
</Chip>
|
|
25
|
+
))}
|
|
26
|
+
</ChipGroup>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Chip, ChipGroup } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ChipGroupRemovableCategories: React.FunctionComponent = () => {
|
|
5
|
+
const [chipGroup1, setChipGroup1] = React.useState(['Chip one', 'Chip two', 'Chip three']);
|
|
6
|
+
const [chipGroup2, setChipGroup2] = React.useState(['Chip one', 'Chip two', 'Chip three', 'Chip four']);
|
|
7
|
+
|
|
8
|
+
const deleteItem = (id: string, group: string[]) => {
|
|
9
|
+
const copyOfChips = [...group];
|
|
10
|
+
const filteredCopy = copyOfChips.filter(chip => chip !== id);
|
|
11
|
+
|
|
12
|
+
if (group === chipGroup1) {
|
|
13
|
+
setChipGroup1(filteredCopy);
|
|
14
|
+
} else {
|
|
15
|
+
setChipGroup2(filteredCopy);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const deleteCategory = (group: string[]) => {
|
|
20
|
+
if (group === chipGroup1) {
|
|
21
|
+
setChipGroup1([]);
|
|
22
|
+
} else {
|
|
23
|
+
setChipGroup2([]);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<React.Fragment>
|
|
29
|
+
<ChipGroup categoryName="Category one" isClosable onClick={() => deleteCategory(chipGroup1)}>
|
|
30
|
+
{chipGroup1.map(currentChip => (
|
|
31
|
+
<Chip key={currentChip} onClick={() => deleteItem(currentChip, chipGroup1)}>
|
|
32
|
+
{currentChip}
|
|
33
|
+
</Chip>
|
|
34
|
+
))}
|
|
35
|
+
</ChipGroup>
|
|
36
|
+
<br /> <br />
|
|
37
|
+
<ChipGroup categoryName="Category two has a very long name" isClosable onClick={() => deleteCategory(chipGroup2)}>
|
|
38
|
+
{chipGroup2.map(currentChip => (
|
|
39
|
+
<Chip key={currentChip} onClick={() => deleteItem(currentChip, chipGroup2)}>
|
|
40
|
+
{currentChip}
|
|
41
|
+
</Chip>
|
|
42
|
+
))}
|
|
43
|
+
</ChipGroup>
|
|
44
|
+
</React.Fragment>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Chip, ChipGroup } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ChipGroupWithCategories: React.FunctionComponent = () => {
|
|
5
|
+
const [chips, setChips] = React.useState([
|
|
6
|
+
'Chip one',
|
|
7
|
+
'Really long chip that goes on and on',
|
|
8
|
+
'Chip three',
|
|
9
|
+
'Chip four',
|
|
10
|
+
'Chip five'
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const deleteItem = (id: string) => {
|
|
14
|
+
const copyOfChips = [...chips];
|
|
15
|
+
const filteredCopy = copyOfChips.filter(chip => chip !== id);
|
|
16
|
+
setChips(filteredCopy);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<ChipGroup categoryName="Category one">
|
|
21
|
+
{chips.map(currentChip => (
|
|
22
|
+
<Chip key={currentChip} onClick={() => deleteItem(currentChip)}>
|
|
23
|
+
{currentChip}
|
|
24
|
+
</Chip>
|
|
25
|
+
))}
|
|
26
|
+
</ChipGroup>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -81,7 +81,7 @@ import { Flex, FlexItem } from '@patternfly/react-core';
|
|
|
81
81
|
import React from 'react';
|
|
82
82
|
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
83
83
|
|
|
84
|
-
<Flex spaceItems={{
|
|
84
|
+
<Flex spaceItems={{ default: 'spaceItemsXl' }}>
|
|
85
85
|
<FlexItem>Flex item</FlexItem>
|
|
86
86
|
<FlexItem>Flex item</FlexItem>
|
|
87
87
|
<FlexItem>Flex item</FlexItem>
|