(
({ children, className, ...rest }: ActionMenuLabelProps, ref) => {
return (
&
ActionMenuGroupLabelingProps;
-const ActionMenuGroup = forwardRef<
+export const ActionMenuGroup = forwardRef<
ActionMenuGroupElement,
ActionMenuGroupProps
>(({ children, className, label, ...rest }: ActionMenuGroupProps, ref) => {
@@ -519,7 +525,7 @@ interface ActionMenuItemProps extends Omit {
icon?: React.ReactNode;
}
-const ActionMenuItem: OverridableComponent<
+export const ActionMenuItem: OverridableComponent<
ActionMenuItemProps,
ActionMenuItemElement
> = forwardRef(
@@ -577,7 +583,7 @@ interface ActionMenuCheckboxItemProps
shortcut?: string;
}
-const ActionMenuCheckboxItem = forwardRef<
+export const ActionMenuCheckboxItem = forwardRef<
ActionMenuCheckboxItemElement,
ActionMenuCheckboxItemProps
>(
@@ -687,7 +693,7 @@ type ActionMenuRadioGroupProps = ActionMenuGroupLabelingProps &
children: React.ReactNode;
};
-const ActionMenuRadioGroup = forwardRef<
+export const ActionMenuRadioGroup = forwardRef<
ActionMenuRadioGroupElement,
ActionMenuRadioGroupProps
>(({ children, label, ...rest }: ActionMenuRadioGroupProps, ref) => {
@@ -719,7 +725,7 @@ interface ActionMenuRadioItemProps extends Omit {
children: React.ReactNode;
}
-const ActionMenuRadioItem = forwardRef<
+export const ActionMenuRadioItem = forwardRef<
ActionMenuRadioItemElement,
ActionMenuRadioItemProps
>(
@@ -810,7 +816,7 @@ type ActionMenuDividerElement = React.ElementRef;
type MenuDividerProps = React.ComponentPropsWithoutRef;
type ActionMenuDividerProps = Omit;
-const ActionMenuDivider = forwardRef<
+export const ActionMenuDivider = forwardRef<
ActionMenuDividerElement,
ActionMenuDividerProps
>(({ className, ...rest }: ActionMenuDividerProps, ref) => {
@@ -843,7 +849,7 @@ interface ActionMenuSubProps {
onOpenChange?: (open: boolean) => void;
}
-const ActionMenuSub = (props: ActionMenuSubProps) => {
+export const ActionMenuSub = (props: ActionMenuSubProps) => {
const { children, open: openProp, onOpenChange, defaultOpen = false } = props;
const [open = false, setOpen] = useControllableState({
@@ -871,7 +877,7 @@ interface ActionMenuSubTriggerProps
icon?: React.ReactNode;
}
-const ActionMenuSubTrigger = forwardRef<
+export const ActionMenuSubTrigger = forwardRef<
ActionMenuSubTriggerElement,
ActionMenuSubTriggerProps
>(({ children, className, icon, ...rest }: ActionMenuSubTriggerProps, ref) => {
@@ -910,7 +916,7 @@ interface ActionMenuSubContentProps
children: React.ReactNode;
}
-const ActionMenuSubContent = forwardRef<
+export const ActionMenuSubContent = forwardRef<
ActionMenuSubContentElement,
ActionMenuSubContentProps
>(
@@ -973,30 +979,18 @@ ActionMenu.Sub = ActionMenuSub;
ActionMenu.SubTrigger = ActionMenuSubTrigger;
ActionMenu.SubContent = ActionMenuSubContent;
-export {
- ActionMenu,
- ActionMenuCheckboxItem,
- ActionMenuContent,
- ActionMenuDivider,
- ActionMenuGroup,
- ActionMenuItem,
- ActionMenuLabel,
- ActionMenuRadioGroup,
- ActionMenuRadioItem,
- ActionMenuSub,
- ActionMenuSubContent,
- ActionMenuSubTrigger,
- ActionMenuTrigger,
- type ActionMenuCheckboxItemProps,
- type ActionMenuContentProps,
- type ActionMenuDividerProps,
- type ActionMenuGroupProps,
- type ActionMenuLabelProps,
- type ActionMenuProps,
- type ActionMenuRadioGroupProps,
- type ActionMenuRadioItemProps,
- type ActionMenuSubContentProps,
- type ActionMenuSubProps,
- type ActionMenuSubTriggerProps,
- type ActionMenuTriggerProps,
+export type {
+ ActionMenuItemProps,
+ ActionMenuCheckboxItemProps,
+ ActionMenuContentProps,
+ ActionMenuDividerProps,
+ ActionMenuGroupProps,
+ ActionMenuLabelProps,
+ ActionMenuProps,
+ ActionMenuRadioGroupProps,
+ ActionMenuRadioItemProps,
+ ActionMenuSubContentProps,
+ ActionMenuSubProps,
+ ActionMenuSubTriggerProps,
+ ActionMenuTriggerProps,
};
diff --git a/@navikt/core/react/src/overlays/action-menu/index.ts b/@navikt/core/react/src/overlays/action-menu/index.ts
index 900fd62390..9dd738e6c3 100644
--- a/@navikt/core/react/src/overlays/action-menu/index.ts
+++ b/@navikt/core/react/src/overlays/action-menu/index.ts
@@ -13,6 +13,7 @@ export {
ActionMenuSubContent,
ActionMenuSubTrigger,
ActionMenuTrigger,
+ type ActionMenuItemProps,
type ActionMenuCheckboxItemProps,
type ActionMenuContentProps,
type ActionMenuGroupProps,
diff --git a/aksel.nav.no/website/components/sanity-modules/code-snippet/Snippet.tsx b/aksel.nav.no/website/components/sanity-modules/code-snippet/Snippet.tsx
index 6f621b9e2c..04e0c589d2 100644
--- a/aksel.nav.no/website/components/sanity-modules/code-snippet/Snippet.tsx
+++ b/aksel.nav.no/website/components/sanity-modules/code-snippet/Snippet.tsx
@@ -88,6 +88,7 @@ const CodeSnippet = ({ node: { code, title } }: CodeSnippetProps) => {
{line.map((token, key) => (
))}
+ {`\n` /* Needed for copy-pasting in some browsers */}
))}
diff --git a/aksel.nav.no/website/pages/eksempler/datepicker/disabled-days.tsx b/aksel.nav.no/website/pages/eksempler/datepicker/disabled-days.tsx
index af427fd928..42886a5c45 100644
--- a/aksel.nav.no/website/pages/eksempler/datepicker/disabled-days.tsx
+++ b/aksel.nav.no/website/pages/eksempler/datepicker/disabled-days.tsx
@@ -1,16 +1,16 @@
import { DatePicker } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";
-const Example = () => {
- const disabledDays = [
- new Date("Oct 10 2022"),
- { from: new Date("Oct 17 2022"), to: new Date("Nov 10 2022") },
- (date) => isFriday(date),
- ];
+const disabledDays = [
+ new Date("Oct 14 2024"),
+ { from: new Date("Oct 21 2024"), to: new Date("Nov 10 2024") },
+ (date) => isFriday(date),
+];
+const Example = () => {
return (
diff --git a/aksel.nav.no/website/pages/eksempler/datepicker/dropdown.tsx b/aksel.nav.no/website/pages/eksempler/datepicker/dropdown.tsx
index e509e7bbd7..761ddd3ecf 100644
--- a/aksel.nav.no/website/pages/eksempler/datepicker/dropdown.tsx
+++ b/aksel.nav.no/website/pages/eksempler/datepicker/dropdown.tsx
@@ -1,13 +1,15 @@
import { DatePicker } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";
+const year = new Date().getFullYear();
+
const Example = () => {
return (
);
};
diff --git a/aksel.nav.no/website/pages/eksempler/monthpicker/disabled-months.tsx b/aksel.nav.no/website/pages/eksempler/monthpicker/disabled-months.tsx
index 4570669cdc..86e322bc77 100644
--- a/aksel.nav.no/website/pages/eksempler/monthpicker/disabled-months.tsx
+++ b/aksel.nav.no/website/pages/eksempler/monthpicker/disabled-months.tsx
@@ -1,18 +1,20 @@
import { MonthPicker } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";
-const Example = () => {
- const disabledDays = [
- new Date("May 10 2022"),
- { from: new Date("Nov 17 2022"), to: new Date("Feb 10 2023") },
- ];
+const year = new Date().getFullYear();
+
+const disabledDays = [
+ new Date(`May 10 ${year}`),
+ { from: new Date(`Nov 17 ${year}`), to: new Date(`Feb 10 ${year + 1}`) },
+];
+const Example = () => {
return (
);
diff --git a/aksel.nav.no/website/pages/eksempler/monthpicker/dropdown.tsx b/aksel.nav.no/website/pages/eksempler/monthpicker/dropdown.tsx
index 8fe162aecd..d874ed8433 100644
--- a/aksel.nav.no/website/pages/eksempler/monthpicker/dropdown.tsx
+++ b/aksel.nav.no/website/pages/eksempler/monthpicker/dropdown.tsx
@@ -1,13 +1,15 @@
import { MonthPicker } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";
+const year = new Date().getFullYear();
+
const Example = () => {
return (
);
};
diff --git a/aksel.nav.no/website/sanity/schema/objects/shared/riktekst.tsx b/aksel.nav.no/website/sanity/schema/objects/shared/riktekst.tsx
index 042c0a8b5c..cf187ec088 100644
--- a/aksel.nav.no/website/sanity/schema/objects/shared/riktekst.tsx
+++ b/aksel.nav.no/website/sanity/schema/objects/shared/riktekst.tsx
@@ -188,7 +188,7 @@ const Riktekst = (
const templates = ["kode_eksempler", "exampletext_block"];
- const grunnleggende = ["spesial_seksjon", "attachment"];
+ const grunnleggende = ["spesial_seksjon", "attachment", "props_seksjon"];
fields.push(...standard);