@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,394 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
5
|
-
import RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';
|
|
6
|
-
const pageData = {
|
|
7
|
-
"id": "Notification drawer",
|
|
8
|
-
"section": "components",
|
|
9
|
-
"subsection": "",
|
|
10
|
-
"deprecated": false,
|
|
11
|
-
"template": false,
|
|
12
|
-
"beta": false,
|
|
13
|
-
"demo": false,
|
|
14
|
-
"newImplementationLink": false,
|
|
15
|
-
"source": "react",
|
|
16
|
-
"tabName": null,
|
|
17
|
-
"slug": "/components/notification-drawer/react",
|
|
18
|
-
"sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/components/NotificationDrawer/examples/NotificationDrawer.md",
|
|
19
|
-
"relPath": "packages/react-core/src/components/NotificationDrawer/examples/NotificationDrawer.md",
|
|
20
|
-
"propComponents": [
|
|
21
|
-
{
|
|
22
|
-
"name": "NotificationDrawer",
|
|
23
|
-
"description": "",
|
|
24
|
-
"props": [
|
|
25
|
-
{
|
|
26
|
-
"name": "children",
|
|
27
|
-
"type": "React.ReactNode",
|
|
28
|
-
"description": "Content rendered inside the notification drawer"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"name": "className",
|
|
32
|
-
"type": "string",
|
|
33
|
-
"description": "Additional classes added to the notification drawer"
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"name": "NotificationDrawerBody",
|
|
39
|
-
"description": "",
|
|
40
|
-
"props": [
|
|
41
|
-
{
|
|
42
|
-
"name": "children",
|
|
43
|
-
"type": "React.ReactNode",
|
|
44
|
-
"description": "Content rendered inside the body of the notification drawer"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"name": "className",
|
|
48
|
-
"type": "string",
|
|
49
|
-
"description": "Additional classes added to the notification drawer body",
|
|
50
|
-
"defaultValue": "''"
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "NotificationDrawerHeader",
|
|
56
|
-
"description": "",
|
|
57
|
-
"props": [
|
|
58
|
-
{
|
|
59
|
-
"name": "children",
|
|
60
|
-
"type": "React.ReactNode",
|
|
61
|
-
"description": "Content rendered inside the drawer"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "className",
|
|
65
|
-
"type": "string",
|
|
66
|
-
"description": "Additional classes for notification drawer header.",
|
|
67
|
-
"defaultValue": "''"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"name": "closeButtonAriaLabel",
|
|
71
|
-
"type": "string",
|
|
72
|
-
"description": "Adds custom accessible text to the notification drawer close button.",
|
|
73
|
-
"defaultValue": "'Close'"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"name": "count",
|
|
77
|
-
"type": "number",
|
|
78
|
-
"description": "Notification drawer heading count"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"name": "customText",
|
|
82
|
-
"type": "string",
|
|
83
|
-
"description": "Notification drawer heading custom text which can be used instead of providing count/unreadText"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": "onClose",
|
|
87
|
-
"type": "(event: KeyboardEvent | React.MouseEvent) => void",
|
|
88
|
-
"description": "Callback for when close button is clicked"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"name": "title",
|
|
92
|
-
"type": "string",
|
|
93
|
-
"description": "Notification drawer heading title",
|
|
94
|
-
"defaultValue": "'Notifications'"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"name": "unreadText",
|
|
98
|
-
"type": "string",
|
|
99
|
-
"description": "Notification drawer heading unread text used in combination with a count",
|
|
100
|
-
"defaultValue": "'unread'"
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"name": "NotificationDrawerGroup",
|
|
106
|
-
"description": "",
|
|
107
|
-
"props": [
|
|
108
|
-
{
|
|
109
|
-
"name": "children",
|
|
110
|
-
"type": "React.ReactNode",
|
|
111
|
-
"description": "Content rendered inside the group"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"name": "className",
|
|
115
|
-
"type": "string",
|
|
116
|
-
"description": "Additional classes added to the group",
|
|
117
|
-
"defaultValue": "''"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"name": "count",
|
|
121
|
-
"type": "number",
|
|
122
|
-
"description": "Notification drawer group count",
|
|
123
|
-
"required": true
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"name": "headingLevel",
|
|
127
|
-
"type": "'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
|
|
128
|
-
"description": "Sets the heading level to use for the group title. Default is h1.",
|
|
129
|
-
"defaultValue": "'h1'"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"name": "isExpanded",
|
|
133
|
-
"type": "boolean",
|
|
134
|
-
"description": "Adds styling to the group to indicate expanded state",
|
|
135
|
-
"required": true
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"name": "isRead",
|
|
139
|
-
"type": "boolean",
|
|
140
|
-
"description": "Adds styling to the group to indicate whether it has been read",
|
|
141
|
-
"defaultValue": "false"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"name": "onExpand",
|
|
145
|
-
"type": "(event: any, value: boolean) => void",
|
|
146
|
-
"description": "Callback for when group button is clicked to expand",
|
|
147
|
-
"defaultValue": "(event: any, expanded: boolean) => undefined as any"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"name": "title",
|
|
151
|
-
"type": "React.ReactNode",
|
|
152
|
-
"description": "Notification drawer group title",
|
|
153
|
-
"required": true
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"name": "tooltipPosition",
|
|
157
|
-
"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'",
|
|
158
|
-
"description": "Position of the tooltip which is displayed if text is truncated"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
"name": "truncateTitle",
|
|
162
|
-
"type": "number",
|
|
163
|
-
"description": "Truncate title to number of lines",
|
|
164
|
-
"defaultValue": "0"
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"name": "NotificationDrawerGroupList",
|
|
170
|
-
"description": "",
|
|
171
|
-
"props": [
|
|
172
|
-
{
|
|
173
|
-
"name": "children",
|
|
174
|
-
"type": "React.ReactNode",
|
|
175
|
-
"description": "Content rendered inside the notification drawer list body"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"name": "className",
|
|
179
|
-
"type": "string",
|
|
180
|
-
"description": "Additional classes added to the notification drawer list body",
|
|
181
|
-
"defaultValue": "''"
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"name": "NotificationDrawerList",
|
|
187
|
-
"description": "",
|
|
188
|
-
"props": [
|
|
189
|
-
{
|
|
190
|
-
"name": "aria-label",
|
|
191
|
-
"type": "string",
|
|
192
|
-
"description": "Adds an accessible label to the notification drawer list."
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"name": "children",
|
|
196
|
-
"type": "React.ReactNode",
|
|
197
|
-
"description": "Content rendered inside the notification drawer list body"
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"name": "className",
|
|
201
|
-
"type": "string",
|
|
202
|
-
"description": "Additional classes added to the notification drawer list body",
|
|
203
|
-
"defaultValue": "''"
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
"name": "isHidden",
|
|
207
|
-
"type": "boolean",
|
|
208
|
-
"description": "Adds styling to the notification drawer list to indicate expand/hide state",
|
|
209
|
-
"defaultValue": "false"
|
|
210
|
-
}
|
|
211
|
-
]
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
"name": "NotificationDrawerListItem",
|
|
215
|
-
"description": "",
|
|
216
|
-
"props": [
|
|
217
|
-
{
|
|
218
|
-
"name": "children",
|
|
219
|
-
"type": "React.ReactNode",
|
|
220
|
-
"description": "Content rendered inside the list item",
|
|
221
|
-
"defaultValue": "null"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"name": "className",
|
|
225
|
-
"type": "string",
|
|
226
|
-
"description": "Additional classes added to the list item",
|
|
227
|
-
"defaultValue": "''"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"name": "isHoverable",
|
|
231
|
-
"type": "boolean",
|
|
232
|
-
"description": "Modifies the list item to include hover styles on :hover",
|
|
233
|
-
"defaultValue": "true"
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
"name": "isRead",
|
|
237
|
-
"type": "boolean",
|
|
238
|
-
"description": "Adds styling to the list item to indicate it has been read",
|
|
239
|
-
"defaultValue": "false"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"name": "onClick",
|
|
243
|
-
"type": "(event: any) => void",
|
|
244
|
-
"description": "Callback for when a list item is clicked",
|
|
245
|
-
"defaultValue": "(event: React.MouseEvent) => undefined as any"
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"name": "readStateScreenReaderText",
|
|
249
|
-
"type": "string",
|
|
250
|
-
"description": "Visually hidden text that conveys the current read state of the notification list item"
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"name": "tabIndex",
|
|
254
|
-
"type": "number",
|
|
255
|
-
"description": "Tab index for the list item",
|
|
256
|
-
"defaultValue": "0"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"name": "variant",
|
|
260
|
-
"type": "'custom' | 'success' | 'danger' | 'warning' | 'info'",
|
|
261
|
-
"description": "Variant indicates the severity level",
|
|
262
|
-
"defaultValue": "'custom'"
|
|
263
|
-
}
|
|
264
|
-
]
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"name": "NotificationDrawerListItemBody",
|
|
268
|
-
"description": "",
|
|
269
|
-
"props": [
|
|
270
|
-
{
|
|
271
|
-
"name": "children",
|
|
272
|
-
"type": "React.ReactNode",
|
|
273
|
-
"description": "Content rendered inside the list item body"
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
"name": "className",
|
|
277
|
-
"type": "string",
|
|
278
|
-
"description": "Additional classes added to the list item body",
|
|
279
|
-
"defaultValue": "''"
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
"name": "timestamp",
|
|
283
|
-
"type": "React.ReactNode",
|
|
284
|
-
"description": "List item timestamp"
|
|
285
|
-
}
|
|
286
|
-
]
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
"name": "NotificationDrawerListItemHeader",
|
|
290
|
-
"description": "",
|
|
291
|
-
"props": [
|
|
292
|
-
{
|
|
293
|
-
"name": "actionHasNoOffset",
|
|
294
|
-
"type": "boolean",
|
|
295
|
-
"description": "Removes the offset of the notification drawer actions.",
|
|
296
|
-
"defaultValue": "false"
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"name": "children",
|
|
300
|
-
"type": "React.ReactNode",
|
|
301
|
-
"description": "Actions rendered inside the notification drawer list item header"
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"name": "className",
|
|
305
|
-
"type": "string",
|
|
306
|
-
"description": "Additional classes for notification drawer list item header.",
|
|
307
|
-
"defaultValue": "''"
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
"name": "headingLevel",
|
|
311
|
-
"type": "'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
|
|
312
|
-
"description": "Sets the heading level to use for the list item header title. Default is h2.",
|
|
313
|
-
"defaultValue": "'h2'"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
"name": "icon",
|
|
317
|
-
"type": "React.ReactNode",
|
|
318
|
-
"description": "Add custom icon for notification drawer list item header",
|
|
319
|
-
"defaultValue": "null"
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"name": "srTitle",
|
|
323
|
-
"type": "string",
|
|
324
|
-
"description": "Notification drawer list item header screen reader title"
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
"name": "title",
|
|
328
|
-
"type": "string",
|
|
329
|
-
"description": "Notification drawer list item title",
|
|
330
|
-
"required": true
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
"name": "tooltipPosition",
|
|
334
|
-
"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'",
|
|
335
|
-
"description": "Position of the tooltip which is displayed if text is truncated"
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
"name": "truncateTitle",
|
|
339
|
-
"type": "number",
|
|
340
|
-
"description": "Truncate title to number of lines",
|
|
341
|
-
"defaultValue": "0"
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
"name": "variant",
|
|
345
|
-
"type": "'success' | 'danger' | 'warning' | 'info' | 'custom'",
|
|
346
|
-
"description": "Variant indicates the severity level",
|
|
347
|
-
"defaultValue": "'custom'"
|
|
348
|
-
}
|
|
349
|
-
]
|
|
350
|
-
}
|
|
351
|
-
],
|
|
352
|
-
"cssPrefix": [
|
|
353
|
-
"pf-v6-c-notification-drawer"
|
|
354
|
-
],
|
|
355
|
-
"examples": [
|
|
356
|
-
"Basic",
|
|
357
|
-
"Groups",
|
|
358
|
-
"Lightweight"
|
|
359
|
-
]
|
|
360
|
-
};
|
|
361
|
-
pageData.liveContext = {
|
|
362
|
-
useState,
|
|
363
|
-
SearchIcon,
|
|
364
|
-
RhUiEllipsisVerticalFillIcon
|
|
365
|
-
};
|
|
366
|
-
pageData.examples = {
|
|
367
|
-
'Basic': props =>
|
|
368
|
-
<Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n NotificationDrawer,\n NotificationDrawerBody,\n NotificationDrawerHeader,\n NotificationDrawerList,\n NotificationDrawerListItem,\n NotificationDrawerListItemBody,\n NotificationDrawerListItemHeader,\n Dropdown,\n DropdownList,\n DropdownItem,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';\n\nexport const NotificationDrawerBasic: React.FunctionComponent = () => {\n const [isOpenMap, setIsOpenMap] = useState(new Array(7).fill(false));\n\n const onToggle = (index: number) => () => {\n const newState = [...isOpenMap.slice(0, index), !isOpenMap[index], ...isOpenMap.slice(index + 1)];\n setIsOpenMap(newState);\n };\n\n const onSelect = () => {\n setIsOpenMap(new Array(7).fill(false));\n };\n\n const onDrawerClose = (_event: React.MouseEvent<Element, MouseEvent> | KeyboardEvent) => {\n setIsOpenMap(new Array(7).fill(false));\n };\n\n const [isOpen0, isOpen1, isOpen2, isOpen3, isOpen4, isOpen5, isOpen6] = isOpenMap;\n const dropdownItems = (\n <>\n <DropdownItem>Action</DropdownItem>\n <DropdownItem\n to=\"#default-link2\"\n // Prevent the default onClick functionality for example purposes\n onClick={(ev: any) => ev.preventDefault()}\n >\n Link\n </DropdownItem>\n <DropdownItem isDisabled>Disabled Action</DropdownItem>\n <DropdownItem isDisabled to=\"#default-link4\">\n Disabled Link\n </DropdownItem>\n </>\n );\n\n return (\n <NotificationDrawer>\n <NotificationDrawerHeader count={3} onClose={onDrawerClose}>\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpen0}\n onOpenChange={() => setIsOpenMap(new Array(7).fill(false))}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen0}\n onClick={onToggle(0)}\n variant=\"plain\"\n aria-label={`Basic example header kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerHeader>\n <NotificationDrawerBody>\n <NotificationDrawerList aria-label=\"Notifications in the basic example\">\n <NotificationDrawerListItem variant=\"info\">\n <NotificationDrawerListItemHeader\n variant=\"info\"\n title=\"Unread info notification title\"\n srTitle=\"Info notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpen1}\n onOpenChange={() => setIsOpenMap(new Array(7).fill(false))}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen0}\n onClick={onToggle(1)}\n variant=\"plain\"\n aria-label={`Basic example notification 1 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"5 minutes ago\">\n This is an info notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"danger\">\n <NotificationDrawerListItemHeader\n variant=\"danger\"\n title=\"Unread danger notification title. This is a long title to show how the title will wrap if it is long and wraps to multiple lines.\"\n srTitle=\"Danger notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpen2}\n onOpenChange={() => setIsOpenMap(new Array(7).fill(false))}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen2}\n onClick={onToggle(2)}\n variant=\"plain\"\n aria-label={`Basic example notification 2 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"10 minutes ago\">\n This is a danger notification description. This is a long description to show how the title will wrap if\n it is long and wraps to multiple lines.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"danger\">\n <NotificationDrawerListItemHeader\n truncateTitle={1}\n variant=\"danger\"\n title=\"Unread danger notification title. This is a long title to show how the title will be truncated if it is long and will be shown in a single line.\"\n srTitle=\"Danger notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpen3}\n onOpenChange={() => setIsOpenMap(new Array(7).fill(false))}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen3}\n onClick={onToggle(3)}\n variant=\"plain\"\n aria-label={`Basic example notification 3 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"10 minutes ago\">\n This is a danger notification description. This is a long description to show how the title will wrap if\n it is long and wraps to multiple lines.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"warning\" isRead>\n <NotificationDrawerListItemHeader\n variant=\"warning\"\n title=\"Read warning notification title\"\n srTitle=\"Warning notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpen4}\n onOpenChange={() => setIsOpenMap(new Array(7).fill(false))}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen4}\n onClick={onToggle(4)}\n variant=\"plain\"\n aria-label={`Basic example notification 4 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"20 minutes ago\">\n This is a warning notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"success\" isRead>\n <NotificationDrawerListItemHeader\n variant=\"success\"\n title=\"Read success notification title\"\n srTitle=\"Success notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpen5}\n onOpenChange={() => setIsOpenMap(new Array(7).fill(false))}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen5}\n onClick={onToggle(5)}\n variant=\"plain\"\n aria-label={`Basic example notification 5 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"30 minutes ago\">\n This is a success notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem isRead>\n <NotificationDrawerListItemHeader title=\"Read (default) notification title\" srTitle=\"notification:\">\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpen6}\n onOpenChange={() => setIsOpenMap(new Array(7).fill(false))}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n isExpanded={isOpen6}\n onClick={onToggle(6)}\n variant=\"plain\"\n aria-label={`Basic example notification 6 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"35 minutes ago\">\n This is a default notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n </NotificationDrawerList>\n </NotificationDrawerBody>\n </NotificationDrawer>\n );\n};\n","title":"Basic","lang":"ts","className":""}}>
|
|
369
|
-
|
|
370
|
-
</Example>,
|
|
371
|
-
'Groups': props =>
|
|
372
|
-
<Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n Button,\n EmptyState,\n EmptyStateBody,\n EmptyStateFooter,\n NotificationDrawer,\n NotificationDrawerBody,\n NotificationDrawerHeader,\n NotificationDrawerGroup,\n NotificationDrawerGroupList,\n NotificationDrawerList,\n NotificationDrawerListItem,\n NotificationDrawerListItemBody,\n NotificationDrawerListItemHeader,\n EmptyStateVariant,\n EmptyStateActions,\n Dropdown,\n DropdownList,\n DropdownItem,\n MenuToggle,\n MenuToggleElement\n} from '@patternfly/react-core';\nimport RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';\nimport SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';\n\nexport const NotificationDrawerGroups: React.FunctionComponent = () => {\n const [firstGroupExpanded, setFirstGroupExpanded] = useState(false);\n const [secondGroupExpanded, setSecondGroupExpanded] = useState(true);\n const [thirdGroupExpanded, setThirdGroupExpanded] = useState(false);\n const [isOpenMap, setIsOpenMap] = useState({});\n\n const onToggle = (id: string) => {\n setIsOpenMap((prevState) => ({ ...prevState, [id]: !prevState[id] }));\n };\n\n const onSelect = () => {\n setIsOpenMap({});\n };\n\n const toggleFirstDrawer = (_event: any, value: boolean) => {\n setFirstGroupExpanded(value);\n setSecondGroupExpanded(false);\n setThirdGroupExpanded(false);\n };\n\n const toggleSecondDrawer = (_event: any, value: boolean) => {\n setSecondGroupExpanded(value);\n setFirstGroupExpanded(false);\n setThirdGroupExpanded(false);\n };\n\n const toggleThirdDrawer = (_event: any, value: boolean) => {\n setThirdGroupExpanded(value);\n setSecondGroupExpanded(false);\n setFirstGroupExpanded(false);\n };\n\n const dropdownItems = (\n <>\n <DropdownItem>Action</DropdownItem>\n <DropdownItem\n to=\"#default-link2\"\n // Prevent the default onClick functionality for example purposes\n onClick={(ev: any) => ev.preventDefault()}\n >\n Link\n </DropdownItem>\n <DropdownItem isDisabled>Disabled Action</DropdownItem>\n <DropdownItem isDisabled to=\"#default-link4\">\n Disabled Link\n </DropdownItem>\n </>\n );\n\n return (\n <NotificationDrawer>\n <NotificationDrawerHeader count={4}>\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-1'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-1\"\n isExpanded={isOpenMap['groups-kebab-toggle-1'] || false}\n onClick={() => onToggle('groups-kebab-toggle-1')}\n variant=\"plain\"\n aria-label={`Groups example header kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerHeader>\n <NotificationDrawerBody>\n <NotificationDrawerGroupList>\n <NotificationDrawerGroup\n title=\"First notification group\"\n isExpanded={firstGroupExpanded}\n count={2}\n onExpand={toggleFirstDrawer}\n >\n <NotificationDrawerList isHidden={!firstGroupExpanded} aria-label=\"Notifications in the first group\">\n <NotificationDrawerListItem variant=\"info\">\n <NotificationDrawerListItemHeader\n variant=\"info\"\n title=\"Unread info notification title\"\n srTitle=\"Info notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-2'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-2\"\n isExpanded={isOpenMap['groups-kebab-toggle-2'] || false}\n onClick={() => onToggle('groups-kebab-toggle-2')}\n variant=\"plain\"\n aria-label={`Groups example group 1 notification 1 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"5 minutes ago\">\n This is an info notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"danger\">\n <NotificationDrawerListItemHeader\n variant=\"danger\"\n title=\"Unread danger notification title. This is a long title to show how the title will wrap if it is long and wraps to multiple lines.\"\n srTitle=\"Danger notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-3'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-3\"\n isExpanded={isOpenMap['groups-kebab-toggle-3'] || false}\n onClick={() => onToggle('groups-kebab-toggle-3')}\n variant=\"plain\"\n aria-label={`Groups example group 1 notification 2 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"10 minutes ago\">\n This is a danger notification description. This is a long description to show how the title will wrap\n if it is long and wraps to multiple lines.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"warning\" isRead>\n <NotificationDrawerListItemHeader\n variant=\"warning\"\n title=\"Read warning notification title\"\n srTitle=\"Warning notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-4'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-4\"\n isExpanded={isOpenMap['groups-kebab-toggle-4'] || false}\n onClick={() => onToggle('groups-kebab-toggle-4')}\n variant=\"plain\"\n aria-label={`Groups example group 1 notification 3 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"20 minutes ago\">\n This is a warning notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"success\" isRead>\n <NotificationDrawerListItemHeader\n variant=\"success\"\n title=\"Read success notification title\"\n srTitle=\"Success notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-5'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-5\"\n isExpanded={isOpenMap['groups-kebab-toggle-5'] || false}\n onClick={() => onToggle('groups-kebab-toggle-5')}\n variant=\"plain\"\n aria-label={`Groups example group 1 notification 4 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"30 minutes ago\">\n This is a success notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n </NotificationDrawerList>\n </NotificationDrawerGroup>\n <NotificationDrawerGroup\n title=\"Second notification group\"\n isExpanded={secondGroupExpanded}\n count={2}\n onExpand={toggleSecondDrawer}\n >\n <NotificationDrawerList isHidden={!secondGroupExpanded} aria-label=\"Notifications in the second group\">\n <NotificationDrawerListItem variant=\"info\">\n <NotificationDrawerListItemHeader\n variant=\"info\"\n title=\"Unread info notification title\"\n srTitle=\"Info notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-6'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-6\"\n isExpanded={isOpenMap['groups-kebab-toggle-6'] || false}\n onClick={() => onToggle('groups-kebab-toggle-6')}\n variant=\"plain\"\n aria-label={`Groups example group 2 notification 1 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"5 minutes ago\">\n This is an info notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"danger\">\n <NotificationDrawerListItemHeader\n variant=\"danger\"\n title=\"Unread danger notification title. This is a long title to show how the title will wrap if it is long and wraps to multiple lines.\"\n srTitle=\"Danger notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-7'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-7\"\n isExpanded={isOpenMap['groups-kebab-toggle-7'] || false}\n onClick={() => onToggle('groups-kebab-toggle-7')}\n variant=\"plain\"\n aria-label={`Groups example group 2 notification 2 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"10 minutes ago\">\n This is a danger notification description. This is a long description to show how the title will wrap\n if it is long and wraps to multiple lines.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"warning\" isRead>\n <NotificationDrawerListItemHeader\n variant=\"warning\"\n title=\"Read warning notification title\"\n srTitle=\"Warning notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-8'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-8\"\n isExpanded={isOpenMap['groups-kebab-toggle-8'] || false}\n onClick={() => onToggle('groups-kebab-toggle-8')}\n variant=\"plain\"\n aria-label={`Groups example group 2 notification 3 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"20 minutes ago\">\n This is a warning notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"success\" isRead>\n <NotificationDrawerListItemHeader\n variant=\"success\"\n title=\"Read success notification title\"\n srTitle=\"Success notification:\"\n >\n <Dropdown\n onSelect={onSelect}\n isOpen={isOpenMap['groups-kebab-toggle-9'] || false}\n onOpenChange={() => setIsOpenMap({})}\n popperProps={{ position: 'right' }}\n toggle={(toggleRef: React.Ref<MenuToggleElement>) => (\n <MenuToggle\n ref={toggleRef}\n id=\"groups-kebab-toggle-9\"\n isExpanded={isOpenMap['groups-kebab-toggle-9'] || false}\n onClick={() => onToggle('groups-kebab-toggle-9')}\n variant=\"plain\"\n aria-label={`Groups example group 2 notification 4 kebab toggle`}\n icon={<RhUiEllipsisVerticalFillIcon />}\n />\n )}\n >\n <DropdownList>{dropdownItems}</DropdownList>\n </Dropdown>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"30 minutes ago\">\n This is a success notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n </NotificationDrawerList>\n </NotificationDrawerGroup>\n <NotificationDrawerGroup\n title=\"Third notification group. This is a long title to show how the title will be truncated if it is long and will be shown in a single line.\"\n isExpanded={thirdGroupExpanded}\n count={0}\n onExpand={toggleThirdDrawer}\n truncateTitle={1}\n >\n <NotificationDrawerList isHidden={!thirdGroupExpanded} aria-label=\"Notifications in the third group\">\n <EmptyState\n headingLevel=\"h2\"\n titleText=\"No alerts found\"\n icon={SearchIcon}\n variant={EmptyStateVariant.full}\n >\n <EmptyStateBody>\n There are currently no critical alerts firing. There may be firing alerts of other severities or\n silenced critical alerts however.\n </EmptyStateBody>\n <EmptyStateFooter>\n <EmptyStateActions>\n <Button variant=\"link\">Action</Button>\n </EmptyStateActions>\n </EmptyStateFooter>\n </EmptyState>\n </NotificationDrawerList>\n </NotificationDrawerGroup>\n </NotificationDrawerGroupList>\n </NotificationDrawerBody>\n </NotificationDrawer>\n );\n};\n","title":"Groups","lang":"ts","className":""}}>
|
|
373
|
-
|
|
374
|
-
</Example>,
|
|
375
|
-
'Lightweight': props =>
|
|
376
|
-
<Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport {\n Button,\n EmptyState,\n EmptyStateBody,\n EmptyStateFooter,\n EmptyStateVariant,\n NotificationDrawer,\n NotificationDrawerBody,\n NotificationDrawerHeader,\n NotificationDrawerGroup,\n NotificationDrawerGroupList,\n NotificationDrawerList,\n NotificationDrawerListItem,\n NotificationDrawerListItemBody,\n NotificationDrawerListItemHeader,\n EmptyStateActions\n} from '@patternfly/react-core';\nimport SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';\n\nexport const NotificationDrawerLightweight: React.FunctionComponent = () => {\n const [firstGroupExpanded, setFirstGroupExpanded] = useState(false);\n const [secondGroupExpanded, setSecondGroupExpanded] = useState(true);\n const [thirdGroupExpanded, setThirdGroupExpanded] = useState(false);\n\n const toggleFirstDrawer = (_event: any, value: boolean) => {\n setFirstGroupExpanded(value);\n setSecondGroupExpanded(false);\n setThirdGroupExpanded(false);\n };\n\n const toggleSecondDrawer = (_event: any, value: boolean) => {\n setSecondGroupExpanded(value);\n setFirstGroupExpanded(false);\n setThirdGroupExpanded(false);\n };\n\n const toggleThirdDrawer = (_event: any, value: boolean) => {\n setThirdGroupExpanded(value);\n setSecondGroupExpanded(false);\n setFirstGroupExpanded(false);\n };\n\n const onDrawerClose = (_event: KeyboardEvent | React.MouseEvent<Element, MouseEvent>) => {\n // do something cool in a callback\n };\n\n return (\n <NotificationDrawer>\n <NotificationDrawerHeader onClose={(event) => onDrawerClose(event)} />\n <NotificationDrawerBody>\n <NotificationDrawerGroupList>\n <NotificationDrawerGroup\n title=\"First notification group\"\n isExpanded={firstGroupExpanded}\n count={4}\n isRead={true}\n onExpand={toggleFirstDrawer}\n >\n <NotificationDrawerList\n isHidden={!firstGroupExpanded}\n aria-label=\"Notifications in the first lightweight group\"\n >\n <NotificationDrawerListItem variant=\"info\">\n <NotificationDrawerListItemHeader\n variant=\"info\"\n title=\"Info notification title\"\n srTitle=\"Info notification:\"\n />\n <NotificationDrawerListItemBody timestamp=\"5 minutes ago\">\n This is an info notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"danger\">\n <NotificationDrawerListItemHeader\n variant=\"danger\"\n title=\"Danger notification title. This is a long title to show how the title will wrap if it is long and wraps to multiple lines.\"\n srTitle=\"Danger notification:\"\n />\n <NotificationDrawerListItemBody timestamp=\"10 minutes ago\">\n This is a danger notification description. This is a long description to show how the title will wrap\n if it is long and wraps to multiple lines.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"warning\">\n <NotificationDrawerListItemHeader\n variant=\"warning\"\n title=\"Warning notification title\"\n srTitle=\"Warning notification:\"\n />\n <NotificationDrawerListItemBody timestamp=\"20 minutes ago\">\n This is a warning notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"success\">\n <NotificationDrawerListItemHeader\n variant=\"success\"\n title=\"Success notification title\"\n srTitle=\"Success notification:\"\n />\n <NotificationDrawerListItemBody timestamp=\"30 minutes ago\">\n This is a success notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n </NotificationDrawerList>\n </NotificationDrawerGroup>\n <NotificationDrawerGroup\n title=\"Second notification group\"\n isExpanded={secondGroupExpanded}\n count={4}\n isRead={true}\n onExpand={toggleSecondDrawer}\n >\n <NotificationDrawerList\n isHidden={!secondGroupExpanded}\n aria-label=\"Notifications in the second lightweight group\"\n >\n <NotificationDrawerListItem variant=\"info\">\n <NotificationDrawerListItemHeader\n variant=\"info\"\n title=\"Info notification title w/action\"\n srTitle=\"Info notification:\"\n >\n <Button variant=\"link\">Action</Button>\n </NotificationDrawerListItemHeader>\n <NotificationDrawerListItemBody timestamp=\"5 minutes ago\">\n This is an info notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"danger\">\n <NotificationDrawerListItemHeader\n variant=\"danger\"\n title=\"Danger notification title. This is a long title to show how the title will wrap if it is long and wraps to multiple lines.\"\n srTitle=\"Danger notification:\"\n />\n <NotificationDrawerListItemBody timestamp=\"10 minutes ago\">\n This is a danger notification description. This is a long description to show how the title will wrap\n if it is long and wraps to multiple lines.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"warning\">\n <NotificationDrawerListItemHeader\n variant=\"warning\"\n title=\"Warning notification title\"\n srTitle=\"Warning notification:\"\n />\n <NotificationDrawerListItemBody timestamp=\"20 minutes ago\">\n This is a warning notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n <NotificationDrawerListItem variant=\"success\">\n <NotificationDrawerListItemHeader\n variant=\"success\"\n title=\"Success notification title\"\n srTitle=\"Success notification:\"\n />\n <NotificationDrawerListItemBody timestamp=\"30 minutes ago\">\n This is a success notification description.\n </NotificationDrawerListItemBody>\n </NotificationDrawerListItem>\n </NotificationDrawerList>\n </NotificationDrawerGroup>\n <NotificationDrawerGroup\n title=\"Third notification group\"\n isExpanded={thirdGroupExpanded}\n count={0}\n isRead={true}\n onExpand={toggleThirdDrawer}\n >\n <NotificationDrawerList\n isHidden={!thirdGroupExpanded}\n aria-label=\"Notifications in the third lightweight group\"\n >\n <EmptyState\n headingLevel=\"h2\"\n titleText=\"No alerts found\"\n icon={SearchIcon}\n variant={EmptyStateVariant.full}\n >\n <EmptyStateBody>\n There are currently no critical alerts firing. There may be firing alerts of other severities or\n silenced critical alerts however.\n </EmptyStateBody>\n <EmptyStateFooter>\n <EmptyStateActions>\n <Button variant=\"link\">Action</Button>\n </EmptyStateActions>\n </EmptyStateFooter>\n </EmptyState>\n </NotificationDrawerList>\n </NotificationDrawerGroup>\n </NotificationDrawerGroupList>\n </NotificationDrawerBody>\n </NotificationDrawer>\n );\n};\n","title":"Lightweight","lang":"ts","className":""}}>
|
|
377
|
-
|
|
378
|
-
</Example>
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
const Component = () => (
|
|
382
|
-
<React.Fragment>
|
|
383
|
-
<AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
|
|
384
|
-
{`Examples`}
|
|
385
|
-
</AutoLinkHeader>
|
|
386
|
-
{React.createElement(pageData.examples["Basic"])}
|
|
387
|
-
{React.createElement(pageData.examples["Groups"])}
|
|
388
|
-
{React.createElement(pageData.examples["Lightweight"])}
|
|
389
|
-
</React.Fragment>
|
|
390
|
-
);
|
|
391
|
-
Component.displayName = 'ComponentsNotificationDrawerReactDocs';
|
|
392
|
-
Component.pageData = pageData;
|
|
393
|
-
|
|
394
|
-
export default Component;
|