@norges-domstoler/dds-components 0.0.0-dev-20260605084306 → 0.0.0-dev-20260608090013

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.mjs CHANGED
@@ -6415,7 +6415,6 @@ var DateInput_default = {
6415
6415
  segment: "DateInput_segment",
6416
6416
  segment__placeholder: "DateInput_segment__placeholder",
6417
6417
  "segment__placeholder--invisible": "DateInput_segment__placeholder--invisible",
6418
- "clear-button--inactive": "DateInput_clear-button--inactive",
6419
6418
  "icon-wrapper--disabled": "DateInput_icon-wrapper--disabled",
6420
6419
  "popover-button": "DateInput_popover-button",
6421
6420
  "icon-wrapper--readonly": "DateInput_icon-wrapper--readonly",
@@ -6431,8 +6430,8 @@ var DateInput_default = {
6431
6430
  "calendar__cell-button": "DateInput_calendar__cell-button",
6432
6431
  "calendar__cell-button--today": "DateInput_calendar__cell-button--today",
6433
6432
  "calendar__cell-button--default": "DateInput_calendar__cell-button--default",
6434
- "calendar__cell-button--selected": "DateInput_calendar__cell-button--selected",
6435
6433
  "calendar__cell-button--unavailable": "DateInput_calendar__cell-button--unavailable",
6434
+ "calendar__cell-button--selected": "DateInput_calendar__cell-button--selected",
6436
6435
  "calendar__cell-button--unavailable--today": "DateInput_calendar__cell-button--unavailable--today"
6437
6436
  };
6438
6437
 
@@ -6459,28 +6458,31 @@ function CalendarCell({ date, state, onClose }) {
6459
6458
  isDisabled,
6460
6459
  isUnavailable
6461
6460
  } = useCalendarCell({ date }, state, ref);
6462
- if (isDisabled) {
6461
+ if (isOutsideVisibleRange) {
6463
6462
  return /* @__PURE__ */ jsx241("td", { ...cellProps });
6464
6463
  }
6465
- const variant = isSelected ? "selected" : isUnavailable || isDisabled ? "unavailable" : "default";
6466
6464
  const closeOnKeyboardBlurForward = (event) => {
6467
6465
  if (event.key === "Tab" && event.shiftKey === false) {
6468
6466
  onClose();
6469
6467
  }
6470
6468
  };
6469
+ const isEffectivelyUnavailable = isUnavailable || isDisabled;
6470
+ const isUnavailableToday = isEffectivelyUnavailable && isToday(date, timezone);
6471
6471
  return /* @__PURE__ */ jsx241("td", { ...cellProps, children: /* @__PURE__ */ jsx241(
6472
6472
  "button",
6473
6473
  {
6474
6474
  ...buttonProps,
6475
6475
  type: "button",
6476
6476
  ref,
6477
- hidden: isOutsideVisibleRange,
6478
6477
  onKeyDown: closeOnKeyboardBlurForward,
6479
6478
  className: cn(
6480
6479
  DateInput_default["calendar__grid-element"],
6481
6480
  DateInput_default["calendar__cell-button"],
6482
6481
  isToday(date, timezone) && DateInput_default["calendar__cell-button--today"],
6483
- DateInput_default[`calendar__cell-button--${variant}`],
6482
+ DateInput_default[`calendar__cell-button--default`],
6483
+ isSelected && DateInput_default[`calendar__cell-button--selected`],
6484
+ isEffectivelyUnavailable && DateInput_default[`calendar__cell-button--unavailable`],
6485
+ isUnavailableToday && DateInput_default["calendar__cell-button--unavailable--today"],
6484
6486
  typographyStyles_default["body-short-small"],
6485
6487
  focusable
6486
6488
  ),
@@ -6862,6 +6864,8 @@ function Calendar(props) {
6862
6864
  nextButtonProps: { onPress: onNext },
6863
6865
  title
6864
6866
  } = useCalendar(props, state);
6867
+ const isPrevDisabled = !!props.minValue && state.visibleRange.start.compare(props.minValue) <= 0;
6868
+ const isNextDisabled = !!props.maxValue && state.visibleRange.end.compare(props.maxValue) >= 0;
6865
6869
  const { onClose, closeButtonRef } = useContext12(CalendarPopoverContext);
6866
6870
  const closeOnKeyboardBlurBack = (event) => {
6867
6871
  var _a;
@@ -6876,6 +6880,7 @@ function Calendar(props) {
6876
6880
  /* @__PURE__ */ jsx244(
6877
6881
  Button,
6878
6882
  {
6883
+ "aria-hidden": optAttr(isPrevDisabled),
6879
6884
  type: "button",
6880
6885
  "aria-label": t(texts7.previousMonth),
6881
6886
  onClick: (e) => onPrev == null ? void 0 : onPrev(e),
@@ -6883,7 +6888,10 @@ function Calendar(props) {
6883
6888
  purpose: "tertiary",
6884
6889
  icon: ArrowLeftIcon,
6885
6890
  htmlProps: { onKeyDown: closeOnKeyboardBlurBack },
6886
- className: DateInput_default["calendar__month-button"]
6891
+ className: cn(
6892
+ DateInput_default["calendar__month-button"],
6893
+ isPrevDisabled && utilStyles_default.invisible
6894
+ )
6887
6895
  }
6888
6896
  ),
6889
6897
  /* @__PURE__ */ jsx244(
@@ -6899,12 +6907,16 @@ function Calendar(props) {
6899
6907
  Button,
6900
6908
  {
6901
6909
  type: "button",
6910
+ "aria-hidden": optAttr(isNextDisabled),
6902
6911
  "aria-label": t(texts7.nextMonth),
6903
6912
  onClick: (e) => onNext == null ? void 0 : onNext(e),
6904
6913
  size: "small",
6905
6914
  purpose: "tertiary",
6906
6915
  icon: ArrowRightIcon,
6907
- className: DateInput_default["calendar__month-button"]
6916
+ className: cn(
6917
+ DateInput_default["calendar__month-button"],
6918
+ isNextDisabled && utilStyles_default.invisible
6919
+ )
6908
6920
  }
6909
6921
  )
6910
6922
  ] }),
@@ -7403,7 +7415,7 @@ function DateField({
7403
7415
  absolute: true,
7404
7416
  "aria-label": t(texts9.clearDate),
7405
7417
  "aria-hidden": !hasValue,
7406
- className: cn(!hasValue && DateInput_default["clear-button--inactive"]),
7418
+ className: cn(!hasValue && utilStyles_default.invisible),
7407
7419
  size: componentSize,
7408
7420
  onClick: clearDate
7409
7421
  }
@@ -11078,7 +11090,6 @@ import { useState as useState23 } from "react";
11078
11090
  var Pagination_default = {
11079
11091
  list: "Pagination_list",
11080
11092
  list__item: "Pagination_list__item",
11081
- "list__item--hidden": "Pagination_list__item--hidden",
11082
11093
  indicators: "Pagination_indicators",
11083
11094
  "truncation-icon": "Pagination_truncation-icon"
11084
11095
  };
@@ -11977,7 +11988,7 @@ var Pagination = ({
11977
11988
  {
11978
11989
  className: cn(
11979
11990
  Pagination_default.list__item,
11980
- isOnFirstPage && Pagination_default["list__item--hidden"]
11991
+ isOnFirstPage && utilStyles_default.invisible
11981
11992
  ),
11982
11993
  "aria-hidden": isOnFirstPage,
11983
11994
  children: previousPageButton
@@ -11989,7 +12000,7 @@ var Pagination = ({
11989
12000
  {
11990
12001
  className: cn(
11991
12002
  Pagination_default.list__item,
11992
- isOnLastPage && Pagination_default["list__item--hidden"]
12003
+ isOnLastPage && utilStyles_default.invisible
11993
12004
  ),
11994
12005
  "aria-hidden": isOnLastPage,
11995
12006
  children: nextPageButton
@@ -12010,7 +12021,7 @@ var Pagination = ({
12010
12021
  {
12011
12022
  className: cn(
12012
12023
  Pagination_default.list__item,
12013
- isOnFirstPage && Pagination_default["list__item--hidden"]
12024
+ isOnFirstPage && utilStyles_default.invisible
12014
12025
  ),
12015
12026
  "aria-hidden": isOnFirstPage,
12016
12027
  children: /* @__PURE__ */ jsx309(
@@ -12032,7 +12043,7 @@ var Pagination = ({
12032
12043
  {
12033
12044
  className: cn(
12034
12045
  Pagination_default.list__item,
12035
- isOnFirstPage && Pagination_default["list__item--hidden"]
12046
+ isOnFirstPage && utilStyles_default.invisible
12036
12047
  ),
12037
12048
  "aria-hidden": isOnFirstPage,
12038
12049
  children: previousPageButton
@@ -12053,7 +12064,7 @@ var Pagination = ({
12053
12064
  {
12054
12065
  className: cn(
12055
12066
  Pagination_default.list__item,
12056
- isOnLastPage && Pagination_default["list__item--hidden"]
12067
+ isOnLastPage && utilStyles_default.invisible
12057
12068
  ),
12058
12069
  "aria-hidden": isOnLastPage,
12059
12070
  children: nextPageButton
@@ -12064,7 +12075,7 @@ var Pagination = ({
12064
12075
  {
12065
12076
  className: cn(
12066
12077
  Pagination_default.list__item,
12067
- isOnLastPage && Pagination_default["list__item--hidden"]
12078
+ isOnLastPage && utilStyles_default.invisible
12068
12079
  ),
12069
12080
  "aria-hidden": isOnLastPage,
12070
12081
  children: /* @__PURE__ */ jsx309(