@norges-domstoler/dds-components 0.0.0-dev-20240822123852 → 0.0.0-dev-20240826095821
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.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -8422,7 +8422,7 @@ var InternalHeader_default = {
|
|
|
8422
8422
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
8423
8423
|
import { forwardRef as forwardRef60 } from "react";
|
|
8424
8424
|
import { jsx as jsx246 } from "react/jsx-runtime";
|
|
8425
|
-
var NavigationItem = forwardRef60(({
|
|
8425
|
+
var NavigationItem = forwardRef60(({ isCurrent, ...rest }, ref) => {
|
|
8426
8426
|
return /* @__PURE__ */ jsx246(
|
|
8427
8427
|
"a",
|
|
8428
8428
|
{
|
|
@@ -8434,8 +8434,7 @@ var NavigationItem = forwardRef60(({ title, isCurrent, ...rest }, ref) => {
|
|
|
8434
8434
|
isCurrent && InternalHeader_default["nav-list__item__link--active"],
|
|
8435
8435
|
typographyStyles_default["body-sans-02"],
|
|
8436
8436
|
focusable
|
|
8437
|
-
)
|
|
8438
|
-
children: title
|
|
8437
|
+
)
|
|
8439
8438
|
}
|
|
8440
8439
|
);
|
|
8441
8440
|
});
|
|
@@ -8448,10 +8447,10 @@ var InternalHeader = (props) => {
|
|
|
8448
8447
|
applicationName,
|
|
8449
8448
|
applicationHref,
|
|
8450
8449
|
smallScreenBreakpoint,
|
|
8451
|
-
|
|
8452
|
-
|
|
8450
|
+
navItems,
|
|
8451
|
+
contextMenuItems,
|
|
8453
8452
|
currentPageHref,
|
|
8454
|
-
|
|
8453
|
+
user,
|
|
8455
8454
|
onCurrentPageChange,
|
|
8456
8455
|
id,
|
|
8457
8456
|
className,
|
|
@@ -8471,8 +8470,8 @@ var InternalHeader = (props) => {
|
|
|
8471
8470
|
setContextMenuIsClosed(!contextMenuIsClosed);
|
|
8472
8471
|
};
|
|
8473
8472
|
const onOveflowMenuClose = () => setContextMenuIsClosed(true);
|
|
8474
|
-
const hasNavigationElements = !!
|
|
8475
|
-
const hasContextMenuElements = !!
|
|
8473
|
+
const hasNavigationElements = !!navItems && navItems.length > 0;
|
|
8474
|
+
const hasContextMenuElements = !!contextMenuItems && contextMenuItems.length > 0;
|
|
8476
8475
|
const hasSmallScreenBreakpoint = !!smallScreenBreakpoint;
|
|
8477
8476
|
const hasNavInContextMenu = hasSmallScreenBreakpoint && hasNavigationElements;
|
|
8478
8477
|
const navigation = hasNavigationElements ? /* @__PURE__ */ jsx247("nav", { "aria-label": "sidenavigasjon", children: /* @__PURE__ */ jsx247(
|
|
@@ -8483,7 +8482,7 @@ var InternalHeader = (props) => {
|
|
|
8483
8482
|
hasSmallScreenBreakpoint && InternalHeader_default[`nav-list--small-screen-${smallScreenBreakpoint}`],
|
|
8484
8483
|
utilStyles_default["remove-list-styling"]
|
|
8485
8484
|
),
|
|
8486
|
-
children:
|
|
8485
|
+
children: navItems.map((item, index) => {
|
|
8487
8486
|
const { href, ...rest2 } = item;
|
|
8488
8487
|
const isCurrent = href === currentPage;
|
|
8489
8488
|
return /* @__PURE__ */ jsx247("li", { className: InternalHeader_default["nav-list__item"], children: /* @__PURE__ */ jsx247(
|
|
@@ -8498,8 +8497,8 @@ var InternalHeader = (props) => {
|
|
|
8498
8497
|
})
|
|
8499
8498
|
}
|
|
8500
8499
|
) }) : null;
|
|
8501
|
-
const hasContextMenu = hasContextMenuElements || !!
|
|
8502
|
-
const hasContextMenuLargeScreen = hasContextMenuElements || !!
|
|
8500
|
+
const hasContextMenu = hasContextMenuElements || !!user || hasNavInContextMenu;
|
|
8501
|
+
const hasContextMenuLargeScreen = hasContextMenuElements || !!user;
|
|
8503
8502
|
return /* @__PURE__ */ jsxs54(
|
|
8504
8503
|
"div",
|
|
8505
8504
|
{
|
|
@@ -8556,7 +8555,7 @@ var InternalHeader = (props) => {
|
|
|
8556
8555
|
anchorRef: buttonRef,
|
|
8557
8556
|
className: InternalHeader_default["context-menu"],
|
|
8558
8557
|
children: [
|
|
8559
|
-
|
|
8558
|
+
user && /* @__PURE__ */ jsx247(OverflowMenuList, { children: user.href ? /* @__PURE__ */ jsx247(OverflowMenuLink, { icon: PersonIcon, ...user }) : /* @__PURE__ */ jsx247(OverflowMenuSpan, { icon: PersonIcon, ...user }) }),
|
|
8560
8559
|
hasNavInContextMenu && /* @__PURE__ */ jsx247(
|
|
8561
8560
|
"nav",
|
|
8562
8561
|
{
|
|
@@ -8565,7 +8564,7 @@ var InternalHeader = (props) => {
|
|
|
8565
8564
|
InternalHeader_default["nav--in-menu--small-screen"],
|
|
8566
8565
|
InternalHeader_default[`nav--in-menu--small-screen-${smallScreenBreakpoint}`]
|
|
8567
8566
|
),
|
|
8568
|
-
children: /* @__PURE__ */ jsx247(OverflowMenuList, { children:
|
|
8567
|
+
children: /* @__PURE__ */ jsx247(OverflowMenuList, { children: navItems.map((item) => /* @__PURE__ */ jsx247(OverflowMenuLink, { ...item })) })
|
|
8569
8568
|
}
|
|
8570
8569
|
),
|
|
8571
8570
|
hasNavInContextMenu && hasContextMenuElements && /* @__PURE__ */ jsx247(
|
|
@@ -8577,9 +8576,13 @@ var InternalHeader = (props) => {
|
|
|
8577
8576
|
)
|
|
8578
8577
|
}
|
|
8579
8578
|
),
|
|
8580
|
-
hasContextMenuElements && /* @__PURE__ */ jsx247(OverflowMenuList, { children:
|
|
8581
|
-
|
|
8582
|
-
|
|
8579
|
+
hasContextMenuElements && /* @__PURE__ */ jsx247(OverflowMenuList, { children: contextMenuItems.map((item) => {
|
|
8580
|
+
return item.href ? /* @__PURE__ */ jsx247(OverflowMenuLink, { ...item }) : /* @__PURE__ */ jsx247(
|
|
8581
|
+
OverflowMenuButton,
|
|
8582
|
+
{
|
|
8583
|
+
...item
|
|
8584
|
+
}
|
|
8585
|
+
);
|
|
8583
8586
|
}) })
|
|
8584
8587
|
]
|
|
8585
8588
|
}
|