@navikt/ds-react 7.35.0 → 7.35.2
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/accordion/AccordionContent.js +1 -3
- package/cjs/accordion/AccordionContent.js.map +1 -1
- package/cjs/alert/base-alert/root/BaseAlertRoot.context.d.ts +1 -1
- package/cjs/alert/base-alert/root/BaseAlertRoot.js +1 -1
- package/cjs/alert/base-alert/root/BaseAlertRoot.js.map +1 -1
- package/cjs/alert/base-alert/title/BaseAlertTitle.js +1 -1
- package/cjs/alert/base-alert/title/BaseAlertTitle.js.map +1 -1
- package/cjs/form/select/Select.d.ts +0 -4
- package/cjs/form/select/Select.js +2 -2
- package/cjs/form/select/Select.js.map +1 -1
- package/esm/accordion/AccordionContent.js +1 -3
- package/esm/accordion/AccordionContent.js.map +1 -1
- package/esm/alert/base-alert/root/BaseAlertRoot.context.d.ts +1 -1
- package/esm/alert/base-alert/root/BaseAlertRoot.js +1 -1
- package/esm/alert/base-alert/root/BaseAlertRoot.js.map +1 -1
- package/esm/alert/base-alert/title/BaseAlertTitle.js +1 -1
- package/esm/alert/base-alert/title/BaseAlertTitle.js.map +1 -1
- package/esm/form/select/Select.d.ts +0 -4
- package/esm/form/select/Select.js +2 -2
- package/esm/form/select/Select.js.map +1 -1
- package/package.json +3 -3
- package/src/accordion/AccordionContent.tsx +1 -6
- package/src/alert/base-alert/root/BaseAlertRoot.context.tsx +1 -1
- package/src/alert/base-alert/root/BaseAlertRoot.tsx +1 -1
- package/src/alert/base-alert/title/BaseAlertTitle.tsx +1 -1
- package/src/form/combobox/__tests__/combobox.test.tsx +1 -2
- package/src/form/select/Select.tsx +0 -6
- package/src/modal/Modal.test.tsx +2 -2
- package/src/popover/Popover.test.tsx +0 -130
- package/src/tooltip/Tooltip.test.tsx +0 -154
|
@@ -57,9 +57,7 @@ const AccordionContent = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
57
57
|
console.error("<Accordion.Content> has to be used within an <Accordion.Item>");
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
|
-
return (react_1.default.createElement(typography_1.BodyLong, Object.assign({}, rest, { as: "div", ref: ref, className: cn("navds-accordion__content", {
|
|
61
|
-
"navds-accordion__content--closed": !context.open,
|
|
62
|
-
}, className), "aria-hidden": !context.open || undefined }), (themeContext === null || themeContext === void 0 ? void 0 : themeContext.isDarkside) ? (react_1.default.createElement("div", { className: cn("navds-accordion__content-inner") }, children)) : (children)));
|
|
60
|
+
return (react_1.default.createElement(typography_1.BodyLong, Object.assign({}, rest, { as: "div", ref: ref, className: cn("navds-accordion__content", { "navds-accordion__content--closed": !context.open }, className) }), (themeContext === null || themeContext === void 0 ? void 0 : themeContext.isDarkside) ? (react_1.default.createElement("div", { className: cn("navds-accordion__content-inner") }, children)) : (children)));
|
|
63
61
|
});
|
|
64
62
|
exports.default = AccordionContent;
|
|
65
63
|
//# sourceMappingURL=AccordionContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionContent.js","sourceRoot":"","sources":["../../src/accordion/AccordionContent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsD;AACtD,0CAAgE;AAChE,8CAAyC;AACzC,mDAAuD;AAUvD,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EACjC,CAAC,EAAgC,EAAE,GAAG,EAAE,EAAE;QAAzC,EAAE,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAC7B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,oCAAoB,CAAC,CAAC;IAEjD,MAAM,YAAY,GAAG,IAAA,wBAAgB,EAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,EAAE,EAAE,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IAE9B,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,KAAK,CACX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,CACF,QAAQ,CACT,CACQ,CACZ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|
|
@@ -3,7 +3,7 @@ type BaseAlertContextProps = {
|
|
|
3
3
|
size: "medium" | "small";
|
|
4
4
|
status?: "announcement" | "success" | "warning" | "error";
|
|
5
5
|
color: AkselColor | undefined;
|
|
6
|
-
statusId
|
|
6
|
+
statusId?: string;
|
|
7
7
|
};
|
|
8
8
|
declare const BaseAlertProvider: import("react").ForwardRefExoticComponent<BaseAlertContextProps & {
|
|
9
9
|
children: React.ReactNode;
|
|
@@ -57,7 +57,7 @@ const BaseAlert = (0, react_1.forwardRef)((_a, forwardedRef) => {
|
|
|
57
57
|
const statusId = (0, util_1.useId)();
|
|
58
58
|
const translate = (0, i18n_hooks_1.useI18n)("global");
|
|
59
59
|
const alertColor = status ? (0, BaseAlertRoot_utils_1.baseAlertStatusToDataColor)(status) : dataColor;
|
|
60
|
-
return (react_1.default.createElement(BaseAlertRoot_context_1.BaseAlertProvider, { size: size, status: status, color: alertColor, statusId: statusId },
|
|
60
|
+
return (react_1.default.createElement(BaseAlertRoot_context_1.BaseAlertProvider, { size: size, status: status, color: alertColor, statusId: type === "strong" ? statusId : undefined },
|
|
61
61
|
react_1.default.createElement(Component, Object.assign({ "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (!status || Component === "div" ? undefined : translate(status)), ref: forwardedRef }, restProps, { className: cn(className, "navds-base-alert"), "data-size": size, "data-color": alertColor, "data-variant": type, "data-global": global }),
|
|
62
62
|
react_1.default.createElement("div", { role: role }, children))));
|
|
63
63
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAlertRoot.js","sourceRoot":"","sources":["../../../../src/alert/base-alert/root/BaseAlertRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,gDAAoD;AAEpD,wCA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EACN,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,YAAY,EAAE,SAAS,EACvB,IAAI,OAEW,EADZ,SAAS,cAXd,uGAYC,CADa;IAId,MAAM,EAAE,EAAE,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IAE9B,MAAM,QAAQ,GAAG,IAAA,YAAK,GAAE,CAAC;IACzB,MAAM,SAAS,GAAG,IAAA,oBAAO,EAAC,QAAQ,CAAC,CAAC;IAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,IAAA,gDAA0B,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3E,OAAO,CACL,8BAAC,yCAAiB,IAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QAElD,8BAAC,SAAS,gCAEN,SAAS,aAAT,SAAS,cAAT,SAAS,GACT,CAAC,CAAC,MAAM,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAElE,GAAG,EAAE,YAAY,IACb,SAAS,IACb,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,kBAAkB,CAAC,eACjC,IAAI,gBACH,UAAU,kBACR,IAAI,iBACL,MAAM;YAEnB,uCAAK,IAAI,EAAE,IAAI,IAAG,QAAQ,CAAO,CACvB,CACM,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEO,8BAAS"}
|
|
@@ -71,7 +71,7 @@ const BaseAlertTitle = (0, react_1.forwardRef)((_a, forwardedRef) => {
|
|
|
71
71
|
const { cn } = (0, Theme_1.useRenameCSS)();
|
|
72
72
|
const { size, statusId } = (0, BaseAlertRoot_context_1.useBaseAlert)();
|
|
73
73
|
const titleId = (0, util_1.useId)(idProp);
|
|
74
|
-
return (react_1.default.createElement(typography_1.BodyShort, Object.assign({ ref: forwardedRef }, restProps, { as: as, size: size === "medium" ? "large" : "medium", weight: "semibold", className: cn(className, "navds-base-alert__title"), id: titleId, "aria-labelledby": (0, clsx_1.default)(statusId, titleId) }), children));
|
|
74
|
+
return (react_1.default.createElement(typography_1.BodyShort, Object.assign({ ref: forwardedRef }, restProps, { as: as, size: size === "medium" ? "large" : "medium", weight: "semibold", className: cn(className, "navds-base-alert__title"), id: titleId, "aria-labelledby": statusId ? (0, clsx_1.default)(statusId, titleId) : undefined }), children));
|
|
75
75
|
});
|
|
76
76
|
exports.BaseAlertTitle = BaseAlertTitle;
|
|
77
77
|
//# sourceMappingURL=BaseAlertTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAlertTitle.js","sourceRoot":"","sources":["../../../../src/alert/base-alert/title/BaseAlertTitle.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAsB;AACtB,+CAA0C;AAC1C,gDAAoD;AACpD,oDAAgD;AAChD,wCAAsC;AACtC,yEAA6D;AAW7D;;;;;;;;;;;GAWG;AACH,MAAM,cAAc,GAAG,IAAA,kBAAU,EAC/B,CACE,EAMsB,EACtB,YAAY,EACZ,EAAE;QARF,EACE,QAAQ,EACR,SAAS,EACT,EAAE,GAAG,IAAI,EACT,EAAE,EAAE,MAAM,OAEU,EADjB,SAAS,cALd,qCAMC,CADa;IAId,MAAM,EAAE,EAAE,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC;IAC9B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAA,oCAAY,GAAE,CAAC;IAE1C,MAAM,OAAO,GAAG,IAAA,YAAK,EAAC,MAAM,CAAC,CAAC;IAE9B,OAAO,CACL,8BAAC,sBAAS,kBACR,GAAG,EAAE,YAAY,IACb,SAAS,IACb,EAAE,EAAE,EAAE,EACN,IAAI,EAAE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OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,KAE5D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEO,wCAAc"}
|
|
@@ -5,10 +5,6 @@ export interface SelectProps extends FormFieldProps, Omit<SelectHTMLAttributes<H
|
|
|
5
5
|
* Collection of <option />-elements.
|
|
6
6
|
*/
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Exposes the HTML size attribute.
|
|
10
|
-
*/
|
|
11
|
-
htmlSize?: number;
|
|
12
8
|
/**
|
|
13
9
|
* Sets inline-style on select wrapper.
|
|
14
10
|
*/
|
|
@@ -70,7 +70,7 @@ const useFormField_1 = require("../useFormField");
|
|
|
70
70
|
*/
|
|
71
71
|
exports.Select = (0, react_1.forwardRef)((props, ref) => {
|
|
72
72
|
const { inputProps, errorId, showErrorMsg, hasError, size, inputDescriptionId, readOnly, } = (0, useFormField_1.useFormField)(props, "select");
|
|
73
|
-
const { children, label, className, description,
|
|
73
|
+
const { children, label, className, description, hideLabel = false, style } = props, rest = __rest(props, ["children", "label", "className", "description", "hideLabel", "style"]);
|
|
74
74
|
const { cn } = (0, Theme_1.useRenameCSS)();
|
|
75
75
|
const readOnlyEventHandlers = {
|
|
76
76
|
onMouseDown: (evt) => {
|
|
@@ -103,7 +103,7 @@ exports.Select = (0, react_1.forwardRef)((props, ref) => {
|
|
|
103
103
|
"navds-sr-only": hideLabel,
|
|
104
104
|
}), id: inputDescriptionId, size: size, as: "div" }, description)),
|
|
105
105
|
react_1.default.createElement("div", { className: cn("navds-select__container"), style: style },
|
|
106
|
-
react_1.default.createElement("select", Object.assign({}, (0, util_1.omit)(rest, ["error", "errorId", "size", "readOnly"]), inputProps, readOnlyEventHandlers, { ref: ref, className: cn("navds-select__input", "navds-body-short", `navds-body-short--${size !== null && size !== void 0 ? size : "medium"}`)
|
|
106
|
+
react_1.default.createElement("select", Object.assign({}, (0, util_1.omit)(rest, ["error", "errorId", "size", "readOnly"]), inputProps, readOnlyEventHandlers, { ref: ref, className: cn("navds-select__input", "navds-body-short", `navds-body-short--${size !== null && size !== void 0 ? size : "medium"}`) }), children),
|
|
107
107
|
react_1.default.createElement(aksel_icons_1.ChevronDownIcon, { className: cn("navds-select__chevron"), "aria-hidden": true })),
|
|
108
108
|
react_1.default.createElement("div", { className: cn("navds-form-field__error"), id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && (react_1.default.createElement(typography_1.ErrorMessage, { size: size, showIcon: true }, props.error)))));
|
|
109
109
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/form/select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgE;AAChE,qDAAsD;AACtD,6CAAiD;AACjD,iDAAkE;AAClE,qCAAkC;AAClC,kDAAwD;AACxD,kDAA+D;
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/form/select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgE;AAChE,qDAAsD;AACtD,6CAAiD;AACjD,iDAAkE;AAClE,qCAAkC;AAClC,kDAAwD;AACxD,kDAA+D;AAuB/D;;;;;;;;;;;;;;;GAeG;AACU,QAAA,MAAM,GAAG,IAAA,kBAAU,EAC9B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EACJ,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,kBAAkB,EAClB,QAAQ,GACT,GAAG,IAAA,2BAAY,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAElC,MAAM,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,WAAW,EACX,SAAS,GAAG,KAAK,EACjB,KAAK,KAEH,KAAK,EADJ,IAAI,UACL,KAAK,EARH,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,EAAC,KAAK,IAEP,WAAW,CACF,CACb;QACD,uCAAK,SAAS,EAAE,EAAE,CAAC,yBAAyB,CAAC,EAAE,KAAK,EAAE,KAAK;YACzD,0DACM,IAAA,WAAI,EAAC,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,EACpD,UAAU,EACV,qBAAqB,IACzB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,QAAQ,EAAE,CACxC,KAEA,QAAQ,CACF;YACT,8BAAC,6BAAe,IACd,SAAS,EAAE,EAAE,CAAC,uBAAuB,CAAC,wBAEtC,CACE;QACN,uCACE,SAAS,EAAE,EAAE,CAAC,yBAAyB,CAAC,EACxC,EAAE,EAAE,OAAO,mBACG,oBAAoB,eACxB,QAAQ,IAEjB,YAAY,IAAI,CACf,8BAAC,yBAAY,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,UAC/B,KAAK,CAAC,KAAK,CACC,CAChB,CACG,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAe,cAAM,CAAC"}
|
|
@@ -22,9 +22,7 @@ const AccordionContent = forwardRef((_a, ref) => {
|
|
|
22
22
|
console.error("<Accordion.Content> has to be used within an <Accordion.Item>");
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
return (React.createElement(BodyLong, Object.assign({}, rest, { as: "div", ref: ref, className: cn("navds-accordion__content", {
|
|
26
|
-
"navds-accordion__content--closed": !context.open,
|
|
27
|
-
}, className), "aria-hidden": !context.open || undefined }), (themeContext === null || themeContext === void 0 ? void 0 : themeContext.isDarkside) ? (React.createElement("div", { className: cn("navds-accordion__content-inner") }, children)) : (children)));
|
|
25
|
+
return (React.createElement(BodyLong, Object.assign({}, rest, { as: "div", ref: ref, className: cn("navds-accordion__content", { "navds-accordion__content--closed": !context.open }, className) }), (themeContext === null || themeContext === void 0 ? void 0 : themeContext.isDarkside) ? (React.createElement("div", { className: cn("navds-accordion__content-inner") }, children)) : (children)));
|
|
28
26
|
});
|
|
29
27
|
export default AccordionContent;
|
|
30
28
|
//# sourceMappingURL=AccordionContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionContent.js","sourceRoot":"","sources":["../../src/accordion/AccordionContent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAUvD,MAAM,gBAAgB,GAAG,UAAU,CACjC,CAAC,EAAgC,EAAE,GAAG,EAAE,EAAE;QAAzC,EAAE,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAEjD,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,CAAC;IAE9B,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,KAAK,CACX,+DAA+D,CAChE,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,oBAAC,QAAQ,oBACH,IAAI,IACR,EAAE,EAAC,KAAK,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,0BAA0B,EAC1B
|
|
1
|
+
{"version":3,"file":"AccordionContent.js","sourceRoot":"","sources":["../../src/accordion/AccordionContent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAA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
5
5
|
color: AkselColor | undefined;
|
|
6
|
-
statusId
|
|
6
|
+
statusId?: string;
|
|
7
7
|
};
|
|
8
8
|
declare const BaseAlertProvider: import("react").ForwardRefExoticComponent<BaseAlertContextProps & {
|
|
9
9
|
children: React.ReactNode;
|
|
@@ -21,7 +21,7 @@ const BaseAlert = forwardRef((_a, forwardedRef) => {
|
|
|
21
21
|
const statusId = useId();
|
|
22
22
|
const translate = useI18n("global");
|
|
23
23
|
const alertColor = status ? baseAlertStatusToDataColor(status) : dataColor;
|
|
24
|
-
return (React.createElement(BaseAlertProvider, { size: size, status: status, color: alertColor, statusId: statusId },
|
|
24
|
+
return (React.createElement(BaseAlertProvider, { size: size, status: status, color: alertColor, statusId: type === "strong" ? statusId : undefined },
|
|
25
25
|
React.createElement(Component, Object.assign({ "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (!status || Component === "div" ? undefined : translate(status)), ref: forwardedRef }, restProps, { className: cn(className, "navds-base-alert"), "data-size": size, "data-color": alertColor, "data-variant": type, "data-global": global }),
|
|
26
26
|
React.createElement("div", { role: role }, children))));
|
|
27
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAlertRoot.js","sourceRoot":"","sources":["../../../../src/alert/base-alert/root/BaseAlertRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAEL,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAwCnE,MAAM,SAAS,GAAG,UAAU,CAC1B,CACE,EAYiB,EACjB,YAAY,EACZ,EAAE;QA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,KAAK,EACd,MAAM,EACN,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,YAAY,EAAE,SAAS,EACvB,IAAI,OAEW,EADZ,SAAS,cAXd,uGAYC,CADa;IAId,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,CAAC;IAE9B,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3E,OAAO,CACL,oBAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QAElD,oBAAC,SAAS,gCAEN,SAAS,aAAT,SAAS,cAAT,SAAS,GACT,CAAC,CAAC,MAAM,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAElE,GAAG,EAAE,YAAY,IACb,SAAS,IACb,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,kBAAkB,CAAC,eACjC,IAAI,gBACH,UAAU,kBACR,IAAI,iBACL,MAAM;YAEnB,6BAAK,IAAI,EAAE,IAAI,IAAG,QAAQ,CAAO,CACvB,CACM,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -32,7 +32,7 @@ const BaseAlertTitle = forwardRef((_a, forwardedRef) => {
|
|
|
32
32
|
const { cn } = useRenameCSS();
|
|
33
33
|
const { size, statusId } = useBaseAlert();
|
|
34
34
|
const titleId = useId(idProp);
|
|
35
|
-
return (React.createElement(BodyShort, Object.assign({ ref: forwardedRef }, restProps, { as: as, size: size === "medium" ? "large" : "medium", weight: "semibold", className: cn(className, "navds-base-alert__title"), id: titleId, "aria-labelledby": cl(statusId, titleId) }), children));
|
|
35
|
+
return (React.createElement(BodyShort, Object.assign({ ref: forwardedRef }, restProps, { as: as, size: size === "medium" ? "large" : "medium", weight: "semibold", className: cn(className, "navds-base-alert__title"), id: titleId, "aria-labelledby": statusId ? cl(statusId, titleId) : undefined }), children));
|
|
36
36
|
});
|
|
37
37
|
export { BaseAlertTitle };
|
|
38
38
|
//# sourceMappingURL=BaseAlertTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAlertTitle.js","sourceRoot":"","sources":["../../../../src/alert/base-alert/title/BaseAlertTitle.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAW7D;;;;;;;;;;;GAWG;AACH,MAAM,cAAc,GAAG,UAAU,CAC/B,CACE,EAMsB,EACtB,YAAY,EACZ,EAAE;QARF,EACE,QAAQ,EACR,SAAS,EACT,EAAE,GAAG,IAAI,EACT,EAAE,EAAE,MAAM,OAEU,EADjB,SAAS,cALd,qCAMC,CADa;IAId,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,YAAY,EAAE,CAAC;IAE1C,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAE9B,OAAO,CACL,oBAAC,SAAS,kBACR,GAAG,EAAE,YAAY,IACb,SAAS,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C5C,MAAM,EAAC,UAAU,EACjB,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,yBAAyB,CAAC,EACnD,EAAE,EAAE,OAAO,qBACM,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,KAE5D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -5,10 +5,6 @@ export interface SelectProps extends FormFieldProps, Omit<SelectHTMLAttributes<H
|
|
|
5
5
|
* Collection of <option />-elements.
|
|
6
6
|
*/
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Exposes the HTML size attribute.
|
|
10
|
-
*/
|
|
11
|
-
htmlSize?: number;
|
|
12
8
|
/**
|
|
13
9
|
* Sets inline-style on select wrapper.
|
|
14
10
|
*/
|
|
@@ -34,7 +34,7 @@ import { useFormField } from "../useFormField.js";
|
|
|
34
34
|
*/
|
|
35
35
|
export const Select = forwardRef((props, ref) => {
|
|
36
36
|
const { inputProps, errorId, showErrorMsg, hasError, size, inputDescriptionId, readOnly, } = useFormField(props, "select");
|
|
37
|
-
const { children, label, className, description,
|
|
37
|
+
const { children, label, className, description, hideLabel = false, style } = props, rest = __rest(props, ["children", "label", "className", "description", "hideLabel", "style"]);
|
|
38
38
|
const { cn } = useRenameCSS();
|
|
39
39
|
const readOnlyEventHandlers = {
|
|
40
40
|
onMouseDown: (evt) => {
|
|
@@ -67,7 +67,7 @@ export const Select = forwardRef((props, ref) => {
|
|
|
67
67
|
"navds-sr-only": hideLabel,
|
|
68
68
|
}), id: inputDescriptionId, size: size, as: "div" }, description)),
|
|
69
69
|
React.createElement("div", { className: cn("navds-select__container"), style: style },
|
|
70
|
-
React.createElement("select", Object.assign({}, omit(rest, ["error", "errorId", "size", "readOnly"]), inputProps, readOnlyEventHandlers, { ref: ref, className: cn("navds-select__input", "navds-body-short", `navds-body-short--${size !== null && size !== void 0 ? size : "medium"}`)
|
|
70
|
+
React.createElement("select", Object.assign({}, omit(rest, ["error", "errorId", "size", "readOnly"]), inputProps, readOnlyEventHandlers, { ref: ref, className: cn("navds-select__input", "navds-body-short", `navds-body-short--${size !== null && size !== void 0 ? size : "medium"}`) }), children),
|
|
71
71
|
React.createElement(ChevronDownIcon, { className: cn("navds-select__chevron"), "aria-hidden": true })),
|
|
72
72
|
React.createElement("div", { className: cn("navds-form-field__error"), id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && (React.createElement(ErrorMessage, { size: size, showIcon: true }, props.error)))));
|
|
73
73
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/form/select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAwB,UAAU,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAkB,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/form/select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAwB,UAAU,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAk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CACG,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "7.35.
|
|
3
|
+
"version": "7.35.2",
|
|
4
4
|
"description": "React components from the Norwegian Labour and Welfare Administration.",
|
|
5
5
|
"author": "Aksel, a team part of the Norwegian Labour and Welfare Administration.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -695,8 +695,8 @@
|
|
|
695
695
|
"dependencies": {
|
|
696
696
|
"@floating-ui/react": "0.27.8",
|
|
697
697
|
"@floating-ui/react-dom": "^2.1.6",
|
|
698
|
-
"@navikt/aksel-icons": "^7.35.
|
|
699
|
-
"@navikt/ds-tokens": "^7.35.
|
|
698
|
+
"@navikt/aksel-icons": "^7.35.2",
|
|
699
|
+
"@navikt/ds-tokens": "^7.35.2",
|
|
700
700
|
"clsx": "^2.1.0",
|
|
701
701
|
"date-fns": "^4.0.0",
|
|
702
702
|
"react-day-picker": "9.7.0"
|
|
@@ -32,14 +32,9 @@ const AccordionContent = forwardRef<HTMLDivElement, AccordionContentProps>(
|
|
|
32
32
|
ref={ref}
|
|
33
33
|
className={cn(
|
|
34
34
|
"navds-accordion__content",
|
|
35
|
-
{
|
|
36
|
-
"navds-accordion__content--closed": !context.open,
|
|
37
|
-
},
|
|
35
|
+
{ "navds-accordion__content--closed": !context.open },
|
|
38
36
|
className,
|
|
39
37
|
)}
|
|
40
|
-
aria-hidden={
|
|
41
|
-
!context.open || undefined
|
|
42
|
-
} /* Added to fix bug with Radio component, where label text inside a span sometimes is ignored by screen readers after hiding/displaying the RadioGroup inside an Accordion */
|
|
43
38
|
>
|
|
44
39
|
{themeContext?.isDarkside ? (
|
|
45
40
|
<div className={cn("navds-accordion__content-inner")}>{children}</div>
|
|
@@ -5,7 +5,7 @@ type BaseAlertContextProps = {
|
|
|
5
5
|
size: "medium" | "small";
|
|
6
6
|
status?: "announcement" | "success" | "warning" | "error";
|
|
7
7
|
color: AkselColor | undefined;
|
|
8
|
-
statusId
|
|
8
|
+
statusId?: string;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const [BaseAlertProvider, useBaseAlert] = createContext<BaseAlertContextProps>({
|
|
@@ -51,7 +51,7 @@ const BaseAlertTitle = forwardRef<HTMLHeadingElement, BaseAlertTitleProps>(
|
|
|
51
51
|
weight="semibold"
|
|
52
52
|
className={cn(className, "navds-base-alert__title")}
|
|
53
53
|
id={titleId}
|
|
54
|
-
aria-labelledby={cl(statusId, titleId)}
|
|
54
|
+
aria-labelledby={statusId ? cl(statusId, titleId) : undefined}
|
|
55
55
|
>
|
|
56
56
|
{children}
|
|
57
57
|
</BodyShort>
|
|
@@ -177,8 +177,7 @@ describe("Render combobox", () => {
|
|
|
177
177
|
expect(onChange).toHaveBeenNthCalledWith(4, "Syke");
|
|
178
178
|
expect(onChange).toHaveBeenNthCalledWith(5, "Sykepenger [SYK]");
|
|
179
179
|
expect(onChange).toHaveBeenCalledWith("");
|
|
180
|
-
expect(onToggleSelected).
|
|
181
|
-
expect(onToggleSelected).toHaveBeenCalledWith(
|
|
180
|
+
expect(onToggleSelected).toHaveBeenCalledExactlyOnceWith(
|
|
182
181
|
"Sykepenger [SYK]",
|
|
183
182
|
true,
|
|
184
183
|
false,
|
|
@@ -13,10 +13,6 @@ export interface SelectProps
|
|
|
13
13
|
* Collection of <option />-elements.
|
|
14
14
|
*/
|
|
15
15
|
children: React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Exposes the HTML size attribute.
|
|
18
|
-
*/
|
|
19
|
-
htmlSize?: number;
|
|
20
16
|
/**
|
|
21
17
|
* Sets inline-style on select wrapper.
|
|
22
18
|
*/
|
|
@@ -64,7 +60,6 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
|
64
60
|
label,
|
|
65
61
|
className,
|
|
66
62
|
description,
|
|
67
|
-
htmlSize,
|
|
68
63
|
hideLabel = false,
|
|
69
64
|
style,
|
|
70
65
|
...rest
|
|
@@ -140,7 +135,6 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
|
140
135
|
"navds-body-short",
|
|
141
136
|
`navds-body-short--${size ?? "medium"}`,
|
|
142
137
|
)}
|
|
143
|
-
size={htmlSize}
|
|
144
138
|
>
|
|
145
139
|
{children}
|
|
146
140
|
</select>
|
package/src/modal/Modal.test.tsx
CHANGED
|
@@ -17,9 +17,9 @@ const Test = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
describe("Modal", () => {
|
|
20
|
-
test("should be visible", () => {
|
|
20
|
+
test("should be visible", async () => {
|
|
21
21
|
render(<Test />);
|
|
22
|
-
expect(screen.
|
|
22
|
+
expect(await screen.findByText("Foobar")).toBeVisible();
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
test("should be hidden after setting 'open' to false", async () => {
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { act, fireEvent, screen } from "@testing-library/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { describe, expect, test, vi } from "vitest";
|
|
4
|
-
import { renderWithStyles as render } from "../../tests/utils";
|
|
5
|
-
import Popover from "./Popover";
|
|
6
|
-
|
|
7
|
-
describe("Popover", () => {
|
|
8
|
-
test("open", () => {
|
|
9
|
-
render(
|
|
10
|
-
<Popover
|
|
11
|
-
open
|
|
12
|
-
anchorEl={document.createElement("div")}
|
|
13
|
-
onClose={() => null}
|
|
14
|
-
data-testid="popover-id"
|
|
15
|
-
>
|
|
16
|
-
<div />
|
|
17
|
-
</Popover>,
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
expect(screen.getByTestId("popover-id")).toBeVisible();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test("should be hidden", () => {
|
|
24
|
-
render(
|
|
25
|
-
<Popover
|
|
26
|
-
open={false}
|
|
27
|
-
anchorEl={document.createElement("div")}
|
|
28
|
-
onClose={() => null}
|
|
29
|
-
data-testid="popover-id"
|
|
30
|
-
>
|
|
31
|
-
<div />
|
|
32
|
-
</Popover>,
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
expect(screen.getByTestId("popover-id")).not.toBeVisible();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
test("outsideClick", async () => {
|
|
39
|
-
const fn = vi.fn();
|
|
40
|
-
render(
|
|
41
|
-
<div>
|
|
42
|
-
<Popover
|
|
43
|
-
open={true}
|
|
44
|
-
anchorEl={document.createElement("div")}
|
|
45
|
-
onClose={fn}
|
|
46
|
-
data-testid="popover-id"
|
|
47
|
-
>
|
|
48
|
-
<div />
|
|
49
|
-
</Popover>
|
|
50
|
-
<a href="/#">link</a>
|
|
51
|
-
</div>,
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
await act(async () => {
|
|
55
|
-
expect(screen.getByTestId("popover-id")).toBeVisible();
|
|
56
|
-
screen.getByRole("link").focus();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
expect(fn).toHaveBeenCalled();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test("escape", async () => {
|
|
63
|
-
const fn = vi.fn();
|
|
64
|
-
const { container } = render(
|
|
65
|
-
<div>
|
|
66
|
-
<Popover
|
|
67
|
-
open={true}
|
|
68
|
-
anchorEl={document.createElement("div")}
|
|
69
|
-
onClose={fn}
|
|
70
|
-
data-testid="popover-id"
|
|
71
|
-
>
|
|
72
|
-
<div />
|
|
73
|
-
</Popover>
|
|
74
|
-
</div>,
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
expect(screen.getByTestId("popover-id")).toBeVisible();
|
|
78
|
-
fireEvent.keyDown(
|
|
79
|
-
// Should work anywhere
|
|
80
|
-
container,
|
|
81
|
-
{ key: "Escape" },
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
expect(fn).toHaveBeenCalled();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test("keep open on popover-focus", async () => {
|
|
88
|
-
const fn = vi.fn();
|
|
89
|
-
render(
|
|
90
|
-
<div>
|
|
91
|
-
<Popover
|
|
92
|
-
open={true}
|
|
93
|
-
anchorEl={document.createElement("div")}
|
|
94
|
-
onClose={fn}
|
|
95
|
-
data-testid="popover-id"
|
|
96
|
-
>
|
|
97
|
-
<div />
|
|
98
|
-
</Popover>
|
|
99
|
-
</div>,
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
await act(async () => {
|
|
103
|
-
expect(screen.getByTestId("popover-id")).toBeVisible();
|
|
104
|
-
screen.getByTestId("popover-id").focus();
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
expect(fn).toHaveBeenCalledTimes(0);
|
|
108
|
-
}, 20000);
|
|
109
|
-
|
|
110
|
-
test("keep open on popover-click", async () => {
|
|
111
|
-
const fn = vi.fn();
|
|
112
|
-
render(
|
|
113
|
-
<div>
|
|
114
|
-
<Popover
|
|
115
|
-
open={true}
|
|
116
|
-
anchorEl={document.createElement("div")}
|
|
117
|
-
onClose={fn}
|
|
118
|
-
data-testid="popover-id"
|
|
119
|
-
>
|
|
120
|
-
<div />
|
|
121
|
-
</Popover>
|
|
122
|
-
</div>,
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
expect(screen.getByTestId("popover-id")).toBeVisible();
|
|
126
|
-
fireEvent.click(screen.getByTestId("popover-id"));
|
|
127
|
-
|
|
128
|
-
expect(fn).toHaveBeenCalledTimes(0);
|
|
129
|
-
});
|
|
130
|
-
});
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { act, fireEvent, screen } from "@testing-library/react";
|
|
2
|
-
import userEvent from "@testing-library/user-event";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { describe, expect, test } from "vitest";
|
|
5
|
-
import {
|
|
6
|
-
focusVisible,
|
|
7
|
-
renderWithStyles as render,
|
|
8
|
-
simulatePointerDown,
|
|
9
|
-
} from "../../tests/utils";
|
|
10
|
-
import Tooltip from "./Tooltip";
|
|
11
|
-
|
|
12
|
-
describe("Tooltip", () => {
|
|
13
|
-
test("controlled open", () => {
|
|
14
|
-
render(
|
|
15
|
-
<Tooltip content="Hello World" open>
|
|
16
|
-
<button id="testChild" type="submit">
|
|
17
|
-
Hello World
|
|
18
|
-
</button>
|
|
19
|
-
</Tooltip>,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("default open", () => {
|
|
26
|
-
render(
|
|
27
|
-
<Tooltip content="Hello World" defaultOpen>
|
|
28
|
-
<button id="testChild" type="submit">
|
|
29
|
-
Hello World
|
|
30
|
-
</button>
|
|
31
|
-
</Tooltip>,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test("Focus", async () => {
|
|
38
|
-
render(
|
|
39
|
-
<Tooltip content="Hello World">
|
|
40
|
-
<button id="testChild" type="submit">
|
|
41
|
-
Hello World
|
|
42
|
-
</button>
|
|
43
|
-
</Tooltip>,
|
|
44
|
-
);
|
|
45
|
-
simulatePointerDown();
|
|
46
|
-
|
|
47
|
-
focusVisible(screen.getByRole("button"));
|
|
48
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("Escape", async () => {
|
|
52
|
-
render(
|
|
53
|
-
<Tooltip content="Hello World">
|
|
54
|
-
<button id="testChild" type="submit">
|
|
55
|
-
Hello World
|
|
56
|
-
</button>
|
|
57
|
-
</Tooltip>,
|
|
58
|
-
);
|
|
59
|
-
simulatePointerDown();
|
|
60
|
-
|
|
61
|
-
focusVisible(screen.getByRole("button"));
|
|
62
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
63
|
-
|
|
64
|
-
fireEvent.keyDown(document, { key: "Escape" });
|
|
65
|
-
expect(screen.queryByRole("tooltip")).toBeNull();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
test("delay", async () => {
|
|
69
|
-
const user = userEvent.setup();
|
|
70
|
-
|
|
71
|
-
render(
|
|
72
|
-
<Tooltip content="Hello World" delay={300}>
|
|
73
|
-
<button id="testChild" type="submit">
|
|
74
|
-
Hello World
|
|
75
|
-
</button>
|
|
76
|
-
</Tooltip>,
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
await act(async () => {
|
|
80
|
-
await user.hover(screen.getByRole("button"));
|
|
81
|
-
await new Promise((r) => setTimeout(r, 250));
|
|
82
|
-
expect(screen.queryByRole("tooltip")).toBeNull();
|
|
83
|
-
await new Promise((r) => setTimeout(r, 600));
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
test("outsideClick", async () => {
|
|
90
|
-
render(
|
|
91
|
-
<div>
|
|
92
|
-
<Tooltip content="Hello World">
|
|
93
|
-
<button id="testChild" type="submit">
|
|
94
|
-
Hello World
|
|
95
|
-
</button>
|
|
96
|
-
</Tooltip>
|
|
97
|
-
<a href="/#">link</a>
|
|
98
|
-
</div>,
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
simulatePointerDown(screen.getByRole("button"));
|
|
102
|
-
focusVisible(screen.getByRole("button"));
|
|
103
|
-
|
|
104
|
-
await act(async () => {
|
|
105
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
106
|
-
screen.getByRole("link").focus();
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
expect(screen.queryByRole("tooltip")).toBeNull();
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
test("keep open on tooltip-click", async () => {
|
|
113
|
-
render(
|
|
114
|
-
<div>
|
|
115
|
-
<Tooltip content="Hello World">
|
|
116
|
-
<button id="testChild" type="submit">
|
|
117
|
-
Hello World
|
|
118
|
-
</button>
|
|
119
|
-
</Tooltip>
|
|
120
|
-
</div>,
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
simulatePointerDown(screen.getByRole("button"));
|
|
124
|
-
focusVisible(screen.getByRole("button"));
|
|
125
|
-
|
|
126
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
127
|
-
fireEvent.click(screen.getByRole("tooltip"));
|
|
128
|
-
|
|
129
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test("close on focus-loss", async () => {
|
|
133
|
-
render(
|
|
134
|
-
<div>
|
|
135
|
-
<Tooltip content="Hello World">
|
|
136
|
-
<button id="testChild" type="submit">
|
|
137
|
-
Hello World
|
|
138
|
-
</button>
|
|
139
|
-
</Tooltip>
|
|
140
|
-
<a href="/#">link</a>
|
|
141
|
-
</div>,
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
simulatePointerDown(screen.getByRole("button"));
|
|
145
|
-
focusVisible(screen.getByRole("button"));
|
|
146
|
-
|
|
147
|
-
await act(async () => {
|
|
148
|
-
expect(screen.getByRole("tooltip")).toBeVisible();
|
|
149
|
-
screen.getByRole("link").focus();
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
expect(screen.queryByRole("tooltip")).toBeNull();
|
|
153
|
-
});
|
|
154
|
-
});
|