@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.
- package/README.md +2 -2
- package/cjs/alert/Alert.js +2 -2
- package/cjs/alert/Alert.js.map +1 -1
- package/cjs/chips/Removable.js +2 -2
- package/cjs/chips/Removable.js.map +1 -1
- package/cjs/copybutton/CopyButton.js +2 -2
- package/cjs/copybutton/CopyButton.js.map +1 -1
- package/cjs/date/context/useDateTranslationContext.d.ts +1 -1
- package/cjs/date/datepicker/DatePicker.js +3 -3
- package/cjs/date/datepicker/DatePicker.js.map +1 -1
- package/cjs/date/datepicker/DatePickerStandalone.js +3 -3
- package/cjs/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/cjs/date/hooks/useDatepicker.js +2 -2
- package/cjs/date/hooks/useDatepicker.js.map +1 -1
- package/cjs/date/hooks/useMonthPicker.js +2 -2
- package/cjs/date/hooks/useMonthPicker.js.map +1 -1
- package/cjs/date/hooks/useRangeDatepicker.js +2 -2
- package/cjs/date/hooks/useRangeDatepicker.js.map +1 -1
- package/cjs/date/monthpicker/MonthPicker.js +3 -3
- package/cjs/date/monthpicker/MonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/MonthPickerStandalone.js +3 -3
- package/cjs/date/monthpicker/MonthPickerStandalone.js.map +1 -1
- package/cjs/date/parts/DateWrapper.d.ts +1 -1
- package/cjs/date/parts/DateWrapper.js +2 -2
- package/cjs/date/parts/DateWrapper.js.map +1 -1
- package/cjs/expansion-card/ExpansionCardHeader.js +2 -2
- package/cjs/expansion-card/ExpansionCardHeader.js.map +1 -1
- package/cjs/form/ReadOnlyIcon.js +2 -2
- package/cjs/form/ReadOnlyIcon.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/AddNewOption.js +2 -2
- package/cjs/form/combobox/FilteredOptions/AddNewOption.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/LoadingMessage.js +2 -2
- package/cjs/form/combobox/FilteredOptions/LoadingMessage.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/MaxSelectedMessage.js +2 -2
- package/cjs/form/combobox/FilteredOptions/MaxSelectedMessage.js.map +1 -1
- package/cjs/form/error-summary/ErrorSummary.js +2 -2
- package/cjs/form/error-summary/ErrorSummary.js.map +1 -1
- package/cjs/form/file-upload/parts/dropzone/Dropzone.js +2 -2
- package/cjs/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
- package/cjs/form/file-upload/parts/item/Item.js +2 -2
- package/cjs/form/file-upload/parts/item/Item.js.map +1 -1
- package/cjs/form/form-progress/FormProgress.js +2 -2
- package/cjs/form/form-progress/FormProgress.js.map +1 -1
- package/cjs/form/form-summary/FormSummaryEditLink.js +2 -2
- package/cjs/form/form-summary/FormSummaryEditLink.js.map +1 -1
- package/cjs/form/search/Search.js +2 -2
- package/cjs/form/search/Search.js.map +1 -1
- package/cjs/form/search/SearchButton.js +2 -2
- package/cjs/form/search/SearchButton.js.map +1 -1
- package/cjs/form/textarea/TextareaCounter.js +2 -2
- package/cjs/form/textarea/TextareaCounter.js.map +1 -1
- package/cjs/guide-panel/Illustration.darkside.js +2 -2
- package/cjs/guide-panel/Illustration.darkside.js.map +1 -1
- package/cjs/guide-panel/Illustration.js +2 -2
- package/cjs/guide-panel/Illustration.js.map +1 -1
- package/cjs/help-text/HelpText.js +2 -2
- package/cjs/help-text/HelpText.js.map +1 -1
- package/cjs/layout/base/BasePrimitive.d.ts +27 -27
- package/cjs/layout/bleed/Bleed.d.ts +6 -6
- package/cjs/layout/box/Box.darkside.d.ts +3 -3
- package/cjs/layout/grid/HGrid.d.ts +3 -3
- package/cjs/layout/stack/Stack.d.ts +3 -3
- package/cjs/layout/utilities/css.d.ts +1 -1
- package/cjs/layout/utilities/css.js +49 -20
- package/cjs/layout/utilities/css.js.map +1 -1
- package/cjs/layout/utilities/types.d.ts +2 -2
- package/cjs/link/stories/RandomIcon.d.ts +2 -0
- package/cjs/link/stories/RandomIcon.js +39 -0
- package/cjs/link/stories/RandomIcon.js.map +1 -0
- package/cjs/loader/Loader.js +2 -2
- package/cjs/loader/Loader.js.map +1 -1
- package/cjs/modal/ModalHeader.js +2 -2
- package/cjs/modal/ModalHeader.js.map +1 -1
- package/cjs/pagination/Pagination.js +2 -2
- package/cjs/pagination/Pagination.js.map +1 -1
- package/cjs/progress-bar/ProgressBar.js +2 -2
- package/cjs/progress-bar/ProgressBar.js.map +1 -1
- package/cjs/table/ExpandableRow.js +2 -2
- package/cjs/table/ExpandableRow.js.map +1 -1
- package/cjs/tag/Tag.d.ts +1 -1
- package/cjs/timeline/AxisLabels.js +3 -3
- package/cjs/timeline/AxisLabels.js.map +1 -1
- package/cjs/timeline/Pin.js +2 -2
- package/cjs/timeline/Pin.js.map +1 -1
- package/cjs/timeline/TimelineRow.js +2 -2
- package/cjs/timeline/TimelineRow.js.map +1 -1
- package/cjs/timeline/period/ClickablePeriod.js +2 -2
- package/cjs/timeline/period/ClickablePeriod.js.map +1 -1
- package/cjs/timeline/period/NonClickablePeriod.js +2 -2
- package/cjs/timeline/period/NonClickablePeriod.js.map +1 -1
- package/cjs/timeline/utils/period.d.ts +1 -1
- package/cjs/timeline/zoom/ZoomButton.js +2 -2
- package/cjs/timeline/zoom/ZoomButton.js.map +1 -1
- package/cjs/util/i18n/i18n.hooks.d.ts +4 -0
- package/cjs/util/i18n/{i18n.context.js → i18n.hooks.js} +3 -7
- package/cjs/util/i18n/i18n.hooks.js.map +1 -0
- package/cjs/util/i18n/i18n.types.d.ts +4 -0
- package/cjs/util/i18n/locales/nb.d.ts +81 -4
- package/cjs/util/i18n/locales/nb.js +81 -4
- package/cjs/util/i18n/locales/nb.js.map +1 -1
- package/esm/alert/Alert.js +1 -1
- package/esm/alert/Alert.js.map +1 -1
- package/esm/chips/Removable.js +1 -1
- package/esm/chips/Removable.js.map +1 -1
- package/esm/copybutton/CopyButton.js +1 -1
- package/esm/copybutton/CopyButton.js.map +1 -1
- package/esm/date/context/useDateTranslationContext.d.ts +1 -1
- package/esm/date/datepicker/DatePicker.js +1 -1
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/DatePickerStandalone.js +1 -1
- package/esm/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/esm/date/hooks/useDatepicker.js +1 -1
- package/esm/date/hooks/useDatepicker.js.map +1 -1
- package/esm/date/hooks/useMonthPicker.js +1 -1
- package/esm/date/hooks/useMonthPicker.js.map +1 -1
- package/esm/date/hooks/useRangeDatepicker.js +1 -1
- package/esm/date/hooks/useRangeDatepicker.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.js +1 -1
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/date/monthpicker/MonthPickerStandalone.js +1 -1
- package/esm/date/monthpicker/MonthPickerStandalone.js.map +1 -1
- package/esm/date/parts/DateWrapper.d.ts +1 -1
- package/esm/date/parts/DateWrapper.js +1 -1
- package/esm/date/parts/DateWrapper.js.map +1 -1
- package/esm/expansion-card/ExpansionCardHeader.js +1 -1
- package/esm/expansion-card/ExpansionCardHeader.js.map +1 -1
- package/esm/form/ReadOnlyIcon.js +1 -1
- package/esm/form/ReadOnlyIcon.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/AddNewOption.js +1 -1
- package/esm/form/combobox/FilteredOptions/AddNewOption.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/LoadingMessage.js +1 -1
- package/esm/form/combobox/FilteredOptions/LoadingMessage.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/MaxSelectedMessage.js +1 -1
- package/esm/form/combobox/FilteredOptions/MaxSelectedMessage.js.map +1 -1
- package/esm/form/error-summary/ErrorSummary.js +1 -1
- package/esm/form/error-summary/ErrorSummary.js.map +1 -1
- package/esm/form/file-upload/parts/dropzone/Dropzone.js +1 -1
- package/esm/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
- package/esm/form/file-upload/parts/item/Item.js +1 -1
- package/esm/form/file-upload/parts/item/Item.js.map +1 -1
- package/esm/form/form-progress/FormProgress.js +1 -1
- package/esm/form/form-progress/FormProgress.js.map +1 -1
- package/esm/form/form-summary/FormSummaryEditLink.js +1 -1
- package/esm/form/form-summary/FormSummaryEditLink.js.map +1 -1
- package/esm/form/search/Search.js +1 -1
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/search/SearchButton.js +1 -1
- package/esm/form/search/SearchButton.js.map +1 -1
- package/esm/form/textarea/TextareaCounter.js +1 -1
- package/esm/form/textarea/TextareaCounter.js.map +1 -1
- package/esm/guide-panel/Illustration.darkside.js +1 -1
- package/esm/guide-panel/Illustration.darkside.js.map +1 -1
- package/esm/guide-panel/Illustration.js +1 -1
- package/esm/guide-panel/Illustration.js.map +1 -1
- package/esm/help-text/HelpText.js +1 -1
- package/esm/help-text/HelpText.js.map +1 -1
- package/esm/layout/base/BasePrimitive.d.ts +27 -27
- package/esm/layout/bleed/Bleed.d.ts +6 -6
- package/esm/layout/box/Box.darkside.d.ts +3 -3
- package/esm/layout/grid/HGrid.d.ts +3 -3
- package/esm/layout/stack/Stack.d.ts +3 -3
- package/esm/layout/utilities/css.d.ts +1 -1
- package/esm/layout/utilities/css.js +49 -20
- package/esm/layout/utilities/css.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +2 -2
- package/esm/link/stories/RandomIcon.d.ts +2 -0
- package/esm/link/stories/RandomIcon.js +9 -0
- package/esm/link/stories/RandomIcon.js.map +1 -0
- package/esm/loader/Loader.js +1 -1
- package/esm/loader/Loader.js.map +1 -1
- package/esm/modal/ModalHeader.js +1 -1
- package/esm/modal/ModalHeader.js.map +1 -1
- package/esm/pagination/Pagination.js +1 -1
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/progress-bar/ProgressBar.js +1 -1
- package/esm/progress-bar/ProgressBar.js.map +1 -1
- package/esm/table/ExpandableRow.js +1 -1
- package/esm/table/ExpandableRow.js.map +1 -1
- package/esm/tag/Tag.d.ts +1 -1
- package/esm/timeline/AxisLabels.js +1 -1
- package/esm/timeline/AxisLabels.js.map +1 -1
- package/esm/timeline/Pin.js +1 -1
- package/esm/timeline/Pin.js.map +1 -1
- package/esm/timeline/TimelineRow.js +1 -1
- package/esm/timeline/TimelineRow.js.map +1 -1
- package/esm/timeline/period/ClickablePeriod.js +1 -1
- package/esm/timeline/period/ClickablePeriod.js.map +1 -1
- package/esm/timeline/period/NonClickablePeriod.js +1 -1
- package/esm/timeline/period/NonClickablePeriod.js.map +1 -1
- package/esm/timeline/utils/period.d.ts +1 -1
- package/esm/timeline/zoom/ZoomButton.js +1 -1
- package/esm/timeline/zoom/ZoomButton.js.map +1 -1
- package/esm/util/i18n/i18n.hooks.d.ts +4 -0
- package/esm/util/i18n/{i18n.context.js → i18n.hooks.js} +3 -7
- package/esm/util/i18n/{i18n.context.js.map → i18n.hooks.js.map} +1 -1
- package/esm/util/i18n/i18n.types.d.ts +4 -0
- package/esm/util/i18n/locales/nb.d.ts +81 -4
- package/esm/util/i18n/locales/nb.js +81 -4
- package/esm/util/i18n/locales/nb.js.map +1 -1
- package/package.json +17 -12
- package/src/alert/Alert.tsx +1 -1
- package/src/chips/Removable.tsx +1 -1
- package/src/copybutton/CopyButton.tsx +1 -1
- package/src/date/context/useDateTranslationContext.ts +1 -1
- package/src/date/datepicker/DatePicker.tsx +1 -1
- package/src/date/datepicker/DatePickerStandalone.tsx +1 -1
- package/src/date/datepicker/datepicker.test.tsx +2 -5
- package/src/date/hooks/useDatepicker.tsx +1 -1
- package/src/date/hooks/useMonthPicker.tsx +1 -1
- package/src/date/hooks/useRangeDatepicker.test.tsx +5 -10
- package/src/date/hooks/useRangeDatepicker.tsx +1 -1
- package/src/date/monthpicker/MonthPicker.tsx +1 -1
- package/src/date/monthpicker/MonthPickerStandalone.tsx +1 -1
- package/src/date/parts/DateWrapper.tsx +2 -1
- package/src/expansion-card/ExpansionCardHeader.tsx +1 -1
- package/src/form/ReadOnlyIcon.tsx +1 -1
- package/src/form/combobox/FilteredOptions/AddNewOption.tsx +1 -1
- package/src/form/combobox/FilteredOptions/LoadingMessage.tsx +1 -1
- package/src/form/combobox/FilteredOptions/MaxSelectedMessage.tsx +1 -1
- package/src/form/error-summary/ErrorSummary.tsx +1 -1
- package/src/form/file-upload/parts/dropzone/Dropzone.tsx +1 -1
- package/src/form/file-upload/parts/item/Item.tsx +1 -1
- package/src/form/form-progress/FormProgress.tsx +1 -1
- package/src/form/form-summary/FormSummaryEditLink.tsx +1 -1
- package/src/form/search/Search.tsx +1 -1
- package/src/form/search/SearchButton.tsx +1 -1
- package/src/form/textarea/TextareaCounter.tsx +1 -1
- package/src/guide-panel/Illustration.darkside.tsx +1 -1
- package/src/guide-panel/Illustration.tsx +1 -1
- package/src/help-text/HelpText.tsx +1 -1
- package/src/layout/base/BasePrimitive.tsx +27 -27
- package/src/layout/bleed/Bleed.tsx +6 -6
- package/src/layout/box/Box.darkside.tsx +3 -3
- package/src/layout/grid/HGrid.tsx +3 -3
- package/src/layout/stack/Stack.tsx +3 -3
- package/src/layout/utilities/css.ts +56 -24
- package/src/layout/utilities/types.ts +3 -2
- package/src/loader/Loader.tsx +1 -1
- package/src/modal/ModalHeader.tsx +1 -1
- package/src/pagination/Pagination.tsx +1 -1
- package/src/progress-bar/ProgressBar.tsx +1 -1
- package/src/table/ExpandableRow.tsx +1 -1
- package/src/tabs/Tabs.test.tsx +4 -12
- package/src/tag/Tag.tsx +6 -6
- package/src/timeline/AxisLabels.tsx +2 -1
- package/src/timeline/Pin.tsx +1 -1
- package/src/timeline/TimelineRow.tsx +1 -1
- package/src/timeline/period/ClickablePeriod.tsx +1 -1
- package/src/timeline/period/NonClickablePeriod.tsx +1 -1
- package/src/timeline/utils/period.ts +1 -1
- package/src/timeline/zoom/ZoomButton.tsx +1 -1
- package/src/util/i18n/{i18n.context.test.tsx → i18n.hooks.test.tsx} +62 -3
- package/src/util/i18n/{i18n.context.ts → i18n.hooks.ts} +3 -19
- package/src/util/i18n/i18n.types.ts +12 -0
- package/cjs/modal/types.test-d.d.ts +0 -1
- package/cjs/modal/types.test-d.js +0 -67
- package/cjs/modal/types.test-d.js.map +0 -1
- package/cjs/util/i18n/i18n.context.d.ts +0 -9
- package/cjs/util/i18n/i18n.context.js.map +0 -1
- package/esm/modal/types.test-d.d.ts +0 -1
- package/esm/modal/types.test-d.js +0 -65
- package/esm/modal/types.test-d.js.map +0 -1
- 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.
|
|
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": "
|
|
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.
|
|
618
|
-
"@navikt/ds-tokens": "^7.9.
|
|
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": "
|
|
625
|
-
"@testing-library/jest-dom": "^
|
|
626
|
-
"@testing-library/react": "^
|
|
627
|
-
"@testing-library/user-event": "^14.2
|
|
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
|
-
"
|
|
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.
|
|
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
|
}
|
package/src/alert/Alert.tsx
CHANGED
|
@@ -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.
|
|
12
|
+
import { useI18n } from "../util/i18n/i18n.hooks";
|
|
13
13
|
|
|
14
14
|
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
15
|
/**
|
package/src/chips/Removable.tsx
CHANGED
|
@@ -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.
|
|
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.
|
|
13
|
+
import { useI18n } from "../util/i18n/i18n.hooks";
|
|
14
14
|
|
|
15
15
|
export interface CopyButtonProps
|
|
16
16
|
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
@@ -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.
|
|
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.
|
|
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 {
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
|
33
|
-
|
|
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
|
|
51
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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 {
|
|
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.
|
|
4
|
+
import { useI18n } from "../util/i18n/i18n.hooks";
|
|
5
5
|
import { ExpansionCardContext } from "./context";
|
|
6
6
|
|
|
7
7
|
export interface ExpansionCardHeaderProps
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
5
|
+
import { useI18n } from "../../util/i18n/i18n.hooks";
|
|
6
6
|
import type { TextareaProps } from "./Textarea";
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
@@ -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.
|
|
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='
|
|
19
|
-
* padding={{xs: '
|
|
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='
|
|
28
|
-
* paddingInline='
|
|
29
|
-
* paddingInline={{xs: '0
|
|
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='
|
|
40
|
-
* paddingBlock='
|
|
41
|
-
* paddingBlock={{xs: '
|
|
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='
|
|
52
|
-
* margin={{xs: '
|
|
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='
|
|
61
|
-
* marginInline='
|
|
62
|
-
* marginInline={{xs: '0
|
|
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='
|
|
77
|
-
* marginBlock='
|
|
78
|
-
* marginBlock={{xs: '
|
|
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='
|
|
123
|
-
* inset='
|
|
124
|
-
* inset={{xs: '0
|
|
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='
|
|
133
|
-
* top={{xs: '
|
|
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='
|
|
142
|
-
* right={{xs: '
|
|
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='
|
|
151
|
-
* bottom={{xs: '
|
|
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='
|
|
160
|
-
* left={{xs: '
|
|
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='
|
|
22
|
-
* marginInline='
|
|
23
|
-
* marginInline={{xs: '0
|
|
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='
|
|
38
|
-
* marginBlock='
|
|
39
|
-
* marginBlock={{xs: '
|
|
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
|
|
26
|
+
* @see {@link StaticDefaultBgKeys} and {@link StaticBgKeys}
|
|
27
27
|
*/
|
|
28
|
-
background?:
|
|
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="
|
|
30
|
-
* gap="
|
|
31
|
-
* gap={{ sm: "
|
|
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='
|
|
51
|
-
* gap='
|
|
52
|
-
* gap={{xs: '
|
|
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
|
/**
|