@getflip/swirl-components 0.116.0 → 0.118.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 (118) hide show
  1. package/components.json +395 -69
  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 +4 -2
  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-icon-arrow-back_5.cjs.entry.js +87 -0
  11. package/dist/cjs/swirl-icon-check-small_3.cjs.entry.js +7 -2
  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-shell-layout.cjs.entry.js +87 -75
  15. package/dist/cjs/swirl-shell-navigation-item.cjs.entry.js +1 -1
  16. package/dist/cjs/swirl-visually-hidden.cjs.entry.js +1 -1
  17. package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
  18. package/dist/collection/collection-manifest.json +1 -0
  19. package/dist/collection/components/swirl-app-bar/swirl-app-bar.js +20 -1
  20. package/dist/collection/components/swirl-app-icon/swirl-app-icon.css +3 -22
  21. package/dist/collection/components/swirl-app-icon/swirl-app-icon.js +0 -20
  22. package/dist/collection/components/swirl-app-layout/swirl-app-layout.css +54 -4
  23. package/dist/collection/components/swirl-app-layout/swirl-app-layout.js +4 -1
  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-icon/icons/swirl-icon-dock-left.js +52 -0
  27. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.css +26 -4
  28. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.js +23 -1
  29. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.spec.js +6 -3
  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 +4 -2
  43. package/dist/components/swirl-badge2.js +1 -1
  44. package/dist/components/swirl-icon-arrow-back.js +1 -35
  45. package/dist/{esm/swirl-icon-arrow-back.entry.js → components/swirl-icon-arrow-back2.js} +26 -8
  46. package/dist/components/swirl-icon-arrow-forward.js +1 -35
  47. package/dist/{esm/swirl-icon-arrow-forward.entry.js → components/swirl-icon-arrow-forward2.js} +26 -8
  48. package/dist/components/swirl-icon-dock-left.d.ts +11 -0
  49. package/dist/components/swirl-icon-dock-left.js +40 -0
  50. package/dist/components/swirl-icon-double-arrow-left.js +1 -35
  51. package/dist/{esm/swirl-icon-double-arrow-left.entry.js → components/swirl-icon-double-arrow-left2.js} +26 -8
  52. package/dist/components/swirl-icon-double-arrow-right.js +1 -35
  53. package/dist/{esm/swirl-icon-double-arrow-right.entry.js → components/swirl-icon-double-arrow-right2.js} +26 -8
  54. package/dist/components/swirl-icon-menu.js +1 -35
  55. package/dist/{esm/swirl-icon-menu.entry.js → components/swirl-icon-menu2.js} +26 -8
  56. package/dist/components/swirl-modal.js +1 -1142
  57. package/dist/components/swirl-option-list-item2.js +8 -2
  58. package/dist/components/swirl-shell-layout.js +150 -89
  59. package/dist/components/swirl-shell-navigation-item.js +1 -1
  60. package/dist/components/swirl-visually-hidden2.js +2 -3
  61. package/dist/esm/focus-trap.esm-37cd2d2b.js +1143 -0
  62. package/dist/esm/index-99d0060d.js +14 -26
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/swirl-app-bar.entry.js +2 -1
  65. package/dist/esm/swirl-app-icon.entry.js +1 -3
  66. package/dist/esm/swirl-app-layout_6.entry.js +4 -2
  67. package/dist/esm/swirl-badge.entry.js +1 -1
  68. package/dist/esm/swirl-components.js +1 -1
  69. package/dist/esm/swirl-icon-arrow-back_5.entry.js +79 -0
  70. package/dist/esm/swirl-icon-check-small_3.entry.js +7 -2
  71. package/dist/esm/swirl-icon-dock-left.entry.js +19 -0
  72. package/dist/esm/swirl-modal.entry.js +1 -1142
  73. package/dist/esm/swirl-shell-layout.entry.js +88 -76
  74. package/dist/esm/swirl-shell-navigation-item.entry.js +1 -1
  75. package/dist/esm/swirl-visually-hidden.entry.js +1 -1
  76. package/dist/swirl-components/p-08fd60a5.entry.js +1 -0
  77. package/dist/swirl-components/p-11c6c9ba.entry.js +1 -0
  78. package/dist/swirl-components/p-25b4973d.entry.js +1 -0
  79. package/dist/swirl-components/p-262771e5.entry.js +1 -0
  80. package/dist/swirl-components/p-3795fbb4.entry.js +1 -0
  81. package/dist/swirl-components/p-40ee5f22.entry.js +1 -0
  82. package/dist/swirl-components/p-488d2a7d.entry.js +1 -0
  83. package/dist/swirl-components/p-4a69e7f3.entry.js +1 -0
  84. package/dist/swirl-components/p-68936168.entry.js +1 -0
  85. package/dist/swirl-components/p-76c36ee9.entry.js +1 -0
  86. package/dist/swirl-components/p-7c4a4b66.entry.js +1 -0
  87. package/dist/swirl-components/p-c2e1dfdb.js +10 -0
  88. package/dist/swirl-components/swirl-components.esm.js +1 -1
  89. package/dist/types/components/swirl-app-bar/swirl-app-bar.d.ts +1 -0
  90. package/dist/types/components/swirl-app-icon/swirl-app-icon.d.ts +0 -1
  91. package/dist/types/components/swirl-app-layout/swirl-app-layout.d.ts +1 -0
  92. package/dist/types/components/swirl-badge/swirl-badge.d.ts +1 -1
  93. package/dist/types/components/swirl-icon/icons/swirl-icon-dock-left.d.ts +5 -0
  94. package/dist/types/components/swirl-option-list-item/swirl-option-list-item.d.ts +2 -0
  95. package/dist/types/components/swirl-shell-layout/swirl-shell-layout.d.ts +42 -25
  96. package/dist/types/components.d.ts +52 -11
  97. package/icons.json +1 -1
  98. package/package.json +2 -2
  99. package/vscode-data.json +62 -6
  100. package/dist/cjs/swirl-icon-arrow-back.cjs.entry.js +0 -23
  101. package/dist/cjs/swirl-icon-arrow-forward.cjs.entry.js +0 -23
  102. package/dist/cjs/swirl-icon-double-arrow-left.cjs.entry.js +0 -23
  103. package/dist/cjs/swirl-icon-double-arrow-right.cjs.entry.js +0 -23
  104. package/dist/cjs/swirl-icon-menu.cjs.entry.js +0 -23
  105. package/dist/swirl-components/p-178d041a.entry.js +0 -1
  106. package/dist/swirl-components/p-3a2abee9.entry.js +0 -1
  107. package/dist/swirl-components/p-441c8210.entry.js +0 -1
  108. package/dist/swirl-components/p-4a84e63d.entry.js +0 -1
  109. package/dist/swirl-components/p-54e4ff0b.entry.js +0 -1
  110. package/dist/swirl-components/p-5da3a9a8.entry.js +0 -1
  111. package/dist/swirl-components/p-645a878c.entry.js +0 -1
  112. package/dist/swirl-components/p-79be22ea.entry.js +0 -10
  113. package/dist/swirl-components/p-97668c59.entry.js +0 -1
  114. package/dist/swirl-components/p-be2cf7ee.entry.js +0 -1
  115. package/dist/swirl-components/p-c4d4a99d.entry.js +0 -1
  116. package/dist/swirl-components/p-ca78767e.entry.js +0 -1
  117. package/dist/swirl-components/p-d2fc7935.entry.js +0 -1
  118. package/dist/swirl-components/p-f83a0b0f.entry.js +0 -1
@@ -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) {