@patternfly/react-docs 7.6.0-prerelease.8 → 7.6.0-prerelease.9
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 +6 -0
- package/LICENSE +21 -0
- package/package.json +12 -11
- package/patternfly-docs/generated/components/about-modal/react.js +0 -149
- package/patternfly-docs/generated/components/accordion/react.js +0 -262
- package/patternfly-docs/generated/components/action-list/react.js +0 -144
- package/patternfly-docs/generated/components/alert/react-demos.js +0 -56
- package/patternfly-docs/generated/components/alert/react.js +0 -1433
- package/patternfly-docs/generated/components/avatar/react.js +0 -166
- package/patternfly-docs/generated/components/back-to-top/react-demos.js +0 -60
- package/patternfly-docs/generated/components/back-to-top/react.js +0 -77
- package/patternfly-docs/generated/components/backdrop/react.js +0 -64
- package/patternfly-docs/generated/components/background-image/react.js +0 -62
- package/patternfly-docs/generated/components/badge/react.js +0 -97
- package/patternfly-docs/generated/components/banner/react-demos.js +0 -57
- package/patternfly-docs/generated/components/banner/react.js +0 -148
- package/patternfly-docs/generated/components/brand/react.js +0 -142
- package/patternfly-docs/generated/components/breadcrumb/react.js +0 -206
- package/patternfly-docs/generated/components/button/react-demos.js +0 -57
- package/patternfly-docs/generated/components/button/react.js +0 -826
- package/patternfly-docs/generated/components/card/react-demos.js +0 -201
- package/patternfly-docs/generated/components/card/react.js +0 -1015
- package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +0 -1350
- package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +0 -1334
- package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +0 -1282
- package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +0 -848
- package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +0 -192
- package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +0 -426
- package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +0 -804
- package/patternfly-docs/generated/components/charts/legends/-Victory.js +0 -3230
- package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +0 -1178
- package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +0 -525
- package/patternfly-docs/generated/components/charts/patterns/-Victory.js +0 -3382
- package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +0 -377
- package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +0 -2475
- package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +0 -538
- package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +0 -1551
- package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +0 -4115
- package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +0 -955
- package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +0 -1173
- package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +0 -1166
- package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +0 -413
- package/patternfly-docs/generated/components/chip/react-deprecated.js +0 -323
- package/patternfly-docs/generated/components/clipboard-copy/react.js +0 -373
- package/patternfly-docs/generated/components/code-block/react.js +0 -148
- package/patternfly-docs/generated/components/code-editor/react.js +0 -659
- package/patternfly-docs/generated/components/compass/react-demos.js +0 -147
- package/patternfly-docs/generated/components/compass/react.js +0 -440
- package/patternfly-docs/generated/components/content/react.js +0 -248
- package/patternfly-docs/generated/components/data-list/react-demos.js +0 -90
- package/patternfly-docs/generated/components/data-list/react.js +0 -709
- package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +0 -283
- package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +0 -64
- package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +0 -83
- package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +0 -395
- package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +0 -241
- package/patternfly-docs/generated/components/description-list/react-demos.js +0 -58
- package/patternfly-docs/generated/components/description-list/react.js +0 -743
- package/patternfly-docs/generated/components/divider/react.js +0 -126
- package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +0 -351
- package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +0 -184
- package/patternfly-docs/generated/components/drag-and-drop/react.js +0 -137
- package/patternfly-docs/generated/components/drawer/react.js +0 -598
- package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +0 -772
- package/patternfly-docs/generated/components/dual-list-selector/react.js +0 -594
- package/patternfly-docs/generated/components/empty-state/react.js +0 -199
- package/patternfly-docs/generated/components/expandable-section/react-demos.js +0 -65
- package/patternfly-docs/generated/components/expandable-section/react.js +0 -408
- package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +0 -52
- package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +0 -398
- package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +0 -749
- package/patternfly-docs/generated/components/forms/checkbox/react.js +0 -222
- package/patternfly-docs/generated/components/forms/form/react.js +0 -1106
- package/patternfly-docs/generated/components/forms/form-select/react.js +0 -208
- package/patternfly-docs/generated/components/forms/radio/react.js +0 -212
- package/patternfly-docs/generated/components/forms/text-area/react.js +0 -160
- package/patternfly-docs/generated/components/forms/text-input/react.js +0 -216
- package/patternfly-docs/generated/components/helper-text/react-demos.js +0 -180
- package/patternfly-docs/generated/components/helper-text/react.js +0 -164
- package/patternfly-docs/generated/components/hero/react.js +0 -88
- package/patternfly-docs/generated/components/hint/react.js +0 -169
- package/patternfly-docs/generated/components/icon/react.js +0 -215
- package/patternfly-docs/generated/components/input-group/react.js +0 -182
- package/patternfly-docs/generated/components/jump-links/react-demos.js +0 -154
- package/patternfly-docs/generated/components/jump-links/react.js +0 -212
- package/patternfly-docs/generated/components/label/react-demos.js +0 -57
- package/patternfly-docs/generated/components/label/react.js +0 -417
- package/patternfly-docs/generated/components/list/react.js +0 -175
- package/patternfly-docs/generated/components/login-page/react.js +0 -587
- package/patternfly-docs/generated/components/masthead/react-demos.js +0 -79
- package/patternfly-docs/generated/components/masthead/react.js +0 -291
- package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +0 -769
- package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +0 -665
- package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +0 -187
- package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +0 -163
- package/patternfly-docs/generated/components/menus/dropdown/react.js +0 -998
- package/patternfly-docs/generated/components/menus/menu/react.js +0 -1540
- package/patternfly-docs/generated/components/menus/menu-toggle/react.js +0 -747
- package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +0 -508
- package/patternfly-docs/generated/components/menus/select/react-templates.js +0 -257
- package/patternfly-docs/generated/components/menus/select/react.js +0 -998
- package/patternfly-docs/generated/components/modal/react-deprecated.js +0 -554
- package/patternfly-docs/generated/components/modal/react.js +0 -597
- package/patternfly-docs/generated/components/navigation/react-demos.js +0 -356
- package/patternfly-docs/generated/components/navigation/react.js +0 -409
- package/patternfly-docs/generated/components/notification-badge/react.js +0 -196
- package/patternfly-docs/generated/components/notification-drawer/react-demos.js +0 -107
- package/patternfly-docs/generated/components/notification-drawer/react.js +0 -394
- package/patternfly-docs/generated/components/number-input/react.js +0 -210
- package/patternfly-docs/generated/components/overflow-menu/react.js +0 -274
- package/patternfly-docs/generated/components/page/react-demos.js +0 -149
- package/patternfly-docs/generated/components/page/react.js +0 -1352
- package/patternfly-docs/generated/components/pagination/react.js +0 -492
- package/patternfly-docs/generated/components/panel/react.js +0 -236
- package/patternfly-docs/generated/components/popover/react.js +0 -390
- package/patternfly-docs/generated/components/progress/react-demos.js +0 -59
- package/patternfly-docs/generated/components/progress/react.js +0 -283
- package/patternfly-docs/generated/components/progress-stepper/react-demos.js +0 -45
- package/patternfly-docs/generated/components/progress-stepper/react.js +0 -219
- package/patternfly-docs/generated/components/search-input/react-demos.js +0 -113
- package/patternfly-docs/generated/components/search-input/react.js +0 -263
- package/patternfly-docs/generated/components/sidebar/react.js +0 -236
- package/patternfly-docs/generated/components/simple-list/react.js +0 -200
- package/patternfly-docs/generated/components/skeleton/react-demos.js +0 -44
- package/patternfly-docs/generated/components/skeleton/react.js +0 -122
- package/patternfly-docs/generated/components/skip-to-content/react.js +0 -73
- package/patternfly-docs/generated/components/slider/react.js +0 -309
- package/patternfly-docs/generated/components/spinner/react.js +0 -111
- package/patternfly-docs/generated/components/switch/react.js +0 -163
- package/patternfly-docs/generated/components/table/react-demos.js +0 -355
- package/patternfly-docs/generated/components/table/react-deprecated.js +0 -1350
- package/patternfly-docs/generated/components/table/react.js +0 -3241
- package/patternfly-docs/generated/components/tabs/react-demos.js +0 -108
- package/patternfly-docs/generated/components/tabs/react.js +0 -1359
- package/patternfly-docs/generated/components/text-input-group/react-demos.js +0 -152
- package/patternfly-docs/generated/components/text-input-group/react.js +0 -278
- package/patternfly-docs/generated/components/tile/react-deprecated.js +0 -242
- package/patternfly-docs/generated/components/timestamp/react.js +0 -283
- package/patternfly-docs/generated/components/title/react.js +0 -94
- package/patternfly-docs/generated/components/toggle-group/react.js +0 -299
- package/patternfly-docs/generated/components/toolbar/react-demos.js +0 -66
- package/patternfly-docs/generated/components/toolbar/react.js +0 -932
- package/patternfly-docs/generated/components/tooltip/react.js +0 -241
- package/patternfly-docs/generated/components/tree-view/react.js +0 -429
- package/patternfly-docs/generated/components/truncate/react.js +0 -211
- package/patternfly-docs/generated/components/wizard/react-demos.js +0 -87
- package/patternfly-docs/generated/components/wizard/react-deprecated.js +0 -788
- package/patternfly-docs/generated/components/wizard/react.js +0 -986
- package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +0 -285
- package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +0 -70
- package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +0 -506
- package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +0 -94
- package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +0 -272
- package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +0 -87
- package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +0 -124
- package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +0 -112
- package/patternfly-docs/generated/index.js +0 -1769
- package/patternfly-docs/generated/patterns/card-view/react-demos.js +0 -78
- package/patternfly-docs/generated/patterns/filters/react-demos.js +0 -141
- package/patternfly-docs/generated/patterns/password-generator/react-demos.js +0 -51
- package/patternfly-docs/generated/patterns/password-strength/react-demos.js +0 -61
- package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +0 -124
- package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +0 -81
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
|
|
3
|
-
import { Fragment, useState } from 'react';
|
|
4
|
-
const pageData = {
|
|
5
|
-
"id": "Chip",
|
|
6
|
-
"section": "components",
|
|
7
|
-
"subsection": "",
|
|
8
|
-
"deprecated": true,
|
|
9
|
-
"template": false,
|
|
10
|
-
"beta": false,
|
|
11
|
-
"demo": false,
|
|
12
|
-
"newImplementationLink": false,
|
|
13
|
-
"source": "react-deprecated",
|
|
14
|
-
"tabName": null,
|
|
15
|
-
"slug": "/components/chip/react-deprecated",
|
|
16
|
-
"sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/deprecated/components/Chip/examples/Chip.md",
|
|
17
|
-
"relPath": "packages/react-core/src/deprecated/components/Chip/examples/Chip.md",
|
|
18
|
-
"propComponents": [
|
|
19
|
-
{
|
|
20
|
-
"name": "Chip",
|
|
21
|
-
"description": "",
|
|
22
|
-
"props": [
|
|
23
|
-
{
|
|
24
|
-
"name": "badge",
|
|
25
|
-
"type": "React.ReactNode",
|
|
26
|
-
"description": "Badge to add to the chip. The badge will be rendered after the chip text."
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"name": "children",
|
|
30
|
-
"type": "React.ReactNode",
|
|
31
|
-
"description": "Content rendered inside the label."
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "className",
|
|
35
|
-
"type": "string",
|
|
36
|
-
"description": "Additional classes added to the label.",
|
|
37
|
-
"defaultValue": "''"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "closeBtn",
|
|
41
|
-
"type": "React.ReactNode",
|
|
42
|
-
"description": "Node for custom close button."
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "closeBtnAriaLabel",
|
|
46
|
-
"type": "string",
|
|
47
|
-
"description": "Aria label for close button"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"name": "closeBtnProps",
|
|
51
|
-
"type": "any",
|
|
52
|
-
"description": "Additional properties for the default close button."
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "color",
|
|
56
|
-
"type": "'blue' | 'teal' | 'green' | 'orange' | 'purple' | 'red' | 'orangered' | 'grey' | 'yellow' | LabelColor",
|
|
57
|
-
"description": "Color of the label."
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"name": "component",
|
|
61
|
-
"type": "React.ReactNode",
|
|
62
|
-
"description": "Component that will be used for chip. It is recommended that <button> or <li> are used when the chip is an overflow chip.",
|
|
63
|
-
"deprecated": true
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"name": "editableProps",
|
|
67
|
-
"type": "any",
|
|
68
|
-
"description": "Additional props passed to the editable label text div. Optionally passing onInput and onBlur callbacks will allow finer custom text input control."
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "href",
|
|
72
|
-
"type": "string",
|
|
73
|
-
"description": "Href for a label that is a link. If present, the label will change to an anchor element. This should not be passed in if the onClick prop is also passed in."
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"name": "icon",
|
|
77
|
-
"type": "React.ReactNode",
|
|
78
|
-
"description": "Icon added to the left of the label text. Overrides the icon set by the status property."
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"name": "isClickable",
|
|
82
|
-
"type": "boolean",
|
|
83
|
-
"description": "Flag indicating the label is clickable. This flag will automatically be set if a href is passed, or if an onClick handler is passed and the label is not an overflow or add variant. This should be manually set when using the render prop."
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": "isCompact",
|
|
87
|
-
"type": "boolean",
|
|
88
|
-
"description": "Flag indicating the label is compact."
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"name": "isDisabled",
|
|
92
|
-
"type": "boolean",
|
|
93
|
-
"description": "Flag indicating the label is disabled. Works only on clickable labels, so either href or onClick props must be passed in."
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"name": "isEditable",
|
|
97
|
-
"type": "boolean",
|
|
98
|
-
"description": "Flag indicating the label is editable."
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"name": "isOverflowChip",
|
|
102
|
-
"type": "boolean",
|
|
103
|
-
"description": "Flag indicating if the chip is an overflow chip",
|
|
104
|
-
"defaultValue": "false"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"name": "isReadOnly",
|
|
108
|
-
"type": "boolean",
|
|
109
|
-
"description": "Flag indicating if chip is read only",
|
|
110
|
-
"defaultValue": "false"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"name": "onClick",
|
|
114
|
-
"type": "(event: React.MouseEvent) => void",
|
|
115
|
-
"description": "Callback for when the label is clicked. This should not be passed in if the href or isEditable props are also passed in.",
|
|
116
|
-
"defaultValue": "(_e: React.MouseEvent) => undefined as any"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"name": "onClose",
|
|
120
|
-
"type": "(event: React.MouseEvent) => void",
|
|
121
|
-
"description": "Close click callback for removable labels. If present, label will have a close button."
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"name": "onEditCancel",
|
|
125
|
-
"type": "(event: KeyboardEvent, previousText: string) => void",
|
|
126
|
-
"description": "Callback when an editable label cancels an edit."
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"name": "onEditComplete",
|
|
130
|
-
"type": "(event: MouseEvent | KeyboardEvent, newText: string) => void",
|
|
131
|
-
"description": "Callback when an editable label completes an edit."
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"name": "ouiaId",
|
|
135
|
-
"type": "number | string",
|
|
136
|
-
"description": "Value to overwrite the randomly generated data-ouia-component-id."
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"name": "ouiaSafe",
|
|
140
|
-
"type": "boolean",
|
|
141
|
-
"description": ""
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"name": "render",
|
|
145
|
-
"type": "({\n className,\n content,\n componentRef\n}: {\n className: string;\n content: React.ReactNode;\n componentRef: any;\n}) => React.ReactNode",
|
|
146
|
-
"description": "Forwards the label content and className to rendered function. Use this prop for react router support."
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"name": "status",
|
|
150
|
-
"type": "'success' | 'warning' | 'danger' | 'info' | 'custom'",
|
|
151
|
-
"description": "Status of the label with a respective icon and color. Overrides the color set by the color property."
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"name": "textMaxWidth",
|
|
155
|
-
"type": "string",
|
|
156
|
-
"description": "The max width of the label before it is truncated. Can be any valid CSS unit, such as '100%', '100px', or '16ch'.",
|
|
157
|
-
"defaultValue": "'16ch'"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"name": "tooltipPosition",
|
|
161
|
-
"type": "| TooltipPosition\n| 'auto'\n| 'top'\n| 'bottom'\n| 'left'\n| 'right'\n| 'top-start'\n| 'top-end'\n| 'bottom-start'\n| 'bottom-end'\n| 'left-start'\n| 'left-end'\n| 'right-start'\n| 'right-end'",
|
|
162
|
-
"description": "Position of the tooltip which is displayed if text is truncated",
|
|
163
|
-
"defaultValue": "'top'"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"name": "variant",
|
|
167
|
-
"type": "'outline' | 'filled' | 'overflow' | 'add'",
|
|
168
|
-
"description": "Variant of the label."
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"name": "ChipGroup",
|
|
174
|
-
"description": "",
|
|
175
|
-
"props": [
|
|
176
|
-
{
|
|
177
|
-
"name": "aria-label",
|
|
178
|
-
"type": "string",
|
|
179
|
-
"description": "Aria label for chip group that does not have a category name",
|
|
180
|
-
"defaultValue": "'Chip group category'"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"name": "categoryName",
|
|
184
|
-
"type": "string",
|
|
185
|
-
"description": "Category name text for the chip group category. If this prop is supplied the chip group with have a label and category styling applied",
|
|
186
|
-
"defaultValue": "''"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"name": "children",
|
|
190
|
-
"type": "React.ReactNode",
|
|
191
|
-
"description": "Content rendered inside the chip group. Should be <Chip> elements."
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"name": "className",
|
|
195
|
-
"type": "string",
|
|
196
|
-
"description": "Additional classes added to the chip item"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"name": "closeBtnAriaLabel",
|
|
200
|
-
"type": "string",
|
|
201
|
-
"description": "Aria label for close button",
|
|
202
|
-
"defaultValue": "'Close chip group'"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"name": "collapsedText",
|
|
206
|
-
"type": "string",
|
|
207
|
-
"description": "Customizable template string. Use variable \"${remaining}\" for the overflow chip count.",
|
|
208
|
-
"defaultValue": "'${remaining} more'"
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"name": "defaultIsOpen",
|
|
212
|
-
"type": "boolean",
|
|
213
|
-
"description": "Flag for having the chip group default to expanded",
|
|
214
|
-
"defaultValue": "false"
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
"name": "expandedText",
|
|
218
|
-
"type": "string",
|
|
219
|
-
"description": "Customizable \"Show Less\" text string",
|
|
220
|
-
"defaultValue": "'Show Less'"
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"name": "isClosable",
|
|
224
|
-
"type": "boolean",
|
|
225
|
-
"description": "Flag if chip group can be closed",
|
|
226
|
-
"defaultValue": "false"
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
"name": "numChips",
|
|
230
|
-
"type": "number",
|
|
231
|
-
"description": "Set number of chips to show before overflow",
|
|
232
|
-
"defaultValue": "3"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"name": "onClick",
|
|
236
|
-
"type": "(event: React.MouseEvent) => void",
|
|
237
|
-
"description": "Function that is called when clicking on the chip group close button or on an overflow chip"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"name": "onOverflowChipClick",
|
|
241
|
-
"type": "(event: React.MouseEvent) => void",
|
|
242
|
-
"description": "Function that is called when clicking on the overflow (expand/collapse) chip button",
|
|
243
|
-
"deprecated": true
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
"name": "ouiaId",
|
|
247
|
-
"type": "number | string",
|
|
248
|
-
"description": "Value to overwrite the randomly generated data-ouia-component-id."
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"name": "ouiaSafe",
|
|
252
|
-
"type": "boolean",
|
|
253
|
-
"description": ""
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"name": "tooltipPosition",
|
|
257
|
-
"type": "| TooltipPosition\n| 'auto'\n| 'top'\n| 'bottom'\n| 'left'\n| 'right'\n| 'top-start'\n| 'top-end'\n| 'bottom-start'\n| 'bottom-end'\n| 'left-start'\n| 'left-end'\n| 'right-start'\n| 'right-end'",
|
|
258
|
-
"description": "Position of the tooltip which is displayed if the category name text is longer",
|
|
259
|
-
"defaultValue": "'top'"
|
|
260
|
-
}
|
|
261
|
-
]
|
|
262
|
-
}
|
|
263
|
-
],
|
|
264
|
-
"cssPrefix": [
|
|
265
|
-
"pf-v6-c-chip",
|
|
266
|
-
"pf-v6-c-chip-group"
|
|
267
|
-
],
|
|
268
|
-
"examples": [
|
|
269
|
-
"Chip variants",
|
|
270
|
-
"Chip groups",
|
|
271
|
-
"Chip groups with categories",
|
|
272
|
-
"Chip groups with removable categories"
|
|
273
|
-
]
|
|
274
|
-
};
|
|
275
|
-
pageData.liveContext = {
|
|
276
|
-
Fragment,
|
|
277
|
-
useState
|
|
278
|
-
};
|
|
279
|
-
pageData.examples = {
|
|
280
|
-
'Chip variants': props =>
|
|
281
|
-
<Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport { Badge } from '@patternfly/react-core';\nimport { Chip } from '@patternfly/react-core/deprecated';\n\nexport const ChipDefault: React.FunctionComponent = () => {\n const [chips, setChips] = useState({\n chip: {\n name: 'Chip 1'\n },\n longchip: {\n name: 'Really long chip that goes on and on'\n },\n badgechip: {\n name: 'Chip',\n isRead: true,\n count: 7\n },\n readonlychip: {\n name: 'Read-only chip'\n },\n overflowchip: {\n name: 'Overflow chip'\n }\n });\n\n const deleteItem = (id: string) => {\n setChips({ ...chips, [id]: null });\n };\n\n const { chip, longchip, badgechip, readonlychip, overflowchip } = chips;\n return (\n <Fragment>\n {chip && (\n <Fragment>\n <Chip key=\"chip1\" onClick={() => deleteItem('chip')}>\n {chip.name}\n </Chip>\n <br /> <br />\n </Fragment>\n )}\n {longchip && (\n <Fragment>\n <Chip key=\"chip2\" onClick={() => deleteItem('longchip')}>\n {longchip.name}\n </Chip>\n <br /> <br />\n </Fragment>\n )}\n {badgechip && (\n <Fragment>\n <Chip\n key=\"chip3\"\n onClick={() => deleteItem('badgechip')}\n badge={<Badge isRead={badgechip.isRead}>{badgechip.count}</Badge>}\n >\n {badgechip.name}\n </Chip>\n <br /> <br />\n </Fragment>\n )}\n <Chip key=\"chip4\" onClick={() => deleteItem('readonlychip')} isReadOnly>\n {readonlychip.name}\n </Chip>\n <br /> <br />\n {overflowchip && (\n <Chip key=\"chip5\" component=\"button\" onClick={() => deleteItem('overflowchip')} isOverflowChip>\n {overflowchip.name}\n </Chip>\n )}\n </Fragment>\n );\n};\n","title":"Chip variants","lang":"ts","className":""}}>
|
|
282
|
-
|
|
283
|
-
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
|
|
284
|
-
{`Chips can be removable or read-only. The Overflow chip is a special chip that is used to expand or collapse the content of a chip group.`}
|
|
285
|
-
</p>
|
|
286
|
-
</Example>,
|
|
287
|
-
'Chip groups': props =>
|
|
288
|
-
<Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Chip, ChipGroup } from '@patternfly/react-core/deprecated';\n\nexport const ChipGroupInline: React.FunctionComponent = () => {\n const [chips, setChips] = useState([\n 'Chip one',\n 'Really long chip that goes on and on',\n 'Chip three',\n 'Chip four',\n 'Chip five'\n ]);\n\n const deleteItem = (id: string) => {\n const copyOfChips = [...chips];\n const filteredCopy = copyOfChips.filter((chip) => chip !== id);\n setChips(filteredCopy);\n };\n\n return (\n <ChipGroup>\n {chips.map((currentChip) => (\n <Chip key={currentChip} onClick={() => deleteItem(currentChip)}>\n {currentChip}\n </Chip>\n ))}\n </ChipGroup>\n );\n};\n","title":"Chip groups","lang":"ts","className":""}}>
|
|
289
|
-
|
|
290
|
-
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
|
|
291
|
-
{`A chip group is a collection of chips that can be grouped by category and used to represent one or more values assigned to a single attribute. When the value of `}
|
|
292
|
-
|
|
293
|
-
<code {...{"className":"ws-code "}}>
|
|
294
|
-
{`numChips`}
|
|
295
|
-
</code>
|
|
296
|
-
{` is exceeded, additional chips will be hidden using an overflow chip.`}
|
|
297
|
-
</p>
|
|
298
|
-
</Example>,
|
|
299
|
-
'Chip groups with categories': props =>
|
|
300
|
-
<Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Chip, ChipGroup } from '@patternfly/react-core/deprecated';\n\nexport const ChipGroupWithCategories: React.FunctionComponent = () => {\n const [chips, setChips] = useState([\n 'Chip one',\n 'Really long chip that goes on and on',\n 'Chip three',\n 'Chip four',\n 'Chip five'\n ]);\n\n const deleteItem = (id: string) => {\n const copyOfChips = [...chips];\n const filteredCopy = copyOfChips.filter((chip) => chip !== id);\n setChips(filteredCopy);\n };\n\n return (\n <ChipGroup categoryName=\"Category one\">\n {chips.map((currentChip) => (\n <Chip key={currentChip} onClick={() => deleteItem(currentChip)}>\n {currentChip}\n </Chip>\n ))}\n </ChipGroup>\n );\n};\n","title":"Chip groups with categories","lang":"ts","className":""}}>
|
|
301
|
-
|
|
302
|
-
</Example>,
|
|
303
|
-
'Chip groups with removable categories': props =>
|
|
304
|
-
<Example {...pageData} {...props} {...{"code":"import { Fragment, useState } from 'react';\nimport { Chip, ChipGroup } from '@patternfly/react-core/deprecated';\n\nexport const ChipGroupRemovableCategories: React.FunctionComponent = () => {\n const [chipGroup1, setChipGroup1] = useState(['Chip one', 'Chip two', 'Chip three']);\n const [chipGroup2, setChipGroup2] = useState(['Chip one', 'Chip two', 'Chip three', 'Chip four']);\n\n const deleteItem = (id: string, group: string[]) => {\n const copyOfChips = [...group];\n const filteredCopy = copyOfChips.filter((chip) => chip !== id);\n\n if (group === chipGroup1) {\n setChipGroup1(filteredCopy);\n } else {\n setChipGroup2(filteredCopy);\n }\n };\n\n const deleteCategory = (group: string[]) => {\n if (group === chipGroup1) {\n setChipGroup1([]);\n } else {\n setChipGroup2([]);\n }\n };\n\n return (\n <Fragment>\n <ChipGroup categoryName=\"Category one\" isClosable onClick={() => deleteCategory(chipGroup1)}>\n {chipGroup1.map((currentChip) => (\n <Chip key={currentChip} onClick={() => deleteItem(currentChip, chipGroup1)}>\n {currentChip}\n </Chip>\n ))}\n </ChipGroup>\n <br /> <br />\n <ChipGroup categoryName=\"Category two has a very long name\" isClosable onClick={() => deleteCategory(chipGroup2)}>\n {chipGroup2.map((currentChip) => (\n <Chip key={currentChip} onClick={() => deleteItem(currentChip, chipGroup2)}>\n {currentChip}\n </Chip>\n ))}\n </ChipGroup>\n </Fragment>\n );\n};\n","title":"Chip groups with removable categories","lang":"ts","className":""}}>
|
|
305
|
-
|
|
306
|
-
</Example>
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
const Component = () => (
|
|
310
|
-
<React.Fragment>
|
|
311
|
-
<AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
|
|
312
|
-
{`Examples`}
|
|
313
|
-
</AutoLinkHeader>
|
|
314
|
-
{React.createElement(pageData.examples["Chip variants"])}
|
|
315
|
-
{React.createElement(pageData.examples["Chip groups"])}
|
|
316
|
-
{React.createElement(pageData.examples["Chip groups with categories"])}
|
|
317
|
-
{React.createElement(pageData.examples["Chip groups with removable categories"])}
|
|
318
|
-
</React.Fragment>
|
|
319
|
-
);
|
|
320
|
-
Component.displayName = 'ComponentsChipReactDeprecatedDocs';
|
|
321
|
-
Component.pageData = pageData;
|
|
322
|
-
|
|
323
|
-
export default Component;
|