@getflip/swirl-components 0.115.0 → 0.117.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.
Files changed (124) hide show
  1. package/components.json +440 -70
  2. package/dist/cjs/focus-trap.esm-21561e09.js +1145 -0
  3. package/dist/cjs/index-506fe4ea.js +14 -26
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/swirl-app-bar.cjs.entry.js +2 -1
  6. package/dist/cjs/swirl-app-icon.cjs.entry.js +1 -3
  7. package/dist/cjs/swirl-app-layout_6.cjs.entry.js +1 -1
  8. package/dist/cjs/swirl-badge.cjs.entry.js +1 -1
  9. package/dist/cjs/swirl-components.cjs.js +1 -1
  10. package/dist/cjs/swirl-file-viewer_7.cjs.entry.js +5 -2
  11. package/dist/cjs/swirl-icon-arrow-back_5.cjs.entry.js +87 -0
  12. package/dist/cjs/swirl-icon-dock-left.cjs.entry.js +23 -0
  13. package/dist/cjs/swirl-modal.cjs.entry.js +2 -1143
  14. package/dist/cjs/swirl-pdf-reader.cjs.entry.js +6 -1
  15. package/dist/cjs/swirl-shell-layout.cjs.entry.js +87 -75
  16. package/dist/cjs/swirl-shell-navigation-item.cjs.entry.js +1 -1
  17. package/dist/cjs/swirl-visually-hidden.cjs.entry.js +1 -1
  18. package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/swirl-app-bar/swirl-app-bar.js +20 -1
  21. package/dist/collection/components/swirl-app-icon/swirl-app-icon.css +3 -22
  22. package/dist/collection/components/swirl-app-icon/swirl-app-icon.js +0 -20
  23. package/dist/collection/components/swirl-app-layout/swirl-app-layout.css +38 -4
  24. package/dist/collection/components/swirl-badge/swirl-badge.css +18 -1
  25. package/dist/collection/components/swirl-badge/swirl-badge.js +1 -1
  26. package/dist/collection/components/swirl-file-viewer/swirl-file-viewer.js +19 -1
  27. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.js +21 -1
  28. package/dist/collection/components/swirl-icon/icons/swirl-icon-dock-left.js +52 -0
  29. package/dist/collection/components/swirl-pdf-reader/swirl-pdf-reader.js +54 -1
  30. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.css +353 -132
  31. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.js +322 -95
  32. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.spec.js +8 -58
  33. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.stories.js +81 -102
  34. package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.css +46 -35
  35. package/dist/collection/components/swirl-visually-hidden/swirl-visually-hidden.js +1 -1
  36. package/dist/collection/components/swirl-visually-hidden/swirl-visually-hidden.spec.js +0 -3
  37. package/dist/components/assets/images/flip-logo.png +0 -0
  38. package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
  39. package/dist/components/focus-trap.esm.js +1143 -0
  40. package/dist/components/swirl-app-bar.js +3 -1
  41. package/dist/components/swirl-app-icon.js +1 -4
  42. package/dist/components/swirl-app-layout2.js +1 -1
  43. package/dist/components/swirl-badge2.js +1 -1
  44. package/dist/components/swirl-file-viewer-pdf2.js +4 -1
  45. package/dist/components/swirl-file-viewer2.js +3 -1
  46. package/dist/components/swirl-icon-arrow-back.js +1 -35
  47. package/dist/{esm/swirl-icon-arrow-back.entry.js → components/swirl-icon-arrow-back2.js} +26 -8
  48. package/dist/components/swirl-icon-arrow-forward.js +1 -35
  49. package/dist/{esm/swirl-icon-arrow-forward.entry.js → components/swirl-icon-arrow-forward2.js} +26 -8
  50. package/dist/components/swirl-icon-dock-left.d.ts +11 -0
  51. package/dist/components/swirl-icon-dock-left.js +40 -0
  52. package/dist/components/swirl-icon-double-arrow-left.js +1 -35
  53. package/dist/{esm/swirl-icon-double-arrow-left.entry.js → components/swirl-icon-double-arrow-left2.js} +26 -8
  54. package/dist/components/swirl-icon-double-arrow-right.js +1 -35
  55. package/dist/{esm/swirl-icon-double-arrow-right.entry.js → components/swirl-icon-double-arrow-right2.js} +26 -8
  56. package/dist/components/swirl-icon-menu.js +1 -35
  57. package/dist/{esm/swirl-icon-menu.entry.js → components/swirl-icon-menu2.js} +26 -8
  58. package/dist/components/swirl-modal.js +1 -1142
  59. package/dist/components/swirl-pdf-reader.js +8 -2
  60. package/dist/components/swirl-shell-layout.js +150 -89
  61. package/dist/components/swirl-shell-navigation-item.js +1 -1
  62. package/dist/components/swirl-visually-hidden2.js +2 -3
  63. package/dist/esm/focus-trap.esm-37cd2d2b.js +1143 -0
  64. package/dist/esm/index-99d0060d.js +14 -26
  65. package/dist/esm/loader.js +1 -1
  66. package/dist/esm/swirl-app-bar.entry.js +2 -1
  67. package/dist/esm/swirl-app-icon.entry.js +1 -3
  68. package/dist/esm/swirl-app-layout_6.entry.js +1 -1
  69. package/dist/esm/swirl-badge.entry.js +1 -1
  70. package/dist/esm/swirl-components.js +1 -1
  71. package/dist/esm/swirl-file-viewer_7.entry.js +5 -2
  72. package/dist/esm/swirl-icon-arrow-back_5.entry.js +79 -0
  73. package/dist/esm/swirl-icon-dock-left.entry.js +19 -0
  74. package/dist/esm/swirl-modal.entry.js +1 -1142
  75. package/dist/esm/swirl-pdf-reader.entry.js +7 -2
  76. package/dist/esm/swirl-shell-layout.entry.js +88 -76
  77. package/dist/esm/swirl-shell-navigation-item.entry.js +1 -1
  78. package/dist/esm/swirl-visually-hidden.entry.js +1 -1
  79. package/dist/swirl-components/p-08fd60a5.entry.js +1 -0
  80. package/dist/swirl-components/p-0ac2eb84.entry.js +1 -0
  81. package/dist/swirl-components/p-11c6c9ba.entry.js +1 -0
  82. package/dist/swirl-components/p-25b4973d.entry.js +1 -0
  83. package/dist/swirl-components/p-262771e5.entry.js +1 -0
  84. package/dist/swirl-components/p-353eab4c.entry.js +1 -0
  85. package/dist/swirl-components/p-3795fbb4.entry.js +1 -0
  86. package/dist/swirl-components/p-40ee5f22.entry.js +1 -0
  87. package/dist/swirl-components/{p-05d56f14.entry.js → p-4368ba9d.entry.js} +2 -2
  88. package/dist/swirl-components/p-4a69e7f3.entry.js +1 -0
  89. package/dist/swirl-components/p-76c36ee9.entry.js +1 -0
  90. package/dist/swirl-components/p-7c4a4b66.entry.js +1 -0
  91. package/dist/swirl-components/p-c2e1dfdb.js +10 -0
  92. package/dist/swirl-components/swirl-components.esm.js +1 -1
  93. package/dist/types/components/swirl-app-bar/swirl-app-bar.d.ts +1 -0
  94. package/dist/types/components/swirl-app-icon/swirl-app-icon.d.ts +0 -1
  95. package/dist/types/components/swirl-badge/swirl-badge.d.ts +1 -1
  96. package/dist/types/components/swirl-file-viewer/swirl-file-viewer.d.ts +1 -0
  97. package/dist/types/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.d.ts +6 -0
  98. package/dist/types/components/swirl-icon/icons/swirl-icon-dock-left.d.ts +5 -0
  99. package/dist/types/components/swirl-pdf-reader/swirl-pdf-reader.d.ts +4 -0
  100. package/dist/types/components/swirl-shell-layout/swirl-shell-layout.d.ts +42 -25
  101. package/dist/types/components.d.ts +62 -11
  102. package/dist/typings.d.ts +1 -0
  103. package/icons.json +1 -1
  104. package/package.json +2 -2
  105. package/vscode-data.json +70 -6
  106. package/dist/cjs/swirl-icon-arrow-back.cjs.entry.js +0 -23
  107. package/dist/cjs/swirl-icon-arrow-forward.cjs.entry.js +0 -23
  108. package/dist/cjs/swirl-icon-double-arrow-left.cjs.entry.js +0 -23
  109. package/dist/cjs/swirl-icon-double-arrow-right.cjs.entry.js +0 -23
  110. package/dist/cjs/swirl-icon-menu.cjs.entry.js +0 -23
  111. package/dist/swirl-components/p-3a2abee9.entry.js +0 -1
  112. package/dist/swirl-components/p-441c8210.entry.js +0 -1
  113. package/dist/swirl-components/p-4a84e63d.entry.js +0 -1
  114. package/dist/swirl-components/p-54e4ff0b.entry.js +0 -1
  115. package/dist/swirl-components/p-5da3a9a8.entry.js +0 -1
  116. package/dist/swirl-components/p-645a878c.entry.js +0 -1
  117. package/dist/swirl-components/p-79be22ea.entry.js +0 -10
  118. package/dist/swirl-components/p-97668c59.entry.js +0 -1
  119. package/dist/swirl-components/p-af636e9c.entry.js +0 -1
  120. package/dist/swirl-components/p-be2cf7ee.entry.js +0 -1
  121. package/dist/swirl-components/p-c4d4a99d.entry.js +0 -1
  122. package/dist/swirl-components/p-ca78767e.entry.js +0 -1
  123. package/dist/swirl-components/p-d2fc7935.entry.js +0 -1
  124. package/dist/swirl-components/p-f83a0b0f.entry.js +0 -1
@@ -13,6 +13,8 @@ const swirlPdfReaderCss = ":host{--thumbnails-width:7rem;display:block}:host *{b
13
13
  const SwirlPdfReader = class {
14
14
  constructor(hostRef) {
15
15
  index.registerInstance(this, hostRef);
16
+ this.modalClose = index.createEvent(this, "modalClose", 7);
17
+ this.modalOpen = index.createEvent(this, "modalOpen", 7);
16
18
  this.desktopZoomSteps = [0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4];
17
19
  this.mobileZoomSteps = [0.5, 0.75, 1, 1.25, 1.5];
18
20
  this.toggleViewMode = () => {
@@ -85,6 +87,7 @@ const SwirlPdfReader = class {
85
87
  this.label = undefined;
86
88
  this.menuLabel = "File menu";
87
89
  this.menuTriggerLabel = "Open file menu";
90
+ this.pdfWorkerSrc = undefined;
88
91
  this.printButtonLabel = "Print PDF";
89
92
  this.sideBySideButtonLabel = "Toggle side by side view";
90
93
  this.thumbnailButtonLabel = "Scroll to page";
@@ -127,6 +130,7 @@ const SwirlPdfReader = class {
127
130
  async open() {
128
131
  this.modal.show();
129
132
  this.active = true;
133
+ this.modalOpen.emit();
130
134
  }
131
135
  /**
132
136
  * Close the reader.
@@ -141,6 +145,7 @@ const SwirlPdfReader = class {
141
145
  this.modal.hide();
142
146
  this.closing = false;
143
147
  this.active = false;
148
+ this.modalClose.emit();
144
149
  }, 150);
145
150
  }
146
151
  lockBodyScroll() {
@@ -173,7 +178,7 @@ const SwirlPdfReader = class {
173
178
  "pdf-reader__thumbnail--active": this.visiblePages[0] === index$2 + 1,
174
179
  });
175
180
  return (index.h("button", { "aria-label": `${this.thumbnailButtonLabel} ${index$2 + 1}`, class: thumbnailClassName, onClick: this.onThumbnailClick(index$2), type: "button" }, index.h("img", { src: thumbnail.toDataURL("image/png"), alt: "" })));
176
- })), index.h("swirl-file-viewer", { active: this.active, class: "pdf-reader__viewer", file: this.file, onActivate: this.onActivate, onVisiblePagesChange: this.onVisiblePagesChange, ref: (el) => (this.viewer = el), type: "application/pdf", viewMode: this.viewMode, zoom: this.zoom }), index.h("div", { class: "pdf-reader__mobile-zoom-controls" }, index.h("button", { "aria-label": this.autoZoomLabel, class: "pdf-reader__mobile-zoom-button", onClick: this.onZoomAutoButtonClick, type: "button" }, this.zoom === "auto" ? (index.h("swirl-icon-fullscreen-exit", null)) : (index.h("swirl-icon-fullscreen", null))), index.h("button", { "aria-label": this.zoomInButtonLabel, class: "pdf-reader__mobile-zoom-button", disabled: this.zoom === this.zoomSteps[this.zoomSteps.length - 1], onClick: this.onZoomInButtonClick, type: "button" }, index.h("swirl-icon-add", null)), index.h("button", { "aria-label": this.zoomOutButtonLabel, class: "pdf-reader__mobile-zoom-button", disabled: this.zoom === this.zoomSteps[0], onClick: this.onZoomOutButtonClick, type: "button" }, index.h("swirl-icon-remove", null))))), index.h("swirl-popover", { animation: "scale-in-y", disableScrollLock: true, id: "menu", label: this.menuLabel, placement: "bottom-end", ref: (el) => (this.menu = el) }, index.h("swirl-stack", null, index.h("div", { class: "pdf-reader__meta" }, index.h("div", { class: "pdf-reader__file-icon" }, index.h("svg", { fill: "none", height: "36", viewBox: "0 0 24 36", width: "24" }, index.h("path", { d: "M7.01755 21.6V15.192H8.39455C8.64655 15.192 8.86855 15.225 9.06055 15.291C9.25255 15.357 9.42655 15.474 9.58255 15.642C9.73855 15.81 9.84655 16.008 9.90655 16.236C9.96655 16.458 9.99655 16.761 9.99655 17.145C9.99655 17.433 9.97855 17.676 9.94255 17.874C9.91255 18.072 9.84355 18.258 9.73555 18.432C9.60955 18.642 9.44155 18.807 9.23155 18.927C9.02155 19.041 8.74555 19.098 8.40355 19.098H7.93555V21.6H7.01755ZM7.93555 16.056V18.234H8.37655C8.56255 18.234 8.70655 18.207 8.80855 18.153C8.91055 18.099 8.98555 18.024 9.03355 17.928C9.08155 17.838 9.10855 17.727 9.11455 17.595C9.12655 17.463 9.13255 17.316 9.13255 17.154C9.13255 17.004 9.12955 16.863 9.12355 16.731C9.11755 16.593 9.09055 16.473 9.04255 16.371C8.99455 16.269 8.92255 16.191 8.82655 16.137C8.73055 16.083 8.59255 16.056 8.41255 16.056H7.93555Z", fill: "white" }), index.h("path", { d: "M10.6826 21.6V15.192H12.0416C12.5696 15.192 12.9686 15.336 13.2386 15.624C13.5146 15.912 13.6526 16.32 13.6526 16.848V19.845C13.6526 20.445 13.5056 20.889 13.2116 21.177C12.9236 21.459 12.5066 21.6 11.9606 21.6H10.6826ZM11.6006 16.056V20.736H12.0236C12.2816 20.736 12.4646 20.673 12.5726 20.547C12.6806 20.415 12.7346 20.211 12.7346 19.935V16.848C12.7346 16.596 12.6836 16.401 12.5816 16.263C12.4796 16.125 12.2936 16.056 12.0236 16.056H11.6006Z", fill: "white" }), index.h("path", { d: "M14.5146 21.6V15.192H17.2506V16.056H15.4326V18H17.0166V18.864H15.4326V21.6H14.5146Z", fill: "white" }), index.h("path", { d: "M3.59961 9.00001C3.59961 8.0059 4.4055 7.20001 5.39961 7.20001H14.854C15.3314 7.20001 15.7893 7.38965 16.1268 7.72722L19.8724 11.4728C20.21 11.8104 20.3996 12.2682 20.3996 12.7456V27C20.3996 27.9941 19.5937 28.8 18.5996 28.8H5.39961C4.4055 28.8 3.59961 27.9941 3.59961 27V9.00001Z", fill: "#FF574D" }), index.h("path", { d: "M15.5996 7.36166V10.2C15.5996 11.1941 16.4055 12 17.3996 12H20.2379C20.3237 12.1884 20.3768 12.3913 20.3937 12.6H17.3996C16.0785 12.6 15.0067 11.5325 14.9996 10.213L14.9996 7.20587C15.2083 7.2228 15.4112 7.27593 15.5996 7.36166Z", fill: "white" }), index.h("path", { d: "M7.01755 21.6V15.192H8.39455C8.64655 15.192 8.86855 15.225 9.06055 15.291C9.25255 15.357 9.42655 15.474 9.58255 15.642C9.73855 15.81 9.84655 16.008 9.90655 16.236C9.96655 16.458 9.99655 16.761 9.99655 17.145C9.99655 17.433 9.97855 17.676 9.94255 17.874C9.91255 18.072 9.84355 18.258 9.73555 18.432C9.60955 18.642 9.44155 18.807 9.23155 18.927C9.02155 19.041 8.74555 19.098 8.40355 19.098H7.93555V21.6H7.01755ZM7.93555 16.056V18.234H8.37655C8.56255 18.234 8.70655 18.207 8.80855 18.153C8.91055 18.099 8.98555 18.024 9.03355 17.928C9.08155 17.838 9.10855 17.727 9.11455 17.595C9.12655 17.463 9.13255 17.316 9.13255 17.154C9.13255 17.004 9.12955 16.863 9.12355 16.731C9.11755 16.593 9.09055 16.473 9.04255 16.371C8.99455 16.269 8.92255 16.191 8.82655 16.137C8.73055 16.083 8.59255 16.056 8.41255 16.056H7.93555Z", fill: "white" }), index.h("path", { d: "M10.6826 21.6V15.192H12.0416C12.5696 15.192 12.9686 15.336 13.2386 15.624C13.5146 15.912 13.6526 16.32 13.6526 16.848V19.845C13.6526 20.445 13.5056 20.889 13.2116 21.177C12.9236 21.459 12.5066 21.6 11.9606 21.6H10.6826ZM11.6006 16.056V20.736H12.0236C12.2816 20.736 12.4646 20.673 12.5726 20.547C12.6806 20.415 12.7346 20.211 12.7346 19.935V16.848C12.7346 16.596 12.6836 16.401 12.5816 16.263C12.4796 16.125 12.2936 16.056 12.0236 16.056H11.6006Z", fill: "white" }), index.h("path", { d: "M14.5146 21.6V15.192H17.2506V16.056H15.4326V18H17.0166V18.864H15.4326V21.6H14.5146Z", fill: "white" }))), index.h("div", { class: "pdf-reader__file-info" }, index.h("swirl-text", { truncate: true, weight: "semibold" }, this.label), index.h("swirl-text", { color: "subdued", size: "sm", truncate: true }, this.fileTypeLabel))), index.h("swirl-separator", null), index.h("swirl-action-list", null, index.h("swirl-action-list-item", { class: "pdf-reader__print-button", icon: "<swirl-icon-print></swirl-icon-print>", label: this.printButtonLabel, onClick: this.onPrintButtonClick }), index.h("swirl-action-list-item", { class: "pdf-reader__download-button", disabled: this.downloading, icon: !this.downloading
181
+ })), index.h("swirl-file-viewer", { active: this.active, class: "pdf-reader__viewer", file: this.file, onActivate: this.onActivate, onVisiblePagesChange: this.onVisiblePagesChange, pdfWorkerSrc: this.pdfWorkerSrc, ref: (el) => (this.viewer = el), type: "application/pdf", viewMode: this.viewMode, zoom: this.zoom }), index.h("div", { class: "pdf-reader__mobile-zoom-controls" }, index.h("button", { "aria-label": this.autoZoomLabel, class: "pdf-reader__mobile-zoom-button", onClick: this.onZoomAutoButtonClick, type: "button" }, this.zoom === "auto" ? (index.h("swirl-icon-fullscreen-exit", null)) : (index.h("swirl-icon-fullscreen", null))), index.h("button", { "aria-label": this.zoomInButtonLabel, class: "pdf-reader__mobile-zoom-button", disabled: this.zoom === this.zoomSteps[this.zoomSteps.length - 1], onClick: this.onZoomInButtonClick, type: "button" }, index.h("swirl-icon-add", null)), index.h("button", { "aria-label": this.zoomOutButtonLabel, class: "pdf-reader__mobile-zoom-button", disabled: this.zoom === this.zoomSteps[0], onClick: this.onZoomOutButtonClick, type: "button" }, index.h("swirl-icon-remove", null))))), index.h("swirl-popover", { animation: "scale-in-y", disableScrollLock: true, id: "menu", label: this.menuLabel, placement: "bottom-end", ref: (el) => (this.menu = el) }, index.h("swirl-stack", null, index.h("div", { class: "pdf-reader__meta" }, index.h("div", { class: "pdf-reader__file-icon" }, index.h("svg", { fill: "none", height: "36", viewBox: "0 0 24 36", width: "24" }, index.h("path", { d: "M7.01755 21.6V15.192H8.39455C8.64655 15.192 8.86855 15.225 9.06055 15.291C9.25255 15.357 9.42655 15.474 9.58255 15.642C9.73855 15.81 9.84655 16.008 9.90655 16.236C9.96655 16.458 9.99655 16.761 9.99655 17.145C9.99655 17.433 9.97855 17.676 9.94255 17.874C9.91255 18.072 9.84355 18.258 9.73555 18.432C9.60955 18.642 9.44155 18.807 9.23155 18.927C9.02155 19.041 8.74555 19.098 8.40355 19.098H7.93555V21.6H7.01755ZM7.93555 16.056V18.234H8.37655C8.56255 18.234 8.70655 18.207 8.80855 18.153C8.91055 18.099 8.98555 18.024 9.03355 17.928C9.08155 17.838 9.10855 17.727 9.11455 17.595C9.12655 17.463 9.13255 17.316 9.13255 17.154C9.13255 17.004 9.12955 16.863 9.12355 16.731C9.11755 16.593 9.09055 16.473 9.04255 16.371C8.99455 16.269 8.92255 16.191 8.82655 16.137C8.73055 16.083 8.59255 16.056 8.41255 16.056H7.93555Z", fill: "white" }), index.h("path", { d: "M10.6826 21.6V15.192H12.0416C12.5696 15.192 12.9686 15.336 13.2386 15.624C13.5146 15.912 13.6526 16.32 13.6526 16.848V19.845C13.6526 20.445 13.5056 20.889 13.2116 21.177C12.9236 21.459 12.5066 21.6 11.9606 21.6H10.6826ZM11.6006 16.056V20.736H12.0236C12.2816 20.736 12.4646 20.673 12.5726 20.547C12.6806 20.415 12.7346 20.211 12.7346 19.935V16.848C12.7346 16.596 12.6836 16.401 12.5816 16.263C12.4796 16.125 12.2936 16.056 12.0236 16.056H11.6006Z", fill: "white" }), index.h("path", { d: "M14.5146 21.6V15.192H17.2506V16.056H15.4326V18H17.0166V18.864H15.4326V21.6H14.5146Z", fill: "white" }), index.h("path", { d: "M3.59961 9.00001C3.59961 8.0059 4.4055 7.20001 5.39961 7.20001H14.854C15.3314 7.20001 15.7893 7.38965 16.1268 7.72722L19.8724 11.4728C20.21 11.8104 20.3996 12.2682 20.3996 12.7456V27C20.3996 27.9941 19.5937 28.8 18.5996 28.8H5.39961C4.4055 28.8 3.59961 27.9941 3.59961 27V9.00001Z", fill: "#FF574D" }), index.h("path", { d: "M15.5996 7.36166V10.2C15.5996 11.1941 16.4055 12 17.3996 12H20.2379C20.3237 12.1884 20.3768 12.3913 20.3937 12.6H17.3996C16.0785 12.6 15.0067 11.5325 14.9996 10.213L14.9996 7.20587C15.2083 7.2228 15.4112 7.27593 15.5996 7.36166Z", fill: "white" }), index.h("path", { d: "M7.01755 21.6V15.192H8.39455C8.64655 15.192 8.86855 15.225 9.06055 15.291C9.25255 15.357 9.42655 15.474 9.58255 15.642C9.73855 15.81 9.84655 16.008 9.90655 16.236C9.96655 16.458 9.99655 16.761 9.99655 17.145C9.99655 17.433 9.97855 17.676 9.94255 17.874C9.91255 18.072 9.84355 18.258 9.73555 18.432C9.60955 18.642 9.44155 18.807 9.23155 18.927C9.02155 19.041 8.74555 19.098 8.40355 19.098H7.93555V21.6H7.01755ZM7.93555 16.056V18.234H8.37655C8.56255 18.234 8.70655 18.207 8.80855 18.153C8.91055 18.099 8.98555 18.024 9.03355 17.928C9.08155 17.838 9.10855 17.727 9.11455 17.595C9.12655 17.463 9.13255 17.316 9.13255 17.154C9.13255 17.004 9.12955 16.863 9.12355 16.731C9.11755 16.593 9.09055 16.473 9.04255 16.371C8.99455 16.269 8.92255 16.191 8.82655 16.137C8.73055 16.083 8.59255 16.056 8.41255 16.056H7.93555Z", fill: "white" }), index.h("path", { d: "M10.6826 21.6V15.192H12.0416C12.5696 15.192 12.9686 15.336 13.2386 15.624C13.5146 15.912 13.6526 16.32 13.6526 16.848V19.845C13.6526 20.445 13.5056 20.889 13.2116 21.177C12.9236 21.459 12.5066 21.6 11.9606 21.6H10.6826ZM11.6006 16.056V20.736H12.0236C12.2816 20.736 12.4646 20.673 12.5726 20.547C12.6806 20.415 12.7346 20.211 12.7346 19.935V16.848C12.7346 16.596 12.6836 16.401 12.5816 16.263C12.4796 16.125 12.2936 16.056 12.0236 16.056H11.6006Z", fill: "white" }), index.h("path", { d: "M14.5146 21.6V15.192H17.2506V16.056H15.4326V18H17.0166V18.864H15.4326V21.6H14.5146Z", fill: "white" }))), index.h("div", { class: "pdf-reader__file-info" }, index.h("swirl-text", { truncate: true, weight: "semibold" }, this.label), index.h("swirl-text", { color: "subdued", size: "sm", truncate: true }, this.fileTypeLabel))), index.h("swirl-separator", null), index.h("swirl-action-list", null, index.h("swirl-action-list-item", { class: "pdf-reader__print-button", icon: "<swirl-icon-print></swirl-icon-print>", label: this.printButtonLabel, onClick: this.onPrintButtonClick }), index.h("swirl-action-list-item", { class: "pdf-reader__download-button", disabled: this.downloading, icon: !this.downloading
177
182
  ? "<swirl-icon-download></swirl-icon-download>"
178
183
  : '<swirl-spinner size="xs"></swirl-spinner>', label: this.downloadButtonLabel, onClick: this.onDownloadButtonClick }), index.h("slot", { name: "menu-items" })))))));
179
184
  }
@@ -4,105 +4,117 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-506fe4ea.js');
6
6
  const index$1 = require('./index-2ddd0598.js');
7
- const utils = require('./utils-2b6367e4.js');
7
+ const focusTrap_esm = require('./focus-trap.esm-21561e09.js');
8
8
 
9
- const swirlShellLayoutCss = ":host{--extended-sidebar-width:17rem;--collapsed-sidebar-width:4rem;display:flex;width:100%;height:100%}:host *{box-sizing:border-box}.shell-layout{display:grid;width:100%;min-height:100%;transition:grid-template-columns 0.2s;grid-template-columns:0 1fr;grid-template-rows:auto 1fr;grid-template-areas:\"banner banner\"\n \"sidebar main\"}@media (min-width: 992px){.shell-layout{grid-template-columns:var(--extended-sidebar-width) 1fr}}.shell-layout--collapsed-sidebar{grid-template-columns:0 1fr}@media (min-width: 992px){.shell-layout--collapsed-sidebar:not(.shell-layout--collapsing) .shell-layout__sidebar-wrapper.shell-layout__sidebar-wrapper--hovered .shell-layout__sidebar,.shell-layout--collapsed-sidebar:not(.shell-layout--collapsing) .shell-layout__sidebar-wrapper:focus-within .shell-layout__sidebar{width:var(--extended-sidebar-width);box-shadow:0 0.75rem 2rem rgba(25, 26, 28, 0.12),\n 0 0.25rem 0.75rem rgba(25, 26, 28, 0.08)}}.shell-layout--collapsed-sidebar .shell-layout__sidebar-wrapper{transform:translate3d(-100%, 0, 0)}.shell-layout--collapsed-sidebar .shell-layout__sidebar-wrapper .shell-layout__sidebar{width:100%;box-shadow:none}@media (min-width: 992px){.shell-layout--collapsed-sidebar .shell-layout__sidebar-wrapper{max-width:var(--collapsed-sidebar-width);flex-basis:var(--collapsed-sidebar-width);transform:none}.shell-layout--collapsed-sidebar .shell-layout__sidebar-wrapper:not(.shell-layout__sidebar-wrapper--hovered):not(:focus-within) .shell-layout__sidebar{box-shadow:none}.shell-layout--collapsed-sidebar .shell-layout__sidebar-wrapper:not(.shell-layout__sidebar-wrapper--hovered):not(:focus-within) .shell-layout__collapsed-logo{display:inline-flex;justify-content:center;align-items:center}.shell-layout--collapsed-sidebar .shell-layout__sidebar-wrapper:not(.shell-layout__sidebar-wrapper--hovered):not(:focus-within) .shell-layout__expanded-logo{display:none}.shell-layout--collapsed-sidebar .shell-layout__sidebar-wrapper:not(.shell-layout__sidebar-wrapper--hovered):not(:focus-within) .shell-layout__toggle{display:none}}@media (min-width: 992px){.shell-layout--collapsed-sidebar{grid-template-columns:var(--collapsed-sidebar-width) 1fr}}.shell-layout--hide-sidebar{grid-template-columns:1fr;grid-template-areas:\"banner\"\n \"main\"}@media (min-width: 992px){.shell-layout--hide-sidebar{grid-template-columns:1fr}}.shell-layout__banner{grid-area:banner}.shell-layout__sidebar-wrapper{position:absolute;z-index:2;top:0;bottom:0;left:0;width:100%;max-width:var(--extended-sidebar-width);min-height:0;flex-basis:var(--extended-sidebar-width);flex-shrink:0;transition:max-width 0.2s, transform 0.2s;grid-area:sidebar}@media (min-width: 992px){.shell-layout__sidebar-wrapper{position:relative;inset:auto}}.shell-layout__sidebar{display:flex;width:var(--extended-sidebar-width);height:100%;border-right:var(--s-border-width-default) solid var(--s-border-default);flex-direction:column;transition:box-shadow 0.2s, width 0.2s;box-shadow:0 0.75rem 2rem rgba(25, 26, 28, 0.12),\n 0 0.25rem 0.75rem rgba(25, 26, 28, 0.08)}@media (min-width: 992px){.shell-layout__sidebar{box-shadow:none}}.shell-layout__header{flex-shrink:0;border-bottom:var(--s-border-width-default) solid var(--s-border-default);background-color:var(--s-background-default)}.shell-layout__logo-bar{display:flex;overflow:hidden;align-items:center;height:4.5rem}.shell-layout__expanded-logo{padding-right:var(--s-space-12);padding-left:var(--s-space-12);flex-grow:1}.shell-layout__collapsed-logo{display:none;padding-right:var(--s-space-12);padding-left:var(--s-space-12);flex-grow:1}.shell-layout__toggle{padding-right:var(--s-space-16);padding-left:var(--s-space-12);flex-grow:0;flex-shrink:0}.shell-layout__mobile-toggle{position:absolute;z-index:2;top:var(--s-space-12);left:calc(100% + var(--s-space-16))}@media (min-width: 992px){.shell-layout__mobile-toggle{display:none}}.shell-layout__main-navigation{overflow:auto;flex-grow:1;background-color:var(--s-background-default)}.shell-layout__main{min-height:0;background-color:var(--s-background-default);grid-area:main}.shell-layout__main>*,.shell-layout__main ::slotted(*){height:100%}.shell-layout__backdrop{position:fixed;z-index:1;background-color:rgba(0, 0, 0, 0.4);animation:shell-layout-backdrop-fade-in 0.1s;inset:0}@media (min-width: 992px){.shell-layout__backdrop{display:none}}.shell-layout__backdrop--fading{animation:shell-layout-backdrop-fade-out 0.2s}@keyframes shell-layout-backdrop-fade-in{from{opacity:0}to{opacity:1}}@keyframes shell-layout-backdrop-fade-out{from{opacity:1}to{opacity:0}}";
9
+ const swirlShellLayoutCss = ".sc-swirl-shell-layout-h{--swirl-shell-background:var(--s-surface-sunken-default);--swirl-shell-text-color:var(--s-text-default);--swirl-shell-header-height:3.25rem;--swirl-shell-collapsed-nav-width:3.75rem;--swirl-shell-extended-nav-width:14rem;--swirl-shell-sidebar-width:21rem;display:flex;width:100%;height:100%}.sc-swirl-shell-layout-h *.sc-swirl-shell-layout{box-sizing:border-box}.shell-layout.sc-swirl-shell-layout{display:grid;width:100%;min-height:100%;background-color:var(--swirl-shell-background);transition:grid-template-columns 0.2s;grid-template-columns:0 1fr 0;grid-template-rows:1fr;grid-template-areas:\"nav main\"}@media (min-width: 992px){.shell-layout.sc-swirl-shell-layout{padding-right:var(--s-space-8);padding-bottom:var(--s-space-8);gap:var(--s-space-8);grid-template-columns:var(--swirl-shell-extended-nav-width) 1fr 0;grid-template-rows:var(--swirl-shell-header-height) 1fr;grid-template-areas:\"header header header\"\n \"nav main sidebar\"}}.shell-layout--branded-header.sc-swirl-shell-layout .shell-layout__header.sc-swirl-shell-layout{border-bottom:none;color:var(--s-text-on-action-primary);background-color:var(--s-action-primary-default)}.shell-layout--branded-header.sc-swirl-shell-layout .shell-layout__header.sc-swirl-shell-layout .shell-layout__header-tool.sc-swirl-shell-layout{color:var(--s-text-on-action-primary);background-color:var(--s-action-primary-default)}.shell-layout--branded-header.sc-swirl-shell-layout .shell-layout__header.sc-swirl-shell-layout .shell-layout__header-tool.sc-swirl-shell-layout:hover{background-color:var(--s-action-primary-hovered)}.shell-layout--branded-header.sc-swirl-shell-layout .shell-layout__header.sc-swirl-shell-layout .shell-layout__header-tool.sc-swirl-shell-layout:active{background-color:var(--s-action-primary-pressed)}.shell-layout--branded-header.sc-swirl-shell-layout .shell-layout__header.sc-swirl-shell-layout .shell-layout__header-tool.sc-swirl-shell-layout swirl-badge.sc-swirl-shell-layout{--swirl-badge-border-color:var(--s-action-primary-default)}.shell-layout--navigation-collapsed.sc-swirl-shell-layout .shell-layout__navigation-toggle.sc-swirl-shell-layout:hover swirl-icon-double-arrow-left.sc-swirl-shell-layout{display:none}.shell-layout--navigation-collapsed.sc-swirl-shell-layout .shell-layout__navigation-toggle.sc-swirl-shell-layout:hover swirl-icon-double-arrow-right.sc-swirl-shell-layout{display:inline-flex}@media (min-width: 992px){.shell-layout--navigation-collapsed.sc-swirl-shell-layout{grid-template-columns:var(--swirl-shell-collapsed-nav-width) 1fr 0}}@media (min-width: 1440px){.shell-layout--sidebar-active.shell-layout--navigation-collapsed.sc-swirl-shell-layout{grid-template-columns:var(--swirl-shell-collapsed-nav-width) 1fr var(\n --swirl-shell-sidebar-width\n )}}@media (min-width: 1440px){.shell-layout--sidebar-active.sc-swirl-shell-layout .shell-layout__main.sc-swirl-shell-layout{width:100%}}@media (min-width: 992px){.shell-layout--sidebar-active.sc-swirl-shell-layout .shell-layout__sidebar-body.sc-swirl-shell-layout{border:0.0625rem solid var(--s-border-default);transform:translate3d(0, 0, 0)}}@media (min-width: 1440px){.shell-layout--sidebar-active.sc-swirl-shell-layout{grid-template-columns:var(--swirl-shell-extended-nav-width) 1fr var(\n --swirl-shell-sidebar-width\n )}}.shell-layout--mobile-navigation-active.sc-swirl-shell-layout .shell-layout__nav.sc-swirl-shell-layout{transform:translate3d(0, 0, 0);box-shadow:var(--s-shadow-level-3)}@media (min-width: 992px){.shell-layout--mobile-navigation-active.sc-swirl-shell-layout .shell-layout__nav.sc-swirl-shell-layout{transform:none;box-shadow:none}}.shell-layout--mobile-navigation-active.sc-swirl-shell-layout .shell-layout__mobile-nav-backdrop.sc-swirl-shell-layout{display:block}@media (min-width: 992px){.shell-layout--mobile-navigation-active.sc-swirl-shell-layout .shell-layout__mobile-nav-backdrop.sc-swirl-shell-layout{display:none}}.shell-layout__header.sc-swirl-shell-layout{position:relative;display:none;width:calc(100% + var(--s-space-8));padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);justify-content:space-between;align-items:center;border-bottom:0.0625rem solid var(--s-border-default);color:var(--swirl-shell-text-color);grid-area:header}@media (min-width: 992px){.shell-layout__header.sc-swirl-shell-layout{display:flex}}.shell-layout__skip-link.sc-swirl-shell-layout{position:absolute;z-index:9;top:0;left:0;padding:var(--s-space-4);border:none;color:var(--swirl-shell-text-color);background-color:var(--swirl-shell-background);font:inherit;cursor:pointer}.shell-layout__skip-link.sc-swirl-shell-layout:not(:focus):not(:active){position:absolute;overflow:hidden;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%)}.shell-layout__header-left.sc-swirl-shell-layout{display:flex;flex-basis:8rem;flex-shrink:0;gap:var(--s-space-8)}.shell-layout__header-right.sc-swirl-shell-layout{display:flex;flex-basis:8rem;flex-shrink:0;justify-content:flex-end;align-items:center;gap:var(--s-space-8)}.shell-layout__logo.sc-swirl-shell-layout{display:flex;flex-grow:1;justify-content:center;align-items:center}.shell-layout__logo.sc-swirl-shell-layout-s>img{max-height:1.75rem}.shell-layout__header-tool.sc-swirl-shell-layout{position:relative;width:2.25rem;height:2.25rem;padding:var(--s-space-8);border:none;border-radius:var(--s-border-radius-sm);color:var(--swirl-shell-text-color);background-color:var(--s-surface-sunken-default);font:inherit;cursor:pointer}.shell-layout__header-tool.sc-swirl-shell-layout:hover{background-color:var(--s-surface-sunken-hovered)}.shell-layout__header-tool.sc-swirl-shell-layout:active{background-color:var(--s-surface-sunken-pressed)}.shell-layout__header-tool.sc-swirl-shell-layout:focus{outline:none}.shell-layout__header-tool.sc-swirl-shell-layout:focus-visible{box-shadow:0 0 0 0.125rem var(--s-focus-default)}.shell-layout__header-tool.sc-swirl-shell-layout swirl-badge.sc-swirl-shell-layout{--swirl-badge-border-color:var(--s-surface-sunken-default);position:absolute;right:0;bottom:0;transform:translate3d(0.1875rem, 0, 0)}.shell-layout__sidebar-toggle.sc-swirl-shell-layout{display:none}@media (min-width: 992px){.shell-layout__sidebar-toggle.sc-swirl-shell-layout{display:block}}.shell-layout__navigation-toggle.sc-swirl-shell-layout:hover swirl-icon-menu.sc-swirl-shell-layout{display:none}.shell-layout__navigation-toggle.sc-swirl-shell-layout:hover swirl-icon-double-arrow-left.sc-swirl-shell-layout{display:inline-flex}.shell-layout__navigation-toggle.sc-swirl-shell-layout swirl-icon-double-arrow-right.sc-swirl-shell-layout,.shell-layout__navigation-toggle.sc-swirl-shell-layout swirl-icon-double-arrow-left.sc-swirl-shell-layout{display:none}.shell-layout__nav.sc-swirl-shell-layout{position:fixed;z-index:9;top:0;bottom:0;left:0;overflow:auto;width:100%;max-width:18.75rem;color:var(--swirl-shell-text-color);background-color:var(--s-surface-overlay-default);transition:transform 0.2s, box-shadow 0.2s;transform:translate3d(-100%, 0, 0);grid-area:nav}@media (min-width: 992px){.shell-layout__nav.sc-swirl-shell-layout{position:static;max-width:none;padding-top:0;padding-right:var(--s-space-4);padding-bottom:var(--s-space-8);padding-left:var(--s-space-12);background-color:var(--swirl-shell-background);transform:none;box-shadow:none;inset:auto}}.shell-layout__mobile-header.sc-swirl-shell-layout{display:flex;min-height:3.5rem;margin-bottom:var(--s-space-8);padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);justify-content:space-between;align-items:center;border-bottom:0.0625rem solid var(--s-border-default)}.shell-layout__mobile-header.sc-swirl-shell-layout-s>img{max-height:1.75rem}.shell-layout__mobile-header.sc-swirl-shell-layout .shell-layout__header-tool.sc-swirl-shell-layout{background-color:var(--s-surface-overlay-default)}.shell-layout__mobile-header.sc-swirl-shell-layout .shell-layout__header-tool.sc-swirl-shell-layout:hover{background-color:var(--s-surface-overlay-hovered)}.shell-layout__mobile-header.sc-swirl-shell-layout .shell-layout__header-tool.sc-swirl-shell-layout:active{background-color:var(--s-surface-overlay-pressed)}@media (min-width: 992px){.shell-layout__mobile-header.sc-swirl-shell-layout{display:none}}.shell-layout__mobile-header-tools.sc-swirl-shell-layout{display:flex;justify-content:flex-end;align-items:center;gap:var(--s-space-8)}.shell-layout__nav-body.sc-swirl-shell-layout{padding:var(--s-space-8)}.shell-layout__nav-body.sc-swirl-shell-layout-s ul{margin:0;padding:0;list-style:none}.shell-layout__nav-body.sc-swirl-shell-layout-s li{display:flex}@media (min-width: 992px){.shell-layout__nav-body.sc-swirl-shell-layout{padding:0}}.shell-layout__mobile-nav-backdrop.sc-swirl-shell-layout{position:fixed;z-index:8;display:none;background-color:rgba(0, 0, 0, 0.25);animation:shell-layout-backdrop-fade-in 0.2s;inset:0}.shell-layout__main.sc-swirl-shell-layout{overflow:hidden;grid-area:main}@media (min-width: 992px){.shell-layout__main.sc-swirl-shell-layout{width:calc(100% + var(--s-space-8));border:0.0625rem solid var(--s-border-default);border-radius:var(--s-border-radius-sm)}}.shell-layout__sidebar.sc-swirl-shell-layout{position:relative;display:none;grid-area:sidebar}@media (min-width: 992px){.shell-layout__sidebar.sc-swirl-shell-layout{display:block}}@media (min-width: 1440px){.shell-layout__sidebar.sc-swirl-shell-layout{overflow:hidden}}.shell-layout__sidebar-body.sc-swirl-shell-layout{z-index:1;display:flex;width:var(--swirl-shell-sidebar-width);height:100%;border-radius:var(--s-border-radius-sm);background-color:var(--s-background-default);flex-direction:column}@media (min-width: 992px){.shell-layout__sidebar-body.sc-swirl-shell-layout{position:absolute;top:0;right:0;bottom:0;transition:transform 0.2s;transform:translate3d(calc(100% + var(--s-space-24)), 0, 0);box-shadow:var(--s-shadow-level-3)}}@media (min-width: 1440px){.shell-layout__sidebar-body.sc-swirl-shell-layout{position:relative;transform:none;box-shadow:none;inset:auto}}.shell-layout__sidebar-app-bar.sc-swirl-shell-layout{flex-grow:0;flex-shrink:0;border-bottom:var(--s-border-width-default) solid var(--s-border-default)}.shell-layout__sidebar-content.sc-swirl-shell-layout{overflow:auto;flex-grow:1}@keyframes shell-layout-backdrop-fade-in{from{opacity:0}to{opacity:1}}";
10
10
 
11
+ const NAVIGATION_COLLAPSE_STORAGE_KEY = "SWIRL_SHELL_NAVIGATION_COLLAPSE_STATE";
12
+ const SIDEBAR_STORAGE_KEY = "SWIRL_SHELL_SIDEBAR_STATE";
11
13
  const SwirlShellLayout = class {
12
14
  constructor(hostRef) {
13
15
  index.registerInstance(this, hostRef);
14
- this.desktopMediaQuery = utils.getDesktopMediaQuery();
15
- this.desktopMediaQueryHandler = (event) => {
16
- if (event.matches) {
17
- this.expandLeftSidebar();
18
- }
19
- else {
20
- this.collapseLeftSidebar();
21
- }
16
+ this.sidebarToggleClick = index.createEvent(this, "sidebarToggleClick", 7);
17
+ this.skipLinkClick = index.createEvent(this, "skipLinkClick", 7);
18
+ this.onBrowserBackClick = () => {
19
+ history.back();
22
20
  };
23
- this.collapseLeftSidebar = () => {
24
- this.collapsedSidebar = true;
25
- this.collapsing = true;
26
- setTimeout(() => {
27
- this.collapsing = false;
28
- // Some browsers don't update the hovered state of an element correctly,
29
- // if the element was moved and is no longer underneath the cursor.
30
- // https://bugs.chromium.org/p/chromium/issues/detail?id=276329
31
- this.sidebarHovered = false;
32
- }, 200);
33
- };
34
- this.expandLeftSidebar = () => {
35
- if (this.hideSidebar) {
36
- return;
37
- }
38
- this.collapsedSidebar = false;
39
- };
40
- this.toggleSidebar = () => {
41
- if (this.collapsedSidebar) {
42
- this.expandLeftSidebar();
43
- }
44
- else {
45
- this.collapseLeftSidebar();
46
- }
47
- };
48
- this.onBackdropClick = () => {
49
- if (!this.collapsedSidebar) {
50
- this.collapseLeftSidebar();
51
- }
21
+ this.onBrowserForwardClick = () => {
22
+ history.forward();
52
23
  };
53
- this.onSidebarClick = () => {
54
- if (this.collapsedSidebar) {
55
- document.activeElement?.blur();
56
- utils.getActiveElement()?.blur();
57
- }
24
+ this.onNavigationToggleClick = () => {
25
+ this.navigationCollapsed = !this.navigationCollapsed;
58
26
  };
59
- this.onSidebarMouseEnter = () => {
60
- this.sidebarHovered = true;
27
+ this.onNavigationClick = () => {
28
+ this.hideMobileNavigation();
61
29
  };
62
- this.onSidebarMouseLeave = () => {
63
- this.sidebarHovered = false;
64
- };
65
- this.hideSidebar = undefined;
66
- this.mainNavigationLabel = "Main";
30
+ this.brandedHeader = undefined;
31
+ this.browserBackButtonLabel = "Navigate back";
32
+ this.browserForwardButtonLabel = "Navigate forward";
33
+ this.hideMobileNavigationButtonLabel = "Close navigation";
34
+ this.navigationLabel = "Main";
35
+ this.navigationToggleLabel = "Toggle navigation";
36
+ this.sidebarActive = undefined;
37
+ this.sidebarToggleBadge = undefined;
38
+ this.sidebarToggleBadgeAriaLabel = undefined;
39
+ this.sidebarToggleIcon = "notifications";
67
40
  this.sidebarToggleLabel = "Toggle sidebar";
68
- this.collapsedSidebar = undefined;
69
- this.collapsing = undefined;
70
- this.sidebarHovered = undefined;
41
+ this.skipLinkLabel = "Skip to main content";
42
+ this.mobileNavigationActive = undefined;
43
+ this.navigationCollapsed = undefined;
71
44
  }
72
45
  componentWillLoad() {
73
- if (!this.desktopMediaQuery.matches) {
74
- this.collapseLeftSidebar();
46
+ const restoredSidebarState = localStorage.getItem(SIDEBAR_STORAGE_KEY) === "true";
47
+ this.sidebarActive =
48
+ this.sidebarActive === undefined
49
+ ? restoredSidebarState
50
+ : this.sidebarActive;
51
+ const restoredNavigationCollapseState = localStorage.getItem(NAVIGATION_COLLAPSE_STORAGE_KEY) === "true";
52
+ this.navigationCollapsed = restoredNavigationCollapseState;
53
+ }
54
+ componentDidLoad() {
55
+ this.focusTrap = focusTrap_esm.createFocusTrap(this.navElement, {
56
+ allowOutsideClick: true,
57
+ tabbableOptions: {
58
+ getShadowRoot: (node) => {
59
+ return node.shadowRoot;
60
+ },
61
+ },
62
+ });
63
+ }
64
+ componentDidRender() {
65
+ this.focusTrap?.updateContainerElements(this.navElement);
66
+ }
67
+ disconnectedCallback() {
68
+ this.focusTrap?.deactivate();
69
+ }
70
+ onWindowKeyDown(event) {
71
+ if (event.key === "Escape" && this.mobileNavigationActive) {
72
+ this.hideMobileNavigation();
73
+ }
74
+ }
75
+ watchMobileNavigationState() {
76
+ if (this.mobileNavigationActive) {
77
+ // wait for animation
78
+ setTimeout(() => {
79
+ this.focusTrap.activate();
80
+ }, 200);
75
81
  }
76
- this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
82
+ else {
83
+ this.focusTrap.deactivate();
84
+ }
85
+ }
86
+ watchNavigationCollapsed() {
87
+ localStorage.setItem(NAVIGATION_COLLAPSE_STORAGE_KEY, String(this.navigationCollapsed));
88
+ }
89
+ watchSidebarActive() {
90
+ localStorage.setItem(SIDEBAR_STORAGE_KEY, String(this.sidebarActive));
77
91
  }
78
92
  /**
79
- * Collapse the left sidebar.
93
+ * Opens the mobile navigation.
80
94
  */
81
- async collapseSidebar() {
82
- this.collapseLeftSidebar();
95
+ async showMobileNavigation() {
96
+ this.mobileNavigationActive = true;
83
97
  }
84
98
  /**
85
- * Extend the left sidebar.
99
+ * Hides the mobile navigation.
86
100
  */
87
- async extendSidebar() {
88
- this.expandLeftSidebar();
101
+ async hideMobileNavigation() {
102
+ this.mobileNavigationActive = false;
89
103
  }
90
104
  render() {
91
105
  const className = index$1.classnames("shell-layout", {
92
- "shell-layout--collapsed-sidebar": this.collapsedSidebar,
93
- "shell-layout--collapsing": this.collapsing,
94
- "shell-layout--hide-sidebar": this.hideSidebar,
95
- });
96
- const sidebarWrapperClassName = index$1.classnames("shell-layout__sidebar-wrapper", {
97
- "shell-layout__sidebar-wrapper--hovered": this.sidebarHovered,
98
- });
99
- const backdropClassName = index$1.classnames("shell-layout__backdrop", {
100
- "shell-layout__backdrop--fading": this.collapsing,
106
+ "shell-layout--branded-header": this.brandedHeader,
107
+ "shell-layout--mobile-navigation-active": this.mobileNavigationActive,
108
+ "shell-layout--navigation-collapsed": this.navigationCollapsed,
109
+ "shell-layout--sidebar-active": this.sidebarActive,
101
110
  });
102
- return (index.h(index.Host, null, index.h("div", { class: className }, index.h("div", { class: "shell-layout__banner" }, index.h("slot", { name: "banner" })), index.h("div", { class: sidebarWrapperClassName, onClick: this.onSidebarClick, onMouseEnter: this.onSidebarMouseEnter, onMouseLeave: this.onSidebarMouseLeave }, !this.hideSidebar && (index.h("div", { class: "shell-layout__sidebar" }, index.h("header", { class: "shell-layout__header" }, index.h("div", { class: "shell-layout__logo-bar" }, index.h("div", { class: "shell-layout__expanded-logo" }, index.h("slot", { name: "logo-expanded" })), index.h("div", { class: "shell-layout__collapsed-logo" }, index.h("slot", { name: "logo-collapsed" })), index.h("div", { class: "shell-layout__toggle" }, index.h("swirl-button", { swirlAriaExpanded: String(!this.collapsedSidebar), hideLabel: true, icon: this.collapsedSidebar
103
- ? "<swirl-icon-double-arrow-right></swirl-icon-double-arrow-right>"
104
- : "<swirl-icon-double-arrow-left></swirl-icon-double-arrow-left>", label: this.sidebarToggleLabel, onClick: this.toggleSidebar }))), index.h("div", { class: "shell-layout__tools" }, index.h("slot", { name: "tools" }))), index.h("nav", { "aria-label": this.mainNavigationLabel, class: "shell-layout__main-navigation" }, index.h("slot", { name: "main-navigation" }))))), index.h("main", { class: "shell-layout__main" }, index.h("slot", { name: "main" })), (!this.collapsedSidebar || this.collapsing) && (index.h("div", { class: backdropClassName, onClick: this.onBackdropClick })))));
111
+ return (index.h(index.Host, null, index.h("div", { class: className }, index.h("header", { class: "shell-layout__header", "data-tauri-drag-region": "true" }, index.h("button", { class: "shell-layout__skip-link", onClick: this.skipLinkClick.emit, type: "button" }, this.skipLinkLabel), index.h("div", { class: "shell-layout__header-left" }, index.h("button", { class: "shell-layout__header-tool shell-layout__navigation-toggle", onClick: this.onNavigationToggleClick, type: "button" }, index.h("swirl-icon-menu", { size: 20 }), index.h("swirl-icon-double-arrow-left", { size: 20 }), index.h("swirl-icon-double-arrow-right", { size: 20 }), index.h("swirl-visually-hidden", null, this.navigationToggleLabel)), index.h("button", { class: "shell-layout__header-tool", onClick: this.onBrowserBackClick, type: "button" }, index.h("swirl-icon-arrow-back", { size: 20 }), index.h("swirl-visually-hidden", null, this.browserBackButtonLabel)), index.h("button", { class: "shell-layout__header-tool", onClick: this.onBrowserForwardClick, type: "button" }, index.h("swirl-icon-arrow-forward", { size: 20 }), index.h("swirl-visually-hidden", null, this.browserForwardButtonLabel))), index.h("div", { class: "shell-layout__logo" }, index.h("slot", { name: "logo" })), index.h("div", { class: "shell-layout__header-right" }, index.h("button", { class: "shell-layout__header-tool shell-layout__sidebar-toggle", onClick: this.sidebarToggleClick.emit, type: "button" }, index.h("swirl-icon", { glyph: this.sidebarToggleIcon, size: 20 }), index.h("swirl-visually-hidden", null, this.sidebarToggleLabel), this.sidebarToggleBadge && (index.h("swirl-badge", { "aria-label": this.sidebarToggleBadgeAriaLabel, label: this.sidebarToggleBadge, size: "xs" }))), index.h("slot", { name: "header-tools" }))), index.h("div", { class: "shell-layout__mobile-nav-backdrop", onClick: this.onNavigationClick }), index.h("nav", { "aria-labelledby": "main-navigation-label", class: "shell-layout__nav", onClick: this.onNavigationClick, ref: (el) => (this.navElement = el) }, index.h("div", { class: "shell-layout__mobile-header" }, index.h("slot", { name: "mobile-logo" }), index.h("div", { class: "shell-layout__mobile-header-tools" }, index.h("slot", { name: "mobile-header-tools" }), index.h("button", { class: "shell-layout__header-tool", type: "button" }, index.h("swirl-icon-double-arrow-left", { size: 20 }), index.h("swirl-visually-hidden", null, this.hideMobileNavigationButtonLabel)))), index.h("div", { class: "shell-layout__nav-body" }, index.h("swirl-visually-hidden", null, index.h("span", { id: "main-navigation-label" }, this.navigationLabel)), index.h("slot", { name: "nav" }))), index.h("main", { class: "shell-layout__main", id: "main-content" }, index.h("slot", null)), index.h("aside", { class: "shell-layout__sidebar" }, index.h("div", { class: "shell-layout__sidebar-body" }, index.h("div", { class: "shell-layout__sidebar-app-bar" }, index.h("slot", { name: "sidebar-app-bar" })), index.h("div", { class: "shell-layout__sidebar-content" }, index.h("slot", { name: "sidebar" })))))));
105
112
  }
113
+ static get watchers() { return {
114
+ "mobileNavigationActive": ["watchMobileNavigationState"],
115
+ "navigationCollapsed": ["watchNavigationCollapsed"],
116
+ "sidebarActive": ["watchSidebarActive"]
117
+ }; }
106
118
  };
107
119
  SwirlShellLayout.style = swirlShellLayoutCss;
108
120
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-506fe4ea.js');
6
6
  const index$1 = require('./index-2ddd0598.js');
7
7
 
8
- const swirlShellNavigationItemCss = "/**\n* seems the container query does not work as expected\n*/\n\n:host {\n container-type: inline-size;\n position: relative;\n display: inline-flex;\n width: 100%;\n height: 3.5rem;\n padding-right: var(--s-space-12);\n padding-left: var(--s-space-12);\n flex-shrink: 0;\n justify-content: flex-start;\n align-items: center;\n color: var(--s-text-default);\n background-color: var(--s-background-default);\n font-size: var(--s-font-size-sm);\n font-weight: var(--s-font-weight-medium);\n line-height: var(--s-line-height-sm);\n cursor: pointer;\n gap: var(--s-space-12);\n}\n\n:host(:hover) {\n background-color: var(--s-background-hovered);\n }\n\n:host(:active) {\n background-color: var(--s-background-pressed);\n color: var(--s-text-highlight);\n }\n\n:host(:focus) {\n outline: none;\n }\n\n:host(:focus-visible) .shell-navigation-item__label {\n border-radius: var(--s-border-radius-xs);\n box-shadow: 0 0 0 0.125rem var(--s-focus-default);\n }\n\n:host(.shell-navigation-item--active) {\n color: var(--s-text-highlight);\n background-color: var(--s-surface-raised-default);\n }\n\n:host(.shell-navigation-item--active:hover) {\n background-color: var(--s-surface-raised-hovered);\n }\n\n:host(.shell-navigation-item--active:active) {\n background-color: var(--s-surface-raised-pressed);\n color: var(--s-text-highlight);\n }\n\n:host * {\n box-sizing: border-box;\n }\n\n:host:before {\n content: \"\";\n display: none;\n position: absolute;\n left: 0;\n height: 2.5rem;\n width: 4px;\n background-color: var(--s-icon-highlight);\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n\n:host(.shell-navigation-item--active):before {\n display: block;\n}\n\n.shell-navigation-item__icon {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n min-width: 2.5rem;\n min-height: 2.5rem;\n}\n\n.shell-navigation-item__label {\n overflow: hidden;\n min-width: 0;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n@container (max-width: 4rem) {\n .shell-navigation-item__label {\n display: none;\n }\n\n .shell-navigation-item__badge {\n position: absolute;\n bottom: 0;\n right: var(--s-space-4);\n }\n}\n\n@container (min-width: 14rem) {\n .shell-navigation-item__badge {\n margin-left: auto;\n padding-right: var(--s-space-4);\n }\n}\n";
8
+ const swirlShellNavigationItemCss = "/**\n* seems the container query does not work as expected\n*/\n\n:host {\n position: relative;\n display: inline-flex;\n width: 100%;\n height: 2.75rem;\n padding: var(--s-space-12);\n flex-shrink: 0;\n justify-content: flex-start;\n align-items: center;\n border-radius: var(--s-border-radius-sm);\n background-color: var(--s-surface-overlay-default);\n font-size: var(--s-font-size-sm);\n font-weight: var(--s-font-weight-medium);\n line-height: var(--s-line-height-sm);\n cursor: pointer;\n container-type: inline-size;\n gap: var(--s-space-16);\n}\n\n:host(:hover) {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n:host(:hover) .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n:host(:active) {\n background-color: var(--s-surface-sunken-pressed);\n }\n\n:host(:active) .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-pressed);\n }\n\n:host(:focus) {\n outline: none;\n }\n\n:host(:focus-visible) {\n z-index: 1;\n box-shadow: 0 0 0 0.125rem var(--s-focus-default);\n }\n\n:host(.shell-navigation-item--active) {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n:host(.shell-navigation-item--active) .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n:host(.shell-navigation-item--active:hover) {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n:host(.shell-navigation-item--active:hover) .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n:host(.shell-navigation-item--active:active) {\n background-color: var(--s-surface-sunken-pressed);\n }\n\n:host(.shell-navigation-item--active:active) .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-pressed);\n }\n\n:host * {\n box-sizing: border-box;\n }\n\n@media (min-width: 992px) {\n\n:host {\n background-color: var(--s-surface-sunken-default)\n}\n }\n\n.shell-navigation-item__icon {\n display: inline-flex;\n min-width: 1.25rem;\n min-height: 1.25rem;\n justify-content: center;\n align-items: center;\n}\n\n.shell-navigation-item__label {\n overflow: hidden;\n min-width: 0;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.shell-navigation-item__badge {\n --swirl-badge-border-color: var(--swirl-shell-background);\n}\n\n@container (max-width: 4rem) {\n .shell-navigation-item__label {\n display: none;\n }\n\n .shell-navigation-item__badge {\n position: absolute;\n right: var(--s-space-4);\n bottom: 0;\n }\n}\n\n@container (min-width: 14rem) {\n .shell-navigation-item__badge {\n margin-left: auto;\n padding-right: var(--s-space-4);\n }\n}\n";
9
9
 
10
10
  const SwirlShellNavigationItem = class {
11
11
  constructor(hostRef) {
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-506fe4ea.js');
6
6
 
7
- const swirlVisuallyHiddenCss = ":host{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;word-wrap:normal;clip:rect(0, 0, 0, 0)}";
7
+ const swirlVisuallyHiddenCss = ".sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;word-wrap:normal;clip:rect(0, 0, 0, 0)}";
8
8
 
9
9
  const SwirlVisuallyHidden = class {
10
10
  constructor(hostRef) {