@navikt/ds-react 1.3.16 → 1.3.18
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/_docs.json +19 -0
- package/cjs/modal/Modal.js +2 -2
- package/esm/modal/Modal.d.ts +4 -0
- package/esm/modal/Modal.js +2 -2
- package/esm/modal/Modal.js.map +1 -1
- package/package.json +3 -3
- package/src/modal/Modal.tsx +6 -1
package/_docs.json
CHANGED
|
@@ -3683,6 +3683,25 @@
|
|
|
3683
3683
|
"name": "string"
|
|
3684
3684
|
}
|
|
3685
3685
|
},
|
|
3686
|
+
"overlayClassName": {
|
|
3687
|
+
"defaultValue": null,
|
|
3688
|
+
"description": "User defined classname for modal",
|
|
3689
|
+
"name": "overlayClassName",
|
|
3690
|
+
"parent": {
|
|
3691
|
+
"fileName": "src/modal/Modal.tsx",
|
|
3692
|
+
"name": "ModalProps"
|
|
3693
|
+
},
|
|
3694
|
+
"declarations": [
|
|
3695
|
+
{
|
|
3696
|
+
"fileName": "src/modal/Modal.tsx",
|
|
3697
|
+
"name": "ModalProps"
|
|
3698
|
+
}
|
|
3699
|
+
],
|
|
3700
|
+
"required": false,
|
|
3701
|
+
"type": {
|
|
3702
|
+
"name": "string"
|
|
3703
|
+
}
|
|
3704
|
+
},
|
|
3686
3705
|
"closeButton": {
|
|
3687
3706
|
"defaultValue": {
|
|
3688
3707
|
"value": "true"
|
package/cjs/modal/Modal.js
CHANGED
|
@@ -45,7 +45,7 @@ const ds_icons_1 = require("@navikt/ds-icons");
|
|
|
45
45
|
const __1 = require("..");
|
|
46
46
|
const ModalContent_1 = __importDefault(require("./ModalContent"));
|
|
47
47
|
exports.Modal = (0, react_1.forwardRef)((_a, ref) => {
|
|
48
|
-
var { children, open, onClose, className, shouldCloseOnOverlayClick = true, closeButton = true, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, "aria-modal": ariaModal, "aria-label": contentLabel, style } = _a, rest = __rest(_a, ["children", "open", "onClose", "className", "shouldCloseOnOverlayClick", "closeButton", "aria-describedby", "aria-labelledby", "aria-modal", "aria-label", "style"]);
|
|
48
|
+
var { children, open, onClose, className, overlayClassName, shouldCloseOnOverlayClick = true, closeButton = true, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, "aria-modal": ariaModal, "aria-label": contentLabel, style } = _a, rest = __rest(_a, ["children", "open", "onClose", "className", "overlayClassName", "shouldCloseOnOverlayClick", "closeButton", "aria-describedby", "aria-labelledby", "aria-modal", "aria-label", "style"]);
|
|
49
49
|
const modalRef = (0, react_1.useRef)(null);
|
|
50
50
|
const mergedRef = (0, react_1.useMemo)(() => (0, __1.mergeRefs)([modalRef, ref]), [ref]);
|
|
51
51
|
const buttonRef = (0, react_1.useRef)(null);
|
|
@@ -57,7 +57,7 @@ exports.Modal = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
57
57
|
buttonRef.current.focus();
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
return (react_1.default.createElement(react_modal_1.default, Object.assign({}, rest, { style: style, isOpen: open, ref: mergedRef, className: (0, clsx_1.default)("navds-modal", className), overlayClassName: "navds-modal__overlay", shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, onRequestClose: (e) => onModalCloseRequest(e), aria: {
|
|
60
|
+
return (react_1.default.createElement(react_modal_1.default, Object.assign({}, rest, { style: style, isOpen: open, ref: mergedRef, className: (0, clsx_1.default)("navds-modal", className), overlayClassName: (0, clsx_1.default)("navds-modal__overlay", overlayClassName), shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, onRequestClose: (e) => onModalCloseRequest(e), aria: {
|
|
61
61
|
describedby: ariaDescribedBy,
|
|
62
62
|
labelledby: ariaLabelledBy,
|
|
63
63
|
modal: ariaModal,
|
package/esm/modal/Modal.d.ts
CHANGED
package/esm/modal/Modal.js
CHANGED
|
@@ -16,7 +16,7 @@ import { Close } from "@navikt/ds-icons";
|
|
|
16
16
|
import { Button, mergeRefs } from "..";
|
|
17
17
|
import ModalContent from "./ModalContent";
|
|
18
18
|
export const Modal = forwardRef((_a, ref) => {
|
|
19
|
-
var { children, open, onClose, className, shouldCloseOnOverlayClick = true, closeButton = true, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, "aria-modal": ariaModal, "aria-label": contentLabel, style } = _a, rest = __rest(_a, ["children", "open", "onClose", "className", "shouldCloseOnOverlayClick", "closeButton", "aria-describedby", "aria-labelledby", "aria-modal", "aria-label", "style"]);
|
|
19
|
+
var { children, open, onClose, className, overlayClassName, shouldCloseOnOverlayClick = true, closeButton = true, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, "aria-modal": ariaModal, "aria-label": contentLabel, style } = _a, rest = __rest(_a, ["children", "open", "onClose", "className", "overlayClassName", "shouldCloseOnOverlayClick", "closeButton", "aria-describedby", "aria-labelledby", "aria-modal", "aria-label", "style"]);
|
|
20
20
|
const modalRef = useRef(null);
|
|
21
21
|
const mergedRef = useMemo(() => mergeRefs([modalRef, ref]), [ref]);
|
|
22
22
|
const buttonRef = useRef(null);
|
|
@@ -28,7 +28,7 @@ export const Modal = forwardRef((_a, ref) => {
|
|
|
28
28
|
buttonRef.current.focus();
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
return (React.createElement(ReactModal, Object.assign({}, rest, { style: style, isOpen: open, ref: mergedRef, className: cl("navds-modal", className), overlayClassName: "navds-modal__overlay", shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, onRequestClose: (e) => onModalCloseRequest(e), aria: {
|
|
31
|
+
return (React.createElement(ReactModal, Object.assign({}, rest, { style: style, isOpen: open, ref: mergedRef, className: cl("navds-modal", className), overlayClassName: cl("navds-modal__overlay", overlayClassName), shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, onRequestClose: (e) => onModalCloseRequest(e), aria: {
|
|
32
32
|
describedby: ariaDescribedBy,
|
|
33
33
|
labelledby: ariaLabelledBy,
|
|
34
34
|
modal: ariaModal,
|
package/esm/modal/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,YAAkC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,YAAkC,MAAM,gBAAgB,CAAC;AA+DhE,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EAcC,EACD,GAAG,EACH,EAAE;QAhBF,EACE,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,yBAAyB,GAAG,IAAI,EAChC,WAAW,GAAG,IAAI,EAClB,kBAAkB,EAAE,eAAe,EACnC,iBAAiB,EAAE,cAAc,EACjC,YAAY,EAAE,SAAS,EACvB,YAAY,EAAE,YAAY,EAC1B,KAAK,OAEN,EADI,IAAI,cAbT,wLAcC,CADQ;IAIT,MAAM,QAAQ,GAAG,MAAM,CAAoB,IAA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C;AACJ,CAAC,CACgB,CAAC;AAEpB,KAAK,CAAC,aAAa,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AACrE,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC;AAE7B,eAAe,KAAK,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.18",
|
|
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.18",
|
|
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",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"optional": true
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "b224ef6810966588555070d39f2a1999aabd4aed"
|
|
80
80
|
}
|
package/src/modal/Modal.tsx
CHANGED
|
@@ -27,6 +27,10 @@ export interface ModalProps {
|
|
|
27
27
|
* User defined classname for modal
|
|
28
28
|
*/
|
|
29
29
|
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* User defined classname for modal
|
|
32
|
+
*/
|
|
33
|
+
overlayClassName?: string;
|
|
30
34
|
/**
|
|
31
35
|
* Removes close-button(X) when false
|
|
32
36
|
* @default true
|
|
@@ -69,6 +73,7 @@ export const Modal = forwardRef<ReactModal, ModalProps>(
|
|
|
69
73
|
open,
|
|
70
74
|
onClose,
|
|
71
75
|
className,
|
|
76
|
+
overlayClassName,
|
|
72
77
|
shouldCloseOnOverlayClick = true,
|
|
73
78
|
closeButton = true,
|
|
74
79
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -99,7 +104,7 @@ export const Modal = forwardRef<ReactModal, ModalProps>(
|
|
|
99
104
|
isOpen={open}
|
|
100
105
|
ref={mergedRef}
|
|
101
106
|
className={cl("navds-modal", className)}
|
|
102
|
-
overlayClassName="navds-modal__overlay"
|
|
107
|
+
overlayClassName={cl("navds-modal__overlay", overlayClassName)}
|
|
103
108
|
shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}
|
|
104
109
|
onRequestClose={(e) => onModalCloseRequest(e)}
|
|
105
110
|
aria={{
|