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

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
 
@@ -7072,6 +7066,36 @@ DatePicker.displayName = "DatePicker";
7072
7066
  var import_datepicker6 = require("@react-aria/datepicker");
7073
7067
  var import_datepicker7 = require("@react-stately/datepicker");
7074
7068
  var import_react48 = require("react");
7069
+
7070
+ // src/components/date-inputs/TimePicker/TimePicker.utils.ts
7071
+ function formatTimeSegments(segments) {
7072
+ const hourSegment = segments.find((segment) => segment.type === "hour");
7073
+ const minuteSegment = segments.find((segment) => segment.type === "minute");
7074
+ const separatorSegment = segments.find(
7075
+ (segment) => segment.type === "literal" && segment.isPlaceholder === void 0
7076
+ );
7077
+ if (!hourSegment || !minuteSegment || !separatorSegment) {
7078
+ throw new Error("Invalid time segments");
7079
+ }
7080
+ const formattedHourSegment = {
7081
+ ...hourSegment,
7082
+ text: hourSegment.text.padStart(2, "0"),
7083
+ placeholder: "\u2013\u2013"
7084
+ };
7085
+ const formattedMinuteSegment = {
7086
+ ...minuteSegment,
7087
+ text: minuteSegment.text.padStart(2, "0"),
7088
+ placeholder: "\u2013\u2013"
7089
+ };
7090
+ const formattedSeparatorSegment = { ...separatorSegment, text: ":" };
7091
+ return [
7092
+ formattedHourSegment,
7093
+ formattedSeparatorSegment,
7094
+ formattedMinuteSegment
7095
+ ];
7096
+ }
7097
+
7098
+ // src/components/date-inputs/TimePicker/TimePicker.tsx
7075
7099
  var import_jsx_runtime238 = require("react/jsx-runtime");
7076
7100
  function TimePicker({
7077
7101
  componentSize = "medium",
@@ -7081,7 +7105,7 @@ function TimePicker({
7081
7105
  }) {
7082
7106
  const lang = useLanguage();
7083
7107
  if (!lang) {
7084
- throw new Error("DatePicker must be used within a DdsProvider");
7108
+ throw new Error("TimePicker must be used within a DdsProvider");
7085
7109
  }
7086
7110
  const internalRef = (0, import_react48.useRef)(null);
7087
7111
  const state = (0, import_datepicker7.useTimeFieldState)({
@@ -7095,6 +7119,7 @@ function TimePicker({
7095
7119
  );
7096
7120
  const iconSize = componentSize === "xsmall" ? "small" : "medium";
7097
7121
  const disabled = props.isDisabled || !!fieldProps["aria-disabled"];
7122
+ const formattedSegments = formatTimeSegments(state.segments);
7098
7123
  return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
7099
7124
  DateInput,
7100
7125
  {
@@ -7120,7 +7145,7 @@ function TimePicker({
7120
7145
  )
7121
7146
  }
7122
7147
  ),
7123
- children: state.segments.map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
7148
+ children: formattedSegments.map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
7124
7149
  DateSegment,
7125
7150
  {
7126
7151
  componentSize,