@norges-domstoler/dds-components 0.0.0-dev-20251016103419 → 0.0.0-dev-20251016104350

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 CHANGED
@@ -2709,7 +2709,7 @@ type CookieBannerProps = BaseComponentPropsWithChildren<HTMLDivElement, {
2709
2709
  /**Brekkpunkt for sammentrukket variant; Brukes på siden med detaljer om informasjonskapsler. */
2710
2710
  collapsedBreakpoint?: Breakpoint;
2711
2711
  } & Pick<ResponsiveProps, 'position' | 'top' | 'bottom' | 'left' | 'right' | 'width' | 'maxHeight'>>;
2712
- declare function CookieBanner({ headerText, description, buttons, checkboxes, id, className, htmlProps, 'aria-label': ariaLabel, maxHeight, width, children, collapsedBreakpoint, ...rest }: CookieBannerProps): react_jsx_runtime.JSX.Element;
2712
+ declare function CookieBanner({ headerText, description, buttons, checkboxes, id, className, htmlProps, maxHeight, width, children, collapsedBreakpoint, ...rest }: CookieBannerProps): react_jsx_runtime.JSX.Element;
2713
2713
  declare namespace CookieBanner {
2714
2714
  var displayName: string;
2715
2715
  }
package/dist/index.d.ts CHANGED
@@ -2709,7 +2709,7 @@ type CookieBannerProps = BaseComponentPropsWithChildren<HTMLDivElement, {
2709
2709
  /**Brekkpunkt for sammentrukket variant; Brukes på siden med detaljer om informasjonskapsler. */
2710
2710
  collapsedBreakpoint?: Breakpoint;
2711
2711
  } & Pick<ResponsiveProps, 'position' | 'top' | 'bottom' | 'left' | 'right' | 'width' | 'maxHeight'>>;
2712
- declare function CookieBanner({ headerText, description, buttons, checkboxes, id, className, htmlProps, 'aria-label': ariaLabel, maxHeight, width, children, collapsedBreakpoint, ...rest }: CookieBannerProps): react_jsx_runtime.JSX.Element;
2712
+ declare function CookieBanner({ headerText, description, buttons, checkboxes, id, className, htmlProps, maxHeight, width, children, collapsedBreakpoint, ...rest }: CookieBannerProps): react_jsx_runtime.JSX.Element;
2713
2713
  declare namespace CookieBanner {
2714
2714
  var displayName: string;
2715
2715
  }
package/dist/index.js CHANGED
@@ -5916,7 +5916,6 @@ function CookieBanner({
5916
5916
  id,
5917
5917
  className,
5918
5918
  htmlProps,
5919
- "aria-label": ariaLabel,
5920
5919
  maxHeight = "calc(100vh - 100px)",
5921
5920
  width = "fit-content",
5922
5921
  children,
@@ -5924,10 +5923,11 @@ function CookieBanner({
5924
5923
  ...rest
5925
5924
  }) {
5926
5925
  const { t } = useTranslation();
5927
- const tAriaLabel = ariaLabel != null ? ariaLabel : t(texts4.consent);
5928
5926
  const hasBp = !!collapsedBreakpoint;
5929
5927
  const [isCollapsedOnBreakpoint, setIsCollapsedOnBreakpoint] = (0, import_react36.useState)(hasBp);
5930
- const heading = headerText ? /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Heading, { level: 2, typographyType: "headingMedium", children: headerText }) : "";
5928
+ const generatedId = (0, import_react36.useId)();
5929
+ const headingId = headerText && (id != null ? id : `cookie-banner-${generatedId}-heading`);
5930
+ const heading = headerText ? /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Heading, { level: 2, typographyType: "headingMedium", id: headingId, children: headerText }) : "";
5931
5931
  return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
5932
5932
  Paper,
5933
5933
  {
@@ -5938,7 +5938,7 @@ function CookieBanner({
5938
5938
  rest
5939
5939
  ),
5940
5940
  role: "region",
5941
- "aria-label": tAriaLabel,
5941
+ "aria-labelledby": headingId,
5942
5942
  padding: styleUpToBreakpoint("x1", "sm", "x1.5"),
5943
5943
  width,
5944
5944
  maxHeight,
@@ -5992,12 +5992,6 @@ var texts4 = createTexts({
5992
5992
  no: "Utvid samtykke for bruk av informasjonskapsler",
5993
5993
  nn: "Utvid samtykke for bruk av informasjonskapslar",
5994
5994
  en: "Expand consent for the use of cookies"
5995
- },
5996
- consent: {
5997
- nb: "Samtykke for bruk av informasjonskapsler",
5998
- no: "Samtykke for bruk av informasjonskapsler",
5999
- nn: "Samtykke for bruk av informasjonskapslar",
6000
- en: "Consent for the use of cookies"
6001
5995
  }
6002
5996
  });
6003
5997