gov-layout 1.2.14 → 1.2.15

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.js CHANGED
@@ -308,6 +308,12 @@ function TrashIcon({ size = 20, className, style } = {}) {
308
308
  /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "14", y1: "11", x2: "14", y2: "17" })
309
309
  ] });
310
310
  }
311
+ var safeCssEscape = (value) => {
312
+ if (typeof CSS !== "undefined" && CSS.escape) {
313
+ return CSS.escape(value);
314
+ }
315
+ return value.replace(/[^a-zA-Z0-9_-]/g, "_");
316
+ };
311
317
  var ICON_MAP = {
312
318
  home: HomeIcon,
313
319
  dashboard: HomeIcon,
@@ -460,11 +466,11 @@ function MenuItemComponent({
460
466
  const hoverBg = isDark ? "#334155" : "var(--color-foundations-fuji-pallet-light, #ebedf5)";
461
467
  if (collapsed && depth === 0) {
462
468
  return /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
463
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@media(hover:hover){.sidebar-btn-${CSS.escape(btnId)}:not([data-active='true']):hover{background-color:${hoverBg}!important}}` }),
469
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@media(hover:hover){.sidebar-btn-${safeCssEscape(btnId)}:not([data-active='true']):hover{background-color:${hoverBg}!important}}` }),
464
470
  /* @__PURE__ */ jsxRuntime.jsx(
465
471
  "button",
466
472
  {
467
- className: `sidebar-btn-${CSS.escape(btnId)}`,
473
+ className: `sidebar-btn-${safeCssEscape(btnId)}`,
468
474
  "data-active": isActive || isChildActive,
469
475
  onClick: handleClick,
470
476
  title: item.title,
@@ -500,11 +506,11 @@ function MenuItemComponent({
500
506
  }
501
507
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
502
508
  /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
503
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@media(hover:hover){.sidebar-btn-${CSS.escape(btnId)}:not([data-active='true']):hover{background-color:${hoverBg}!important}}` }),
509
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@media(hover:hover){.sidebar-btn-${safeCssEscape(btnId)}:not([data-active='true']):hover{background-color:${hoverBg}!important}}` }),
504
510
  /* @__PURE__ */ jsxRuntime.jsxs(
505
511
  "button",
506
512
  {
507
- className: `sidebar-btn-${CSS.escape(btnId)}`,
513
+ className: `sidebar-btn-${safeCssEscape(btnId)}`,
508
514
  "data-active": isActive,
509
515
  onClick: handleClick,
510
516
  style: {