@phillips/seldon 1.38.5 → 1.38.6
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { LinkProps } from '../../Link/Link';
|
|
2
3
|
import { LinkVariants } from '../../Link/utils';
|
|
3
4
|
export interface NavigationItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> {
|
|
4
5
|
/**
|
|
@@ -25,6 +26,10 @@ export interface NavigationItemProps extends Omit<React.HTMLAttributes<HTMLLIEle
|
|
|
25
26
|
* Optional type for navigation item
|
|
26
27
|
*/
|
|
27
28
|
navType?: LinkVariants;
|
|
29
|
+
/**
|
|
30
|
+
* Element to render within the navigation item, renders <Link> by default
|
|
31
|
+
*/
|
|
32
|
+
element?: React.ElementType<LinkProps>;
|
|
28
33
|
}
|
|
29
|
-
declare const NavigationItem: ({ badge, className, href, label, navGroup, navType, onClick, ...props }: React.PropsWithChildren<NavigationItemProps>) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare const NavigationItem: ({ badge, className, href, label, navGroup, navType, onClick, element: Component, ...props }: React.PropsWithChildren<NavigationItemProps>) => import("react/jsx-runtime").JSX.Element;
|
|
30
35
|
export default NavigationItem;
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { px as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { LinkVariants as
|
|
7
|
-
import { HeaderContext as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { px as a } from "../../../utils/index.js";
|
|
4
|
+
import x from "../../../node_modules/classnames/index.js";
|
|
5
|
+
import v from "../../Link/Link.js";
|
|
6
|
+
import { LinkVariants as _ } from "../../Link/utils.js";
|
|
7
|
+
import { HeaderContext as h } from "../../Header/Header.js";
|
|
8
|
+
const C = ({
|
|
9
9
|
badge: e,
|
|
10
|
-
className:
|
|
10
|
+
className: i = "",
|
|
11
11
|
href: r,
|
|
12
12
|
label: n,
|
|
13
13
|
navGroup: s,
|
|
14
|
-
navType:
|
|
14
|
+
navType: m,
|
|
15
15
|
onClick: o,
|
|
16
|
-
|
|
16
|
+
element: l = v,
|
|
17
|
+
...c
|
|
17
18
|
}) => {
|
|
18
|
-
const { expandedItem:
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
const { expandedItem: d } = f.useContext(h);
|
|
20
|
+
return /* @__PURE__ */ t(
|
|
20
21
|
"li",
|
|
21
22
|
{
|
|
22
|
-
...
|
|
23
|
+
...c,
|
|
23
24
|
onClick: o,
|
|
24
25
|
"data-testid": `nav-item-${n}`,
|
|
25
|
-
className:
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
e ? /* @__PURE__ */
|
|
26
|
+
className: x(`${a}-nav__item`, s, i),
|
|
27
|
+
children: /* @__PURE__ */ p(l, { href: r, variant: m || _.navMain, tabIndex: d === "" ? 0 : -1, children: [
|
|
28
|
+
/* @__PURE__ */ t("span", { className: `${a}-nav__item--label`, children: n }),
|
|
29
|
+
e ? /* @__PURE__ */ t("span", { className: `${a}-nav__item--badge `, children: e }) : null
|
|
29
30
|
] })
|
|
30
31
|
}
|
|
31
32
|
);
|
|
32
33
|
};
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
C as default
|
|
35
36
|
};
|
package/dist/scss/_utils.scss
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
display: grid;
|
|
57
57
|
gap: $spacing-md;
|
|
58
58
|
grid-template-columns: repeat($columns, 1fr);
|
|
59
|
+
row-gap: $spacing-lg;
|
|
59
60
|
|
|
60
61
|
@if $margins-on {
|
|
61
62
|
@include gridMargins;
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
display: grid;
|
|
67
68
|
gap: $spacing-md;
|
|
68
69
|
grid-template-columns: repeat(2, 1fr);
|
|
70
|
+
row-gap: $spacing-lg;
|
|
69
71
|
|
|
70
72
|
@media (min-width: $breakpoint-md) {
|
|
71
73
|
grid-template-columns: repeat(4, 1fr);
|