@norges-domstoler/dds-components 13.10.5 → 13.11.0
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.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1325,6 +1325,8 @@ type ModalProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
|
1325
1325
|
header?: string | ReactNode;
|
|
1326
1326
|
/**Ref som brukes til returnering av fokus. */
|
|
1327
1327
|
triggerRef?: RefObject<HTMLElement>;
|
|
1328
|
+
/**Ref som skal motta fokus når Modal åpnes. Hvis utelatt blir Modal fokusert. */
|
|
1329
|
+
initialFocusRef?: RefObject<HTMLElement>;
|
|
1328
1330
|
}>;
|
|
1329
1331
|
declare const Modal: react.ForwardRefExoticComponent<Pick<react.HTMLAttributes<HTMLDivElement>, "className" | "id"> & {
|
|
1330
1332
|
/**Spesifiserer om modal skal vises. */
|
|
@@ -1337,6 +1339,8 @@ declare const Modal: react.ForwardRefExoticComponent<Pick<react.HTMLAttributes<H
|
|
|
1337
1339
|
header?: string | ReactNode;
|
|
1338
1340
|
/**Ref som brukes til returnering av fokus. */
|
|
1339
1341
|
triggerRef?: RefObject<HTMLElement> | undefined;
|
|
1342
|
+
/**Ref som skal motta fokus når Modal åpnes. Hvis utelatt blir Modal fokusert. */
|
|
1343
|
+
initialFocusRef?: RefObject<HTMLElement> | undefined;
|
|
1340
1344
|
} & {
|
|
1341
1345
|
children?: ReactNode;
|
|
1342
1346
|
} & {
|
package/dist/index.d.ts
CHANGED
|
@@ -1325,6 +1325,8 @@ type ModalProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
|
1325
1325
|
header?: string | ReactNode;
|
|
1326
1326
|
/**Ref som brukes til returnering av fokus. */
|
|
1327
1327
|
triggerRef?: RefObject<HTMLElement>;
|
|
1328
|
+
/**Ref som skal motta fokus når Modal åpnes. Hvis utelatt blir Modal fokusert. */
|
|
1329
|
+
initialFocusRef?: RefObject<HTMLElement>;
|
|
1328
1330
|
}>;
|
|
1329
1331
|
declare const Modal: react.ForwardRefExoticComponent<Pick<react.HTMLAttributes<HTMLDivElement>, "className" | "id"> & {
|
|
1330
1332
|
/**Spesifiserer om modal skal vises. */
|
|
@@ -1337,6 +1339,8 @@ declare const Modal: react.ForwardRefExoticComponent<Pick<react.HTMLAttributes<H
|
|
|
1337
1339
|
header?: string | ReactNode;
|
|
1338
1340
|
/**Ref som brukes til returnering av fokus. */
|
|
1339
1341
|
triggerRef?: RefObject<HTMLElement> | undefined;
|
|
1342
|
+
/**Ref som skal motta fokus når Modal åpnes. Hvis utelatt blir Modal fokusert. */
|
|
1343
|
+
initialFocusRef?: RefObject<HTMLElement> | undefined;
|
|
1340
1344
|
} & {
|
|
1341
1345
|
children?: ReactNode;
|
|
1342
1346
|
} & {
|
package/dist/index.js
CHANGED
|
@@ -7129,6 +7129,7 @@ var Modal = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
7129
7129
|
onClose,
|
|
7130
7130
|
id,
|
|
7131
7131
|
triggerRef,
|
|
7132
|
+
initialFocusRef,
|
|
7132
7133
|
className,
|
|
7133
7134
|
htmlProps,
|
|
7134
7135
|
...rest
|
|
@@ -7136,7 +7137,7 @@ var Modal = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
7136
7137
|
const generatedId = (0, import_react57.useId)();
|
|
7137
7138
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
7138
7139
|
const headerId = `${modalId}-header`;
|
|
7139
|
-
const modalRef = (0, import_dds_core60.useFocusTrap)(isOpen);
|
|
7140
|
+
const modalRef = (0, import_dds_core60.useFocusTrap)(isOpen, initialFocusRef);
|
|
7140
7141
|
const combinedRef = (0, import_dds_core60.useCombinedRef)(ref, modalRef);
|
|
7141
7142
|
const handleClose = () => {
|
|
7142
7143
|
var _a;
|