@navikt/ds-react 7.9.0 → 7.9.2

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.
Files changed (263) hide show
  1. package/README.md +2 -2
  2. package/cjs/alert/Alert.js +2 -2
  3. package/cjs/alert/Alert.js.map +1 -1
  4. package/cjs/chips/Removable.js +2 -2
  5. package/cjs/chips/Removable.js.map +1 -1
  6. package/cjs/copybutton/CopyButton.js +2 -2
  7. package/cjs/copybutton/CopyButton.js.map +1 -1
  8. package/cjs/date/context/useDateTranslationContext.d.ts +1 -1
  9. package/cjs/date/datepicker/DatePicker.js +3 -3
  10. package/cjs/date/datepicker/DatePicker.js.map +1 -1
  11. package/cjs/date/datepicker/DatePickerStandalone.js +3 -3
  12. package/cjs/date/datepicker/DatePickerStandalone.js.map +1 -1
  13. package/cjs/date/hooks/useDatepicker.js +2 -2
  14. package/cjs/date/hooks/useDatepicker.js.map +1 -1
  15. package/cjs/date/hooks/useMonthPicker.js +2 -2
  16. package/cjs/date/hooks/useMonthPicker.js.map +1 -1
  17. package/cjs/date/hooks/useRangeDatepicker.js +2 -2
  18. package/cjs/date/hooks/useRangeDatepicker.js.map +1 -1
  19. package/cjs/date/monthpicker/MonthPicker.js +3 -3
  20. package/cjs/date/monthpicker/MonthPicker.js.map +1 -1
  21. package/cjs/date/monthpicker/MonthPickerStandalone.js +3 -3
  22. package/cjs/date/monthpicker/MonthPickerStandalone.js.map +1 -1
  23. package/cjs/date/parts/DateWrapper.d.ts +1 -1
  24. package/cjs/date/parts/DateWrapper.js +2 -2
  25. package/cjs/date/parts/DateWrapper.js.map +1 -1
  26. package/cjs/expansion-card/ExpansionCardHeader.js +2 -2
  27. package/cjs/expansion-card/ExpansionCardHeader.js.map +1 -1
  28. package/cjs/form/ReadOnlyIcon.js +2 -2
  29. package/cjs/form/ReadOnlyIcon.js.map +1 -1
  30. package/cjs/form/combobox/FilteredOptions/AddNewOption.js +2 -2
  31. package/cjs/form/combobox/FilteredOptions/AddNewOption.js.map +1 -1
  32. package/cjs/form/combobox/FilteredOptions/LoadingMessage.js +2 -2
  33. package/cjs/form/combobox/FilteredOptions/LoadingMessage.js.map +1 -1
  34. package/cjs/form/combobox/FilteredOptions/MaxSelectedMessage.js +2 -2
  35. package/cjs/form/combobox/FilteredOptions/MaxSelectedMessage.js.map +1 -1
  36. package/cjs/form/error-summary/ErrorSummary.js +2 -2
  37. package/cjs/form/error-summary/ErrorSummary.js.map +1 -1
  38. package/cjs/form/file-upload/parts/dropzone/Dropzone.js +2 -2
  39. package/cjs/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
  40. package/cjs/form/file-upload/parts/item/Item.js +2 -2
  41. package/cjs/form/file-upload/parts/item/Item.js.map +1 -1
  42. package/cjs/form/form-progress/FormProgress.js +2 -2
  43. package/cjs/form/form-progress/FormProgress.js.map +1 -1
  44. package/cjs/form/form-summary/FormSummaryEditLink.js +2 -2
  45. package/cjs/form/form-summary/FormSummaryEditLink.js.map +1 -1
  46. package/cjs/form/search/Search.js +2 -2
  47. package/cjs/form/search/Search.js.map +1 -1
  48. package/cjs/form/search/SearchButton.js +2 -2
  49. package/cjs/form/search/SearchButton.js.map +1 -1
  50. package/cjs/form/textarea/TextareaCounter.js +2 -2
  51. package/cjs/form/textarea/TextareaCounter.js.map +1 -1
  52. package/cjs/guide-panel/Illustration.darkside.js +2 -2
  53. package/cjs/guide-panel/Illustration.darkside.js.map +1 -1
  54. package/cjs/guide-panel/Illustration.js +2 -2
  55. package/cjs/guide-panel/Illustration.js.map +1 -1
  56. package/cjs/help-text/HelpText.js +2 -2
  57. package/cjs/help-text/HelpText.js.map +1 -1
  58. package/cjs/layout/base/BasePrimitive.d.ts +27 -27
  59. package/cjs/layout/bleed/Bleed.d.ts +6 -6
  60. package/cjs/layout/box/Box.darkside.d.ts +3 -3
  61. package/cjs/layout/grid/HGrid.d.ts +3 -3
  62. package/cjs/layout/stack/Stack.d.ts +3 -3
  63. package/cjs/layout/utilities/css.d.ts +1 -1
  64. package/cjs/layout/utilities/css.js +49 -20
  65. package/cjs/layout/utilities/css.js.map +1 -1
  66. package/cjs/layout/utilities/types.d.ts +2 -2
  67. package/cjs/link/stories/RandomIcon.d.ts +2 -0
  68. package/cjs/link/stories/RandomIcon.js +39 -0
  69. package/cjs/link/stories/RandomIcon.js.map +1 -0
  70. package/cjs/loader/Loader.js +2 -2
  71. package/cjs/loader/Loader.js.map +1 -1
  72. package/cjs/modal/ModalHeader.js +2 -2
  73. package/cjs/modal/ModalHeader.js.map +1 -1
  74. package/cjs/pagination/Pagination.js +2 -2
  75. package/cjs/pagination/Pagination.js.map +1 -1
  76. package/cjs/progress-bar/ProgressBar.js +2 -2
  77. package/cjs/progress-bar/ProgressBar.js.map +1 -1
  78. package/cjs/table/ExpandableRow.js +2 -2
  79. package/cjs/table/ExpandableRow.js.map +1 -1
  80. package/cjs/tag/Tag.d.ts +1 -1
  81. package/cjs/timeline/AxisLabels.js +3 -3
  82. package/cjs/timeline/AxisLabels.js.map +1 -1
  83. package/cjs/timeline/Pin.js +2 -2
  84. package/cjs/timeline/Pin.js.map +1 -1
  85. package/cjs/timeline/TimelineRow.js +2 -2
  86. package/cjs/timeline/TimelineRow.js.map +1 -1
  87. package/cjs/timeline/period/ClickablePeriod.js +2 -2
  88. package/cjs/timeline/period/ClickablePeriod.js.map +1 -1
  89. package/cjs/timeline/period/NonClickablePeriod.js +2 -2
  90. package/cjs/timeline/period/NonClickablePeriod.js.map +1 -1
  91. package/cjs/timeline/utils/period.d.ts +1 -1
  92. package/cjs/timeline/zoom/ZoomButton.js +2 -2
  93. package/cjs/timeline/zoom/ZoomButton.js.map +1 -1
  94. package/cjs/util/i18n/i18n.hooks.d.ts +4 -0
  95. package/cjs/util/i18n/{i18n.context.js → i18n.hooks.js} +3 -7
  96. package/cjs/util/i18n/i18n.hooks.js.map +1 -0
  97. package/cjs/util/i18n/i18n.types.d.ts +4 -0
  98. package/cjs/util/i18n/locales/nb.d.ts +81 -4
  99. package/cjs/util/i18n/locales/nb.js +81 -4
  100. package/cjs/util/i18n/locales/nb.js.map +1 -1
  101. package/esm/alert/Alert.js +1 -1
  102. package/esm/alert/Alert.js.map +1 -1
  103. package/esm/chips/Removable.js +1 -1
  104. package/esm/chips/Removable.js.map +1 -1
  105. package/esm/copybutton/CopyButton.js +1 -1
  106. package/esm/copybutton/CopyButton.js.map +1 -1
  107. package/esm/date/context/useDateTranslationContext.d.ts +1 -1
  108. package/esm/date/datepicker/DatePicker.js +1 -1
  109. package/esm/date/datepicker/DatePicker.js.map +1 -1
  110. package/esm/date/datepicker/DatePickerStandalone.js +1 -1
  111. package/esm/date/datepicker/DatePickerStandalone.js.map +1 -1
  112. package/esm/date/hooks/useDatepicker.js +1 -1
  113. package/esm/date/hooks/useDatepicker.js.map +1 -1
  114. package/esm/date/hooks/useMonthPicker.js +1 -1
  115. package/esm/date/hooks/useMonthPicker.js.map +1 -1
  116. package/esm/date/hooks/useRangeDatepicker.js +1 -1
  117. package/esm/date/hooks/useRangeDatepicker.js.map +1 -1
  118. package/esm/date/monthpicker/MonthPicker.js +1 -1
  119. package/esm/date/monthpicker/MonthPicker.js.map +1 -1
  120. package/esm/date/monthpicker/MonthPickerStandalone.js +1 -1
  121. package/esm/date/monthpicker/MonthPickerStandalone.js.map +1 -1
  122. package/esm/date/parts/DateWrapper.d.ts +1 -1
  123. package/esm/date/parts/DateWrapper.js +1 -1
  124. package/esm/date/parts/DateWrapper.js.map +1 -1
  125. package/esm/expansion-card/ExpansionCardHeader.js +1 -1
  126. package/esm/expansion-card/ExpansionCardHeader.js.map +1 -1
  127. package/esm/form/ReadOnlyIcon.js +1 -1
  128. package/esm/form/ReadOnlyIcon.js.map +1 -1
  129. package/esm/form/combobox/FilteredOptions/AddNewOption.js +1 -1
  130. package/esm/form/combobox/FilteredOptions/AddNewOption.js.map +1 -1
  131. package/esm/form/combobox/FilteredOptions/LoadingMessage.js +1 -1
  132. package/esm/form/combobox/FilteredOptions/LoadingMessage.js.map +1 -1
  133. package/esm/form/combobox/FilteredOptions/MaxSelectedMessage.js +1 -1
  134. package/esm/form/combobox/FilteredOptions/MaxSelectedMessage.js.map +1 -1
  135. package/esm/form/error-summary/ErrorSummary.js +1 -1
  136. package/esm/form/error-summary/ErrorSummary.js.map +1 -1
  137. package/esm/form/file-upload/parts/dropzone/Dropzone.js +1 -1
  138. package/esm/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
  139. package/esm/form/file-upload/parts/item/Item.js +1 -1
  140. package/esm/form/file-upload/parts/item/Item.js.map +1 -1
  141. package/esm/form/form-progress/FormProgress.js +1 -1
  142. package/esm/form/form-progress/FormProgress.js.map +1 -1
  143. package/esm/form/form-summary/FormSummaryEditLink.js +1 -1
  144. package/esm/form/form-summary/FormSummaryEditLink.js.map +1 -1
  145. package/esm/form/search/Search.js +1 -1
  146. package/esm/form/search/Search.js.map +1 -1
  147. package/esm/form/search/SearchButton.js +1 -1
  148. package/esm/form/search/SearchButton.js.map +1 -1
  149. package/esm/form/textarea/TextareaCounter.js +1 -1
  150. package/esm/form/textarea/TextareaCounter.js.map +1 -1
  151. package/esm/guide-panel/Illustration.darkside.js +1 -1
  152. package/esm/guide-panel/Illustration.darkside.js.map +1 -1
  153. package/esm/guide-panel/Illustration.js +1 -1
  154. package/esm/guide-panel/Illustration.js.map +1 -1
  155. package/esm/help-text/HelpText.js +1 -1
  156. package/esm/help-text/HelpText.js.map +1 -1
  157. package/esm/layout/base/BasePrimitive.d.ts +27 -27
  158. package/esm/layout/bleed/Bleed.d.ts +6 -6
  159. package/esm/layout/box/Box.darkside.d.ts +3 -3
  160. package/esm/layout/grid/HGrid.d.ts +3 -3
  161. package/esm/layout/stack/Stack.d.ts +3 -3
  162. package/esm/layout/utilities/css.d.ts +1 -1
  163. package/esm/layout/utilities/css.js +49 -20
  164. package/esm/layout/utilities/css.js.map +1 -1
  165. package/esm/layout/utilities/types.d.ts +2 -2
  166. package/esm/link/stories/RandomIcon.d.ts +2 -0
  167. package/esm/link/stories/RandomIcon.js +9 -0
  168. package/esm/link/stories/RandomIcon.js.map +1 -0
  169. package/esm/loader/Loader.js +1 -1
  170. package/esm/loader/Loader.js.map +1 -1
  171. package/esm/modal/ModalHeader.js +1 -1
  172. package/esm/modal/ModalHeader.js.map +1 -1
  173. package/esm/pagination/Pagination.js +1 -1
  174. package/esm/pagination/Pagination.js.map +1 -1
  175. package/esm/progress-bar/ProgressBar.js +1 -1
  176. package/esm/progress-bar/ProgressBar.js.map +1 -1
  177. package/esm/table/ExpandableRow.js +1 -1
  178. package/esm/table/ExpandableRow.js.map +1 -1
  179. package/esm/tag/Tag.d.ts +1 -1
  180. package/esm/timeline/AxisLabels.js +1 -1
  181. package/esm/timeline/AxisLabels.js.map +1 -1
  182. package/esm/timeline/Pin.js +1 -1
  183. package/esm/timeline/Pin.js.map +1 -1
  184. package/esm/timeline/TimelineRow.js +1 -1
  185. package/esm/timeline/TimelineRow.js.map +1 -1
  186. package/esm/timeline/period/ClickablePeriod.js +1 -1
  187. package/esm/timeline/period/ClickablePeriod.js.map +1 -1
  188. package/esm/timeline/period/NonClickablePeriod.js +1 -1
  189. package/esm/timeline/period/NonClickablePeriod.js.map +1 -1
  190. package/esm/timeline/utils/period.d.ts +1 -1
  191. package/esm/timeline/zoom/ZoomButton.js +1 -1
  192. package/esm/timeline/zoom/ZoomButton.js.map +1 -1
  193. package/esm/util/i18n/i18n.hooks.d.ts +4 -0
  194. package/esm/util/i18n/{i18n.context.js → i18n.hooks.js} +3 -7
  195. package/esm/util/i18n/{i18n.context.js.map → i18n.hooks.js.map} +1 -1
  196. package/esm/util/i18n/i18n.types.d.ts +4 -0
  197. package/esm/util/i18n/locales/nb.d.ts +81 -4
  198. package/esm/util/i18n/locales/nb.js +81 -4
  199. package/esm/util/i18n/locales/nb.js.map +1 -1
  200. package/package.json +17 -12
  201. package/src/alert/Alert.tsx +1 -1
  202. package/src/chips/Removable.tsx +1 -1
  203. package/src/copybutton/CopyButton.tsx +1 -1
  204. package/src/date/context/useDateTranslationContext.ts +1 -1
  205. package/src/date/datepicker/DatePicker.tsx +1 -1
  206. package/src/date/datepicker/DatePickerStandalone.tsx +1 -1
  207. package/src/date/datepicker/datepicker.test.tsx +2 -5
  208. package/src/date/hooks/useDatepicker.tsx +1 -1
  209. package/src/date/hooks/useMonthPicker.tsx +1 -1
  210. package/src/date/hooks/useRangeDatepicker.test.tsx +5 -10
  211. package/src/date/hooks/useRangeDatepicker.tsx +1 -1
  212. package/src/date/monthpicker/MonthPicker.tsx +1 -1
  213. package/src/date/monthpicker/MonthPickerStandalone.tsx +1 -1
  214. package/src/date/parts/DateWrapper.tsx +2 -1
  215. package/src/expansion-card/ExpansionCardHeader.tsx +1 -1
  216. package/src/form/ReadOnlyIcon.tsx +1 -1
  217. package/src/form/combobox/FilteredOptions/AddNewOption.tsx +1 -1
  218. package/src/form/combobox/FilteredOptions/LoadingMessage.tsx +1 -1
  219. package/src/form/combobox/FilteredOptions/MaxSelectedMessage.tsx +1 -1
  220. package/src/form/error-summary/ErrorSummary.tsx +1 -1
  221. package/src/form/file-upload/parts/dropzone/Dropzone.tsx +1 -1
  222. package/src/form/file-upload/parts/item/Item.tsx +1 -1
  223. package/src/form/form-progress/FormProgress.tsx +1 -1
  224. package/src/form/form-summary/FormSummaryEditLink.tsx +1 -1
  225. package/src/form/search/Search.tsx +1 -1
  226. package/src/form/search/SearchButton.tsx +1 -1
  227. package/src/form/textarea/TextareaCounter.tsx +1 -1
  228. package/src/guide-panel/Illustration.darkside.tsx +1 -1
  229. package/src/guide-panel/Illustration.tsx +1 -1
  230. package/src/help-text/HelpText.tsx +1 -1
  231. package/src/layout/base/BasePrimitive.tsx +27 -27
  232. package/src/layout/bleed/Bleed.tsx +6 -6
  233. package/src/layout/box/Box.darkside.tsx +3 -3
  234. package/src/layout/grid/HGrid.tsx +3 -3
  235. package/src/layout/stack/Stack.tsx +3 -3
  236. package/src/layout/utilities/css.ts +56 -24
  237. package/src/layout/utilities/types.ts +3 -2
  238. package/src/loader/Loader.tsx +1 -1
  239. package/src/modal/ModalHeader.tsx +1 -1
  240. package/src/pagination/Pagination.tsx +1 -1
  241. package/src/progress-bar/ProgressBar.tsx +1 -1
  242. package/src/table/ExpandableRow.tsx +1 -1
  243. package/src/tabs/Tabs.test.tsx +4 -12
  244. package/src/tag/Tag.tsx +6 -6
  245. package/src/timeline/AxisLabels.tsx +2 -1
  246. package/src/timeline/Pin.tsx +1 -1
  247. package/src/timeline/TimelineRow.tsx +1 -1
  248. package/src/timeline/period/ClickablePeriod.tsx +1 -1
  249. package/src/timeline/period/NonClickablePeriod.tsx +1 -1
  250. package/src/timeline/utils/period.ts +1 -1
  251. package/src/timeline/zoom/ZoomButton.tsx +1 -1
  252. package/src/util/i18n/{i18n.context.test.tsx → i18n.hooks.test.tsx} +62 -3
  253. package/src/util/i18n/{i18n.context.ts → i18n.hooks.ts} +3 -19
  254. package/src/util/i18n/i18n.types.ts +12 -0
  255. package/cjs/modal/types.test-d.d.ts +0 -1
  256. package/cjs/modal/types.test-d.js +0 -67
  257. package/cjs/modal/types.test-d.js.map +0 -1
  258. package/cjs/util/i18n/i18n.context.d.ts +0 -9
  259. package/cjs/util/i18n/i18n.context.js.map +0 -1
  260. package/esm/modal/types.test-d.d.ts +0 -1
  261. package/esm/modal/types.test-d.js +0 -65
  262. package/esm/modal/types.test-d.js.map +0 -1
  263. package/esm/util/i18n/i18n.context.d.ts +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-react",
3
- "version": "7.9.0",
3
+ "version": "7.9.2",
4
4
  "description": "React components from the Norwegian Labour and Welfare Administration.",
5
5
  "author": "Aksel, a team part of the Norwegian Labour and Welfare Administration.",
6
6
  "license": "MIT",
@@ -603,10 +603,11 @@
603
603
  "./package.json": "./package.json"
604
604
  },
605
605
  "scripts": {
606
- "docgen": "yarn tsx ../../../scripts/docgen.ts",
606
+ "docgen": "tsx ../../../scripts/docgen.ts",
607
+ "i18n-jsdoc": "tsx ./scripts/addJsdocToLocales.ts",
607
608
  "write-packagejson": "echo '{\"type\": \"module\"}' > esm/package.json",
608
609
  "clean": "rimraf cjs esm",
609
- "build": "concurrently \"tsc -p tsconfig.build.json\" \"tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json && yarn write-packagejson\" ",
610
+ "build": "yarn i18n-jsdoc && concurrently \"tsc -p tsconfig.build.json\" \"tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json && yarn write-packagejson\" && yarn i18n-jsdoc --cleanup",
610
611
  "watch": "tsc --watch -p tsconfig.esm.json",
611
612
  "test": "TZ=UTC vitest run -c tests/vitest.config.ts",
612
613
  "test:watch": "vitest watch"
@@ -614,20 +615,23 @@
614
615
  "dependencies": {
615
616
  "@floating-ui/react": "0.25.4",
616
617
  "@floating-ui/react-dom": "^2.0.9",
617
- "@navikt/aksel-icons": "^7.9.0",
618
- "@navikt/ds-tokens": "^7.9.0",
618
+ "@navikt/aksel-icons": "^7.9.2",
619
+ "@navikt/ds-tokens": "^7.9.2",
619
620
  "clsx": "^2.1.0",
620
621
  "date-fns": "^3.0.0",
621
622
  "react-day-picker": "8.10.1"
622
623
  },
623
624
  "devDependencies": {
624
- "@testing-library/dom": "9.3.4",
625
- "@testing-library/jest-dom": "^5.16.0",
626
- "@testing-library/react": "^15.0.7",
627
- "@testing-library/user-event": "^14.2.0",
625
+ "@testing-library/dom": "10.4.0",
626
+ "@testing-library/jest-dom": "^6.6.3",
627
+ "@testing-library/react": "^16.1.0",
628
+ "@testing-library/user-event": "^14.5.2",
629
+ "@types/jscodeshift": "^0.11.11",
630
+ "aksel": "workspace:^",
628
631
  "concurrently": "9.0.1",
629
632
  "fast-glob": "3.2.11",
630
- "jsdom": "24.0.0",
633
+ "jscodeshift": "^0.15.1",
634
+ "jsdom": "25.0.1",
631
635
  "react-dom": "^18.0.0",
632
636
  "react-router-dom": "^6.3.0",
633
637
  "rimraf": "6.0.1",
@@ -635,7 +639,7 @@
635
639
  "tsc-alias": "1.8.8",
636
640
  "tsx": "^4.19.1",
637
641
  "typescript": "5.5.4",
638
- "vitest": "^1.2.2"
642
+ "vitest": "^2.1.8"
639
643
  },
640
644
  "peerDependencies": {
641
645
  "@types/react": ">=17.0.30",
@@ -645,5 +649,6 @@
645
649
  "@types/react": {
646
650
  "optional": true
647
651
  }
648
- }
652
+ },
653
+ "_comment": "The 'aksel' dependency tells yarn to install the root deps when installing deps for this package. Helps make it possible to contribute without access to GPR."
649
654
  }
@@ -9,7 +9,7 @@ import {
9
9
  } from "@navikt/aksel-icons";
10
10
  import { Button } from "../button";
11
11
  import { BodyLong } from "../typography";
12
- import { useI18n } from "../util/i18n/i18n.context";
12
+ import { useI18n } from "../util/i18n/i18n.hooks";
13
13
 
14
14
  export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
15
15
  /**
@@ -2,7 +2,7 @@ import cl from "clsx";
2
2
  import React, { forwardRef } from "react";
3
3
  import { XMarkIcon } from "@navikt/aksel-icons";
4
4
  import { composeEventHandlers } from "../util/composeEventHandlers";
5
- import { useI18n } from "../util/i18n/i18n.context";
5
+ import { useI18n } from "../util/i18n/i18n.hooks";
6
6
 
7
7
  export interface ChipsRemovableProps
8
8
  extends React.ButtonHTMLAttributes<HTMLButtonElement> {
@@ -10,7 +10,7 @@ import { CheckmarkIcon, FilesIcon } from "@navikt/aksel-icons";
10
10
  import { Label } from "../typography";
11
11
  import { composeEventHandlers } from "../util/composeEventHandlers";
12
12
  import copy from "../util/copy";
13
- import { useI18n } from "../util/i18n/i18n.context";
13
+ import { useI18n } from "../util/i18n/i18n.hooks";
14
14
 
15
15
  export interface CopyButtonProps
16
16
  extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
@@ -1,5 +1,5 @@
1
1
  import { createContext } from "../../util/create-context";
2
- import { TFunction } from "../../util/i18n/i18n.context";
2
+ import { TFunction } from "../../util/i18n/i18n.types";
3
3
 
4
4
  interface DateTranslationContextProps {
5
5
  translate: TFunction<"DatePicker">;
@@ -5,7 +5,7 @@ import { DateRange, DayPicker, isMatch } from "react-day-picker";
5
5
  import { omit } from "../../util";
6
6
  import { useId } from "../../util/hooks";
7
7
  import { useMergeRefs } from "../../util/hooks/useMergeRefs";
8
- import { useDateLocale, useI18n } from "../../util/i18n/i18n.context";
8
+ import { useDateLocale, useI18n } from "../../util/i18n/i18n.hooks";
9
9
  import { DateInputContext, DateTranslationContextProvider } from "../context";
10
10
  import { DatePickerInput } from "../parts/DateInput";
11
11
  import { DateWrapper } from "../parts/DateWrapper";
@@ -3,7 +3,7 @@ import { isWeekend } from "date-fns";
3
3
  import React, { forwardRef } from "react";
4
4
  import { DateRange, DayPicker, isMatch } from "react-day-picker";
5
5
  import { omit } from "../../util";
6
- import { useDateLocale, useI18n } from "../../util/i18n/i18n.context";
6
+ import { useDateLocale, useI18n } from "../../util/i18n/i18n.hooks";
7
7
  import { DateTranslationContextProvider } from "../context";
8
8
  import { getLocaleFromString, getTranslations } from "../utils";
9
9
  import Caption from "./parts/Caption";
@@ -1,4 +1,4 @@
1
- import { act, render, screen } from "@testing-library/react";
1
+ import { render, screen } from "@testing-library/react";
2
2
  import userEvent from "@testing-library/user-event";
3
3
  import React from "react";
4
4
  import { describe, test } from "vitest";
@@ -23,9 +23,6 @@ describe("Render datepicker", () => {
23
23
  test("Should not crash when e.target is window", async () => {
24
24
  render(<App />);
25
25
 
26
- // eslint-disable-next-line testing-library/no-unnecessary-act -- https://kentcdodds.com/blog/fix-the-not-wrapped-in-act-warning
27
- await act(async () => {
28
- await userEvent.click(screen.getByText("Velg dato"));
29
- });
26
+ await userEvent.click(screen.getByText("Velg dato"));
30
27
  });
31
28
  });
@@ -1,7 +1,7 @@
1
1
  import { differenceInCalendarDays, isWeekend } from "date-fns";
2
2
  import React, { useCallback, useState } from "react";
3
3
  import { DayClickEventHandler, isMatch } from "react-day-picker";
4
- import { useDateLocale } from "../../util/i18n/i18n.context";
4
+ import { useDateLocale } from "../../util/i18n/i18n.hooks";
5
5
  import { DatePickerProps } from "../datepicker/DatePicker";
6
6
  import { DateInputProps } from "../parts/DateInput";
7
7
  import {
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useMemo, useState } from "react";
2
- import { useDateLocale } from "../../util/i18n/i18n.context";
2
+ import { useDateLocale } from "../../util/i18n/i18n.hooks";
3
3
  import { MonthPickerProps } from "../monthpicker/types";
4
4
  import { DateInputProps } from "../parts/DateInput";
5
5
  import {
@@ -1,5 +1,4 @@
1
- /* eslint-disable testing-library/no-unnecessary-act -- https://kentcdodds.com/blog/fix-the-not-wrapped-in-act-warning */
2
- import { act, render, screen } from "@testing-library/react";
1
+ import { render, screen } from "@testing-library/react";
3
2
  import userEvent from "@testing-library/user-event";
4
3
  import React from "react";
5
4
  import { describe, expect, test } from "vitest";
@@ -29,10 +28,8 @@ describe("Writing in input sets correct values", () => {
29
28
 
30
29
  const fraInput = screen.getByRole("textbox", { name: "Fra" });
31
30
  const tilInput = screen.getByRole("textbox", { name: "Til" });
32
- await act(async () => {
33
- await userEvent.type(fraInput, "03.08.2022");
34
- await userEvent.type(tilInput, "03.08.2022");
35
- });
31
+ await userEvent.type(fraInput, "03.08.2022");
32
+ await userEvent.type(tilInput, "03.08.2022");
36
33
  const res = screen.getByTitle("res");
37
34
  expect(res.innerHTML).toEqual(
38
35
  JSON.stringify({
@@ -47,10 +44,8 @@ describe("Writing in input sets correct values", () => {
47
44
 
48
45
  const fraInput = screen.getByRole("textbox", { name: "Fra" });
49
46
  const tilInput = screen.getByRole("textbox", { name: "Til" });
50
- await act(async () => {
51
- await userEvent.type(fraInput, "03.08.2022");
52
- await userEvent.type(tilInput, "02.08.2022");
53
- });
47
+ await userEvent.type(fraInput, "03.08.2022");
48
+ await userEvent.type(tilInput, "02.08.2022");
54
49
  const res = screen.getByTitle("res");
55
50
  expect(res.innerHTML).toEqual(
56
51
  JSON.stringify({
@@ -5,7 +5,7 @@ import {
5
5
  } from "date-fns";
6
6
  import React, { useState } from "react";
7
7
  import { DateRange, isMatch } from "react-day-picker";
8
- import { useDateLocale } from "../../util/i18n/i18n.context";
8
+ import { useDateLocale } from "../../util/i18n/i18n.hooks";
9
9
  import { DatePickerProps } from "../datepicker/DatePicker";
10
10
  import { DateInputProps } from "../parts/DateInput";
11
11
  import {
@@ -3,7 +3,7 @@ import React, { forwardRef, useState } from "react";
3
3
  import { DayPickerProvider } from "react-day-picker";
4
4
  import { useId } from "../../util/hooks";
5
5
  import { useMergeRefs } from "../../util/hooks/useMergeRefs";
6
- import { useDateLocale, useI18n } from "../../util/i18n/i18n.context";
6
+ import { useDateLocale, useI18n } from "../../util/i18n/i18n.hooks";
7
7
  import {
8
8
  DateInputContext,
9
9
  DateTranslationContextProvider,
@@ -1,7 +1,7 @@
1
1
  import cl from "clsx";
2
2
  import React, { forwardRef, useState } from "react";
3
3
  import { DayPickerProvider } from "react-day-picker";
4
- import { useDateLocale, useI18n } from "../../util/i18n/i18n.context";
4
+ import { useDateLocale, useI18n } from "../../util/i18n/i18n.hooks";
5
5
  import {
6
6
  DateTranslationContextProvider,
7
7
  SharedMonthProvider,
@@ -5,7 +5,8 @@ import { Modal } from "../../modal";
5
5
  import { useModalContext } from "../../modal/Modal.context";
6
6
  import { Popover } from "../../popover";
7
7
  import { useMedia } from "../../util/hooks";
8
- import { TFunction, useI18n } from "../../util/i18n/i18n.context";
8
+ import { useI18n } from "../../util/i18n/i18n.hooks";
9
+ import { TFunction } from "../../util/i18n/i18n.types";
9
10
  import { getGlobalTranslations } from "../utils";
10
11
 
11
12
  const variantToLabel = {
@@ -1,7 +1,7 @@
1
1
  import cl from "clsx";
2
2
  import React, { forwardRef, useContext } from "react";
3
3
  import { ChevronDownIcon } from "@navikt/aksel-icons";
4
- import { useI18n } from "../util/i18n/i18n.context";
4
+ import { useI18n } from "../util/i18n/i18n.hooks";
5
5
  import { ExpansionCardContext } from "./context";
6
6
 
7
7
  export interface ExpansionCardHeaderProps
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { PadlockLockedFillIcon } from "@navikt/aksel-icons";
3
- import { useI18n } from "../util/i18n/i18n.context";
3
+ import { useI18n } from "../util/i18n/i18n.hooks";
4
4
 
5
5
  export const ReadOnlyIcon = () => (
6
6
  <PadlockLockedFillIcon
@@ -2,7 +2,7 @@ import cl from "clsx";
2
2
  import React from "react";
3
3
  import { PlusIcon } from "@navikt/aksel-icons";
4
4
  import { BodyShort, Label } from "../../../typography";
5
- import { useI18n } from "../../../util/i18n/i18n.context";
5
+ import { useI18n } from "../../../util/i18n/i18n.hooks";
6
6
  import { useInputContext } from "../Input/Input.context";
7
7
  import { useSelectedOptionsContext } from "../SelectedOptions/selectedOptionsContext";
8
8
  import { isInList, toComboboxOption } from "../combobox-utils";
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { Loader } from "../../../loader";
3
- import { useI18n } from "../../../util/i18n/i18n.context";
3
+ import { useI18n } from "../../../util/i18n/i18n.hooks";
4
4
  import { useInputContext } from "../Input/Input.context";
5
5
  import filteredOptionsUtil from "./filtered-options-util";
6
6
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { useI18n } from "../../../util/i18n/i18n.context";
2
+ import { useI18n } from "../../../util/i18n/i18n.hooks";
3
3
  import { useInputContext } from "../Input/Input.context";
4
4
  import { useSelectedOptionsContext } from "../SelectedOptions/selectedOptionsContext";
5
5
  import filteredOptionsUtil from "./filtered-options-util";
@@ -3,7 +3,7 @@ import React, { HTMLAttributes, forwardRef, useRef } from "react";
3
3
  import { BodyShort, Heading } from "../../typography";
4
4
  import { composeEventHandlers } from "../../util/composeEventHandlers";
5
5
  import { useMergeRefs } from "../../util/hooks";
6
- import { useI18n } from "../../util/i18n/i18n.context";
6
+ import { useI18n } from "../../util/i18n/i18n.hooks";
7
7
  import ErrorSummaryItem from "./ErrorSummaryItem";
8
8
 
9
9
  export interface ErrorSummaryProps
@@ -5,7 +5,7 @@ import { Button } from "../../../../button";
5
5
  import { BodyShort, ErrorMessage, Label } from "../../../../typography";
6
6
  import { composeEventHandlers } from "../../../../util/composeEventHandlers";
7
7
  import { useId } from "../../../../util/hooks";
8
- import { useI18n } from "../../../../util/i18n/i18n.context";
8
+ import { useI18n } from "../../../../util/i18n/i18n.hooks";
9
9
  import { omit } from "../../../../util/omit";
10
10
  import { useFormField } from "../../../useFormField";
11
11
  import { useFileUploadTranslation } from "../../FileUpload.context";
@@ -3,7 +3,7 @@ import React, { MouseEvent, forwardRef } from "react";
3
3
  import { ExclamationmarkTriangleIcon } from "@navikt/aksel-icons";
4
4
  import { BodyShort } from "../../../../typography";
5
5
  import { OverridableComponent } from "../../../../util";
6
- import { useI18n } from "../../../../util/i18n/i18n.context";
6
+ import { useI18n } from "../../../../util/i18n/i18n.hooks";
7
7
  import { ComponentTranslation } from "../../../../util/i18n/i18n.types";
8
8
  import { useFileUploadTranslation } from "../../FileUpload.context";
9
9
  import { FileItem } from "./Item.types";
@@ -6,7 +6,7 @@ import { HStack } from "../../layout/stack";
6
6
  import { ProgressBar } from "../../progress-bar";
7
7
  import { Stepper, StepperStepProps } from "../../stepper";
8
8
  import { BodyShort } from "../../typography";
9
- import { useI18n } from "../../util/i18n/i18n.context";
9
+ import { useI18n } from "../../util/i18n/i18n.hooks";
10
10
  import { ComponentTranslation } from "../../util/i18n/i18n.types";
11
11
 
12
12
  export interface FormProgressProps
@@ -1,7 +1,7 @@
1
1
  import cl from "clsx";
2
2
  import React, { forwardRef } from "react";
3
3
  import { Link } from "../../link";
4
- import { useI18n } from "../../util/i18n/i18n.context";
4
+ import { useI18n } from "../../util/i18n/i18n.hooks";
5
5
  import { OverridableComponent } from "../../util/types";
6
6
 
7
7
  export interface FormSummaryEditProps
@@ -11,7 +11,7 @@ import { useThemeInternal } from "../../theme/Theme";
11
11
  import { BodyShort, ErrorMessage, Label } from "../../typography";
12
12
  import { omit } from "../../util";
13
13
  import { useMergeRefs } from "../../util/hooks/useMergeRefs";
14
- import { useI18n } from "../../util/i18n/i18n.context";
14
+ import { useI18n } from "../../util/i18n/i18n.hooks";
15
15
  import { FormFieldProps, useFormField } from "../useFormField";
16
16
  import SearchButton, { SearchButtonType } from "./SearchButton";
17
17
  import { SearchContext } from "./context";
@@ -3,7 +3,7 @@ import React, { forwardRef, useContext } from "react";
3
3
  import { MagnifyingGlassIcon } from "@navikt/aksel-icons";
4
4
  import { Button, ButtonProps } from "../../button";
5
5
  import { composeEventHandlers } from "../../util/composeEventHandlers";
6
- import { useI18n } from "../../util/i18n/i18n.context";
6
+ import { useI18n } from "../../util/i18n/i18n.hooks";
7
7
  import { SearchContext } from "./context";
8
8
 
9
9
  export interface SearchButtonProps
@@ -2,7 +2,7 @@ import cl from "clsx";
2
2
  import React, { useEffect, useState } from "react";
3
3
  import { BodyShort } from "../../typography";
4
4
  import debounce from "../../util/debounce";
5
- import { useI18n } from "../../util/i18n/i18n.context";
5
+ import { useI18n } from "../../util/i18n/i18n.hooks";
6
6
  import type { TextareaProps } from "./Textarea";
7
7
 
8
8
  interface Props {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { useI18n } from "../util/i18n/i18n.context";
2
+ import { useI18n } from "../util/i18n/i18n.hooks";
3
3
 
4
4
  export const DarksideGudiepanelIllustration = () => {
5
5
  const translate = useI18n("GuidePanel");
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { useI18n } from "../util/i18n/i18n.context";
2
+ import { useI18n } from "../util/i18n/i18n.hooks";
3
3
 
4
4
  export const DefaultIllustration = () => {
5
5
  const translate = useI18n("GuidePanel");
@@ -4,7 +4,7 @@ import { Popover, PopoverProps } from "../popover";
4
4
  import { useThemeInternal } from "../theme/Theme";
5
5
  import { composeEventHandlers } from "../util/composeEventHandlers";
6
6
  import { useMergeRefs } from "../util/hooks/useMergeRefs";
7
- import { useI18n } from "../util/i18n/i18n.context";
7
+ import { useI18n } from "../util/i18n/i18n.hooks";
8
8
  import { HelpTextIcon } from "./HelpTextIcon";
9
9
 
10
10
  export interface HelpTextProps
@@ -15,8 +15,8 @@ export type PrimitiveProps = {
15
15
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
16
16
  * or an object of spacing tokens for different breakpoints.
17
17
  * @example
18
- * padding='4'
19
- * padding={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
18
+ * padding='space-16'
19
+ * padding={{xs: 'space-8', sm: 'space-12', md: 'space-16', lg: 'space-20', xl: 'space-24'}}
20
20
  */
21
21
  padding?: ResponsiveProp<SpacingScale>;
22
22
  /**
@@ -24,9 +24,9 @@ export type PrimitiveProps = {
24
24
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
25
25
  * or an object of spacing tokens for different breakpoints.
26
26
  * @example
27
- * paddingInline='4'
28
- * paddingInline='4 5'
29
- * paddingInline={{xs: '0 32', sm: '3', md: '4 5', lg: '5', xl: '6'}}
27
+ * paddingInline='space-16'
28
+ * paddingInline='space-16 space-20'
29
+ * paddingInline={{xs: '0 space-8', sm: 'space-12', md: 'space-16 space-20', lg: 'space-20', xl: 'space-24'}}
30
30
  */
31
31
  paddingInline?: ResponsiveProp<
32
32
  SpacingScale | `${SpacingScale} ${SpacingScale}`
@@ -36,9 +36,9 @@ export type PrimitiveProps = {
36
36
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
37
37
  * or an object of spacing tokens for different breakpoints.
38
38
  * @example
39
- * paddingBlock='4'
40
- * paddingBlock='4 5'
41
- * paddingBlock={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
39
+ * paddingBlock='space-16'
40
+ * paddingBlock='space-16 space-20'
41
+ * paddingBlock={{xs: '0 space-8', sm: 'space-12', md: 'space-16 space-20', lg: 'space-20', xl: 'space-24'}}
42
42
  */
43
43
  paddingBlock?: ResponsiveProp<
44
44
  SpacingScale | `${SpacingScale} ${SpacingScale}`
@@ -48,8 +48,8 @@ export type PrimitiveProps = {
48
48
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
49
49
  * or an object of spacing tokens for different breakpoints.
50
50
  * @example
51
- * margin='4'
52
- * margin={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
51
+ * margin='space-16'
52
+ * margin={{xs: '0', sm: 'space-12', md: 'space-16', lg: 'space-20', xl: 'space-24'}}
53
53
  */
54
54
  margin?: ResponsiveProp<SpacingScale>;
55
55
  /**
@@ -57,9 +57,9 @@ export type PrimitiveProps = {
57
57
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
58
58
  * or an object of spacing tokens for different breakpoints.
59
59
  * @example
60
- * marginInline='4'
61
- * marginInline='4 5'
62
- * marginInline={{xs: '0 32', sm: '3', md: '4 5', lg: '5', xl: '6'}}
60
+ * marginInline='space-16'
61
+ * marginInline='space-16 space-20'
62
+ * marginInline={{xs: '0 space-8', sm: 'space-12', md: 'space-16 space-20', lg: 'space-20', xl: 'space-24'}}
63
63
  */
64
64
  marginInline?: ResponsiveProp<
65
65
  | SpacingScale
@@ -73,9 +73,9 @@ export type PrimitiveProps = {
73
73
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
74
74
  * or an object of spacing tokens for different breakpoints.
75
75
  * @example
76
- * marginBlock='4'
77
- * marginBlock='4 5'
78
- * marginBlock={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
76
+ * marginBlock='space-16'
77
+ * marginBlock='space-16 space-20'
78
+ * marginBlock={{xs: '0 space-8', sm: 'space-12', md: 'space-16 space-20', lg: 'space-20', xl: 'space-24'}}
79
79
  */
80
80
  marginBlock?: ResponsiveProp<
81
81
  | SpacingScale
@@ -119,9 +119,9 @@ export type PrimitiveProps = {
119
119
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
120
120
  * or an object of spacing tokens for different breakpoints.
121
121
  * @example
122
- * inset='4'
123
- * inset='4 5'
124
- * inset={{xs: '0 32', sm: '3', md: '4 5', lg: '5', xl: '6'}}
122
+ * inset='space-16'
123
+ * inset='space-16 space-20'
124
+ * inset={{xs: '0 space-8', sm: 'space-12', md: 'space-16 space-20', lg: 'space-20', xl: 'space-24'}}
125
125
  */
126
126
  inset?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
127
127
  /**
@@ -129,8 +129,8 @@ export type PrimitiveProps = {
129
129
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
130
130
  * or an object of spacing tokens for different breakpoints.
131
131
  * @example
132
- * top='4'
133
- * top={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
132
+ * top='space-16'
133
+ * top={{xs: 'space-8', sm: 'space-12', md: 'space-16', lg: 'space-20', xl: 'space-24'}}
134
134
  */
135
135
  top?: ResponsiveProp<SpacingScale>;
136
136
  /**
@@ -138,8 +138,8 @@ export type PrimitiveProps = {
138
138
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
139
139
  * or an object of spacing tokens for different breakpoints.
140
140
  * @example
141
- * right='4'
142
- * right={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
141
+ * right='space-16'
142
+ * right={{xs: 'space-8', sm: 'space-12', md: 'space-16', lg: 'space-20', xl: 'space-24'}}
143
143
  */
144
144
  right?: ResponsiveProp<SpacingScale>;
145
145
  /**
@@ -147,8 +147,8 @@ export type PrimitiveProps = {
147
147
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
148
148
  * or an object of spacing tokens for different breakpoints.
149
149
  * @example
150
- * bottom='4'
151
- * bottom={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
150
+ * bottom='space-16'
151
+ * bottom={{xs: 'space-8', sm: 'space-12', md: 'space-16', lg: 'space-20', xl: 'space-24'}}
152
152
  */
153
153
  bottom?: ResponsiveProp<SpacingScale>;
154
154
  /**
@@ -156,8 +156,8 @@ export type PrimitiveProps = {
156
156
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
157
157
  * or an object of spacing tokens for different breakpoints.
158
158
  * @example
159
- * left='4'
160
- * left={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
159
+ * left='space-16'
160
+ * left={{xs: 'space-8', sm: 'space-12', md: 'space-16', lg: 'space-20', xl: 'space-24'}}
161
161
  */
162
162
  left?: ResponsiveProp<SpacingScale>;
163
163
  /**
@@ -18,9 +18,9 @@ export interface BleedProps extends React.HTMLAttributes<HTMLDivElement> {
18
18
  * The `full` value is used to extend the margin to the full width of the parent.
19
19
  *
20
20
  * @example
21
- * marginInline='4'
22
- * marginInline='4 5'
23
- * marginInline={{xs: '0 32', sm: '3', md: '4 5', lg: '5', xl: '6', "2xl": '12'}}
21
+ * marginInline='space-16'
22
+ * marginInline='space-16 space-20'
23
+ * marginInline={{xs: '0 space-8', sm: 'space-12', md: 'space-16 space-20', lg: 'space-20', xl: 'space-24', "2xl": 'space-32'}}
24
24
  */
25
25
  marginInline?: ResponsiveProp<
26
26
  BleedSpacingInline | `${BleedSpacingInline} ${BleedSpacingInline}`
@@ -34,9 +34,9 @@ export interface BleedProps extends React.HTMLAttributes<HTMLDivElement> {
34
34
  * This prop does **not** accept the `full` value.
35
35
  *
36
36
  * @example
37
- * marginBlock='4'
38
- * marginBlock='4 5'
39
- * marginBlock={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6', "2xl": '12'}}
37
+ * marginBlock='space-16'
38
+ * marginBlock='space-16 space-20'
39
+ * marginBlock={{xs: '0 space-8', sm: 'space-12', md: 'space-16 space-20', lg: 'space-20', xl: 'space-24', "2xl": 'space-32'}}
40
40
  */
41
41
  marginBlock?: ResponsiveProp<
42
42
  BleedSpacingBlock | `${BleedSpacingBlock} ${BleedSpacingBlock}`
@@ -4,9 +4,9 @@ import type {
4
4
  BorderColorKeys,
5
5
  BorderColorWithRoleKeys,
6
6
  BorderRadiusKeys,
7
- DefaultBgKeys,
8
7
  ShadowKeys,
9
8
  StaticBgKeys,
9
+ StaticDefaultBgKeys,
10
10
  } from "@navikt/ds-tokens/types";
11
11
  import { Slot } from "../../slot/Slot";
12
12
  import { omit } from "../../util";
@@ -23,9 +23,9 @@ export type BoxNewProps = React.HTMLAttributes<HTMLDivElement> & {
23
23
  /**
24
24
  * CSS `background-color` property.
25
25
  * Accepts a [background/surface color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#afff774dad80).
26
- * @see {@link DefaultBgKeys} and {@link StaticBgKeys}
26
+ * @see {@link StaticDefaultBgKeys} and {@link StaticBgKeys}
27
27
  */
28
- background?: DefaultBgKeys | StaticBgKeys;
28
+ background?: StaticDefaultBgKeys | StaticBgKeys;
29
29
  /**
30
30
  * CSS `border-color` property.
31
31
  * Accepts a [border color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#adb1767e2f87).
@@ -26,9 +26,9 @@ export type HGridProps = React.HTMLAttributes<HTMLDivElement> & {
26
26
  * Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
27
27
  * or an object of spacing tokens for different breakpoints.
28
28
  * @example
29
- * gap="6"
30
- * gap="8 4"
31
- * gap={{ sm: "2", md: "2", lg: "6", xl: "6"}}
29
+ * gap="space-20"
30
+ * gap="space-32 space-16"
31
+ * gap={{ sm: "space-8", md: "space-12", lg: "space-20", xl: "space-24"}}
32
32
  */
33
33
  gap?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
34
34
  /**
@@ -47,9 +47,9 @@ export type StackProps = HTMLAttributes<HTMLDivElement> & {
47
47
  * or an object of spacing tokens for different breakpoints.
48
48
  *
49
49
  * @example
50
- * gap='4'
51
- * gap='8 4'
52
- * gap={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
50
+ * gap='space-16'
51
+ * gap='space-32 space-16'
52
+ * gap={{xs: 'space-8', sm: 'space-12', md: 'space-16', lg: 'space-20', xl: 'space-24'}}
53
53
  */
54
54
  gap?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
55
55
  /**