@norges-domstoler/dds-components 0.0.0-dev-20240306131021 → 0.0.0-dev-20240306143937
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -5690,6 +5690,7 @@ import { GregorianCalendar } from "@internationalized/date";
|
|
|
5690
5690
|
import {
|
|
5691
5691
|
useCalendar
|
|
5692
5692
|
} from "@react-aria/calendar";
|
|
5693
|
+
import { useLocale as useLocale2 } from "@react-aria/i18n";
|
|
5693
5694
|
import { useCalendarState } from "@react-stately/calendar";
|
|
5694
5695
|
import {
|
|
5695
5696
|
useContext as useContext5
|
|
@@ -5701,6 +5702,7 @@ import { getWeeksInMonth } from "@internationalized/date";
|
|
|
5701
5702
|
import {
|
|
5702
5703
|
useCalendarGrid
|
|
5703
5704
|
} from "@react-aria/calendar";
|
|
5705
|
+
import { useLocale } from "@react-aria/i18n";
|
|
5704
5706
|
import styled33 from "styled-components";
|
|
5705
5707
|
|
|
5706
5708
|
// src/components/date-inputs/DatePicker/Calendar/Calendar.tokens.ts
|
|
@@ -5997,11 +5999,12 @@ var WeekNumber = styled33.td`
|
|
|
5997
5999
|
justify-content: center;
|
|
5998
6000
|
`;
|
|
5999
6001
|
function CalendarGrid({ state, ...props }) {
|
|
6002
|
+
const { locale: locale2 } = useLocale();
|
|
6000
6003
|
const {
|
|
6001
6004
|
gridProps: { onKeyDown, ...gridProps },
|
|
6002
6005
|
headerProps
|
|
6003
6006
|
} = useCalendarGrid(props, state);
|
|
6004
|
-
const weeksInMonth = getWeeksInMonth(state.visibleRange.start,
|
|
6007
|
+
const weeksInMonth = getWeeksInMonth(state.visibleRange.start, locale2);
|
|
6005
6008
|
const weekDays = ["Ma", "Ti", "On", "To", "Fr", "L\xF8", "S\xF8"];
|
|
6006
6009
|
return /* @__PURE__ */ jsxs32(
|
|
6007
6010
|
"table",
|
|
@@ -6066,10 +6069,11 @@ function createCalendar(identifier) {
|
|
|
6066
6069
|
}
|
|
6067
6070
|
}
|
|
6068
6071
|
function Calendar(props) {
|
|
6072
|
+
const { locale: locale2 } = useLocale2();
|
|
6069
6073
|
const state = useCalendarState({
|
|
6070
6074
|
...props,
|
|
6071
6075
|
createCalendar,
|
|
6072
|
-
locale
|
|
6076
|
+
locale: locale2
|
|
6073
6077
|
});
|
|
6074
6078
|
const {
|
|
6075
6079
|
calendarProps,
|
|
@@ -6119,6 +6123,7 @@ Calendar.displayName = "Calendar";
|
|
|
6119
6123
|
|
|
6120
6124
|
// src/components/date-inputs/DatePicker/DatePicker.tsx
|
|
6121
6125
|
import { useDatePicker } from "@react-aria/datepicker";
|
|
6126
|
+
import { I18nProvider } from "@react-aria/i18n";
|
|
6122
6127
|
import { useDatePickerState } from "@react-stately/datepicker";
|
|
6123
6128
|
import { forwardRef as forwardRef23, useRef as useRef16 } from "react";
|
|
6124
6129
|
|
|
@@ -6129,6 +6134,7 @@ import {
|
|
|
6129
6134
|
import {
|
|
6130
6135
|
useDateField
|
|
6131
6136
|
} from "@react-aria/datepicker";
|
|
6137
|
+
import { useLocale as useLocale3 } from "@react-aria/i18n";
|
|
6132
6138
|
import { useDateFieldState } from "@react-stately/datepicker";
|
|
6133
6139
|
import {
|
|
6134
6140
|
forwardRef as forwardRef22,
|
|
@@ -6482,9 +6488,10 @@ function _DateField({
|
|
|
6482
6488
|
groupProps,
|
|
6483
6489
|
...props
|
|
6484
6490
|
}, forwardedRef) {
|
|
6491
|
+
const { locale: locale2 } = useLocale3();
|
|
6485
6492
|
const state = useDateFieldState({
|
|
6486
6493
|
...props,
|
|
6487
|
-
locale,
|
|
6494
|
+
locale: locale2,
|
|
6488
6495
|
createCalendar: createCalendar2
|
|
6489
6496
|
});
|
|
6490
6497
|
const ref = useRef14(null);
|
|
@@ -6565,7 +6572,7 @@ function _DatePicker({ errorMessage, componentSize, tip, style, width, ...props
|
|
|
6565
6572
|
state,
|
|
6566
6573
|
ref
|
|
6567
6574
|
);
|
|
6568
|
-
return /* @__PURE__ */ jsxs36(CalendarPopover, { isOpen: state.isOpen, onClose: state.close, children: [
|
|
6575
|
+
return /* @__PURE__ */ jsx200(I18nProvider, { locale, children: /* @__PURE__ */ jsxs36(CalendarPopover, { isOpen: state.isOpen, onClose: state.close, children: [
|
|
6569
6576
|
/* @__PURE__ */ jsx200(CalendarPopoverAnchor, { children: /* @__PURE__ */ jsx200(
|
|
6570
6577
|
DateField,
|
|
6571
6578
|
{
|
|
@@ -6583,7 +6590,7 @@ function _DatePicker({ errorMessage, componentSize, tip, style, width, ...props
|
|
|
6583
6590
|
}
|
|
6584
6591
|
) }),
|
|
6585
6592
|
/* @__PURE__ */ jsx200(CalendarPopoverContent, { children: /* @__PURE__ */ jsx200(Calendar, { ...calendarProps }) })
|
|
6586
|
-
] });
|
|
6593
|
+
] }) });
|
|
6587
6594
|
}
|
|
6588
6595
|
var DatePicker = forwardRef23(_DatePicker);
|
|
6589
6596
|
DatePicker.displayName = "DatePicker";
|