uikit-react-public 0.27.1 → 0.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -19367,6 +19367,12 @@ const Ot = ({
|
|
|
19367
19367
|
color: inherit;
|
|
19368
19368
|
text-decoration: none;
|
|
19369
19369
|
|
|
19370
|
+
&::after {
|
|
19371
|
+
content: '';
|
|
19372
|
+
position: absolute;
|
|
19373
|
+
inset: 0;
|
|
19374
|
+
}
|
|
19375
|
+
|
|
19370
19376
|
&:hover,
|
|
19371
19377
|
&:visited,
|
|
19372
19378
|
&:active,
|
|
@@ -249,6 +249,42 @@ describe('Menu', () => {
|
|
|
249
249
|
);
|
|
250
250
|
});
|
|
251
251
|
|
|
252
|
+
test.each([
|
|
253
|
+
{
|
|
254
|
+
name: 'primary',
|
|
255
|
+
menu: (
|
|
256
|
+
<Menu.PrimaryItem asChild>
|
|
257
|
+
<a href='/home'>Home</a>
|
|
258
|
+
</Menu.PrimaryItem>
|
|
259
|
+
),
|
|
260
|
+
linkName: 'Home',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: 'accordion',
|
|
264
|
+
menu: (
|
|
265
|
+
<Menu.Accordion.Item asChild>
|
|
266
|
+
<a href='/library'>Library</a>
|
|
267
|
+
</Menu.Accordion.Item>
|
|
268
|
+
),
|
|
269
|
+
linkName: 'Library',
|
|
270
|
+
},
|
|
271
|
+
])('$name asChild link covers the full item', ({ menu, linkName }) => {
|
|
272
|
+
wrap(<Menu>{menu}</Menu>);
|
|
273
|
+
|
|
274
|
+
const link = screen.getByRole('link', { name: linkName });
|
|
275
|
+
const generatedClass = Array.from(link.classList).find((className) =>
|
|
276
|
+
className.startsWith('css-')
|
|
277
|
+
);
|
|
278
|
+
const cssRules = Array.from(document.styleSheets)
|
|
279
|
+
.flatMap((styleSheet) => Array.from(styleSheet.cssRules))
|
|
280
|
+
.map((rule) => rule.cssText)
|
|
281
|
+
.join(' ');
|
|
282
|
+
|
|
283
|
+
expect(cssRules).toContain(`.${generatedClass}::after`);
|
|
284
|
+
expect(cssRules).toContain('position: absolute');
|
|
285
|
+
expect(cssRules).toContain('inset: 0');
|
|
286
|
+
});
|
|
287
|
+
|
|
252
288
|
test('primary item enforces icon on the left', () => {
|
|
253
289
|
const { getByText } = wrap(
|
|
254
290
|
<Menu>
|