@norges-domstoler/dds-components 21.19.0 → 21.19.1

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
@@ -4300,20 +4300,25 @@ var OverflowMenuSpan = ({
4300
4300
  OverflowMenuSpan.displayName = "OverflowMenuSpan";
4301
4301
 
4302
4302
  // src/components/OverflowMenu/components/OverflowMenuListHeader.tsx
4303
+ import { useContext as useContext6 } from "react";
4303
4304
  import { jsx as jsx203 } from "react/jsx-runtime";
4304
4305
  var OverflowMenuListHeader = ({
4305
4306
  className,
4306
4307
  ...rest
4307
- }) => /* @__PURE__ */ jsx203(
4308
- Box,
4309
- {
4310
- as: "h2",
4311
- paddingInline: "x0.75",
4312
- paddingBlock: "x0.75 0",
4313
- ...rest,
4314
- className: cn(className, typographyStyles_default["heading-xxsmall"])
4315
- }
4316
- );
4308
+ }) => {
4309
+ const themeContext = useContext6(ThemeContext);
4310
+ const headingStyle = (themeContext == null ? void 0 : themeContext.theme) === "core" ? "heading-xsmall" : "heading-xxsmall";
4311
+ return /* @__PURE__ */ jsx203(
4312
+ Box,
4313
+ {
4314
+ as: "h2",
4315
+ paddingInline: "x0.75",
4316
+ paddingBlock: "x0.75 0",
4317
+ ...rest,
4318
+ className: cn(className, typographyStyles_default[headingStyle])
4319
+ }
4320
+ );
4321
+ };
4317
4322
  OverflowMenuListHeader.displayName = "OverflowMenuListHeader";
4318
4323
 
4319
4324
  // src/components/OverflowMenu/OverflowMenuGroup.tsx
@@ -4781,10 +4786,10 @@ CardExpandableBody.displayName = "CardExpandableBody";
4781
4786
  import { useId as useId4 } from "react";
4782
4787
 
4783
4788
  // src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
4784
- import { createContext as createContext6, useContext as useContext6 } from "react";
4789
+ import { createContext as createContext6, useContext as useContext7 } from "react";
4785
4790
  var CheckboxGroupContext = createContext6(null);
4786
4791
  var useCheckboxGroup = () => {
4787
- return useContext6(CheckboxGroupContext);
4792
+ return useContext7(CheckboxGroupContext);
4788
4793
  };
4789
4794
 
4790
4795
  // src/components/SelectionControl/SelectionControl.module.css
@@ -5135,10 +5140,10 @@ CheckboxGroup.displayName = "CheckboxGroup";
5135
5140
  import { useId as useId6 } from "react";
5136
5141
 
5137
5142
  // src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
5138
- import { createContext as createContext7, useContext as useContext7 } from "react";
5143
+ import { createContext as createContext7, useContext as useContext8 } from "react";
5139
5144
  var RadioButtonGroupContext = createContext7(null);
5140
5145
  var useRadioButtonGroup = () => {
5141
- return useContext7(RadioButtonGroupContext);
5146
+ return useContext8(RadioButtonGroupContext);
5142
5147
  };
5143
5148
 
5144
5149
  // src/components/SelectionControl/RadioButton/RadioButton.tsx
@@ -5325,9 +5330,9 @@ var RadioButtonGroup = ({
5325
5330
  RadioButtonGroup.displayName = "RadioButtonGroup";
5326
5331
 
5327
5332
  // src/components/Card/CardSelectionControl/CardSelectable.context.tsx
5328
- import { createContext as createContext8, useContext as useContext8 } from "react";
5333
+ import { createContext as createContext8, useContext as useContext9 } from "react";
5329
5334
  var CardSelectableContext = createContext8({});
5330
- var useCardSelectableContext = () => useContext8(CardSelectableContext);
5335
+ var useCardSelectableContext = () => useContext9(CardSelectableContext);
5331
5336
 
5332
5337
  // src/components/Card/CardSelectionControl/CardSelectable.tsx
5333
5338
  import { jsx as jsx217 } from "react/jsx-runtime";
@@ -5703,7 +5708,7 @@ import {
5703
5708
  import { useLocale as useLocale2 } from "@react-aria/i18n";
5704
5709
  import { useCalendarState } from "@react-stately/calendar";
5705
5710
  import {
5706
- useContext as useContext11
5711
+ useContext as useContext12
5707
5712
  } from "react";
5708
5713
 
5709
5714
  // src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
@@ -5712,7 +5717,7 @@ import {
5712
5717
  useCalendarGrid
5713
5718
  } from "@react-aria/calendar";
5714
5719
  import { useLocale } from "@react-aria/i18n";
5715
- import { useContext as useContext10 } from "react";
5720
+ import { useContext as useContext11 } from "react";
5716
5721
 
5717
5722
  // src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
5718
5723
  import { isToday } from "@internationalized/date";
@@ -5873,7 +5878,7 @@ function isLeapYear(date) {
5873
5878
  // src/components/date-inputs/DatePicker/CalendarPopover.tsx
5874
5879
  import {
5875
5880
  createContext as createContext9,
5876
- useContext as useContext9,
5881
+ useContext as useContext10,
5877
5882
  useEffect as useEffect18,
5878
5883
  useRef as useRef12
5879
5884
  } from "react";
@@ -5905,7 +5910,7 @@ var CalendarPopover = ({
5905
5910
  var CalendarPopoverAnchor = ({
5906
5911
  children
5907
5912
  }) => {
5908
- const { anchorRef } = useContext9(CalendarPopoverContext);
5913
+ const { anchorRef } = useContext10(CalendarPopoverContext);
5909
5914
  return /* @__PURE__ */ jsx226("div", { ref: anchorRef != null ? anchorRef : void 0, children });
5910
5915
  };
5911
5916
  var CalendarPopoverContent = ({
@@ -5918,13 +5923,13 @@ var CalendarPopoverContent = ({
5918
5923
  const { refs, styles: floatingStyles } = useFloatPosition(null, {
5919
5924
  placement: "bottom-start"
5920
5925
  });
5921
- const themeContext = useContext9(ThemeContext);
5926
+ const themeContext = useContext10(ThemeContext);
5922
5927
  if (!themeContext) {
5923
5928
  throw new Error("DatePicker must be used within a ThemeProvider");
5924
5929
  }
5925
5930
  const portalTarget = themeContext.el;
5926
5931
  const { t } = useTranslation();
5927
- const { isOpen, onClose, anchorRef, closeButtonRef } = useContext9(
5932
+ const { isOpen, onClose, anchorRef, closeButtonRef } = useContext10(
5928
5933
  CalendarPopoverContext
5929
5934
  );
5930
5935
  const hasTransitionedIn = useMountTransition(isOpen, 500);
@@ -6018,7 +6023,7 @@ function CalendarGrid({ state, ...props }) {
6018
6023
  { short: t(texts6.sa), full: t(texts6.saturday) },
6019
6024
  { short: t(texts6.su), full: t(texts6.sunday) }
6020
6025
  ];
6021
- const { showWeekNumbers, onClose } = useContext10(CalendarPopoverContext);
6026
+ const { showWeekNumbers, onClose } = useContext11(CalendarPopoverContext);
6022
6027
  const typographyCn = [
6023
6028
  typographyStyles_default["body-xsmall"],
6024
6029
  typographyStyles_default["text-color--subtle"]
@@ -6217,7 +6222,7 @@ function Calendar(props) {
6217
6222
  nextButtonProps: { onPress: onNext },
6218
6223
  title
6219
6224
  } = useCalendar(props, state);
6220
- const { onClose, closeButtonRef } = useContext11(CalendarPopoverContext);
6225
+ const { onClose, closeButtonRef } = useContext12(CalendarPopoverContext);
6221
6226
  const closeOnKeyboardBlurBack = (event) => {
6222
6227
  var _a;
6223
6228
  if (event.key === "Tab" && event.shiftKey === true) {
@@ -6518,7 +6523,7 @@ var ClearButton = ({
6518
6523
  ClearButton.displayName = "ClearButton";
6519
6524
 
6520
6525
  // src/components/date-inputs/common/DateInput.tsx
6521
- import { useContext as useContext12 } from "react";
6526
+ import { useContext as useContext13 } from "react";
6522
6527
 
6523
6528
  // src/components/helpers/Input/Input.tsx
6524
6529
  import { jsx as jsx233 } from "react/jsx-runtime";
@@ -6608,7 +6613,7 @@ function DateInput({
6608
6613
  ...props
6609
6614
  }) {
6610
6615
  const hasErrorMessage = !!errorMessage;
6611
- const { isOpen } = useContext12(CalendarPopoverContext);
6616
+ const { isOpen } = useContext13(CalendarPopoverContext);
6612
6617
  return /* @__PURE__ */ jsxs46(
6613
6618
  "div",
6614
6619
  {
@@ -7101,9 +7106,9 @@ var DetailList_default = {
7101
7106
  };
7102
7107
 
7103
7108
  // src/components/DetailList/DetailList.context.tsx
7104
- import { createContext as createContext10, useContext as useContext13 } from "react";
7109
+ import { createContext as createContext10, useContext as useContext14 } from "react";
7105
7110
  var DetailListContext = createContext10({});
7106
- var useDetailListContext = () => useContext13(DetailListContext);
7111
+ var useDetailListContext = () => useContext14(DetailListContext);
7107
7112
 
7108
7113
  // src/components/DetailList/DetailList.tsx
7109
7114
  import { jsx as jsx243 } from "react/jsx-runtime";
@@ -7177,7 +7182,7 @@ DetailListTerm.displayName = "DetailListTerm";
7177
7182
 
7178
7183
  // src/components/Drawer/Drawer.tsx
7179
7184
  import {
7180
- useContext as useContext15,
7185
+ useContext as useContext16,
7181
7186
  useEffect as useEffect19,
7182
7187
  useRef as useRef19
7183
7188
  } from "react";
@@ -7198,9 +7203,9 @@ var Drawer_default = {
7198
7203
  };
7199
7204
 
7200
7205
  // src/components/Drawer/Drawer.context.tsx
7201
- import { createContext as createContext11, useContext as useContext14 } from "react";
7206
+ import { createContext as createContext11, useContext as useContext15 } from "react";
7202
7207
  var DrawerContext = createContext11({});
7203
- var useDrawerContext = () => useContext14(DrawerContext);
7208
+ var useDrawerContext = () => useContext15(DrawerContext);
7204
7209
 
7205
7210
  // src/components/Drawer/Drawer.tsx
7206
7211
  import { jsx as jsx247, jsxs as jsxs50 } from "react/jsx-runtime";
@@ -7218,7 +7223,7 @@ var Drawer = ({
7218
7223
  ref,
7219
7224
  ...rest
7220
7225
  }) => {
7221
- const themeContext = useContext15(ThemeContext);
7226
+ const themeContext = useContext16(ThemeContext);
7222
7227
  if (!themeContext) {
7223
7228
  throw new Error("Drawer must be used within a ThemeProvider");
7224
7229
  }
@@ -9078,14 +9083,14 @@ import { useRef as useRef25 } from "react";
9078
9083
  // src/components/InlineEdit/InlineEdit.context.tsx
9079
9084
  import {
9080
9085
  createContext as createContext12,
9081
- useContext as useContext16,
9086
+ useContext as useContext17,
9082
9087
  useState as useState18
9083
9088
  } from "react";
9084
9089
  import { jsx as jsx274 } from "react/jsx-runtime";
9085
9090
  var InlineEditContext = createContext12(
9086
9091
  {}
9087
9092
  );
9088
- var useInlineEditContext = () => useContext16(InlineEditContext);
9093
+ var useInlineEditContext = () => useContext17(InlineEditContext);
9089
9094
  var InlineEditContextProvider = (props) => {
9090
9095
  const {
9091
9096
  emptiable,
@@ -9766,7 +9771,7 @@ LocalMessage.displayName = "LocalMessage";
9766
9771
 
9767
9772
  // src/components/Modal/Modal.tsx
9768
9773
  import {
9769
- useContext as useContext17,
9774
+ useContext as useContext18,
9770
9775
  useEffect as useEffect24,
9771
9776
  useId as useId19,
9772
9777
  useRef as useRef28
@@ -9812,7 +9817,7 @@ var Modal = ({
9812
9817
  onClose();
9813
9818
  }
9814
9819
  };
9815
- const themeContext = useContext17(ThemeContext);
9820
+ const themeContext = useContext18(ThemeContext);
9816
9821
  if (!themeContext) {
9817
9822
  throw new Error("Modal must be used within a ThemeProvider");
9818
9823
  }
@@ -9990,7 +9995,7 @@ function PaginationGenerator(pagesAmount, activePage) {
9990
9995
  // src/components/Select/Select.tsx
9991
9996
  import {
9992
9997
  useCallback as useCallback7,
9993
- useContext as useContext18,
9998
+ useContext as useContext19,
9994
9999
  useId as useId20
9995
10000
  } from "react";
9996
10001
  import {
@@ -10422,7 +10427,7 @@ function Select({
10422
10427
  afterLabelContent,
10423
10428
  ...rest
10424
10429
  }) {
10425
- const themeContext = useContext18(ThemeContext);
10430
+ const themeContext = useContext19(ThemeContext);
10426
10431
  if (!themeContext) {
10427
10432
  throw new Error("Select must be used within a ThemeProvider");
10428
10433
  }
@@ -11752,7 +11757,7 @@ var texts22 = createTexts({
11752
11757
 
11753
11758
  // src/components/Popover/Popover.tsx
11754
11759
  import {
11755
- useContext as useContext20,
11760
+ useContext as useContext21,
11756
11761
  useEffect as useEffect27,
11757
11762
  useId as useId23
11758
11763
  } from "react";
@@ -11769,10 +11774,10 @@ var Popover_default = {
11769
11774
  // src/components/Popover/Popover.context.tsx
11770
11775
  import {
11771
11776
  createContext as createContext13,
11772
- useContext as useContext19
11777
+ useContext as useContext20
11773
11778
  } from "react";
11774
11779
  var PopoverContext = createContext13({});
11775
- var usePopoverContext = () => useContext19(PopoverContext);
11780
+ var usePopoverContext = () => useContext20(PopoverContext);
11776
11781
 
11777
11782
  // src/components/Popover/Popover.tsx
11778
11783
  import { jsx as jsx292, jsxs as jsxs72 } from "react/jsx-runtime";
@@ -11802,7 +11807,7 @@ var Popover = ({
11802
11807
  });
11803
11808
  const { maxHeight, maxWidth, minHeight, minWidth, height, width } = sizeProps;
11804
11809
  const context = usePopoverContext();
11805
- const themeContext = useContext20(ThemeContext);
11810
+ const themeContext = useContext21(ThemeContext);
11806
11811
  const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
11807
11812
  const {
11808
11813
  floatStyling: contextFloatStyling,
@@ -12019,14 +12024,14 @@ import {
12019
12024
  } from "react";
12020
12025
 
12021
12026
  // src/components/ProgressTracker/ProgressTracker.context.tsx
12022
- import { createContext as createContext14, useContext as useContext21 } from "react";
12027
+ import { createContext as createContext14, useContext as useContext22 } from "react";
12023
12028
  var ProgressTrackerContext = createContext14(
12024
12029
  {
12025
12030
  activeStep: 0,
12026
12031
  direction: "column"
12027
12032
  }
12028
12033
  );
12029
- var useProgressTrackerContext = () => useContext21(ProgressTrackerContext);
12034
+ var useProgressTrackerContext = () => useContext22(ProgressTrackerContext);
12030
12035
 
12031
12036
  // src/components/ProgressTracker/ProgressTracker.module.css
12032
12037
  var ProgressTracker_default = {
@@ -12383,11 +12388,11 @@ import {
12383
12388
  // src/components/Search/AutocompleteSearch.context.tsx
12384
12389
  import {
12385
12390
  createContext as createContext15,
12386
- useContext as useContext22
12391
+ useContext as useContext23
12387
12392
  } from "react";
12388
12393
  var AutocompleteSearchContext = createContext15({});
12389
12394
  var useAutocompleteSearch = () => {
12390
- return useContext22(AutocompleteSearchContext);
12395
+ return useContext23(AutocompleteSearchContext);
12391
12396
  };
12392
12397
 
12393
12398
  // src/components/Search/Search.module.css
@@ -12949,12 +12954,12 @@ import {
12949
12954
  } from "react";
12950
12955
 
12951
12956
  // src/components/Table/collapsible/Table.context.tsx
12952
- import { createContext as createContext16, useContext as useContext23 } from "react";
12957
+ import { createContext as createContext16, useContext as useContext24 } from "react";
12953
12958
  var CollapsibleTableContext = createContext16({
12954
12959
  headerValues: [],
12955
12960
  definingColumnIndex: [0]
12956
12961
  });
12957
- var useCollapsibleTableContext = () => useContext23(CollapsibleTableContext);
12962
+ var useCollapsibleTableContext = () => useContext24(CollapsibleTableContext);
12958
12963
 
12959
12964
  // src/components/Table/normal/Body.tsx
12960
12965
  import { jsx as jsx304 } from "react/jsx-runtime";
@@ -12962,12 +12967,12 @@ var Body = (props) => /* @__PURE__ */ jsx304("tbody", { ...props });
12962
12967
  Body.displayName = "Table.Body";
12963
12968
 
12964
12969
  // src/components/Table/normal/Head.tsx
12965
- import { createContext as createContext17, useContext as useContext24 } from "react";
12970
+ import { createContext as createContext17, useContext as useContext25 } from "react";
12966
12971
  import { jsx as jsx305 } from "react/jsx-runtime";
12967
12972
  var Head = ({ children, ...rest }) => /* @__PURE__ */ jsx305("thead", { ...rest, children: /* @__PURE__ */ jsx305(HeadContext, { value: true, children }) });
12968
12973
  var HeadContext = createContext17(false);
12969
12974
  function useIsInTableHead() {
12970
- const isInTableHead = useContext24(HeadContext);
12975
+ const isInTableHead = useContext25(HeadContext);
12971
12976
  return isInTableHead;
12972
12977
  }
12973
12978
 
@@ -13145,14 +13150,14 @@ Table.displayName = "Table";
13145
13150
 
13146
13151
  // src/components/Table/normal/TableWrapper.tsx
13147
13152
  import {
13148
- useContext as useContext25,
13153
+ useContext as useContext26,
13149
13154
  useEffect as useEffect31,
13150
13155
  useRef as useRef34,
13151
13156
  useState as useState29
13152
13157
  } from "react";
13153
13158
  import { jsx as jsx311 } from "react/jsx-runtime";
13154
13159
  var TableWrapper = ({ className, ...rest }) => {
13155
- const themeContext = useContext25(ThemeContext);
13160
+ const themeContext = useContext26(ThemeContext);
13156
13161
  const container2 = themeContext == null ? void 0 : themeContext.el;
13157
13162
  const containerWidth = container2 ? container2.clientWidth : 0;
13158
13163
  const [overflowX, setOverflowX] = useState29(false);
@@ -13346,7 +13351,7 @@ CollapsibleTable2.Row = CollapsibleRow;
13346
13351
  import { useRef as useRef35 } from "react";
13347
13352
 
13348
13353
  // src/components/Tabs/Tabs.context.tsx
13349
- import { createContext as createContext18, useContext as useContext26 } from "react";
13354
+ import { createContext as createContext18, useContext as useContext27 } from "react";
13350
13355
  var TabsContext = createContext18({
13351
13356
  activeTab: 0,
13352
13357
  tabsId: "",
@@ -13359,7 +13364,7 @@ var TabsContext = createContext18({
13359
13364
  tabContentDirection: "row",
13360
13365
  addTabButtonProps: void 0
13361
13366
  });
13362
- var useTabsContext = () => useContext26(TabsContext);
13367
+ var useTabsContext = () => useContext27(TabsContext);
13363
13368
 
13364
13369
  // src/components/Tabs/Tabs.module.css
13365
13370
  var Tabs_default = {
@@ -13379,7 +13384,7 @@ var Tabs_default = {
13379
13384
  // src/components/Tabs/TabWidthContext.tsx
13380
13385
  import {
13381
13386
  createContext as createContext19,
13382
- useContext as useContext27,
13387
+ useContext as useContext28,
13383
13388
  useLayoutEffect as useLayoutEffect3
13384
13389
  } from "react";
13385
13390
  import { jsx as jsx314 } from "react/jsx-runtime";
@@ -13412,7 +13417,7 @@ function TabWidthContextProvider({
13412
13417
  );
13413
13418
  }
13414
13419
  function useSetTabWidth(index, width) {
13415
- const context = useContext27(TabContext);
13420
+ const context = useContext28(TabContext);
13416
13421
  useLayoutEffect3(() => {
13417
13422
  context == null ? void 0 : context.updateWidth(index, width);
13418
13423
  return () => context == null ? void 0 : context.removeTab(index);
@@ -14142,11 +14147,11 @@ Toggle.displayName = "Toggle";
14142
14147
  import { useId as useId30, useState as useState34 } from "react";
14143
14148
 
14144
14149
  // src/components/ToggleBar/ToggleBar.context.tsx
14145
- import { createContext as createContext20, useContext as useContext28 } from "react";
14150
+ import { createContext as createContext20, useContext as useContext29 } from "react";
14146
14151
  var ToggleBarContext = createContext20({
14147
14152
  size: "medium"
14148
14153
  });
14149
- var useToggleBarContext = () => useContext28(ToggleBarContext);
14154
+ var useToggleBarContext = () => useContext29(ToggleBarContext);
14150
14155
 
14151
14156
  // src/components/ToggleBar/ToggleBar.module.css
14152
14157
  var ToggleBar_default = {