@cambly/syntax-core 7.11.0 → 7.12.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.ts +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1039,7 +1039,7 @@ type TapAreaProps = {
|
|
|
1039
1039
|
/**
|
|
1040
1040
|
* The callback to be called when the tap area is clicked
|
|
1041
1041
|
*/
|
|
1042
|
-
onClick: React__default.
|
|
1042
|
+
onClick: (event: React__default.SyntheticEvent<HTMLDivElement>) => void;
|
|
1043
1043
|
/**
|
|
1044
1044
|
* Border radius of the tap area.
|
|
1045
1045
|
*
|
package/dist/index.js
CHANGED
|
@@ -1195,7 +1195,7 @@ function Layer({
|
|
|
1195
1195
|
children,
|
|
1196
1196
|
zIndex = 1
|
|
1197
1197
|
}) {
|
|
1198
|
-
return (0, import_react_dom.createPortal)(
|
|
1198
|
+
return typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
|
|
1199
1199
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1200
1200
|
Box_default,
|
|
1201
1201
|
{
|
|
@@ -1208,7 +1208,7 @@ function Layer({
|
|
|
1208
1208
|
}
|
|
1209
1209
|
),
|
|
1210
1210
|
document.body
|
|
1211
|
-
);
|
|
1211
|
+
) : null;
|
|
1212
1212
|
}
|
|
1213
1213
|
|
|
1214
1214
|
// css-module:./Modal.module.css#css-module
|
|
@@ -1520,6 +1520,14 @@ var TapArea = (0, import_react12.forwardRef)(
|
|
|
1520
1520
|
tabIndex = 0
|
|
1521
1521
|
}, ref) => {
|
|
1522
1522
|
const handleClick = (event) => !disabled ? onClick(event) : void 0;
|
|
1523
|
+
const handleKeyDown = (event) => {
|
|
1524
|
+
if (disabled)
|
|
1525
|
+
return;
|
|
1526
|
+
if (event.key === "Enter" || event.key === " " || event.key === "Space") {
|
|
1527
|
+
event.preventDefault();
|
|
1528
|
+
onClick(event);
|
|
1529
|
+
}
|
|
1530
|
+
};
|
|
1523
1531
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1524
1532
|
"div",
|
|
1525
1533
|
{
|
|
@@ -1533,6 +1541,7 @@ var TapArea = (0, import_react12.forwardRef)(
|
|
|
1533
1541
|
),
|
|
1534
1542
|
"data-testid": dataTestId,
|
|
1535
1543
|
onClick: handleClick,
|
|
1544
|
+
onKeyDown: handleKeyDown,
|
|
1536
1545
|
ref,
|
|
1537
1546
|
role: "button",
|
|
1538
1547
|
tabIndex: disabled ? void 0 : tabIndex,
|