@norges-domstoler/dds-components 0.0.0-dev-20260825082236 → 0.0.0-dev-20260826072458

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.cjs CHANGED
@@ -4554,10 +4554,7 @@ const useOverflowMenuContext = () => {
4554
4554
  };
4555
4555
  //#endregion
4556
4556
  //#region src/components/OverflowMenu/OverflowMenu.module.css
4557
- var OverflowMenu_module_default = {
4558
- "container": "dds-OverflowMenu-module__container",
4559
- "list": "dds-OverflowMenu-module__list"
4560
- };
4557
+ var OverflowMenu_module_default = { "container": "dds-OverflowMenu-module__container" };
4561
4558
  //#endregion
4562
4559
  //#region src/components/OverflowMenu/OverflowMenu.tsx
4563
4560
  const OverflowMenu = ({ placement = "bottom-end", offset = 2, parentElement, portal = true, className, htmlProps = {}, ref, style, ...rest }) => {
@@ -5719,13 +5716,9 @@ var DateInput_module_default = {
5719
5716
  "icon-wrapper--readonly": "dds-DateInput-module__icon-wrapper--readonly",
5720
5717
  "popover-button--readonly": "dds-DateInput-module__popover-button--readonly",
5721
5718
  "popover": "dds-DateInput-module__popover",
5722
- "modal-close-button-wrapper": "dds-DateInput-module__modal-close-button-wrapper",
5723
- "calendar": "dds-DateInput-module__calendar",
5724
5719
  "calendar__header__month": "dds-DateInput-module__calendar__header__month",
5725
5720
  "calendar__month-button": "dds-DateInput-module__calendar__month-button",
5726
- "calendar__grid-element": "dds-DateInput-module__calendar__grid-element",
5727
5721
  "calendar__th": "dds-DateInput-module__calendar__th",
5728
- "calendar__week-number": "dds-DateInput-module__calendar__week-number",
5729
5722
  "calendar__cell-button": "dds-DateInput-module__calendar__cell-button",
5730
5723
  "calendar__cell-button--today": "dds-DateInput-module__calendar__cell-button--today",
5731
5724
  "calendar__cell-button--default": "dds-DateInput-module__calendar__cell-button--default",
@@ -5734,6 +5727,16 @@ var DateInput_module_default = {
5734
5727
  "calendar__cell-button--unavailable--today": "dds-DateInput-module__calendar__cell-button--unavailable--today"
5735
5728
  };
5736
5729
  //#endregion
5730
+ //#region src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
5731
+ function CalendarCell({ ...props }) {
5732
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
5733
+ textAlign: "center",
5734
+ className: cn(typographyStyles_module_default["text-color--subtle"], DateInput_module_default.calendar__th),
5735
+ ...props
5736
+ });
5737
+ }
5738
+ CalendarCell.displayName = "CalendarCell";
5739
+ //#endregion
5737
5740
  //#region src/components/date-inputs/DatePicker/constants.ts
5738
5741
  const LOCALE = {
5739
5742
  nb: "nb-NO",
@@ -5743,8 +5746,8 @@ const LOCALE = {
5743
5746
  se: "se-NO"
5744
5747
  };
5745
5748
  //#endregion
5746
- //#region src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
5747
- function CalendarCell({ date, state, onClose }) {
5749
+ //#region src/components/date-inputs/DatePicker/Calendar/CalendarDate.tsx
5750
+ function CalendarDate$1({ date, state, onClose }) {
5748
5751
  const ref = (0, react.useRef)(null);
5749
5752
  const { buttonProps, cellProps, isOutsideVisibleRange, formattedDate, isSelected, isDisabled, isUnavailable } = (0, _react_aria_calendar.useCalendarCell)({ date }, state, ref);
5750
5753
  if (isOutsideVisibleRange) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { ...cellProps });
@@ -5755,17 +5758,23 @@ function CalendarCell({ date, state, onClose }) {
5755
5758
  const isUnavailableToday = isEffectivelyUnavailable && (0, _internationalized_date.isToday)(date, "Europe/Oslo");
5756
5759
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
5757
5760
  ...cellProps,
5758
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
5761
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
5759
5762
  ...buttonProps,
5763
+ as: "button",
5760
5764
  type: "button",
5761
5765
  ref,
5762
5766
  onKeyDown: closeOnKeyboardBlurForward,
5763
- className: cn(DateInput_module_default["calendar__grid-element"], DateInput_module_default["calendar__cell-button"], (0, _internationalized_date.isToday)(date, "Europe/Oslo") && DateInput_module_default["calendar__cell-button--today"], DateInput_module_default[`calendar__cell-button--default`], isSelected && DateInput_module_default[`calendar__cell-button--selected`], isEffectivelyUnavailable && DateInput_module_default[`calendar__cell-button--unavailable`], isUnavailableToday && DateInput_module_default["calendar__cell-button--unavailable--today"], typographyStyles_module_default["body-short-small"], _key1),
5767
+ height: "100%",
5768
+ width: "100%",
5769
+ display: "flex",
5770
+ alignItems: "center",
5771
+ justifyContent: "center",
5772
+ className: cn(DateInput_module_default["calendar__cell-button"], (0, _internationalized_date.isToday)(date, "Europe/Oslo") && DateInput_module_default["calendar__cell-button--today"], DateInput_module_default[`calendar__cell-button--default`], isSelected && DateInput_module_default[`calendar__cell-button--selected`], isEffectivelyUnavailable && DateInput_module_default[`calendar__cell-button--unavailable`], isUnavailableToday && DateInput_module_default["calendar__cell-button--unavailable--today"], typographyStyles_module_default["body-short-small"], _key1),
5764
5773
  children: formattedDate
5765
5774
  })
5766
5775
  });
5767
5776
  }
5768
- CalendarCell.displayName = "CalendarCell";
5777
+ CalendarDate$1.displayName = "CalendarDate";
5769
5778
  //#endregion
5770
5779
  //#region src/components/date-inputs/utils/getWeekNumber.ts
5771
5780
  /**
@@ -5885,8 +5894,9 @@ const CalendarPopoverContent = ({ children, className, smallScreenBreakpoint })
5885
5894
  ref: modalRef,
5886
5895
  className: cn(DateInput_module_default.popover, className),
5887
5896
  ...paperStyleProps,
5888
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5889
- className: DateInput_module_default["modal-close-button-wrapper"],
5897
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
5898
+ display: "flex",
5899
+ justifyContent: "flex-end",
5890
5900
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
5891
5901
  ref: closeButtonRef,
5892
5902
  icon: CloseIcon,
@@ -5946,7 +5956,6 @@ function CalendarGrid({ state, ...props }) {
5946
5956
  }
5947
5957
  ];
5948
5958
  const { showWeekNumbers, onClose } = (0, react.useContext)(CalendarPopoverContext);
5949
- const thCn = cn(DateInput_module_default["calendar__grid-element"], typographyStyles_module_default["text-color--subtle"], DateInput_module_default.calendar__th);
5950
5959
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
5951
5960
  ...gridProps,
5952
5961
  onKeyDown: (e) => {
@@ -5957,14 +5966,14 @@ function CalendarGrid({ state, ...props }) {
5957
5966
  className: typographyStyles_module_default["body-short-xsmall"],
5958
5967
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", {
5959
5968
  ...headerProps,
5960
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [showWeekNumbers && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("th", {
5961
- className: cn(thCn),
5969
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [showWeekNumbers && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CalendarCell, {
5970
+ as: "th",
5962
5971
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5963
5972
  "aria-hidden": true,
5964
5973
  children: "#"
5965
5974
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VisuallyHidden, { children: t(texts$24.weekNumber) })]
5966
- }), weekDays.map((day, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("th", {
5967
- className: thCn,
5975
+ }), weekDays.map((day, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CalendarCell, {
5976
+ as: "th",
5968
5977
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5969
5978
  "aria-hidden": true,
5970
5979
  children: day.short
@@ -5974,10 +5983,10 @@ function CalendarGrid({ state, ...props }) {
5974
5983
  const datesInWeek = state.getDatesInWeek(weekIndex);
5975
5984
  const firstExistingDay = datesInWeek.find(Boolean);
5976
5985
  const weekNumber = firstExistingDay ? getWeekNumber(firstExistingDay) : "";
5977
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [showWeekNumbers && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
5978
- className: cn(thCn, DateInput_module_default["calendar__week-number"]),
5986
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [showWeekNumbers && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarCell, {
5987
+ as: "td",
5979
5988
  children: weekNumber
5980
- }), datesInWeek.map((date, i) => date ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarCell, {
5989
+ }), datesInWeek.map((date, i) => date ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarDate$1, {
5981
5990
  state,
5982
5991
  date,
5983
5992
  onClose
@@ -6409,7 +6418,7 @@ function DateInput({ errorMessage, tip, componentSize = "medium", style, classNa
6409
6418
  className: cn(Input_module_default["input-group"], typographyStyles_module_default[`body-short-${componentSize}`], DateInput_module_default["input-group"]),
6410
6419
  children: [
6411
6420
  button,
6412
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6421
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
6413
6422
  ...fieldProps,
6414
6423
  ref: internalRef,
6415
6424
  className: cn(Input_module_default.input, Input_module_default[`input--${componentSize}`], Input_module_default["input--stateful"], Input_module_default["input--hover"], hasErrorMessage && Input_module_default["input--stateful-danger"], clearable && Input_module_default[`input-with-btn-right--${componentSize}`], DateInput_module_default["date-segment-container"], Input_module_default[`input-with-icon--${componentSize}`], isOpen && focus_module_default.focused, disabled && "disabled", disabled && Input_module_default.disabled, active && "active", readOnly && "read-only", readOnly && Input_module_default["read-only"], focus_module_default["focusable-within"]),
@@ -6707,8 +6716,13 @@ const DescriptionListTerm = (props) => {
6707
6716
  DescriptionListTerm.displayName = "DescriptionListTerm";
6708
6717
  //#endregion
6709
6718
  //#region src/components/DescriptionList/DescriptionListDesc.tsx
6710
- const DescriptionListDesc = ({ children, icon, id, className, style, htmlProps, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
6719
+ const DescriptionListDesc = ({ children, icon, id, className, style, htmlProps, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
6711
6720
  ...getBaseHTMLProps(id, cn(className, DescriptionList_module_default.desc), style, htmlProps, rest),
6721
+ as: "dd",
6722
+ display: "flex",
6723
+ alignItems: "center",
6724
+ gap: "x0.25",
6725
+ marginInline: "x0",
6712
6726
  children: [
6713
6727
  icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { icon }),
6714
6728
  " ",
@@ -8143,21 +8157,17 @@ const texts$12 = createTexts({
8143
8157
  }
8144
8158
  });
8145
8159
  //#endregion
8146
- //#region src/components/Footer/Footer.module.css
8147
- var Footer_module_default = {
8148
- "container": "dds-Footer-module__container",
8149
- "left": "dds-Footer-module__left",
8150
- "list": "dds-Footer-module__list",
8151
- "list-group": "dds-Footer-module__list-group",
8152
- "socials-group": "dds-Footer-module__socials-group",
8153
- "socials-list": "dds-Footer-module__socials-list"
8154
- };
8155
- //#endregion
8156
8160
  //#region src/components/Footer/Footer.tsx
8157
- const Footer = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Contrast, {
8161
+ const Footer = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Contrast, {
8158
8162
  as: "footer",
8159
- className: cn(className, Footer_module_default.container),
8160
- ...rest
8163
+ paddingBlock: {
8164
+ xs: "x3 x6",
8165
+ sm: "x3 x6",
8166
+ md: "x4",
8167
+ lg: "x4",
8168
+ xl: "x4"
8169
+ },
8170
+ ...props
8161
8171
  });
8162
8172
  //#endregion
8163
8173
  //#region src/components/Footer/FooterListHeader.tsx
@@ -8186,33 +8196,35 @@ const FooterLogo = ({ children, hideBreakpoint, ...rest }) => {
8186
8196
  };
8187
8197
  //#endregion
8188
8198
  //#region src/components/Footer/FooterList.tsx
8189
- const FooterList = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StylelessList, {
8190
- className: cn(className, Footer_module_default.list),
8191
- ...rest
8199
+ const FooterList = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
8200
+ as: StylelessList,
8201
+ gap: "x1.5",
8202
+ ...props
8192
8203
  });
8193
8204
  //#endregion
8194
8205
  //#region src/components/Footer/FooterSocialsList.tsx
8195
- const FooterSocialsList = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StylelessList, {
8196
- className: cn(className, Footer_module_default["socials-list"]),
8197
- ...rest
8206
+ const FooterSocialsList = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
8207
+ as: StylelessList,
8208
+ gap: "x1.5",
8209
+ ...props
8198
8210
  });
8199
8211
  //#endregion
8200
8212
  //#region src/components/Footer/FooterSocialsGroup.tsx
8201
- const FooterSocialsGroup = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8202
- className: cn(className, Footer_module_default["socials-group"]),
8203
- ...rest
8213
+ const FooterSocialsGroup = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
8214
+ gap: "x1",
8215
+ ...props
8204
8216
  });
8205
8217
  //#endregion
8206
8218
  //#region src/components/Footer/FooterListGroup.tsx
8207
- const FooterListGroup = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8208
- className: cn(className, Footer_module_default["list-group"]),
8209
- ...rest
8219
+ const FooterListGroup = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
8220
+ gap: "x1.5",
8221
+ ...props
8210
8222
  });
8211
8223
  //#endregion
8212
8224
  //#region src/components/Footer/FooterLeft.tsx
8213
- const FooterLeft = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8214
- className: cn(className, Footer_module_default["left"]),
8215
- ...rest
8225
+ const FooterLeft = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
8226
+ gap: "x4",
8227
+ ...props
8216
8228
  });
8217
8229
  //#endregion
8218
8230
  //#region src/components/FormSummary/FormSummary.tsx
@@ -8315,9 +8327,7 @@ var GlobalMessage_module_default = {
8315
8327
  "container--info": "dds-GlobalMessage-module__container--info",
8316
8328
  "icon": "dds-GlobalMessage-module__icon",
8317
8329
  "container--danger": "dds-GlobalMessage-module__container--danger",
8318
- "container--warning": "dds-GlobalMessage-module__container--warning",
8319
- "content": "dds-GlobalMessage-module__content",
8320
- "content--closable": "dds-GlobalMessage-module__content--closable"
8330
+ "container--warning": "dds-GlobalMessage-module__container--warning"
8321
8331
  };
8322
8332
  const icons$2 = {
8323
8333
  info: InfoIcon,
@@ -8327,10 +8337,16 @@ const icons$2 = {
8327
8337
  const GlobalMessage = ({ purpose = "info", closable, onClose, children, id, className, style, htmlProps, ...rest }) => {
8328
8338
  const { t } = useTranslation();
8329
8339
  const [isClosed, setClosed] = (0, react.useState)(false);
8330
- return !isClosed ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8340
+ return !isClosed ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
8331
8341
  ...getBaseHTMLProps(id, cn(className, GlobalMessage_module_default.container, GlobalMessage_module_default[`container--${purpose}`], typographyStyles_module_default["body-short-medium"]), style, htmlProps, rest),
8332
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8333
- className: cn(GlobalMessage_module_default.content, closable && GlobalMessage_module_default["content--closable"]),
8342
+ alignItems: "center",
8343
+ justifyContent: "space-between",
8344
+ width: "100%",
8345
+ padding: "0 x1",
8346
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
8347
+ alignItems: "center",
8348
+ paddingBlock: "x0.75",
8349
+ paddingInline: closable ? "x0 x0.75" : " x0 x1.5",
8334
8350
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
8335
8351
  icon: icons$2[purpose],
8336
8352
  iconSize: "component",
@@ -11387,25 +11403,20 @@ const texts$7 = createTexts({
11387
11403
  }
11388
11404
  });
11389
11405
  //#endregion
11390
- //#region src/components/Popover/Popover.module.css
11391
- var Popover_module_default = {
11392
- "container": "dds-Popover-module__container",
11393
- "content--closable--no-header": "dds-Popover-module__content--closable--no-header",
11394
- "header": "dds-Popover-module__header",
11395
- "close-button": "dds-Popover-module__close-button"
11396
- };
11397
- //#endregion
11398
11406
  //#region src/components/Popover/Popover.context.tsx
11399
11407
  const PopoverContext = (0, react.createContext)({});
11400
11408
  const usePopoverContext = () => (0, react.useContext)(PopoverContext);
11401
11409
  //#endregion
11410
+ //#region src/components/Popover/Popover.module.css
11411
+ var Popover_module_default = { "container": "dds-Popover-module__container" };
11412
+ //#endregion
11402
11413
  //#region src/components/Popover/Popover.tsx
11403
11414
  const Popover = ({ id, header, withCloseButton = true, onBlur, children, placement = "bottom", parentElement, portal = false, offset = 8, sizeProps = {}, returnFocusOnBlur = true, className, htmlProps = {}, anchorRef, isOpen: propIsOpen, onClose: propOnClose, style, ref, ...rest }) => {
11404
11415
  const { refs, styles: positionStyles, isPositioned: localIsPositioned } = useFloatPosition(null, {
11405
11416
  offset,
11406
11417
  placement
11407
11418
  });
11408
- const { maxHeight, maxWidth, minHeight, minWidth, height, width } = sizeProps;
11419
+ const { maxHeight, maxWidth, minHeight, minWidth, height, width = "fit-content" } = sizeProps;
11409
11420
  const context = usePopoverContext();
11410
11421
  const themeContext = (0, react.useContext)(ThemeContext);
11411
11422
  const portalTarget = parentElement ?? themeContext?.el;
@@ -11465,29 +11476,34 @@ const Popover = ({ id, header, withCloseButton = true, onBlur, children, placeme
11465
11476
  width,
11466
11477
  maxWidth,
11467
11478
  minWidth,
11479
+ position: "absolute",
11480
+ padding: "x0.75 x1 x1.5 x1",
11468
11481
  role: "dialog",
11469
11482
  elevation: "large",
11470
11483
  border: "border-subtle",
11471
11484
  children: [
11472
- header && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11473
- className: Popover_module_default.header,
11485
+ header && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
11486
+ marginInline: "0 x2",
11474
11487
  children: typeof header === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
11475
11488
  level: 2,
11476
11489
  typographyType: "heading-medium",
11477
11490
  children: header
11478
11491
  }) : header
11479
11492
  }),
11480
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11481
- className: !hasTitle && withCloseButton ? Popover_module_default["content--closable--no-header"] : "",
11493
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
11494
+ marginBlock: !hasTitle && withCloseButton ? "x2 0" : "0",
11482
11495
  children
11483
11496
  }),
11484
- withCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
11497
+ withCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
11498
+ as: Button,
11485
11499
  icon: CloseIcon,
11486
11500
  purpose: "tertiary",
11487
11501
  size: "small",
11488
11502
  onClick: onClose,
11489
11503
  "aria-label": t(commonTexts.close),
11490
- className: Popover_module_default["close-button"]
11504
+ position: "absolute",
11505
+ top: "x0.25",
11506
+ right: "x0.25"
11491
11507
  })
11492
11508
  ]
11493
11509
  });