@norges-domstoler/dds-components 0.0.0-dev-20260817111025 → 0.0.0-dev-20260817113827
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.cjs +44 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.mts +5 -2
- package/dist/index.mjs +44 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -3157,6 +3157,20 @@ function OpenExternalIcon(props) {
|
|
|
3157
3157
|
});
|
|
3158
3158
|
}
|
|
3159
3159
|
//#endregion
|
|
3160
|
+
//#region src/components/Icon/icons/palette.tsx
|
|
3161
|
+
function PaletteIcon(props) {
|
|
3162
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SvgWrapper, {
|
|
3163
|
+
...props,
|
|
3164
|
+
children: [
|
|
3165
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M20.577 11.1187C20.577 10.0273 20.3577 9.02385 19.9178 8.09912C19.4684 7.15462 18.8683 6.34388 18.1111 5.65674C17.3498 4.97031 16.4653 4.42718 15.4432 4.03174C14.4268 3.63856 13.4091 3.44092 12.1951 3.44092C10.9856 3.44095 9.85953 3.66412 8.80841 4.11279L8.80548 4.11377C7.73888 4.56491 6.81308 5.17689 6.01837 5.95068C5.22538 6.72281 4.59792 7.63007 4.13068 8.67822C3.67065 9.71017 3.43636 10.8328 3.43634 12.0044C3.43634 13.1798 3.65837 14.2822 4.10626 15.3149C4.56105 16.3635 5.17676 17.275 5.95294 18.0513C6.72866 18.827 7.63963 19.4422 8.68732 19.897L9.07892 20.0542C9.99995 20.3955 10.9731 20.5679 11.9998 20.5679H12.1541C12.6372 20.5447 12.9693 20.4059 13.2068 20.1987C13.4172 20.0153 13.5906 19.6843 13.5906 19.0405C13.5906 18.7299 13.5118 18.4756 13.366 18.2554C13.236 18.0591 13.1236 17.8646 13.0418 17.6772C12.9831 17.5428 12.9272 17.3843 12.9031 17.2124L12.8904 17.0366L12.9051 16.853C12.9333 16.672 13.0033 16.5006 13.1102 16.3491L13.2088 16.23C13.4505 15.9794 13.7704 15.9136 14.0135 15.9136H15.7361C17.1186 15.9136 18.2613 15.4932 19.2 14.6685C20.0887 13.8833 20.5769 12.7416 20.577 11.1187ZM22.077 11.1187C22.0769 13.0672 21.4754 14.6616 20.1922 15.7944L20.1902 15.7954C18.9563 16.8795 17.4534 17.4136 15.7361 17.4136H14.6072C14.6101 17.418 14.6131 17.4228 14.616 17.4272C14.9335 17.9066 15.0906 18.4518 15.0906 19.0405C15.0906 19.9512 14.8373 20.7666 14.1932 21.3286C13.5993 21.8467 12.8457 22.0728 12.0086 22.0728H11.8318L11.8133 22.063C10.5096 22.04 9.26652 21.7795 8.09454 21.2759L8.09259 21.2749C6.87756 20.7479 5.80705 20.0265 4.8924 19.1118C3.97782 18.1972 3.25726 17.1266 2.73029 15.9116C2.19652 14.6809 1.93634 13.3743 1.93634 12.0044C1.93636 10.6306 2.21154 9.29848 2.76056 8.06689C3.30238 6.85159 4.03831 5.78604 4.97247 4.87646C5.78842 4.082 6.72004 3.43566 7.76642 2.93701L8.2215 2.73193C9.46946 2.19959 10.7967 1.94096 12.1951 1.94092C13.5902 1.94092 14.7915 2.17096 15.9842 2.63232C17.0227 3.03406 17.951 3.57308 18.7713 4.24658L19.116 4.54346L19.118 4.54443C20.0234 5.36583 20.7403 6.33655 21.2723 7.45459C21.8141 8.59349 22.077 9.81906 22.077 11.1187Z" }),
|
|
3166
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M7.40455 12.0046C7.66819 11.7409 7.8 11.4046 7.8 11.0046C7.8 10.6046 7.66819 10.2682 7.40455 10.0046C7.14091 9.74095 6.80455 9.60913 6.40455 9.60913C6.00455 9.60913 5.66818 9.74095 5.40455 10.0046C5.14091 10.2682 5.00909 10.6046 5.00909 11.0046C5.00909 11.4046 5.14091 11.7409 5.40455 12.0046C5.66818 12.2682 6.00455 12.4 6.40455 12.4C6.80455 12.4 7.14091 12.2682 7.40455 12.0046Z" }),
|
|
3167
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10.3818 8.04096C10.6455 7.77733 10.7773 7.44096 10.7773 7.04096C10.7773 6.64096 10.6455 6.3046 10.3818 6.04096C10.1182 5.77733 9.78184 5.64551 9.38184 5.64551C8.98184 5.64551 8.64548 5.77733 8.38184 6.04096C8.11821 6.3046 7.98639 6.64096 7.98639 7.04096C7.98639 7.44096 8.11821 7.77733 8.38184 8.04096C8.64548 8.3046 8.98184 8.43642 9.38184 8.43642C9.78184 8.43642 10.1182 8.3046 10.3818 8.04096Z" }),
|
|
3168
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M15.3364 8.04096C15.6 7.77733 15.7318 7.44096 15.7318 7.04096C15.7318 6.64096 15.6 6.3046 15.3364 6.04096C15.0727 5.77733 14.7364 5.64551 14.3364 5.64551C13.9364 5.64551 13.6 5.77733 13.3364 6.04096C13.0727 6.3046 12.9409 6.64096 12.9409 7.04096C12.9409 7.44096 13.0727 7.77733 13.3364 8.04096C13.6 8.3046 13.9364 8.43642 14.3364 8.43642C14.7364 8.43642 15.0727 8.3046 15.3364 8.04096Z" }),
|
|
3169
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18.3137 12.0046C18.5773 11.7409 18.7091 11.4046 18.7091 11.0046C18.7091 10.6046 18.5773 10.2682 18.3137 10.0046C18.05 9.74095 17.7137 9.60913 17.3137 9.60913C16.9137 9.60913 16.5773 9.74095 16.3137 10.0046C16.05 10.2682 15.9182 10.6046 15.9182 11.0046C15.9182 11.4046 16.05 11.7409 16.3137 12.0046C16.5773 12.2682 16.9137 12.4 17.3137 12.4C17.7137 12.4 18.05 12.2682 18.3137 12.0046Z" })
|
|
3170
|
+
]
|
|
3171
|
+
});
|
|
3172
|
+
}
|
|
3173
|
+
//#endregion
|
|
3160
3174
|
//#region src/components/Icon/icons/panelLeft.tsx
|
|
3161
3175
|
function PanelLeftIcon(props) {
|
|
3162
3176
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SvgWrapper, {
|
|
@@ -3925,6 +3939,7 @@ var icons_exports = /* @__PURE__ */ __exportAll({
|
|
|
3925
3939
|
NotificationsOffIcon: () => NotificationsOffIcon,
|
|
3926
3940
|
OnlineMeetingIcon: () => OnlineMeetingIcon,
|
|
3927
3941
|
OpenExternalIcon: () => OpenExternalIcon,
|
|
3942
|
+
PaletteIcon: () => PaletteIcon,
|
|
3928
3943
|
PanelLeftIcon: () => PanelLeftIcon,
|
|
3929
3944
|
PaperPlaneIcon: () => PaperPlaneIcon,
|
|
3930
3945
|
PayoutIcon: () => PayoutIcon,
|
|
@@ -5801,7 +5816,8 @@ const CalendarPopoverContext = (0, react.createContext)({
|
|
|
5801
5816
|
closeButtonRef: null,
|
|
5802
5817
|
isOpen: false,
|
|
5803
5818
|
onClose: () => null,
|
|
5804
|
-
showWeekNumbers: true
|
|
5819
|
+
showWeekNumbers: true,
|
|
5820
|
+
closeOtherCalendars: () => null
|
|
5805
5821
|
});
|
|
5806
5822
|
const CalendarPopover = ({ children, onClose, ...props }) => {
|
|
5807
5823
|
const anchorRef = (0, react.useRef)(null);
|
|
@@ -5818,9 +5834,12 @@ const CalendarPopover = ({ children, onClose, ...props }) => {
|
|
|
5818
5834
|
});
|
|
5819
5835
|
};
|
|
5820
5836
|
const CalendarPopoverAnchor = ({ children }) => {
|
|
5821
|
-
const { anchorRef } = (0, react.useContext)(CalendarPopoverContext);
|
|
5837
|
+
const { anchorRef, closeOtherCalendars } = (0, react.useContext)(CalendarPopoverContext);
|
|
5822
5838
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5823
5839
|
ref: anchorRef ?? void 0,
|
|
5840
|
+
onFocusCapture: closeOtherCalendars,
|
|
5841
|
+
onMouseDown: closeOtherCalendars,
|
|
5842
|
+
onPointerDown: closeOtherCalendars,
|
|
5824
5843
|
children
|
|
5825
5844
|
});
|
|
5826
5845
|
};
|
|
@@ -6498,10 +6517,30 @@ function createDOMRef(ref) {
|
|
|
6498
6517
|
const refIsFocusable = (ref) => {
|
|
6499
6518
|
return typeof ref === "object" && ref !== null && "focus" in ref;
|
|
6500
6519
|
};
|
|
6520
|
+
const closeRegistry = /* @__PURE__ */ new Map();
|
|
6521
|
+
const closeOtherCalendars = (currentInstanceId) => {
|
|
6522
|
+
for (const [instanceId, close] of closeRegistry.entries()) if (instanceId !== currentInstanceId) close();
|
|
6523
|
+
};
|
|
6501
6524
|
function DatePicker({ errorMessage, componentSize, tip, style, width, smallScreenBreakpoint, showWeekNumbers = true, clearable = false, ref, ...props }) {
|
|
6525
|
+
const instanceIdRef = (0, react.useRef)(Symbol("datePickerInstance"));
|
|
6526
|
+
const closeOthers = () => {
|
|
6527
|
+
closeOtherCalendars(instanceIdRef.current);
|
|
6528
|
+
};
|
|
6502
6529
|
const lang = useLanguage();
|
|
6503
6530
|
if (!lang) throw new Error("DatePicker must be used within a DdsProvider");
|
|
6504
|
-
const state = (0, _react_stately_datepicker.useDatePickerState)(
|
|
6531
|
+
const state = (0, _react_stately_datepicker.useDatePickerState)({
|
|
6532
|
+
...props,
|
|
6533
|
+
onOpenChange: (isOpen) => {
|
|
6534
|
+
if (isOpen) closeOthers();
|
|
6535
|
+
props.onOpenChange?.(isOpen);
|
|
6536
|
+
}
|
|
6537
|
+
});
|
|
6538
|
+
(0, react.useEffect)(() => {
|
|
6539
|
+
closeRegistry.set(instanceIdRef.current, state.close);
|
|
6540
|
+
return () => {
|
|
6541
|
+
closeRegistry.delete(instanceIdRef.current);
|
|
6542
|
+
};
|
|
6543
|
+
}, [state.close]);
|
|
6505
6544
|
const domRef = useFocusManagerRef(ref && refIsFocusable(ref) ? ref : null);
|
|
6506
6545
|
const internalRef = (0, react.useRef)(null);
|
|
6507
6546
|
const combinedRef = useCombinedRef(internalRef, domRef);
|
|
@@ -6520,6 +6559,7 @@ function DatePicker({ errorMessage, componentSize, tip, style, width, smallScree
|
|
|
6520
6559
|
isOpen: state.isOpen,
|
|
6521
6560
|
onClose: state.close,
|
|
6522
6561
|
showWeekNumbers,
|
|
6562
|
+
closeOtherCalendars: closeOthers,
|
|
6523
6563
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarPopoverAnchor, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DateField, {
|
|
6524
6564
|
...fieldProps,
|
|
6525
6565
|
groupProps,
|
|
@@ -13225,6 +13265,7 @@ exports.OverflowMenuListHeader = OverflowMenuListHeader;
|
|
|
13225
13265
|
exports.OverflowMenuSpan = OverflowMenuSpan;
|
|
13226
13266
|
exports.OverflowMenuToggle = OverflowMenuToggle;
|
|
13227
13267
|
exports.Pagination = Pagination;
|
|
13268
|
+
exports.PaletteIcon = PaletteIcon;
|
|
13228
13269
|
exports.PanelLeftIcon = PanelLeftIcon;
|
|
13229
13270
|
exports.Paper = Paper;
|
|
13230
13271
|
exports.PaperPlaneIcon = PaperPlaneIcon;
|