@navikt/ds-react 1.3.20 → 1.3.21
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/cjs/date/datepicker/DatePicker.js +3 -3
- package/cjs/date/datepicker/DatePickerStandalone.js +3 -3
- package/cjs/date/datepicker/DayButton.js +5 -2
- package/cjs/date/datepicker/caption/DropdownCaption.js +5 -3
- package/cjs/date/hooks/useDatepicker.js +8 -4
- package/cjs/date/hooks/useRangeDatepicker.js +12 -8
- package/cjs/date/hooks/useSharedMonthContext.js +6 -2
- package/cjs/date/monthpicker/MonthButton.js +14 -10
- package/cjs/date/monthpicker/MonthCaption.js +9 -6
- package/cjs/date/monthpicker/MonthSelector.js +11 -8
- package/cjs/date/utils/check-dates.js +6 -2
- package/cjs/date/utils/dates-disabled.js +6 -3
- package/cjs/date/utils/format-date.js +5 -2
- package/cjs/date/utils/get-dates.js +20 -13
- package/cjs/date/utils/get-initial-year.js +5 -2
- package/cjs/date/utils/is-match.js +20 -14
- package/cjs/date/utils/navigation.js +24 -21
- package/cjs/date/utils/parse-date.js +5 -2
- 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/datepicker/DayButton.js +1 -1
- package/esm/date/datepicker/DayButton.js.map +1 -1
- package/esm/date/datepicker/caption/DropdownCaption.js +3 -1
- package/esm/date/datepicker/caption/DropdownCaption.js.map +1 -1
- package/esm/date/hooks/useDatepicker.js +2 -1
- package/esm/date/hooks/useDatepicker.js.map +1 -1
- package/esm/date/hooks/useRangeDatepicker.js +2 -1
- package/esm/date/hooks/useRangeDatepicker.js.map +1 -1
- package/esm/date/hooks/useSharedMonthContext.js +2 -1
- package/esm/date/hooks/useSharedMonthContext.js.map +1 -1
- package/esm/date/monthpicker/MonthButton.js +5 -1
- package/esm/date/monthpicker/MonthButton.js.map +1 -1
- package/esm/date/monthpicker/MonthCaption.js +4 -1
- package/esm/date/monthpicker/MonthCaption.js.map +1 -1
- package/esm/date/monthpicker/MonthSelector.js +4 -1
- package/esm/date/monthpicker/MonthSelector.js.map +1 -1
- package/esm/date/utils/check-dates.js +2 -1
- package/esm/date/utils/check-dates.js.map +1 -1
- package/esm/date/utils/dates-disabled.js +1 -1
- package/esm/date/utils/dates-disabled.js.map +1 -1
- package/esm/date/utils/format-date.js +1 -1
- package/esm/date/utils/format-date.js.map +1 -1
- package/esm/date/utils/get-dates.js +5 -1
- package/esm/date/utils/get-dates.js.map +1 -1
- package/esm/date/utils/get-initial-year.js +1 -1
- package/esm/date/utils/get-initial-year.js.map +1 -1
- package/esm/date/utils/is-match.js +4 -1
- package/esm/date/utils/is-match.js.map +1 -1
- package/esm/date/utils/navigation.js +1 -1
- package/esm/date/utils/navigation.js.map +1 -1
- package/esm/date/utils/parse-date.js +1 -1
- package/esm/date/utils/parse-date.js.map +1 -1
- package/package.json +3 -4
- package/src/date/datepicker/DatePicker.tsx +1 -1
- package/src/date/datepicker/DatePickerStandalone.tsx +1 -1
- package/src/date/datepicker/DayButton.tsx +1 -1
- package/src/date/datepicker/caption/DropdownCaption.tsx +3 -1
- package/src/date/datepicker/datepicker.stories.tsx +1 -1
- package/src/date/hooks/useDatepicker.tsx +2 -1
- package/src/date/hooks/useRangeDatepicker.tsx +2 -1
- package/src/date/hooks/useSharedMonthContext.tsx +2 -1
- package/src/date/monthpicker/MonthButton.tsx +5 -7
- package/src/date/monthpicker/MonthCaption.tsx +4 -1
- package/src/date/monthpicker/MonthSelector.tsx +4 -1
- package/src/date/utils/__tests__/get-initial-year.test.ts +1 -1
- package/src/date/utils/__tests__/parse-dates.test.ts +2 -1
- package/src/date/utils/check-dates.ts +2 -1
- package/src/date/utils/dates-disabled.ts +1 -1
- package/src/date/utils/format-date.ts +1 -1
- package/src/date/utils/get-dates.ts +5 -7
- package/src/date/utils/get-initial-year.ts +1 -1
- package/src/date/utils/is-match.ts +5 -6
- package/src/date/utils/navigation.ts +1 -1
- package/src/date/utils/parse-date.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-date.js","sourceRoot":"","sources":["../../../src/date/utils/parse-date.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"parse-date.js","sourceRoot":"","sources":["../../../src/date/utils/parse-date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,gBAAgB,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAEhC,MAAM,CAAC,MAAM,6BAA6B,GAAG,YAAY,CAAC;AAE1D,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAS,CAAC;AAExD,MAAM,0BAA0B,GAAG;IACjC,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,UAAU;IACV,UAAU;IACV,6BAA6B;IAC7B,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,UAAU;CACX,CAAC;AAEF,MAAM,2BAA2B,GAAG;IAClC,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;IACT,8BAA8B;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,IAAY,EACZ,KAAW,EACX,MAAc,EACd,IAAsB,EACtB,EAAE;IACF,IAAI,MAAM,CAAC;IACX,MAAM,eAAe,GACnB,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,2BAA2B,CAAC;IAC7E,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE;QACpC,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAChD,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;YACvB,OAAO,MAAM,CAAC;SACf;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.21",
|
|
4
4
|
"description": "NAV designsystem react components",
|
|
5
5
|
"author": "NAV Designsystem team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@floating-ui/react-dom-interactions": "0.9.2",
|
|
39
|
-
"@navikt/ds-icons": "^1.3.
|
|
39
|
+
"@navikt/ds-icons": "^1.3.21",
|
|
40
40
|
"@radix-ui/react-tabs": "1.0.0",
|
|
41
41
|
"@radix-ui/react-toggle-group": "1.0.0",
|
|
42
42
|
"clsx": "^1.2.1",
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
"faker": "5.5.3",
|
|
59
59
|
"fast-glob": "3.2.11",
|
|
60
60
|
"jest": "^27.5.0",
|
|
61
|
-
"react-docgen-typescript": "2.2.2",
|
|
62
61
|
"react-dom": "^18.0.0",
|
|
63
62
|
"react-router-dom": "^6.3.0",
|
|
64
63
|
"rimraf": "3.0.2",
|
|
@@ -76,5 +75,5 @@
|
|
|
76
75
|
"optional": true
|
|
77
76
|
}
|
|
78
77
|
},
|
|
79
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "d94ace2aee4ef3862a1d1f8a52f984b23b0fff60"
|
|
80
79
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Left, Right } from "@navikt/ds-icons";
|
|
2
|
-
import
|
|
2
|
+
import setMonth from "date-fns/setMonth";
|
|
3
|
+
import setYear from "date-fns/setYear";
|
|
4
|
+
import startOfMonth from "date-fns/startOfMonth";
|
|
3
5
|
import React from "react";
|
|
4
6
|
import { CaptionProps, useDayPicker, useNavigation } from "react-day-picker";
|
|
5
7
|
import { Button, Select } from "../../..";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import differenceInCalendarDays from "date-fns/differenceInCalendarDays";
|
|
2
|
+
import isWeekend from "date-fns/isWeekend";
|
|
2
3
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
4
|
import { DayClickEventHandler, isMatch } from "react-day-picker";
|
|
4
5
|
import { DateInputProps } from "../DateInput";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import differenceInCalendarDays from "date-fns/differenceInCalendarDays";
|
|
2
|
+
import isWeekend from "date-fns/isWeekend";
|
|
2
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
4
|
import { DateRange, isMatch } from "react-day-picker";
|
|
4
5
|
import { DateInputProps } from "../DateInput";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import setYear from "date-fns/setYear";
|
|
2
|
+
import startOfMonth from "date-fns/startOfMonth";
|
|
2
3
|
import React, { createContext, useContext, useState } from "react";
|
|
3
4
|
import { useDayPicker } from "react-day-picker";
|
|
4
5
|
import { getInitialYear, Matcher } from "../utils";
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
setYear,
|
|
8
|
-
} from "date-fns";
|
|
2
|
+
import compareAsc from "date-fns/compareAsc";
|
|
3
|
+
import compareDesc from "date-fns/compareDesc";
|
|
4
|
+
import format from "date-fns/format";
|
|
5
|
+
import isSameMonth from "date-fns/isSameMonth";
|
|
6
|
+
import setYear from "date-fns/setYear";
|
|
9
7
|
import React, { useEffect, useRef } from "react";
|
|
10
8
|
import { useDayPicker } from "react-day-picker";
|
|
11
9
|
import { useSharedMonthContext } from "../hooks";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Left, Right } from "@navikt/ds-icons";
|
|
2
|
-
import
|
|
2
|
+
import isSameYear from "date-fns/isSameYear";
|
|
3
|
+
import setYear from "date-fns/setYear";
|
|
4
|
+
import startOfMonth from "date-fns/startOfMonth";
|
|
5
|
+
import startOfYear from "date-fns/startOfYear";
|
|
3
6
|
import React from "react";
|
|
4
7
|
import { useDayPicker } from "react-day-picker";
|
|
5
8
|
import { Button, Select } from "../..";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isSameMonth from "date-fns/isSameMonth";
|
|
2
|
+
import setMonth from "date-fns/setMonth";
|
|
3
|
+
import setYear from "date-fns/setYear";
|
|
4
|
+
import startOfMonth from "date-fns/startOfMonth";
|
|
2
5
|
import React, { useState } from "react";
|
|
3
6
|
import { BodyShort } from "../..";
|
|
4
7
|
import { useSharedMonthContext } from "../hooks";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { parseDate } from "..";
|
|
2
2
|
import { isValidDate } from "..";
|
|
3
3
|
import nb from "date-fns/locale/nb";
|
|
4
|
-
import
|
|
4
|
+
import getMonth from "date-fns/getMonth";
|
|
5
|
+
import getYear from "date-fns/getYear";
|
|
5
6
|
|
|
6
7
|
const check = (inp: string) =>
|
|
7
8
|
expect(isValidDate(parseDate(inp, new Date(), nb, "date")));
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
startOfYear,
|
|
7
|
-
} from "date-fns";
|
|
1
|
+
import isSameYear from "date-fns/isSameYear";
|
|
2
|
+
import setMonth from "date-fns/setMonth";
|
|
3
|
+
import setYear from "date-fns/setYear";
|
|
4
|
+
import startOfMonth from "date-fns/startOfMonth";
|
|
5
|
+
import startOfYear from "date-fns/startOfYear";
|
|
8
6
|
|
|
9
7
|
export const getMonths = (start: Date, end: Date, current: Date): Date[] => {
|
|
10
8
|
const dropdownMonths: Date[] = [];
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "date-fns";
|
|
1
|
+
import isSameDay from "date-fns/isSameDay";
|
|
2
|
+
import isDate from "date-fns/isDate";
|
|
3
|
+
import differenceInCalendarDays from "date-fns/differenceInCalendarDays";
|
|
4
|
+
import isSameMonth from "date-fns/isSameMonth";
|
|
5
|
+
|
|
7
6
|
import {
|
|
8
7
|
DateAfter,
|
|
9
8
|
DateBefore,
|