hale-commenting-system 2.1.1 → 2.2.1

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.
Files changed (99) hide show
  1. package/.claude/settings.local.json +7 -0
  2. package/.editorconfig +17 -0
  3. package/.eslintrc.js +75 -0
  4. package/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
  5. package/.github/workflows/ci.yaml +51 -0
  6. package/.prettierignore +1 -0
  7. package/.prettierrc +4 -0
  8. package/GITHUB_OAUTH_ENV_TEMPLATE.md +53 -0
  9. package/LICENSE +21 -0
  10. package/README.md +92 -21
  11. package/package.json +74 -50
  12. package/scripts/README.md +42 -0
  13. package/scripts/integrate.js +440 -0
  14. package/src/app/AppLayout/AppLayout.tsx +248 -0
  15. package/src/app/Comments/Comments.tsx +273 -0
  16. package/src/app/Dashboard/Dashboard.tsx +10 -0
  17. package/src/app/NotFound/NotFound.tsx +35 -0
  18. package/src/app/Settings/General/GeneralSettings.tsx +16 -0
  19. package/src/app/Settings/Profile/ProfileSettings.tsx +18 -0
  20. package/src/app/Support/Support.tsx +50 -0
  21. package/src/app/__snapshots__/app.test.tsx.snap +524 -0
  22. package/src/app/app.css +11 -0
  23. package/src/app/app.test.tsx +55 -0
  24. package/src/app/bgimages/Patternfly-Logo.svg +28 -0
  25. package/src/app/commenting-system/components/CommentOverlay.tsx +93 -0
  26. package/src/app/commenting-system/components/CommentPanel.tsx +534 -0
  27. package/src/app/commenting-system/components/CommentPin.tsx +60 -0
  28. package/src/app/commenting-system/components/DetailsTab.tsx +516 -0
  29. package/src/app/commenting-system/components/FloatingWidget.tsx +130 -0
  30. package/src/app/commenting-system/components/JiraTab.tsx +696 -0
  31. package/src/app/commenting-system/contexts/CommentContext.tsx +1033 -0
  32. package/src/app/commenting-system/contexts/GitHubAuthContext.tsx +84 -0
  33. package/{dist/index.d.ts → src/app/commenting-system/index.ts} +5 -4
  34. package/src/app/commenting-system/services/githubAdapter.ts +359 -0
  35. package/src/app/commenting-system/types/index.ts +27 -0
  36. package/src/app/commenting-system/utils/version.ts +19 -0
  37. package/src/app/index.tsx +22 -0
  38. package/src/app/routes.tsx +81 -0
  39. package/src/app/utils/useDocumentTitle.ts +13 -0
  40. package/src/favicon.png +0 -0
  41. package/src/index.html +18 -0
  42. package/src/index.tsx +25 -0
  43. package/src/test/setup.ts +33 -0
  44. package/src/typings.d.ts +12 -0
  45. package/stylePaths.js +14 -0
  46. package/tsconfig.json +34 -0
  47. package/vitest.config.ts +19 -0
  48. package/webpack.common.js +139 -0
  49. package/webpack.dev.js +318 -0
  50. package/webpack.prod.js +38 -0
  51. package/bin/detect.d.ts +0 -10
  52. package/bin/detect.js +0 -134
  53. package/bin/generators.d.ts +0 -18
  54. package/bin/generators.js +0 -193
  55. package/bin/hale-commenting.js +0 -4
  56. package/bin/index.d.ts +0 -2
  57. package/bin/index.js +0 -61
  58. package/bin/onboarding.d.ts +0 -1
  59. package/bin/onboarding.js +0 -349
  60. package/bin/postinstall.d.ts +0 -2
  61. package/bin/postinstall.js +0 -65
  62. package/bin/validators.d.ts +0 -2
  63. package/bin/validators.js +0 -66
  64. package/dist/cli/detect.d.ts +0 -10
  65. package/dist/cli/detect.js +0 -134
  66. package/dist/cli/generators.d.ts +0 -18
  67. package/dist/cli/generators.js +0 -193
  68. package/dist/cli/index.d.ts +0 -2
  69. package/dist/cli/index.js +0 -61
  70. package/dist/cli/onboarding.d.ts +0 -1
  71. package/dist/cli/onboarding.js +0 -349
  72. package/dist/cli/postinstall.d.ts +0 -2
  73. package/dist/cli/postinstall.js +0 -65
  74. package/dist/cli/validators.d.ts +0 -2
  75. package/dist/cli/validators.js +0 -66
  76. package/dist/components/CommentOverlay.d.ts +0 -2
  77. package/dist/components/CommentOverlay.js +0 -101
  78. package/dist/components/CommentPanel.d.ts +0 -6
  79. package/dist/components/CommentPanel.js +0 -334
  80. package/dist/components/CommentPin.d.ts +0 -11
  81. package/dist/components/CommentPin.js +0 -64
  82. package/dist/components/DetailsTab.d.ts +0 -2
  83. package/dist/components/DetailsTab.js +0 -380
  84. package/dist/components/FloatingWidget.d.ts +0 -8
  85. package/dist/components/FloatingWidget.js +0 -128
  86. package/dist/components/JiraTab.d.ts +0 -2
  87. package/dist/components/JiraTab.js +0 -507
  88. package/dist/contexts/CommentContext.d.ts +0 -30
  89. package/dist/contexts/CommentContext.js +0 -891
  90. package/dist/contexts/GitHubAuthContext.d.ts +0 -13
  91. package/dist/contexts/GitHubAuthContext.js +0 -96
  92. package/dist/index.js +0 -27
  93. package/dist/services/githubAdapter.d.ts +0 -56
  94. package/dist/services/githubAdapter.js +0 -321
  95. package/dist/types/index.d.ts +0 -25
  96. package/dist/types/index.js +0 -2
  97. package/dist/utils/version.d.ts +0 -1
  98. package/dist/utils/version.js +0 -23
  99. package/templates/webpack-middleware.js +0 -226
@@ -0,0 +1,524 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`App tests > should render default App component 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="pf-v6-c-page"
7
+ >
8
+ <div
9
+ class="pf-v6-c-skip-to-content"
10
+ >
11
+ <a
12
+ class="pf-v6-c-button pf-m-primary"
13
+ data-ouia-component-id="OUIA-Generated-Button-primary-1"
14
+ data-ouia-component-type="PF6/Button"
15
+ data-ouia-safe="true"
16
+ href="#primary-app-container"
17
+ >
18
+ <span
19
+ class="pf-v6-c-button__text"
20
+ >
21
+ Skip to Content
22
+ </span>
23
+ </a>
24
+ </div>
25
+ <header
26
+ class="pf-v6-c-masthead pf-m-display-inline-on-md"
27
+ >
28
+ <div
29
+ class="pf-v6-c-masthead__main"
30
+ >
31
+ <span
32
+ class="pf-v6-c-masthead__toggle"
33
+ >
34
+ <button
35
+ aria-label="Global navigation"
36
+ class="pf-v6-c-button pf-m-plain"
37
+ data-ouia-component-id="OUIA-Generated-Button-plain-1"
38
+ data-ouia-component-type="PF6/Button"
39
+ data-ouia-safe="true"
40
+ type="button"
41
+ >
42
+ <span
43
+ class="pf-v6-c-button__icon"
44
+ >
45
+ <svg
46
+ aria-hidden="true"
47
+ class="pf-v6-svg"
48
+ fill="currentColor"
49
+ height="1em"
50
+ role="img"
51
+ viewBox="0 0 448 512"
52
+ width="1em"
53
+ >
54
+ <path
55
+ d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"
56
+ />
57
+ </svg>
58
+ </span>
59
+ </button>
60
+ </span>
61
+ <div
62
+ class="pf-v6-c-masthead__brand"
63
+ data-codemods="true"
64
+ >
65
+ <span
66
+ class="pf-v6-c-masthead__logo"
67
+ data-codemods="true"
68
+ >
69
+ <svg
70
+ height="40px"
71
+ viewBox="0 0 679 158"
72
+ >
73
+ <title>
74
+ PatternFly logo
75
+ </title>
76
+ <defs>
77
+ <lineargradient
78
+ id="linearGradient-basic-masthead"
79
+ x1="68%"
80
+ x2="32%"
81
+ y1="2.25860997e-13%"
82
+ y2="100%"
83
+ >
84
+ <stop
85
+ offset="0%"
86
+ stop-color="#2B9AF3"
87
+ />
88
+ <stop
89
+ offset="100%"
90
+ stop-color="#73BCF7"
91
+ stop-opacity="0.502212631"
92
+ />
93
+ </lineargradient>
94
+ </defs>
95
+ <g
96
+ fill="none"
97
+ fill-rule="evenodd"
98
+ stroke="none"
99
+ stroke-width="1"
100
+ >
101
+ <g
102
+ fill="var(--pf-t--global--text--color--regular)"
103
+ fill-rule="nonzero"
104
+ transform="translate(206.000000, 45.750000)"
105
+ >
106
+ <path
107
+ d="M0,65.25 L0,2.25 L33.21,2.25 C37.35,2.25 41.025,3.135 44.235,4.905 C47.445,6.675 49.98,9.09 51.84,12.15 C53.7,15.21 54.63,18.72 54.63,22.68 C54.63,26.46 53.7,29.865 51.84,32.895 C49.98,35.925 47.43,38.31 44.19,40.05 C40.95,41.79 37.29,42.66 33.21,42.66 L15.48,42.66 L15.48,65.25 L0,65.25 Z M15.48,29.88 L31.41,29.88 C33.69,29.88 35.52,29.22 36.9,27.9 C38.28,26.58 38.97,24.87 38.97,22.77 C38.97,20.61 38.28,18.855 36.9,17.505 C35.52,16.155 33.69,15.48 31.41,15.48 L15.48,15.48 L15.48,29.88 Z"
108
+ />
109
+ <path
110
+ d="M77.04,66.06 C73.68,66.06 70.695,65.43 68.085,64.17 C65.475,62.91 63.435,61.17 61.965,58.95 C60.495,56.73 59.76,54.18 59.76,51.3 C59.76,46.74 61.485,43.215 64.935,40.725 C68.385,38.235 73.2,36.99 79.38,36.99 C83.1,36.99 86.7,37.44 90.18,38.34 L90.18,36 C90.18,31.26 87.15,28.89 81.09,28.89 C77.49,28.89 72.69,30.15 66.69,32.67 L61.47,21.96 C69.15,18.48 76.56,16.74 83.7,16.74 C90.3,16.74 95.43,18.315 99.09,21.465 C102.75,24.615 104.58,29.04 104.58,34.74 L104.58,65.25 L90.18,65.25 L90.18,62.37 C88.26,63.69 86.235,64.635 84.105,65.205 C81.975,65.775 79.62,66.06 77.04,66.06 Z M73.62,51.03 C73.62,52.53 74.28,53.7 75.6,54.54 C76.92,55.38 78.75,55.8 81.09,55.8 C84.69,55.8 87.72,55.05 90.18,53.55 L90.18,47.43 C87.42,46.71 84.54,46.35 81.54,46.35 C79.02,46.35 77.07,46.755 75.69,47.565 C74.31,48.375 73.62,49.53 73.62,51.03 Z"
111
+ />
112
+ <path
113
+ d="M137.25,65.88 C125.73,65.88 119.97,60.84 119.97,50.76 L119.97,29.79 L110.34,29.79 L110.34,17.64 L119.97,17.64 L119.97,5.4 L134.55,2.25 L134.55,17.64 L147.87,17.64 L147.87,29.79 L134.55,29.79 L134.55,47.88 C134.55,49.98 135.015,51.465 135.945,52.335 C136.875,53.205 138.51,53.64 140.85,53.64 C143.01,53.64 145.2,53.31 147.42,52.65 L147.42,64.44 C146.1,64.86 144.42,65.205 142.38,65.475 C140.34,65.745 138.63,65.88 137.25,65.88 Z"
114
+ />
115
+ <path
116
+ d="M177.57,65.88 C166.05,65.88 160.29,60.84 160.29,50.76 L160.29,29.79 L150.66,29.79 L150.66,17.64 L160.29,17.64 L160.29,5.4 L174.87,2.25 L174.87,17.64 L188.19,17.64 L188.19,29.79 L174.87,29.79 L174.87,47.88 C174.87,49.98 175.335,51.465 176.265,52.335 C177.195,53.205 178.83,53.64 181.17,53.64 C183.33,53.64 185.52,53.31 187.74,52.65 L187.74,64.44 C186.42,64.86 184.74,65.205 182.7,65.475 C180.66,65.745 178.95,65.88 177.57,65.88 Z"
117
+ />
118
+ <path
119
+ d="M217.62,66.15 C212.76,66.15 208.365,65.055 204.435,62.865 C200.505,60.675 197.4,57.72 195.12,54 C192.84,50.28 191.7,46.11 191.7,41.49 C191.7,36.87 192.795,32.7 194.985,28.98 C197.175,25.26 200.16,22.305 203.94,20.115 C207.72,17.925 211.92,16.83 216.54,16.83 C221.22,16.83 225.36,17.955 228.96,20.205 C232.56,22.455 235.395,25.53 237.465,29.43 C239.535,33.33 240.57,37.8 240.57,42.84 L240.57,46.44 L206.64,46.44 C207.6,48.66 209.1,50.475 211.14,51.885 C213.18,53.295 215.58,54 218.34,54 C222.42,54 225.6,52.8 227.88,50.4 L237.51,58.95 C234.51,61.47 231.435,63.3 228.285,64.44 C225.135,65.58 221.58,66.15 217.62,66.15 Z M206.37,36.27 L226.26,36.27 C225.48,33.99 224.205,32.16 222.435,30.78 C220.665,29.4 218.61,28.71 216.27,28.71 C213.87,28.71 211.8,29.37 210.06,30.69 C208.32,32.01 207.09,33.87 206.37,36.27 Z"
120
+ />
121
+ <path
122
+ d="M247.41,65.25 L247.41,17.64 L261.99,17.64 L261.99,22.41 C265.23,18.51 269.4,16.56 274.5,16.56 C277.08,16.62 278.91,17.01 279.99,17.73 L279.99,30.42 C277.95,29.46 275.64,28.98 273.06,28.98 C270.78,28.98 268.665,29.505 266.715,30.555 C264.765,31.605 263.19,33.09 261.99,35.01 L261.99,65.25 L247.41,65.25 Z"
123
+ />
124
+ <path
125
+ d="M286.29,65.25 L286.29,17.64 L300.87,17.64 L300.87,20.88 C304.47,18.12 308.73,16.74 313.65,16.74 C317.37,16.74 320.655,17.55 323.505,19.17 C326.355,20.79 328.59,23.04 330.21,25.92 C331.83,28.8 332.64,32.13 332.64,35.91 L332.64,65.25 L318.06,65.25 L318.06,37.89 C318.06,35.25 317.28,33.15 315.72,31.59 C314.16,30.03 312.06,29.25 309.42,29.25 C305.76,29.25 302.91,30.51 300.87,33.03 L300.87,65.25 L286.29,65.25 Z"
126
+ />
127
+ <polygon
128
+ points="342 65.25 342 2.25 392.04 2.25 392.04 15.66 357.48 15.66 357.48 27.45 380.52 27.45 380.52 40.41 357.48 40.41 357.48 65.25"
129
+ />
130
+ <polygon
131
+ points="399.96 65.25 399.96 2.25 414.54 0 414.54 65.25"
132
+ />
133
+ <path
134
+ d="M429.21,84.69 C428.07,84.69 426.96,84.645 425.88,84.555 C424.8,84.465 423.9,84.33 423.18,84.15 L423.18,71.73 C424.38,71.97 425.88,72.09 427.68,72.09 C432.36,72.09 435.51,70.05 437.13,65.97 L437.13,65.88 L418.86,17.64 L434.97,17.64 L445.5,47.61 L457.74,17.64 L473.49,17.64 L452.16,67.68 C450.42,71.82 448.5,75.135 446.4,77.625 C444.3,80.115 441.87,81.915 439.11,83.025 C436.35,84.135 433.05,84.69 429.21,84.69 Z"
135
+ />
136
+ </g>
137
+ <g
138
+ transform="translate(0.000000, 0.000000)"
139
+ >
140
+ <path
141
+ d="M61.826087,0 L158,0 L158,96.173913 L147.695652,96.173913 C100.271201,96.173913 61.826087,57.7287992 61.826087,10.3043478 L61.826087,0 L61.826087,0 Z"
142
+ fill="#0066CC"
143
+ />
144
+ <path
145
+ d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z"
146
+ fill="url(#linearGradient-basic-masthead)"
147
+ />
148
+ <path
149
+ d="M123.652174,-30.9130435 L30.9130435,123.652174 L103.652174,123.652174 C114.697869,123.652174 123.652174,114.697869 123.652174,103.652174 L123.652174,-30.9130435 L123.652174,-30.9130435 Z"
150
+ fill="url(#linearGradient-basic-masthead)"
151
+ transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "
152
+ />
153
+ </g>
154
+ </g>
155
+ </svg>
156
+ </span>
157
+ </div>
158
+ </div>
159
+ </header>
160
+ <div
161
+ aria-hidden="false"
162
+ class="pf-v6-c-page__sidebar pf-m-expanded"
163
+ id="page-sidebar"
164
+ >
165
+ <div
166
+ class="pf-v6-c-page__sidebar-body"
167
+ >
168
+ <nav
169
+ aria-label="Global"
170
+ class="pf-v6-c-nav"
171
+ data-ouia-component-id="OUIA-Generated-Nav-1"
172
+ data-ouia-component-type="PF6/Nav"
173
+ data-ouia-safe="true"
174
+ id="nav-primary-simple"
175
+ >
176
+ <ul
177
+ class="pf-v6-c-nav__list"
178
+ id="nav-list-simple"
179
+ role="list"
180
+ >
181
+ <li
182
+ class="pf-v6-c-nav__item"
183
+ data-ouia-component-id="OUIA-Generated-NavItem-1"
184
+ data-ouia-component-type="PF6/NavItem"
185
+ data-ouia-safe="true"
186
+ >
187
+ <a
188
+ aria-current="page"
189
+ class="pf-v6-c-nav__link pf-m-current active"
190
+ data-discover="true"
191
+ href="/"
192
+ >
193
+ Dashboard
194
+ </a>
195
+ </li>
196
+ <li
197
+ class="pf-v6-c-nav__item"
198
+ data-ouia-component-id="OUIA-Generated-NavItem-2"
199
+ data-ouia-component-type="PF6/NavItem"
200
+ data-ouia-safe="true"
201
+ >
202
+ <a
203
+ class="pf-v6-c-nav__link"
204
+ data-discover="true"
205
+ href="/support"
206
+ >
207
+ Support
208
+ </a>
209
+ </li>
210
+ <li
211
+ class="pf-v6-c-nav__item"
212
+ data-ouia-component-id="OUIA-Generated-NavExpandable-1"
213
+ data-ouia-component-type="PF6/NavExpandable"
214
+ data-ouia-safe="true"
215
+ >
216
+ <button
217
+ aria-expanded="false"
218
+ class="pf-v6-c-nav__link"
219
+ id="Settings-2"
220
+ >
221
+ Settings
222
+ <span
223
+ class="pf-v6-c-nav__toggle"
224
+ >
225
+ <span
226
+ class="pf-v6-c-nav__toggle-icon"
227
+ >
228
+ <svg
229
+ aria-hidden="true"
230
+ class="pf-v6-svg"
231
+ fill="currentColor"
232
+ height="1em"
233
+ role="img"
234
+ viewBox="0 0 256 512"
235
+ width="1em"
236
+ >
237
+ <path
238
+ d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
239
+ />
240
+ </svg>
241
+ </span>
242
+ </span>
243
+ </button>
244
+ <section
245
+ aria-labelledby="Settings-2"
246
+ class="pf-v6-c-nav__subnav"
247
+ hidden=""
248
+ inert=""
249
+ >
250
+ <ul
251
+ class="pf-v6-c-nav__list"
252
+ role="list"
253
+ >
254
+ <li
255
+ class="pf-v6-c-nav__item"
256
+ data-ouia-component-id="OUIA-Generated-NavItem-3"
257
+ data-ouia-component-type="PF6/NavItem"
258
+ data-ouia-safe="true"
259
+ >
260
+ <a
261
+ class="pf-v6-c-nav__link"
262
+ data-discover="true"
263
+ href="/settings/general"
264
+ >
265
+ General
266
+ </a>
267
+ </li>
268
+ <li
269
+ class="pf-v6-c-nav__item"
270
+ data-ouia-component-id="OUIA-Generated-NavItem-4"
271
+ data-ouia-component-type="PF6/NavItem"
272
+ data-ouia-safe="true"
273
+ >
274
+ <a
275
+ class="pf-v6-c-nav__link"
276
+ data-discover="true"
277
+ href="/settings/profile"
278
+ >
279
+ Profile
280
+ </a>
281
+ </li>
282
+ </ul>
283
+ </section>
284
+ </li>
285
+ <li
286
+ class="pf-v6-c-nav__item"
287
+ data-ouia-component-id="OUIA-Generated-NavExpandable-2"
288
+ data-ouia-component-type="PF6/NavExpandable"
289
+ data-ouia-safe="true"
290
+ >
291
+ <button
292
+ aria-expanded="false"
293
+ class="pf-v6-c-nav__link"
294
+ id="Comments-3"
295
+ >
296
+ Comments
297
+ <span
298
+ class="pf-v6-c-nav__toggle"
299
+ >
300
+ <span
301
+ class="pf-v6-c-nav__toggle-icon"
302
+ >
303
+ <svg
304
+ aria-hidden="true"
305
+ class="pf-v6-svg"
306
+ fill="currentColor"
307
+ height="1em"
308
+ role="img"
309
+ viewBox="0 0 256 512"
310
+ width="1em"
311
+ >
312
+ <path
313
+ d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
314
+ />
315
+ </svg>
316
+ </span>
317
+ </span>
318
+ </button>
319
+ <section
320
+ aria-labelledby="Comments-3"
321
+ class="pf-v6-c-nav__subnav"
322
+ hidden=""
323
+ inert=""
324
+ >
325
+ <ul
326
+ class="pf-v6-c-nav__list"
327
+ role="list"
328
+ >
329
+ <li
330
+ class="pf-v6-c-nav__item"
331
+ data-ouia-component-id="OUIA-Generated-NavItem-5"
332
+ data-ouia-component-type="PF6/NavItem"
333
+ data-ouia-safe="true"
334
+ >
335
+ <div
336
+ class="pf-v6-c-nav__link"
337
+ data-comment-controls="true"
338
+ style="display: flex; align-items: center; justify-content: space-between; padding-right: 1rem;"
339
+ >
340
+ <span>
341
+ Enable Comments
342
+ </span>
343
+ <label
344
+ class="pf-v6-c-switch"
345
+ data-ouia-component-id="OUIA-Generated-Switch-1"
346
+ data-ouia-component-type="PF6/Switch"
347
+ data-ouia-safe="true"
348
+ for="comments-enabled-switch"
349
+ >
350
+ <input
351
+ aria-label="Enable or disable comments"
352
+ class="pf-v6-c-switch__input"
353
+ id="comments-enabled-switch"
354
+ role="switch"
355
+ type="checkbox"
356
+ />
357
+ <span
358
+ class="pf-v6-c-switch__toggle"
359
+ >
360
+ <div
361
+ class="pf-v6-c-switch__toggle-icon"
362
+ >
363
+ <svg
364
+ aria-hidden="true"
365
+ class="pf-v6-svg"
366
+ fill="currentColor"
367
+ height="1em"
368
+ role="img"
369
+ viewBox="0 0 512 512"
370
+ width="1em"
371
+ >
372
+ <path
373
+ d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"
374
+ />
375
+ </svg>
376
+ </div>
377
+ </span>
378
+ </label>
379
+ </div>
380
+ </li>
381
+ <li
382
+ class="pf-v6-c-nav__item"
383
+ data-ouia-component-id="OUIA-Generated-NavItem-6"
384
+ data-ouia-component-type="PF6/NavItem"
385
+ data-ouia-safe="true"
386
+ >
387
+ <div
388
+ class="pf-v6-c-nav__link"
389
+ data-comment-controls="true"
390
+ style="display: flex; align-items: center; justify-content: space-between; padding-right: 1rem;"
391
+ >
392
+ <span>
393
+ Page info drawer
394
+ </span>
395
+ <label
396
+ class="pf-v6-c-switch"
397
+ data-ouia-component-id="OUIA-Generated-Switch-2"
398
+ data-ouia-component-type="PF6/Switch"
399
+ data-ouia-safe="true"
400
+ for="page-info-drawer-switch"
401
+ >
402
+ <input
403
+ aria-label="Pin page info drawer open"
404
+ class="pf-v6-c-switch__input"
405
+ id="page-info-drawer-switch"
406
+ role="switch"
407
+ type="checkbox"
408
+ />
409
+ <span
410
+ class="pf-v6-c-switch__toggle"
411
+ >
412
+ <div
413
+ class="pf-v6-c-switch__toggle-icon"
414
+ >
415
+ <svg
416
+ aria-hidden="true"
417
+ class="pf-v6-svg"
418
+ fill="currentColor"
419
+ height="1em"
420
+ role="img"
421
+ viewBox="0 0 512 512"
422
+ width="1em"
423
+ >
424
+ <path
425
+ d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"
426
+ />
427
+ </svg>
428
+ </div>
429
+ </span>
430
+ </label>
431
+ </div>
432
+ </li>
433
+ <li
434
+ class="pf-v6-c-nav__item"
435
+ data-ouia-component-id="OUIA-Generated-NavItem-7"
436
+ data-ouia-component-type="PF6/NavItem"
437
+ data-ouia-safe="true"
438
+ >
439
+ <div
440
+ class="pf-v6-c-nav__link"
441
+ data-comment-controls="true"
442
+ style="display: flex; align-items: center; justify-content: space-between; padding-right: 1rem;"
443
+ >
444
+ <button
445
+ class="pf-v6-c-button pf-m-link pf-m-inline"
446
+ data-ouia-component-id="OUIA-Generated-Button-link-1"
447
+ data-ouia-component-type="PF6/Button"
448
+ data-ouia-safe="true"
449
+ type="button"
450
+ >
451
+ <span
452
+ class="pf-v6-c-button__icon pf-m-start"
453
+ >
454
+ <svg
455
+ aria-hidden="true"
456
+ class="pf-v6-svg"
457
+ fill="currentColor"
458
+ height="1em"
459
+ role="img"
460
+ viewBox="0 0 496 512"
461
+ width="1em"
462
+ >
463
+ <path
464
+ d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
465
+ />
466
+ </svg>
467
+ </span>
468
+ <span
469
+ class="pf-v6-c-button__text"
470
+ >
471
+ Sign in with GitHub
472
+ </span>
473
+ </button>
474
+ </div>
475
+ </li>
476
+ </ul>
477
+ </section>
478
+ </li>
479
+ </ul>
480
+ </nav>
481
+ </div>
482
+ </div>
483
+ <div
484
+ class="pf-v6-c-page__main-container"
485
+ >
486
+ <main
487
+ class="pf-v6-c-page__main"
488
+ id="primary-app-container"
489
+ tabindex="-1"
490
+ >
491
+ <div
492
+ class="pf-v6-c-drawer pf-m-inline"
493
+ >
494
+ <div
495
+ class="pf-v6-c-drawer__main"
496
+ >
497
+ <div
498
+ class="pf-v6-c-drawer__content"
499
+ >
500
+ <div
501
+ class="pf-v6-c-drawer__body"
502
+ style="position: relative;"
503
+ >
504
+ <section
505
+ class="pf-v6-c-page__main-section"
506
+ >
507
+ <h1
508
+ class="pf-v6-c-title pf-m-lg"
509
+ data-ouia-component-id="OUIA-Generated-Title-1"
510
+ data-ouia-component-type="PF6/Title"
511
+ data-ouia-safe="true"
512
+ >
513
+ Dashboard Page Title!
514
+ </h1>
515
+ </section>
516
+ </div>
517
+ </div>
518
+ </div>
519
+ </div>
520
+ </main>
521
+ </div>
522
+ </div>
523
+ </DocumentFragment>
524
+ `;
@@ -0,0 +1,11 @@
1
+ html,
2
+ body,
3
+ #root {
4
+ height: 100%;
5
+ }
6
+
7
+ .pf-v6-c-content {
8
+ --pf-v6-c-content--small--Color: var(--pf-t--global--color--status--danger--default); /* changes all <small> color to the semantic token for danger */
9
+ --pf-v6-c-content--blockquote--BorderLeftColor: var(--pf-t--global--color--nonstatus--purple--default); /* changes all <blockquote> left border color to the semantic token for non-status (purple) */
10
+ --pf-v6-c-content--hr--BackgroundColor: var(--pf-t--global--color--nonstatus--yellow--default); /* changes a <hr> color to the semantic token for non-status (yellow) */
11
+ }
@@ -0,0 +1,55 @@
1
+ import * as React from 'react';
2
+ import App from '@app/index';
3
+ import { render, screen } from '@testing-library/react';
4
+ import userEvent from '@testing-library/user-event';
5
+ import { describe, expect, it, test } from 'vitest';
6
+
7
+ describe('App tests', () => {
8
+ test('should render default App component', () => {
9
+ const { asFragment } = render(<App />);
10
+
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
13
+
14
+ it('should render a nav-toggle button', () => {
15
+ render(<App />);
16
+
17
+ expect(screen.getByRole('button', { name: 'Global navigation' })).toBeVisible();
18
+ });
19
+
20
+ // I'm fairly sure that this test not going to work properly no matter what we do since JSDOM doesn't actually
21
+ // draw anything. We could potentially make something work, likely using a different test environment, but
22
+ // using Cypress for this kind of test would be more efficient.
23
+ it.skip('should hide the sidebar on smaller viewports', () => {
24
+ Object.defineProperty(window, 'innerWidth', { writable: true, configurable: true, value: 600 });
25
+
26
+ render(<App />);
27
+
28
+ window.dispatchEvent(new Event('resize'));
29
+
30
+ expect(screen.queryByRole('link', { name: 'Dashboard' })).not.toBeInTheDocument();
31
+ });
32
+
33
+ it('should expand the sidebar on larger viewports', () => {
34
+ render(<App />);
35
+
36
+ window.dispatchEvent(new Event('resize'));
37
+
38
+ expect(screen.getByRole('link', { name: 'Dashboard' })).toBeVisible();
39
+ });
40
+
41
+ it('should hide the sidebar when clicking the nav-toggle button', async () => {
42
+ const user = userEvent.setup();
43
+
44
+ render(<App />);
45
+
46
+ window.dispatchEvent(new Event('resize'));
47
+ const button = screen.getByRole('button', { name: 'Global navigation' });
48
+
49
+ expect(screen.getByRole('link', { name: 'Dashboard' })).toBeVisible();
50
+
51
+ await user.click(button);
52
+
53
+ expect(screen.queryByRole('link', { name: 'Dashboard' })).not.toBeInTheDocument();
54
+ });
55
+ });
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="679px" height="158px" viewBox="0 0 679 158" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Patternfly Logo</title>
4
+ <defs>
5
+ <linearGradient x1="100%" y1="1.31838984e-13%" x2="40.4021492%" y2="59.4473677%" id="linearGradient-1">
6
+ <stop stop-color="#FFFFFF" offset="0%"></stop>
7
+ <stop stop-color="#FFFFFF" stop-opacity="0.498497596" offset="100%"></stop>
8
+ </linearGradient>
9
+ </defs>
10
+ <g id="PF-HorizontalLogo-Reverse" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
11
+ <g id="Group" transform="translate(-0.000000, 0.000000)">
12
+ <path d="M61.7658863,0 L157.846154,0 L157.846154,96.0802676 C104.782487,96.0802676 61.7658863,53.0636665 61.7658863,0 L61.7658863,0 L61.7658863,0 Z" id="Rectangle-Copy-15" fill="#FFFFFF" opacity="0.401297433"></path>
13
+ <path d="M158,1.84777167 L158,138 C158,149.045695 149.045695,158 138,158 L66.3656919,158 L158,1.84777167 Z M156.152228,3.55271368e-13 L-9.37916411e-13,91.6343081 L-9.37916411e-13,20 C-9.09494702e-13,8.954305 8.954305,3.55271368e-13 20,3.41060513e-13 L156.152228,3.55271368e-13 Z" id="Combined-Shape-Copy-4" fill="url(#linearGradient-1)"></path>
14
+ </g>
15
+ <g id="PatternFly-Copy-11" transform="translate(206.000000, 45.750000)" fill="#FFFFFF" fill-rule="nonzero">
16
+ <path d="M0,65.25 L0,2.25 L33.21,2.25 C37.35,2.25 41.025,3.135 44.235,4.905 C47.445,6.675 49.98,9.09 51.84,12.15 C53.7,15.21 54.63,18.72 54.63,22.68 C54.63,26.46 53.7,29.865 51.84,32.895 C49.98,35.925 47.43,38.31 44.19,40.05 C40.95,41.79 37.29,42.66 33.21,42.66 L15.48,42.66 L15.48,65.25 L0,65.25 Z M15.48,29.88 L31.41,29.88 C33.69,29.88 35.52,29.22 36.9,27.9 C38.28,26.58 38.97,24.87 38.97,22.77 C38.97,20.61 38.28,18.855 36.9,17.505 C35.52,16.155 33.69,15.48 31.41,15.48 L15.48,15.48 L15.48,29.88 Z" id="Shape"></path>
17
+ <path d="M77.04,66.06 C73.68,66.06 70.695,65.43 68.085,64.17 C65.475,62.91 63.435,61.17 61.965,58.95 C60.495,56.73 59.76,54.18 59.76,51.3 C59.76,46.74 61.485,43.215 64.935,40.725 C68.385,38.235 73.2,36.99 79.38,36.99 C83.1,36.99 86.7,37.44 90.18,38.34 L90.18,36 C90.18,31.26 87.15,28.89 81.09,28.89 C77.49,28.89 72.69,30.15 66.69,32.67 L61.47,21.96 C69.15,18.48 76.56,16.74 83.7,16.74 C90.3,16.74 95.43,18.315 99.09,21.465 C102.75,24.615 104.58,29.04 104.58,34.74 L104.58,65.25 L90.18,65.25 L90.18,62.37 C88.26,63.69 86.235,64.635 84.105,65.205 C81.975,65.775 79.62,66.06 77.04,66.06 Z M73.62,51.03 C73.62,52.53 74.28,53.7 75.6,54.54 C76.92,55.38 78.75,55.8 81.09,55.8 C84.69,55.8 87.72,55.05 90.18,53.55 L90.18,47.43 C87.42,46.71 84.54,46.35 81.54,46.35 C79.02,46.35 77.07,46.755 75.69,47.565 C74.31,48.375 73.62,49.53 73.62,51.03 Z" id="Shape"></path>
18
+ <path d="M137.25,65.88 C125.73,65.88 119.97,60.84 119.97,50.76 L119.97,29.79 L110.34,29.79 L110.34,17.64 L119.97,17.64 L119.97,5.4 L134.55,2.25 L134.55,17.64 L147.87,17.64 L147.87,29.79 L134.55,29.79 L134.55,47.88 C134.55,49.98 135.015,51.465 135.945,52.335 C136.875,53.205 138.51,53.64 140.85,53.64 C143.01,53.64 145.2,53.31 147.42,52.65 L147.42,64.44 C146.1,64.86 144.42,65.205 142.38,65.475 C140.34,65.745 138.63,65.88 137.25,65.88 Z" id="Path"></path>
19
+ <path d="M177.57,65.88 C166.05,65.88 160.29,60.84 160.29,50.76 L160.29,29.79 L150.66,29.79 L150.66,17.64 L160.29,17.64 L160.29,5.4 L174.87,2.25 L174.87,17.64 L188.19,17.64 L188.19,29.79 L174.87,29.79 L174.87,47.88 C174.87,49.98 175.335,51.465 176.265,52.335 C177.195,53.205 178.83,53.64 181.17,53.64 C183.33,53.64 185.52,53.31 187.74,52.65 L187.74,64.44 C186.42,64.86 184.74,65.205 182.7,65.475 C180.66,65.745 178.95,65.88 177.57,65.88 Z" id="Path"></path>
20
+ <path d="M217.62,66.15 C212.76,66.15 208.365,65.055 204.435,62.865 C200.505,60.675 197.4,57.72 195.12,54 C192.84,50.28 191.7,46.11 191.7,41.49 C191.7,36.87 192.795,32.7 194.985,28.98 C197.175,25.26 200.16,22.305 203.94,20.115 C207.72,17.925 211.92,16.83 216.54,16.83 C221.22,16.83 225.36,17.955 228.96,20.205 C232.56,22.455 235.395,25.53 237.465,29.43 C239.535,33.33 240.57,37.8 240.57,42.84 L240.57,46.44 L206.64,46.44 C207.6,48.66 209.1,50.475 211.14,51.885 C213.18,53.295 215.58,54 218.34,54 C222.42,54 225.6,52.8 227.88,50.4 L237.51,58.95 C234.51,61.47 231.435,63.3 228.285,64.44 C225.135,65.58 221.58,66.15 217.62,66.15 Z M206.37,36.27 L226.26,36.27 C225.48,33.99 224.205,32.16 222.435,30.78 C220.665,29.4 218.61,28.71 216.27,28.71 C213.87,28.71 211.8,29.37 210.06,30.69 C208.32,32.01 207.09,33.87 206.37,36.27 Z" id="Shape"></path>
21
+ <path d="M247.41,65.25 L247.41,17.64 L261.99,17.64 L261.99,22.41 C265.23,18.51 269.4,16.56 274.5,16.56 C277.08,16.62 278.91,17.01 279.99,17.73 L279.99,30.42 C277.95,29.46 275.64,28.98 273.06,28.98 C270.78,28.98 268.665,29.505 266.715,30.555 C264.765,31.605 263.19,33.09 261.99,35.01 L261.99,65.25 L247.41,65.25 Z" id="Path"></path>
22
+ <path d="M286.29,65.25 L286.29,17.64 L300.87,17.64 L300.87,20.88 C304.47,18.12 308.73,16.74 313.65,16.74 C317.37,16.74 320.655,17.55 323.505,19.17 C326.355,20.79 328.59,23.04 330.21,25.92 C331.83,28.8 332.64,32.13 332.64,35.91 L332.64,65.25 L318.06,65.25 L318.06,37.89 C318.06,35.25 317.28,33.15 315.72,31.59 C314.16,30.03 312.06,29.25 309.42,29.25 C305.76,29.25 302.91,30.51 300.87,33.03 L300.87,65.25 L286.29,65.25 Z" id="Path"></path>
23
+ <polygon id="Path" points="342 65.25 342 2.25 392.04 2.25 392.04 15.66 357.48 15.66 357.48 27.45 380.52 27.45 380.52 40.41 357.48 40.41 357.48 65.25"></polygon>
24
+ <polygon id="Path" points="399.96 65.25 399.96 2.25 414.54 0 414.54 65.25"></polygon>
25
+ <path d="M429.21,84.69 C428.07,84.69 426.96,84.645 425.88,84.555 C424.8,84.465 423.9,84.33 423.18,84.15 L423.18,71.73 C424.38,71.97 425.88,72.09 427.68,72.09 C432.36,72.09 435.51,70.05 437.13,65.97 L437.13,65.88 L418.86,17.64 L434.97,17.64 L445.5,47.61 L457.74,17.64 L473.49,17.64 L452.16,67.68 C450.42,71.82 448.5,75.135 446.4,77.625 C444.3,80.115 441.87,81.915 439.11,83.025 C436.35,84.135 433.05,84.69 429.21,84.69 Z" id="Path"></path>
26
+ </g>
27
+ </g>
28
+ </svg>